diff --git a/kie-wb-common-dmn/.gitignore b/kie-wb-common-dmn/.gitignore index e9277639889..b99d5feafbf 100644 --- a/kie-wb-common-dmn/.gitignore +++ b/kie-wb-common-dmn/.gitignore @@ -13,10 +13,6 @@ # Repository wide ignore mac DS_Store files .DS_Store -#Ignore DMN's kogito related work on branch DROOLS-3727 -#Added to simplify switching branches and avoid accidentially committing unrelated work! -/kie-wb-common-dmn-webapp-kogito-marshaller -/kie-wb-common-dmn-webapp-kogito-runtime -/kie-wb-common-dmn-webapp-kogito-testing -/kie-wb-common-dmn-webapp-standalone +#This is on master. Ignore to make switching branches easier +/kie-wb-common-dmn-webapp diff --git a/kie-wb-common-dmn/README.md b/kie-wb-common-dmn/README.md new file mode 100644 index 00000000000..842d8c91d9f --- /dev/null +++ b/kie-wb-common-dmn/README.md @@ -0,0 +1,64 @@ +Graphical DMN modeling tool +=========================== + +This module contains various children for different purposes. + +1) `kie-wb-common-dmn-api` + +Common API and UI model used by Business Central and _kogito_. + +2) `kie-wb-common-dmn-backend` + +Server-side implementation of services relating to marshalling, imports and validation +used exclusively by Business Central and the `kie-wb-common-webapp-standalone` module. + +3) `kie-wb-common-dmn-client` + +Common client-side code for the _core_ editor used by Business Central and _kogito_. + +4) `kie-wb-common-dmn-project-api` + +API specific to integration with Business Central. + +5) `kie-wb-common-dmn-project-client` + +Client-side code specific to the integration with Business Central. + +6) `kie-wb-common-dmn-webapp-common` + +Client-side code common to the `kie-wb-common-webapp-standalone` and `kie-wb-common-webapp-kogito-testing` +modules. Includes _docks_ and diagram _navigator_. This code is not used by Business Central. + +7) `kie-wb-common-dmn-webapp-kogito-common` + +Substitute implementations of services in `kie-wb-common-dmn-backend` for _kogito_ client-side use. + +8) `kie-wb-common-dmn-webapp-kogito-marshaller` + +Client-side marshaller for _kogito_. + +9) `kie-wb-common-dmn-webapp-kogito-runtime` + +Webapp targeting _kogito_ integration with VSCode etc. No decorations. + +10) `kie-wb-common-dmn-webapp-kogito-testing` + +Webapp used for development of _kogito_ decorated with a diagram _navigator_ to emulate integration with VSCode etc. + +11) `kie-wb-common-dmn-webapp-standalone` + +Webapp used for development of Business Central integration. + + +The _kogito_ modules are isolated by the `kogito` Maven profile. In order to compile and run a _kogito_ related +webapp the following steps need to be adhered to. + +1) Clone https://github.com/kiegroup/droolsjbpm-build-bootstrap/ and build the `DROOLS-3727` branch. + +2) Clone https://github.com/highsource/jsonix and build the `master` branch. Ignore the failure of the compilation of some sub-modules.. enough is compiled for our use. + +3) Clone https://github.com/kiegroup/gwt-jsonix-marshallers and build the `master` branch. + +4) Compile `kie-wb-common` using the `kogito` profile; e.g. `mvn clean install -Pkogito` + +5) Run one of the _kogito_ webapps using `mvn clean process-resources gwt:run` \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-api/pom.xml b/kie-wb-common-dmn/kie-wb-common-dmn-api/pom.xml index 327dc75964d..70fbb8b9260 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-api/pom.xml +++ b/kie-wb-common-dmn/kie-wb-common-dmn-api/pom.xml @@ -40,33 +40,18 @@ validation-api - - org.hibernate - hibernate-validator - - org.kie.workbench.stunner kie-wb-common-stunner-core-api - - org.kie.workbench.stunner - kie-wb-common-stunner-client-api - - org.kie.workbench.stunner kie-wb-common-stunner-core-common - - org.kie.workbench.stunner - kie-wb-common-stunner-shapes-api - provided - - + org.kie.workbench.stunner kie-wb-common-stunner-processors @@ -83,13 +68,6 @@ kie-wb-common-stunner-forms-api - - - com.google.gwt - gwt-user - provided - - org.kie.workbench.forms @@ -101,6 +79,7 @@ kie-wb-common-forms-adf-base + org.kie.workbench.forms kie-wb-common-forms-adf-processors @@ -149,11 +128,6 @@ uberfire-api - - org.uberfire - uberfire-commons - - org.uberfire uberfire-project-api @@ -170,6 +144,18 @@ kie-dmn-model + + + org.powermock + powermock-api-mockito + test + + + + com.google.gwt + gwt-user + test + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/definition/model/DMNElement.java b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/definition/model/DMNElement.java index f29d0e4df0d..c558b332068 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/definition/model/DMNElement.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/definition/model/DMNElement.java @@ -77,13 +77,12 @@ public void setExtensionElements(final ExtensionElements extensionElements) { this.extensionElements = extensionElements; } - //TODO {manstis} The DMN model uses Object not String @Portable public static class ExtensionElements extends DMNModelInstrumentedBase { - protected List any; + protected List any; - public List getAny() { + public List getAny() { if (any == null) { any = new ArrayList<>(); } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/definition/model/DMNModelInstrumentedBase.java b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/definition/model/DMNModelInstrumentedBase.java index 50a626ca204..851166b6c0c 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/definition/model/DMNModelInstrumentedBase.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/definition/model/DMNModelInstrumentedBase.java @@ -109,10 +109,10 @@ public Optional getPrefixForNamespaceURI(final String namespaceURI) { public String getDefaultNamespace() { if (nsContext != null && nsContext.containsKey("")) { return nsContext.entrySet().stream() - .filter(kv -> Objects.equals(kv.getKey(), "")) - .findFirst() - .map(Map.Entry::getValue) - .get(); + .filter(kv -> Objects.equals(kv.getKey(), "")) + .findFirst() + .map(Map.Entry::getValue) + .get(); } if (this.parent != null) { return parent.getDefaultNamespace(); diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/definition/model/FunctionDefinition.java b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/definition/model/FunctionDefinition.java index f29337e0c03..42d8eb08403 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/definition/model/FunctionDefinition.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/definition/model/FunctionDefinition.java @@ -17,6 +17,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Objects; import org.jboss.errai.common.client.api.annotations.Portable; import org.kie.workbench.common.dmn.api.definition.HasExpression; @@ -148,22 +149,34 @@ public int hashCode() { @Portable public enum Kind { - FEEL("F"), - JAVA("J"), - PMML("P"); + FEEL("F", "FEEL"), + JAVA("J", "Java"), + PMML("P", "PMML"); private final String code; + private final String value; - Kind(final String code) { + Kind(final String code, + final String value) { this.code = code; + this.value = value; } public String code() { return code; } + public static Kind fromValue(final String value) { + for (Kind kind : Kind.values()) { + if (Objects.equals(kind.value, value)) { + return kind; + } + } + throw new IllegalArgumentException("FunctionKind [" + value + "] is not supported."); + } + public static FunctionDefinition.Kind determineFromString(final String code) { - return code == null ? null : (FEEL.code.equals(code) ? FEEL : (JAVA.code.equals(code) ? JAVA : (PMML.code.equals(code) ? PMML : null))); + return code == null ? null : Objects.equals(FEEL.code, code) ? FEEL : (Objects.equals(JAVA.code, code) ? JAVA : (Objects.equals(PMML.code, code) ? PMML : null)); } } } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/factory/DMNDiagramFactory.java b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/factory/DMNDiagramFactory.java index 1b4381295ca..92197752ad9 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/factory/DMNDiagramFactory.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/factory/DMNDiagramFactory.java @@ -20,8 +20,7 @@ import org.kie.workbench.common.stunner.core.factory.diagram.DiagramFactory; import org.kie.workbench.common.stunner.core.graph.Graph; -public interface DMNDiagramFactory - extends DMNFactory, - DiagramFactory> { +public interface DMNDiagramFactory extends DMNFactory, + DiagramFactory> { } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/factory/DMNDiagramFactoryImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/factory/DMNDiagramFactoryImpl.java index eebef0ff0a5..207b19a9aef 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/factory/DMNDiagramFactoryImpl.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/factory/DMNDiagramFactoryImpl.java @@ -18,7 +18,6 @@ import javax.enterprise.context.Dependent; import org.kie.workbench.common.dmn.api.DMNDefinitionSet; -import org.kie.workbench.common.stunner.core.diagram.AbstractDiagram; import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.diagram.DiagramImpl; import org.kie.workbench.common.stunner.core.diagram.Metadata; @@ -41,12 +40,12 @@ public Class getMetadataType() { } @Override - public Diagram doBuild(final String name, - final Metadata metadata, - final Graph graph) { - final AbstractDiagram result = new DiagramImpl(name, - metadata); - result.setGraph(graph); + public Diagram doBuild(final String name, + final Metadata metadata, + final Graph graph) { + final Diagram result = new DiagramImpl(name, + graph, + metadata); return result; } } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNImportTypesHelper.java b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/marshalling/DMNImportTypesHelper.java similarity index 94% rename from kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNImportTypesHelper.java rename to kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/marshalling/DMNImportTypesHelper.java index addf8aa7370..107bc432637 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNImportTypesHelper.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/marshalling/DMNImportTypesHelper.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.workbench.common.dmn.backend.common; +package org.kie.workbench.common.dmn.api.marshalling; import org.uberfire.backend.vfs.Path; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/marshalling/DMNMarshallerImportsHelper.java b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/marshalling/DMNMarshallerImportsHelper.java new file mode 100644 index 00000000000..d3c07a71e61 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/marshalling/DMNMarshallerImportsHelper.java @@ -0,0 +1,103 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.api.marshalling; + +import java.io.InputStream; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.guvnor.common.services.project.model.WorkspaceProject; +import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.uberfire.backend.vfs.Path; + +/** + * This helper provides methods to handle imports into the DMNMarshaller. + */ +public interface DMNMarshallerImportsHelper { + + /** + * This method loads all imported DMN definitions from a list of imports. + * @param metadata represents the metadata from the main DMN model. + * @param imports represent the list of imported files. + * @return a map {@link DEFINITIONS} indexed by {@link IMPORT}s. + */ + Map getImportDefinitions(final Metadata metadata, + final List imports); + + /** + * This method loads all imported PMML documents from a list of imports. + * @param metadata represents the metadata from the main DMN model. + * @param imports represent the list of imported files. + * @return a map {@link PMMLDocumentMetadata} indexed by {@link IMPORT}s. + */ + Map getPMMLDocuments(final Metadata metadata, + final List imports); + + /** + * This method loads {@link String} of all imported XML files from a list of imports. + * @param metadata represents the metadata from the main DMN model. + * @param imports represent the list of imported files. + * @return a map {@link String} indexed by {@link IMPORT}s. + */ + Map getImportXML(final Metadata metadata, + final List imports); + + /** + * This method extract a list of {@link DRGELEMENT}s from the importDefinitions map. + * @param importDefinitions is a map of {@link DEFINITIONS} indexed by {@link IMPORT}. + * @return a list of imported {@link DRGELEMENT}s. + */ + List getImportedDRGElements(final Map importDefinitions); + + /** + * This method extract a list of {@link ITEMDEFINITION} from the importDefinitions map. + * @param importDefinitions is a map of {@link DEFINITIONS} indexed by {@link IMPORT}. + * @return a list of imported {@link ITEMDEFINITION}s. + */ + List getImportedItemDefinitions(final Map importDefinitions); + + /** + * This method finds the list of {@link ITEMDEFINITION}s for a given namespace. + * @param workspaceProject represents the project that will be scanned. + * @param modelName is the value used as the prefix for imported {@link ITEMDEFINITION}s. + * @param namespace is the namespace of the model that provides the list of {@link ITEMDEFINITION}s. + * @return a list of imported {@link ITEMDEFINITION}s. + */ + List getImportedItemDefinitionsByNamespace(final WorkspaceProject workspaceProject, + final String modelName, + final String namespace); + + /** + * This method finds the {@link Path} of DMN model. + * @param metadata represents the metadata from the a DMN model from the scanned project. + * @param modelNamespace represents the namespace of the desired DMN model. + * @param modelName represents the mode name of the desired DMN model. + * @return the {@link Path} of the desired DMN model. + */ + Path getDMNModelPath(final Metadata metadata, + final String modelNamespace, + final String modelName); + + /** + * This method loads the {@link InputStream} from a given {@link org.uberfire.backend.vfs.Path}. + * @param path to be loaded. + * @return the {@link InputStream} when the path is valid, otherwise is returns empty. + */ + Optional loadPath(final Path path); +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNPathsHelper.java b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/marshalling/DMNPathsHelper.java similarity index 97% rename from kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNPathsHelper.java rename to kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/marshalling/DMNPathsHelper.java index 45695bff8da..b9fed0fde5d 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNPathsHelper.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/java/org/kie/workbench/common/dmn/api/marshalling/DMNPathsHelper.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.backend.common; +package org.kie.workbench.common.dmn.api.marshalling; import java.util.List; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/resources/org/kie/workbench/common/dmn/DMNAPI.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/resources/org/kie/workbench/common/dmn/DMNAPI.gwt.xml index c6a0973c62b..286fa5a95f0 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/resources/org/kie/workbench/common/dmn/DMNAPI.gwt.xml +++ b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/main/resources/org/kie/workbench/common/dmn/DMNAPI.gwt.xml @@ -22,7 +22,7 @@ - + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/test/java/org/kie/workbench/common/dmn/api/factory/DMNDiagramFactoryImplTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/test/java/org/kie/workbench/common/dmn/api/factory/DMNDiagramFactoryImplTest.java index 793b33aca53..3c9e656ee28 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-api/src/test/java/org/kie/workbench/common/dmn/api/factory/DMNDiagramFactoryImplTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-api/src/test/java/org/kie/workbench/common/dmn/api/factory/DMNDiagramFactoryImplTest.java @@ -27,7 +27,6 @@ import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.diagram.Metadata; import org.kie.workbench.common.stunner.core.graph.Edge; -import org.kie.workbench.common.stunner.core.graph.Graph; import org.kie.workbench.common.stunner.core.graph.Node; import org.kie.workbench.common.stunner.core.graph.content.Bounds; import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; @@ -77,7 +76,7 @@ private Node newNode(final Object definition) { @Test @SuppressWarnings("unchecked") public void testDefaultNameSpaces() { - final Diagram diagram = factory.build(NAME, metadata, graph); + final Diagram diagram = factory.build(NAME, metadata, graph); //We can safely get the first object on the iterator as we know the graph only contains one node final Node root = (Node) diagram.getGraph().nodes().iterator().next(); @@ -118,7 +117,7 @@ public void testDefaultNameSpaces() { @Test @SuppressWarnings("unchecked") public void testModelName() { - final Diagram diagram = factory.build(NAME, metadata, graph); + final Diagram diagram = factory.build(NAME, metadata, graph); //We can safely get the first object on the iterator as we know the graph only contains one node final Node root = (Node) diagram.getGraph().nodes().iterator().next(); @@ -137,7 +136,7 @@ public void testModelNameWithNonEmptyExistingName() { final Definitions existingDMNDefinitions = existingDMNDiagram.getDefinitions(); existingDMNDefinitions.getName().setValue(EXISTING_NAME); - final Diagram newDiagram = factory.build(NAME, metadata, graph); + final Diagram newDiagram = factory.build(NAME, metadata, graph); final Node newRoot = (Node) newDiagram.getGraph().nodes().iterator().next(); final DMNDiagram newDMNDiagram = (DMNDiagram) newRoot.getContent().getDefinition(); final Definitions newDMNDefinitions = newDMNDiagram.getDefinitions(); diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/pom.xml b/kie-wb-common-dmn/kie-wb-common-dmn-backend/pom.xml index 31b6686d565..cd462f60254 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/pom.xml +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/pom.xml @@ -110,16 +110,6 @@ errai-bus - - org.jboss.errai - errai-config - - - - org.jboss.errai - errai-security-server - - org.uberfire uberfire-commons @@ -150,11 +140,6 @@ kie-dmn-validation - - org.antlr - antlr4-runtime - - org.uberfire uberfire-nio2-api @@ -165,11 +150,6 @@ uberfire-nio2-model - - org.uberfire - uberfire-backend-api - - org.uberfire uberfire-backend-server @@ -185,12 +165,6 @@ uberfire-io - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec - provided - - javax.inject @@ -204,16 +178,6 @@ provided - - org.uberfire - uberfire-commons-editor-backend - - - - org.apache.commons - commons-lang3 - - org.slf4j slf4j-api @@ -263,12 +227,6 @@ test-jar - - org.uberfire - uberfire-testing-utils - test - - org.slf4j slf4j-simple @@ -294,6 +252,18 @@ test + + org.apache.commons + commons-lang3 + test + + + + org.apache.ant + ant + test + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/DMNBackendService.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/DMNBackendService.java index 0ed7b3a4a86..3d84eebfd2f 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/DMNBackendService.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/DMNBackendService.java @@ -33,7 +33,7 @@ protected DMNBackendService() { } @Inject - public DMNBackendService(final DMNMarshaller marshaller, + public DMNBackendService(final DMNMarshallerStandalone marshaller, final DMNDefinitionSetResourceType resourceType) { super(marshaller); this.resourceType = resourceType; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/DMNMarshaller.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/DMNMarshaller.java deleted file mode 100644 index 066e56ff5ec..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/DMNMarshaller.java +++ /dev/null @@ -1,1244 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.backend; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.AbstractMap.SimpleEntry; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.BiConsumer; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import java.util.stream.StreamSupport; - -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.xml.namespace.QName; - -import org.jboss.errai.marshalling.server.ServerMarshalling; -import org.kie.dmn.model.api.Import; -import org.kie.dmn.model.api.dmndi.Bounds; -import org.kie.dmn.model.api.dmndi.Color; -import org.kie.dmn.model.api.dmndi.DMNDecisionServiceDividerLine; -import org.kie.dmn.model.api.dmndi.DMNEdge; -import org.kie.dmn.model.api.dmndi.DMNShape; -import org.kie.dmn.model.api.dmndi.DMNStyle; -import org.kie.dmn.model.api.dmndi.Point; -import org.kie.dmn.model.v1_2.dmndi.DMNDI; -import org.kie.dmn.model.v1_2.dmndi.DiagramElement; -import org.kie.workbench.common.dmn.api.DMNDefinitionSet; -import org.kie.workbench.common.dmn.api.definition.DMNViewDefinition; -import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; -import org.kie.workbench.common.dmn.api.definition.model.Association; -import org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel; -import org.kie.workbench.common.dmn.api.definition.model.DMNDiagram; -import org.kie.workbench.common.dmn.api.definition.model.DMNElement; -import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase; -import org.kie.workbench.common.dmn.api.definition.model.DRGElement; -import org.kie.workbench.common.dmn.api.definition.model.Decision; -import org.kie.workbench.common.dmn.api.definition.model.DecisionService; -import org.kie.workbench.common.dmn.api.definition.model.Definitions; -import org.kie.workbench.common.dmn.api.definition.model.InputData; -import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; -import org.kie.workbench.common.dmn.api.definition.model.KnowledgeSource; -import org.kie.workbench.common.dmn.api.definition.model.TextAnnotation; -import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; -import org.kie.workbench.common.dmn.api.property.background.BackgroundSet; -import org.kie.workbench.common.dmn.api.property.background.BgColour; -import org.kie.workbench.common.dmn.api.property.background.BorderColour; -import org.kie.workbench.common.dmn.api.property.dimensions.Height; -import org.kie.workbench.common.dmn.api.property.dimensions.RectangleDimensionsSet; -import org.kie.workbench.common.dmn.api.property.dimensions.Width; -import org.kie.workbench.common.dmn.api.property.dmn.DecisionServiceDividerLineY; -import org.kie.workbench.common.dmn.api.property.dmn.Description; -import org.kie.workbench.common.dmn.api.property.dmn.Id; -import org.kie.workbench.common.dmn.api.property.font.FontSet; -import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelper; -import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelperImpl; -import org.kie.workbench.common.dmn.backend.definition.v1_1.AssociationConverter; -import org.kie.workbench.common.dmn.backend.definition.v1_1.BusinessKnowledgeModelConverter; -import org.kie.workbench.common.dmn.backend.definition.v1_1.DecisionConverter; -import org.kie.workbench.common.dmn.backend.definition.v1_1.DecisionServiceConverter; -import org.kie.workbench.common.dmn.backend.definition.v1_1.DefinitionsConverter; -import org.kie.workbench.common.dmn.backend.definition.v1_1.InputDataConverter; -import org.kie.workbench.common.dmn.backend.definition.v1_1.ItemDefinitionPropertyConverter; -import org.kie.workbench.common.dmn.backend.definition.v1_1.KnowledgeSourceConverter; -import org.kie.workbench.common.dmn.backend.definition.v1_1.TextAnnotationConverter; -import org.kie.workbench.common.dmn.backend.definition.v1_1.dd.ColorUtils; -import org.kie.workbench.common.dmn.backend.definition.v1_1.dd.ComponentWidths; -import org.kie.workbench.common.dmn.backend.definition.v1_1.dd.ComponentsWidthsExtension; -import org.kie.workbench.common.dmn.backend.definition.v1_1.dd.FontSetPropertyConverter; -import org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils; -import org.kie.workbench.common.forms.adf.definitions.DynamicReadOnly; -import org.kie.workbench.common.stunner.core.api.FactoryManager; -import org.kie.workbench.common.stunner.core.backend.service.XMLEncoderDiagramMetadataMarshaller; -import org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils; -import org.kie.workbench.common.stunner.core.definition.service.DiagramMarshaller; -import org.kie.workbench.common.stunner.core.definition.service.DiagramMetadataMarshaller; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.kie.workbench.common.stunner.core.graph.Edge; -import org.kie.workbench.common.stunner.core.graph.Graph; -import org.kie.workbench.common.stunner.core.graph.Node; -import org.kie.workbench.common.stunner.core.graph.content.Bound; -import org.kie.workbench.common.stunner.core.graph.content.relationship.Child; -import org.kie.workbench.common.stunner.core.graph.content.view.Connection; -import org.kie.workbench.common.stunner.core.graph.content.view.ControlPoint; -import org.kie.workbench.common.stunner.core.graph.content.view.MagnetConnection; -import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; -import org.kie.workbench.common.stunner.core.graph.content.view.View; -import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; -import org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl; -import org.kie.workbench.common.stunner.core.util.DefinitionUtils; -import org.kie.workbench.common.stunner.core.util.StringUtils; -import org.kie.workbench.common.stunner.core.util.UUID; - -import static java.util.Collections.emptyList; -import static java.util.stream.Collectors.toMap; -import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.heightOfShape; -import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.lowerRightBound; -import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.upperLeftBound; -import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.widthOfShape; -import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.xOfBound; -import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.xOfShape; -import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.yOfBound; -import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.yOfShape; -import static org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId; - -@ApplicationScoped -public class DMNMarshaller implements DiagramMarshaller> { - - private static final double CENTRE_TOLERANCE = 1.0; - - private XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller; - private FactoryManager factoryManager; - private InputDataConverter inputDataConverter; - private DecisionConverter decisionConverter; - private BusinessKnowledgeModelConverter bkmConverter; - private KnowledgeSourceConverter knowledgeSourceConverter; - private TextAnnotationConverter textAnnotationConverter; - private DecisionServiceConverter decisionServiceConverter; - private org.kie.dmn.api.marshalling.DMNMarshaller marshaller; - private DMNMarshallerImportsHelper dmnMarshallerImportsHelper; - - protected DMNMarshaller() { - this(null, null, null, null); - } - - @Inject - public DMNMarshaller(final XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller, - final FactoryManager factoryManager, - final DMNMarshallerImportsHelper dmnMarshallerImportsHelper, - final org.kie.dmn.api.marshalling.DMNMarshaller marshaller) { - this.diagramMetadataMarshaller = diagramMetadataMarshaller; - this.factoryManager = factoryManager; - this.dmnMarshallerImportsHelper = dmnMarshallerImportsHelper; - this.marshaller = marshaller; - this.inputDataConverter = new InputDataConverter(factoryManager); - this.decisionConverter = new DecisionConverter(factoryManager); - this.bkmConverter = new BusinessKnowledgeModelConverter(factoryManager); - this.knowledgeSourceConverter = new KnowledgeSourceConverter(factoryManager); - this.textAnnotationConverter = new TextAnnotationConverter(factoryManager); - this.decisionServiceConverter = new DecisionServiceConverter(factoryManager); - } - - @Deprecated - public Graph unmarshallFromStunnerJSON(final Metadata metadata, - final InputStream input) throws IOException { - Graph result = (Graph) ServerMarshalling.fromJSON(input); - return result; - } - - @Deprecated - public String marshallFromStunnerToJSON(final Diagram diagram) throws IOException { - String result = ServerMarshalling.toJSON(diagram.getGraph()); - return result; - } - - private static Optional findDMNDiagram(org.kie.dmn.model.api.Definitions dmnXml) { - if (!(dmnXml instanceof org.kie.dmn.model.v1_2.TDefinitions)) { - return Optional.empty(); - } - if (dmnXml.getDMNDI() == null) { - return Optional.empty(); - } - List elems = dmnXml.getDMNDI().getDMNDiagram(); - if (elems.size() != 1) { - return Optional.empty(); - } else { - return Optional.of(elems.get(0)); - } - } - - public static final String INFO_REQ_ID = getDefinitionId(org.kie.workbench.common.dmn.api.definition.model.InformationRequirement.class); - public static final String KNOWLEDGE_REQ_ID = getDefinitionId(org.kie.workbench.common.dmn.api.definition.model.KnowledgeRequirement.class); - public static final String AUTH_REQ_ID = getDefinitionId(org.kie.workbench.common.dmn.api.definition.model.AuthorityRequirement.class); - public static final String ASSOCIATION_ID = getDefinitionId(Association.class); - - @Override - @SuppressWarnings("unchecked") - public Graph unmarshall(final Metadata metadata, - final InputStream input) throws IOException { - final Map hasComponentWidthsMap = new HashMap<>(); - final BiConsumer hasComponentWidthsConsumer = (uuid, hcw) -> { - if (Objects.nonNull(uuid)) { - hasComponentWidthsMap.put(uuid, hcw); - } - }; - - final org.kie.dmn.model.api.Definitions dmnXml = marshaller.unmarshal(new InputStreamReader(input)); - final List diagramDrgElements = dmnXml.getDrgElement(); - final Optional dmnDDDiagram = findDMNDiagram(dmnXml); - - // Get external DMN model information - final Map importDefinitions = dmnMarshallerImportsHelper.getImportDefinitions(metadata, dmnXml.getImport()); - - // Get external PMML model information - final Map pmmlDocuments = dmnMarshallerImportsHelper.getPMMLDocuments(metadata, dmnXml.getImport()); - - // Map external DRGElements - final List dmnShapes = dmnDDDiagram.map(this::getUniqueDMNShapes).orElse(emptyList()); - final List importedDrgElements = getImportedDrgElementsByShape(dmnShapes, importDefinitions, dmnXml); - - // Group DRGElements - final List drgElements = new ArrayList<>(); - drgElements.addAll(diagramDrgElements); - drgElements.addAll(importedDrgElements); - - // Remove DRGElements that doesn't have any local or imported shape. - removeDrgElementsWithoutShape(drgElements, dmnShapes); - - Map> elems = drgElements.stream().collect(toMap(org.kie.dmn.model.api.DRGElement::getId, - dmn -> new SimpleEntry<>(dmn, - dmnToStunner(dmn, hasComponentWidthsConsumer, importedDrgElements)))); - - Set dmnDecisionServices = new HashSet<>(); - - // Stunner rely on relative positioning for Edge connections, so need to cycle on DMNShape first. - for (Entry kv : elems.values()) { - ddExtAugmentStunner(dmnDDDiagram, kv.getValue()); - } - - // Setup Node Relationships and Connections all based on absolute positioning - for (Entry kv : elems.values()) { - org.kie.dmn.model.api.DRGElement elem = kv.getKey(); - Node currentNode = kv.getValue(); - - // For imported nodes, we don't have its connections - if (isImportedDRGElement(importedDrgElements, elem)) { - continue; - } - - // DMN spec table 2: Requirements connection rules - if (elem instanceof org.kie.dmn.model.api.Decision) { - org.kie.dmn.model.api.Decision decision = (org.kie.dmn.model.api.Decision) elem; - for (org.kie.dmn.model.api.InformationRequirement ir : decision.getInformationRequirement()) { - if (ir.getRequiredInput() != null) { - String reqInputID = getId(ir.getRequiredInput()); - Node requiredNode = getRequiredNode(elems, reqInputID); - Edge myEdge = factoryManager.newElement(idOfDMNorWBUUID(ir), - INFO_REQ_ID).asEdge(); - connectEdge(myEdge, - requiredNode, - currentNode); - setConnectionMagnets(myEdge, ir.getId(), dmnXml); - } - if (ir.getRequiredDecision() != null) { - String reqInputID = getId(ir.getRequiredDecision()); - Node requiredNode = getRequiredNode(elems, reqInputID); - Edge myEdge = factoryManager.newElement(idOfDMNorWBUUID(ir), - INFO_REQ_ID).asEdge(); - connectEdge(myEdge, - requiredNode, - currentNode); - setConnectionMagnets(myEdge, ir.getId(), dmnXml); - } - } - for (org.kie.dmn.model.api.KnowledgeRequirement kr : decision.getKnowledgeRequirement()) { - String reqInputID = getId(kr.getRequiredKnowledge()); - Node requiredNode = getRequiredNode(elems, reqInputID); - Edge myEdge = factoryManager.newElement(idOfDMNorWBUUID(kr), - KNOWLEDGE_REQ_ID).asEdge(); - connectEdge(myEdge, - requiredNode, - currentNode); - setConnectionMagnets(myEdge, kr.getId(), dmnXml); - } - for (org.kie.dmn.model.api.AuthorityRequirement kr : decision.getAuthorityRequirement()) { - String reqInputID = getId(kr.getRequiredAuthority()); - Node requiredNode = getRequiredNode(elems, reqInputID); - Edge myEdge = factoryManager.newElement(idOfDMNorWBUUID(kr), - AUTH_REQ_ID).asEdge(); - connectEdge(myEdge, - requiredNode, - currentNode); - setConnectionMagnets(myEdge, kr.getId(), dmnXml); - } - } else if (elem instanceof org.kie.dmn.model.api.BusinessKnowledgeModel) { - org.kie.dmn.model.api.BusinessKnowledgeModel bkm = (org.kie.dmn.model.api.BusinessKnowledgeModel) elem; - for (org.kie.dmn.model.api.KnowledgeRequirement kr : bkm.getKnowledgeRequirement()) { - String reqInputID = getId(kr.getRequiredKnowledge()); - Node requiredNode = getRequiredNode(elems, reqInputID); - Edge myEdge = factoryManager.newElement(idOfDMNorWBUUID(kr), - KNOWLEDGE_REQ_ID).asEdge(); - connectEdge(myEdge, - requiredNode, - currentNode); - setConnectionMagnets(myEdge, kr.getId(), dmnXml); - } - for (org.kie.dmn.model.api.AuthorityRequirement kr : bkm.getAuthorityRequirement()) { - String reqInputID = getId(kr.getRequiredAuthority()); - Node requiredNode = getRequiredNode(elems, reqInputID); - Edge myEdge = factoryManager.newElement(idOfDMNorWBUUID(kr), - AUTH_REQ_ID).asEdge(); - connectEdge(myEdge, - requiredNode, - currentNode); - setConnectionMagnets(myEdge, kr.getId(), dmnXml); - } - } else if (elem instanceof org.kie.dmn.model.api.KnowledgeSource) { - org.kie.dmn.model.api.KnowledgeSource ks = (org.kie.dmn.model.api.KnowledgeSource) elem; - for (org.kie.dmn.model.api.AuthorityRequirement ir : ks.getAuthorityRequirement()) { - if (ir.getRequiredInput() != null) { - String reqInputID = getId(ir.getRequiredInput()); - Node requiredNode = getRequiredNode(elems, reqInputID); - Edge myEdge = factoryManager.newElement(idOfDMNorWBUUID(ir), - AUTH_REQ_ID).asEdge(); - connectEdge(myEdge, - requiredNode, - currentNode); - setConnectionMagnets(myEdge, ir.getId(), dmnXml); - } - if (ir.getRequiredDecision() != null) { - String reqInputID = getId(ir.getRequiredDecision()); - Node requiredNode = getRequiredNode(elems, reqInputID); - Edge myEdge = factoryManager.newElement(idOfDMNorWBUUID(ir), - AUTH_REQ_ID).asEdge(); - connectEdge(myEdge, - requiredNode, - currentNode); - setConnectionMagnets(myEdge, ir.getId(), dmnXml); - } - if (ir.getRequiredAuthority() != null) { - String reqInputID = getId(ir.getRequiredAuthority()); - Node requiredNode = getRequiredNode(elems, reqInputID); - Edge myEdge = factoryManager.newElement(idOfDMNorWBUUID(ir), - AUTH_REQ_ID).asEdge(); - connectEdge(myEdge, - requiredNode, - currentNode); - setConnectionMagnets(myEdge, ir.getId(), dmnXml); - } - } - } else if (elem instanceof org.kie.dmn.model.api.DecisionService) { - org.kie.dmn.model.api.DecisionService ds = (org.kie.dmn.model.api.DecisionService) elem; - dmnDecisionServices.add(ds); - for (org.kie.dmn.model.api.DMNElementReference er : ds.getEncapsulatedDecision()) { - final String reqInputID = getId(er); - final Node requiredNode = getRequiredNode(elems, reqInputID); - connectDSChildEdge(currentNode, requiredNode); - } - for (org.kie.dmn.model.api.DMNElementReference er : ds.getOutputDecision()) { - final String reqInputID = getId(er); - final Node requiredNode = getRequiredNode(elems, reqInputID); - connectDSChildEdge(currentNode, requiredNode); - } - } - } - - Map, ?>> textAnnotations = dmnXml.getArtifact().stream() - .filter(org.kie.dmn.model.api.TextAnnotation.class::isInstance) - .map(org.kie.dmn.model.api.TextAnnotation.class::cast) - .collect(Collectors.toMap(org.kie.dmn.model.api.TextAnnotation::getId, - dmn -> textAnnotationConverter.nodeFromDMN(dmn, - hasComponentWidthsConsumer))); - textAnnotations.values().forEach(n -> ddExtAugmentStunner(dmnDDDiagram, n)); - - List associations = dmnXml.getArtifact().stream() - .filter(org.kie.dmn.model.api.Association.class::isInstance) - .map(org.kie.dmn.model.api.Association.class::cast) - .collect(Collectors.toList()); - for (org.kie.dmn.model.api.Association a : associations) { - String sourceId = getId(a.getSourceRef()); - Node sourceNode = Optional.ofNullable(elems.get(sourceId)).map(Entry::getValue).orElse(textAnnotations.get(sourceId)); - - String targetId = getId(a.getTargetRef()); - Node targetNode = Optional.ofNullable(elems.get(targetId)).map(Entry::getValue).orElse(textAnnotations.get(targetId)); - - @SuppressWarnings("unchecked") - Edge, ?> myEdge = (Edge, ?>) factoryManager.newElement(idOfDMNorWBUUID(a), - ASSOCIATION_ID).asEdge(); - - Id id = new Id(a.getId()); - Description description = new Description(a.getDescription()); - Association definition = new Association(id, - description); - myEdge.getContent().setDefinition(definition); - - connectEdge(myEdge, - sourceNode, - targetNode); - setConnectionMagnets(myEdge, a.getId(), dmnXml); - } - - //Ensure all locations are updated to relative for Stunner - for (Entry kv : elems.values()) { - PointUtils.convertToRelativeBounds(kv.getValue()); - } - - Graph graph = factoryManager.newDiagram("prova", - BindableAdapterUtils.getDefinitionSetId(DMNDefinitionSet.class), - metadata).getGraph(); - elems.values().stream().map(Map.Entry::getValue).forEach(graph::addNode); - textAnnotations.values().forEach(graph::addNode); - - Node dmnDiagramRoot = findDMNDiagramRoot(graph); - Definitions definitionsStunnerPojo = DefinitionsConverter.wbFromDMN(dmnXml, importDefinitions, pmmlDocuments); - loadImportedItemDefinitions(definitionsStunnerPojo, importDefinitions); - ((View) dmnDiagramRoot.getContent()).getDefinition().setDefinitions(definitionsStunnerPojo); - - //Only connect Nodes to the Diagram that are not referenced by DecisionServices - final List references = new ArrayList<>(); - dmnDecisionServices.forEach(ds -> references.addAll(ds.getEncapsulatedDecision().stream().map(org.kie.dmn.model.api.DMNElementReference::getHref).collect(Collectors.toList()))); - dmnDecisionServices.forEach(ds -> references.addAll(ds.getOutputDecision().stream().map(org.kie.dmn.model.api.DMNElementReference::getHref).collect(Collectors.toList()))); - - final Map elemsToConnectToRoot = elems.values().stream() - .filter(elem -> !references.contains("#" + elem.getKey().getId())) - .collect(Collectors.toMap(Entry::getKey, Entry::getValue)); - elemsToConnectToRoot.values().stream() - .forEach(node -> connectRootWithChild(dmnDiagramRoot, - node)); - - textAnnotations.values().stream().forEach(node -> connectRootWithChild(dmnDiagramRoot, - node)); - - //Copy ComponentWidths information - final Optional extension = findComponentsWidthsExtension(dmnDDDiagram); - extension.ifPresent(componentsWidthsExtension -> { - //This condition is required because a node with ComponentsWidthsExtension - //can be imported from another diagram but the extension is not imported or present in this diagram. - //TODO: This will be fixed in this JIRA: https://issues.jboss.org/browse/DROOLS-3934 - if (componentsWidthsExtension.getComponentsWidths() != null) { - hasComponentWidthsMap.entrySet().forEach(es -> { - componentsWidthsExtension - .getComponentsWidths() - .stream() - .filter(componentWidths -> componentWidths.getDmnElementRef().getLocalPart().equals(es.getKey())) - .findFirst() - .ifPresent(componentWidths -> { - final List widths = es.getValue().getComponentWidths(); - widths.clear(); - widths.addAll(componentWidths.getWidths()); - }); - }); - } - }); - - return graph; - } - - void removeDrgElementsWithoutShape( - final List drgElements, - final List dmnShapes) { - - if (dmnShapes.size() == 0) { - // DMN 1.1 doesn't have DMNShape, so we include all DRGElements and create all the shapes. - return; - } - - drgElements.removeIf(element -> !dmnShapes.stream() - .filter(s -> Objects.equals(s.getDmnElementRef().getLocalPart(), element.getId())) - .findFirst() - .isPresent() - ); - } - - void updateIDsWithAlias(final HashMap indexByUri, - final List importedDrgElements) { - - if (importedDrgElements.isEmpty()) { - return; - } - - final QName namespace = DMNMarshallerImportsHelperImpl.NAMESPACE; - - for (org.kie.dmn.model.api.DRGElement element : importedDrgElements) { - final String namespaceAttribute = element.getAdditionalAttributes().getOrDefault(namespace, ""); - if (!StringUtils.isEmpty(namespaceAttribute)) { - if (indexByUri.containsKey(namespaceAttribute)) { - final String alias = indexByUri.get(namespaceAttribute); - changeAlias(alias, element); - } - } - } - } - - HashMap getIndexByUri(final org.kie.dmn.model.api.Definitions dmnXml) { - - final HashMap indexByUri = new HashMap<>(); - dmnXml.getNsContext().entrySet().forEach(e -> indexByUri.put(e.getValue(), e.getKey())); - return indexByUri; - } - - void changeAlias(final String alias, final org.kie.dmn.model.api.DRGElement drgElement) { - if (drgElement.getId().contains(":")) { - final String id = drgElement.getId().split(":")[1]; - drgElement.setId(alias + ":" + id); - } - } - - private Node getRequiredNode(final Map> elems, - final String reqInputID) { - if (elems.containsKey(reqInputID)) { - return elems.get(reqInputID).getValue(); - } else { - - final Optional match = elems.keySet().stream() - .filter(k -> k.contains(reqInputID)) - .findFirst(); - if (match.isPresent()) { - return elems.get(match.get()).getValue(); - } - } - - return null; - } - - List getImportedDrgElementsByShape(final List dmnShapes, - final Map importDefinitions, - final org.kie.dmn.model.api.Definitions dmnXml) { - - final List importedDRGElements = dmnMarshallerImportsHelper.getImportedDRGElements(importDefinitions); - - // Update IDs with the alias used in this file for the respective imports - final HashMap indexByUri = getIndexByUri(dmnXml); - updateIDsWithAlias(indexByUri, importedDRGElements); - - return dmnShapes - .stream() - .map(shape -> { - - final String dmnElementRef = getDmnElementRef(shape); - final Optional ref = getReference(importedDRGElements, dmnElementRef); - - return ref.orElse(null); - }) - .filter(Objects::nonNull) - .collect(Collectors.toList()); - } - - Optional getReference(final List importedDRGElements, - final String dmnElementRef) { - final Optional element = importedDRGElements.stream().filter(drgElement -> dmnElementRef.equals(drgElement.getId())).findFirst(); - return element; - } - - String getDmnElementRef(final DMNShape dmnShape) { - return Optional - .ofNullable(dmnShape.getDmnElementRef()) - .map(QName::getLocalPart) - .orElse(""); - } - - List getUniqueDMNShapes(final org.kie.dmn.model.api.dmndi.DMNDiagram dmnDDDiagram) { - return new ArrayList<>(dmnDDDiagram - .getDMNDiagramElement() - .stream() - .filter(diagramElements -> diagramElements instanceof DMNShape) - .map(d -> (DMNShape) d) - .collect(toMap(DMNShape::getId, shape -> shape, (shape1, shape2) -> shape1)) - .values()); - } - - /** - * Stunner's factoryManager is only used to create Nodes that are considered part of a "Definition Set" (a collection of nodes visible to the User e.g. BPMN2 StartNode, EndNode and DMN's DecisionNode etc). - * Relationships are not created with the factory. - * This method specializes to connect with an Edge containing a Child relationship the target Node. - */ - private static void connectDSChildEdge(Node dsNode, Node requiredNode) { - final String uuid = dsNode.getUUID() + "er" + requiredNode.getUUID(); - final Edge myEdge = new EdgeImpl<>(uuid); - myEdge.setContent(new Child()); - connectEdge(myEdge, - dsNode, - requiredNode); - } - - private static String idOfDMNorWBUUID(org.kie.dmn.model.api.DMNElement dmn) { - return dmn.getId() != null ? dmn.getId() : UUID.uuid(); - } - - public static Node findDMNDiagramRoot(final Graph> graph) { - return StreamSupport.stream(graph.nodes().spliterator(), - false).filter(n -> n.getContent().getDefinition() instanceof DMNDiagram).findFirst().orElseThrow(() -> new UnsupportedOperationException("TODO")); - } - - private String getId(final org.kie.dmn.model.api.DMNElementReference er) { - String href = er.getHref(); - return href.contains("#") ? href.substring(href.indexOf('#') + 1) : href; - } - - private Node dmnToStunner(final org.kie.dmn.model.api.DRGElement dmn, - final BiConsumer hasComponentWidthsConsumer, - final List importedDrgElements) { - - final Node node = createNode(dmn, hasComponentWidthsConsumer); - return setAllowOnlyVisualChange(importedDrgElements, node); - } - - private Node createNode(org.kie.dmn.model.api.DRGElement dmn, - final BiConsumer hasComponentWidthsConsumer) { - if (dmn instanceof org.kie.dmn.model.api.InputData) { - return inputDataConverter.nodeFromDMN((org.kie.dmn.model.api.InputData) dmn, - hasComponentWidthsConsumer); - } else if (dmn instanceof org.kie.dmn.model.api.Decision) { - return decisionConverter.nodeFromDMN((org.kie.dmn.model.api.Decision) dmn, - hasComponentWidthsConsumer); - } else if (dmn instanceof org.kie.dmn.model.api.BusinessKnowledgeModel) { - return bkmConverter.nodeFromDMN((org.kie.dmn.model.api.BusinessKnowledgeModel) dmn, - hasComponentWidthsConsumer); - } else if (dmn instanceof org.kie.dmn.model.api.KnowledgeSource) { - return knowledgeSourceConverter.nodeFromDMN((org.kie.dmn.model.api.KnowledgeSource) dmn, - hasComponentWidthsConsumer); - } else if (dmn instanceof org.kie.dmn.model.api.DecisionService) { - return decisionServiceConverter.nodeFromDMN((org.kie.dmn.model.api.DecisionService) dmn, - hasComponentWidthsConsumer); - } else { - throw new UnsupportedOperationException("TODO"); // TODO - } - } - - Node setAllowOnlyVisualChange(final List importedDrgElements, - final Node node) { - - getDRGElement(node).ifPresent(drgElement -> { - if (isImportedDRGElement(importedDrgElements, drgElement)) { - drgElement.setAllowOnlyVisualChange(true); - } else { - drgElement.setAllowOnlyVisualChange(false); - } - }); - - return node; - } - - Optional getDRGElement(final Node node) { - - final Object objectDefinition = DefinitionUtils.getElementDefinition(node); - - if (objectDefinition instanceof DRGElement) { - return Optional.of((DRGElement) objectDefinition); - } - - return Optional.empty(); - } - - boolean isImportedDRGElement(final List importedDrgElements, - final org.kie.dmn.model.api.DRGElement drgElement) { - return isImportedIdNode(importedDrgElements, drgElement.getId()); - } - - boolean isImportedDRGElement(final List importedDrgElements, - final DRGElement drgElement) { - return isImportedIdNode(importedDrgElements, drgElement.getId().getValue()); - } - - private boolean isImportedIdNode(final List importedDrgElements, - final String id) { - return importedDrgElements - .stream() - .anyMatch(drgElement -> Objects.equals(drgElement.getId(), id)); - } - - @SuppressWarnings({"rawtypes", "unchecked"}) - public static void connectRootWithChild(final Node dmnDiagramRoot, - final Node child) { - final String uuid = org.kie.workbench.common.stunner.core.util.UUID.uuid(); - final Edge edge = new EdgeImpl<>(uuid); - edge.setContent(new Child()); - connectEdge(edge, - dmnDiagramRoot, - child); - Definitions definitions = ((DMNDiagram) ((View) dmnDiagramRoot.getContent()).getDefinition()).getDefinitions(); - DMNModelInstrumentedBase childDRG = (DMNModelInstrumentedBase) ((View) child.getContent()).getDefinition(); - childDRG.setParent(definitions); - } - - @SuppressWarnings({"rawtypes", "unchecked"}) - public static void connectEdge(final Edge edge, - final Node source, - final Node target) { - edge.setSourceNode(source); - edge.setTargetNode(target); - source.getOutEdges().add(edge); - target.getInEdges().add(edge); - } - - @SuppressWarnings("unchecked") - private void setConnectionMagnets(final Edge edge, - final String dmnEdgeElementRef, - final org.kie.dmn.model.api.Definitions dmnXml) { - final ViewConnector connectionContent = (ViewConnector) edge.getContent(); - - Optional dmnDiagram = findDMNDiagram(dmnXml); - Optional dmnEdge = Optional.empty(); - if (dmnDiagram.isPresent()) { - dmnEdge = dmnDiagram.get().getDMNDiagramElement().stream() - .filter(DMNEdge.class::isInstance) - .map(DMNEdge.class::cast) - .filter(e -> e.getDmnElementRef().getLocalPart().equals(dmnEdgeElementRef)) - .findFirst(); - } - if (dmnEdge.isPresent()) { - DMNEdge e = dmnEdge.get(); - Point source = e.getWaypoint().get(0); - final Node, Edge> sourceNode = edge.getSourceNode(); - if (null != sourceNode) { - setConnectionMagnet(sourceNode, - source, - connectionContent::setSourceConnection); - } - Point target = e.getWaypoint().get(e.getWaypoint().size() - 1); - final Node, Edge> targetNode = edge.getTargetNode(); - if (null != targetNode) { - setConnectionMagnet(targetNode, - target, - connectionContent::setTargetConnection); - } - if (e.getWaypoint().size() > 2) { - connectionContent.setControlPoints(e.getWaypoint() - .subList(1, e.getWaypoint().size() - 1) - .stream() - .map(p -> ControlPoint.build(PointUtils.dmndiPointToPoint2D(p))) - .toArray(ControlPoint[]::new)); - } - } else { - // Set the source connection, if any. - final Node sourceNode = edge.getSourceNode(); - if (null != sourceNode) { - connectionContent.setSourceConnection(MagnetConnection.Builder.atCenter(sourceNode)); - } - // Set the target connection, if any. - final Node targetNode = edge.getTargetNode(); - if (null != targetNode) { - connectionContent.setTargetConnection(MagnetConnection.Builder.atCenter(targetNode)); - } - } - } - - private void setConnectionMagnet(final Node, Edge> node, - final Point magnetPoint, - final Consumer connectionConsumer) { - final View view = node.getContent(); - final double viewX = xOfBound(upperLeftBound(view)); - final double viewY = yOfBound(upperLeftBound(view)); - final double magnetRelativeX = magnetPoint.getX() - viewX; - final double magnetRelativeY = magnetPoint.getY() - viewY; - final double viewWidth = view.getBounds().getWidth(); - final double viewHeight = view.getBounds().getHeight(); - if (isCentre(magnetRelativeX, - magnetRelativeY, - viewWidth, - viewHeight)) { - connectionConsumer.accept(MagnetConnection.Builder.atCenter(node)); - } else { - connectionConsumer.accept(MagnetConnection.Builder.at(magnetRelativeX, magnetRelativeY).setAuto(true)); - } - } - - private boolean isCentre(final double magnetRelativeX, - final double magnetRelativeY, - final double viewWidth, - final double viewHeight) { - return Math.abs((viewWidth / 2) - magnetRelativeX) < CENTRE_TOLERANCE && - Math.abs((viewHeight / 2) - magnetRelativeY) < CENTRE_TOLERANCE; - } - - private Optional findComponentsWidthsExtension(final Optional dmnDDDiagram) { - if (!dmnDDDiagram.isPresent()) { - return Optional.empty(); - } - final org.kie.dmn.model.api.dmndi.DiagramElement.Extension dmnDDExtensions = dmnDDDiagram.get().getExtension(); - - if (Objects.isNull(dmnDDExtensions)) { - return Optional.empty(); - } - final List extensions = dmnDDExtensions.getAny(); - if (Objects.isNull(extensions)) { - return Optional.empty(); - } - return extensions - .stream() - .filter(extension -> extension instanceof ComponentsWidthsExtension) - .map(extension -> (ComponentsWidthsExtension) extension) - .findFirst(); - } - - @Override - @SuppressWarnings("unchecked") - public String marshall(final Diagram diagram) throws IOException { - Graph> g = diagram.getGraph(); - - Map nodes = new HashMap<>(); - Map textAnnotations = new HashMap<>(); - - Node, ?> dmnDiagramRoot = (Node, ?>) findDMNDiagramRoot(g); - Definitions definitionsStunnerPojo = dmnDiagramRoot.getContent().getDefinition().getDefinitions(); - cleanImportedItemDefinitions(definitionsStunnerPojo); - org.kie.dmn.model.api.Definitions definitions = DefinitionsConverter.dmnFromWB(definitionsStunnerPojo); - if (definitions.getExtensionElements() == null) { - if (definitions instanceof org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase) { - definitions.setExtensionElements(new org.kie.dmn.model.v1_1.TDMNElement.TExtensionElements()); - } else if (definitions instanceof org.kie.dmn.model.v1_2.KieDMNModelInstrumentedBase) { - definitions.setExtensionElements(new org.kie.dmn.model.v1_2.TDMNElement.TExtensionElements()); - } else { - definitions.setExtensionElements(new org.kie.dmn.model.v1_2.TDMNElement.TExtensionElements()); - } - } - - if (definitions.getDMNDI() == null) { - definitions.setDMNDI(new DMNDI()); - } - org.kie.dmn.model.api.dmndi.DMNDiagram dmnDDDMNDiagram = new org.kie.dmn.model.v1_2.dmndi.DMNDiagram(); - definitions.getDMNDI().getDMNDiagram().add(dmnDDDMNDiagram); - List dmnEdges = new ArrayList<>(); - - //Convert relative positioning to absolute - for (Node node : g.nodes()) { - PointUtils.convertToAbsoluteBounds(node); - } - - //Setup callback for marshalling ComponentWidths - if (dmnDDDMNDiagram.getExtension() == null) { - dmnDDDMNDiagram.setExtension(new DiagramElement.Extension()); - } - final ComponentsWidthsExtension componentsWidthsExtension = new ComponentsWidthsExtension(); - dmnDDDMNDiagram.getExtension().getAny().add(componentsWidthsExtension); - - final Consumer componentWidthsConsumer = (cw) -> { - componentsWidthsExtension.getComponentsWidths().add(cw); - }; - - //Iterate Graph processing nodes.. - for (Node node : g.nodes()) { - if (node.getContent() instanceof View) { - View view = (View) node.getContent(); - if (view.getDefinition() instanceof DRGElement) { - DRGElement n = (org.kie.workbench.common.dmn.api.definition.model.DRGElement) view.getDefinition(); - if (view.getDefinition() instanceof DynamicReadOnly) { - final DynamicReadOnly def = (DynamicReadOnly) view.getDefinition(); - if (!def.isAllowOnlyVisualChange()) { - nodes.put(n.getId().getValue(), - stunnerToDMN(node, - componentWidthsConsumer)); - } - } else { - nodes.put(n.getId().getValue(), - stunnerToDMN(node, - componentWidthsConsumer)); - } - dmnDDDMNDiagram.getDMNDiagramElement().add(stunnerToDDExt((View) view)); - } else if (view.getDefinition() instanceof TextAnnotation) { - TextAnnotation textAnnotation = (TextAnnotation) view.getDefinition(); - textAnnotations.put(textAnnotation.getId().getValue(), - textAnnotationConverter.dmnFromNode((Node, ?>) node, - componentWidthsConsumer)); - dmnDDDMNDiagram.getDMNDiagramElement().add(stunnerToDDExt((View) view)); - - List associations = AssociationConverter.dmnFromWB((Node, ?>) node); - definitions.getArtifact().addAll(associations); - } - // DMNDI Edge management. - List> inEdges = (List>) node.getInEdges(); - for (Edge e : inEdges) { - if (e.getContent() instanceof ViewConnector) { - final ViewConnector connectionContent = (ViewConnector) e.getContent(); - if (connectionContent.getSourceConnection().isPresent() && connectionContent.getTargetConnection().isPresent()) { - Point2D sourcePoint = ((Connection) connectionContent.getSourceConnection().get()).getLocation(); - Point2D targetPoint = ((Connection) connectionContent.getTargetConnection().get()).getLocation(); - if (sourcePoint == null) { // If the "connection source/target location is null" assume it's the centre of the shape. - final Node sourceNode = e.getSourceNode(); - final View sourceView = (View) sourceNode.getContent(); - double xSource = xOfBound(upperLeftBound(sourceView)); - double ySource = yOfBound(upperLeftBound(sourceView)); - if (sourceView.getDefinition() instanceof DMNViewDefinition) { - DMNViewDefinition dmnViewDefinition = (DMNViewDefinition) sourceView.getDefinition(); - xSource += dmnViewDefinition.getDimensionsSet().getWidth().getValue() / 2; - ySource += dmnViewDefinition.getDimensionsSet().getHeight().getValue() / 2; - } - sourcePoint = Point2D.create(xSource, ySource); - } else { // If it is non-null it is relative to the source/target shape location. - final Node sourceNode = e.getSourceNode(); - final View sourceView = (View) sourceNode.getContent(); - double xSource = xOfBound(upperLeftBound(sourceView)); - double ySource = yOfBound(upperLeftBound(sourceView)); - sourcePoint = Point2D.create(xSource + sourcePoint.getX(), ySource + sourcePoint.getY()); - } - if (targetPoint == null) { // If the "connection source/target location is null" assume it's the centre of the shape. - double xTarget = xOfBound(upperLeftBound(view)); - double yTarget = yOfBound(upperLeftBound(view)); - if (view.getDefinition() instanceof DMNViewDefinition) { - DMNViewDefinition dmnViewDefinition = (DMNViewDefinition) view.getDefinition(); - xTarget += dmnViewDefinition.getDimensionsSet().getWidth().getValue() / 2; - yTarget += dmnViewDefinition.getDimensionsSet().getHeight().getValue() / 2; - } - targetPoint = Point2D.create(xTarget, yTarget); - } else { // If it is non-null it is relative to the source/target shape location. - final double xTarget = xOfBound(upperLeftBound(view)); - final double yTarget = yOfBound(upperLeftBound(view)); - targetPoint = Point2D.create(xTarget + targetPoint.getX(), yTarget + targetPoint.getY()); - } - - DMNEdge dmnEdge = new org.kie.dmn.model.v1_2.dmndi.DMNEdge(); - // DMNDI edge elementRef is uuid of Stunner edge, - // with the only exception when edge contains as content a DMN Association (Association is an edge) - String uuid = e.getUUID(); - if (e.getContent() instanceof View) { - final View edgeView = (View) e.getContent(); - if (edgeView.getDefinition() instanceof Association) { - uuid = ((Association) edgeView.getDefinition()).getId().getValue(); - } - } - dmnEdge.setId("dmnedge-" + uuid); - dmnEdge.setDmnElementRef(new QName(uuid)); - - dmnEdge.getWaypoint().add(PointUtils.point2dToDMNDIPoint(sourcePoint)); - for (ControlPoint cp : connectionContent.getControlPoints()) { - dmnEdge.getWaypoint().add(PointUtils.point2dToDMNDIPoint(cp.getLocation())); - } - dmnEdge.getWaypoint().add(PointUtils.point2dToDMNDIPoint(targetPoint)); - dmnEdges.add(dmnEdge); - } - } - } - } - } - - nodes.values().forEach(n -> { - n.setParent(definitions); - definitions.getDrgElement().add(n); - }); - textAnnotations.values().forEach(definitions.getArtifact()::add); - - // add DMNEdge last. - dmnDDDMNDiagram.getDMNDiagramElement().addAll(dmnEdges); - - return marshaller.marshal(definitions); - } - - void loadImportedItemDefinitions(final Definitions definitions, - final Map importDefinitions) { - definitions.getItemDefinition().addAll(getWbImportedItemDefinitions(importDefinitions)); - } - - void cleanImportedItemDefinitions(final Definitions definitions) { - definitions.getItemDefinition().removeIf(ItemDefinition::isAllowOnlyVisualChange); - } - - List getWbImportedItemDefinitions(final Map importDefinitions) { - return dmnMarshallerImportsHelper - .getImportedItemDefinitions(importDefinitions) - .stream() - .map(ItemDefinitionPropertyConverter::wbFromDMN) - .peek(itemDefinition -> itemDefinition.setAllowOnlyVisualChange(true)) - .collect(Collectors.toList()); - } - - private void ddExtAugmentStunner(Optional dmnDDDiagram, Node currentNode) { - if (!dmnDDDiagram.isPresent()) { - return; - } - - final Stream drgShapeStream = dmnDDDiagram.get().getDMNDiagramElement().stream().filter(DMNShape.class::isInstance).map(DMNShape.class::cast); - final View content = (View) currentNode.getContent(); - final Bound ulBound = upperLeftBound(content); - final Bound lrBound = lowerRightBound(content); - if (content.getDefinition() instanceof Decision) { - Decision d = (Decision) content.getDefinition(); - internalAugment(drgShapeStream, d.getId(), - ulBound, - d.getDimensionsSet(), - lrBound, - d.getBackgroundSet(), - d::setFontSet); - } else if (content.getDefinition() instanceof InputData) { - InputData d = (InputData) content.getDefinition(); - internalAugment(drgShapeStream, - d.getId(), - ulBound, - d.getDimensionsSet(), - lrBound, - d.getBackgroundSet(), - d::setFontSet); - } else if (content.getDefinition() instanceof BusinessKnowledgeModel) { - BusinessKnowledgeModel d = (BusinessKnowledgeModel) content.getDefinition(); - internalAugment(drgShapeStream, - d.getId(), - ulBound, - d.getDimensionsSet(), - lrBound, - d.getBackgroundSet(), - d::setFontSet); - } else if (content.getDefinition() instanceof KnowledgeSource) { - KnowledgeSource d = (KnowledgeSource) content.getDefinition(); - internalAugment(drgShapeStream, - d.getId(), - ulBound, - d.getDimensionsSet(), - lrBound, - d.getBackgroundSet(), - d::setFontSet); - } else if (content.getDefinition() instanceof TextAnnotation) { - TextAnnotation d = (TextAnnotation) content.getDefinition(); - internalAugment(drgShapeStream, - d.getId(), - ulBound, - d.getDimensionsSet(), - lrBound, - d.getBackgroundSet(), - d::setFontSet); - } else if (content.getDefinition() instanceof DecisionService) { - DecisionService d = (DecisionService) content.getDefinition(); - internalAugment(drgShapeStream, - d.getId(), - ulBound, - d.getDimensionsSet(), - lrBound, - d.getBackgroundSet(), - d::setFontSet, - (dividerLineY) -> d.setDividerLineY(new DecisionServiceDividerLineY(dividerLineY - ulBound.getY()))); - } - } - - @SuppressWarnings("unchecked") - private void internalAugment(final Stream drgShapeStream, - final Id id, - final Bound ulBound, - final RectangleDimensionsSet dimensionsSet, - final Bound lrBound, - final BackgroundSet bgset, - final Consumer fontSetSetter) { - internalAugment(drgShapeStream, - id, - ulBound, - dimensionsSet, - lrBound, - bgset, - fontSetSetter, - (line) -> {/*NOP*/}); - } - - @SuppressWarnings("unchecked") - private void internalAugment(final Stream drgShapeStream, - final Id id, - final Bound ulBound, - final RectangleDimensionsSet dimensionsSet, - final Bound lrBound, - final BackgroundSet bgset, - final Consumer fontSetSetter, - final Consumer decisionServiceDividerLineYSetter) { - Optional drgShapeOpt = drgShapeStream.filter(shape -> shape.getDmnElementRef().getLocalPart().equals(id.getValue())).findFirst(); - if (!drgShapeOpt.isPresent()) { - return; - } - DMNShape drgShape = drgShapeOpt.get(); - - if (ulBound != null) { - ulBound.setX(xOfShape(drgShape)); - ulBound.setY(yOfShape(drgShape)); - } - dimensionsSet.setWidth(new Width(widthOfShape(drgShape))); - dimensionsSet.setHeight(new Height(heightOfShape(drgShape))); - if (lrBound != null) { - lrBound.setX(xOfShape(drgShape) + widthOfShape(drgShape)); - lrBound.setY(yOfShape(drgShape) + heightOfShape(drgShape)); - } - - DMNStyle dmnStyleOfDrgShape = drgShape.getStyle() instanceof DMNStyle ? (DMNStyle) drgShape.getStyle() : null; - if (dmnStyleOfDrgShape != null) { - if (null != dmnStyleOfDrgShape.getFillColor()) { - bgset.setBgColour(new BgColour(ColorUtils.wbFromDMN(dmnStyleOfDrgShape.getFillColor()))); - } - if (null != dmnStyleOfDrgShape.getStrokeColor()) { - bgset.setBorderColour(new BorderColour(ColorUtils.wbFromDMN(dmnStyleOfDrgShape.getStrokeColor()))); - } - } - - FontSet fontSet = new FontSet(); - if (dmnStyleOfDrgShape != null) { - mergeFontSet(fontSet, FontSetPropertyConverter.wbFromDMN(dmnStyleOfDrgShape)); - } - if (drgShape.getDMNLabel() != null && drgShape.getDMNLabel().getSharedStyle() instanceof DMNStyle) { - mergeFontSet(fontSet, FontSetPropertyConverter.wbFromDMN((DMNStyle) drgShape.getDMNLabel().getSharedStyle())); - } - if (drgShape.getDMNLabel() != null && drgShape.getDMNLabel().getStyle() instanceof DMNStyle) { - mergeFontSet(fontSet, FontSetPropertyConverter.wbFromDMN((DMNStyle) drgShape.getDMNLabel().getStyle())); - } - fontSetSetter.accept(fontSet); - - if (drgShape.getDMNDecisionServiceDividerLine() != null) { - decisionServiceDividerLineYSetter.accept(drgShape.getDMNDecisionServiceDividerLine().getWaypoint().get(0).getY()); - } - } - - private static void mergeFontSet(FontSet fontSet, FontSet additional) { - if (additional.getFontFamily() != null) { - fontSet.setFontFamily(additional.getFontFamily()); - } - if (additional.getFontSize() != null) { - fontSet.setFontSize(additional.getFontSize()); - } - if (additional.getFontColour() != null) { - fontSet.setFontColour(additional.getFontColour()); - } - } - - @SuppressWarnings("unchecked") - private static DMNShape stunnerToDDExt(final View v) { - DMNShape result = new org.kie.dmn.model.v1_2.dmndi.DMNShape(); - result.setId("dmnshape-" + v.getDefinition().getId().getValue()); - result.setDmnElementRef(new QName(v.getDefinition().getId().getValue())); - Bounds bounds = new org.kie.dmn.model.v1_2.dmndi.Bounds(); - result.setBounds(bounds); - bounds.setX(xOfBound(upperLeftBound(v))); - bounds.setY(yOfBound(upperLeftBound(v))); - result.setStyle(new org.kie.dmn.model.v1_2.dmndi.DMNStyle()); - result.setDMNLabel(new org.kie.dmn.model.v1_2.dmndi.DMNLabel()); - if (v.getDefinition() instanceof Decision) { - Decision d = (Decision) v.getDefinition(); - applyBounds(d.getDimensionsSet(), bounds); - applyBackgroundStyles(d.getBackgroundSet(), result); - applyFontStyle(d.getFontSet(), result); - } else if (v.getDefinition() instanceof InputData) { - InputData d = (InputData) v.getDefinition(); - applyBounds(d.getDimensionsSet(), bounds); - applyBackgroundStyles(d.getBackgroundSet(), result); - applyFontStyle(d.getFontSet(), result); - } else if (v.getDefinition() instanceof BusinessKnowledgeModel) { - BusinessKnowledgeModel d = (BusinessKnowledgeModel) v.getDefinition(); - applyBounds(d.getDimensionsSet(), bounds); - applyBackgroundStyles(d.getBackgroundSet(), result); - applyFontStyle(d.getFontSet(), result); - } else if (v.getDefinition() instanceof KnowledgeSource) { - KnowledgeSource d = (KnowledgeSource) v.getDefinition(); - applyBounds(d.getDimensionsSet(), bounds); - applyBackgroundStyles(d.getBackgroundSet(), result); - applyFontStyle(d.getFontSet(), result); - } else if (v.getDefinition() instanceof TextAnnotation) { - TextAnnotation d = (TextAnnotation) v.getDefinition(); - applyBounds(d.getDimensionsSet(), bounds); - applyBackgroundStyles(d.getBackgroundSet(), result); - applyFontStyle(d.getFontSet(), result); - } else if (v.getDefinition() instanceof DecisionService) { - DecisionService d = (DecisionService) v.getDefinition(); - applyBounds(d.getDimensionsSet(), bounds); - applyBackgroundStyles(d.getBackgroundSet(), result); - applyFontStyle(d.getFontSet(), result); - DMNDecisionServiceDividerLine dl = new org.kie.dmn.model.v1_2.dmndi.DMNDecisionServiceDividerLine(); - org.kie.dmn.model.api.dmndi.Point leftPoint = new org.kie.dmn.model.v1_2.dmndi.Point(); - leftPoint.setX(v.getBounds().getUpperLeft().getX()); - double dlY = v.getBounds().getUpperLeft().getY() + d.getDividerLineY().getValue(); - leftPoint.setY(dlY); - dl.getWaypoint().add(leftPoint); - org.kie.dmn.model.api.dmndi.Point rightPoint = new org.kie.dmn.model.v1_2.dmndi.Point(); - rightPoint.setX(v.getBounds().getLowerRight().getX()); - rightPoint.setY(dlY); - dl.getWaypoint().add(rightPoint); - result.setDMNDecisionServiceDividerLine(dl); - } - return result; - } - - private static void applyFontStyle(FontSet fontSet, DMNShape result) { - if (!(result.getStyle() instanceof DMNStyle)) { - return; - } - DMNStyle shapeStyle = (DMNStyle) result.getStyle(); - Color fontColor = ColorUtils.dmnFromWB(fontSet.getFontColour().getValue()); - shapeStyle.setFontColor(fontColor); - if (null != fontSet.getFontFamily().getValue()) { - shapeStyle.setFontFamily(fontSet.getFontFamily().getValue()); - } - if (null != fontSet.getFontSize().getValue()) { - shapeStyle.setFontSize(fontSet.getFontSize().getValue()); - } - } - - private static void applyBounds(final RectangleDimensionsSet dimensionsSet, - final Bounds bounds) { - if (null != dimensionsSet.getWidth().getValue() && - null != dimensionsSet.getHeight().getValue()) { - bounds.setWidth(dimensionsSet.getWidth().getValue()); - bounds.setHeight(dimensionsSet.getHeight().getValue()); - } - } - - private static void applyBackgroundStyles(final BackgroundSet bgset, - final DMNShape result) { - if (!(result.getStyle() instanceof DMNStyle)) { - return; - } - DMNStyle style = (DMNStyle) result.getStyle(); - if (null != bgset.getBgColour().getValue()) { - style.setFillColor(ColorUtils.dmnFromWB(bgset.getBgColour().getValue())); - } - if (null != bgset.getBorderColour().getValue()) { - style.setStrokeColor(ColorUtils.dmnFromWB(bgset.getBorderColour().getValue())); - } - } - - @SuppressWarnings("unchecked") - private org.kie.dmn.model.api.DRGElement stunnerToDMN(final Node node, - final Consumer componentWidthsConsumer) { - if (node.getContent() instanceof View) { - View view = (View) node.getContent(); - if (view.getDefinition() instanceof InputData) { - return inputDataConverter.dmnFromNode((Node, ?>) node, - componentWidthsConsumer); - } else if (view.getDefinition() instanceof Decision) { - return decisionConverter.dmnFromNode((Node, ?>) node, - componentWidthsConsumer); - } else if (view.getDefinition() instanceof BusinessKnowledgeModel) { - return bkmConverter.dmnFromNode((Node, ?>) node, - componentWidthsConsumer); - } else if (view.getDefinition() instanceof KnowledgeSource) { - return knowledgeSourceConverter.dmnFromNode((Node, ?>) node, - componentWidthsConsumer); - } else if (view.getDefinition() instanceof DecisionService) { - return decisionServiceConverter.dmnFromNode((Node, ?>) node, - componentWidthsConsumer); - } else { - throw new UnsupportedOperationException("TODO"); // TODO - } - } - throw new RuntimeException("wrong diagram structure to marshall"); - } - - @Override - public DiagramMetadataMarshaller getMetadataMarshaller() { - return diagramMetadataMarshaller; - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/DMNMarshallerStandalone.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/DMNMarshallerStandalone.java new file mode 100644 index 00000000000..b264430c106 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/DMNMarshallerStandalone.java @@ -0,0 +1,1234 @@ +/* + * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.backend; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.AbstractMap.SimpleEntry; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.xml.namespace.QName; + +import org.jboss.errai.marshalling.server.ServerMarshalling; +import org.kie.dmn.api.marshalling.DMNMarshaller; +import org.kie.dmn.model.api.Import; +import org.kie.dmn.model.api.dmndi.Bounds; +import org.kie.dmn.model.api.dmndi.Color; +import org.kie.dmn.model.api.dmndi.DMNDecisionServiceDividerLine; +import org.kie.dmn.model.api.dmndi.DMNEdge; +import org.kie.dmn.model.api.dmndi.DMNShape; +import org.kie.dmn.model.api.dmndi.DMNStyle; +import org.kie.dmn.model.api.dmndi.Point; +import org.kie.dmn.model.v1_2.dmndi.DMNDI; +import org.kie.dmn.model.v1_2.dmndi.DiagramElement; +import org.kie.workbench.common.dmn.api.DMNDefinitionSet; +import org.kie.workbench.common.dmn.api.definition.DMNViewDefinition; +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.Association; +import org.kie.workbench.common.dmn.api.definition.model.AuthorityRequirement; +import org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel; +import org.kie.workbench.common.dmn.api.definition.model.DMNDiagram; +import org.kie.workbench.common.dmn.api.definition.model.DMNElement; +import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase; +import org.kie.workbench.common.dmn.api.definition.model.DRGElement; +import org.kie.workbench.common.dmn.api.definition.model.Decision; +import org.kie.workbench.common.dmn.api.definition.model.DecisionService; +import org.kie.workbench.common.dmn.api.definition.model.Definitions; +import org.kie.workbench.common.dmn.api.definition.model.InformationRequirement; +import org.kie.workbench.common.dmn.api.definition.model.InputData; +import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeRequirement; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeSource; +import org.kie.workbench.common.dmn.api.definition.model.TextAnnotation; +import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; +import org.kie.workbench.common.dmn.api.property.background.BackgroundSet; +import org.kie.workbench.common.dmn.api.property.background.BgColour; +import org.kie.workbench.common.dmn.api.property.background.BorderColour; +import org.kie.workbench.common.dmn.api.property.dimensions.Height; +import org.kie.workbench.common.dmn.api.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.dmn.api.property.dimensions.Width; +import org.kie.workbench.common.dmn.api.property.dmn.DecisionServiceDividerLineY; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.font.FontSet; +import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelperStandalone; +import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelperStandaloneImpl; +import org.kie.workbench.common.dmn.backend.definition.v1_1.AssociationConverter; +import org.kie.workbench.common.dmn.backend.definition.v1_1.BusinessKnowledgeModelConverter; +import org.kie.workbench.common.dmn.backend.definition.v1_1.DecisionConverter; +import org.kie.workbench.common.dmn.backend.definition.v1_1.DecisionServiceConverter; +import org.kie.workbench.common.dmn.backend.definition.v1_1.DefinitionsConverter; +import org.kie.workbench.common.dmn.backend.definition.v1_1.InputDataConverter; +import org.kie.workbench.common.dmn.backend.definition.v1_1.ItemDefinitionPropertyConverter; +import org.kie.workbench.common.dmn.backend.definition.v1_1.KnowledgeSourceConverter; +import org.kie.workbench.common.dmn.backend.definition.v1_1.TextAnnotationConverter; +import org.kie.workbench.common.dmn.backend.definition.v1_1.dd.ColorUtils; +import org.kie.workbench.common.dmn.backend.definition.v1_1.dd.ComponentWidths; +import org.kie.workbench.common.dmn.backend.definition.v1_1.dd.ComponentsWidthsExtension; +import org.kie.workbench.common.dmn.backend.definition.v1_1.dd.FontSetPropertyConverter; +import org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.backend.service.XMLEncoderDiagramMetadataMarshaller; +import org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils; +import org.kie.workbench.common.stunner.core.definition.service.DiagramMarshaller; +import org.kie.workbench.common.stunner.core.definition.service.DiagramMetadataMarshaller; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bound; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Child; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.ControlPoint; +import org.kie.workbench.common.stunner.core.graph.content.view.MagnetConnection; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; +import org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl; +import org.kie.workbench.common.stunner.core.util.DefinitionUtils; +import org.kie.workbench.common.stunner.core.util.StringUtils; +import org.kie.workbench.common.stunner.core.util.UUID; + +import static java.util.Collections.emptyList; +import static java.util.stream.Collectors.toMap; +import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.heightOfShape; +import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.lowerRightBound; +import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.upperLeftBound; +import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.widthOfShape; +import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.xOfBound; +import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.xOfShape; +import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.yOfBound; +import static org.kie.workbench.common.dmn.backend.definition.v1_1.dd.PointUtils.yOfShape; +import static org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId; + +@ApplicationScoped +public class DMNMarshallerStandalone implements DiagramMarshaller> { + + public static final String INFO_REQ_ID = getDefinitionId(InformationRequirement.class); + + public static final String KNOWLEDGE_REQ_ID = getDefinitionId(KnowledgeRequirement.class); + + public static final String AUTH_REQ_ID = getDefinitionId(AuthorityRequirement.class); + + public static final String ASSOCIATION_ID = getDefinitionId(Association.class); + + private static final double CENTRE_TOLERANCE = 1.0; + + private XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller; + private FactoryManager factoryManager; + private InputDataConverter inputDataConverter; + private DecisionConverter decisionConverter; + private BusinessKnowledgeModelConverter bkmConverter; + private KnowledgeSourceConverter knowledgeSourceConverter; + private TextAnnotationConverter textAnnotationConverter; + private DecisionServiceConverter decisionServiceConverter; + private DMNMarshaller marshaller; + private DMNMarshallerImportsHelperStandalone dmnMarshallerImportsHelper; + + protected DMNMarshallerStandalone() { + this(null, null, null, null); + } + + @Inject + public DMNMarshallerStandalone(final XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller, + final FactoryManager factoryManager, + final DMNMarshallerImportsHelperStandalone dmnMarshallerImportsHelper, + final DMNMarshaller marshaller) { + this.diagramMetadataMarshaller = diagramMetadataMarshaller; + this.factoryManager = factoryManager; + this.dmnMarshallerImportsHelper = dmnMarshallerImportsHelper; + this.marshaller = marshaller; + this.inputDataConverter = new InputDataConverter(factoryManager); + this.decisionConverter = new DecisionConverter(factoryManager); + this.bkmConverter = new BusinessKnowledgeModelConverter(factoryManager); + this.knowledgeSourceConverter = new KnowledgeSourceConverter(factoryManager); + this.textAnnotationConverter = new TextAnnotationConverter(factoryManager); + this.decisionServiceConverter = new DecisionServiceConverter(factoryManager); + } + + @Deprecated + public Graph unmarshallFromStunnerJSON(final Metadata metadata, + final InputStream input) throws IOException { + Graph result = (Graph) ServerMarshalling.fromJSON(input); + return result; + } + + @Deprecated + public String marshallFromStunnerToJSON(final Diagram diagram) throws IOException { + String result = ServerMarshalling.toJSON(diagram.getGraph()); + return result; + } + + private static Optional findDMNDiagram(final org.kie.dmn.model.api.Definitions dmnXml) { + if (!(dmnXml instanceof org.kie.dmn.model.v1_2.TDefinitions)) { + return Optional.empty(); + } + if (dmnXml.getDMNDI() == null) { + return Optional.empty(); + } + final List elems = dmnXml.getDMNDI().getDMNDiagram(); + if (elems.size() != 1) { + return Optional.empty(); + } else { + return Optional.of(elems.get(0)); + } + } + + @Override + @SuppressWarnings("unchecked") + public Graph unmarshall(final Metadata metadata, + final InputStream input) throws IOException { + final Map hasComponentWidthsMap = new HashMap<>(); + final BiConsumer hasComponentWidthsConsumer = (uuid, hcw) -> { + if (Objects.nonNull(uuid)) { + hasComponentWidthsMap.put(uuid, hcw); + } + }; + + final org.kie.dmn.model.api.Definitions dmnXml = marshaller.unmarshal(new InputStreamReader(input)); + final List diagramDrgElements = dmnXml.getDrgElement(); + final Optional dmnDDDiagram = findDMNDiagram(dmnXml); + + // Get external DMN model information + final Map importDefinitions = dmnMarshallerImportsHelper.getImportDefinitions(metadata, dmnXml.getImport()); + + // Get external PMML model information + final Map pmmlDocuments = dmnMarshallerImportsHelper.getPMMLDocuments(metadata, dmnXml.getImport()); + + // Map external DRGElements + final List dmnShapes = dmnDDDiagram.map(this::getUniqueDMNShapes).orElse(emptyList()); + final List importedDrgElements = getImportedDrgElementsByShape(dmnShapes, importDefinitions, dmnXml); + + // Group DRGElements + final List drgElements = new ArrayList<>(); + drgElements.addAll(diagramDrgElements); + drgElements.addAll(importedDrgElements); + + // Remove DRGElements that doesn't have any local or imported shape. + removeDrgElementsWithoutShape(drgElements, dmnShapes); + + final Map> elems = drgElements.stream().collect(toMap(org.kie.dmn.model.api.DRGElement::getId, + dmn -> new SimpleEntry<>(dmn, + dmnToStunner(dmn, hasComponentWidthsConsumer, importedDrgElements)))); + + final Set dmnDecisionServices = new HashSet<>(); + + // Stunner rely on relative positioning for Edge connections, so need to cycle on DMNShape first. + for (Entry kv : elems.values()) { + ddExtAugmentStunner(dmnDDDiagram, kv.getValue()); + } + + // Setup Node Relationships and Connections all based on absolute positioning + for (Entry kv : elems.values()) { + final org.kie.dmn.model.api.DRGElement elem = kv.getKey(); + final Node currentNode = kv.getValue(); + + // For imported nodes, we don't have its connections + if (isImportedDRGElement(importedDrgElements, elem)) { + continue; + } + + // DMN spec table 2: Requirements connection rules + if (elem instanceof org.kie.dmn.model.api.Decision) { + final org.kie.dmn.model.api.Decision decision = (org.kie.dmn.model.api.Decision) elem; + for (org.kie.dmn.model.api.InformationRequirement ir : decision.getInformationRequirement()) { + connectEdgeToNodes(INFO_REQ_ID, + ir, + ir.getRequiredInput(), + elems, + dmnXml, + currentNode); + connectEdgeToNodes(INFO_REQ_ID, + ir, + ir.getRequiredDecision(), + elems, + dmnXml, + currentNode); + } + for (org.kie.dmn.model.api.KnowledgeRequirement kr : decision.getKnowledgeRequirement()) { + connectEdgeToNodes(KNOWLEDGE_REQ_ID, + kr, + kr.getRequiredKnowledge(), + elems, + dmnXml, + currentNode); + } + for (org.kie.dmn.model.api.AuthorityRequirement ar : decision.getAuthorityRequirement()) { + connectEdgeToNodes(AUTH_REQ_ID, + ar, + ar.getRequiredAuthority(), + elems, + dmnXml, + currentNode); + } + } else if (elem instanceof org.kie.dmn.model.api.BusinessKnowledgeModel) { + final org.kie.dmn.model.api.BusinessKnowledgeModel bkm = (org.kie.dmn.model.api.BusinessKnowledgeModel) elem; + for (org.kie.dmn.model.api.KnowledgeRequirement kr : bkm.getKnowledgeRequirement()) { + connectEdgeToNodes(KNOWLEDGE_REQ_ID, + kr, + kr.getRequiredKnowledge(), + elems, + dmnXml, + currentNode); + } + for (org.kie.dmn.model.api.AuthorityRequirement ar : bkm.getAuthorityRequirement()) { + connectEdgeToNodes(AUTH_REQ_ID, + ar, + ar.getRequiredAuthority(), + elems, + dmnXml, + currentNode); + } + } else if (elem instanceof org.kie.dmn.model.api.KnowledgeSource) { + final org.kie.dmn.model.api.KnowledgeSource ks = (org.kie.dmn.model.api.KnowledgeSource) elem; + for (org.kie.dmn.model.api.AuthorityRequirement ar : ks.getAuthorityRequirement()) { + connectEdgeToNodes(AUTH_REQ_ID, + ar, + ar.getRequiredInput(), + elems, + dmnXml, + currentNode); + connectEdgeToNodes(AUTH_REQ_ID, + ar, + ar.getRequiredDecision(), + elems, + dmnXml, + currentNode); + connectEdgeToNodes(AUTH_REQ_ID, + ar, + ar.getRequiredAuthority(), + elems, + dmnXml, + currentNode); + } + } else if (elem instanceof org.kie.dmn.model.api.DecisionService) { + final org.kie.dmn.model.api.DecisionService ds = (org.kie.dmn.model.api.DecisionService) elem; + dmnDecisionServices.add(ds); + for (org.kie.dmn.model.api.DMNElementReference er : ds.getEncapsulatedDecision()) { + final String reqInputID = getId(er); + final Node requiredNode = getRequiredNode(elems, reqInputID); + if (Objects.nonNull(requiredNode)) { + connectDSChildEdge(currentNode, requiredNode); + } + } + for (org.kie.dmn.model.api.DMNElementReference er : ds.getOutputDecision()) { + final String reqInputID = getId(er); + final Node requiredNode = getRequiredNode(elems, reqInputID); + if (Objects.nonNull(requiredNode)) { + connectDSChildEdge(currentNode, requiredNode); + } + } + } + } + + final Map, ?>> textAnnotations = dmnXml.getArtifact().stream() + .filter(org.kie.dmn.model.api.TextAnnotation.class::isInstance) + .map(org.kie.dmn.model.api.TextAnnotation.class::cast) + .collect(Collectors.toMap(org.kie.dmn.model.api.TextAnnotation::getId, + dmn -> textAnnotationConverter.nodeFromDMN(dmn, + hasComponentWidthsConsumer))); + textAnnotations.values().forEach(n -> ddExtAugmentStunner(dmnDDDiagram, n)); + + final List associations = dmnXml.getArtifact().stream() + .filter(org.kie.dmn.model.api.Association.class::isInstance) + .map(org.kie.dmn.model.api.Association.class::cast) + .collect(Collectors.toList()); + for (org.kie.dmn.model.api.Association a : associations) { + final String sourceId = getId(a.getSourceRef()); + final Node sourceNode = Optional.ofNullable(elems.get(sourceId)).map(Entry::getValue).orElse(textAnnotations.get(sourceId)); + + final String targetId = getId(a.getTargetRef()); + final Node targetNode = Optional.ofNullable(elems.get(targetId)).map(Entry::getValue).orElse(textAnnotations.get(targetId)); + + @SuppressWarnings("unchecked") + final Edge, ?> myEdge = (Edge, ?>) factoryManager.newElement(idOfDMNorWBUUID(a), + ASSOCIATION_ID).asEdge(); + + final Id id = new Id(a.getId()); + final Description description = new Description(a.getDescription()); + final Association definition = new Association(id, + description); + myEdge.getContent().setDefinition(definition); + + connectEdge(myEdge, + sourceNode, + targetNode); + setConnectionMagnets(myEdge, a.getId(), dmnXml); + } + + //Ensure all locations are updated to relative for Stunner + for (Entry kv : elems.values()) { + PointUtils.convertToRelativeBounds(kv.getValue()); + } + + final Graph graph = factoryManager.newDiagram("prova", + BindableAdapterUtils.getDefinitionSetId(DMNDefinitionSet.class), + metadata).getGraph(); + elems.values().stream().map(Map.Entry::getValue).forEach(graph::addNode); + textAnnotations.values().forEach(graph::addNode); + + final Node dmnDiagramRoot = findDMNDiagramRoot(graph); + final Definitions definitionsStunnerPojo = DefinitionsConverter.wbFromDMN(dmnXml, importDefinitions, pmmlDocuments); + loadImportedItemDefinitions(definitionsStunnerPojo, importDefinitions); + ((View) dmnDiagramRoot.getContent()).getDefinition().setDefinitions(definitionsStunnerPojo); + + //Only connect Nodes to the Diagram that are not referenced by DecisionServices + final List references = new ArrayList<>(); + dmnDecisionServices.forEach(ds -> references.addAll(ds.getEncapsulatedDecision().stream().map(org.kie.dmn.model.api.DMNElementReference::getHref).collect(Collectors.toList()))); + dmnDecisionServices.forEach(ds -> references.addAll(ds.getOutputDecision().stream().map(org.kie.dmn.model.api.DMNElementReference::getHref).collect(Collectors.toList()))); + + final Map elemsToConnectToRoot = elems.values().stream() + .filter(elem -> !references.contains("#" + elem.getKey().getId())) + .collect(Collectors.toMap(Entry::getKey, Entry::getValue)); + elemsToConnectToRoot.values().stream() + .forEach(node -> connectRootWithChild(dmnDiagramRoot, + node)); + + textAnnotations.values().stream().forEach(node -> connectRootWithChild(dmnDiagramRoot, + node)); + + //Copy ComponentWidths information + final Optional extension = findComponentsWidthsExtension(dmnDDDiagram); + extension.ifPresent(componentsWidthsExtension -> { + //This condition is required because a node with ComponentsWidthsExtension + //can be imported from another diagram but the extension is not imported or present in this diagram. + if (componentsWidthsExtension.getComponentsWidths() != null) { + hasComponentWidthsMap.entrySet().forEach(es -> { + componentsWidthsExtension + .getComponentsWidths() + .stream() + .filter(componentWidths -> componentWidths.getDmnElementRef().getLocalPart().equals(es.getKey())) + .findFirst() + .ifPresent(componentWidths -> { + final List widths = es.getValue().getComponentWidths(); + widths.clear(); + widths.addAll(componentWidths.getWidths()); + }); + }); + } + }); + + return graph; + } + + void removeDrgElementsWithoutShape(final List drgElements, + final List dmnShapes) { + + // DMN 1.1 doesn't have DMNShape, so we include all DRGElements and create all the shapes. + if (dmnShapes.isEmpty()) { + return; + } + + drgElements.removeIf(element -> !dmnShapes.stream() + .filter(s -> Objects.equals(s.getDmnElementRef().getLocalPart(), element.getId())) + .findFirst() + .isPresent() + ); + } + + void updateIDsWithAlias(final HashMap indexByUri, + final List importedDrgElements) { + + if (importedDrgElements.isEmpty()) { + return; + } + + final QName namespace = DMNMarshallerImportsHelperStandaloneImpl.NAMESPACE; + + for (org.kie.dmn.model.api.DRGElement element : importedDrgElements) { + final String namespaceAttribute = element.getAdditionalAttributes().getOrDefault(namespace, ""); + if (!StringUtils.isEmpty(namespaceAttribute)) { + if (indexByUri.containsKey(namespaceAttribute)) { + final String alias = indexByUri.get(namespaceAttribute); + changeAlias(alias, element); + } + } + } + } + + HashMap getIndexByUri(final org.kie.dmn.model.api.Definitions dmnXml) { + + final HashMap indexByUri = new HashMap<>(); + dmnXml.getNsContext().entrySet().forEach(e -> indexByUri.put(e.getValue(), e.getKey())); + return indexByUri; + } + + void changeAlias(final String alias, + final org.kie.dmn.model.api.DRGElement drgElement) { + if (drgElement.getId().contains(":")) { + final String id = drgElement.getId().split(":")[1]; + drgElement.setId(alias + ":" + id); + } + } + + private Node getRequiredNode(final Map> elems, + final String reqInputID) { + if (elems.containsKey(reqInputID)) { + return elems.get(reqInputID).getValue(); + } else { + + final Optional match = elems.keySet().stream() + .filter(k -> k.contains(reqInputID)) + .findFirst(); + if (match.isPresent()) { + return elems.get(match.get()).getValue(); + } + } + + return null; + } + + List getImportedDrgElementsByShape(final List dmnShapes, + final Map importDefinitions, + final org.kie.dmn.model.api.Definitions dmnXml) { + + final List importedDRGElements = dmnMarshallerImportsHelper.getImportedDRGElements(importDefinitions); + + // Update IDs with the alias used in this file for the respective imports + final HashMap indexByUri = getIndexByUri(dmnXml); + updateIDsWithAlias(indexByUri, importedDRGElements); + + return dmnShapes + .stream() + .map(shape -> { + final String dmnElementRef = getDmnElementRef(shape); + final Optional ref = getReference(importedDRGElements, dmnElementRef); + return ref.orElse(null); + }) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + } + + Optional getReference(final List importedDRGElements, + final String dmnElementRef) { + final Optional element = importedDRGElements.stream().filter(drgElement -> dmnElementRef.equals(drgElement.getId())).findFirst(); + return element; + } + + String getDmnElementRef(final DMNShape dmnShape) { + return Optional + .ofNullable(dmnShape.getDmnElementRef()) + .map(QName::getLocalPart) + .orElse(""); + } + + List getUniqueDMNShapes(final org.kie.dmn.model.api.dmndi.DMNDiagram dmnDDDiagram) { + return new ArrayList<>(dmnDDDiagram + .getDMNDiagramElement() + .stream() + .filter(diagramElements -> diagramElements instanceof DMNShape) + .map(d -> (DMNShape) d) + .collect(toMap(DMNShape::getId, shape -> shape, (shape1, shape2) -> shape1)) + .values()); + } + + /** + * Stunner's factoryManager is only used to create Nodes that are considered part of a "Definition Set" (a collection of nodes visible to the User e.g. BPMN2 StartNode, EndNode and DMN's DecisionNode etc). + * Relationships are not created with the factory. + * This method specializes to connect with an Edge containing a Child relationship the target Node. + */ + private static void connectDSChildEdge(final Node dsNode, + final Node requiredNode) { + final String uuid = dsNode.getUUID() + "er" + requiredNode.getUUID(); + final Edge myEdge = new EdgeImpl<>(uuid); + myEdge.setContent(new Child()); + connectEdge(myEdge, + dsNode, + requiredNode); + } + + private static String idOfDMNorWBUUID(final org.kie.dmn.model.api.DMNElement dmn) { + return dmn.getId() != null ? dmn.getId() : UUID.uuid(); + } + + public static Node findDMNDiagramRoot(final Graph> graph) { + return StreamSupport.stream(graph.nodes().spliterator(), + false).filter(n -> n.getContent().getDefinition() instanceof DMNDiagram).findFirst().orElseThrow(() -> new UnsupportedOperationException("TODO")); + } + + private String getId(final org.kie.dmn.model.api.DMNElementReference er) { + final String href = er.getHref(); + return href.contains("#") ? href.substring(href.indexOf('#') + 1) : href; + } + + private void connectEdgeToNodes(final String connectorTypeId, + final org.kie.dmn.model.api.DMNElement dmnElement, + final org.kie.dmn.model.api.DMNElementReference dmnElementReference, + final Map> elems, + final org.kie.dmn.model.api.Definitions definitions, + final Node currentNode) { + if (Objects.nonNull(dmnElementReference)) { + final String reqInputID = getId(dmnElementReference); + final Node requiredNode = getRequiredNode(elems, reqInputID); + final Edge myEdge = factoryManager.newElement(idOfDMNorWBUUID(dmnElement), + connectorTypeId).asEdge(); + connectEdge(myEdge, + requiredNode, + currentNode); + setConnectionMagnets(myEdge, dmnElement.getId(), definitions); + } + } + + private Node dmnToStunner(final org.kie.dmn.model.api.DRGElement dmn, + final BiConsumer hasComponentWidthsConsumer, + final List importedDrgElements) { + final Node node = createNode(dmn, hasComponentWidthsConsumer); + return setAllowOnlyVisualChange(importedDrgElements, node); + } + + private Node createNode(final org.kie.dmn.model.api.DRGElement dmn, + final BiConsumer hasComponentWidthsConsumer) { + if (dmn instanceof org.kie.dmn.model.api.InputData) { + return inputDataConverter.nodeFromDMN((org.kie.dmn.model.api.InputData) dmn, + hasComponentWidthsConsumer); + } else if (dmn instanceof org.kie.dmn.model.api.Decision) { + return decisionConverter.nodeFromDMN((org.kie.dmn.model.api.Decision) dmn, + hasComponentWidthsConsumer); + } else if (dmn instanceof org.kie.dmn.model.api.BusinessKnowledgeModel) { + return bkmConverter.nodeFromDMN((org.kie.dmn.model.api.BusinessKnowledgeModel) dmn, + hasComponentWidthsConsumer); + } else if (dmn instanceof org.kie.dmn.model.api.KnowledgeSource) { + return knowledgeSourceConverter.nodeFromDMN((org.kie.dmn.model.api.KnowledgeSource) dmn, + hasComponentWidthsConsumer); + } else if (dmn instanceof org.kie.dmn.model.api.DecisionService) { + return decisionServiceConverter.nodeFromDMN((org.kie.dmn.model.api.DecisionService) dmn, + hasComponentWidthsConsumer); + } else { + throw new UnsupportedOperationException("Unsupported node type detected."); + } + } + + Node setAllowOnlyVisualChange(final List importedDrgElements, + final Node node) { + + getDRGElement(node).ifPresent(drgElement -> { + if (isImportedDRGElement(importedDrgElements, drgElement)) { + drgElement.setAllowOnlyVisualChange(true); + } else { + drgElement.setAllowOnlyVisualChange(false); + } + }); + + return node; + } + + Optional getDRGElement(final Node node) { + + final Object objectDefinition = DefinitionUtils.getElementDefinition(node); + + if (objectDefinition instanceof DRGElement) { + return Optional.of((DRGElement) objectDefinition); + } + + return Optional.empty(); + } + + boolean isImportedDRGElement(final List importedDrgElements, + final org.kie.dmn.model.api.DRGElement drgElement) { + return isImportedIdNode(importedDrgElements, drgElement.getId()); + } + + boolean isImportedDRGElement(final List importedDrgElements, + final DRGElement drgElement) { + return isImportedIdNode(importedDrgElements, drgElement.getId().getValue()); + } + + private boolean isImportedIdNode(final List importedDrgElements, + final String id) { + return importedDrgElements + .stream() + .anyMatch(drgElement -> Objects.equals(drgElement.getId(), id)); + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + public static void connectRootWithChild(final Node dmnDiagramRoot, + final Node child) { + final String uuid = org.kie.workbench.common.stunner.core.util.UUID.uuid(); + final Edge edge = new EdgeImpl<>(uuid); + edge.setContent(new Child()); + connectEdge(edge, + dmnDiagramRoot, + child); + final Definitions definitions = ((DMNDiagram) ((View) dmnDiagramRoot.getContent()).getDefinition()).getDefinitions(); + final DMNModelInstrumentedBase childDRG = (DMNModelInstrumentedBase) ((View) child.getContent()).getDefinition(); + childDRG.setParent(definitions); + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + public static void connectEdge(final Edge edge, + final Node source, + final Node target) { + edge.setSourceNode(source); + edge.setTargetNode(target); + source.getOutEdges().add(edge); + target.getInEdges().add(edge); + } + + @SuppressWarnings("unchecked") + private void setConnectionMagnets(final Edge edge, + final String dmnEdgeElementRef, + final org.kie.dmn.model.api.Definitions dmnXml) { + final ViewConnector connectionContent = (ViewConnector) edge.getContent(); + + final Optional dmnDiagram = findDMNDiagram(dmnXml); + Optional dmnEdge = Optional.empty(); + if (dmnDiagram.isPresent()) { + dmnEdge = dmnDiagram.get().getDMNDiagramElement().stream() + .filter(DMNEdge.class::isInstance) + .map(DMNEdge.class::cast) + .filter(e -> e.getDmnElementRef().getLocalPart().equals(dmnEdgeElementRef)) + .findFirst(); + } + if (dmnEdge.isPresent()) { + DMNEdge e = dmnEdge.get(); + final Point source = e.getWaypoint().get(0); + final Node, Edge> sourceNode = edge.getSourceNode(); + if (null != sourceNode) { + setConnectionMagnet(sourceNode, + source, + connectionContent::setSourceConnection); + } + final Point target = e.getWaypoint().get(e.getWaypoint().size() - 1); + final Node, Edge> targetNode = edge.getTargetNode(); + if (null != targetNode) { + setConnectionMagnet(targetNode, + target, + connectionContent::setTargetConnection); + } + if (e.getWaypoint().size() > 2) { + connectionContent.setControlPoints(e.getWaypoint() + .subList(1, e.getWaypoint().size() - 1) + .stream() + .map(p -> ControlPoint.build(PointUtils.dmndiPointToPoint2D(p))) + .toArray(ControlPoint[]::new)); + } + } else { + // Set the source connection, if any. + final Node sourceNode = edge.getSourceNode(); + if (null != sourceNode) { + connectionContent.setSourceConnection(MagnetConnection.Builder.atCenter(sourceNode)); + } + // Set the target connection, if any. + final Node targetNode = edge.getTargetNode(); + if (null != targetNode) { + connectionContent.setTargetConnection(MagnetConnection.Builder.atCenter(targetNode)); + } + } + } + + private void setConnectionMagnet(final Node, Edge> node, + final Point magnetPoint, + final Consumer connectionConsumer) { + final View view = node.getContent(); + final double viewX = xOfBound(upperLeftBound(view)); + final double viewY = yOfBound(upperLeftBound(view)); + final double magnetRelativeX = magnetPoint.getX() - viewX; + final double magnetRelativeY = magnetPoint.getY() - viewY; + final double viewWidth = view.getBounds().getWidth(); + final double viewHeight = view.getBounds().getHeight(); + if (isCentre(magnetRelativeX, + magnetRelativeY, + viewWidth, + viewHeight)) { + connectionConsumer.accept(MagnetConnection.Builder.atCenter(node)); + } else { + connectionConsumer.accept(MagnetConnection.Builder.at(magnetRelativeX, magnetRelativeY).setAuto(true)); + } + } + + private boolean isCentre(final double magnetRelativeX, + final double magnetRelativeY, + final double viewWidth, + final double viewHeight) { + return Math.abs((viewWidth / 2) - magnetRelativeX) < CENTRE_TOLERANCE && + Math.abs((viewHeight / 2) - magnetRelativeY) < CENTRE_TOLERANCE; + } + + private Optional findComponentsWidthsExtension(final Optional dmnDDDiagram) { + if (!dmnDDDiagram.isPresent()) { + return Optional.empty(); + } + final org.kie.dmn.model.api.dmndi.DiagramElement.Extension dmnDDExtensions = dmnDDDiagram.get().getExtension(); + + if (Objects.isNull(dmnDDExtensions)) { + return Optional.empty(); + } + final List extensions = dmnDDExtensions.getAny(); + if (Objects.isNull(extensions)) { + return Optional.empty(); + } + return extensions + .stream() + .filter(extension -> extension instanceof ComponentsWidthsExtension) + .map(extension -> (ComponentsWidthsExtension) extension) + .findFirst(); + } + + @Override + @SuppressWarnings("unchecked") + public String marshall(final Diagram diagram) throws IOException { + final Graph> g = diagram.getGraph(); + + final Map nodes = new HashMap<>(); + final Map textAnnotations = new HashMap<>(); + + final Node, ?> dmnDiagramRoot = (Node, ?>) findDMNDiagramRoot(g); + final Definitions definitionsStunnerPojo = dmnDiagramRoot.getContent().getDefinition().getDefinitions(); + cleanImportedItemDefinitions(definitionsStunnerPojo); + final org.kie.dmn.model.api.Definitions definitions = DefinitionsConverter.dmnFromWB(definitionsStunnerPojo); + if (definitions.getExtensionElements() == null) { + if (definitions instanceof org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase) { + definitions.setExtensionElements(new org.kie.dmn.model.v1_1.TDMNElement.TExtensionElements()); + } else if (definitions instanceof org.kie.dmn.model.v1_2.KieDMNModelInstrumentedBase) { + definitions.setExtensionElements(new org.kie.dmn.model.v1_2.TDMNElement.TExtensionElements()); + } else { + definitions.setExtensionElements(new org.kie.dmn.model.v1_2.TDMNElement.TExtensionElements()); + } + } + + if (definitions.getDMNDI() == null) { + definitions.setDMNDI(new DMNDI()); + } + final org.kie.dmn.model.api.dmndi.DMNDiagram dmnDDDMNDiagram = new org.kie.dmn.model.v1_2.dmndi.DMNDiagram(); + definitions.getDMNDI().getDMNDiagram().add(dmnDDDMNDiagram); + final List dmnEdges = new ArrayList<>(); + + //Convert relative positioning to absolute + for (Node node : g.nodes()) { + PointUtils.convertToAbsoluteBounds(node); + } + + //Setup callback for marshalling ComponentWidths + if (dmnDDDMNDiagram.getExtension() == null) { + dmnDDDMNDiagram.setExtension(new DiagramElement.Extension()); + } + final ComponentsWidthsExtension componentsWidthsExtension = new ComponentsWidthsExtension(); + dmnDDDMNDiagram.getExtension().getAny().add(componentsWidthsExtension); + + final Consumer componentWidthsConsumer = (cw) -> { + componentsWidthsExtension.getComponentsWidths().add(cw); + }; + + //Iterate Graph processing nodes.. + for (Node node : g.nodes()) { + if (node.getContent() instanceof View) { + final View view = (View) node.getContent(); + if (view.getDefinition() instanceof DRGElement) { + final DRGElement drgElement = (org.kie.workbench.common.dmn.api.definition.model.DRGElement) view.getDefinition(); + if (!drgElement.isAllowOnlyVisualChange()) { + nodes.put(drgElement.getId().getValue(), + stunnerToDMN(node, + componentWidthsConsumer)); + } + dmnDDDMNDiagram.getDMNDiagramElement().add(stunnerToDDExt((View) view)); + } else if (view.getDefinition() instanceof TextAnnotation) { + final TextAnnotation textAnnotation = (TextAnnotation) view.getDefinition(); + textAnnotations.put(textAnnotation.getId().getValue(), + textAnnotationConverter.dmnFromNode((Node, ?>) node, + componentWidthsConsumer)); + dmnDDDMNDiagram.getDMNDiagramElement().add(stunnerToDDExt((View) view)); + + final List associations = AssociationConverter.dmnFromWB((Node, ?>) node); + definitions.getArtifact().addAll(associations); + } + // DMNDI Edge management. + final List> inEdges = (List>) node.getInEdges(); + for (Edge e : inEdges) { + if (e.getContent() instanceof ViewConnector) { + final ViewConnector connectionContent = (ViewConnector) e.getContent(); + if (connectionContent.getSourceConnection().isPresent() && connectionContent.getTargetConnection().isPresent()) { + Point2D sourcePoint = ((Connection) connectionContent.getSourceConnection().get()).getLocation(); + Point2D targetPoint = ((Connection) connectionContent.getTargetConnection().get()).getLocation(); + final Node sourceNode = e.getSourceNode(); + final View sourceView = (View) sourceNode.getContent(); + double xSource = xOfBound(upperLeftBound(sourceView)); + double ySource = yOfBound(upperLeftBound(sourceView)); + double xTarget = xOfBound(upperLeftBound(view)); + double yTarget = yOfBound(upperLeftBound(view)); + if (sourcePoint == null) { + // If the "connection source/target location is null" assume it's the centre of the shape. + if (sourceView.getDefinition() instanceof DMNViewDefinition) { + DMNViewDefinition dmnViewDefinition = (DMNViewDefinition) sourceView.getDefinition(); + xSource += dmnViewDefinition.getDimensionsSet().getWidth().getValue() / 2; + ySource += dmnViewDefinition.getDimensionsSet().getHeight().getValue() / 2; + } + sourcePoint = Point2D.create(xSource, ySource); + } else { + // If it is non-null it is relative to the source/target shape location. + sourcePoint = Point2D.create(xSource + sourcePoint.getX(), ySource + sourcePoint.getY()); + } + if (targetPoint == null) { + // If the "connection source/target location is null" assume it's the centre of the shape. + if (view.getDefinition() instanceof DMNViewDefinition) { + DMNViewDefinition dmnViewDefinition = (DMNViewDefinition) view.getDefinition(); + xTarget += dmnViewDefinition.getDimensionsSet().getWidth().getValue() / 2; + yTarget += dmnViewDefinition.getDimensionsSet().getHeight().getValue() / 2; + } + targetPoint = Point2D.create(xTarget, yTarget); + } else { + // If it is non-null it is relative to the source/target shape location. + targetPoint = Point2D.create(xTarget + targetPoint.getX(), yTarget + targetPoint.getY()); + } + + final DMNEdge dmnEdge = new org.kie.dmn.model.v1_2.dmndi.DMNEdge(); + // DMNDI edge elementRef is uuid of Stunner edge, + // with the only exception when edge contains as content a DMN Association (Association is an edge) + String uuid = e.getUUID(); + if (e.getContent() instanceof View) { + final View edgeView = (View) e.getContent(); + if (edgeView.getDefinition() instanceof Association) { + uuid = ((Association) edgeView.getDefinition()).getId().getValue(); + } + } + dmnEdge.setId("dmnedge-" + uuid); + dmnEdge.setDmnElementRef(new QName(uuid)); + + dmnEdge.getWaypoint().add(PointUtils.point2dToDMNDIPoint(sourcePoint)); + for (ControlPoint cp : connectionContent.getControlPoints()) { + dmnEdge.getWaypoint().add(PointUtils.point2dToDMNDIPoint(cp.getLocation())); + } + dmnEdge.getWaypoint().add(PointUtils.point2dToDMNDIPoint(targetPoint)); + dmnEdges.add(dmnEdge); + } + } + } + } + } + + nodes.values().forEach(n -> { + n.setParent(definitions); + definitions.getDrgElement().add(n); + }); + textAnnotations.values().forEach(definitions.getArtifact()::add); + + // add DMNEdge last. + dmnDDDMNDiagram.getDMNDiagramElement().addAll(dmnEdges); + + return marshaller.marshal(definitions); + } + + void loadImportedItemDefinitions(final Definitions definitions, + final Map importDefinitions) { + definitions.getItemDefinition().addAll(getWbImportedItemDefinitions(importDefinitions)); + } + + void cleanImportedItemDefinitions(final Definitions definitions) { + definitions.getItemDefinition().removeIf(ItemDefinition::isAllowOnlyVisualChange); + } + + List getWbImportedItemDefinitions(final Map importDefinitions) { + return dmnMarshallerImportsHelper + .getImportedItemDefinitions(importDefinitions) + .stream() + .map(ItemDefinitionPropertyConverter::wbFromDMN) + .peek(itemDefinition -> itemDefinition.setAllowOnlyVisualChange(true)) + .collect(Collectors.toList()); + } + + private void ddExtAugmentStunner(final Optional dmnDDDiagram, Node currentNode) { + if (!dmnDDDiagram.isPresent()) { + return; + } + + final Stream drgShapeStream = dmnDDDiagram.get().getDMNDiagramElement().stream().filter(DMNShape.class::isInstance).map(DMNShape.class::cast); + final View content = (View) currentNode.getContent(); + final Bound ulBound = upperLeftBound(content); + final Bound lrBound = lowerRightBound(content); + if (content.getDefinition() instanceof Decision) { + final Decision d = (Decision) content.getDefinition(); + internalAugment(drgShapeStream, d.getId(), + ulBound, + d.getDimensionsSet(), + lrBound, + d.getBackgroundSet(), + d::setFontSet); + } else if (content.getDefinition() instanceof InputData) { + final InputData d = (InputData) content.getDefinition(); + internalAugment(drgShapeStream, + d.getId(), + ulBound, + d.getDimensionsSet(), + lrBound, + d.getBackgroundSet(), + d::setFontSet); + } else if (content.getDefinition() instanceof BusinessKnowledgeModel) { + final BusinessKnowledgeModel d = (BusinessKnowledgeModel) content.getDefinition(); + internalAugment(drgShapeStream, + d.getId(), + ulBound, + d.getDimensionsSet(), + lrBound, + d.getBackgroundSet(), + d::setFontSet); + } else if (content.getDefinition() instanceof KnowledgeSource) { + final KnowledgeSource d = (KnowledgeSource) content.getDefinition(); + internalAugment(drgShapeStream, + d.getId(), + ulBound, + d.getDimensionsSet(), + lrBound, + d.getBackgroundSet(), + d::setFontSet); + } else if (content.getDefinition() instanceof TextAnnotation) { + final TextAnnotation d = (TextAnnotation) content.getDefinition(); + internalAugment(drgShapeStream, + d.getId(), + ulBound, + d.getDimensionsSet(), + lrBound, + d.getBackgroundSet(), + d::setFontSet); + } else if (content.getDefinition() instanceof DecisionService) { + final DecisionService d = (DecisionService) content.getDefinition(); + internalAugment(drgShapeStream, + d.getId(), + ulBound, + d.getDimensionsSet(), + lrBound, + d.getBackgroundSet(), + d::setFontSet, + (dividerLineY) -> d.setDividerLineY(new DecisionServiceDividerLineY(dividerLineY - ulBound.getY()))); + } + } + + @SuppressWarnings("unchecked") + private void internalAugment(final Stream drgShapeStream, + final Id id, + final Bound ulBound, + final RectangleDimensionsSet dimensionsSet, + final Bound lrBound, + final BackgroundSet bgset, + final Consumer fontSetSetter) { + internalAugment(drgShapeStream, + id, + ulBound, + dimensionsSet, + lrBound, + bgset, + fontSetSetter, + (line) -> {/*NOP*/}); + } + + @SuppressWarnings("unchecked") + private void internalAugment(final Stream drgShapeStream, + final Id id, + final Bound ulBound, + final RectangleDimensionsSet dimensionsSet, + final Bound lrBound, + final BackgroundSet bgset, + final Consumer fontSetSetter, + final Consumer decisionServiceDividerLineYSetter) { + final Optional drgShapeOpt = drgShapeStream.filter(shape -> shape.getDmnElementRef().getLocalPart().equals(id.getValue())).findFirst(); + if (!drgShapeOpt.isPresent()) { + return; + } + final DMNShape drgShape = drgShapeOpt.get(); + + if (ulBound != null) { + ulBound.setX(xOfShape(drgShape)); + ulBound.setY(yOfShape(drgShape)); + } + dimensionsSet.setWidth(new Width(widthOfShape(drgShape))); + dimensionsSet.setHeight(new Height(heightOfShape(drgShape))); + if (lrBound != null) { + lrBound.setX(xOfShape(drgShape) + widthOfShape(drgShape)); + lrBound.setY(yOfShape(drgShape) + heightOfShape(drgShape)); + } + + final DMNStyle dmnStyleOfDrgShape = drgShape.getStyle() instanceof DMNStyle ? (DMNStyle) drgShape.getStyle() : null; + if (dmnStyleOfDrgShape != null) { + if (null != dmnStyleOfDrgShape.getFillColor()) { + bgset.setBgColour(new BgColour(ColorUtils.wbFromDMN(dmnStyleOfDrgShape.getFillColor()))); + } + if (null != dmnStyleOfDrgShape.getStrokeColor()) { + bgset.setBorderColour(new BorderColour(ColorUtils.wbFromDMN(dmnStyleOfDrgShape.getStrokeColor()))); + } + } + + final FontSet fontSet = new FontSet(); + if (dmnStyleOfDrgShape != null) { + mergeFontSet(fontSet, FontSetPropertyConverter.wbFromDMN(dmnStyleOfDrgShape)); + } + if (drgShape.getDMNLabel() != null && drgShape.getDMNLabel().getSharedStyle() instanceof DMNStyle) { + mergeFontSet(fontSet, FontSetPropertyConverter.wbFromDMN((DMNStyle) drgShape.getDMNLabel().getSharedStyle())); + } + if (drgShape.getDMNLabel() != null && drgShape.getDMNLabel().getStyle() instanceof DMNStyle) { + mergeFontSet(fontSet, FontSetPropertyConverter.wbFromDMN((DMNStyle) drgShape.getDMNLabel().getStyle())); + } + fontSetSetter.accept(fontSet); + + if (drgShape.getDMNDecisionServiceDividerLine() != null) { + decisionServiceDividerLineYSetter.accept(drgShape.getDMNDecisionServiceDividerLine().getWaypoint().get(0).getY()); + } + } + + private static void mergeFontSet(final FontSet fontSet, + final FontSet additional) { + if (additional.getFontFamily() != null) { + fontSet.setFontFamily(additional.getFontFamily()); + } + if (additional.getFontSize() != null) { + fontSet.setFontSize(additional.getFontSize()); + } + if (additional.getFontColour() != null) { + fontSet.setFontColour(additional.getFontColour()); + } + } + + @SuppressWarnings("unchecked") + private static DMNShape stunnerToDDExt(final View v) { + final DMNShape result = new org.kie.dmn.model.v1_2.dmndi.DMNShape(); + result.setId("dmnshape-" + v.getDefinition().getId().getValue()); + result.setDmnElementRef(new QName(v.getDefinition().getId().getValue())); + final Bounds bounds = new org.kie.dmn.model.v1_2.dmndi.Bounds(); + result.setBounds(bounds); + bounds.setX(xOfBound(upperLeftBound(v))); + bounds.setY(yOfBound(upperLeftBound(v))); + result.setStyle(new org.kie.dmn.model.v1_2.dmndi.DMNStyle()); + result.setDMNLabel(new org.kie.dmn.model.v1_2.dmndi.DMNLabel()); + if (v.getDefinition() instanceof Decision) { + final Decision d = (Decision) v.getDefinition(); + applyBounds(d.getDimensionsSet(), bounds); + applyBackgroundStyles(d.getBackgroundSet(), result); + applyFontStyle(d.getFontSet(), result); + } else if (v.getDefinition() instanceof InputData) { + final InputData d = (InputData) v.getDefinition(); + applyBounds(d.getDimensionsSet(), bounds); + applyBackgroundStyles(d.getBackgroundSet(), result); + applyFontStyle(d.getFontSet(), result); + } else if (v.getDefinition() instanceof BusinessKnowledgeModel) { + final BusinessKnowledgeModel d = (BusinessKnowledgeModel) v.getDefinition(); + applyBounds(d.getDimensionsSet(), bounds); + applyBackgroundStyles(d.getBackgroundSet(), result); + applyFontStyle(d.getFontSet(), result); + } else if (v.getDefinition() instanceof KnowledgeSource) { + final KnowledgeSource d = (KnowledgeSource) v.getDefinition(); + applyBounds(d.getDimensionsSet(), bounds); + applyBackgroundStyles(d.getBackgroundSet(), result); + applyFontStyle(d.getFontSet(), result); + } else if (v.getDefinition() instanceof TextAnnotation) { + final TextAnnotation d = (TextAnnotation) v.getDefinition(); + applyBounds(d.getDimensionsSet(), bounds); + applyBackgroundStyles(d.getBackgroundSet(), result); + applyFontStyle(d.getFontSet(), result); + } else if (v.getDefinition() instanceof DecisionService) { + final DecisionService d = (DecisionService) v.getDefinition(); + applyBounds(d.getDimensionsSet(), bounds); + applyBackgroundStyles(d.getBackgroundSet(), result); + applyFontStyle(d.getFontSet(), result); + final DMNDecisionServiceDividerLine dl = new org.kie.dmn.model.v1_2.dmndi.DMNDecisionServiceDividerLine(); + final org.kie.dmn.model.api.dmndi.Point leftPoint = new org.kie.dmn.model.v1_2.dmndi.Point(); + leftPoint.setX(v.getBounds().getUpperLeft().getX()); + final double dlY = v.getBounds().getUpperLeft().getY() + d.getDividerLineY().getValue(); + leftPoint.setY(dlY); + dl.getWaypoint().add(leftPoint); + final org.kie.dmn.model.api.dmndi.Point rightPoint = new org.kie.dmn.model.v1_2.dmndi.Point(); + rightPoint.setX(v.getBounds().getLowerRight().getX()); + rightPoint.setY(dlY); + dl.getWaypoint().add(rightPoint); + result.setDMNDecisionServiceDividerLine(dl); + } + return result; + } + + private static void applyFontStyle(final FontSet fontSet, + final DMNShape result) { + if (!(result.getStyle() instanceof DMNStyle)) { + return; + } + final DMNStyle shapeStyle = (DMNStyle) result.getStyle(); + final Color fontColor = ColorUtils.dmnFromWB(fontSet.getFontColour().getValue()); + shapeStyle.setFontColor(fontColor); + if (null != fontSet.getFontFamily().getValue()) { + shapeStyle.setFontFamily(fontSet.getFontFamily().getValue()); + } + if (null != fontSet.getFontSize().getValue()) { + shapeStyle.setFontSize(fontSet.getFontSize().getValue()); + } + } + + private static void applyBounds(final RectangleDimensionsSet dimensionsSet, + final Bounds bounds) { + if (null != dimensionsSet.getWidth().getValue() && + null != dimensionsSet.getHeight().getValue()) { + bounds.setWidth(dimensionsSet.getWidth().getValue()); + bounds.setHeight(dimensionsSet.getHeight().getValue()); + } + } + + private static void applyBackgroundStyles(final BackgroundSet bgset, + final DMNShape result) { + if (!(result.getStyle() instanceof DMNStyle)) { + return; + } + final DMNStyle style = (DMNStyle) result.getStyle(); + if (null != bgset.getBgColour().getValue()) { + style.setFillColor(ColorUtils.dmnFromWB(bgset.getBgColour().getValue())); + } + if (null != bgset.getBorderColour().getValue()) { + style.setStrokeColor(ColorUtils.dmnFromWB(bgset.getBorderColour().getValue())); + } + } + + @SuppressWarnings("unchecked") + private org.kie.dmn.model.api.DRGElement stunnerToDMN(final Node node, + final Consumer componentWidthsConsumer) { + if (node.getContent() instanceof View) { + final View view = (View) node.getContent(); + if (view.getDefinition() instanceof InputData) { + return inputDataConverter.dmnFromNode((Node, ?>) node, + componentWidthsConsumer); + } else if (view.getDefinition() instanceof Decision) { + return decisionConverter.dmnFromNode((Node, ?>) node, + componentWidthsConsumer); + } else if (view.getDefinition() instanceof BusinessKnowledgeModel) { + return bkmConverter.dmnFromNode((Node, ?>) node, + componentWidthsConsumer); + } else if (view.getDefinition() instanceof KnowledgeSource) { + return knowledgeSourceConverter.dmnFromNode((Node, ?>) node, + componentWidthsConsumer); + } else if (view.getDefinition() instanceof DecisionService) { + return decisionServiceConverter.dmnFromNode((Node, ?>) node, + componentWidthsConsumer); + } else { + throw new UnsupportedOperationException("Unsupported node type detected."); + } + } + throw new RuntimeException("wrong diagram structure to marshall"); + } + + @Override + public DiagramMetadataMarshaller getMetadataMarshaller() { + return diagramMetadataMarshaller; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNImportTypesHelperImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNImportTypesHelperImpl.java index 0b0008b6203..ec66fdfacf9 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNImportTypesHelperImpl.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNImportTypesHelperImpl.java @@ -18,6 +18,7 @@ import javax.enterprise.context.ApplicationScoped; import org.kie.workbench.common.dmn.api.editors.included.DMNImportTypes; +import org.kie.workbench.common.dmn.api.marshalling.DMNImportTypesHelper; import org.kie.workbench.common.stunner.core.util.StringUtils; import org.uberfire.backend.vfs.Path; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelper.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelper.java deleted file mode 100644 index 527e805e8e2..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelper.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.dmn.backend.common; - -import java.io.InputStream; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -import org.guvnor.common.services.project.model.WorkspaceProject; -import org.kie.dmn.model.api.DRGElement; -import org.kie.dmn.model.api.Definitions; -import org.kie.dmn.model.api.Import; -import org.kie.dmn.model.api.ItemDefinition; -import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; -import org.kie.workbench.common.dmn.backend.DMNMarshaller; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.uberfire.backend.vfs.Path; - -/** - * This helper provides methods to handle imports into the {@link DMNMarshaller}. - */ -public interface DMNMarshallerImportsHelper { - - /** - * This method loads all imported DMN definitions from a list of imports. - * @param metadata represents the metadata from the main DMN model. - * @param imports represent the list of imported files. - * @return a map {@link Definitions} indexed by {@link Import}s. - */ - Map getImportDefinitions(final Metadata metadata, - final List imports); - - /** - * This method loads all imported PMML documents from a list of imports. - * @param metadata represents the metadata from the main DMN model. - * @param imports represent the list of imported files. - * @return a map {@link PMMLDocumentMetadata} indexed by {@link Import}s. - */ - Map getPMMLDocuments(final Metadata metadata, - final List imports); - - /** - * This method loads {@link String} of all imported XML files from a list of imports. - * @param metadata represents the metadata from the main DMN model. - * @param imports represent the list of imported files. - * @return a map {@link String} indexed by {@link Import}s. - */ - Map getImportXML(final Metadata metadata, - final List imports); - - /** - * This method extract a list of {@link DRGElement}s from the importDefinitions map. - * @param importDefinitions is a map of {@link Definitions} indexed by {@link Import}. - * @return a list of imported {@link DRGElement}s. - */ - List getImportedDRGElements(final Map importDefinitions); - - /** - * This method extract a list of {@link ItemDefinition} from the importDefinitions map. - * @param importDefinitions is a map of {@link Definitions} indexed by {@link Import}. - * @return a list of imported {@link ItemDefinition}s. - */ - List getImportedItemDefinitions(final Map importDefinitions); - - /** - * This method finds the list of {@link ItemDefinition}s for a given namespace. - * @param workspaceProject represents the project that will be scanned. - * @param modelName is the value used as the prefix for imported {@link ItemDefinition}s. - * @param namespace is the namespace of the model that provides the list of {@link ItemDefinition}s. - * @return a list of imported {@link ItemDefinition}s. - */ - List getImportedItemDefinitionsByNamespace(final WorkspaceProject workspaceProject, - final String modelName, - final String namespace); - - /** - * This method finds the {@link Path} of DMN model. - * @param metadata represents the metadata from the a DMN model from the scanned project. - * @param modelNamespace represents the namespace of the desired DMN model. - * @param modelName represents the mode name of the desired DMN model. - * @return the {@link Path} of the desired DMN model. - */ - Path getDMNModelPath(final Metadata metadata, - final String modelNamespace, - final String modelName); - - /** - * This method loads the {@link InputStream} from a given {@link org.uberfire.backend.vfs.Path}. - * @param path to be loaded. - * @return the {@link InputStream} when the path is valid, otherwise is returns empty. - */ - Optional loadPath(final Path path); -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelperImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelperImpl.java deleted file mode 100644 index 59331879a6b..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelperImpl.java +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.dmn.backend.common; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.inject.Named; -import javax.xml.namespace.QName; - -import org.guvnor.common.services.project.model.WorkspaceProject; -import org.guvnor.common.services.project.service.WorkspaceProjectService; -import org.kie.dmn.api.marshalling.DMNMarshaller; -import org.kie.dmn.model.api.DRGElement; -import org.kie.dmn.model.api.Decision; -import org.kie.dmn.model.api.Definitions; -import org.kie.dmn.model.api.Import; -import org.kie.dmn.model.api.InformationItem; -import org.kie.dmn.model.api.InputData; -import org.kie.dmn.model.api.Invocable; -import org.kie.dmn.model.api.ItemDefinition; -import org.kie.dmn.model.v1_2.TInformationItem; -import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; -import org.kie.workbench.common.dmn.backend.editors.common.PMMLIncludedDocumentFactory; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.uberfire.backend.server.util.Paths; -import org.uberfire.backend.vfs.Path; -import org.uberfire.io.IOService; - -import static java.util.Collections.emptyList; -import static org.kie.workbench.common.dmn.api.editors.types.BuiltInTypeUtils.isBuiltInType; -import static org.kie.workbench.common.dmn.backend.definition.v1_1.ImportedItemDefinitionConverter.withNamespace; - -@ApplicationScoped -public class DMNMarshallerImportsHelperImpl implements DMNMarshallerImportsHelper { - - private final DMNPathsHelper pathsHelper; - - private final WorkspaceProjectService projectService; - - private final IOService ioService; - - private final DMNMarshaller marshaller; - - private final DMNIOHelper dmnIOHelper; - - public static final QName NAMESPACE = new QName("Namespace"); - - private final PMMLIncludedDocumentFactory pmmlDocumentFactory; - - public DMNMarshallerImportsHelperImpl() { - this(null, null, null, null, null, null); - } - - @Inject - public DMNMarshallerImportsHelperImpl(final DMNPathsHelper pathsHelper, - final WorkspaceProjectService projectService, - final DMNMarshaller marshaller, - final DMNIOHelper dmnIOHelper, - final PMMLIncludedDocumentFactory pmmlDocumentFactory, - final @Named("ioStrategy") IOService ioService) { - this.pathsHelper = pathsHelper; - this.projectService = projectService; - this.marshaller = marshaller; - this.dmnIOHelper = dmnIOHelper; - this.pmmlDocumentFactory = pmmlDocumentFactory; - this.ioService = ioService; - } - - @Override - public Map getImportDefinitions(final Metadata metadata, - final List imports) { - - final Map importDefinitions = new HashMap<>(); - - if (imports.size() > 0) { - for (final Definitions definitions : getOtherDMNDiagramsDefinitions(metadata)) { - findImportByDefinitions(definitions, imports).ifPresent(anImport -> { - importDefinitions.put(anImport, definitions); - }); - } - } - - return importDefinitions; - } - - @Override - public Map getPMMLDocuments(final Metadata metadata, - final List imports) { - final Map pmmlDocuments = new HashMap<>(); - - if (imports.size() > 0) { - for (final Path pmmlDocumentPath : getPMMLDocumentPaths(metadata)) { - findImportByPMMLDocument(metadata.getPath(), pmmlDocumentPath, imports).ifPresent(anImport -> { - pmmlDocuments.put(anImport, pmmlDocumentFactory.getDocumentByPath(pmmlDocumentPath)); - }); - } - } - - return pmmlDocuments; - } - - @Override - public Map getImportXML(final Metadata metadata, - final List imports) { - - final Map importXML = new HashMap<>(); - - if (imports.size() > 0) { - for (final String xml : getOtherDMNDiagramsXML(metadata)) { - try (StringReader sr = toStringReader(xml)) { - final Definitions definitions = marshaller.unmarshal(sr); - findImportByDefinitions(definitions, imports).ifPresent(anImport -> { - importXML.put(anImport, xml); - }); - } - } - } - - return importXML; - } - - @Override - public Path getDMNModelPath(final Metadata metadata, - final String modelNamespace, - final String modelName) { - - final WorkspaceProject workspaceProject = getProject(metadata); - - for (final Path dmnModelPath : pathsHelper.getDMNModelsPaths(workspaceProject)) { - - final Optional definitions = getDefinitionsByPath(dmnModelPath); - - if (definitions.map(d -> Objects.equals(d.getNamespace(), modelNamespace) && Objects.equals(d.getName(), modelName)).orElse(false)) { - return dmnModelPath; - } - } - - throw new UnsupportedOperationException("No DMN model could be found for the following namespace: " + modelNamespace); - } - - @Override - public List getImportedDRGElements(final Map importDefinitions) { - - final List importedNodes = new ArrayList<>(); - - importDefinitions.forEach((anImport, definitions) -> { - importedNodes.addAll(getDrgElementsWithNamespace(definitions, anImport)); - }); - - return importedNodes; - } - - @Override - public List getImportedItemDefinitions(final Map importDefinitions) { - - final List itemDefinitions = new ArrayList<>(); - - importDefinitions.forEach((anImport, definitions) -> { - itemDefinitions.addAll(getItemDefinitionsWithNamespace(definitions, anImport)); - }); - - return itemDefinitions; - } - - @Override - public List getImportedItemDefinitionsByNamespace(final WorkspaceProject workspaceProject, - final String modelName, - final String namespace) { - - return findDefinitionsByNamespace(workspaceProject, namespace) - .map(Definitions::getItemDefinition) - .orElse(emptyList()); - } - - private Optional findDefinitionsByNamespace(final WorkspaceProject workspaceProject, - final String namespace) { - return pathsHelper - .getDMNModelsPaths(workspaceProject) - .stream() - .map(path -> getDefinitionsByPath(path).orElse(null)) - .filter(Objects::nonNull) - .filter(definitions -> Objects.equals(definitions.getNamespace(), namespace)) - .findAny(); - } - - List getItemDefinitionsWithNamespace(final Definitions definitions, - final Import anImport) { - - final List itemDefinitions = definitions.getItemDefinition(); - final String prefix = anImport.getName(); - - return itemDefinitions - .stream() - .map(itemDefinition -> withNamespace(itemDefinition, prefix)) - .collect(Collectors.toList()); - } - - List getDrgElementsWithNamespace(final Definitions definitions, - final Import anImport) { - return definitions - .getDrgElement() - .stream() - .map(drgElement -> drgElementWithNamespace(drgElement, anImport)) - .collect(Collectors.toList()); - } - - private DRGElement drgElementWithNamespace(final DRGElement drgElement, - final Import anImport) { - - final String namespace = anImport.getName(); - - drgElement.getAdditionalAttributes().put(NAMESPACE, anImport.getNamespace()); - drgElement.setId(namespace + ":" + drgElement.getId()); - drgElement.setName(namespace + "." + drgElement.getName()); - updateInformationItem(namespace, drgElement); - - return drgElement; - } - - private void updateInformationItem(final String namespace, - final DRGElement drgElement) { - - getInformationItem(drgElement).ifPresent(informationItem -> { - - final InformationItem tInformationItem = new TInformationItem(); - final QName qName = informationItem.getTypeRef(); - - if (qName != null && !isBuiltInType(qName.getLocalPart())) { - tInformationItem.setTypeRef(new QName(qName.getNamespaceURI(), namespace + "." + qName.getLocalPart(), qName.getPrefix())); - } - - setInformationItem(drgElement, tInformationItem); - }); - } - - private Optional getInformationItem(final DRGElement drgElement) { - - if (drgElement instanceof Decision) { - return Optional.of(((Decision) drgElement).getVariable()); - } - - if (drgElement instanceof InputData) { - return Optional.of(((InputData) drgElement).getVariable()); - } - - if (drgElement instanceof Invocable) { - return Optional.of(((Invocable) drgElement).getVariable()); - } - - return Optional.empty(); - } - - private void setInformationItem(final DRGElement drgElement, - final InformationItem informationItem) { - - if (drgElement instanceof Decision) { - ((Decision) drgElement).setVariable(informationItem); - } - - if (drgElement instanceof InputData) { - ((InputData) drgElement).setVariable(informationItem); - } - - if (drgElement instanceof Invocable) { - ((Invocable) drgElement).setVariable(informationItem); - } - } - - private Optional findImportByDefinitions(final Definitions definitions, - final List imports) { - return imports - .stream() - .filter(anImport -> Objects.equals(anImport.getNamespace(), definitions.getNamespace())) - .findAny(); - } - - private Optional findImportByPMMLDocument(final Path dmnModelPath, - final Path includedModelPath, - final List imports) { - return imports - .stream() - .filter(anImport -> Objects.equals(anImport.getLocationURI(), pathsHelper.getRelativeURI(dmnModelPath, includedModelPath))) - .findAny(); - } - - List getOtherDMNDiagramsDefinitions(final Metadata metadata) { - final List diagramPaths = pathsHelper.getDMNModelsPaths(getProject(metadata)); - return diagramPaths - .stream() - .filter(path -> !Objects.equals(metadata.getPath(), path)) - .map(path -> loadPath(path).orElse(null)) - .filter(Objects::nonNull) - .map(this::toDefinitions) - .filter(Objects::nonNull) - .collect(Collectors.toList()); - } - - private Definitions toDefinitions(final InputStream inputStream) { - try (InputStream inputStreamAutoClosable = inputStream; - InputStreamReader reader = toInputStreamReader(inputStreamAutoClosable)) { - return marshaller.unmarshal(reader); - } catch (IOException ioe) { - //Swallow. null is returned by default. - } - return null; - } - - List getPMMLDocumentPaths(final Metadata metadata) { - return pathsHelper.getPMMLModelsPaths(getProject(metadata)); - } - - InputStreamReader toInputStreamReader(final InputStream inputStream) { - return new InputStreamReader(inputStream); - } - - Optional getDefinitionsByPath(final Path dmnModelPath) { - return loadPath(dmnModelPath).map(this::toInputStreamReader).map(marshaller::unmarshal); - } - - StringReader toStringReader(final String xml) { - return new StringReader(xml); - } - - private List getOtherDMNDiagramsXML(final Metadata metadata) { - final List diagramPaths = pathsHelper.getDMNModelsPaths(getProject(metadata)); - return diagramPaths - .stream() - .filter(path -> !Objects.equals(metadata.getPath(), path)) - .map(path -> loadPath(path).orElse(null)) - .filter(Objects::nonNull) - .map(dmnIOHelper::isAsString) - .filter(Objects::nonNull) - .collect(Collectors.toList()); - } - - @Override - public Optional loadPath(final Path path) { - try { - return Optional.ofNullable(ioService.newInputStream(convertPath(path))); - } catch (final Exception e) { - return Optional.empty(); - } - } - - private WorkspaceProject getProject(final Metadata metadata) { - try { - return projectService.resolveProject(metadata.getPath()); - } catch (final Exception e) { - // There's not project when the webapp is running on standalone mode, thus NullPointerException is raised. - return null; - } - } - - org.uberfire.java.nio.file.Path convertPath(final Path path) { - return Paths.convert(path); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelperStandalone.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelperStandalone.java new file mode 100644 index 00000000000..21562d5dd75 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelperStandalone.java @@ -0,0 +1,26 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.backend.common; + +import org.kie.dmn.model.api.DRGElement; +import org.kie.dmn.model.api.Definitions; +import org.kie.dmn.model.api.Import; +import org.kie.dmn.model.api.ItemDefinition; +import org.kie.workbench.common.dmn.api.marshalling.DMNMarshallerImportsHelper; + +public interface DMNMarshallerImportsHelperStandalone extends DMNMarshallerImportsHelper { + +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelperStandaloneImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelperStandaloneImpl.java new file mode 100644 index 00000000000..e2504dfff0b --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelperStandaloneImpl.java @@ -0,0 +1,384 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.backend.common; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.inject.Named; +import javax.xml.namespace.QName; + +import org.guvnor.common.services.project.model.WorkspaceProject; +import org.guvnor.common.services.project.service.WorkspaceProjectService; +import org.kie.dmn.api.marshalling.DMNMarshaller; +import org.kie.dmn.model.api.DRGElement; +import org.kie.dmn.model.api.Decision; +import org.kie.dmn.model.api.Definitions; +import org.kie.dmn.model.api.Import; +import org.kie.dmn.model.api.InformationItem; +import org.kie.dmn.model.api.InputData; +import org.kie.dmn.model.api.Invocable; +import org.kie.dmn.model.api.ItemDefinition; +import org.kie.dmn.model.v1_2.TInformationItem; +import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; +import org.kie.workbench.common.dmn.api.marshalling.DMNPathsHelper; +import org.kie.workbench.common.dmn.backend.editors.common.PMMLIncludedDocumentFactory; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.uberfire.backend.server.util.Paths; +import org.uberfire.backend.vfs.Path; +import org.uberfire.io.IOService; + +import static java.util.Collections.emptyList; +import static org.kie.workbench.common.dmn.api.editors.types.BuiltInTypeUtils.isBuiltInType; +import static org.kie.workbench.common.dmn.backend.definition.v1_1.ImportedItemDefinitionConverter.withNamespace; + +@ApplicationScoped +public class DMNMarshallerImportsHelperStandaloneImpl implements DMNMarshallerImportsHelperStandalone { + + private final DMNPathsHelper pathsHelper; + + private final WorkspaceProjectService projectService; + + private final IOService ioService; + + private final DMNMarshaller marshaller; + + private final DMNIOHelper dmnIOHelper; + + public static final QName NAMESPACE = new QName("Namespace"); + + private final PMMLIncludedDocumentFactory pmmlDocumentFactory; + + public DMNMarshallerImportsHelperStandaloneImpl() { + this(null, null, null, null, null, null); + } + + @Inject + public DMNMarshallerImportsHelperStandaloneImpl(final DMNPathsHelper pathsHelper, + final WorkspaceProjectService projectService, + final DMNMarshaller marshaller, + final DMNIOHelper dmnIOHelper, + final PMMLIncludedDocumentFactory pmmlDocumentFactory, + final @Named("ioStrategy") IOService ioService) { + this.pathsHelper = pathsHelper; + this.projectService = projectService; + this.marshaller = marshaller; + this.dmnIOHelper = dmnIOHelper; + this.pmmlDocumentFactory = pmmlDocumentFactory; + this.ioService = ioService; + } + + @Override + public Map getImportDefinitions(final Metadata metadata, + final List imports) { + + final Map importDefinitions = new HashMap<>(); + + if (imports.size() > 0) { + for (final Definitions definitions : getOtherDMNDiagramsDefinitions(metadata)) { + findImportByDefinitions(definitions, imports).ifPresent(anImport -> { + importDefinitions.put(anImport, definitions); + }); + } + } + + return importDefinitions; + } + + @Override + public Map getPMMLDocuments(final Metadata metadata, + final List imports) { + final Map pmmlDocuments = new HashMap<>(); + + if (imports.size() > 0) { + for (final Path pmmlDocumentPath : getPMMLDocumentPaths(metadata)) { + findImportByPMMLDocument(metadata.getPath(), pmmlDocumentPath, imports).ifPresent(anImport -> { + pmmlDocuments.put(anImport, pmmlDocumentFactory.getDocumentByPath(pmmlDocumentPath)); + }); + } + } + + return pmmlDocuments; + } + + @Override + public Map getImportXML(final Metadata metadata, + final List imports) { + + final Map importXML = new HashMap<>(); + + if (imports.size() > 0) { + for (final String xml : getOtherDMNDiagramsXML(metadata)) { + try (final StringReader sr = toStringReader(xml)) { + final Definitions definitions = marshaller.unmarshal(sr); + findImportByDefinitions(definitions, imports).ifPresent(anImport -> { + importXML.put(anImport, xml); + }); + } + } + } + + return importXML; + } + + @Override + public Path getDMNModelPath(final Metadata metadata, + final String modelNamespace, + final String modelName) { + + final WorkspaceProject workspaceProject = getProject(metadata); + + for (final Path dmnModelPath : pathsHelper.getDMNModelsPaths(workspaceProject)) { + + final Optional definitions = getDefinitionsByPath(dmnModelPath); + + if (definitions.map(d -> Objects.equals(d.getNamespace(), modelNamespace) && Objects.equals(d.getName(), modelName)).orElse(false)) { + return dmnModelPath; + } + } + + throw new IllegalStateException("A path for the DMN model with namespace [" + modelNamespace + "] could not be found."); + } + + @Override + public List getImportedDRGElements(final Map importDefinitions) { + + final List importedNodes = new ArrayList<>(); + + importDefinitions.forEach((anImport, definitions) -> { + importedNodes.addAll(getDrgElementsWithNamespace(definitions, anImport)); + }); + + return importedNodes; + } + + @Override + public List getImportedItemDefinitions(final Map importDefinitions) { + + final List itemDefinitions = new ArrayList<>(); + + importDefinitions.forEach((anImport, definitions) -> { + itemDefinitions.addAll(getItemDefinitionsWithNamespace(definitions, anImport)); + }); + + return itemDefinitions; + } + + @Override + public List getImportedItemDefinitionsByNamespace(final WorkspaceProject workspaceProject, + final String modelName, + final String namespace) { + + return findDefinitionsByNamespace(workspaceProject, namespace) + .map(Definitions::getItemDefinition) + .orElse(emptyList()); + } + + private Optional findDefinitionsByNamespace(final WorkspaceProject workspaceProject, + final String namespace) { + return pathsHelper + .getDMNModelsPaths(workspaceProject) + .stream() + .map(path -> getDefinitionsByPath(path).orElse(null)) + .filter(Objects::nonNull) + .filter(definitions -> Objects.equals(definitions.getNamespace(), namespace)) + .findAny(); + } + + List getItemDefinitionsWithNamespace(final Definitions definitions, + final Import anImport) { + + final List itemDefinitions = definitions.getItemDefinition(); + final String prefix = anImport.getName(); + + return itemDefinitions + .stream() + .map(itemDefinition -> withNamespace(itemDefinition, prefix)) + .collect(Collectors.toList()); + } + + List getDrgElementsWithNamespace(final Definitions definitions, + final Import anImport) { + return definitions + .getDrgElement() + .stream() + .map(drgElement -> drgElementWithNamespace(drgElement, anImport)) + .collect(Collectors.toList()); + } + + private DRGElement drgElementWithNamespace(final DRGElement drgElement, + final Import anImport) { + + final String namespace = anImport.getName(); + + drgElement.getAdditionalAttributes().put(NAMESPACE, anImport.getNamespace()); + drgElement.setId(namespace + ":" + drgElement.getId()); + drgElement.setName(namespace + "." + drgElement.getName()); + updateInformationItem(namespace, drgElement); + + return drgElement; + } + + private void updateInformationItem(final String namespace, + final DRGElement drgElement) { + + getInformationItem(drgElement).ifPresent(informationItem -> { + + final InformationItem tInformationItem = new TInformationItem(); + final QName qName = informationItem.getTypeRef(); + + if (qName != null && !isBuiltInType(qName.getLocalPart())) { + tInformationItem.setTypeRef(new QName(qName.getNamespaceURI(), namespace + "." + qName.getLocalPart(), qName.getPrefix())); + } + + setInformationItem(drgElement, tInformationItem); + }); + } + + private Optional getInformationItem(final DRGElement drgElement) { + + if (drgElement instanceof Decision) { + return Optional.of(((Decision) drgElement).getVariable()); + } + + if (drgElement instanceof InputData) { + return Optional.of(((InputData) drgElement).getVariable()); + } + + if (drgElement instanceof Invocable) { + return Optional.of(((Invocable) drgElement).getVariable()); + } + + return Optional.empty(); + } + + private void setInformationItem(final DRGElement drgElement, + final InformationItem informationItem) { + + if (drgElement instanceof Decision) { + ((Decision) drgElement).setVariable(informationItem); + } + + if (drgElement instanceof InputData) { + ((InputData) drgElement).setVariable(informationItem); + } + + if (drgElement instanceof Invocable) { + ((Invocable) drgElement).setVariable(informationItem); + } + } + + private Optional findImportByDefinitions(final Definitions definitions, + final List imports) { + return imports + .stream() + .filter(anImport -> Objects.equals(anImport.getNamespace(), definitions.getNamespace())) + .findAny(); + } + + private Optional findImportByPMMLDocument(final Path dmnModelPath, + final Path includedModelPath, + final List imports) { + return imports + .stream() + .filter(anImport -> Objects.equals(anImport.getLocationURI(), pathsHelper.getRelativeURI(dmnModelPath, includedModelPath))) + .findAny(); + } + + List getOtherDMNDiagramsDefinitions(final Metadata metadata) { + final List diagramPaths = pathsHelper.getDMNModelsPaths(getProject(metadata)); + return diagramPaths + .stream() + .filter(path -> !Objects.equals(metadata.getPath(), path)) + .map(path -> loadPath(path).orElse(null)) + .filter(Objects::nonNull) + .map(this::toDefinitions) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + } + + private Definitions toDefinitions(final InputStream inputStream) { + try (InputStream inputStreamAutoClosable = inputStream; + InputStreamReader reader = toInputStreamReader(inputStreamAutoClosable)) { + return marshaller.unmarshal(reader); + } catch (IOException ioe) { + //Swallow. null is returned by default. + } + return null; + } + + List getPMMLDocumentPaths(final Metadata metadata) { + return pathsHelper.getPMMLModelsPaths(getProject(metadata)); + } + + InputStreamReader toInputStreamReader(final InputStream inputStream) { + return new InputStreamReader(inputStream); + } + + Optional getDefinitionsByPath(final Path dmnModelPath) { + return loadPath(dmnModelPath).map(this::toInputStreamReader).map(marshaller::unmarshal); + } + + StringReader toStringReader(final String xml) { + return new StringReader(xml); + } + + private List getOtherDMNDiagramsXML(final Metadata metadata) { + final List diagramPaths = pathsHelper.getDMNModelsPaths(getProject(metadata)); + return diagramPaths + .stream() + .filter(path -> !Objects.equals(metadata.getPath(), path)) + .map(path -> loadPath(path).orElse(null)) + .filter(Objects::nonNull) + .map(dmnIOHelper::isAsString) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + } + + @Override + public Optional loadPath(final Path path) { + try { + return Optional.ofNullable(ioService.newInputStream(convertPath(path))); + } catch (final Exception e) { + return Optional.empty(); + } + } + + private WorkspaceProject getProject(final Metadata metadata) { + try { + return projectService.resolveProject(metadata.getPath()); + } catch (final Exception e) { + // There's not project when the webapp is running on standalone mode, thus NullPointerException is raised. + return null; + } + } + + org.uberfire.java.nio.file.Path convertPath(final Path path) { + return Paths.convert(path); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNPathsHelperImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNPathsHelperImpl.java index 3480f57ad56..6537e947469 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNPathsHelperImpl.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNPathsHelperImpl.java @@ -28,6 +28,8 @@ import javax.inject.Named; import org.guvnor.common.services.project.model.WorkspaceProject; +import org.kie.workbench.common.dmn.api.marshalling.DMNImportTypesHelper; +import org.kie.workbench.common.dmn.api.marshalling.DMNPathsHelper; import org.kie.workbench.common.dmn.backend.editors.included.query.AllModelsValueFileExtensionIndexTerm; import org.kie.workbench.common.dmn.backend.editors.included.query.PMMLValueFileExtensionIndexTerm; import org.kie.workbench.common.dmn.backend.editors.types.query.DMNValueFileExtensionIndexTerm; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/common/IncludedModelFactory.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/common/IncludedModelFactory.java index b586002a570..22e0440b4ae 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/common/IncludedModelFactory.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/common/IncludedModelFactory.java @@ -27,8 +27,8 @@ import org.kie.workbench.common.dmn.api.editors.included.IncludedModel; import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; import org.kie.workbench.common.dmn.api.editors.included.PMMLIncludedModel; -import org.kie.workbench.common.dmn.backend.common.DMNImportTypesHelper; -import org.kie.workbench.common.dmn.backend.common.DMNPathsHelper; +import org.kie.workbench.common.dmn.api.marshalling.DMNImportTypesHelper; +import org.kie.workbench.common.dmn.api.marshalling.DMNPathsHelper; import org.kie.workbench.common.dmn.backend.editors.types.exceptions.DMNIncludeModelCouldNotBeCreatedException; import org.kie.workbench.common.services.shared.project.KieModuleService; import org.kie.workbench.common.stunner.core.diagram.Diagram; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/common/PMMLIncludedDocumentsFilter.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/common/PMMLIncludedDocumentsFilter.java index 6342b0bca1c..c0602d8e1a6 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/common/PMMLIncludedDocumentsFilter.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/common/PMMLIncludedDocumentsFilter.java @@ -25,7 +25,7 @@ import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; import org.kie.workbench.common.dmn.api.editors.included.PMMLIncludedModel; -import org.kie.workbench.common.dmn.backend.common.DMNPathsHelper; +import org.kie.workbench.common.dmn.api.marshalling.DMNPathsHelper; import org.uberfire.backend.vfs.Path; @Dependent diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/included/DMNIncludedModelsServiceImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/included/DMNIncludedModelsServiceImpl.java index a784d2ce50a..e2af23da5d7 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/included/DMNIncludedModelsServiceImpl.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/included/DMNIncludedModelsServiceImpl.java @@ -34,8 +34,8 @@ import org.kie.workbench.common.dmn.api.editors.included.IncludedModel; import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; import org.kie.workbench.common.dmn.api.editors.included.PMMLIncludedModel; -import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelper; -import org.kie.workbench.common.dmn.backend.common.DMNPathsHelper; +import org.kie.workbench.common.dmn.api.marshalling.DMNPathsHelper; +import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelperStandalone; import org.kie.workbench.common.dmn.backend.definition.v1_1.ImportedItemDefinitionConverter; import org.kie.workbench.common.dmn.backend.editors.common.DMNIncludedNodesFilter; import org.kie.workbench.common.dmn.backend.editors.common.IncludedModelFactory; @@ -56,14 +56,14 @@ public class DMNIncludedModelsServiceImpl implements DMNIncludedModelsService { private final PMMLIncludedDocumentsFilter includedDocumentsFilter; - private final DMNMarshallerImportsHelper importsHelper; + private final DMNMarshallerImportsHelperStandalone importsHelper; @Inject public DMNIncludedModelsServiceImpl(final DMNPathsHelper pathsHelper, final IncludedModelFactory includedModelFactory, final DMNIncludedNodesFilter includedNodesFilter, final PMMLIncludedDocumentsFilter includedDocumentsFilter, - final DMNMarshallerImportsHelper importsHelper) { + final DMNMarshallerImportsHelperStandalone importsHelper) { this.pathsHelper = pathsHelper; this.includedModelFactory = includedModelFactory; this.includedNodesFilter = includedNodesFilter; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/types/exceptions/DMNIncludeModelCouldNotBeCreatedException.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/types/exceptions/DMNIncludeModelCouldNotBeCreatedException.java index 0af4cd1db6d..520c6a3e2db 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/types/exceptions/DMNIncludeModelCouldNotBeCreatedException.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/editors/types/exceptions/DMNIncludeModelCouldNotBeCreatedException.java @@ -17,5 +17,11 @@ package org.kie.workbench.common.dmn.backend.editors.types.exceptions; public class DMNIncludeModelCouldNotBeCreatedException extends Exception { - // empty. + + public DMNIncludeModelCouldNotBeCreatedException() { + } + + public DMNIncludeModelCouldNotBeCreatedException(final String message) { + super(message); + } } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/validation/DMNDomainValidator.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/validation/DMNDomainValidator.java index 6175ab64f74..111692fe35c 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/validation/DMNDomainValidator.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/validation/DMNDomainValidator.java @@ -41,9 +41,9 @@ import org.kie.workbench.common.dmn.api.definition.model.Definitions; import org.kie.workbench.common.dmn.api.definition.model.Import; import org.kie.workbench.common.dmn.api.graph.DMNDiagramUtils; -import org.kie.workbench.common.dmn.backend.DMNMarshaller; +import org.kie.workbench.common.dmn.backend.DMNMarshallerStandalone; import org.kie.workbench.common.dmn.backend.common.DMNIOHelper; -import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelper; +import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelperStandalone; import org.kie.workbench.common.dmn.backend.definition.v1_1.ImportConverter; import org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils; import org.kie.workbench.common.stunner.core.diagram.Diagram; @@ -66,15 +66,15 @@ public class DMNDomainValidator implements DomainValidator { private DMNValidator dmnValidator; - private final DMNMarshaller dmnMarshaller; - private final DMNDiagramUtils dmnDiagramUtils; - private final DMNMarshallerImportsHelper importsHelper; + private DMNMarshallerStandalone dmnMarshaller; + private DMNDiagramUtils dmnDiagramUtils; + private DMNMarshallerImportsHelperStandalone importsHelper; private final DMNIOHelper dmnIOHelper; @Inject - public DMNDomainValidator(final DMNMarshaller dmnMarshaller, + public DMNDomainValidator(final DMNMarshallerStandalone dmnMarshaller, final DMNDiagramUtils dmnDiagramUtils, - final DMNMarshallerImportsHelper importsHelper, + final DMNMarshallerImportsHelperStandalone importsHelper, final DMNIOHelper dmnIOHelper) { this.dmnMarshaller = dmnMarshaller; this.dmnDiagramUtils = dmnDiagramUtils; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/DMNMarshallerStandaloneTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/DMNMarshallerStandaloneTest.java new file mode 100644 index 00000000000..28e0f3b5b01 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/DMNMarshallerStandaloneTest.java @@ -0,0 +1,2425 @@ +/* + * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.backend; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.math.BigDecimal; +import java.util.AbstractMap; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.OptionalInt; +import java.util.Scanner; +import java.util.Spliterator; +import java.util.Spliterators; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; + +import javax.xml.namespace.NamespaceContext; +import javax.xml.namespace.QName; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.apache.commons.lang3.StringUtils; +import org.apache.tools.ant.filters.StringInputStream; +import org.apache.tools.ant.util.ReaderInputStream; +import org.jboss.errai.marshalling.server.MappingContextSingleton; +import org.junit.Assert; +import org.junit.Assume; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.api.KieServices; +import org.kie.api.builder.Message; +import org.kie.api.builder.Message.Level; +import org.kie.api.builder.Results; +import org.kie.api.runtime.KieContainer; +import org.kie.dmn.api.core.DMNContext; +import org.kie.dmn.api.core.DMNDecisionResult; +import org.kie.dmn.api.core.DMNDecisionResult.DecisionEvaluationStatus; +import org.kie.dmn.api.core.DMNMessage; +import org.kie.dmn.api.core.DMNModel; +import org.kie.dmn.api.core.DMNResult; +import org.kie.dmn.api.core.DMNRuntime; +import org.kie.dmn.api.core.ast.BusinessKnowledgeModelNode; +import org.kie.dmn.backend.marshalling.v1x.DMNMarshallerFactory; +import org.kie.dmn.core.util.DMNRuntimeUtil; +import org.kie.dmn.core.util.KieHelper; +import org.kie.dmn.model.api.DRGElement; +import org.kie.dmn.model.api.DecisionTable; +import org.kie.dmn.model.api.Definitions; +import org.kie.dmn.model.api.FunctionKind; +import org.kie.dmn.model.api.Import; +import org.kie.dmn.model.api.dmndi.Bounds; +import org.kie.dmn.model.api.dmndi.Color; +import org.kie.dmn.model.api.dmndi.DMNEdge; +import org.kie.dmn.model.api.dmndi.DMNShape; +import org.kie.dmn.model.api.dmndi.DMNStyle; +import org.kie.dmn.model.api.dmndi.DiagramElement; +import org.kie.dmn.model.api.dmndi.Point; +import org.kie.dmn.model.v1_2.TDecision; +import org.kie.dmn.model.v1_2.TInputData; +import org.kie.dmn.model.v1_2.TItemDefinition; +import org.kie.dmn.model.v1_2.TTextAnnotation; +import org.kie.workbench.common.dmn.api.DMNDefinitionSet; +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.Association; +import org.kie.workbench.common.dmn.api.definition.model.AuthorityRequirement; +import org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel; +import org.kie.workbench.common.dmn.api.definition.model.Context; +import org.kie.workbench.common.dmn.api.definition.model.ContextEntry; +import org.kie.workbench.common.dmn.api.definition.model.DMNDiagram; +import org.kie.workbench.common.dmn.api.definition.model.DMNElement; +import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase; +import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase.Namespace; +import org.kie.workbench.common.dmn.api.definition.model.Decision; +import org.kie.workbench.common.dmn.api.definition.model.DecisionService; +import org.kie.workbench.common.dmn.api.definition.model.Expression; +import org.kie.workbench.common.dmn.api.definition.model.FunctionDefinition; +import org.kie.workbench.common.dmn.api.definition.model.ImportDMN; +import org.kie.workbench.common.dmn.api.definition.model.ImportPMML; +import org.kie.workbench.common.dmn.api.definition.model.InformationItem; +import org.kie.workbench.common.dmn.api.definition.model.InformationRequirement; +import org.kie.workbench.common.dmn.api.definition.model.InputData; +import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeRequirement; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeSource; +import org.kie.workbench.common.dmn.api.definition.model.LiteralExpression; +import org.kie.workbench.common.dmn.api.definition.model.TextAnnotation; +import org.kie.workbench.common.dmn.api.editors.included.DMNImportTypes; +import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; +import org.kie.workbench.common.dmn.api.factory.DMNGraphFactoryImpl; +import org.kie.workbench.common.dmn.api.graph.DMNDiagramUtils; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.types.BuiltInType; +import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelperStandalone; +import org.kie.workbench.common.dmn.backend.definition.v1_1.DecisionConverter; +import org.kie.workbench.common.dmn.backend.definition.v1_1.InputDataConverter; +import org.kie.workbench.common.dmn.backend.definition.v1_1.TextAnnotationConverter; +import org.kie.workbench.common.dmn.backend.producers.DMNMarshallerProducer; +import org.kie.workbench.common.stunner.core.backend.StunnerTestingGraphBackendAPI; +import org.kie.workbench.common.stunner.core.backend.service.XMLEncoderDiagramMetadataMarshaller; +import org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.DiagramImpl; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bound; +import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Child; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.ControlPoint; +import org.kie.workbench.common.stunner.core.graph.content.view.MagnetConnection; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; +import org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl; +import org.kie.workbench.common.stunner.core.graph.processing.index.map.MapIndexBuilder; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.uberfire.commons.uuid.UUID; +import org.xml.sax.InputSource; + +import static java.util.Arrays.asList; +import static org.assertj.core.api.Assertions.assertThat; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyList; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class DMNMarshallerStandaloneTest { + + private static final Logger LOG = LoggerFactory.getLogger(DMNMarshallerStandaloneTest.class); + private static final String DMN_DEF_SET_ID = BindableAdapterUtils.getDefinitionSetId(DMNDefinitionSet.class); + + @Mock + private DMNMarshallerImportsHelperStandalone dmnMarshallerImportsHelper; + + private StunnerTestingGraphBackendAPI api; + + @Before + @SuppressWarnings("unchecked") + public void setup() throws Exception { + api = StunnerTestingGraphBackendAPI.build(DMNDefinitionSet.class); + api.getFactoryManager().registry().register(new DMNGraphFactoryImpl(api.getDefinitionManager(), + api.getFactoryManager(), + api.commandManager, + api.commandFactory, + new MapIndexBuilder())); + } + + /** + * Two issues bellow prevents us from running marshalling tests on IBM jdk + * https://support.oracle.com/knowledge/Middleware/1459269_1.html + * https://www-01.ibm.com/support/docview.wss?uid=swg1PK99682 + */ + @Before + public void doNotRunTestsOnIbmJdk() { + final String ibmVendorName = "IBM"; + final String javaVendorPropertyKey = "java.vendor"; + Assume.assumeFalse(StringUtils.containsIgnoreCase(System.getProperty(javaVendorPropertyKey), ibmVendorName)); + } + + @Test + public void testDynamicMarshallers() { + // This is a fail-fast for Errai's dynamic marshallers. It isn't needed as such for + // testing DMNMarshallerStandalone however issues with Errai's dynamic marshaller generation will + // otherwise be reported when compiling the webapp. + MappingContextSingleton.loadDynamicMarshallers(); + } + + @Test + public void testLoan() throws IOException { + roundTripUnmarshalMarshalThenUnmarshalDMN(getClass().getResourceAsStream("/Loan Pre-Qualification.dmn")); + DMNMarshallerStandalone m = getDMNMarshaller(); + Graph g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/Loan Pre-Qualification.dmn")); + DiagramImpl diagram = createDiagram(); + diagram.setGraph(g); + String mString = m.marshall(diagram); + final KieServices ks = KieServices.Factory.get(); + final KieContainer kieContainer = KieHelper.getKieContainer(ks.newReleaseId("org.kie", "dmn-testLoan", "1.0"), + ks.getResources().newByteArrayResource(mString.getBytes()).setTargetPath("src/main/resources/Loan Pre-Qualification.dmn")); + + final DMNRuntime runtime = kieContainer.newKieSession().getKieRuntime(DMNRuntime.class); + Assert.assertNotNull(runtime); + DMNModel model = runtime.getModel("http://www.trisotech.com/definitions/_4e0a7f15-3176-427e-add8-68d30903c84c", "Loan Pre-Qualification"); + DMNContext dmnContext = runtime.newContext(); + dmnContext.set("Credit Score", new HashMap() {{ + put("FICO", 400); + }}); + DMNResult dmnResult = runtime.evaluateByName(model, dmnContext, "Credit Score Rating"); + assertFalse(dmnResult.getMessages().toString(), dmnResult.hasErrors()); + } + + @Test + public void test_DecisionTableInputOutputClausesWhenEmpty() throws IOException { + DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/qGslQdo2.dmn")); + Assert.assertNotNull(runtime); + + DMNModel model = runtime.getModel("https://github.com/kiegroup/drools/kie-dmn/_A2C75C01-7EAD-46B8-A499-D85D6C07D273", "_5FE8CBFD-821B-41F6-A6C7-42BE3FC45F2F"); + Assert.assertNotNull(model); + assertThat(model.hasErrors(), is(false)); + + DMNContext dmnContext = runtime.newContext(); + dmnContext.set("my number", -99); + + DMNResult dmnResult = runtime.evaluateAll(model, dmnContext); + LOG.debug("{}", dmnResult); + assertThat(dmnResult.hasErrors(), is(false)); + assertThat(dmnResult.getDecisionResultByName("my decision").getEvaluationStatus(), is(DecisionEvaluationStatus.SUCCEEDED)); + assertThat(dmnResult.getDecisionResultByName("my decision").getResult(), is("negative")); + + org.kie.dmn.model.api.DecisionTable dmnDT = (DecisionTable) model.getDecisionByName("my decision").getDecision().getExpression(); + assertThat(dmnDT.getInput().get(0).getInputValues(), nullValue()); // DROOLS-3262 + assertThat(dmnDT.getOutput().get(0).getOutputValues(), nullValue()); // DROOLS-3262 + assertThat(dmnDT.getOutput().get(0).getDefaultOutputEntry(), nullValue()); // DROOLS-3262 + assertThat(dmnDT.getOutput().get(0).getName(), nullValue()); // DROOLS-3281 + } + + @Test + public void test_diamond() throws IOException { + // round trip test + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/diamondDMN12.dmn"), + this::checkDiamondGraph); + + // additionally, check the marshalled is still DMN executable as expected + DMNMarshallerStandalone m = getDMNMarshaller(); + Graph g = m.unmarshall(createMetadata(), + this.getClass().getResourceAsStream("/diamondDMN12.dmn")); + DiagramImpl diagram = createDiagram(); + diagram.setGraph(g); + + String mString = m.marshall(diagram); + final KieServices ks = KieServices.Factory.get(); + final KieContainer kieContainer = KieHelper.getKieContainer(ks.newReleaseId("org.kie", + "dmn-test_diamond", + "1.0"), + ks.getResources().newByteArrayResource(mString.getBytes()).setTargetPath("src/main/resources/diamond.dmn")); + + final DMNRuntime runtime = kieContainer.newKieSession().getKieRuntime(DMNRuntime.class); + Assert.assertNotNull(runtime); + DMNModel diamondModel = runtime.getModel("http://www.trisotech.com/definitions/_8afa6c24-55c8-43cf-8a02-fdde7fc5d1f2", + "three decisions in a diamond shape"); + DMNContext dmnContext = runtime.newContext(); + dmnContext.set("My Name", + "John Doe"); + DMNResult dmnResult = runtime.evaluateAll(diamondModel, + dmnContext); + assertFalse(dmnResult.getMessages().toString(), + dmnResult.hasErrors()); + DMNContext result = dmnResult.getContext(); + assertEquals("Hello, John Doe.", + result.get("My Decision")); + + // additionally, check DMN DD/DI + org.kie.dmn.api.marshalling.DMNMarshaller dmnMarshaller = DMNMarshallerFactory.newDefaultMarshaller(); + Definitions definitions = dmnMarshaller.unmarshal(mString); + + org.kie.dmn.model.api.dmndi.DMNDiagram ddRoot = (org.kie.dmn.model.api.dmndi.DMNDiagram) definitions.getDMNDI().getDMNDiagram().get(0); + + DMNShape myname = findShapeByDMNI(ddRoot, "_4cd17e52-6253-41d6-820d-5824bf5197f3"); + assertBounds(500, 500, 100, 50, myname.getBounds()); + assertColor(255, 255, 255, ((DMNStyle) myname.getStyle()).getFillColor()); + assertColor(0, 0, 0, ((DMNStyle) myname.getStyle()).getStrokeColor()); + assertDMNStyle("Open Sans", 24, 255, 0, 0, (DMNStyle) myname.getStyle()); + + DMNShape prefix = findShapeByDMNI(ddRoot, "_e920f38a-293c-41b8-adb3-69d0dc184fab"); + assertBounds(300, 400, 100, 50, prefix.getBounds()); + assertColor(0, 253, 25, ((DMNStyle) prefix.getStyle()).getFillColor()); + assertColor(253, 0, 0, ((DMNStyle) prefix.getStyle()).getStrokeColor()); + assertDMNStyle("Times New Roman", 8, 70, 60, 50, (DMNStyle) prefix.getStyle()); + + DMNShape postfix = findShapeByDMNI(ddRoot, "_f49f9c34-29d5-4e72-91d2-f4f92117c8da"); + assertBounds(700, 400, 100, 50, postfix.getBounds()); + assertColor(247, 255, 0, ((DMNStyle) postfix.getStyle()).getFillColor()); + assertColor(0, 51, 255, ((DMNStyle) postfix.getStyle()).getStrokeColor()); + assertDMNStyle("Arial", 10, 50, 60, 70, (DMNStyle) postfix.getStyle()); + + DMNShape mydecision = findShapeByDMNI(ddRoot, "_9b061fc3-8109-42e2-9fe4-fc39c90b654e"); + assertBounds(487.5, 275, 125, 75, mydecision.getBounds()); + assertColor(255, 255, 255, ((DMNStyle) mydecision.getStyle()).getFillColor()); + assertColor(0, 0, 0, ((DMNStyle) mydecision.getStyle()).getStrokeColor()); + assertDMNStyle("Monospaced", 32, 55, 66, 77, (DMNStyle) mydecision.getStyle()); + } + + private void assertDMNStyle(String fontName, double fontSize, int r, int g, int b, DMNStyle style) { + assertEquals(fontName, style.getFontFamily()); + assertEquals(fontSize, style.getFontSize(), 0); + assertColor(r, g, b, style.getFontColor()); + } + + private static void assertBounds(double x, double y, double width, double height, Bounds bounds) { + assertEquals(x, bounds.getX(), 0); + assertEquals(y, bounds.getY(), 0); + assertEquals(width, bounds.getWidth(), 0); + assertEquals(height, bounds.getHeight(), 0); + } + + private static void assertColor(int r, int g, int b, Color color) { + assertEquals(r, color.getRed()); + assertEquals(g, color.getGreen()); + assertEquals(b, color.getBlue()); + } + + private static DMNShape findShapeByDMNI(org.kie.dmn.model.api.dmndi.DMNDiagram root, String id) { + return root.getDMNDiagramElement().stream() + .filter(DMNShape.class::isInstance) + .map(DMNShape.class::cast) + .filter(shape -> shape.getDmnElementRef().getLocalPart().equals(id)) + .findFirst() + .orElseThrow(() -> new UnsupportedOperationException("There is no DMNShape with id '" + id + "' in DMNDiagram " + root)); + } + + private static DMNEdge findEdgeByDMNI(org.kie.dmn.model.api.dmndi.DMNDiagram root, String id) { + return root.getDMNDiagramElement().stream() + .filter(DMNEdge.class::isInstance) + .map(DMNEdge.class::cast) + .filter(shape -> shape.getDmnElementRef().getLocalPart().equals(id)) + .findFirst() + .orElseThrow(() -> new UnsupportedOperationException("There is no DMNEdge with id '" + id + "' in DMNDiagram " + root)); + } + + @Test + public void test_potpourri_drawing() throws IOException { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/potpourri_drawing.dmn"), + this::checkPotpourriGraph); + } + + @Test + public void testAssociations() throws IOException { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/associations.dmn"), + this::checkAssociationsGraph); + } + + @Test + public void testTextAnnotation() throws Exception { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/textAnnotation.dmn"), + this::checkTextAnnotationGraph); + } + + @Test + public void testTextAnnotationWithCDATA() throws Exception { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/textAnnotationCDATA.dmn"), + this::checkTextAnnotationGraph); + } + + @Test + public void testDecisionWithContext() throws Exception { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/DecisionWithContext.dmn"), + this::checkDecisionWithContext); + } + + @Test + public void testDecisionWithContextWithDefaultResult() throws Exception { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/DecisionWithContextWithDefaultResult.dmn"), + this::checkDecisionWithContextWithDefaultResult); + } + + @Test + public void testDecisionWithContextWithoutDefaultResult() throws Exception { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/DecisionWithContextWithoutDefaultResult.dmn"), + this::checkDecisionWithContextWithoutDefaultResult); + } + + @Test + public void testEdgewaypoint() throws Exception { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/edgewaypoint.dmn"), + this::checkEdgewaypoint); + } + + @Test + public void test_decisionqa() throws IOException { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/decisionqa.dmn"), + this::checkDecisionqa); + } + + @Test + public void test_decisionservice_1outputDecision() throws IOException { + final DMNMarshallerStandalone m = getDMNMarshaller(); + @SuppressWarnings("unchecked") + final Graph> g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/DROOLS-3372.dmn")); + Node nodeDS = g.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); + Node nodeDecisionPostfix = g.getNode("_3a69915a-30af-4de3-a07f-6be514f53caa"); + moveNode(nodeDecisionPostfix, 0, -280); + makeNodeChildOf(nodeDecisionPostfix, nodeDS); + DiagramImpl diagram = createDiagram(); + diagram.setGraph(g); + String mString = m.marshall(diagram); + LOG.debug("MARSHALLED ROUNDTRIP RESULTING xml:\n{}\n", mString); + roundTripUnmarshalThenMarshalUnmarshal(new ReaderInputStream(new StringReader(mString)), + this::check_decisionservice_1outputDecision); + } + + @SuppressWarnings("unchecked") + private void check_decisionservice_1outputDecision(Graph> graph) { + Node node = graph.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); + assertNodeContentDefinitionIs(node, DecisionService.class); + DecisionService definition = ((View) node.getContent()).getDefinition(); + assertEquals(0, definition.getEncapsulatedDecision().size()); + assertEquals(0, definition.getInputData().size()); + assertEquals(1, definition.getOutputDecision().size()); + assertEquals("#" + "_3a69915a-30af-4de3-a07f-6be514f53caa", definition.getOutputDecision().get(0).getHref()); + assertEquals(1, definition.getInputDecision().size()); + assertEquals("#" + "_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a", definition.getInputDecision().get(0).getHref()); + } + + @Test + public void test_decisionservice_1outputDecision1encapsulatedDecision() throws IOException { + final DMNMarshallerStandalone m = getDMNMarshaller(); + @SuppressWarnings("unchecked") + final Graph> g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/DROOLS-3372.dmn")); + Node nodeDS = g.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); + Node nodeDecisionPostfix = g.getNode("_3a69915a-30af-4de3-a07f-6be514f53caa"); + Node nodeDecisionPrefix = g.getNode("_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a"); + moveNode(nodeDecisionPostfix, 0, -280); + makeNodeChildOf(nodeDecisionPostfix, nodeDS); + moveNode(nodeDecisionPrefix, 0, -170); + makeNodeChildOf(nodeDecisionPrefix, nodeDS); + DiagramImpl diagram = createDiagram(); + diagram.setGraph(g); + String mString = m.marshall(diagram); + LOG.debug("MARSHALLED ROUNDTRIP RESULTING xml:\n{}\n", mString); + roundTripUnmarshalThenMarshalUnmarshal(new ReaderInputStream(new StringReader(mString)), + this::check_decisionservice_1outputDecision1encapsulatedDecision); + } + + @SuppressWarnings("unchecked") + private void check_decisionservice_1outputDecision1encapsulatedDecision(Graph> graph) { + Node node = graph.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); + assertNodeContentDefinitionIs(node, DecisionService.class); + DecisionService definition = ((View) node.getContent()).getDefinition(); + assertEquals(1, definition.getEncapsulatedDecision().size()); + assertEquals("#" + "_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a", definition.getEncapsulatedDecision().get(0).getHref()); + assertEquals(1, definition.getInputData().size()); + assertEquals("#" + "_dd5b090f-6d52-4bd8-8c7f-0c469983d44e", definition.getInputData().get(0).getHref()); + assertEquals(1, definition.getOutputDecision().size()); + assertEquals("#" + "_3a69915a-30af-4de3-a07f-6be514f53caa", definition.getOutputDecision().get(0).getHref()); + assertEquals(0, definition.getInputDecision().size()); + } + + @Test + public void test_decisionservice2_1outputDecision1encapsulatedDecision() throws IOException { + final DMNMarshallerStandalone m = getDMNMarshaller(); + @SuppressWarnings("unchecked") + final Graph> g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/DROOLS-3372bis.dmn")); + Node nodeDS = g.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); + Node nodeDecisionPostfix = g.getNode("_3a69915a-30af-4de3-a07f-6be514f53caa"); + Node nodeDecisionPrefix = g.getNode("_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a"); + moveNode(nodeDecisionPostfix, 0, -280); + makeNodeChildOf(nodeDecisionPostfix, nodeDS); + moveNode(nodeDecisionPrefix, 0, -170); + makeNodeChildOf(nodeDecisionPrefix, nodeDS); + DiagramImpl diagram = createDiagram(); + diagram.setGraph(g); + String mString = m.marshall(diagram); + LOG.debug("MARSHALLED ROUNDTRIP RESULTING xml:\n{}\n", mString); + roundTripUnmarshalThenMarshalUnmarshal(new ReaderInputStream(new StringReader(mString)), + this::check_decisionservice2_1outputDecision1encapsulatedDecision); + } + + @SuppressWarnings("unchecked") + private void check_decisionservice2_1outputDecision1encapsulatedDecision(Graph> graph) { + Node node = graph.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); + assertNodeContentDefinitionIs(node, DecisionService.class); + DecisionService definition = ((View) node.getContent()).getDefinition(); + assertEquals(3, definition.getEncapsulatedDecision().size()); + assertEquals("#_ca9d65e7-a5fa-4a13-98b7-8404f4601147", definition.getEncapsulatedDecision().get(0).getHref()); + assertEquals("#_4b02cf97-5f9b-48ee-a4ae-229233238876", definition.getEncapsulatedDecision().get(1).getHref()); + assertEquals("#" + "_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a", definition.getEncapsulatedDecision().get(2).getHref()); + assertEquals(1, definition.getInputData().size()); + assertEquals("#" + "_dd5b090f-6d52-4bd8-8c7f-0c469983d44e", definition.getInputData().get(0).getHref()); + assertEquals(3, definition.getOutputDecision().size()); + assertEquals("#_a5d0e474-083f-44ef-b00e-4ddc9a9ebd34", definition.getOutputDecision().get(0).getHref()); + assertEquals("#_8878539e-1c50-4622-b601-5878c97dc34e", definition.getOutputDecision().get(1).getHref()); + assertEquals("#" + "_3a69915a-30af-4de3-a07f-6be514f53caa", definition.getOutputDecision().get(2).getHref()); + assertEquals(0, definition.getInputDecision().size()); + } + + @Test + public void test_decisionservice2_remove_1outputDecision1encapsulatedDecision() throws IOException { + final DMNMarshallerStandalone m = getDMNMarshaller(); + @SuppressWarnings("unchecked") + final Graph> g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/DROOLS-3372bis.dmn")); + Node nodeDS = g.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); + Node nodeDecisionPostfix = g.getNode("_3a69915a-30af-4de3-a07f-6be514f53caa"); + Node nodeDecisionPrefix = g.getNode("_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a"); + moveNode(nodeDecisionPostfix, 0, -280); + makeNodeChildOf(nodeDecisionPostfix, nodeDS); + moveNode(nodeDecisionPrefix, 0, -170); + makeNodeChildOf(nodeDecisionPrefix, nodeDS); + DiagramImpl diagram = createDiagram(); + Node nodeEncaps1 = g.getNode("_ca9d65e7-a5fa-4a13-98b7-8404f4601147"); + moveNode(nodeEncaps1, 0, +400); + removeNodeChildOf(nodeEncaps1, nodeDS); + Node nodeEncaps2 = g.getNode("_4b02cf97-5f9b-48ee-a4ae-229233238876"); + moveNode(nodeEncaps2, 0, +400); + removeNodeChildOf(nodeEncaps2, nodeDS); + Node nodeHardcoded2 = g.getNode("_8878539e-1c50-4622-b601-5878c97dc34e"); + moveNode(nodeHardcoded2, 0, +400); + removeNodeChildOf(nodeHardcoded2, nodeDS); + diagram.setGraph(g); + String mString = m.marshall(diagram); + LOG.debug("MARSHALLED ROUNDTRIP RESULTING xml:\n{}\n", mString); + roundTripUnmarshalThenMarshalUnmarshal(new ReaderInputStream(new StringReader(mString)), + this::check_decisionservice2_remove_1outputDecision1encapsulatedDecision); + } + + private void removeNodeChildOf(Node childNode, Node nodeDS) { + nodeDS.getOutEdges().removeIf(x -> { + Edge, ?> edge = x; + return edge.getContent() instanceof Child && edge.getTargetNode().equals(childNode); + }); + childNode.getInEdges().removeIf(x -> { + Edge, ?> edge = x; + return edge.getContent() instanceof Child && edge.getSourceNode().equals(nodeDS); + }); + } + + @SuppressWarnings("unchecked") + private void check_decisionservice2_remove_1outputDecision1encapsulatedDecision(Graph> graph) { + Node node = graph.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); + assertNodeContentDefinitionIs(node, DecisionService.class); + DecisionService definition = ((View) node.getContent()).getDefinition(); + assertEquals(1, definition.getEncapsulatedDecision().size()); + // no more "#_ca9d65e7-a5fa-4a13-98b7-8404f4601147" + // no more "#_4b02cf97-5f9b-48ee-a4ae-229233238876" + assertEquals("#" + "_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a", definition.getEncapsulatedDecision().get(0).getHref()); + assertEquals(1, definition.getInputData().size()); + assertEquals("#" + "_dd5b090f-6d52-4bd8-8c7f-0c469983d44e", definition.getInputData().get(0).getHref()); + assertEquals(2, definition.getOutputDecision().size()); + assertEquals("#_a5d0e474-083f-44ef-b00e-4ddc9a9ebd34", definition.getOutputDecision().get(0).getHref()); + // no more "#_8878539e-1c50-4622-b601-5878c97dc34e" + assertEquals("#" + "_3a69915a-30af-4de3-a07f-6be514f53caa", definition.getOutputDecision().get(1).getHref()); + assertEquals(1, definition.getInputDecision().size()); + assertEquals("#_ca9d65e7-a5fa-4a13-98b7-8404f4601147", definition.getInputDecision().get(0).getHref()); + } + + private void makeNodeChildOf(Node nodeDecisionPostfix, Node nodeDS) { + Edge myEdge = new EdgeImpl<>(UUID.uuid()); + myEdge.setContent(new Child()); + myEdge.setSourceNode(nodeDS); + myEdge.setTargetNode(nodeDecisionPostfix); + nodeDS.getOutEdges().add(myEdge); + nodeDecisionPostfix.getInEdges().add(myEdge); + } + + private void moveNode(Node nodeDecisionPostfix, int dx, int dy) { + View content = (View) nodeDecisionPostfix.getContent(); + Bound ul = content.getBounds().getUpperLeft(); + Bound lr = content.getBounds().getLowerRight(); + content.setBounds(org.kie.workbench.common.stunner.core.graph.content.Bounds.create(ul.getX() + dx, ul.getY() + dy, lr.getX() + dx, lr.getY() + dy)); + } + + @Test + public void test_decisionservice3_evaluate() throws IOException { + DMNRuntime dmnRuntime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/DROOLS-3372evaluate.dmn")); + assertThat(dmnRuntime.getModels()).hasSize(1); + final DMNModel dmnModel = dmnRuntime.getModels().get(0); + final DMNContext context = dmnRuntime.newContext(); + context.set("in1", "asd"); + final DMNResult result = dmnRuntime.evaluateAll(dmnModel, context); + assertThat(result.getDecisionResultByName("outInDS").getResult()).isEqualTo("outInDSasd"); + assertThat(result.getDecisionResultByName("out1").getResult()).isEqualTo("outInDSp1 outInDSin1"); + } + + @Test + public void test_fontsize_stunner() throws IOException { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/test-FontSize-stunner.dmn"), + this::checkFontsize_stunner); + } + + @SuppressWarnings("unchecked") + private void checkFontsize_stunner(Graph> graph) { + Node node = graph.getNode("_A9D510E0-1942-4945-A945-0213EC6AAEC5"); + assertNodeContentDefinitionIs(node, InputData.class); + InputData definition = ((View) node.getContent()).getDefinition(); + assertEquals(Double.valueOf(21), definition.getFontSet().getFontSize().getValue()); + } + + @Test + public void test_fontsize_sharedStyle() throws IOException { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/test-FontSize-sharedStyle.dmn"), + this::checkFontsize_sharedStyle); + } + + @SuppressWarnings("unchecked") + private void checkFontsize_sharedStyle(Graph> graph) { + Node node = graph.getNode("_38b74e2e-32f8-42c5-ab51-8a3e927637e0"); + assertNodeContentDefinitionIs(node, InputData.class); + InputData definition = ((View) node.getContent()).getDefinition(); + assertEquals(Double.valueOf(21), definition.getFontSet().getFontSize().getValue()); + } + + @SuppressWarnings("unchecked") + private void checkDecisionqa(Graph> graph) { + Node decision = graph.getNode("_7052d0f6-ccee-462b-bd89-76afc3b6f67b"); + assertNodeContentDefinitionIs(decision, + Decision.class); + Decision decisionDefinition = ((View) decision.getContent()).getDefinition(); + assertEquals("hardcoded question", decisionDefinition.getName().getValue()); + assertEquals("What is the codename?", decisionDefinition.getQuestion().getValue()); + assertEquals("47.", decisionDefinition.getAllowedAnswers().getValue()); + } + + @SuppressWarnings("unchecked") + private void checkEdgewaypoint(Graph> graph) { + Node decision = graph.getNode("_7647e26b-6c7c-46db-aa34-1a1a2b4d8d79"); + assertNodeContentDefinitionIs(decision, + Decision.class); + Decision decisionDefinition = ((View) decision.getContent()).getDefinition(); + assertEquals("my decision", + decisionDefinition.getName().getValue()); + + Node inputdata = graph.getNode("_fd528e66-e2a4-4b7f-aae1-c3ca6723d0cb"); + assertNodeEdgesTo(inputdata, + decision, + InformationRequirement.class); + + // asserted the two Stunner graph nodes are properly connected, assert location of edge. + List> outEdges = (List>) inputdata.getOutEdges(); + Edge edge = outEdges.stream().filter(e -> e.getTargetNode().equals(decision)).findFirst().get(); + ViewConnector connectionContent = (ViewConnector) edge.getContent(); + Point2D sourceLocation = connectionContent.getSourceConnection().get().getLocation(); + assertEquals(266.9968013763428d, ((View) inputdata.getContent()).getBounds().getUpperLeft().getX() + sourceLocation.getX(), 0.1d); + assertEquals(225.99999618530273d, ((View) inputdata.getContent()).getBounds().getUpperLeft().getY() + sourceLocation.getY(), 0.1d); + + Point2D targetLocation = connectionContent.getTargetConnection().get().getLocation(); + assertEquals(552.2411708831787d, ((View) decision.getContent()).getBounds().getUpperLeft().getX() + targetLocation.getX(), 0.1d); + assertEquals(226d, ((View) decision.getContent()).getBounds().getUpperLeft().getY() + targetLocation.getY(), 0.1d); + + assertEquals(1, connectionContent.getControlPoints().length); + Point2D controlPointLocation = connectionContent.getControlPoints()[0].getLocation(); + assertEquals(398.61898612976074d, controlPointLocation.getX(), 0.1d); + assertEquals(116.99999809265137d, controlPointLocation.getY(), 0.1d); + + final Connection sourceConnection = connectionContent.getSourceConnection().get(); + assertTrue(sourceConnection instanceof MagnetConnection); + assertTrue(((MagnetConnection) sourceConnection).isAuto()); + + final Connection targetConnection = connectionContent.getTargetConnection().get(); + assertTrue(targetConnection instanceof MagnetConnection); + assertTrue(((MagnetConnection) targetConnection).isAuto()); + } + + @SuppressWarnings("unchecked") + private void checkTextAnnotationGraph(Graph> graph) { + Node textAnnotation = graph.getNode("60915990-9E1D-42DF-B7F6-0D28383BE9D1"); + assertNodeContentDefinitionIs(textAnnotation, + TextAnnotation.class); + TextAnnotation textAnnotationDefinition = ((View) textAnnotation.getContent()).getDefinition(); + assertEquals("描述", + textAnnotationDefinition.getDescription().getValue()); + assertEquals("This Annotation holds some Long text and also UTF-8 characters", + textAnnotationDefinition.getText().getValue()); + assertEquals("text/html", + textAnnotationDefinition.getTextFormat().getValue()); + } + + public void testTreeStructure() throws IOException { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/treeStructure.dmn"), + this::checkTreeStructureGraph); + } + + public void roundTripUnmarshalThenMarshalUnmarshal(InputStream dmnXmlInputStream, + Consumer>> checkGraphConsumer) throws IOException { + DMNMarshallerStandalone m = getDMNMarshaller(); + + // first unmarshal from DMN XML to Stunner DMN Graph + @SuppressWarnings("unchecked") + Graph> g = m.unmarshall(createMetadata(), + dmnXmlInputStream); + checkGraphConsumer.accept(g); + + // round trip to Stunner DMN Graph back to DMN XML + DiagramImpl diagram = createDiagram(); + diagram.setGraph(g); + + String mString = m.marshall(diagram); + LOG.debug(mString); + + // now unmarshal once more, from the marshalled just done above, back again to Stunner DMN Graph to complete check for round-trip + @SuppressWarnings("unchecked") + Graph> g2 = m.unmarshall(createMetadata(), + new StringInputStream(mString)); + checkGraphConsumer.accept(g2); + } + + private void checkTreeStructureGraph(Graph> graph) { + Node root = graph.getNode("BBF2B56F-A0AF-4428-AA6A-61A655D72883"); + Node decisionOne = graph.getNode("B7DD0DC9-7FAC-4510-9031-FFEE067CC2F5"); + Node decisionTwo = graph.getNode("DF84B353-A2F6-46B9-B680-EBD98F5084C8"); + Node decisionThree = graph.getNode("1B6EF5EB-CA09-45A5-AB03-21CD70F941AD"); + Node bkmRoot = graph.getNode("AD910446-56AD-49A5-99CE-F7B9C6F74E5E"); + Node bkmOne = graph.getNode("C1D0937E-96F4-4EAF-8A85-45B129F38E9B"); + Node bkmTwo = graph.getNode("47E47E51-4509-4A3B-86E9-D690F397B69C"); + Node annotation = graph.getNode("47C5A244-EF6D-473D-99B6-629F70A49FCC"); + Node knowledgeSource = graph.getNode("CFE44FA9-7309-4F28-81E9-5C1EF455B4C2"); + Node knowledgeSourceInput = graph.getNode("BC0D715A-ADD4-4136-AB3D-226EABC840A2"); + Node decisionOneInput = graph.getNode("CF65CEB9-433F-402F-A485-90AC34E2FE39"); + + assertNodeEdgesTo(decisionOne, + root, + InformationRequirement.class); + + assertNodeEdgesTo(decisionTwo, + decisionOne, + InformationRequirement.class); + + assertNodeEdgesTo(decisionThree, + decisionOne, + InformationRequirement.class); + + assertNodeEdgesTo(bkmRoot, + annotation, + Association.class); + + assertNodeEdgesTo(bkmRoot, + decisionOne, + KnowledgeRequirement.class); + + assertNodeEdgesTo(bkmOne, + bkmRoot, + KnowledgeRequirement.class); + + assertNodeEdgesTo(bkmTwo, + bkmRoot, + KnowledgeRequirement.class); + + assertNodeEdgesTo(decisionOneInput, + decisionOne, + InformationRequirement.class); + + assertNodeEdgesTo(knowledgeSource, + decisionOne, + AuthorityRequirement.class); + + assertNodeEdgesTo(knowledgeSourceInput, + knowledgeSource, + AuthorityRequirement.class); + } + + @SuppressWarnings("unchecked") + private void checkDecisionWithContext(Graph> g) { + Node decisionNode = g.getNode("_30810b88-8416-4c02-8ed1-8c19b7606243"); + assertNodeContentDefinitionIs(decisionNode, + Decision.class); + + Node rootNode = DMNMarshallerStandalone.findDMNDiagramRoot((Graph) g); + assertNotNull(rootNode); + assertRootNodeConnectedTo(rootNode, + decisionNode); + assertEquals("decisionNode parent is Definitions DMN root", + "_153e2b47-3bd2-4db0-828c-db3fce0b3199", + ((DMNElement) ((Decision) ((View) decisionNode.getContent()).getDefinition()).getParent()).getId().getValue()); + + Context context = (Context) ((Decision) ((View) decisionNode.getContent()).getDefinition()).getExpression(); + assertEquals("contextNode's parent is decisionNode", + "_30810b88-8416-4c02-8ed1-8c19b7606243", + ((DMNElement) context.getParent()).getId().getValue()); + + Expression literalExpression1 = context.getContextEntry().get(0).getExpression(); + assertEquals("literalExpression1's parent-parent is contextNode", + "_0f38d114-5d6e-40dd-aa9c-9f031f9b0571", + ((DMNElement) (literalExpression1).getParent() + .getParent()).getId().getValue()); + + Expression literalExpression2 = context.getContextEntry().get(1).getExpression(); + assertEquals("literalExpression2's parent-parent is contextNode", + "_0f38d114-5d6e-40dd-aa9c-9f031f9b0571", + ((DMNElement) (literalExpression2).getParent() + .getParent()).getId().getValue()); + } + + private void checkDecisionWithContextWithDefaultResult(Graph> g) { + Node decisionNode = g.getNode("_30810b88-8416-4c02-8ed1-8c19b7606243"); + assertNodeContentDefinitionIs(decisionNode, + Decision.class); + + Context context = (Context) ((Decision) ((View) decisionNode.getContent()).getDefinition()).getExpression(); + + InformationItem defaultResultVariable = context.getContextEntry().get(1).getVariable(); + assertNull("Default result variable", + defaultResultVariable); + Expression defaultResultExpression = context.getContextEntry().get(1).getExpression(); + assertNotNull("Default result expression", + defaultResultExpression); + assertEquals("defaultResultExpression's parent-parent is contextNode", + "_0f38d114-5d6e-40dd-aa9c-9f031f9b0571", + ((DMNElement) (defaultResultExpression).getParent() + .getParent()).getId().getValue()); + } + + private void checkDecisionWithContextWithoutDefaultResult(Graph> g) { + Node decisionNode = g.getNode("_30810b88-8416-4c02-8ed1-8c19b7606243"); + assertNodeContentDefinitionIs(decisionNode, + Decision.class); + + Context context = (Context) ((Decision) ((View) decisionNode.getContent()).getDefinition()).getExpression(); + + InformationItem defaultResultVariable = context.getContextEntry().get(1).getVariable(); + assertNull("Default result variable", + defaultResultVariable); + Expression defaultResultExpression = context.getContextEntry().get(1).getExpression(); + assertNull("Default result expression", + defaultResultExpression); + } + + @SuppressWarnings("unchecked") + private void checkDiamondGraph(Graph> g) { + Node idNode = g.getNode("_4cd17e52-6253-41d6-820d-5824bf5197f3"); + assertNodeContentDefinitionIs(idNode, + InputData.class); + assertNodeEdgesTo(idNode, + g.getNode("_e920f38a-293c-41b8-adb3-69d0dc184fab"), + InformationRequirement.class); + assertNodeEdgesTo(idNode, + g.getNode("_f49f9c34-29d5-4e72-91d2-f4f92117c8da"), + InformationRequirement.class); + assertNodeEdgesTo(idNode, + g.getNode("_9b061fc3-8109-42e2-9fe4-fc39c90b654e"), + InformationRequirement.class); + + Node prefixDecisionNode = g.getNode("_e920f38a-293c-41b8-adb3-69d0dc184fab"); + assertNodeContentDefinitionIs(prefixDecisionNode, + Decision.class); + assertNodeEdgesTo(prefixDecisionNode, + g.getNode("_9b061fc3-8109-42e2-9fe4-fc39c90b654e"), + InformationRequirement.class); + + Node postfixDecisionNode = g.getNode("_f49f9c34-29d5-4e72-91d2-f4f92117c8da"); + assertNodeContentDefinitionIs(postfixDecisionNode, + Decision.class); + assertNodeEdgesTo(postfixDecisionNode, + g.getNode("_9b061fc3-8109-42e2-9fe4-fc39c90b654e"), + InformationRequirement.class); + + Node myDecisionNode = g.getNode("_9b061fc3-8109-42e2-9fe4-fc39c90b654e"); + assertNodeContentDefinitionIs(myDecisionNode, + Decision.class); + + Node rootNode = DMNMarshallerStandalone.findDMNDiagramRoot((Graph) g); + assertNotNull(rootNode); + assertRootNodeConnectedTo(rootNode, + idNode); + assertRootNodeConnectedTo(rootNode, + prefixDecisionNode); + assertRootNodeConnectedTo(rootNode, + postfixDecisionNode); + assertRootNodeConnectedTo(rootNode, + myDecisionNode); + } + + @SuppressWarnings("unchecked") + private void checkAssociationsGraph(Graph> g) { + Node inputData = g.getNode("BD168F8B-4398-4478-8BEA-E67AA5F90FAF"); + assertNodeContentDefinitionIs(inputData, + InputData.class); + + Node decision = g.getNode("A960E2D2-FBC1-4D11-AA33-064F6A0B5CB9"); + assertNodeContentDefinitionIs(decision, + Decision.class); + + Node knowledgeSource = g.getNode("FB99ED65-BC43-4750-999F-7FE24690845B"); + assertNodeContentDefinitionIs(knowledgeSource, + KnowledgeSource.class); + + Node bkm = g.getNode("2F07453C-854F-436F-8378-4CFCE63BB124"); + assertNodeContentDefinitionIs(bkm, + BusinessKnowledgeModel.class); + + Node textAnnotation = g.getNode("7F4B8130-6F3D-4A16-9F6C-01D01DA481D2"); + assertNodeContentDefinitionIs(textAnnotation, + TextAnnotation.class); + + Edge fromInput = assertNodeEdgesTo(inputData, + textAnnotation, + Association.class); + assertEquals("From Input", + ((View) fromInput.getContent()).getDefinition().getDescription().getValue()); + + Edge fromDecision = assertNodeEdgesTo(decision, + textAnnotation, + Association.class); + assertEquals("From Decision", + ((View) fromDecision.getContent()).getDefinition().getDescription().getValue()); + + Edge fromBkm = assertNodeEdgesTo(bkm, + textAnnotation, + Association.class); + assertEquals("From BKM", + ((View) fromBkm.getContent()).getDefinition().getDescription().getValue()); + + Edge fromKnowledgeSource = assertNodeEdgesTo(knowledgeSource, + textAnnotation, + Association.class); + assertEquals("From Knowledge Source", + ((View) fromKnowledgeSource.getContent()).getDefinition().getDescription().getValue()); + } + + @SuppressWarnings("unchecked") + private void checkPotpourriGraph(Graph> g) { + Node _My_Input_Data = g.getNode("_My_Input_Data"); + assertNodeContentDefinitionIs(_My_Input_Data, + InputData.class); + assertNodeEdgesTo(_My_Input_Data, + g.getNode("_My_Decision_1"), + InformationRequirement.class); + assertNodeEdgesTo(_My_Input_Data, + g.getNode("_KS_of_Input_Data"), + AuthorityRequirement.class); + assertNodeEdgesTo(_My_Input_Data, + g.getNode("_Annotation_for_Input_Data"), + Association.class); + + Node _Annotation_for_Input_Data = g.getNode("_Annotation_for_Input_Data"); + assertNodeContentDefinitionIs(_Annotation_for_Input_Data, + TextAnnotation.class); + + Node _KS_of_Input_Data = g.getNode("_KS_of_Input_Data"); + assertNodeContentDefinitionIs(_KS_of_Input_Data, + KnowledgeSource.class); + + Node _KS_of_KS_of_InputData = g.getNode("_KS_of_KS_of_InputData"); + assertNodeContentDefinitionIs(_KS_of_KS_of_InputData, + KnowledgeSource.class); + assertNodeEdgesTo(_KS_of_KS_of_InputData, + g.getNode("_KS_of_Input_Data"), + AuthorityRequirement.class); + + Node _KS_of_KS_of_Decision_1 = g.getNode("_KS_of_KS_of_Decision_1"); + assertNodeContentDefinitionIs(_KS_of_KS_of_Decision_1, + KnowledgeSource.class); + assertNodeEdgesTo(_KS_of_KS_of_Decision_1, + g.getNode("_KS_of_Decision_1"), + AuthorityRequirement.class); + + Node _KS_of_Decision_1 = g.getNode("_KS_of_Decision_1"); + assertNodeContentDefinitionIs(_KS_of_Decision_1, + KnowledgeSource.class); + assertNodeEdgesTo(_KS_of_Decision_1, + g.getNode("_My_Decision_1"), + AuthorityRequirement.class); + + Node _My_Decision_2 = g.getNode("_My_Decision_2"); + assertNodeContentDefinitionIs(_My_Decision_2, + Decision.class); + assertNodeEdgesTo(_My_Decision_2, + g.getNode("_KS_of_Decision_2"), + AuthorityRequirement.class); + assertNodeEdgesTo(_My_Decision_2, + g.getNode("_Annotation_for_Decision_2"), + Association.class); + + Node _KS_of_Decision_2 = g.getNode("_KS_of_Decision_2"); + assertNodeContentDefinitionIs(_KS_of_Decision_2, + KnowledgeSource.class); + + Node _Annotation_for_Decision_2 = g.getNode("_Annotation_for_Decision_2"); + assertNodeContentDefinitionIs(_Annotation_for_Decision_2, + TextAnnotation.class); + + Node _Annotation_for_BKM_1 = g.getNode("_Annotation_for_BKM_1"); + assertNodeContentDefinitionIs(_Annotation_for_BKM_1, + TextAnnotation.class); + assertNodeEdgesTo(_Annotation_for_BKM_1, + g.getNode("_My_BKM_1_of_Decision_1"), + Association.class); + + Node _My_BKM_1_of_Decision_1 = g.getNode("_My_BKM_1_of_Decision_1"); + assertNodeContentDefinitionIs(_My_BKM_1_of_Decision_1, + BusinessKnowledgeModel.class); + assertNodeEdgesTo(_My_BKM_1_of_Decision_1, + g.getNode("_My_Decision_1"), + KnowledgeRequirement.class); + + Node _KS_of_BKM_1 = g.getNode("_KS_of_BKM_1"); + assertNodeContentDefinitionIs(_KS_of_BKM_1, + KnowledgeSource.class); + assertNodeEdgesTo(_KS_of_BKM_1, + g.getNode("_My_BKM_1_of_Decision_1"), + AuthorityRequirement.class); + + Node _KS_of_KS_of_BKM_1 = g.getNode("_KS_of_KS_of_BKM_1"); + assertNodeContentDefinitionIs(_KS_of_KS_of_BKM_1, + KnowledgeSource.class); + assertNodeEdgesTo(_KS_of_KS_of_BKM_1, + g.getNode("_KS_of_BKM_1"), + AuthorityRequirement.class); + + Node _My_BKM_2_of_BKM_1 = g.getNode("_My_BKM_2_of_BKM_1"); + assertNodeContentDefinitionIs(_My_BKM_2_of_BKM_1, + BusinessKnowledgeModel.class); + assertNodeEdgesTo(_My_BKM_2_of_BKM_1, + g.getNode("_My_BKM_1_of_Decision_1"), + KnowledgeRequirement.class); + + Node _KS_of_BKM_2 = g.getNode("_KS_of_BKM_2"); + assertNodeContentDefinitionIs(_KS_of_BKM_2, + KnowledgeSource.class); + assertNodeEdgesTo(_KS_of_BKM_2, + g.getNode("_My_BKM_2_of_BKM_1"), + AuthorityRequirement.class); + assertNodeEdgesTo(_KS_of_BKM_2, + g.getNode("_Annotation_for_KS_of_BKM_2"), + Association.class); + + Node _Annotation_for_KS_of_BKM_2 = g.getNode("_Annotation_for_KS_of_BKM_2"); + assertNodeContentDefinitionIs(_Annotation_for_KS_of_BKM_2, + TextAnnotation.class); + + Node _My_Decision_1 = g.getNode("_My_Decision_1"); + assertNodeContentDefinitionIs(_My_Decision_1, + Decision.class); + + Node rootNode = DMNMarshallerStandalone.findDMNDiagramRoot((Graph) g); + assertNotNull(rootNode); + assertRootNodeConnectedTo(rootNode, + _My_Input_Data); + assertRootNodeConnectedTo(rootNode, + _Annotation_for_Input_Data); + assertRootNodeConnectedTo(rootNode, + _KS_of_Input_Data); + assertRootNodeConnectedTo(rootNode, + _KS_of_KS_of_InputData); + assertRootNodeConnectedTo(rootNode, + _KS_of_KS_of_Decision_1); + assertRootNodeConnectedTo(rootNode, + _KS_of_Decision_1); + assertRootNodeConnectedTo(rootNode, + _My_Decision_2); + assertRootNodeConnectedTo(rootNode, + _KS_of_Decision_2); + assertRootNodeConnectedTo(rootNode, + _Annotation_for_Decision_2); + assertRootNodeConnectedTo(rootNode, + _Annotation_for_BKM_1); + assertRootNodeConnectedTo(rootNode, + _My_BKM_1_of_Decision_1); + assertRootNodeConnectedTo(rootNode, + _KS_of_BKM_1); + assertRootNodeConnectedTo(rootNode, + _KS_of_KS_of_BKM_1); + assertRootNodeConnectedTo(rootNode, + _My_BKM_2_of_BKM_1); + assertRootNodeConnectedTo(rootNode, + _KS_of_BKM_2); + assertRootNodeConnectedTo(rootNode, + _Annotation_for_KS_of_BKM_2); + assertRootNodeConnectedTo(rootNode, + _My_Decision_1); + } + + private static void assertRootNodeConnectedTo(Node rootNode, + Node to) { + @SuppressWarnings("unchecked") + List> outEdges = (List>) rootNode.getOutEdges(); + Optional> optEdge = outEdges.stream().filter(e -> e.getTargetNode().equals(to)).findFirst(); + assertTrue(optEdge.isPresent()); + + Edge edge = optEdge.get(); + assertTrue(edge.getContent() instanceof Child); + + assertTrue(to.getInEdges().contains(edge)); + } + + private static Edge assertNodeEdgesTo(Node from, + Node to, + Class clazz) { + @SuppressWarnings("unchecked") + List> outEdges = (List>) from.getOutEdges(); + Optional> optEdge = outEdges.stream().filter(e -> e.getTargetNode().equals(to)).findFirst(); + assertTrue(optEdge.isPresent()); + + Edge edge = optEdge.get(); + assertTrue(edge.getContent() instanceof View); + assertTrue(clazz.isInstance(((View) edge.getContent()).getDefinition())); + + assertTrue(to.getInEdges().contains(edge)); + + ViewConnector connectionContent = (ViewConnector) edge.getContent(); + assertTrue(connectionContent.getSourceConnection().isPresent()); + assertTrue(connectionContent.getTargetConnection().isPresent()); + return edge; + } + + private static void assertNodeContentDefinitionIs(Node node, + Class clazz) { + assertTrue(node.getContent() instanceof View); + assertTrue(clazz.isInstance(((View) node.getContent()).getDefinition())); + } + + @Test + public void test_Simple_structured_context() throws IOException { + final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/Simple_structured_context.dmn")); + DMNModel dmnModel = runtime.getModels().get(0); + + DMNContext dmnContext = runtime.newContext(); + dmnContext.set("Input Name", + "John Doe"); + DMNResult dmnResult = runtime.evaluateAll(dmnModel, + dmnContext); + assertFalse(dmnResult.getMessages().toString(), + dmnResult.hasErrors()); + DMNContext result = dmnResult.getContext(); + assertEquals("Hello, John Doe!", + result.get("Decision Logic 1")); + } + + private DMNRuntime roundTripUnmarshalMarshalThenUnmarshalDMN(InputStream dmnXmlInputStream) throws IOException { + String xml = null; + try (BufferedReader buffer = new BufferedReader(new InputStreamReader(dmnXmlInputStream))) { + xml = buffer.lines().collect(Collectors.joining("\n")); + } catch (Exception e) { + throw new RuntimeException("test utily method roundTripUnmarshalMarshalThenUnmarshalDMN failed to read XML content.", e); + } + LOG.debug("ORIGINAL xml:\n{}\n", xml); + final DMNRuntime runtime0 = dmnRuntimeFromDMNXML(xml); + assertEquals("The DMN XML file contains compilation error. If this was intentional use test method roundTripUnmarshalMarshalThenUnmarshalDMNexpectingErrors", + 0, + runtime0.getModels().get(0).getMessages(DMNMessage.Severity.ERROR).size()); + + DMNMarshallerStandalone m = getDMNMarshaller(); + + // first unmarshal from DMN XML to Stunner DMN Graph + @SuppressWarnings("unchecked") + Graph> g = m.unmarshall(createMetadata(), + new ReaderInputStream(new StringReader(xml))); + + // round trip to Stunner DMN Graph back to DMN XML + DiagramImpl diagram = createDiagram(); + diagram.setGraph(g); + + String mString = m.marshall(diagram); + LOG.debug("MARSHALLED ROUNDTRIP RESULTING xml:\n{}\n", mString); + + // now unmarshal once more, from the marshalled just done above, into a DMNRuntime + final DMNRuntime runtime = dmnRuntimeFromDMNXML(mString); + assertTrue(runtime.getModels().get(0).getMessages(DMNMessage.Severity.ERROR).size() == 0); + return runtime; + } + + private static DMNRuntime dmnRuntimeFromDMNXML(String mString) { + final KieServices ks = KieServices.Factory.get(); + String uuid = UUID.uuid(8); + final KieContainer kieContainer = KieHelper.getKieContainer(ks.newReleaseId("org.kie", + uuid, + "1.0"), + ks.getResources().newByteArrayResource(mString.getBytes()).setTargetPath("src/main/resources/" + uuid + ".dmn")); + final DMNRuntime runtime = kieContainer.newKieSession().getKieRuntime(DMNRuntime.class); + assertNotNull(runtime); + assertFalse(runtime.getModels().isEmpty()); + return runtime; + } + + private static class ErrorsAndDMNModelAsSerialized { + + final List messages; + final Definitions definitions; + + public ErrorsAndDMNModelAsSerialized(List messages, Definitions definitions) { + this.messages = Collections.unmodifiableList(messages); + this.definitions = definitions; + } + + public boolean hasErrors() { + return messages.stream().filter(m -> m.getLevel().equals(Level.ERROR)).count() > 0; + } + } + + private ErrorsAndDMNModelAsSerialized roundTripUnmarshalMarshalThenUnmarshalDMNexpectingErrors(InputStream dmnXmlInputStream) throws IOException { + String xml = null; + try (BufferedReader buffer = new BufferedReader(new InputStreamReader(dmnXmlInputStream))) { + xml = buffer.lines().collect(Collectors.joining("\n")); + } catch (Exception e) { + throw new RuntimeException("test utility method roundTripUnmarshalMarshalThenUnmarshalDMN failed to read XML content.", e); + } + LOG.debug("ORIGINAL xml:\n{}\n", xml); + final List messages0 = kieBuilderMessagesUsingDMNXML(xml); + assertTrue("The DMN XML content did NOT result in compilation errors and this test method expected errors to be detected. If this was intentional use test method roundTripUnmarshalMarshalThenUnmarshalDMN", + messages0.stream().filter(m -> m.getLevel().equals(Message.Level.ERROR)).count() > 0); + + DMNMarshallerStandalone m = getDMNMarshaller(); + + // first unmarshal from DMN XML to Stunner DMN Graph + @SuppressWarnings("unchecked") + Graph> g = m.unmarshall(createMetadata(), + new ReaderInputStream(new StringReader(xml))); + + // round trip to Stunner DMN Graph back to DMN XML + DiagramImpl diagram = createDiagram(); + diagram.setGraph(g); + + String mString = m.marshall(diagram); + LOG.debug("MARSHALLED ROUNDTRIP RESULTING xml:\n{}\n", mString); + + // now unmarshal once more, from the marshalled just done above, into a DMNRuntime + final List result = kieBuilderMessagesUsingDMNXML(mString); + assertTrue("The DMN XML content did NOT result in compilation errors and this test method expected errors to be detected. If this was intentional use test method roundTripUnmarshalMarshalThenUnmarshalDMN", + messages0.stream().filter(msg -> msg.getLevel().equals(Message.Level.ERROR)).count() > 0); + + Definitions definitions = DMNMarshallerFactory.newDefaultMarshaller().unmarshal(mString); + return new ErrorsAndDMNModelAsSerialized(result, definitions); + } + + private static List kieBuilderMessagesUsingDMNXML(String mString) { + final KieServices ks = KieServices.Factory.get(); + String uuid = UUID.uuid(8); + final KieContainer kieContainer = DMNRuntimeUtil.getKieContainerIgnoringErrors(ks.newReleaseId("org.kie", uuid, "1.0"), + ks.getResources().newByteArrayResource(mString.getBytes()).setTargetPath("src/main/resources/" + uuid + ".dmn")); + Results verify = kieContainer.verify(); + List kie_messages = verify.getMessages(); + LOG.debug("{}", kie_messages); + return kie_messages; + } + + @Test + public void test_relation_literal_expression() throws IOException { + final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/hardcoded_relation_and_literal_expression.dmn")); + DMNModel dmnModel = runtime.getModels().get(0); + + DMNContext dmnContext = runtime.newContext(); + DMNResult dmnResult = runtime.evaluateAll(dmnModel, + dmnContext); + assertFalse(dmnResult.getMessages().toString(), + dmnResult.hasErrors()); + + DMNContext result = dmnResult.getContext(); + Object hardCodedRelation = result.get("hardcoded relation"); + assertNotNull(hardCodedRelation); + assertEquals(3, ((Collection) hardCodedRelation).size()); + + DMNDecisionResult adultResult = dmnResult.getDecisionResultByName("Adults"); + assertEquals(DecisionEvaluationStatus.SUCCEEDED, adultResult.getEvaluationStatus()); + assertEquals(1, ((Collection) adultResult.getResult()).size()); + } + + @Test + public void test_invocation() throws IOException { + final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/hardcoded_invokation.dmn")); + DMNModel dmnModel = runtime.getModels().get(0); + + DMNContext dmnContext = runtime.newContext(); + DMNResult dmnResult = runtime.evaluateAll(dmnModel, + dmnContext); + assertFalse(dmnResult.getMessages().toString(), + dmnResult.hasErrors()); + + DMNDecisionResult adultResult = dmnResult.getDecisionResultByName("hardcoded invokation"); + assertEquals(DecisionEvaluationStatus.SUCCEEDED, adultResult.getEvaluationStatus()); + assertEquals(new BigDecimal(11), adultResult.getResult()); + } + + @Test + public void test_function_definition_and_invocation() throws IOException { + final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/hardcoded_function_definition.dmn")); + DMNModel dmnModel = runtime.getModels().get(0); + + DMNContext emptyContext = runtime.newContext(); + DMNResult dmnResult = runtime.evaluateAll(dmnModel, emptyContext); + assertFalse(dmnResult.getMessages().toString(), dmnResult.hasErrors()); + + DMNDecisionResult adultResult = dmnResult.getDecisionResultByName("hardcoded decision"); + assertEquals(DecisionEvaluationStatus.SUCCEEDED, adultResult.getEvaluationStatus()); + assertEquals(47, ((BigDecimal) adultResult.getResult()).intValue()); + } + + @Test + public void test_function_java_WB_model() throws IOException { + final DMNMarshallerStandalone m = getDMNMarshaller(); + + @SuppressWarnings("unchecked") + final Graph> g = m.unmarshall(createMetadata(), + this.getClass().getResourceAsStream("/DROOLS-2372.dmn")); + + final Stream> stream = StreamSupport.stream(Spliterators.spliteratorUnknownSize(g.nodes().iterator(), Spliterator.ORDERED), + false); + final Optional wbDecision = stream + .filter(n -> n.getContent() instanceof ViewImpl) + .map(n -> (ViewImpl) n.getContent()) + .filter(n -> n.getDefinition() instanceof Decision) + .map(n -> (Decision) n.getDefinition()) + .findFirst(); + + wbDecision.ifPresent(d -> { + assertTrue(d.getExpression() instanceof FunctionDefinition); + final FunctionDefinition wbFunction = (FunctionDefinition) d.getExpression(); + + //This is what the WB expects + assertEquals(FunctionDefinition.Kind.JAVA, wbFunction.getKind()); + }); + + final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/DROOLS-2372.dmn")); + final DMNModel dmnModel = runtime.getModels().get(0); + + final BusinessKnowledgeModelNode bkmNode = dmnModel.getBusinessKnowledgeModels().iterator().next(); + final org.kie.dmn.model.api.FunctionDefinition dmnFunction = bkmNode.getBusinessKnowledModel().getEncapsulatedLogic(); + assertEquals(FunctionKind.JAVA, dmnFunction.getKind()); + } + + @Test + public void test_function_definition_and_invoke_in_ctx() throws IOException { + final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/function_definition_and_invoke_in_ctx.dmn")); + DMNModel dmnModel = runtime.getModels().get(0); + + DMNContext emptyContext = runtime.newContext(); + DMNResult dmnResult = runtime.evaluateAll(dmnModel, emptyContext); + assertFalse(dmnResult.getMessages().toString(), dmnResult.hasErrors()); + + DMNDecisionResult adultResult = dmnResult.getDecisionResultByName("hardcoded decision"); + assertEquals(DecisionEvaluationStatus.SUCCEEDED, adultResult.getEvaluationStatus()); + assertEquals(3, ((BigDecimal) adultResult.getResult()).intValue()); + } + + @Test + public void test_hardcoded_decision_a_function() throws IOException { + final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/hardcoded_decision_a_function.dmn")); + DMNModel dmnModel = runtime.getModels().get(0); + + DMNContext emptyContext = runtime.newContext(); + DMNResult dmnResult = runtime.evaluateAll(dmnModel, emptyContext); + assertFalse(dmnResult.getMessages().toString(), dmnResult.hasErrors()); + + DMNDecisionResult adultResult = dmnResult.getDecisionResultByName("hardcoded invokation"); + assertEquals(DecisionEvaluationStatus.SUCCEEDED, adultResult.getEvaluationStatus()); + assertEquals(3, ((BigDecimal) adultResult.getResult()).intValue()); + } + + @Test + public void test_decision_table() throws IOException { + final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/positive_or_negative.dmn")); + DMNModel dmnModel = runtime.getModels().get(0); + + checkDecisionTableForPositiveOrNegative(runtime, dmnModel, 47, "positive"); + checkDecisionTableForPositiveOrNegative(runtime, dmnModel, -1, "negative"); + } + + private void checkDecisionTableForPositiveOrNegative(final DMNRuntime runtime, DMNModel dmnModel, int number, String result) { + DMNContext context = runtime.newContext(); + context.set("a number", number); + DMNResult dmnResult = runtime.evaluateAll(dmnModel, context); + assertFalse(dmnResult.getMessages().toString(), dmnResult.hasErrors()); + + DMNDecisionResult adultResult = dmnResult.getDecisionResultByName("positive or negative"); + assertEquals(DecisionEvaluationStatus.SUCCEEDED, adultResult.getEvaluationStatus()); + assertEquals(result, adultResult.getResult()); + } + + @Test + //https://issues.jboss.org/browse/DROOLS-4107 + public void test_decision_table_UnaryTestsParenthood() throws IOException { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/positive_or_negative.dmn"), + this::checkDecisionRuleInputUnaryTests); + } + + @SuppressWarnings("unchecked") + private void checkDecisionRuleInputUnaryTests(final Graph> g) { + final Node decisionNode = g.getNode("_f9f209df-1d64-4c27-90e9-3ad42cb47c07"); + assertNodeContentDefinitionIs(decisionNode, + Decision.class); + + final Node rootNode = DMNMarshallerStandalone.findDMNDiagramRoot((Graph) g); + assertNotNull(rootNode); + assertRootNodeConnectedTo(rootNode, + decisionNode); + assertEquals("decisionNode parent is Definitions DMN root", + "_f330b756-e84e-401d-ac3a-2e72e710d4ed", + ((DMNElement) ((Decision) ((View) decisionNode.getContent()).getDefinition()).getParent()).getId().getValue()); + + final org.kie.workbench.common.dmn.api.definition.model.DecisionTable dtable = (org.kie.workbench.common.dmn.api.definition.model.DecisionTable) ((Decision) ((View) decisionNode.getContent()).getDefinition()).getExpression(); + dtable.getRule().forEach(rule -> rule.getInputEntry().forEach(ie -> assertEquals(ie.getParent(), rule))); + dtable.getRule().forEach(rule -> rule.getOutputEntry().forEach(ie -> assertEquals(ie.getParent(), rule))); + dtable.getRule().forEach(rule -> assertEquals(rule.getParent(), dtable)); + } + + @Test + @SuppressWarnings("unchecked") + public void test_wrong_context() throws IOException { + // DROOLS-2217 + final ErrorsAndDMNModelAsSerialized result = roundTripUnmarshalMarshalThenUnmarshalDMNexpectingErrors(this.getClass().getResourceAsStream("/wrong_context.dmn")); + + // although the DMN file is schema valid but is not a valid-DMN (a context-entry value is a literal expression missing text, which is null) + // DROOLS-3152: once roundtripped through the Stunner marshaller it will receive an empty text. (empty expression, but a LiteralExpression with an empty text child xml element) + // this will still naturally throw some error because unable to FEEL-parse/compile an empty expression. + assertTrue(result.hasErrors()); + + // identify the error message for context-entry "ciao": + DMNMessage m0 = (DMNMessage) result.messages.get(0); + assertTrue("expected a message identifying the problem on a context entry for 'ciao'", + m0.getMessage().startsWith("Error compiling FEEL expression '' for name ")); // DROOLS-3152 please notice FEEL reporting indeed an empty expression. + + org.kie.dmn.model.api.Decision d0 = (org.kie.dmn.model.api.Decision) result.definitions.getDrgElement().stream().filter(d -> d.getId().equals("_653b3426-933a-4050-9568-ab2a66b43c36")).findFirst().get(); + // the identified DMN Decision is composed of a DMN Context where the first context-entry value is a literal expression missing text (text is null). + org.kie.dmn.model.api.Context d0c = (org.kie.dmn.model.api.Context) d0.getExpression(); + org.kie.dmn.model.api.Expression contextEntryValue = d0c.getContextEntry().get(0).getExpression(); + assertTrue(contextEntryValue instanceof org.kie.dmn.model.api.LiteralExpression); + assertEquals("", ((org.kie.dmn.model.api.LiteralExpression) contextEntryValue).getText()); // DROOLS-3152 + + // -- Stunner side. + DMNMarshallerStandalone m = getDMNMarshaller(); + Graph g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/wrong_context.dmn")); + + Node decisionNode = g.getNode("_653b3426-933a-4050-9568-ab2a66b43c36"); + assertNodeContentDefinitionIs(decisionNode, Decision.class); + View view = ((View) decisionNode.getContent()); + + // the identified DMN Decision is composed of a DMN Context where the first context-entry has missing Expression. + Context expression = (Context) view.getDefinition().getExpression(); + assertNotNull(expression.getContextEntry().get(0).getExpression()); // DROOLS-3116 empty Literal Expression is preserved + assertEquals(LiteralExpression.class, expression.getContextEntry().get(0).getExpression().getClass()); + LiteralExpression le = (LiteralExpression) expression.getContextEntry().get(0).getExpression(); + assertEquals("", le.getText().getValue()); // DROOLS-3152 + } + + @Test + @SuppressWarnings("unchecked") + public void test_wrong_decision() throws IOException { + // DROOLS-3116 empty Literal Expression to be preserved + final ErrorsAndDMNModelAsSerialized result = roundTripUnmarshalMarshalThenUnmarshalDMNexpectingErrors(this.getClass().getResourceAsStream("/wrong_decision.dmn")); + + // although the DMN file is schema valid but is not a valid-DMN (a context-entry value is a literal expression missing text, which is null) + // DROOLS-3152: once roundtripped through the Stunner marshaller it will receive an empty text. (empty expression, but a LiteralExpression with an empty text child xml element) + // this will still naturally throw some error because unable to FEEL-parse/compile an empty epression. + assertTrue(result.hasErrors()); + + // identify the error message for the Decision with a Literal Expression decision logic missing the actual expression text. + DMNMessage m0 = (DMNMessage) result.messages.get(0); + assertTrue("expected a message identifying the problem on the literalExpression of 'my decision'", + m0.getSourceId().equals("_36dd163c-4862-4308-92bf-40a998b24e39")); + + org.kie.dmn.model.api.Decision d0 = (org.kie.dmn.model.api.Decision) result.definitions.getDrgElement().stream().filter(d -> d.getId().equals("_cce32679-9395-444d-a4bf-96af8ee727a0")).findFirst().get(); + // the identified DMN Decision is composed a literal expression missing text (text is null). + org.kie.dmn.model.api.Expression d0le = d0.getExpression(); + assertTrue(d0le instanceof org.kie.dmn.model.api.LiteralExpression); + assertEquals("", ((org.kie.dmn.model.api.LiteralExpression) d0le).getText()); // DROOLS-3152 + + // -- Stunner side. + DMNMarshallerStandalone m = getDMNMarshaller(); + Graph g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/wrong_decision.dmn")); + + Node decisionNode = g.getNode("_cce32679-9395-444d-a4bf-96af8ee727a0"); + assertNodeContentDefinitionIs(decisionNode, Decision.class); + View view = ((View) decisionNode.getContent()); + + // the identified DMN Decision is composed a literal expression missing text (text is null). + Expression expression = view.getDefinition().getExpression(); + assertNotNull(expression); // DROOLS-3116 empty Literal Expression is preserved + assertEquals(LiteralExpression.class, expression.getClass()); + LiteralExpression le = (LiteralExpression) expression; + assertEquals("", le.getText().getValue()); // DROOLS-3152 + } + + @Test + public void testOtherElements() throws IOException, XPathExpressionException { + String original = new Scanner(this.getClass().getResourceAsStream("/dummy.dmn")).useDelimiter("\\A").next(); + DMNMarshallerStandalone marshaller = getDMNMarshaller(); + DiagramImpl diagram = createDiagram(); + diagram.setGraph(marshaller.unmarshall(createMetadata(), getClass().getResourceAsStream("/dummy.dmn"))); + String roundtripped = marshaller.marshall(diagram); + LOG.debug(roundtripped); + XPath xpathOriginal = namespaceAwareXPath( + new AbstractMap.SimpleEntry<>("semantic", "http://www.omg.org/spec/DMN/20151101/dmn.xsd"), + new AbstractMap.SimpleEntry<>("drools", "http://www.drools.org/kie/dmn/1.1")); + XPath xpathRountripped = namespaceAwareXPath( + new AbstractMap.SimpleEntry<>("semantic", "http://www.omg.org/spec/DMN/20180521/MODEL/"), + new AbstractMap.SimpleEntry<>("drools", "http://www.drools.org/kie/dmn/1.2") + ); + assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:extensionElements)", original, roundtripped); + + assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:import)", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:import/@namespace", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:import/@importType", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:import/@locationURI", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:import/@drools:name", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:import/@drools:modelName", original, roundtripped); + + //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:elementCollection)"), original, roundtripped); + //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:elementCollection/@name"), original, roundtripped); + //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:elementCollection/@id"), original, roundtripped); + //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:elementCollection/@label"), original, roundtripped); + //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:elementCollection/drgElement)"), original, roundtripped); + //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:elementCollection/semantic:drgElement/@href"), original, roundtripped); + + //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:performanceIndicator)"), original, roundtripped); + //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:performanceIndicator/@name"), original, roundtripped); + //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:performanceIndicator/@id"), original, roundtripped); + //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:performanceIndicator/@label"), original, roundtripped); + //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:performanceIndicator/@URI"), original, roundtripped); + //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:performanceIndicator/semantic:impactingDecision)"), original, roundtripped); + //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:performanceIndicator/semantic:impactingDecision/@href"), original, roundtripped); + + //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:organizationUnit)"), original, roundtripped); + //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:organizationUnit/@name"), original, roundtripped); + //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:organizationUnit/@id"), original, roundtripped); + //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:organizationUnit/semantic:decisionMade)"), original, roundtripped); + //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:organizationUnit/semantic:decisionMade/@href"), original, roundtripped); + //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:organizationUnit/semantic:decisionOwned)"), original, roundtripped); + //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:organizationUnit/semantic:decisionOwned/@href"), original, roundtripped); + + assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:knowledgeSource)", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:knowledgeSource/@name", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:knowledgeSource/@id", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:knowledgeSource/semantic:authorityRequirement)", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:knowledgeSource/semantic:requiredInput)", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:knowledgeSource/semantic:requiredInput/@href", original, roundtripped); + + assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:inputData)", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:inputData/@id", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:inputData/@name", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:inputData/semantic:variable)", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:inputData/semantic:variable/@id", original, roundtripped); + assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:inputData/semantic:variable/@name", original, roundtripped); + + // DMN v1.2 + String inputDataVariableTypeRefOriginal = xpathOriginal.compile("/semantic:definitions/semantic:inputData/semantic:variable/@typeRef").evaluate(new InputSource(new StringReader(original))); + String inputDataVariableTypeRefRoundtripped = xpathRountripped.compile("/semantic:definitions/semantic:inputData/semantic:variable/@typeRef").evaluate(new InputSource(new StringReader(roundtripped))); + assertEquals("feel:number", inputDataVariableTypeRefOriginal); + assertEquals("number", inputDataVariableTypeRefRoundtripped); + } + + @Test + @SuppressWarnings("unchecked") + public void testContextEntryDataType() throws Exception { + final DMNMarshallerStandalone marshaller = getDMNMarshaller(); + + final Context context = new Context(); + context.setTypeRef(BuiltInType.DATE_TIME.asQName()); + + final ContextEntry contextEntry = new ContextEntry(); + final LiteralExpression literalExpression = new LiteralExpression(); + literalExpression.setTypeRef(BuiltInType.BOOLEAN.asQName()); + literalExpression.getText().setValue("feel"); + contextEntry.setExpression(literalExpression); + context.getContextEntry().add(contextEntry); + + final Diagram mockedDiagram = newDiagramDecisionWithExpression(context); + + final String marshalledSource = marshaller.marshall(mockedDiagram); + + final Graph> unmarshalledGraph = marshaller.unmarshall(createMetadata(), + new StringInputStream(marshalledSource)); + assertThat(unmarshalledGraph.nodes()).hasSize(2); + + checkDecisionExpression(unmarshalledGraph, context); + } + + @Test + public void testDefaultObjectsAreNotCreated() throws IOException { + final DMNRuntime dmnRuntime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/DROOLS-2941.dmn")); + final List dmn_messages = dmnRuntime.getModels().get(0).getMessages(); + assertThat(dmn_messages).isEmpty(); + + assertThat(dmnRuntime.getModels()).hasSize(1); + final DMNModel dmnModel = dmnRuntime.getModels().get(0); + final DMNContext context = dmnRuntime.newContext(); + final DMNResult result = dmnRuntime.evaluateAll(dmnModel, context); + assertThat(result.getDecisionResultByName("A Vowel").getResult()).isEqualTo("a"); + } + + /** + * DROOLS-3184: If the "connection source/target location is null" assume it's the centre of the shape. + * [source/target location is null] If the connection was created from the Toolbox (i.e. add a InputData and then the Decision from it using the Decision toolbox icon). + *

+ * This test re-create by hard-code the behavior of the Stunner framework "Toolbox" by instrumenting API calls to achieve the same behavior. + */ + @SuppressWarnings("unchecked") + @Test + public void testStunnerConstellationButtonCausingPoint2DbeingNull() throws IOException { + final BiConsumer hasComponentWidthsConsumer = (uuid, hcw) -> {/*NOP*/}; + + Diagram diagram = createDiagram(); + Graph g = diagram.getGraph(); + Node diagramRoot = DMNMarshallerStandalone.findDMNDiagramRoot(g); + testAugmentWithNSPrefixes(((DMNDiagram) ((View) diagramRoot.getContent()).getDefinition()).getDefinitions()); + + org.kie.dmn.model.api.InputData dmnInputData = new TInputData(); + dmnInputData.setId("inputDataID"); + dmnInputData.setName(dmnInputData.getId()); + Node inputDataNode = new InputDataConverter(api.getFactoryManager()).nodeFromDMN(dmnInputData, + hasComponentWidthsConsumer); + org.kie.dmn.model.api.Decision dmnDecision = new TDecision(); + dmnDecision.setId("decisionID"); + dmnDecision.setName(dmnDecision.getId()); + Node decisionNode = new DecisionConverter(api.getFactoryManager()).nodeFromDMN(dmnDecision, + hasComponentWidthsConsumer); + g.addNode(inputDataNode); + g.addNode(decisionNode); + View content = (View) decisionNode.getContent(); + content.setBounds(org.kie.workbench.common.stunner.core.graph.content.Bounds.create(200, 200, 300, 250)); + final String irID = "irID"; + Edge myEdge = api.getFactoryManager().newElement(irID, DMNMarshallerStandalone.INFO_REQ_ID).asEdge(); + myEdge.setSourceNode(inputDataNode); + myEdge.setTargetNode(decisionNode); + inputDataNode.getOutEdges().add(myEdge); + decisionNode.getInEdges().add(myEdge); + ViewConnector connectionContent = (ViewConnector) myEdge.getContent(); + // DROOLS-3184: If the "connection source/target location is null" assume it's the centre of the shape. + // keep Stunner behavior of constellation button + connectionContent.setSourceConnection(MagnetConnection.Builder.atCenter(inputDataNode).setLocation(null).setAuto(true)); + connectionContent.setTargetConnection(MagnetConnection.Builder.atCenter(decisionNode).setLocation(null).setAuto(true)); + + DMNMarshallerStandalone.connectRootWithChild(diagramRoot, inputDataNode); + DMNMarshallerStandalone.connectRootWithChild(diagramRoot, decisionNode); + + DMNMarshallerStandalone m = getDMNMarshaller(); + String output = m.marshall(diagram); + LOG.debug(output); + + Definitions dmnDefinitions = DMNMarshallerFactory.newDefaultMarshaller().unmarshal(output); + DMNEdge dmndiEdge = findEdgeByDMNI(dmnDefinitions.getDMNDI().getDMNDiagram().get(0), irID); + assertThat(dmndiEdge.getWaypoint()).hasSize(2); + Point wpSource = dmndiEdge.getWaypoint().get(0); + assertThat(wpSource.getX()).isEqualByComparingTo(50d); + assertThat(wpSource.getY()).isEqualByComparingTo(25d); + Point wpTarget = dmndiEdge.getWaypoint().get(1); + assertThat(wpTarget.getX()).isEqualByComparingTo(250d); + assertThat(wpTarget.getY()).isEqualByComparingTo(225d); + } + + /** + * DROOLS-2569 [DMN Designer] Marshalling of magnet positions -- Association DMN Edge DMNDI serialization. + * This test re-create by hard-code the graph to simulate the behavior of the Stunner framework programmatically. + */ + @SuppressWarnings("unchecked") + @Test + public void testAssociationEdgeDMNDI() throws IOException { + final BiConsumer hasComponentWidthsConsumer = (uuid, hcw) -> {/*NOP*/}; + + Diagram diagram = createDiagram(); + Graph g = diagram.getGraph(); + Node diagramRoot = DMNMarshallerStandalone.findDMNDiagramRoot(g); + testAugmentWithNSPrefixes(((DMNDiagram) ((View) diagramRoot.getContent()).getDefinition()).getDefinitions()); + + org.kie.dmn.model.api.InputData dmnInputData = new TInputData(); + dmnInputData.setId("inputDataID"); + dmnInputData.setName(dmnInputData.getId()); + Node inputDataNode = new InputDataConverter(api.getFactoryManager()).nodeFromDMN(dmnInputData, + hasComponentWidthsConsumer); + org.kie.dmn.model.api.TextAnnotation dmnTextAnnotation = new TTextAnnotation(); + dmnTextAnnotation.setId("textAnnotationID"); + Node textAnnotationNode = new TextAnnotationConverter(api.getFactoryManager()).nodeFromDMN(dmnTextAnnotation, + hasComponentWidthsConsumer); + g.addNode(inputDataNode); + g.addNode(textAnnotationNode); + View content = (View) textAnnotationNode.getContent(); + content.setBounds(org.kie.workbench.common.stunner.core.graph.content.Bounds.create(200, 200, 300, 250)); + final String edgeID = "edgeID"; + final String associationID = "associationID"; + Edge myEdge = api.getFactoryManager().newElement(edgeID, DMNMarshallerStandalone.ASSOCIATION_ID).asEdge(); + final View edgeView = (View) myEdge.getContent(); + ((Association) edgeView.getDefinition()).setId(new Id(associationID)); + myEdge.setSourceNode(inputDataNode); + myEdge.setTargetNode(textAnnotationNode); + inputDataNode.getOutEdges().add(myEdge); + textAnnotationNode.getInEdges().add(myEdge); + ViewConnector connectionContent = (ViewConnector) myEdge.getContent(); + connectionContent.setSourceConnection(MagnetConnection.Builder.atCenter(inputDataNode)); + connectionContent.setTargetConnection(MagnetConnection.Builder.atCenter(textAnnotationNode)); + + DMNMarshallerStandalone.connectRootWithChild(diagramRoot, inputDataNode); + DMNMarshallerStandalone.connectRootWithChild(diagramRoot, textAnnotationNode); + + DMNMarshallerStandalone m = getDMNMarshaller(); + String output = m.marshall(diagram); + LOG.debug(output); + + Definitions dmnDefinitions = DMNMarshallerFactory.newDefaultMarshaller().unmarshal(output); + assertThat(dmnDefinitions.getDMNDI().getDMNDiagram().get(0).getDMNDiagramElement().stream().filter(DMNEdge.class::isInstance).count()).isEqualTo(1); + DMNEdge dmndiEdge = findEdgeByDMNI(dmnDefinitions.getDMNDI().getDMNDiagram().get(0), associationID); + assertThat(dmndiEdge.getWaypoint()).hasSize(2); + } + + @Test + public void test_ExpressionComponentWidthPersistence() throws IOException { + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/DROOLS-2262.dmn"), + this::checkComponentWidths); + } + + @Test + public void testGetImportedDrgElementsByShape() { + + final DMNMarshallerStandalone marshaller = spy(getDMNMarshaller()); + final List importedDRGElements = mock(List.class); + final Map importDefinitions = mock(Map.class); + final org.kie.dmn.model.api.Definitions dmnXml = mock(org.kie.dmn.model.api.Definitions.class); + + final org.kie.dmn.model.api.DRGElement ref1 = mock(org.kie.dmn.model.api.DRGElement.class); + final org.kie.dmn.model.api.DRGElement ref2 = mock(org.kie.dmn.model.api.DRGElement.class); + final org.kie.dmn.model.api.DRGElement ref3 = mock(org.kie.dmn.model.api.DRGElement.class); + + final List dmnShapes = new ArrayList<>(); + final DMNShape shape1 = mock(DMNShape.class); + final DMNShape shape2 = mock(DMNShape.class); + final DMNShape shape3 = mock(DMNShape.class); + dmnShapes.add(shape1); + dmnShapes.add(shape2); + dmnShapes.add(shape3); + + doReturn("REF1").when(marshaller).getDmnElementRef(shape1); + doReturn("REF2").when(marshaller).getDmnElementRef(shape2); + doReturn("REF3").when(marshaller).getDmnElementRef(shape3); + + when(dmnMarshallerImportsHelper.getImportedDRGElements(importDefinitions)).thenReturn(importedDRGElements); + + doNothing().when(marshaller).updateIDsWithAlias(any(), any()); + doReturn(Optional.of(ref1)).when(marshaller).getReference(importedDRGElements, "REF1"); + doReturn(Optional.of(ref2)).when(marshaller).getReference(importedDRGElements, "REF2"); + doReturn(Optional.of(ref3)).when(marshaller).getReference(importedDRGElements, "REF3"); + + final List actual = marshaller.getImportedDrgElementsByShape(dmnShapes, importDefinitions, dmnXml); + + assertEquals(ref1, actual.get(0)); + assertEquals(ref2, actual.get(1)); + assertEquals(ref3, actual.get(2)); + } + + @Test + public void testGetDmnElementRef() { + + final DMNMarshallerStandalone marshaller = spy(getDMNMarshaller()); + final String expected = "localPart"; + final DMNShape shape = mock(DMNShape.class); + final javax.xml.namespace.QName ref = mock(javax.xml.namespace.QName.class); + when(ref.getLocalPart()).thenReturn(expected); + when(shape.getDmnElementRef()).thenReturn(ref); + + final String actual = marshaller.getDmnElementRef(shape); + + assertEquals(expected, actual); + } + + @Test + public void testGetUniqueDMNShapes() { + + final DMNMarshallerStandalone marshaller = spy(getDMNMarshaller()); + final org.kie.dmn.model.api.dmndi.DMNDiagram diagram = mock(org.kie.dmn.model.api.dmndi.DMNDiagram.class); + final List elements = new ArrayList<>(); + + final DMNShape unique1 = mock(DMNShape.class); + when(unique1.getId()).thenReturn("unique1"); + + final DMNShape unique2 = mock(DMNShape.class); + when(unique2.getId()).thenReturn("unique2"); + + final DMNShape duplicate1 = mock(DMNShape.class); + when(duplicate1.getId()).thenReturn("duplicate"); + + final DMNShape duplicate2 = mock(DMNShape.class); + when(duplicate2.getId()).thenReturn("duplicate"); + + elements.add(unique1); + elements.add(unique2); + elements.add(duplicate1); + elements.add(duplicate2); + + when(diagram.getDMNDiagramElement()).thenReturn(elements); + + final List actual = marshaller.getUniqueDMNShapes(diagram); + + assertEquals(3, actual.size()); + assertTrue(actual.contains(unique1)); + assertTrue(actual.contains(unique2)); + assertTrue(actual.contains(duplicate1) || actual.contains(duplicate2)); + } + + @Test + public void testSetAllowOnlyVisualChangeToTrue() { + testSetAllowOnlyVisualChange(true); + } + + @Test + public void testSetAllowOnlyVisualChangeToFalse() { + testSetAllowOnlyVisualChange(false); + } + + private void testSetAllowOnlyVisualChange(final boolean expected) { + + final DMNMarshallerStandalone marshaller = spy(getDMNMarshaller()); + final List importedDrgElements = mock(List.class); + final Node node = mock(Node.class); + final org.kie.workbench.common.dmn.api.definition.model.DRGElement element = mock(org.kie.workbench.common.dmn.api.definition.model.DRGElement.class); + doReturn(Optional.of(element)).when(marshaller).getDRGElement(node); + doReturn(expected).when(marshaller).isImportedDRGElement(importedDrgElements, element); + + marshaller.setAllowOnlyVisualChange(importedDrgElements, node); + + verify(element).setAllowOnlyVisualChange(expected); + } + + @Test + public void testIsImportedDRGElementWithDmnDRGElement() { + + final DMNMarshallerStandalone marshaller = spy(getDMNMarshaller()); + final List importedDrgElements = new ArrayList<>(); + + final org.kie.dmn.model.api.DRGElement imported = mock(org.kie.dmn.model.api.DRGElement.class); + when(imported.getId()).thenReturn("id"); + importedDrgElements.add(imported); + + final org.kie.dmn.model.api.DRGElement drgElement = mock(org.kie.dmn.model.api.DRGElement.class); + when(drgElement.getId()).thenReturn("id"); + + final boolean actual = marshaller.isImportedDRGElement(importedDrgElements, drgElement); + + assertTrue(actual); + } + + @Test + public void testIsImportedDRGElementWithWbDRGElement() { + + final DMNMarshallerStandalone marshaller = spy(getDMNMarshaller()); + final List importedDrgElements = new ArrayList<>(); + + final org.kie.dmn.model.api.DRGElement imported = mock(org.kie.dmn.model.api.DRGElement.class); + when(imported.getId()).thenReturn("id"); + importedDrgElements.add(imported); + + final org.kie.workbench.common.dmn.api.definition.model.DRGElement drgElement = mock(org.kie.workbench.common.dmn.api.definition.model.DRGElement.class); + final Id id = mock(Id.class); + when(id.getValue()).thenReturn("id"); + when(drgElement.getId()).thenReturn(id); + + final boolean actual = marshaller.isImportedDRGElement(importedDrgElements, drgElement); + + assertTrue(actual); + } + + @Test + public void testUpdateIDsWithAlias() { + + final DMNMarshallerStandalone marshaller = getDMNMarshaller(); + final HashMap indexByUri = new HashMap<>(); + final String namespace1 = "https://kiegroup.org/dmn/_red"; + final String namespace2 = "https://kiegroup.org/dmn/_blue"; + final String namespace3 = "https://kiegroup.org/dmn/_yellow"; + final String missingNamespace = "missing_namespace"; + + final String someWrongAlias = "some wrong alias"; + + final String include1 = "include1"; + final String include2 = "include2"; + final String include3 = "include3"; + + final String id1 = "id1"; + final String id2 = "id2"; + final String id3 = "id3"; + final String id4 = "id4"; + + indexByUri.put(namespace1, include1); + indexByUri.put(namespace2, include2); + indexByUri.put(namespace3, include3); + + final List importedDrgElements = new ArrayList<>(); + final DRGElement element1 = createDRGElementWithNamespaceAndId(namespace1, someWrongAlias + ":" + id1); + importedDrgElements.add(element1); + + final DRGElement element2 = createDRGElementWithNamespaceAndId(namespace2, someWrongAlias + ":" + id2); + importedDrgElements.add(element2); + + final DRGElement element3 = createDRGElementWithNamespaceAndId(namespace3, someWrongAlias + ":" + id3); + importedDrgElements.add(element3); + + final DRGElement element4 = createDRGElementWithNamespaceAndId(missingNamespace, id4); + importedDrgElements.add(element4); + + marshaller.updateIDsWithAlias(indexByUri, importedDrgElements); + + verify(element1).setId(include1 + ":" + id1); + verify(element2).setId(include2 + ":" + id2); + verify(element3).setId(include3 + ":" + id3); + + verify(element4, never()).setId(any()); + } + + private org.kie.dmn.model.api.DRGElement createDRGElementWithNamespaceAndId(final String namespace, + final String id) { + + final org.kie.dmn.model.api.DRGElement drgElement = mock(DRGElement.class); + final Map additionalAttributes = new HashMap<>(); + + additionalAttributes.put(new QName("Namespace"), namespace); + + when(drgElement.getAdditionalAttributes()).thenReturn(additionalAttributes); + when(drgElement.getId()).thenReturn(id); + + return drgElement; + } + + @Test + public void testChangeAliasForImportedElement() { + + final DMNMarshallerStandalone marshaller = getDMNMarshaller(); + final org.kie.dmn.model.api.DRGElement drgElement = mock(org.kie.dmn.model.api.DRGElement.class); + final String alias = "include1"; + final String id = "_01234567"; + + when(drgElement.getId()).thenReturn("some another alias:" + id); + + marshaller.changeAlias(alias, drgElement); + + verify(drgElement).setId(alias + ":" + id); + } + + @Test + public void testChangeAliasForLocalElement() { + + final DMNMarshallerStandalone marshaller = getDMNMarshaller(); + final org.kie.dmn.model.api.DRGElement drgElement = mock(org.kie.dmn.model.api.DRGElement.class); + final String alias = "include1"; + final String id = "_01234567"; + + when(drgElement.getId()).thenReturn(id); + + marshaller.changeAlias(alias, drgElement); + + verify(drgElement, never()).setId(any()); + } + + @Test + public void testLoadImportedItemDefinitions() { + + final org.kie.workbench.common.dmn.api.definition.model.Definitions definitions = mock(org.kie.workbench.common.dmn.api.definition.model.Definitions.class); + final org.kie.workbench.common.dmn.api.definition.model.ItemDefinition itemDefinition1 = mock(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition.class); + final org.kie.workbench.common.dmn.api.definition.model.ItemDefinition itemDefinition2 = mock(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition.class); + final List expectedItemDefinitions = asList(itemDefinition1, itemDefinition2); + final List actualItemDefinitions = new ArrayList<>(); + final Map importDefinitions = new HashMap<>(); + final DMNMarshallerStandalone dmnMarshaller = spy(getDMNMarshaller()); + + doReturn(expectedItemDefinitions).when(dmnMarshaller).getWbImportedItemDefinitions(importDefinitions); + when(definitions.getItemDefinition()).thenReturn(actualItemDefinitions); + + dmnMarshaller.loadImportedItemDefinitions(definitions, importDefinitions); + + assertEquals(expectedItemDefinitions, actualItemDefinitions); + } + + @Test + public void testCleanImportedItemDefinitions() { + + final org.kie.workbench.common.dmn.api.definition.model.Definitions definitions = mock(org.kie.workbench.common.dmn.api.definition.model.Definitions.class); + final org.kie.workbench.common.dmn.api.definition.model.ItemDefinition itemDefinition1 = mock(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition.class); + final org.kie.workbench.common.dmn.api.definition.model.ItemDefinition itemDefinition2 = mock(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition.class); + final org.kie.workbench.common.dmn.api.definition.model.ItemDefinition itemDefinition3 = mock(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition.class); + final List actualItemDefinitions = new ArrayList<>(asList(itemDefinition1, itemDefinition2, itemDefinition3)); + final List expectedItemDefinitions = asList(itemDefinition1, itemDefinition3); + final DMNMarshallerStandalone dmnMarshaller = getDMNMarshaller(); + + when(itemDefinition1.isAllowOnlyVisualChange()).thenReturn(false); + when(itemDefinition2.isAllowOnlyVisualChange()).thenReturn(true); + when(itemDefinition3.isAllowOnlyVisualChange()).thenReturn(false); + when(definitions.getItemDefinition()).thenReturn(actualItemDefinitions); + + dmnMarshaller.cleanImportedItemDefinitions(definitions); + + assertEquals(expectedItemDefinitions, actualItemDefinitions); + } + + @Test + public void testGetWbImportedItemDefinitions() { + + final org.kie.dmn.model.api.ItemDefinition itemDefinition1 = makeItemDefinition("model1.tUUID"); + final org.kie.dmn.model.api.ItemDefinition itemDefinition2 = makeItemDefinition("model1.tPerson"); + final org.kie.dmn.model.api.ItemDefinition itemDefinition3 = makeItemDefinition("model2.tNum"); + final Map importDefinitions = new HashMap<>(); + + when(dmnMarshallerImportsHelper.getImportedItemDefinitions(importDefinitions)).thenReturn(asList(itemDefinition1, itemDefinition2, itemDefinition3)); + + final List actualItemDefinitions = getDMNMarshaller().getWbImportedItemDefinitions(importDefinitions); + + assertEquals(3, actualItemDefinitions.size()); + assertEquals("model1.tUUID", actualItemDefinitions.get(0).getName().getValue()); + assertEquals("model1.tPerson", actualItemDefinitions.get(1).getName().getValue()); + assertEquals("model2.tNum", actualItemDefinitions.get(2).getName().getValue()); + } + + private org.kie.dmn.model.api.ItemDefinition makeItemDefinition(final String name) { + final org.kie.dmn.model.api.ItemDefinition itemDefinition = new TItemDefinition(); + itemDefinition.setName(name); + return itemDefinition; + } + + @Test + public void testConnectorRightToLeft() throws Exception { + final org.kie.workbench.common.stunner.core.graph.content.Bounds bounds = org.kie.workbench.common.stunner.core.graph.content.Bounds.create(0, 0, 100, 50); + final String decisionNode1UUID = org.kie.workbench.common.stunner.core.util.UUID.uuid(); + final String decisionNode2UUID = org.kie.workbench.common.stunner.core.util.UUID.uuid(); + final String edgeUUID = org.kie.workbench.common.stunner.core.util.UUID.uuid(); + + final ViewConnector edgeView = marshallAndUnMarshallConnectors(bounds, + decisionNode1UUID, + decisionNode2UUID, + edgeUUID, + (sc) -> { + when(sc.getMagnetIndex()).thenReturn(OptionalInt.of(MagnetConnection.MAGNET_RIGHT)); + when(sc.getLocation()).thenReturn(new Point2D(bounds.getWidth(), bounds.getHeight() / 2)); + }, + (tc) -> { + when(tc.getMagnetIndex()).thenReturn(OptionalInt.of(MagnetConnection.MAGNET_LEFT)); + when(tc.getLocation()).thenReturn(new Point2D(0, bounds.getHeight() / 2)); + }); + + final MagnetConnection sourceConnection = (MagnetConnection) edgeView.getSourceConnection().get(); + assertEquals(bounds.getWidth(), sourceConnection.getLocation().getX(), 0.0); + assertEquals(bounds.getHeight() / 2, sourceConnection.getLocation().getY(), 0.0); + assertFalse(sourceConnection.getMagnetIndex().isPresent()); + assertTrue(sourceConnection.isAuto()); + + final MagnetConnection targetConnection = (MagnetConnection) edgeView.getTargetConnection().get(); + assertEquals(0, targetConnection.getLocation().getX(), 0.0); + assertEquals(bounds.getHeight() / 2, targetConnection.getLocation().getY(), 0.0); + assertFalse(targetConnection.getMagnetIndex().isPresent()); + assertTrue(targetConnection.isAuto()); + } + + @Test + public void testConnectorCentreToCentre() throws Exception { + final org.kie.workbench.common.stunner.core.graph.content.Bounds bounds = org.kie.workbench.common.stunner.core.graph.content.Bounds.create(0, 0, 100, 50); + final String decisionNode1UUID = org.kie.workbench.common.stunner.core.util.UUID.uuid(); + final String decisionNode2UUID = org.kie.workbench.common.stunner.core.util.UUID.uuid(); + final String edgeUUID = org.kie.workbench.common.stunner.core.util.UUID.uuid(); + + final ViewConnector edgeView = marshallAndUnMarshallConnectors(bounds, + decisionNode1UUID, + decisionNode2UUID, + edgeUUID, + (sc) -> {/*NOP*/}, + (tc) -> {/*NOP*/}); + + final MagnetConnection sourceConnection = (MagnetConnection) edgeView.getSourceConnection().get(); + assertEquals(bounds.getWidth() / 2, sourceConnection.getLocation().getX(), 0.0); + assertEquals(bounds.getHeight() / 2, sourceConnection.getLocation().getY(), 0.0); + assertTrue(sourceConnection.getMagnetIndex().isPresent()); + assertEquals(MagnetConnection.MAGNET_CENTER, sourceConnection.getMagnetIndex().getAsInt()); + assertFalse(sourceConnection.isAuto()); + + final MagnetConnection targetConnection = (MagnetConnection) edgeView.getTargetConnection().get(); + assertEquals(bounds.getWidth() / 2, targetConnection.getLocation().getX(), 0.0); + assertEquals(bounds.getHeight() / 2, targetConnection.getLocation().getY(), 0.0); + assertTrue(targetConnection.getMagnetIndex().isPresent()); + assertEquals(MagnetConnection.MAGNET_CENTER, targetConnection.getMagnetIndex().getAsInt()); + assertFalse(targetConnection.isAuto()); + } + + @Test + public void testRemoveDrgElementsWithoutShape() { + final String id1 = "id1"; + final String id2 = "id2"; + final String id3 = "id3"; + final DRGElement e1 = createDRGElement(id1); + final DRGElement e2 = createDRGElement(id2); + final DRGElement e3 = createDRGElement(id3); + final List drgElements = new ArrayList<>(Arrays.asList(e1, e2, e3)); + final DMNShape s1 = createDMNShape(id1); + final DMNShape s3 = createDMNShape(id3); + final List dmnShapes = new ArrayList<>(Arrays.asList(s1, s3)); + + getDMNMarshaller().removeDrgElementsWithoutShape(drgElements, dmnShapes); + + assertEquals(2, drgElements.size()); + assertEquals(e1, drgElements.get(0)); + assertEquals(e3, drgElements.get(1)); + } + + @Test + public void testRemoveDrgElementsWithoutShapeWhenAllElementsHaveShape() { + final String id1 = "id1"; + final String id2 = "id2"; + final String id3 = "id3"; + final DRGElement e1 = createDRGElement(id1); + final DRGElement e2 = createDRGElement(id2); + final DRGElement e3 = createDRGElement(id3); + final List drgElements = new ArrayList<>(Arrays.asList(e1, e2, e3)); + final DMNShape s1 = createDMNShape(id1); + final DMNShape s2 = createDMNShape(id2); + final DMNShape s3 = createDMNShape(id3); + final List dmnShapes = new ArrayList<>(Arrays.asList(s1, s2, s3)); + + getDMNMarshaller().removeDrgElementsWithoutShape(drgElements, dmnShapes); + + assertEquals(3, drgElements.size()); + assertEquals(e1, drgElements.get(0)); + assertEquals(e2, drgElements.get(1)); + assertEquals(e3, drgElements.get(2)); + } + + @Test + public void testRemoveDrgElementsWithoutShapeFromDMN11() { + final String id1 = "id1"; + final String id2 = "id2"; + final String id3 = "id3"; + final DRGElement e1 = createDRGElement(id1); + final DRGElement e2 = createDRGElement(id2); + final DRGElement e3 = createDRGElement(id3); + final List drgElements = new ArrayList<>(Arrays.asList(e1, e2, e3)); + final List dmnShapes = new ArrayList<>(); + + getDMNMarshaller().removeDrgElementsWithoutShape(drgElements, dmnShapes); + + assertEquals(3, drgElements.size()); + assertEquals(e1, drgElements.get(0)); + assertEquals(e2, drgElements.get(1)); + assertEquals(e3, drgElements.get(2)); + } + + private DMNShape createDMNShape(final String refId) { + final DMNShape shape = mock(DMNShape.class); + final QName ref = mock(QName.class); + when(shape.getDmnElementRef()).thenReturn(ref); + when(ref.getLocalPart()).thenReturn(refId); + return shape; + } + + private DRGElement createDRGElement(final String id) { + final DRGElement element = mock(DRGElement.class); + when(element.getId()).thenReturn(id); + return element; + } + + @Test + @SuppressWarnings("unchecked") + public void testImportConversion() throws IOException { + //Assume every import in the DMN file can be resolved to the actual file. + when(dmnMarshallerImportsHelper.getPMMLDocuments(any(Metadata.class), anyList())).thenAnswer(i -> { + final Map pmmlDocuments = new HashMap<>(); + final List imports = (List) i.getArguments()[1]; + imports.forEach(imp -> pmmlDocuments.put(imp, mock(PMMLDocumentMetadata.class))); + return pmmlDocuments; + }); + + roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/imports.dmn"), + this::checkImports); + } + + @SuppressWarnings("unchecked") + private void checkImports(final Graph> graph) { + assertNotNull(graph); + + final DMNDiagramUtils utils = new DMNDiagramUtils(); + final Diagram mockDiagram = mock(Diagram.class); + when(mockDiagram.getGraph()).thenReturn(graph); + + final org.kie.workbench.common.dmn.api.definition.model.Definitions definitions = utils.getDefinitions(mockDiagram); + final List imports = definitions.getImport(); + assertTrue(imports.get(0) instanceof ImportDMN); + assertTrue(imports.get(1) instanceof ImportPMML); + + final ImportDMN dmnImport = (ImportDMN) imports.get(0); + assertEquals("dmn-import", dmnImport.getName().getValue()); + assertEquals("https://kiegroup.org/dmn/_46EB0D0D-7241-4629-A38E-0377AA5B32D1", dmnImport.getNamespace()); + assertEquals(DMNImportTypes.DMN.getDefaultNamespace(), dmnImport.getImportType()); + + final ImportPMML pmmlImport = (ImportPMML) imports.get(1); + assertEquals("pmml-import", pmmlImport.getName().getValue()); + assertEquals("pmml-import", pmmlImport.getNamespace()); + assertEquals(DMNImportTypes.PMML.getDefaultNamespace(), pmmlImport.getImportType()); + } + + @SuppressWarnings("unchecked") + private ViewConnector marshallAndUnMarshallConnectors(final org.kie.workbench.common.stunner.core.graph.content.Bounds bounds, + final String decisionNode1UUID, + final String decisionNode2UUID, + final String edgeUUID, + final Consumer sourceMagnetConsumer, + final Consumer targetMagnetConsumer) throws Exception { + final DMNMarshallerStandalone marshaller = getDMNMarshaller(); + + final Diagram mockedDiagram = connectTwoNodes(bounds, + decisionNode1UUID, + decisionNode2UUID, + edgeUUID, + sourceMagnetConsumer, + targetMagnetConsumer); + + final String marshalledSource = marshaller.marshall(mockedDiagram); + + final Graph> unmarshalledGraph = marshaller.unmarshall(createMetadata(), new StringInputStream(marshalledSource)); + + assertNotNull(unmarshalledGraph); + + final Node decision1Node = unmarshalledGraph.getNode(decisionNode1UUID); + final Node decision2Node = unmarshalledGraph.getNode(decisionNode2UUID); + assertNotNull(decision1Node); + assertNotNull(decision2Node); + assertEquals(1, decision1Node.getOutEdges().size()); + assertEquals(2, decision2Node.getInEdges().size()); + + final Edge decision1NodeOutEdge = decision1Node.getOutEdges().get(0); + final Edge decision2NodeInEdge = decision2Node.getInEdges().get(0); + assertEquals(decision1NodeOutEdge, decision2NodeInEdge); + + final ViewConnector edgeView = (ViewConnector) decision1NodeOutEdge.getContent(); + assertTrue(edgeView.getSourceConnection().isPresent()); + assertTrue(edgeView.getTargetConnection().isPresent()); + + return edgeView; + } + + @SuppressWarnings("unchecked") + private Diagram connectTwoNodes(final org.kie.workbench.common.stunner.core.graph.content.Bounds bounds, + final String decisionNode1UUID, + final String decisionNode2UUID, + final String edgeUUID, + final Consumer sourceMagnetConsumer, + final Consumer targetMagnetConsumer) { + final DiagramImpl diagram = createDiagram(); + final Graph graph = mock(Graph.class); + + final Node diagramNode = mock(Node.class); + final View diagramView = mock(View.class); + final DMNDiagram dmnDiagram = new DMNDiagram(); + when(diagramNode.getContent()).thenReturn(diagramView); + when(diagramView.getDefinition()).thenReturn(dmnDiagram); + + final Node decisionNode1 = mock(Node.class); + final View decisionView1 = mock(View.class); + final Decision decision1 = new Decision(); + decision1.getId().setValue(decisionNode1UUID); + when(decisionNode1.getContent()).thenReturn(decisionView1); + when(decisionView1.getDefinition()).thenReturn(decision1); + when(decisionView1.getBounds()).thenReturn(bounds); + + final Node decisionNode2 = mock(Node.class); + final View decisionView2 = mock(View.class); + final Decision decision2 = new Decision(); + decision2.getId().setValue(decisionNode2UUID); + when(decisionNode2.getContent()).thenReturn(decisionView2); + when(decisionView2.getDefinition()).thenReturn(decision2); + when(decisionView2.getBounds()).thenReturn(bounds); + + final Edge edge = mock(Edge.class); + final ViewConnector edgeView = mock(ViewConnector.class); + when(edge.getUUID()).thenReturn(edgeUUID); + when(edge.getContent()).thenReturn(edgeView); + final MagnetConnection edgeSourceConnection = mock(MagnetConnection.class); + final MagnetConnection edgeTargetConnection = mock(MagnetConnection.class); + when(edgeView.getSourceConnection()).thenReturn(Optional.of(edgeSourceConnection)); + when(edgeView.getTargetConnection()).thenReturn(Optional.of(edgeTargetConnection)); + when(edgeView.getControlPoints()).thenReturn(new ControlPoint[]{}); + when(decisionNode1.getOutEdges()).thenReturn(Collections.singletonList(edge)); + when(decisionNode2.getInEdges()).thenReturn(Collections.singletonList(edge)); + when(edge.getSourceNode()).thenReturn(decisionNode1); + when(edge.getTargetNode()).thenReturn(decisionNode2); + + sourceMagnetConsumer.accept(edgeSourceConnection); + targetMagnetConsumer.accept(edgeTargetConnection); + + doReturn(asList(diagramNode, decisionNode1, decisionNode2)).when(graph).nodes(); + diagram.setGraph(graph); + + return diagram; + } + + @SuppressWarnings("unchecked") + private void checkComponentWidths(Graph> graph) { + final Node node = graph.getNode("_37883BDC-DB54-4925-B539-A0F19B1DDE41"); + assertThat(node).isNotNull(); + assertNodeContentDefinitionIs(node, Decision.class); + + final Decision definition = ((View) node.getContent()).getDefinition(); + assertThat(definition.getExpression()).isNotNull(); + + final HasComponentWidths expression = definition.getExpression(); + final List componentWidths = expression.getComponentWidths(); + assertThat(componentWidths.size()).isEqualTo(expression.getRequiredComponentWidthCount()); + assertThat(componentWidths.get(0)).isEqualTo(50.0); + assertThat(componentWidths.get(1)).isEqualTo(150.0); + assertThat(componentWidths.get(2)).isEqualTo(200.0); + assertThat(componentWidths.get(3)).isEqualTo(250.0); + } + + private static void testAugmentWithNSPrefixes(org.kie.workbench.common.dmn.api.definition.model.Definitions definitions) { + for (Namespace nsp : DMNModelInstrumentedBase.Namespace.values()) { + definitions.getNsContext().put(nsp.getPrefix(), nsp.getUri()); + } + } + + @SuppressWarnings("unchecked") + private Diagram newDiagramDecisionWithExpression(final Expression expression) { + final Diagram diagram = createDiagram(); + final Graph graph = mock(Graph.class); + + final Node diagramNode = mock(Node.class); + final View diagramView = mock(View.class); + final DMNDiagram dmnDiagram = new DMNDiagram(); + doReturn(diagramView).when(diagramNode).getContent(); + doReturn(dmnDiagram).when(diagramView).getDefinition(); + + final Node decisionNode = mock(Node.class); + final View decisionView = mock(View.class); + final Decision decision = new Decision(); + doReturn(decisionView).when(decisionNode).getContent(); + doReturn(decision).when(decisionView).getDefinition(); + decision.setExpression(expression); + + doReturn(asList(diagramNode, decisionNode)).when(graph).nodes(); + ((DiagramImpl) diagram).setGraph(graph); + + return diagram; + } + + private static void checkDecisionExpression(final Graph> unmarshalledGraph, + final Expression expression) { + final Node decisionNode = nodeOfDefinition(unmarshalledGraph.nodes().iterator(), Decision.class); + final Expression decisionNodeExpression = ((Decision) decisionNode.getContent().getDefinition()).getExpression(); + + // The process of marshalling an Expression that has been programmatically instantiated (vs created in the UI) + // leads to the _source_ Expression ComponentWidths being initialised. Therefore to ensure a like-for-like equality + // comparison ensure the unmarshalled _target_ Expression has had it's ComponentWidths initialised too. + decisionNodeExpression.getComponentWidths(); + ((Context) decisionNodeExpression).getContextEntry().get(0).getExpression().getComponentWidths(); + assertThat(decisionNodeExpression).isEqualTo(expression); + } + + private static Node nodeOfDefinition(final Iterator> nodesIterator, final Class aClass) { + return StreamSupport.stream(Spliterators.spliteratorUnknownSize(nodesIterator, Spliterator.NONNULL), false) + .filter(node -> aClass.isInstance(node.getContent().getDefinition())) + .findFirst().get(); + } + + @SafeVarargs + private final XPath namespaceAwareXPath(Map.Entry... pfxAndURI) { + XPath result = XPathFactory.newInstance().newXPath(); + result.setNamespaceContext(new NamespaceContext() { + final Map pfxToURI = new HashMap() {{ + for (Map.Entry pair : pfxAndURI) { + put(pair.getKey(), pair.getValue()); + } + }}; + final Map URItoPfx = new HashMap() {{ + for (Map.Entry pair : pfxAndURI) { + put(pair.getValue(), pair.getKey()); + } + }}; + + @Override + public String getNamespaceURI(String prefix) { + return pfxToURI.get(prefix); + } + + @Override + public String getPrefix(String namespaceURI) { + return URItoPfx.get(namespaceURI); + } + + @Override + public Iterator getPrefixes(String namespaceURI) { + return pfxToURI.keySet().iterator(); + } + }); + return result; + } + + private DMNMarshallerStandalone getDMNMarshaller() { + return new DMNMarshallerStandalone(new XMLEncoderDiagramMetadataMarshaller(), + api.getFactoryManager(), + dmnMarshallerImportsHelper, + getMarshaller()); + } + + private org.kie.dmn.api.marshalling.DMNMarshaller getMarshaller() { + return new DMNMarshallerProducer().get(); + } + + private void assertXPathEquals(XPath xpathOriginal, XPath xpathRoundtrip, String xpathExpression, String expectedXml, String actualXml) throws XPathExpressionException { + InputSource expected = new InputSource(new StringReader(expectedXml)); + InputSource actual = new InputSource(new StringReader(actualXml)); + assertEquals(xpathOriginal.compile(xpathExpression).evaluate(expected), xpathRoundtrip.compile(xpathExpression).evaluate(actual)); + } + + private DiagramImpl createDiagram() { + return api.getFactoryManager().newDiagram("dmnDiagram", + DMN_DEF_SET_ID, + createMetadata()); + } + + private static Metadata createMetadata() { + return mock(Metadata.class); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/DMNMarshallerTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/DMNMarshallerTest.java deleted file mode 100644 index 091eb53b461..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/DMNMarshallerTest.java +++ /dev/null @@ -1,2425 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.dmn.backend; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.StringReader; -import java.math.BigDecimal; -import java.util.AbstractMap; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.OptionalInt; -import java.util.Scanner; -import java.util.Spliterator; -import java.util.Spliterators; -import java.util.function.BiConsumer; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import java.util.stream.StreamSupport; - -import javax.xml.namespace.NamespaceContext; -import javax.xml.namespace.QName; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import org.apache.commons.lang.StringUtils; -import org.apache.tools.ant.filters.StringInputStream; -import org.apache.tools.ant.util.ReaderInputStream; -import org.jboss.errai.marshalling.server.MappingContextSingleton; -import org.junit.Assert; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.api.KieServices; -import org.kie.api.builder.Message; -import org.kie.api.builder.Message.Level; -import org.kie.api.builder.Results; -import org.kie.api.runtime.KieContainer; -import org.kie.dmn.api.core.DMNContext; -import org.kie.dmn.api.core.DMNDecisionResult; -import org.kie.dmn.api.core.DMNDecisionResult.DecisionEvaluationStatus; -import org.kie.dmn.api.core.DMNMessage; -import org.kie.dmn.api.core.DMNModel; -import org.kie.dmn.api.core.DMNResult; -import org.kie.dmn.api.core.DMNRuntime; -import org.kie.dmn.api.core.ast.BusinessKnowledgeModelNode; -import org.kie.dmn.backend.marshalling.v1x.DMNMarshallerFactory; -import org.kie.dmn.core.util.DMNRuntimeUtil; -import org.kie.dmn.core.util.KieHelper; -import org.kie.dmn.model.api.DRGElement; -import org.kie.dmn.model.api.DecisionTable; -import org.kie.dmn.model.api.Definitions; -import org.kie.dmn.model.api.FunctionKind; -import org.kie.dmn.model.api.Import; -import org.kie.dmn.model.api.dmndi.Bounds; -import org.kie.dmn.model.api.dmndi.Color; -import org.kie.dmn.model.api.dmndi.DMNEdge; -import org.kie.dmn.model.api.dmndi.DMNShape; -import org.kie.dmn.model.api.dmndi.DMNStyle; -import org.kie.dmn.model.api.dmndi.DiagramElement; -import org.kie.dmn.model.api.dmndi.Point; -import org.kie.dmn.model.v1_2.TDecision; -import org.kie.dmn.model.v1_2.TInputData; -import org.kie.dmn.model.v1_2.TItemDefinition; -import org.kie.dmn.model.v1_2.TTextAnnotation; -import org.kie.workbench.common.dmn.api.DMNDefinitionSet; -import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; -import org.kie.workbench.common.dmn.api.definition.model.Association; -import org.kie.workbench.common.dmn.api.definition.model.AuthorityRequirement; -import org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel; -import org.kie.workbench.common.dmn.api.definition.model.Context; -import org.kie.workbench.common.dmn.api.definition.model.ContextEntry; -import org.kie.workbench.common.dmn.api.definition.model.DMNDiagram; -import org.kie.workbench.common.dmn.api.definition.model.DMNElement; -import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase; -import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase.Namespace; -import org.kie.workbench.common.dmn.api.definition.model.Decision; -import org.kie.workbench.common.dmn.api.definition.model.DecisionService; -import org.kie.workbench.common.dmn.api.definition.model.Expression; -import org.kie.workbench.common.dmn.api.definition.model.FunctionDefinition; -import org.kie.workbench.common.dmn.api.definition.model.ImportDMN; -import org.kie.workbench.common.dmn.api.definition.model.ImportPMML; -import org.kie.workbench.common.dmn.api.definition.model.InformationItem; -import org.kie.workbench.common.dmn.api.definition.model.InformationRequirement; -import org.kie.workbench.common.dmn.api.definition.model.InputData; -import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; -import org.kie.workbench.common.dmn.api.definition.model.KnowledgeRequirement; -import org.kie.workbench.common.dmn.api.definition.model.KnowledgeSource; -import org.kie.workbench.common.dmn.api.definition.model.LiteralExpression; -import org.kie.workbench.common.dmn.api.definition.model.TextAnnotation; -import org.kie.workbench.common.dmn.api.editors.included.DMNImportTypes; -import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; -import org.kie.workbench.common.dmn.api.factory.DMNGraphFactoryImpl; -import org.kie.workbench.common.dmn.api.graph.DMNDiagramUtils; -import org.kie.workbench.common.dmn.api.property.dmn.Id; -import org.kie.workbench.common.dmn.api.property.dmn.types.BuiltInType; -import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelper; -import org.kie.workbench.common.dmn.backend.definition.v1_1.DecisionConverter; -import org.kie.workbench.common.dmn.backend.definition.v1_1.InputDataConverter; -import org.kie.workbench.common.dmn.backend.definition.v1_1.TextAnnotationConverter; -import org.kie.workbench.common.dmn.backend.producers.DMNMarshallerProducer; -import org.kie.workbench.common.stunner.core.backend.StunnerTestingGraphBackendAPI; -import org.kie.workbench.common.stunner.core.backend.service.XMLEncoderDiagramMetadataMarshaller; -import org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.kie.workbench.common.stunner.core.diagram.DiagramImpl; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.kie.workbench.common.stunner.core.graph.Edge; -import org.kie.workbench.common.stunner.core.graph.Graph; -import org.kie.workbench.common.stunner.core.graph.Node; -import org.kie.workbench.common.stunner.core.graph.content.Bound; -import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; -import org.kie.workbench.common.stunner.core.graph.content.relationship.Child; -import org.kie.workbench.common.stunner.core.graph.content.view.Connection; -import org.kie.workbench.common.stunner.core.graph.content.view.ControlPoint; -import org.kie.workbench.common.stunner.core.graph.content.view.MagnetConnection; -import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; -import org.kie.workbench.common.stunner.core.graph.content.view.View; -import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; -import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; -import org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl; -import org.kie.workbench.common.stunner.core.graph.processing.index.map.MapIndexBuilder; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.uberfire.commons.uuid.UUID; -import org.xml.sax.InputSource; - -import static java.util.Arrays.asList; -import static org.assertj.core.api.Assertions.assertThat; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyList; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class DMNMarshallerTest { - - private static final Logger LOG = LoggerFactory.getLogger(DMNMarshallerTest.class); - private static final String DMN_DEF_SET_ID = BindableAdapterUtils.getDefinitionSetId(DMNDefinitionSet.class); - - @Mock - private DMNMarshallerImportsHelper dmnMarshallerImportsHelper; - - private StunnerTestingGraphBackendAPI api; - - @Before - @SuppressWarnings("unchecked") - public void setup() throws Exception { - api = StunnerTestingGraphBackendAPI.build(DMNDefinitionSet.class); - api.getFactoryManager().registry().register(new DMNGraphFactoryImpl(api.getDefinitionManager(), - api.getFactoryManager(), - api.commandManager, - api.commandFactory, - new MapIndexBuilder())); - } - - /** - * Two issues bellow prevents us from running marshalling tests on IBM jdk - * https://support.oracle.com/knowledge/Middleware/1459269_1.html - * https://www-01.ibm.com/support/docview.wss?uid=swg1PK99682 - */ - @Before - public void doNotRunTestsOnIbmJdk() { - final String ibmVendorName = "IBM"; - final String javaVendorPropertyKey = "java.vendor"; - Assume.assumeFalse(StringUtils.containsIgnoreCase(System.getProperty(javaVendorPropertyKey), ibmVendorName)); - } - - @Test - public void testDynamicMarshallers() { - // This is a fail-fast for Errai's dynamic marshallers. It isn't needed as such for - // testing DMNMarshaller however issues with Errai's dynamic marshaller generation will - // otherwise be reported when compiling the webapp. - MappingContextSingleton.loadDynamicMarshallers(); - } - - @Test - public void testLoan() throws IOException { - roundTripUnmarshalMarshalThenUnmarshalDMN(getClass().getResourceAsStream("/Loan Pre-Qualification.dmn")); - DMNMarshaller m = getDMNMarshaller(); - Graph g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/Loan Pre-Qualification.dmn")); - DiagramImpl diagram = createDiagram(); - diagram.setGraph(g); - String mString = m.marshall(diagram); - final KieServices ks = KieServices.Factory.get(); - final KieContainer kieContainer = KieHelper.getKieContainer(ks.newReleaseId("org.kie", "dmn-testLoan", "1.0"), - ks.getResources().newByteArrayResource(mString.getBytes()).setTargetPath("src/main/resources/Loan Pre-Qualification.dmn")); - - final DMNRuntime runtime = kieContainer.newKieSession().getKieRuntime(DMNRuntime.class); - Assert.assertNotNull(runtime); - DMNModel model = runtime.getModel("http://www.trisotech.com/definitions/_4e0a7f15-3176-427e-add8-68d30903c84c", "Loan Pre-Qualification"); - DMNContext dmnContext = runtime.newContext(); - dmnContext.set("Credit Score", new HashMap() {{ - put("FICO", 400); - }}); - DMNResult dmnResult = runtime.evaluateByName(model, dmnContext, "Credit Score Rating"); - assertFalse(dmnResult.getMessages().toString(), dmnResult.hasErrors()); - } - - @Test - public void test_DecisionTableInputOutputClausesWhenEmpty() throws IOException { - DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/qGslQdo2.dmn")); - Assert.assertNotNull(runtime); - - DMNModel model = runtime.getModel("https://github.com/kiegroup/drools/kie-dmn/_A2C75C01-7EAD-46B8-A499-D85D6C07D273", "_5FE8CBFD-821B-41F6-A6C7-42BE3FC45F2F"); - Assert.assertNotNull(model); - assertThat(model.hasErrors(), is(false)); - - DMNContext dmnContext = runtime.newContext(); - dmnContext.set("my number", -99); - - DMNResult dmnResult = runtime.evaluateAll(model, dmnContext); - LOG.debug("{}", dmnResult); - assertThat(dmnResult.hasErrors(), is(false)); - assertThat(dmnResult.getDecisionResultByName("my decision").getEvaluationStatus(), is(DecisionEvaluationStatus.SUCCEEDED)); - assertThat(dmnResult.getDecisionResultByName("my decision").getResult(), is("negative")); - - org.kie.dmn.model.api.DecisionTable dmnDT = (DecisionTable) model.getDecisionByName("my decision").getDecision().getExpression(); - assertThat(dmnDT.getInput().get(0).getInputValues(), nullValue()); // DROOLS-3262 - assertThat(dmnDT.getOutput().get(0).getOutputValues(), nullValue()); // DROOLS-3262 - assertThat(dmnDT.getOutput().get(0).getDefaultOutputEntry(), nullValue()); // DROOLS-3262 - assertThat(dmnDT.getOutput().get(0).getName(), nullValue()); // DROOLS-3281 - } - - @Test - public void test_diamond() throws IOException { - // round trip test - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/diamondDMN12.dmn"), - this::checkDiamondGraph); - - // additionally, check the marshalled is still DMN executable as expected - DMNMarshaller m = getDMNMarshaller(); - Graph g = m.unmarshall(createMetadata(), - this.getClass().getResourceAsStream("/diamondDMN12.dmn")); - DiagramImpl diagram = createDiagram(); - diagram.setGraph(g); - - String mString = m.marshall(diagram); - final KieServices ks = KieServices.Factory.get(); - final KieContainer kieContainer = KieHelper.getKieContainer(ks.newReleaseId("org.kie", - "dmn-test_diamond", - "1.0"), - ks.getResources().newByteArrayResource(mString.getBytes()).setTargetPath("src/main/resources/diamond.dmn")); - - final DMNRuntime runtime = kieContainer.newKieSession().getKieRuntime(DMNRuntime.class); - Assert.assertNotNull(runtime); - DMNModel diamondModel = runtime.getModel("http://www.trisotech.com/definitions/_8afa6c24-55c8-43cf-8a02-fdde7fc5d1f2", - "three decisions in a diamond shape"); - DMNContext dmnContext = runtime.newContext(); - dmnContext.set("My Name", - "John Doe"); - DMNResult dmnResult = runtime.evaluateAll(diamondModel, - dmnContext); - assertFalse(dmnResult.getMessages().toString(), - dmnResult.hasErrors()); - DMNContext result = dmnResult.getContext(); - assertEquals("Hello, John Doe.", - result.get("My Decision")); - - // additionally, check DMN DD/DI - org.kie.dmn.api.marshalling.DMNMarshaller dmnMarshaller = DMNMarshallerFactory.newDefaultMarshaller(); - Definitions definitions = dmnMarshaller.unmarshal(mString); - - org.kie.dmn.model.api.dmndi.DMNDiagram ddRoot = (org.kie.dmn.model.api.dmndi.DMNDiagram) definitions.getDMNDI().getDMNDiagram().get(0); - - DMNShape myname = findShapeByDMNI(ddRoot, "_4cd17e52-6253-41d6-820d-5824bf5197f3"); - assertBounds(500, 500, 100, 50, myname.getBounds()); - assertColor(255, 255, 255, ((DMNStyle) myname.getStyle()).getFillColor()); - assertColor(0, 0, 0, ((DMNStyle) myname.getStyle()).getStrokeColor()); - assertDMNStyle("Open Sans", 24, 255, 0, 0, (DMNStyle) myname.getStyle()); - - DMNShape prefix = findShapeByDMNI(ddRoot, "_e920f38a-293c-41b8-adb3-69d0dc184fab"); - assertBounds(300, 400, 100, 50, prefix.getBounds()); - assertColor(0, 253, 25, ((DMNStyle) prefix.getStyle()).getFillColor()); - assertColor(253, 0, 0, ((DMNStyle) prefix.getStyle()).getStrokeColor()); - assertDMNStyle("Times New Roman", 8, 70, 60, 50, (DMNStyle) prefix.getStyle()); - - DMNShape postfix = findShapeByDMNI(ddRoot, "_f49f9c34-29d5-4e72-91d2-f4f92117c8da"); - assertBounds(700, 400, 100, 50, postfix.getBounds()); - assertColor(247, 255, 0, ((DMNStyle) postfix.getStyle()).getFillColor()); - assertColor(0, 51, 255, ((DMNStyle) postfix.getStyle()).getStrokeColor()); - assertDMNStyle("Arial", 10, 50, 60, 70, (DMNStyle) postfix.getStyle()); - - DMNShape mydecision = findShapeByDMNI(ddRoot, "_9b061fc3-8109-42e2-9fe4-fc39c90b654e"); - assertBounds(487.5, 275, 125, 75, mydecision.getBounds()); - assertColor(255, 255, 255, ((DMNStyle) mydecision.getStyle()).getFillColor()); - assertColor(0, 0, 0, ((DMNStyle) mydecision.getStyle()).getStrokeColor()); - assertDMNStyle("Monospaced", 32, 55, 66, 77, (DMNStyle) mydecision.getStyle()); - } - - private void assertDMNStyle(String fontName, double fontSize, int r, int g, int b, DMNStyle style) { - assertEquals(fontName, style.getFontFamily()); - assertEquals(fontSize, style.getFontSize(), 0); - assertColor(r, g, b, style.getFontColor()); - } - - private static void assertBounds(double x, double y, double width, double height, Bounds bounds) { - assertEquals(x, bounds.getX(), 0); - assertEquals(y, bounds.getY(), 0); - assertEquals(width, bounds.getWidth(), 0); - assertEquals(height, bounds.getHeight(), 0); - } - - private static void assertColor(int r, int g, int b, Color color) { - assertEquals(r, color.getRed()); - assertEquals(g, color.getGreen()); - assertEquals(b, color.getBlue()); - } - - private static DMNShape findShapeByDMNI(org.kie.dmn.model.api.dmndi.DMNDiagram root, String id) { - return root.getDMNDiagramElement().stream() - .filter(DMNShape.class::isInstance) - .map(DMNShape.class::cast) - .filter(shape -> shape.getDmnElementRef().getLocalPart().equals(id)) - .findFirst() - .orElseThrow(() -> new UnsupportedOperationException("There is no DMNShape with id '" + id + "' in DMNDiagram " + root)); - } - - private static DMNEdge findEdgeByDMNI(org.kie.dmn.model.api.dmndi.DMNDiagram root, String id) { - return root.getDMNDiagramElement().stream() - .filter(DMNEdge.class::isInstance) - .map(DMNEdge.class::cast) - .filter(shape -> shape.getDmnElementRef().getLocalPart().equals(id)) - .findFirst() - .orElseThrow(() -> new UnsupportedOperationException("There is no DMNEdge with id '" + id + "' in DMNDiagram " + root)); - } - - @Test - public void test_potpourri_drawing() throws IOException { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/potpourri_drawing.dmn"), - this::checkPotpourriGraph); - } - - @Test - public void testAssociations() throws IOException { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/associations.dmn"), - this::checkAssociationsGraph); - } - - @Test - public void testTextAnnotation() throws Exception { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/textAnnotation.dmn"), - this::checkTextAnnotationGraph); - } - - @Test - public void testTextAnnotationWithCDATA() throws Exception { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/textAnnotationCDATA.dmn"), - this::checkTextAnnotationGraph); - } - - @Test - public void testDecisionWithContext() throws Exception { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/DecisionWithContext.dmn"), - this::checkDecisionWithContext); - } - - @Test - public void testDecisionWithContextWithDefaultResult() throws Exception { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/DecisionWithContextWithDefaultResult.dmn"), - this::checkDecisionWithContextWithDefaultResult); - } - - @Test - public void testDecisionWithContextWithoutDefaultResult() throws Exception { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/DecisionWithContextWithoutDefaultResult.dmn"), - this::checkDecisionWithContextWithoutDefaultResult); - } - - @Test - public void testEdgewaypoint() throws Exception { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/edgewaypoint.dmn"), - this::checkEdgewaypoint); - } - - @Test - public void test_decisionqa() throws IOException { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/decisionqa.dmn"), - this::checkDecisionqa); - } - - @Test - public void test_decisionservice_1outputDecision() throws IOException { - final DMNMarshaller m = getDMNMarshaller(); - @SuppressWarnings("unchecked") - final Graph> g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/DROOLS-3372.dmn")); - Node nodeDS = g.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); - Node nodeDecisionPostfix = g.getNode("_3a69915a-30af-4de3-a07f-6be514f53caa"); - moveNode(nodeDecisionPostfix, 0, -280); - makeNodeChildOf(nodeDecisionPostfix, nodeDS); - DiagramImpl diagram = createDiagram(); - diagram.setGraph(g); - String mString = m.marshall(diagram); - LOG.debug("MARSHALLED ROUNDTRIP RESULTING xml:\n{}\n", mString); - roundTripUnmarshalThenMarshalUnmarshal(new ReaderInputStream(new StringReader(mString)), - this::check_decisionservice_1outputDecision); - } - - @SuppressWarnings("unchecked") - private void check_decisionservice_1outputDecision(Graph> graph) { - Node node = graph.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); - assertNodeContentDefinitionIs(node, DecisionService.class); - DecisionService definition = ((View) node.getContent()).getDefinition(); - assertEquals(0, definition.getEncapsulatedDecision().size()); - assertEquals(0, definition.getInputData().size()); - assertEquals(1, definition.getOutputDecision().size()); - assertEquals("#" + "_3a69915a-30af-4de3-a07f-6be514f53caa", definition.getOutputDecision().get(0).getHref()); - assertEquals(1, definition.getInputDecision().size()); - assertEquals("#" + "_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a", definition.getInputDecision().get(0).getHref()); - } - - @Test - public void test_decisionservice_1outputDecision1encapsulatedDecision() throws IOException { - final DMNMarshaller m = getDMNMarshaller(); - @SuppressWarnings("unchecked") - final Graph> g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/DROOLS-3372.dmn")); - Node nodeDS = g.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); - Node nodeDecisionPostfix = g.getNode("_3a69915a-30af-4de3-a07f-6be514f53caa"); - Node nodeDecisionPrefix = g.getNode("_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a"); - moveNode(nodeDecisionPostfix, 0, -280); - makeNodeChildOf(nodeDecisionPostfix, nodeDS); - moveNode(nodeDecisionPrefix, 0, -170); - makeNodeChildOf(nodeDecisionPrefix, nodeDS); - DiagramImpl diagram = createDiagram(); - diagram.setGraph(g); - String mString = m.marshall(diagram); - LOG.debug("MARSHALLED ROUNDTRIP RESULTING xml:\n{}\n", mString); - roundTripUnmarshalThenMarshalUnmarshal(new ReaderInputStream(new StringReader(mString)), - this::check_decisionservice_1outputDecision1encapsulatedDecision); - } - - @SuppressWarnings("unchecked") - private void check_decisionservice_1outputDecision1encapsulatedDecision(Graph> graph) { - Node node = graph.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); - assertNodeContentDefinitionIs(node, DecisionService.class); - DecisionService definition = ((View) node.getContent()).getDefinition(); - assertEquals(1, definition.getEncapsulatedDecision().size()); - assertEquals("#" + "_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a", definition.getEncapsulatedDecision().get(0).getHref()); - assertEquals(1, definition.getInputData().size()); - assertEquals("#" + "_dd5b090f-6d52-4bd8-8c7f-0c469983d44e", definition.getInputData().get(0).getHref()); - assertEquals(1, definition.getOutputDecision().size()); - assertEquals("#" + "_3a69915a-30af-4de3-a07f-6be514f53caa", definition.getOutputDecision().get(0).getHref()); - assertEquals(0, definition.getInputDecision().size()); - } - - @Test - public void test_decisionservice2_1outputDecision1encapsulatedDecision() throws IOException { - final DMNMarshaller m = getDMNMarshaller(); - @SuppressWarnings("unchecked") - final Graph> g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/DROOLS-3372bis.dmn")); - Node nodeDS = g.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); - Node nodeDecisionPostfix = g.getNode("_3a69915a-30af-4de3-a07f-6be514f53caa"); - Node nodeDecisionPrefix = g.getNode("_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a"); - moveNode(nodeDecisionPostfix, 0, -280); - makeNodeChildOf(nodeDecisionPostfix, nodeDS); - moveNode(nodeDecisionPrefix, 0, -170); - makeNodeChildOf(nodeDecisionPrefix, nodeDS); - DiagramImpl diagram = createDiagram(); - diagram.setGraph(g); - String mString = m.marshall(diagram); - LOG.debug("MARSHALLED ROUNDTRIP RESULTING xml:\n{}\n", mString); - roundTripUnmarshalThenMarshalUnmarshal(new ReaderInputStream(new StringReader(mString)), - this::check_decisionservice2_1outputDecision1encapsulatedDecision); - } - - @SuppressWarnings("unchecked") - private void check_decisionservice2_1outputDecision1encapsulatedDecision(Graph> graph) { - Node node = graph.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); - assertNodeContentDefinitionIs(node, DecisionService.class); - DecisionService definition = ((View) node.getContent()).getDefinition(); - assertEquals(3, definition.getEncapsulatedDecision().size()); - assertEquals("#_ca9d65e7-a5fa-4a13-98b7-8404f4601147", definition.getEncapsulatedDecision().get(0).getHref()); - assertEquals("#_4b02cf97-5f9b-48ee-a4ae-229233238876", definition.getEncapsulatedDecision().get(1).getHref()); - assertEquals("#" + "_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a", definition.getEncapsulatedDecision().get(2).getHref()); - assertEquals(1, definition.getInputData().size()); - assertEquals("#" + "_dd5b090f-6d52-4bd8-8c7f-0c469983d44e", definition.getInputData().get(0).getHref()); - assertEquals(3, definition.getOutputDecision().size()); - assertEquals("#_a5d0e474-083f-44ef-b00e-4ddc9a9ebd34", definition.getOutputDecision().get(0).getHref()); - assertEquals("#_8878539e-1c50-4622-b601-5878c97dc34e", definition.getOutputDecision().get(1).getHref()); - assertEquals("#" + "_3a69915a-30af-4de3-a07f-6be514f53caa", definition.getOutputDecision().get(2).getHref()); - assertEquals(0, definition.getInputDecision().size()); - } - - @Test - public void test_decisionservice2_remove_1outputDecision1encapsulatedDecision() throws IOException { - final DMNMarshaller m = getDMNMarshaller(); - @SuppressWarnings("unchecked") - final Graph> g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/DROOLS-3372bis.dmn")); - Node nodeDS = g.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); - Node nodeDecisionPostfix = g.getNode("_3a69915a-30af-4de3-a07f-6be514f53caa"); - Node nodeDecisionPrefix = g.getNode("_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a"); - moveNode(nodeDecisionPostfix, 0, -280); - makeNodeChildOf(nodeDecisionPostfix, nodeDS); - moveNode(nodeDecisionPrefix, 0, -170); - makeNodeChildOf(nodeDecisionPrefix, nodeDS); - DiagramImpl diagram = createDiagram(); - Node nodeEncaps1 = g.getNode("_ca9d65e7-a5fa-4a13-98b7-8404f4601147"); - moveNode(nodeEncaps1, 0, +400); - removeNodeChildOf(nodeEncaps1, nodeDS); - Node nodeEncaps2 = g.getNode("_4b02cf97-5f9b-48ee-a4ae-229233238876"); - moveNode(nodeEncaps2, 0, +400); - removeNodeChildOf(nodeEncaps2, nodeDS); - Node nodeHardcoded2 = g.getNode("_8878539e-1c50-4622-b601-5878c97dc34e"); - moveNode(nodeHardcoded2, 0, +400); - removeNodeChildOf(nodeHardcoded2, nodeDS); - diagram.setGraph(g); - String mString = m.marshall(diagram); - LOG.debug("MARSHALLED ROUNDTRIP RESULTING xml:\n{}\n", mString); - roundTripUnmarshalThenMarshalUnmarshal(new ReaderInputStream(new StringReader(mString)), - this::check_decisionservice2_remove_1outputDecision1encapsulatedDecision); - } - - private void removeNodeChildOf(Node childNode, Node nodeDS) { - nodeDS.getOutEdges().removeIf(x -> { - Edge, ?> edge = x; - return edge.getContent() instanceof Child && edge.getTargetNode().equals(childNode); - }); - childNode.getInEdges().removeIf(x -> { - Edge, ?> edge = x; - return edge.getContent() instanceof Child && edge.getSourceNode().equals(nodeDS); - }); - } - - @SuppressWarnings("unchecked") - private void check_decisionservice2_remove_1outputDecision1encapsulatedDecision(Graph> graph) { - Node node = graph.getNode("_659a06e2-ae80-496c-8783-f790a640bb49"); - assertNodeContentDefinitionIs(node, DecisionService.class); - DecisionService definition = ((View) node.getContent()).getDefinition(); - assertEquals(1, definition.getEncapsulatedDecision().size()); - // no more "#_ca9d65e7-a5fa-4a13-98b7-8404f4601147" - // no more "#_4b02cf97-5f9b-48ee-a4ae-229233238876" - assertEquals("#" + "_afce4fb3-9a7c-4791-bbfe-63d4b76bd61a", definition.getEncapsulatedDecision().get(0).getHref()); - assertEquals(1, definition.getInputData().size()); - assertEquals("#" + "_dd5b090f-6d52-4bd8-8c7f-0c469983d44e", definition.getInputData().get(0).getHref()); - assertEquals(2, definition.getOutputDecision().size()); - assertEquals("#_a5d0e474-083f-44ef-b00e-4ddc9a9ebd34", definition.getOutputDecision().get(0).getHref()); - // no more "#_8878539e-1c50-4622-b601-5878c97dc34e" - assertEquals("#" + "_3a69915a-30af-4de3-a07f-6be514f53caa", definition.getOutputDecision().get(1).getHref()); - assertEquals(1, definition.getInputDecision().size()); - assertEquals("#_ca9d65e7-a5fa-4a13-98b7-8404f4601147", definition.getInputDecision().get(0).getHref()); - } - - private void makeNodeChildOf(Node nodeDecisionPostfix, Node nodeDS) { - Edge myEdge = new EdgeImpl<>(UUID.uuid()); - myEdge.setContent(new Child()); - myEdge.setSourceNode(nodeDS); - myEdge.setTargetNode(nodeDecisionPostfix); - nodeDS.getOutEdges().add(myEdge); - nodeDecisionPostfix.getInEdges().add(myEdge); - } - - private void moveNode(Node nodeDecisionPostfix, int dx, int dy) { - View content = (View) nodeDecisionPostfix.getContent(); - Bound ul = content.getBounds().getUpperLeft(); - Bound lr = content.getBounds().getLowerRight(); - content.setBounds(org.kie.workbench.common.stunner.core.graph.content.Bounds.create(ul.getX() + dx, ul.getY() + dy, lr.getX() + dx, lr.getY() + dy)); - } - - @Test - public void test_decisionservice3_evaluate() throws IOException { - DMNRuntime dmnRuntime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/DROOLS-3372evaluate.dmn")); - assertThat(dmnRuntime.getModels()).hasSize(1); - final DMNModel dmnModel = dmnRuntime.getModels().get(0); - final DMNContext context = dmnRuntime.newContext(); - context.set("in1", "asd"); - final DMNResult result = dmnRuntime.evaluateAll(dmnModel, context); - assertThat(result.getDecisionResultByName("outInDS").getResult()).isEqualTo("outInDSasd"); - assertThat(result.getDecisionResultByName("out1").getResult()).isEqualTo("outInDSp1 outInDSin1"); - } - - @Test - public void test_fontsize_stunner() throws IOException { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/test-FontSize-stunner.dmn"), - this::checkFontsize_stunner); - } - - @SuppressWarnings("unchecked") - private void checkFontsize_stunner(Graph> graph) { - Node node = graph.getNode("_A9D510E0-1942-4945-A945-0213EC6AAEC5"); - assertNodeContentDefinitionIs(node, InputData.class); - InputData definition = ((View) node.getContent()).getDefinition(); - assertEquals(Double.valueOf(21), definition.getFontSet().getFontSize().getValue()); - } - - @Test - public void test_fontsize_sharedStyle() throws IOException { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/test-FontSize-sharedStyle.dmn"), - this::checkFontsize_sharedStyle); - } - - @SuppressWarnings("unchecked") - private void checkFontsize_sharedStyle(Graph> graph) { - Node node = graph.getNode("_38b74e2e-32f8-42c5-ab51-8a3e927637e0"); - assertNodeContentDefinitionIs(node, InputData.class); - InputData definition = ((View) node.getContent()).getDefinition(); - assertEquals(Double.valueOf(21), definition.getFontSet().getFontSize().getValue()); - } - - @SuppressWarnings("unchecked") - private void checkDecisionqa(Graph> graph) { - Node decision = graph.getNode("_7052d0f6-ccee-462b-bd89-76afc3b6f67b"); - assertNodeContentDefinitionIs(decision, - Decision.class); - Decision decisionDefinition = ((View) decision.getContent()).getDefinition(); - assertEquals("hardcoded question", decisionDefinition.getName().getValue()); - assertEquals("What is the codename?", decisionDefinition.getQuestion().getValue()); - assertEquals("47.", decisionDefinition.getAllowedAnswers().getValue()); - } - - @SuppressWarnings("unchecked") - private void checkEdgewaypoint(Graph> graph) { - Node decision = graph.getNode("_7647e26b-6c7c-46db-aa34-1a1a2b4d8d79"); - assertNodeContentDefinitionIs(decision, - Decision.class); - Decision decisionDefinition = ((View) decision.getContent()).getDefinition(); - assertEquals("my decision", - decisionDefinition.getName().getValue()); - - Node inputdata = graph.getNode("_fd528e66-e2a4-4b7f-aae1-c3ca6723d0cb"); - assertNodeEdgesTo(inputdata, - decision, - InformationRequirement.class); - - // asserted the two Stunner graph nodes are properly connected, assert location of edge. - List> outEdges = (List>) inputdata.getOutEdges(); - Edge edge = outEdges.stream().filter(e -> e.getTargetNode().equals(decision)).findFirst().get(); - ViewConnector connectionContent = (ViewConnector) edge.getContent(); - Point2D sourceLocation = connectionContent.getSourceConnection().get().getLocation(); - assertEquals(266.9968013763428d, ((View) inputdata.getContent()).getBounds().getUpperLeft().getX() + sourceLocation.getX(), 0.1d); - assertEquals(225.99999618530273d, ((View) inputdata.getContent()).getBounds().getUpperLeft().getY() + sourceLocation.getY(), 0.1d); - - Point2D targetLocation = connectionContent.getTargetConnection().get().getLocation(); - assertEquals(552.2411708831787d, ((View) decision.getContent()).getBounds().getUpperLeft().getX() + targetLocation.getX(), 0.1d); - assertEquals(226d, ((View) decision.getContent()).getBounds().getUpperLeft().getY() + targetLocation.getY(), 0.1d); - - assertEquals(1, connectionContent.getControlPoints().length); - Point2D controlPointLocation = connectionContent.getControlPoints()[0].getLocation(); - assertEquals(398.61898612976074d, controlPointLocation.getX(), 0.1d); - assertEquals(116.99999809265137d, controlPointLocation.getY(), 0.1d); - - final Connection sourceConnection = connectionContent.getSourceConnection().get(); - assertTrue(sourceConnection instanceof MagnetConnection); - assertTrue(((MagnetConnection) sourceConnection).isAuto()); - - final Connection targetConnection = connectionContent.getTargetConnection().get(); - assertTrue(targetConnection instanceof MagnetConnection); - assertTrue(((MagnetConnection) targetConnection).isAuto()); - } - - @SuppressWarnings("unchecked") - private void checkTextAnnotationGraph(Graph> graph) { - Node textAnnotation = graph.getNode("60915990-9E1D-42DF-B7F6-0D28383BE9D1"); - assertNodeContentDefinitionIs(textAnnotation, - TextAnnotation.class); - TextAnnotation textAnnotationDefinition = ((View) textAnnotation.getContent()).getDefinition(); - assertEquals("描述", - textAnnotationDefinition.getDescription().getValue()); - assertEquals("This Annotation holds some Long text and also UTF-8 characters", - textAnnotationDefinition.getText().getValue()); - assertEquals("text/html", - textAnnotationDefinition.getTextFormat().getValue()); - } - - public void testTreeStructure() throws IOException { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/treeStructure.dmn"), - this::checkTreeStructureGraph); - } - - public void roundTripUnmarshalThenMarshalUnmarshal(InputStream dmnXmlInputStream, - Consumer>> checkGraphConsumer) throws IOException { - DMNMarshaller m = getDMNMarshaller(); - - // first unmarshal from DMN XML to Stunner DMN Graph - @SuppressWarnings("unchecked") - Graph> g = m.unmarshall(createMetadata(), - dmnXmlInputStream); - checkGraphConsumer.accept(g); - - // round trip to Stunner DMN Graph back to DMN XML - DiagramImpl diagram = createDiagram(); - diagram.setGraph(g); - - String mString = m.marshall(diagram); - LOG.debug(mString); - - // now unmarshal once more, from the marshalled just done above, back again to Stunner DMN Graph to complete check for round-trip - @SuppressWarnings("unchecked") - Graph> g2 = m.unmarshall(createMetadata(), - new StringInputStream(mString)); - checkGraphConsumer.accept(g2); - } - - private void checkTreeStructureGraph(Graph> graph) { - Node root = graph.getNode("BBF2B56F-A0AF-4428-AA6A-61A655D72883"); - Node decisionOne = graph.getNode("B7DD0DC9-7FAC-4510-9031-FFEE067CC2F5"); - Node decisionTwo = graph.getNode("DF84B353-A2F6-46B9-B680-EBD98F5084C8"); - Node decisionThree = graph.getNode("1B6EF5EB-CA09-45A5-AB03-21CD70F941AD"); - Node bkmRoot = graph.getNode("AD910446-56AD-49A5-99CE-F7B9C6F74E5E"); - Node bkmOne = graph.getNode("C1D0937E-96F4-4EAF-8A85-45B129F38E9B"); - Node bkmTwo = graph.getNode("47E47E51-4509-4A3B-86E9-D690F397B69C"); - Node annotation = graph.getNode("47C5A244-EF6D-473D-99B6-629F70A49FCC"); - Node knowledgeSource = graph.getNode("CFE44FA9-7309-4F28-81E9-5C1EF455B4C2"); - Node knowledgeSourceInput = graph.getNode("BC0D715A-ADD4-4136-AB3D-226EABC840A2"); - Node decisionOneInput = graph.getNode("CF65CEB9-433F-402F-A485-90AC34E2FE39"); - - assertNodeEdgesTo(decisionOne, - root, - InformationRequirement.class); - - assertNodeEdgesTo(decisionTwo, - decisionOne, - InformationRequirement.class); - - assertNodeEdgesTo(decisionThree, - decisionOne, - InformationRequirement.class); - - assertNodeEdgesTo(bkmRoot, - annotation, - Association.class); - - assertNodeEdgesTo(bkmRoot, - decisionOne, - KnowledgeRequirement.class); - - assertNodeEdgesTo(bkmOne, - bkmRoot, - KnowledgeRequirement.class); - - assertNodeEdgesTo(bkmTwo, - bkmRoot, - KnowledgeRequirement.class); - - assertNodeEdgesTo(decisionOneInput, - decisionOne, - InformationRequirement.class); - - assertNodeEdgesTo(knowledgeSource, - decisionOne, - AuthorityRequirement.class); - - assertNodeEdgesTo(knowledgeSourceInput, - knowledgeSource, - AuthorityRequirement.class); - } - - @SuppressWarnings("unchecked") - private void checkDecisionWithContext(Graph> g) { - Node decisionNode = g.getNode("_30810b88-8416-4c02-8ed1-8c19b7606243"); - assertNodeContentDefinitionIs(decisionNode, - Decision.class); - - Node rootNode = DMNMarshaller.findDMNDiagramRoot((Graph) g); - assertNotNull(rootNode); - assertRootNodeConnectedTo(rootNode, - decisionNode); - assertEquals("decisionNode parent is Definitions DMN root", - "_153e2b47-3bd2-4db0-828c-db3fce0b3199", - ((DMNElement) ((Decision) ((View) decisionNode.getContent()).getDefinition()).getParent()).getId().getValue()); - - Context context = (Context) ((Decision) ((View) decisionNode.getContent()).getDefinition()).getExpression(); - assertEquals("contextNode's parent is decisionNode", - "_30810b88-8416-4c02-8ed1-8c19b7606243", - ((DMNElement) context.getParent()).getId().getValue()); - - Expression literalExpression1 = context.getContextEntry().get(0).getExpression(); - assertEquals("literalExpression1's parent-parent is contextNode", - "_0f38d114-5d6e-40dd-aa9c-9f031f9b0571", - ((DMNElement) (literalExpression1).getParent() - .getParent()).getId().getValue()); - - Expression literalExpression2 = context.getContextEntry().get(1).getExpression(); - assertEquals("literalExpression2's parent-parent is contextNode", - "_0f38d114-5d6e-40dd-aa9c-9f031f9b0571", - ((DMNElement) (literalExpression2).getParent() - .getParent()).getId().getValue()); - } - - private void checkDecisionWithContextWithDefaultResult(Graph> g) { - Node decisionNode = g.getNode("_30810b88-8416-4c02-8ed1-8c19b7606243"); - assertNodeContentDefinitionIs(decisionNode, - Decision.class); - - Context context = (Context) ((Decision) ((View) decisionNode.getContent()).getDefinition()).getExpression(); - - InformationItem defaultResultVariable = context.getContextEntry().get(1).getVariable(); - assertNull("Default result variable", - defaultResultVariable); - Expression defaultResultExpression = context.getContextEntry().get(1).getExpression(); - assertNotNull("Default result expression", - defaultResultExpression); - assertEquals("defaultResultExpression's parent-parent is contextNode", - "_0f38d114-5d6e-40dd-aa9c-9f031f9b0571", - ((DMNElement) (defaultResultExpression).getParent() - .getParent()).getId().getValue()); - } - - private void checkDecisionWithContextWithoutDefaultResult(Graph> g) { - Node decisionNode = g.getNode("_30810b88-8416-4c02-8ed1-8c19b7606243"); - assertNodeContentDefinitionIs(decisionNode, - Decision.class); - - Context context = (Context) ((Decision) ((View) decisionNode.getContent()).getDefinition()).getExpression(); - - InformationItem defaultResultVariable = context.getContextEntry().get(1).getVariable(); - assertNull("Default result variable", - defaultResultVariable); - Expression defaultResultExpression = context.getContextEntry().get(1).getExpression(); - assertNull("Default result expression", - defaultResultExpression); - } - - @SuppressWarnings("unchecked") - private void checkDiamondGraph(Graph> g) { - Node idNode = g.getNode("_4cd17e52-6253-41d6-820d-5824bf5197f3"); - assertNodeContentDefinitionIs(idNode, - InputData.class); - assertNodeEdgesTo(idNode, - g.getNode("_e920f38a-293c-41b8-adb3-69d0dc184fab"), - InformationRequirement.class); - assertNodeEdgesTo(idNode, - g.getNode("_f49f9c34-29d5-4e72-91d2-f4f92117c8da"), - InformationRequirement.class); - assertNodeEdgesTo(idNode, - g.getNode("_9b061fc3-8109-42e2-9fe4-fc39c90b654e"), - InformationRequirement.class); - - Node prefixDecisionNode = g.getNode("_e920f38a-293c-41b8-adb3-69d0dc184fab"); - assertNodeContentDefinitionIs(prefixDecisionNode, - Decision.class); - assertNodeEdgesTo(prefixDecisionNode, - g.getNode("_9b061fc3-8109-42e2-9fe4-fc39c90b654e"), - InformationRequirement.class); - - Node postfixDecisionNode = g.getNode("_f49f9c34-29d5-4e72-91d2-f4f92117c8da"); - assertNodeContentDefinitionIs(postfixDecisionNode, - Decision.class); - assertNodeEdgesTo(postfixDecisionNode, - g.getNode("_9b061fc3-8109-42e2-9fe4-fc39c90b654e"), - InformationRequirement.class); - - Node myDecisionNode = g.getNode("_9b061fc3-8109-42e2-9fe4-fc39c90b654e"); - assertNodeContentDefinitionIs(myDecisionNode, - Decision.class); - - Node rootNode = DMNMarshaller.findDMNDiagramRoot((Graph) g); - assertNotNull(rootNode); - assertRootNodeConnectedTo(rootNode, - idNode); - assertRootNodeConnectedTo(rootNode, - prefixDecisionNode); - assertRootNodeConnectedTo(rootNode, - postfixDecisionNode); - assertRootNodeConnectedTo(rootNode, - myDecisionNode); - } - - @SuppressWarnings("unchecked") - private void checkAssociationsGraph(Graph> g) { - Node inputData = g.getNode("BD168F8B-4398-4478-8BEA-E67AA5F90FAF"); - assertNodeContentDefinitionIs(inputData, - InputData.class); - - Node decision = g.getNode("A960E2D2-FBC1-4D11-AA33-064F6A0B5CB9"); - assertNodeContentDefinitionIs(decision, - Decision.class); - - Node knowledgeSource = g.getNode("FB99ED65-BC43-4750-999F-7FE24690845B"); - assertNodeContentDefinitionIs(knowledgeSource, - KnowledgeSource.class); - - Node bkm = g.getNode("2F07453C-854F-436F-8378-4CFCE63BB124"); - assertNodeContentDefinitionIs(bkm, - BusinessKnowledgeModel.class); - - Node textAnnotation = g.getNode("7F4B8130-6F3D-4A16-9F6C-01D01DA481D2"); - assertNodeContentDefinitionIs(textAnnotation, - TextAnnotation.class); - - Edge fromInput = assertNodeEdgesTo(inputData, - textAnnotation, - Association.class); - assertEquals("From Input", - ((View) fromInput.getContent()).getDefinition().getDescription().getValue()); - - Edge fromDecision = assertNodeEdgesTo(decision, - textAnnotation, - Association.class); - assertEquals("From Decision", - ((View) fromDecision.getContent()).getDefinition().getDescription().getValue()); - - Edge fromBkm = assertNodeEdgesTo(bkm, - textAnnotation, - Association.class); - assertEquals("From BKM", - ((View) fromBkm.getContent()).getDefinition().getDescription().getValue()); - - Edge fromKnowledgeSource = assertNodeEdgesTo(knowledgeSource, - textAnnotation, - Association.class); - assertEquals("From Knowledge Source", - ((View) fromKnowledgeSource.getContent()).getDefinition().getDescription().getValue()); - } - - @SuppressWarnings("unchecked") - private void checkPotpourriGraph(Graph> g) { - Node _My_Input_Data = g.getNode("_My_Input_Data"); - assertNodeContentDefinitionIs(_My_Input_Data, - InputData.class); - assertNodeEdgesTo(_My_Input_Data, - g.getNode("_My_Decision_1"), - InformationRequirement.class); - assertNodeEdgesTo(_My_Input_Data, - g.getNode("_KS_of_Input_Data"), - AuthorityRequirement.class); - assertNodeEdgesTo(_My_Input_Data, - g.getNode("_Annotation_for_Input_Data"), - Association.class); - - Node _Annotation_for_Input_Data = g.getNode("_Annotation_for_Input_Data"); - assertNodeContentDefinitionIs(_Annotation_for_Input_Data, - TextAnnotation.class); - - Node _KS_of_Input_Data = g.getNode("_KS_of_Input_Data"); - assertNodeContentDefinitionIs(_KS_of_Input_Data, - KnowledgeSource.class); - - Node _KS_of_KS_of_InputData = g.getNode("_KS_of_KS_of_InputData"); - assertNodeContentDefinitionIs(_KS_of_KS_of_InputData, - KnowledgeSource.class); - assertNodeEdgesTo(_KS_of_KS_of_InputData, - g.getNode("_KS_of_Input_Data"), - AuthorityRequirement.class); - - Node _KS_of_KS_of_Decision_1 = g.getNode("_KS_of_KS_of_Decision_1"); - assertNodeContentDefinitionIs(_KS_of_KS_of_Decision_1, - KnowledgeSource.class); - assertNodeEdgesTo(_KS_of_KS_of_Decision_1, - g.getNode("_KS_of_Decision_1"), - AuthorityRequirement.class); - - Node _KS_of_Decision_1 = g.getNode("_KS_of_Decision_1"); - assertNodeContentDefinitionIs(_KS_of_Decision_1, - KnowledgeSource.class); - assertNodeEdgesTo(_KS_of_Decision_1, - g.getNode("_My_Decision_1"), - AuthorityRequirement.class); - - Node _My_Decision_2 = g.getNode("_My_Decision_2"); - assertNodeContentDefinitionIs(_My_Decision_2, - Decision.class); - assertNodeEdgesTo(_My_Decision_2, - g.getNode("_KS_of_Decision_2"), - AuthorityRequirement.class); - assertNodeEdgesTo(_My_Decision_2, - g.getNode("_Annotation_for_Decision_2"), - Association.class); - - Node _KS_of_Decision_2 = g.getNode("_KS_of_Decision_2"); - assertNodeContentDefinitionIs(_KS_of_Decision_2, - KnowledgeSource.class); - - Node _Annotation_for_Decision_2 = g.getNode("_Annotation_for_Decision_2"); - assertNodeContentDefinitionIs(_Annotation_for_Decision_2, - TextAnnotation.class); - - Node _Annotation_for_BKM_1 = g.getNode("_Annotation_for_BKM_1"); - assertNodeContentDefinitionIs(_Annotation_for_BKM_1, - TextAnnotation.class); - assertNodeEdgesTo(_Annotation_for_BKM_1, - g.getNode("_My_BKM_1_of_Decision_1"), - Association.class); - - Node _My_BKM_1_of_Decision_1 = g.getNode("_My_BKM_1_of_Decision_1"); - assertNodeContentDefinitionIs(_My_BKM_1_of_Decision_1, - BusinessKnowledgeModel.class); - assertNodeEdgesTo(_My_BKM_1_of_Decision_1, - g.getNode("_My_Decision_1"), - KnowledgeRequirement.class); - - Node _KS_of_BKM_1 = g.getNode("_KS_of_BKM_1"); - assertNodeContentDefinitionIs(_KS_of_BKM_1, - KnowledgeSource.class); - assertNodeEdgesTo(_KS_of_BKM_1, - g.getNode("_My_BKM_1_of_Decision_1"), - AuthorityRequirement.class); - - Node _KS_of_KS_of_BKM_1 = g.getNode("_KS_of_KS_of_BKM_1"); - assertNodeContentDefinitionIs(_KS_of_KS_of_BKM_1, - KnowledgeSource.class); - assertNodeEdgesTo(_KS_of_KS_of_BKM_1, - g.getNode("_KS_of_BKM_1"), - AuthorityRequirement.class); - - Node _My_BKM_2_of_BKM_1 = g.getNode("_My_BKM_2_of_BKM_1"); - assertNodeContentDefinitionIs(_My_BKM_2_of_BKM_1, - BusinessKnowledgeModel.class); - assertNodeEdgesTo(_My_BKM_2_of_BKM_1, - g.getNode("_My_BKM_1_of_Decision_1"), - KnowledgeRequirement.class); - - Node _KS_of_BKM_2 = g.getNode("_KS_of_BKM_2"); - assertNodeContentDefinitionIs(_KS_of_BKM_2, - KnowledgeSource.class); - assertNodeEdgesTo(_KS_of_BKM_2, - g.getNode("_My_BKM_2_of_BKM_1"), - AuthorityRequirement.class); - assertNodeEdgesTo(_KS_of_BKM_2, - g.getNode("_Annotation_for_KS_of_BKM_2"), - Association.class); - - Node _Annotation_for_KS_of_BKM_2 = g.getNode("_Annotation_for_KS_of_BKM_2"); - assertNodeContentDefinitionIs(_Annotation_for_KS_of_BKM_2, - TextAnnotation.class); - - Node _My_Decision_1 = g.getNode("_My_Decision_1"); - assertNodeContentDefinitionIs(_My_Decision_1, - Decision.class); - - Node rootNode = DMNMarshaller.findDMNDiagramRoot((Graph) g); - assertNotNull(rootNode); - assertRootNodeConnectedTo(rootNode, - _My_Input_Data); - assertRootNodeConnectedTo(rootNode, - _Annotation_for_Input_Data); - assertRootNodeConnectedTo(rootNode, - _KS_of_Input_Data); - assertRootNodeConnectedTo(rootNode, - _KS_of_KS_of_InputData); - assertRootNodeConnectedTo(rootNode, - _KS_of_KS_of_Decision_1); - assertRootNodeConnectedTo(rootNode, - _KS_of_Decision_1); - assertRootNodeConnectedTo(rootNode, - _My_Decision_2); - assertRootNodeConnectedTo(rootNode, - _KS_of_Decision_2); - assertRootNodeConnectedTo(rootNode, - _Annotation_for_Decision_2); - assertRootNodeConnectedTo(rootNode, - _Annotation_for_BKM_1); - assertRootNodeConnectedTo(rootNode, - _My_BKM_1_of_Decision_1); - assertRootNodeConnectedTo(rootNode, - _KS_of_BKM_1); - assertRootNodeConnectedTo(rootNode, - _KS_of_KS_of_BKM_1); - assertRootNodeConnectedTo(rootNode, - _My_BKM_2_of_BKM_1); - assertRootNodeConnectedTo(rootNode, - _KS_of_BKM_2); - assertRootNodeConnectedTo(rootNode, - _Annotation_for_KS_of_BKM_2); - assertRootNodeConnectedTo(rootNode, - _My_Decision_1); - } - - private static void assertRootNodeConnectedTo(Node rootNode, - Node to) { - @SuppressWarnings("unchecked") - List> outEdges = (List>) rootNode.getOutEdges(); - Optional> optEdge = outEdges.stream().filter(e -> e.getTargetNode().equals(to)).findFirst(); - assertTrue(optEdge.isPresent()); - - Edge edge = optEdge.get(); - assertTrue(edge.getContent() instanceof Child); - - assertTrue(to.getInEdges().contains(edge)); - } - - private static Edge assertNodeEdgesTo(Node from, - Node to, - Class clazz) { - @SuppressWarnings("unchecked") - List> outEdges = (List>) from.getOutEdges(); - Optional> optEdge = outEdges.stream().filter(e -> e.getTargetNode().equals(to)).findFirst(); - assertTrue(optEdge.isPresent()); - - Edge edge = optEdge.get(); - assertTrue(edge.getContent() instanceof View); - assertTrue(clazz.isInstance(((View) edge.getContent()).getDefinition())); - - assertTrue(to.getInEdges().contains(edge)); - - ViewConnector connectionContent = (ViewConnector) edge.getContent(); - assertTrue(connectionContent.getSourceConnection().isPresent()); - assertTrue(connectionContent.getTargetConnection().isPresent()); - return edge; - } - - private static void assertNodeContentDefinitionIs(Node node, - Class clazz) { - assertTrue(node.getContent() instanceof View); - assertTrue(clazz.isInstance(((View) node.getContent()).getDefinition())); - } - - @Test - public void test_Simple_structured_context() throws IOException { - final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/Simple_structured_context.dmn")); - DMNModel dmnModel = runtime.getModels().get(0); - - DMNContext dmnContext = runtime.newContext(); - dmnContext.set("Input Name", - "John Doe"); - DMNResult dmnResult = runtime.evaluateAll(dmnModel, - dmnContext); - assertFalse(dmnResult.getMessages().toString(), - dmnResult.hasErrors()); - DMNContext result = dmnResult.getContext(); - assertEquals("Hello, John Doe!", - result.get("Decision Logic 1")); - } - - private DMNRuntime roundTripUnmarshalMarshalThenUnmarshalDMN(InputStream dmnXmlInputStream) throws IOException { - String xml = null; - try (BufferedReader buffer = new BufferedReader(new InputStreamReader(dmnXmlInputStream))) { - xml = buffer.lines().collect(Collectors.joining("\n")); - } catch (Exception e) { - throw new RuntimeException("test utily method roundTripUnmarshalMarshalThenUnmarshalDMN failed to read XML content.", e); - } - LOG.debug("ORIGINAL xml:\n{}\n", xml); - final DMNRuntime runtime0 = dmnRuntimeFromDMNXML(xml); - assertEquals("The DMN XML file contains compilation error. If this was intentional use test method roundTripUnmarshalMarshalThenUnmarshalDMNexpectingErrors", - 0, - runtime0.getModels().get(0).getMessages(DMNMessage.Severity.ERROR).size()); - - DMNMarshaller m = getDMNMarshaller(); - - // first unmarshal from DMN XML to Stunner DMN Graph - @SuppressWarnings("unchecked") - Graph> g = m.unmarshall(createMetadata(), - new ReaderInputStream(new StringReader(xml))); - - // round trip to Stunner DMN Graph back to DMN XML - DiagramImpl diagram = createDiagram(); - diagram.setGraph(g); - - String mString = m.marshall(diagram); - LOG.debug("MARSHALLED ROUNDTRIP RESULTING xml:\n{}\n", mString); - - // now unmarshal once more, from the marshalled just done above, into a DMNRuntime - final DMNRuntime runtime = dmnRuntimeFromDMNXML(mString); - assertTrue(runtime.getModels().get(0).getMessages(DMNMessage.Severity.ERROR).size() == 0); - return runtime; - } - - private static DMNRuntime dmnRuntimeFromDMNXML(String mString) { - final KieServices ks = KieServices.Factory.get(); - String uuid = UUID.uuid(8); - final KieContainer kieContainer = KieHelper.getKieContainer(ks.newReleaseId("org.kie", - uuid, - "1.0"), - ks.getResources().newByteArrayResource(mString.getBytes()).setTargetPath("src/main/resources/" + uuid + ".dmn")); - final DMNRuntime runtime = kieContainer.newKieSession().getKieRuntime(DMNRuntime.class); - assertNotNull(runtime); - assertFalse(runtime.getModels().isEmpty()); - return runtime; - } - - private static class ErrorsAndDMNModelAsSerialized { - - final List messages; - final Definitions definitions; - - public ErrorsAndDMNModelAsSerialized(List messages, Definitions definitions) { - this.messages = Collections.unmodifiableList(messages); - this.definitions = definitions; - } - - public boolean hasErrors() { - return messages.stream().filter(m -> m.getLevel().equals(Level.ERROR)).count() > 0; - } - } - - private ErrorsAndDMNModelAsSerialized roundTripUnmarshalMarshalThenUnmarshalDMNexpectingErrors(InputStream dmnXmlInputStream) throws IOException { - String xml = null; - try (BufferedReader buffer = new BufferedReader(new InputStreamReader(dmnXmlInputStream))) { - xml = buffer.lines().collect(Collectors.joining("\n")); - } catch (Exception e) { - throw new RuntimeException("test utility method roundTripUnmarshalMarshalThenUnmarshalDMN failed to read XML content.", e); - } - LOG.debug("ORIGINAL xml:\n{}\n", xml); - final List messages0 = kieBuilderMessagesUsingDMNXML(xml); - assertTrue("The DMN XML content did NOT result in compilation errors and this test method expected errors to be detected. If this was intentional use test method roundTripUnmarshalMarshalThenUnmarshalDMN", - messages0.stream().filter(m -> m.getLevel().equals(Message.Level.ERROR)).count() > 0); - - DMNMarshaller m = getDMNMarshaller(); - - // first unmarshal from DMN XML to Stunner DMN Graph - @SuppressWarnings("unchecked") - Graph> g = m.unmarshall(createMetadata(), - new ReaderInputStream(new StringReader(xml))); - - // round trip to Stunner DMN Graph back to DMN XML - DiagramImpl diagram = createDiagram(); - diagram.setGraph(g); - - String mString = m.marshall(diagram); - LOG.debug("MARSHALLED ROUNDTRIP RESULTING xml:\n{}\n", mString); - - // now unmarshal once more, from the marshalled just done above, into a DMNRuntime - final List result = kieBuilderMessagesUsingDMNXML(mString); - assertTrue("The DMN XML content did NOT result in compilation errors and this test method expected errors to be detected. If this was intentional use test method roundTripUnmarshalMarshalThenUnmarshalDMN", - messages0.stream().filter(msg -> msg.getLevel().equals(Message.Level.ERROR)).count() > 0); - - Definitions definitions = DMNMarshallerFactory.newDefaultMarshaller().unmarshal(mString); - return new ErrorsAndDMNModelAsSerialized(result, definitions); - } - - private static List kieBuilderMessagesUsingDMNXML(String mString) { - final KieServices ks = KieServices.Factory.get(); - String uuid = UUID.uuid(8); - final KieContainer kieContainer = DMNRuntimeUtil.getKieContainerIgnoringErrors(ks.newReleaseId("org.kie", uuid, "1.0"), - ks.getResources().newByteArrayResource(mString.getBytes()).setTargetPath("src/main/resources/" + uuid + ".dmn")); - Results verify = kieContainer.verify(); - List kie_messages = verify.getMessages(); - LOG.debug("{}", kie_messages); - return kie_messages; - } - - @Test - public void test_relation_literal_expression() throws IOException { - final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/hardcoded_relation_and_literal_expression.dmn")); - DMNModel dmnModel = runtime.getModels().get(0); - - DMNContext dmnContext = runtime.newContext(); - DMNResult dmnResult = runtime.evaluateAll(dmnModel, - dmnContext); - assertFalse(dmnResult.getMessages().toString(), - dmnResult.hasErrors()); - - DMNContext result = dmnResult.getContext(); - Object hardCodedRelation = result.get("hardcoded relation"); - assertNotNull(hardCodedRelation); - assertEquals(3, ((Collection) hardCodedRelation).size()); - - DMNDecisionResult adultResult = dmnResult.getDecisionResultByName("Adults"); - assertEquals(DecisionEvaluationStatus.SUCCEEDED, adultResult.getEvaluationStatus()); - assertEquals(1, ((Collection) adultResult.getResult()).size()); - } - - @Test - public void test_invocation() throws IOException { - final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/hardcoded_invokation.dmn")); - DMNModel dmnModel = runtime.getModels().get(0); - - DMNContext dmnContext = runtime.newContext(); - DMNResult dmnResult = runtime.evaluateAll(dmnModel, - dmnContext); - assertFalse(dmnResult.getMessages().toString(), - dmnResult.hasErrors()); - - DMNDecisionResult adultResult = dmnResult.getDecisionResultByName("hardcoded invokation"); - assertEquals(DecisionEvaluationStatus.SUCCEEDED, adultResult.getEvaluationStatus()); - assertEquals(new BigDecimal(11), adultResult.getResult()); - } - - @Test - public void test_function_definition_and_invocation() throws IOException { - final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/hardcoded_function_definition.dmn")); - DMNModel dmnModel = runtime.getModels().get(0); - - DMNContext emptyContext = runtime.newContext(); - DMNResult dmnResult = runtime.evaluateAll(dmnModel, emptyContext); - assertFalse(dmnResult.getMessages().toString(), dmnResult.hasErrors()); - - DMNDecisionResult adultResult = dmnResult.getDecisionResultByName("hardcoded decision"); - assertEquals(DecisionEvaluationStatus.SUCCEEDED, adultResult.getEvaluationStatus()); - assertEquals(47, ((BigDecimal) adultResult.getResult()).intValue()); - } - - @Test - public void test_function_java_WB_model() throws IOException { - final DMNMarshaller m = getDMNMarshaller(); - - @SuppressWarnings("unchecked") - final Graph> g = m.unmarshall(createMetadata(), - this.getClass().getResourceAsStream("/DROOLS-2372.dmn")); - - final Stream> stream = StreamSupport.stream(Spliterators.spliteratorUnknownSize(g.nodes().iterator(), Spliterator.ORDERED), - false); - final Optional wbDecision = stream - .filter(n -> n.getContent() instanceof ViewImpl) - .map(n -> (ViewImpl) n.getContent()) - .filter(n -> n.getDefinition() instanceof Decision) - .map(n -> (Decision) n.getDefinition()) - .findFirst(); - - wbDecision.ifPresent(d -> { - assertTrue(d.getExpression() instanceof FunctionDefinition); - final FunctionDefinition wbFunction = (FunctionDefinition) d.getExpression(); - - //This is what the WB expects - assertEquals(FunctionDefinition.Kind.JAVA, wbFunction.getKind()); - }); - - final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/DROOLS-2372.dmn")); - final DMNModel dmnModel = runtime.getModels().get(0); - - final BusinessKnowledgeModelNode bkmNode = dmnModel.getBusinessKnowledgeModels().iterator().next(); - final org.kie.dmn.model.api.FunctionDefinition dmnFunction = bkmNode.getBusinessKnowledModel().getEncapsulatedLogic(); - assertEquals(FunctionKind.JAVA, dmnFunction.getKind()); - } - - @Test - public void test_function_definition_and_invoke_in_ctx() throws IOException { - final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/function_definition_and_invoke_in_ctx.dmn")); - DMNModel dmnModel = runtime.getModels().get(0); - - DMNContext emptyContext = runtime.newContext(); - DMNResult dmnResult = runtime.evaluateAll(dmnModel, emptyContext); - assertFalse(dmnResult.getMessages().toString(), dmnResult.hasErrors()); - - DMNDecisionResult adultResult = dmnResult.getDecisionResultByName("hardcoded decision"); - assertEquals(DecisionEvaluationStatus.SUCCEEDED, adultResult.getEvaluationStatus()); - assertEquals(3, ((BigDecimal) adultResult.getResult()).intValue()); - } - - @Test - public void test_hardcoded_decision_a_function() throws IOException { - final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/hardcoded_decision_a_function.dmn")); - DMNModel dmnModel = runtime.getModels().get(0); - - DMNContext emptyContext = runtime.newContext(); - DMNResult dmnResult = runtime.evaluateAll(dmnModel, emptyContext); - assertFalse(dmnResult.getMessages().toString(), dmnResult.hasErrors()); - - DMNDecisionResult adultResult = dmnResult.getDecisionResultByName("hardcoded invokation"); - assertEquals(DecisionEvaluationStatus.SUCCEEDED, adultResult.getEvaluationStatus()); - assertEquals(3, ((BigDecimal) adultResult.getResult()).intValue()); - } - - @Test - public void test_decision_table() throws IOException { - final DMNRuntime runtime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/positive_or_negative.dmn")); - DMNModel dmnModel = runtime.getModels().get(0); - - checkDecisionTableForPositiveOrNegative(runtime, dmnModel, 47, "positive"); - checkDecisionTableForPositiveOrNegative(runtime, dmnModel, -1, "negative"); - } - - private void checkDecisionTableForPositiveOrNegative(final DMNRuntime runtime, DMNModel dmnModel, int number, String result) { - DMNContext context = runtime.newContext(); - context.set("a number", number); - DMNResult dmnResult = runtime.evaluateAll(dmnModel, context); - assertFalse(dmnResult.getMessages().toString(), dmnResult.hasErrors()); - - DMNDecisionResult adultResult = dmnResult.getDecisionResultByName("positive or negative"); - assertEquals(DecisionEvaluationStatus.SUCCEEDED, adultResult.getEvaluationStatus()); - assertEquals(result, adultResult.getResult()); - } - - @Test - //https://issues.jboss.org/browse/DROOLS-4107 - public void test_decision_table_UnaryTestsParenthood() throws IOException { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/positive_or_negative.dmn"), - this::checkDecisionRuleInputUnaryTests); - } - - @SuppressWarnings("unchecked") - private void checkDecisionRuleInputUnaryTests(final Graph> g) { - final Node decisionNode = g.getNode("_f9f209df-1d64-4c27-90e9-3ad42cb47c07"); - assertNodeContentDefinitionIs(decisionNode, - Decision.class); - - final Node rootNode = DMNMarshaller.findDMNDiagramRoot((Graph) g); - assertNotNull(rootNode); - assertRootNodeConnectedTo(rootNode, - decisionNode); - assertEquals("decisionNode parent is Definitions DMN root", - "_f330b756-e84e-401d-ac3a-2e72e710d4ed", - ((DMNElement) ((Decision) ((View) decisionNode.getContent()).getDefinition()).getParent()).getId().getValue()); - - final org.kie.workbench.common.dmn.api.definition.model.DecisionTable dtable = (org.kie.workbench.common.dmn.api.definition.model.DecisionTable) ((Decision) ((View) decisionNode.getContent()).getDefinition()).getExpression(); - dtable.getRule().forEach(rule -> rule.getInputEntry().forEach(ie -> assertEquals(ie.getParent(), rule))); - dtable.getRule().forEach(rule -> rule.getOutputEntry().forEach(ie -> assertEquals(ie.getParent(), rule))); - dtable.getRule().forEach(rule -> assertEquals(rule.getParent(), dtable)); - } - - @Test - @SuppressWarnings("unchecked") - public void test_wrong_context() throws IOException { - // DROOLS-2217 - final ErrorsAndDMNModelAsSerialized result = roundTripUnmarshalMarshalThenUnmarshalDMNexpectingErrors(this.getClass().getResourceAsStream("/wrong_context.dmn")); - - // although the DMN file is schema valid but is not a valid-DMN (a context-entry value is a literal expression missing text, which is null) - // DROOLS-3152: once roundtripped through the Stunner marshaller it will receive an empty text. (empty expression, but a LiteralExpression with an empty text child xml element) - // this will still naturally throw some error because unable to FEEL-parse/compile an empty expression. - assertTrue(result.hasErrors()); - - // identify the error message for context-entry "ciao": - DMNMessage m0 = (DMNMessage) result.messages.get(0); - assertTrue("expected a message identifying the problem on a context entry for 'ciao'", - m0.getMessage().startsWith("Error compiling FEEL expression '' for name ")); // DROOLS-3152 please notice FEEL reporting indeed an empty expression. - - org.kie.dmn.model.api.Decision d0 = (org.kie.dmn.model.api.Decision) result.definitions.getDrgElement().stream().filter(d -> d.getId().equals("_653b3426-933a-4050-9568-ab2a66b43c36")).findFirst().get(); - // the identified DMN Decision is composed of a DMN Context where the first context-entry value is a literal expression missing text (text is null). - org.kie.dmn.model.api.Context d0c = (org.kie.dmn.model.api.Context) d0.getExpression(); - org.kie.dmn.model.api.Expression contextEntryValue = d0c.getContextEntry().get(0).getExpression(); - assertTrue(contextEntryValue instanceof org.kie.dmn.model.api.LiteralExpression); - assertEquals("", ((org.kie.dmn.model.api.LiteralExpression) contextEntryValue).getText()); // DROOLS-3152 - - // -- Stunner side. - DMNMarshaller m = getDMNMarshaller(); - Graph g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/wrong_context.dmn")); - - Node decisionNode = g.getNode("_653b3426-933a-4050-9568-ab2a66b43c36"); - assertNodeContentDefinitionIs(decisionNode, Decision.class); - View view = ((View) decisionNode.getContent()); - - // the identified DMN Decision is composed of a DMN Context where the first context-entry has missing Expression. - Context expression = (Context) view.getDefinition().getExpression(); - assertNotNull(expression.getContextEntry().get(0).getExpression()); // DROOLS-3116 empty Literal Expression is preserved - assertEquals(LiteralExpression.class, expression.getContextEntry().get(0).getExpression().getClass()); - LiteralExpression le = (LiteralExpression) expression.getContextEntry().get(0).getExpression(); - assertEquals("", le.getText().getValue()); // DROOLS-3152 - } - - @Test - @SuppressWarnings("unchecked") - public void test_wrong_decision() throws IOException { - // DROOLS-3116 empty Literal Expression to be preserved - final ErrorsAndDMNModelAsSerialized result = roundTripUnmarshalMarshalThenUnmarshalDMNexpectingErrors(this.getClass().getResourceAsStream("/wrong_decision.dmn")); - - // although the DMN file is schema valid but is not a valid-DMN (a context-entry value is a literal expression missing text, which is null) - // DROOLS-3152: once roundtripped through the Stunner marshaller it will receive an empty text. (empty expression, but a LiteralExpression with an empty text child xml element) - // this will still naturally throw some error because unable to FEEL-parse/compile an empty epression. - assertTrue(result.hasErrors()); - - // identify the error message for the Decision with a Literal Expression decision logic missing the actual expression text. - DMNMessage m0 = (DMNMessage) result.messages.get(0); - assertTrue("expected a message identifying the problem on the literalExpression of 'my decision'", - m0.getSourceId().equals("_36dd163c-4862-4308-92bf-40a998b24e39")); - - org.kie.dmn.model.api.Decision d0 = (org.kie.dmn.model.api.Decision) result.definitions.getDrgElement().stream().filter(d -> d.getId().equals("_cce32679-9395-444d-a4bf-96af8ee727a0")).findFirst().get(); - // the identified DMN Decision is composed a literal expression missing text (text is null). - org.kie.dmn.model.api.Expression d0le = d0.getExpression(); - assertTrue(d0le instanceof org.kie.dmn.model.api.LiteralExpression); - assertEquals("", ((org.kie.dmn.model.api.LiteralExpression) d0le).getText()); // DROOLS-3152 - - // -- Stunner side. - DMNMarshaller m = getDMNMarshaller(); - Graph g = m.unmarshall(createMetadata(), this.getClass().getResourceAsStream("/wrong_decision.dmn")); - - Node decisionNode = g.getNode("_cce32679-9395-444d-a4bf-96af8ee727a0"); - assertNodeContentDefinitionIs(decisionNode, Decision.class); - View view = ((View) decisionNode.getContent()); - - // the identified DMN Decision is composed a literal expression missing text (text is null). - Expression expression = view.getDefinition().getExpression(); - assertNotNull(expression); // DROOLS-3116 empty Literal Expression is preserved - assertEquals(LiteralExpression.class, expression.getClass()); - LiteralExpression le = (LiteralExpression) expression; - assertEquals("", le.getText().getValue()); // DROOLS-3152 - } - - @Test - public void testOtherElements() throws IOException, XPathExpressionException { - String original = new Scanner(this.getClass().getResourceAsStream("/dummy.dmn")).useDelimiter("\\A").next(); - DMNMarshaller marshaller = getDMNMarshaller(); - DiagramImpl diagram = createDiagram(); - diagram.setGraph(marshaller.unmarshall(createMetadata(), getClass().getResourceAsStream("/dummy.dmn"))); - String roundtripped = marshaller.marshall(diagram); - LOG.debug(roundtripped); - XPath xpathOriginal = namespaceAwareXPath( - new AbstractMap.SimpleEntry<>("semantic", "http://www.omg.org/spec/DMN/20151101/dmn.xsd"), - new AbstractMap.SimpleEntry<>("drools", "http://www.drools.org/kie/dmn/1.1")); - XPath xpathRountripped = namespaceAwareXPath( - new AbstractMap.SimpleEntry<>("semantic", "http://www.omg.org/spec/DMN/20180521/MODEL/"), - new AbstractMap.SimpleEntry<>("drools", "http://www.drools.org/kie/dmn/1.2") - ); - assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:extensionElements)", original, roundtripped); - - assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:import)", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:import/@namespace", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:import/@importType", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:import/@locationURI", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:import/@drools:name", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:import/@drools:modelName", original, roundtripped); - - //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:elementCollection)"), original, roundtripped); - //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:elementCollection/@name"), original, roundtripped); - //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:elementCollection/@id"), original, roundtripped); - //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:elementCollection/@label"), original, roundtripped); - //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:elementCollection/drgElement)"), original, roundtripped); - //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:elementCollection/semantic:drgElement/@href"), original, roundtripped); - - //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:performanceIndicator)"), original, roundtripped); - //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:performanceIndicator/@name"), original, roundtripped); - //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:performanceIndicator/@id"), original, roundtripped); - //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:performanceIndicator/@label"), original, roundtripped); - //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:performanceIndicator/@URI"), original, roundtripped); - //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:performanceIndicator/semantic:impactingDecision)"), original, roundtripped); - //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:performanceIndicator/semantic:impactingDecision/@href"), original, roundtripped); - - //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:organizationUnit)"), original, roundtripped); - //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:organizationUnit/@name"), original, roundtripped); - //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:organizationUnit/@id"), original, roundtripped); - //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:organizationUnit/semantic:decisionMade)"), original, roundtripped); - //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:organizationUnit/semantic:decisionMade/@href"), original, roundtripped); - //assertXPathEquals(xpath.compile("boolean(/semantic:definitions/semantic:organizationUnit/semantic:decisionOwned)"), original, roundtripped); - //assertXPathEquals(xpath.compile("/semantic:definitions/semantic:organizationUnit/semantic:decisionOwned/@href"), original, roundtripped); - - assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:knowledgeSource)", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:knowledgeSource/@name", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:knowledgeSource/@id", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:knowledgeSource/semantic:authorityRequirement)", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:knowledgeSource/semantic:requiredInput)", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:knowledgeSource/semantic:requiredInput/@href", original, roundtripped); - - assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:inputData)", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:inputData/@id", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:inputData/@name", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "boolean(/semantic:definitions/semantic:inputData/semantic:variable)", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:inputData/semantic:variable/@id", original, roundtripped); - assertXPathEquals(xpathOriginal, xpathRountripped, "/semantic:definitions/semantic:inputData/semantic:variable/@name", original, roundtripped); - - // DMN v1.2 - String inputDataVariableTypeRefOriginal = xpathOriginal.compile("/semantic:definitions/semantic:inputData/semantic:variable/@typeRef").evaluate(new InputSource(new StringReader(original))); - String inputDataVariableTypeRefRoundtripped = xpathRountripped.compile("/semantic:definitions/semantic:inputData/semantic:variable/@typeRef").evaluate(new InputSource(new StringReader(roundtripped))); - assertEquals("feel:number", inputDataVariableTypeRefOriginal); - assertEquals("number", inputDataVariableTypeRefRoundtripped); - } - - @Test - @SuppressWarnings("unchecked") - public void testContextEntryDataType() throws Exception { - final DMNMarshaller marshaller = getDMNMarshaller(); - - final Context context = new Context(); - context.setTypeRef(BuiltInType.DATE_TIME.asQName()); - - final ContextEntry contextEntry = new ContextEntry(); - final LiteralExpression literalExpression = new LiteralExpression(); - literalExpression.setTypeRef(BuiltInType.BOOLEAN.asQName()); - literalExpression.getText().setValue("feel"); - contextEntry.setExpression(literalExpression); - context.getContextEntry().add(contextEntry); - - final Diagram mockedDiagram = newDiagramDecisionWithExpression(context); - - final String marshalledSource = marshaller.marshall(mockedDiagram); - - final Graph> unmarshalledGraph = marshaller.unmarshall(createMetadata(), - new StringInputStream(marshalledSource)); - assertThat(unmarshalledGraph.nodes()).hasSize(2); - - checkDecisionExpression(unmarshalledGraph, context); - } - - @Test - public void testDefaultObjectsAreNotCreated() throws IOException { - final DMNRuntime dmnRuntime = roundTripUnmarshalMarshalThenUnmarshalDMN(this.getClass().getResourceAsStream("/DROOLS-2941.dmn")); - final List dmn_messages = dmnRuntime.getModels().get(0).getMessages(); - assertThat(dmn_messages).isEmpty(); - - assertThat(dmnRuntime.getModels()).hasSize(1); - final DMNModel dmnModel = dmnRuntime.getModels().get(0); - final DMNContext context = dmnRuntime.newContext(); - final DMNResult result = dmnRuntime.evaluateAll(dmnModel, context); - assertThat(result.getDecisionResultByName("A Vowel").getResult()).isEqualTo("a"); - } - - /** - * DROOLS-3184: If the "connection source/target location is null" assume it's the centre of the shape. - * [source/target location is null] If the connection was created from the Toolbox (i.e. add a InputData and then the Decision from it using the Decision toolbox icon). - *

- * This test re-create by hard-code the behavior of the Stunner framework "Toolbox" by instrumenting API calls to achieve the same behavior. - */ - @SuppressWarnings("unchecked") - @Test - public void testStunnerConstellationButtonCausingPoint2DbeingNull() throws IOException { - final BiConsumer hasComponentWidthsConsumer = (uuid, hcw) -> {/*NOP*/}; - - Diagram diagram = createDiagram(); - Graph g = diagram.getGraph(); - Node diagramRoot = DMNMarshaller.findDMNDiagramRoot(g); - testAugmentWithNSPrefixes(((DMNDiagram) ((View) diagramRoot.getContent()).getDefinition()).getDefinitions()); - - org.kie.dmn.model.api.InputData dmnInputData = new TInputData(); - dmnInputData.setId("inputDataID"); - dmnInputData.setName(dmnInputData.getId()); - Node inputDataNode = new InputDataConverter(api.getFactoryManager()).nodeFromDMN(dmnInputData, - hasComponentWidthsConsumer); - org.kie.dmn.model.api.Decision dmnDecision = new TDecision(); - dmnDecision.setId("decisionID"); - dmnDecision.setName(dmnDecision.getId()); - Node decisionNode = new DecisionConverter(api.getFactoryManager()).nodeFromDMN(dmnDecision, - hasComponentWidthsConsumer); - g.addNode(inputDataNode); - g.addNode(decisionNode); - View content = (View) decisionNode.getContent(); - content.setBounds(org.kie.workbench.common.stunner.core.graph.content.Bounds.create(200, 200, 300, 250)); - final String irID = "irID"; - Edge myEdge = api.getFactoryManager().newElement(irID, DMNMarshaller.INFO_REQ_ID).asEdge(); - myEdge.setSourceNode(inputDataNode); - myEdge.setTargetNode(decisionNode); - inputDataNode.getOutEdges().add(myEdge); - decisionNode.getInEdges().add(myEdge); - ViewConnector connectionContent = (ViewConnector) myEdge.getContent(); - // DROOLS-3184: If the "connection source/target location is null" assume it's the centre of the shape. - // keep Stunner behavior of constellation button - connectionContent.setSourceConnection(MagnetConnection.Builder.atCenter(inputDataNode).setLocation(null).setAuto(true)); - connectionContent.setTargetConnection(MagnetConnection.Builder.atCenter(decisionNode).setLocation(null).setAuto(true)); - - DMNMarshaller.connectRootWithChild(diagramRoot, inputDataNode); - DMNMarshaller.connectRootWithChild(diagramRoot, decisionNode); - - DMNMarshaller m = getDMNMarshaller(); - String output = m.marshall(diagram); - LOG.debug(output); - - Definitions dmnDefinitions = DMNMarshallerFactory.newDefaultMarshaller().unmarshal(output); - DMNEdge dmndiEdge = findEdgeByDMNI(dmnDefinitions.getDMNDI().getDMNDiagram().get(0), irID); - assertThat(dmndiEdge.getWaypoint()).hasSize(2); - Point wpSource = dmndiEdge.getWaypoint().get(0); - assertThat(wpSource.getX()).isEqualByComparingTo(50d); - assertThat(wpSource.getY()).isEqualByComparingTo(25d); - Point wpTarget = dmndiEdge.getWaypoint().get(1); - assertThat(wpTarget.getX()).isEqualByComparingTo(250d); - assertThat(wpTarget.getY()).isEqualByComparingTo(225d); - } - - /** - * DROOLS-2569 [DMN Designer] Marshalling of magnet positions -- Association DMN Edge DMNDI serialization. - * This test re-create by hard-code the graph to simulate the behavior of the Stunner framework programmatically. - */ - @SuppressWarnings("unchecked") - @Test - public void testAssociationEdgeDMNDI() throws IOException { - final BiConsumer hasComponentWidthsConsumer = (uuid, hcw) -> {/*NOP*/}; - - Diagram diagram = createDiagram(); - Graph g = diagram.getGraph(); - Node diagramRoot = DMNMarshaller.findDMNDiagramRoot(g); - testAugmentWithNSPrefixes(((DMNDiagram) ((View) diagramRoot.getContent()).getDefinition()).getDefinitions()); - - org.kie.dmn.model.api.InputData dmnInputData = new TInputData(); - dmnInputData.setId("inputDataID"); - dmnInputData.setName(dmnInputData.getId()); - Node inputDataNode = new InputDataConverter(api.getFactoryManager()).nodeFromDMN(dmnInputData, - hasComponentWidthsConsumer); - org.kie.dmn.model.api.TextAnnotation dmnTextAnnotation = new TTextAnnotation(); - dmnTextAnnotation.setId("textAnnotationID"); - Node textAnnotationNode = new TextAnnotationConverter(api.getFactoryManager()).nodeFromDMN(dmnTextAnnotation, - hasComponentWidthsConsumer); - g.addNode(inputDataNode); - g.addNode(textAnnotationNode); - View content = (View) textAnnotationNode.getContent(); - content.setBounds(org.kie.workbench.common.stunner.core.graph.content.Bounds.create(200, 200, 300, 250)); - final String edgeID = "edgeID"; - final String associationID = "associationID"; - Edge myEdge = api.getFactoryManager().newElement(edgeID, DMNMarshaller.ASSOCIATION_ID).asEdge(); - final View edgeView = (View) myEdge.getContent(); - ((Association) edgeView.getDefinition()).setId(new Id(associationID)); - myEdge.setSourceNode(inputDataNode); - myEdge.setTargetNode(textAnnotationNode); - inputDataNode.getOutEdges().add(myEdge); - textAnnotationNode.getInEdges().add(myEdge); - ViewConnector connectionContent = (ViewConnector) myEdge.getContent(); - connectionContent.setSourceConnection(MagnetConnection.Builder.atCenter(inputDataNode)); - connectionContent.setTargetConnection(MagnetConnection.Builder.atCenter(textAnnotationNode)); - - DMNMarshaller.connectRootWithChild(diagramRoot, inputDataNode); - DMNMarshaller.connectRootWithChild(diagramRoot, textAnnotationNode); - - DMNMarshaller m = getDMNMarshaller(); - String output = m.marshall(diagram); - LOG.debug(output); - - Definitions dmnDefinitions = DMNMarshallerFactory.newDefaultMarshaller().unmarshal(output); - assertThat(dmnDefinitions.getDMNDI().getDMNDiagram().get(0).getDMNDiagramElement().stream().filter(DMNEdge.class::isInstance).count()).isEqualTo(1); - DMNEdge dmndiEdge = findEdgeByDMNI(dmnDefinitions.getDMNDI().getDMNDiagram().get(0), associationID); - assertThat(dmndiEdge.getWaypoint()).hasSize(2); - } - - @Test - public void test_ExpressionComponentWidthPersistence() throws IOException { - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/DROOLS-2262.dmn"), - this::checkComponentWidths); - } - - @Test - public void testGetImportedDrgElementsByShape() { - - final DMNMarshaller marshaller = spy(getDMNMarshaller()); - final List importedDRGElements = mock(List.class); - final Map importDefinitions = mock(Map.class); - final org.kie.dmn.model.api.Definitions dmnXml = mock(org.kie.dmn.model.api.Definitions.class); - - final org.kie.dmn.model.api.DRGElement ref1 = mock(org.kie.dmn.model.api.DRGElement.class); - final org.kie.dmn.model.api.DRGElement ref2 = mock(org.kie.dmn.model.api.DRGElement.class); - final org.kie.dmn.model.api.DRGElement ref3 = mock(org.kie.dmn.model.api.DRGElement.class); - - final List dmnShapes = new ArrayList<>(); - final DMNShape shape1 = mock(DMNShape.class); - final DMNShape shape2 = mock(DMNShape.class); - final DMNShape shape3 = mock(DMNShape.class); - dmnShapes.add(shape1); - dmnShapes.add(shape2); - dmnShapes.add(shape3); - - doReturn("REF1").when(marshaller).getDmnElementRef(shape1); - doReturn("REF2").when(marshaller).getDmnElementRef(shape2); - doReturn("REF3").when(marshaller).getDmnElementRef(shape3); - - when(dmnMarshallerImportsHelper.getImportedDRGElements(importDefinitions)).thenReturn(importedDRGElements); - - doNothing().when(marshaller).updateIDsWithAlias(any(), any()); - doReturn(Optional.of(ref1)).when(marshaller).getReference(importedDRGElements, "REF1"); - doReturn(Optional.of(ref2)).when(marshaller).getReference(importedDRGElements, "REF2"); - doReturn(Optional.of(ref3)).when(marshaller).getReference(importedDRGElements, "REF3"); - - final List actual = marshaller.getImportedDrgElementsByShape(dmnShapes, importDefinitions, dmnXml); - - assertEquals(ref1, actual.get(0)); - assertEquals(ref2, actual.get(1)); - assertEquals(ref3, actual.get(2)); - } - - @Test - public void testGetDmnElementRef() { - - final DMNMarshaller marshaller = spy(getDMNMarshaller()); - final String expected = "localPart"; - final DMNShape shape = mock(DMNShape.class); - final javax.xml.namespace.QName ref = mock(javax.xml.namespace.QName.class); - when(ref.getLocalPart()).thenReturn(expected); - when(shape.getDmnElementRef()).thenReturn(ref); - - final String actual = marshaller.getDmnElementRef(shape); - - assertEquals(expected, actual); - } - - @Test - public void testGetUniqueDMNShapes() { - - final DMNMarshaller marshaller = spy(getDMNMarshaller()); - final org.kie.dmn.model.api.dmndi.DMNDiagram diagram = mock(org.kie.dmn.model.api.dmndi.DMNDiagram.class); - final List elements = new ArrayList<>(); - - final DMNShape unique1 = mock(DMNShape.class); - when(unique1.getId()).thenReturn("unique1"); - - final DMNShape unique2 = mock(DMNShape.class); - when(unique2.getId()).thenReturn("unique2"); - - final DMNShape duplicate1 = mock(DMNShape.class); - when(duplicate1.getId()).thenReturn("duplicate"); - - final DMNShape duplicate2 = mock(DMNShape.class); - when(duplicate2.getId()).thenReturn("duplicate"); - - elements.add(unique1); - elements.add(unique2); - elements.add(duplicate1); - elements.add(duplicate2); - - when(diagram.getDMNDiagramElement()).thenReturn(elements); - - final List actual = marshaller.getUniqueDMNShapes(diagram); - - assertEquals(3, actual.size()); - assertTrue(actual.contains(unique1)); - assertTrue(actual.contains(unique2)); - assertTrue(actual.contains(duplicate1) || actual.contains(duplicate2)); - } - - @Test - public void testSetAllowOnlyVisualChangeToTrue() { - testSetAllowOnlyVisualChange(true); - } - - @Test - public void testSetAllowOnlyVisualChangeToFalse() { - testSetAllowOnlyVisualChange(false); - } - - private void testSetAllowOnlyVisualChange(final boolean expected) { - - final DMNMarshaller marshaller = spy(getDMNMarshaller()); - final List importedDrgElements = mock(List.class); - final Node node = mock(Node.class); - final org.kie.workbench.common.dmn.api.definition.model.DRGElement element = mock(org.kie.workbench.common.dmn.api.definition.model.DRGElement.class); - doReturn(Optional.of(element)).when(marshaller).getDRGElement(node); - doReturn(expected).when(marshaller).isImportedDRGElement(importedDrgElements, element); - - marshaller.setAllowOnlyVisualChange(importedDrgElements, node); - - verify(element).setAllowOnlyVisualChange(expected); - } - - @Test - public void testIsImportedDRGElementWithDmnDRGElement() { - - final DMNMarshaller marshaller = spy(getDMNMarshaller()); - final List importedDrgElements = new ArrayList<>(); - - final org.kie.dmn.model.api.DRGElement imported = mock(org.kie.dmn.model.api.DRGElement.class); - when(imported.getId()).thenReturn("id"); - importedDrgElements.add(imported); - - final org.kie.dmn.model.api.DRGElement drgElement = mock(org.kie.dmn.model.api.DRGElement.class); - when(drgElement.getId()).thenReturn("id"); - - final boolean actual = marshaller.isImportedDRGElement(importedDrgElements, drgElement); - - assertTrue(actual); - } - - @Test - public void testIsImportedDRGElementWithWbDRGElement() { - - final DMNMarshaller marshaller = spy(getDMNMarshaller()); - final List importedDrgElements = new ArrayList<>(); - - final org.kie.dmn.model.api.DRGElement imported = mock(org.kie.dmn.model.api.DRGElement.class); - when(imported.getId()).thenReturn("id"); - importedDrgElements.add(imported); - - final org.kie.workbench.common.dmn.api.definition.model.DRGElement drgElement = mock(org.kie.workbench.common.dmn.api.definition.model.DRGElement.class); - final Id id = mock(Id.class); - when(id.getValue()).thenReturn("id"); - when(drgElement.getId()).thenReturn(id); - - final boolean actual = marshaller.isImportedDRGElement(importedDrgElements, drgElement); - - assertTrue(actual); - } - - @Test - public void testUpdateIDsWithAlias() { - - final DMNMarshaller marshaller = getDMNMarshaller(); - final HashMap indexByUri = new HashMap<>(); - final String namespace1 = "https://kiegroup.org/dmn/_red"; - final String namespace2 = "https://kiegroup.org/dmn/_blue"; - final String namespace3 = "https://kiegroup.org/dmn/_yellow"; - final String missingNamespace = "missing_namespace"; - - final String someWrongAlias = "some wrong alias"; - - final String include1 = "include1"; - final String include2 = "include2"; - final String include3 = "include3"; - - final String id1 = "id1"; - final String id2 = "id2"; - final String id3 = "id3"; - final String id4 = "id4"; - - indexByUri.put(namespace1, include1); - indexByUri.put(namespace2, include2); - indexByUri.put(namespace3, include3); - - final List importedDrgElements = new ArrayList<>(); - final DRGElement element1 = createDRGElementWithNamespaceAndId(namespace1, someWrongAlias + ":" + id1); - importedDrgElements.add(element1); - - final DRGElement element2 = createDRGElementWithNamespaceAndId(namespace2, someWrongAlias + ":" + id2); - importedDrgElements.add(element2); - - final DRGElement element3 = createDRGElementWithNamespaceAndId(namespace3, someWrongAlias + ":" + id3); - importedDrgElements.add(element3); - - final DRGElement element4 = createDRGElementWithNamespaceAndId(missingNamespace, id4); - importedDrgElements.add(element4); - - marshaller.updateIDsWithAlias(indexByUri, importedDrgElements); - - verify(element1).setId(include1 + ":" + id1); - verify(element2).setId(include2 + ":" + id2); - verify(element3).setId(include3 + ":" + id3); - - verify(element4, never()).setId(any()); - } - - private org.kie.dmn.model.api.DRGElement createDRGElementWithNamespaceAndId(final String namespace, - final String id) { - - final org.kie.dmn.model.api.DRGElement drgElement = mock(DRGElement.class); - final Map additionalAttributes = new HashMap<>(); - - additionalAttributes.put(new QName("Namespace"), namespace); - - when(drgElement.getAdditionalAttributes()).thenReturn(additionalAttributes); - when(drgElement.getId()).thenReturn(id); - - return drgElement; - } - - @Test - public void testChangeAliasForImportedElement() { - - final DMNMarshaller marshaller = getDMNMarshaller(); - final org.kie.dmn.model.api.DRGElement drgElement = mock(org.kie.dmn.model.api.DRGElement.class); - final String alias = "include1"; - final String id = "_01234567"; - - when(drgElement.getId()).thenReturn("some another alias:" + id); - - marshaller.changeAlias(alias, drgElement); - - verify(drgElement).setId(alias + ":" + id); - } - - @Test - public void testChangeAliasForLocalElement() { - - final DMNMarshaller marshaller = getDMNMarshaller(); - final org.kie.dmn.model.api.DRGElement drgElement = mock(org.kie.dmn.model.api.DRGElement.class); - final String alias = "include1"; - final String id = "_01234567"; - - when(drgElement.getId()).thenReturn(id); - - marshaller.changeAlias(alias, drgElement); - - verify(drgElement, never()).setId(any()); - } - - @Test - public void testLoadImportedItemDefinitions() { - - final org.kie.workbench.common.dmn.api.definition.model.Definitions definitions = mock(org.kie.workbench.common.dmn.api.definition.model.Definitions.class); - final org.kie.workbench.common.dmn.api.definition.model.ItemDefinition itemDefinition1 = mock(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition.class); - final org.kie.workbench.common.dmn.api.definition.model.ItemDefinition itemDefinition2 = mock(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition.class); - final List expectedItemDefinitions = asList(itemDefinition1, itemDefinition2); - final List actualItemDefinitions = new ArrayList<>(); - final Map importDefinitions = new HashMap<>(); - final DMNMarshaller dmnMarshaller = spy(getDMNMarshaller()); - - doReturn(expectedItemDefinitions).when(dmnMarshaller).getWbImportedItemDefinitions(importDefinitions); - when(definitions.getItemDefinition()).thenReturn(actualItemDefinitions); - - dmnMarshaller.loadImportedItemDefinitions(definitions, importDefinitions); - - assertEquals(expectedItemDefinitions, actualItemDefinitions); - } - - @Test - public void testCleanImportedItemDefinitions() { - - final org.kie.workbench.common.dmn.api.definition.model.Definitions definitions = mock(org.kie.workbench.common.dmn.api.definition.model.Definitions.class); - final org.kie.workbench.common.dmn.api.definition.model.ItemDefinition itemDefinition1 = mock(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition.class); - final org.kie.workbench.common.dmn.api.definition.model.ItemDefinition itemDefinition2 = mock(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition.class); - final org.kie.workbench.common.dmn.api.definition.model.ItemDefinition itemDefinition3 = mock(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition.class); - final List actualItemDefinitions = new ArrayList<>(asList(itemDefinition1, itemDefinition2, itemDefinition3)); - final List expectedItemDefinitions = asList(itemDefinition1, itemDefinition3); - final DMNMarshaller dmnMarshaller = getDMNMarshaller(); - - when(itemDefinition1.isAllowOnlyVisualChange()).thenReturn(false); - when(itemDefinition2.isAllowOnlyVisualChange()).thenReturn(true); - when(itemDefinition3.isAllowOnlyVisualChange()).thenReturn(false); - when(definitions.getItemDefinition()).thenReturn(actualItemDefinitions); - - dmnMarshaller.cleanImportedItemDefinitions(definitions); - - assertEquals(expectedItemDefinitions, actualItemDefinitions); - } - - @Test - public void testGetWbImportedItemDefinitions() { - - final org.kie.dmn.model.api.ItemDefinition itemDefinition1 = makeItemDefinition("model1.tUUID"); - final org.kie.dmn.model.api.ItemDefinition itemDefinition2 = makeItemDefinition("model1.tPerson"); - final org.kie.dmn.model.api.ItemDefinition itemDefinition3 = makeItemDefinition("model2.tNum"); - final Map importDefinitions = new HashMap<>(); - - when(dmnMarshallerImportsHelper.getImportedItemDefinitions(importDefinitions)).thenReturn(asList(itemDefinition1, itemDefinition2, itemDefinition3)); - - final List actualItemDefinitions = getDMNMarshaller().getWbImportedItemDefinitions(importDefinitions); - - assertEquals(3, actualItemDefinitions.size()); - assertEquals("model1.tUUID", actualItemDefinitions.get(0).getName().getValue()); - assertEquals("model1.tPerson", actualItemDefinitions.get(1).getName().getValue()); - assertEquals("model2.tNum", actualItemDefinitions.get(2).getName().getValue()); - } - - private org.kie.dmn.model.api.ItemDefinition makeItemDefinition(final String name) { - final org.kie.dmn.model.api.ItemDefinition itemDefinition = new TItemDefinition(); - itemDefinition.setName(name); - return itemDefinition; - } - - @Test - public void testConnectorRightToLeft() throws Exception { - final org.kie.workbench.common.stunner.core.graph.content.Bounds bounds = org.kie.workbench.common.stunner.core.graph.content.Bounds.create(0, 0, 100, 50); - final String decisionNode1UUID = org.kie.workbench.common.stunner.core.util.UUID.uuid(); - final String decisionNode2UUID = org.kie.workbench.common.stunner.core.util.UUID.uuid(); - final String edgeUUID = org.kie.workbench.common.stunner.core.util.UUID.uuid(); - - final ViewConnector edgeView = marshallAndUnMarshallConnectors(bounds, - decisionNode1UUID, - decisionNode2UUID, - edgeUUID, - (sc) -> { - when(sc.getMagnetIndex()).thenReturn(OptionalInt.of(MagnetConnection.MAGNET_RIGHT)); - when(sc.getLocation()).thenReturn(new Point2D(bounds.getWidth(), bounds.getHeight() / 2)); - }, - (tc) -> { - when(tc.getMagnetIndex()).thenReturn(OptionalInt.of(MagnetConnection.MAGNET_LEFT)); - when(tc.getLocation()).thenReturn(new Point2D(0, bounds.getHeight() / 2)); - }); - - final MagnetConnection sourceConnection = (MagnetConnection) edgeView.getSourceConnection().get(); - assertEquals(bounds.getWidth(), sourceConnection.getLocation().getX(), 0.0); - assertEquals(bounds.getHeight() / 2, sourceConnection.getLocation().getY(), 0.0); - assertFalse(sourceConnection.getMagnetIndex().isPresent()); - assertTrue(sourceConnection.isAuto()); - - final MagnetConnection targetConnection = (MagnetConnection) edgeView.getTargetConnection().get(); - assertEquals(0, targetConnection.getLocation().getX(), 0.0); - assertEquals(bounds.getHeight() / 2, targetConnection.getLocation().getY(), 0.0); - assertFalse(targetConnection.getMagnetIndex().isPresent()); - assertTrue(targetConnection.isAuto()); - } - - @Test - public void testConnectorCentreToCentre() throws Exception { - final org.kie.workbench.common.stunner.core.graph.content.Bounds bounds = org.kie.workbench.common.stunner.core.graph.content.Bounds.create(0, 0, 100, 50); - final String decisionNode1UUID = org.kie.workbench.common.stunner.core.util.UUID.uuid(); - final String decisionNode2UUID = org.kie.workbench.common.stunner.core.util.UUID.uuid(); - final String edgeUUID = org.kie.workbench.common.stunner.core.util.UUID.uuid(); - - final ViewConnector edgeView = marshallAndUnMarshallConnectors(bounds, - decisionNode1UUID, - decisionNode2UUID, - edgeUUID, - (sc) -> {/*NOP*/}, - (tc) -> {/*NOP*/}); - - final MagnetConnection sourceConnection = (MagnetConnection) edgeView.getSourceConnection().get(); - assertEquals(bounds.getWidth() / 2, sourceConnection.getLocation().getX(), 0.0); - assertEquals(bounds.getHeight() / 2, sourceConnection.getLocation().getY(), 0.0); - assertTrue(sourceConnection.getMagnetIndex().isPresent()); - assertEquals(MagnetConnection.MAGNET_CENTER, sourceConnection.getMagnetIndex().getAsInt()); - assertFalse(sourceConnection.isAuto()); - - final MagnetConnection targetConnection = (MagnetConnection) edgeView.getTargetConnection().get(); - assertEquals(bounds.getWidth() / 2, targetConnection.getLocation().getX(), 0.0); - assertEquals(bounds.getHeight() / 2, targetConnection.getLocation().getY(), 0.0); - assertTrue(targetConnection.getMagnetIndex().isPresent()); - assertEquals(MagnetConnection.MAGNET_CENTER, targetConnection.getMagnetIndex().getAsInt()); - assertFalse(targetConnection.isAuto()); - } - - @Test - public void testRemoveDrgElementsWithoutShape() { - final String id1 = "id1"; - final String id2 = "id2"; - final String id3 = "id3"; - final DRGElement e1 = createDRGElement(id1); - final DRGElement e2 = createDRGElement(id2); - final DRGElement e3 = createDRGElement(id3); - final List drgElements = new ArrayList<>(Arrays.asList(e1, e2, e3)); - final DMNShape s1 = createDMNShape(id1); - final DMNShape s3 = createDMNShape(id3); - final List dmnShapes = new ArrayList<>(Arrays.asList(s1, s3)); - - getDMNMarshaller().removeDrgElementsWithoutShape(drgElements, dmnShapes); - - assertEquals(2, drgElements.size()); - assertEquals(e1, drgElements.get(0)); - assertEquals(e3, drgElements.get(1)); - } - - @Test - public void testRemoveDrgElementsWithoutShapeWhenAllElementsHaveShape() { - final String id1 = "id1"; - final String id2 = "id2"; - final String id3 = "id3"; - final DRGElement e1 = createDRGElement(id1); - final DRGElement e2 = createDRGElement(id2); - final DRGElement e3 = createDRGElement(id3); - final List drgElements = new ArrayList<>(Arrays.asList(e1, e2, e3)); - final DMNShape s1 = createDMNShape(id1); - final DMNShape s2 = createDMNShape(id2); - final DMNShape s3 = createDMNShape(id3); - final List dmnShapes = new ArrayList<>(Arrays.asList(s1, s2, s3)); - - getDMNMarshaller().removeDrgElementsWithoutShape(drgElements, dmnShapes); - - assertEquals(3, drgElements.size()); - assertEquals(e1, drgElements.get(0)); - assertEquals(e2, drgElements.get(1)); - assertEquals(e3, drgElements.get(2)); - } - - @Test - public void testRemoveDrgElementsWithoutShapeFromDMN11() { - final String id1 = "id1"; - final String id2 = "id2"; - final String id3 = "id3"; - final DRGElement e1 = createDRGElement(id1); - final DRGElement e2 = createDRGElement(id2); - final DRGElement e3 = createDRGElement(id3); - final List drgElements = new ArrayList<>(Arrays.asList(e1, e2, e3)); - final List dmnShapes = new ArrayList<>(); - - getDMNMarshaller().removeDrgElementsWithoutShape(drgElements, dmnShapes); - - assertEquals(3, drgElements.size()); - assertEquals(e1, drgElements.get(0)); - assertEquals(e2, drgElements.get(1)); - assertEquals(e3, drgElements.get(2)); - } - - private DMNShape createDMNShape(final String refId) { - final DMNShape shape = mock(DMNShape.class); - final QName ref = mock(QName.class); - when(shape.getDmnElementRef()).thenReturn(ref); - when(ref.getLocalPart()).thenReturn(refId); - return shape; - } - - private DRGElement createDRGElement(final String id) { - final DRGElement element = mock(DRGElement.class); - when(element.getId()).thenReturn(id); - return element; - } - - @Test - @SuppressWarnings("unchecked") - public void testImportConversion() throws IOException { - //Assume every import in the DMN file can be resolved to the actual file. - when(dmnMarshallerImportsHelper.getPMMLDocuments(any(Metadata.class), anyList())).thenAnswer(i -> { - final Map pmmlDocuments = new HashMap<>(); - final List imports = (List) i.getArguments()[1]; - imports.forEach(imp -> pmmlDocuments.put(imp, mock(PMMLDocumentMetadata.class))); - return pmmlDocuments; - }); - - roundTripUnmarshalThenMarshalUnmarshal(this.getClass().getResourceAsStream("/imports.dmn"), - this::checkImports); - } - - @SuppressWarnings("unchecked") - private void checkImports(final Graph> graph) { - assertNotNull(graph); - - final DMNDiagramUtils utils = new DMNDiagramUtils(); - final Diagram mockDiagram = mock(Diagram.class); - when(mockDiagram.getGraph()).thenReturn(graph); - - final org.kie.workbench.common.dmn.api.definition.model.Definitions definitions = utils.getDefinitions(mockDiagram); - final List imports = definitions.getImport(); - assertTrue(imports.get(0) instanceof ImportDMN); - assertTrue(imports.get(1) instanceof ImportPMML); - - final ImportDMN dmnImport = (ImportDMN) imports.get(0); - assertEquals("dmn-import", dmnImport.getName().getValue()); - assertEquals("https://kiegroup.org/dmn/_46EB0D0D-7241-4629-A38E-0377AA5B32D1", dmnImport.getNamespace()); - assertEquals(DMNImportTypes.DMN.getDefaultNamespace(), dmnImport.getImportType()); - - final ImportPMML pmmlImport = (ImportPMML) imports.get(1); - assertEquals("pmml-import", pmmlImport.getName().getValue()); - assertEquals("pmml-import", pmmlImport.getNamespace()); - assertEquals(DMNImportTypes.PMML.getDefaultNamespace(), pmmlImport.getImportType()); - } - - @SuppressWarnings("unchecked") - private ViewConnector marshallAndUnMarshallConnectors(final org.kie.workbench.common.stunner.core.graph.content.Bounds bounds, - final String decisionNode1UUID, - final String decisionNode2UUID, - final String edgeUUID, - final Consumer sourceMagnetConsumer, - final Consumer targetMagnetConsumer) throws Exception { - final DMNMarshaller marshaller = getDMNMarshaller(); - - final Diagram mockedDiagram = connectTwoNodes(bounds, - decisionNode1UUID, - decisionNode2UUID, - edgeUUID, - sourceMagnetConsumer, - targetMagnetConsumer); - - final String marshalledSource = marshaller.marshall(mockedDiagram); - - final Graph> unmarshalledGraph = marshaller.unmarshall(createMetadata(), new StringInputStream(marshalledSource)); - - assertNotNull(unmarshalledGraph); - - final Node decision1Node = unmarshalledGraph.getNode(decisionNode1UUID); - final Node decision2Node = unmarshalledGraph.getNode(decisionNode2UUID); - assertNotNull(decision1Node); - assertNotNull(decision2Node); - assertEquals(1, decision1Node.getOutEdges().size()); - assertEquals(2, decision2Node.getInEdges().size()); - - final Edge decision1NodeOutEdge = decision1Node.getOutEdges().get(0); - final Edge decision2NodeInEdge = decision2Node.getInEdges().get(0); - assertEquals(decision1NodeOutEdge, decision2NodeInEdge); - - final ViewConnector edgeView = (ViewConnector) decision1NodeOutEdge.getContent(); - assertTrue(edgeView.getSourceConnection().isPresent()); - assertTrue(edgeView.getTargetConnection().isPresent()); - - return edgeView; - } - - @SuppressWarnings("unchecked") - private Diagram connectTwoNodes(final org.kie.workbench.common.stunner.core.graph.content.Bounds bounds, - final String decisionNode1UUID, - final String decisionNode2UUID, - final String edgeUUID, - final Consumer sourceMagnetConsumer, - final Consumer targetMagnetConsumer) { - final DiagramImpl diagram = createDiagram(); - final Graph graph = mock(Graph.class); - - final Node diagramNode = mock(Node.class); - final View diagramView = mock(View.class); - final DMNDiagram dmnDiagram = new DMNDiagram(); - when(diagramNode.getContent()).thenReturn(diagramView); - when(diagramView.getDefinition()).thenReturn(dmnDiagram); - - final Node decisionNode1 = mock(Node.class); - final View decisionView1 = mock(View.class); - final Decision decision1 = new Decision(); - decision1.getId().setValue(decisionNode1UUID); - when(decisionNode1.getContent()).thenReturn(decisionView1); - when(decisionView1.getDefinition()).thenReturn(decision1); - when(decisionView1.getBounds()).thenReturn(bounds); - - final Node decisionNode2 = mock(Node.class); - final View decisionView2 = mock(View.class); - final Decision decision2 = new Decision(); - decision2.getId().setValue(decisionNode2UUID); - when(decisionNode2.getContent()).thenReturn(decisionView2); - when(decisionView2.getDefinition()).thenReturn(decision2); - when(decisionView2.getBounds()).thenReturn(bounds); - - final Edge edge = mock(Edge.class); - final ViewConnector edgeView = mock(ViewConnector.class); - when(edge.getUUID()).thenReturn(edgeUUID); - when(edge.getContent()).thenReturn(edgeView); - final MagnetConnection edgeSourceConnection = mock(MagnetConnection.class); - final MagnetConnection edgeTargetConnection = mock(MagnetConnection.class); - when(edgeView.getSourceConnection()).thenReturn(Optional.of(edgeSourceConnection)); - when(edgeView.getTargetConnection()).thenReturn(Optional.of(edgeTargetConnection)); - when(edgeView.getControlPoints()).thenReturn(new ControlPoint[]{}); - when(decisionNode1.getOutEdges()).thenReturn(Collections.singletonList(edge)); - when(decisionNode2.getInEdges()).thenReturn(Collections.singletonList(edge)); - when(edge.getSourceNode()).thenReturn(decisionNode1); - when(edge.getTargetNode()).thenReturn(decisionNode2); - - sourceMagnetConsumer.accept(edgeSourceConnection); - targetMagnetConsumer.accept(edgeTargetConnection); - - doReturn(asList(diagramNode, decisionNode1, decisionNode2)).when(graph).nodes(); - diagram.setGraph(graph); - - return diagram; - } - - @SuppressWarnings("unchecked") - private void checkComponentWidths(Graph> graph) { - final Node node = graph.getNode("_37883BDC-DB54-4925-B539-A0F19B1DDE41"); - assertThat(node).isNotNull(); - assertNodeContentDefinitionIs(node, Decision.class); - - final Decision definition = ((View) node.getContent()).getDefinition(); - assertThat(definition.getExpression()).isNotNull(); - - final HasComponentWidths expression = definition.getExpression(); - final List componentWidths = expression.getComponentWidths(); - assertThat(componentWidths.size()).isEqualTo(expression.getRequiredComponentWidthCount()); - assertThat(componentWidths.get(0)).isEqualTo(50.0); - assertThat(componentWidths.get(1)).isEqualTo(150.0); - assertThat(componentWidths.get(2)).isEqualTo(200.0); - assertThat(componentWidths.get(3)).isEqualTo(250.0); - } - - private static void testAugmentWithNSPrefixes(org.kie.workbench.common.dmn.api.definition.model.Definitions definitions) { - for (Namespace nsp : DMNModelInstrumentedBase.Namespace.values()) { - definitions.getNsContext().put(nsp.getPrefix(), nsp.getUri()); - } - } - - @SuppressWarnings("unchecked") - private Diagram newDiagramDecisionWithExpression(final Expression expression) { - final Diagram diagram = createDiagram(); - final Graph graph = mock(Graph.class); - - final Node diagramNode = mock(Node.class); - final View diagramView = mock(View.class); - final DMNDiagram dmnDiagram = new DMNDiagram(); - doReturn(diagramView).when(diagramNode).getContent(); - doReturn(dmnDiagram).when(diagramView).getDefinition(); - - final Node decisionNode = mock(Node.class); - final View decisionView = mock(View.class); - final Decision decision = new Decision(); - doReturn(decisionView).when(decisionNode).getContent(); - doReturn(decision).when(decisionView).getDefinition(); - decision.setExpression(expression); - - doReturn(asList(diagramNode, decisionNode)).when(graph).nodes(); - ((DiagramImpl) diagram).setGraph(graph); - - return diagram; - } - - private static void checkDecisionExpression(final Graph> unmarshalledGraph, - final Expression expression) { - final Node decisionNode = nodeOfDefinition(unmarshalledGraph.nodes().iterator(), Decision.class); - final Expression decisionNodeExpression = ((Decision) decisionNode.getContent().getDefinition()).getExpression(); - - // The process of marshalling an Expression that has been programmatically instantiated (vs created in the UI) - // leads to the _source_ Expression ComponentWidths being initialised. Therefore to ensure a like-for-like equality - // comparison ensure the unmarshalled _target_ Expression has had it's ComponentWidths initialised too. - decisionNodeExpression.getComponentWidths(); - ((Context) decisionNodeExpression).getContextEntry().get(0).getExpression().getComponentWidths(); - assertThat(decisionNodeExpression).isEqualTo(expression); - } - - private static Node nodeOfDefinition(final Iterator> nodesIterator, final Class aClass) { - return StreamSupport.stream(Spliterators.spliteratorUnknownSize(nodesIterator, Spliterator.NONNULL), false) - .filter(node -> aClass.isInstance(node.getContent().getDefinition())) - .findFirst().get(); - } - - @SafeVarargs - private final XPath namespaceAwareXPath(Map.Entry... pfxAndURI) { - XPath result = XPathFactory.newInstance().newXPath(); - result.setNamespaceContext(new NamespaceContext() { - final Map pfxToURI = new HashMap() {{ - for (Map.Entry pair : pfxAndURI) { - put(pair.getKey(), pair.getValue()); - } - }}; - final Map URItoPfx = new HashMap() {{ - for (Map.Entry pair : pfxAndURI) { - put(pair.getValue(), pair.getKey()); - } - }}; - - @Override - public String getNamespaceURI(String prefix) { - return pfxToURI.get(prefix); - } - - @Override - public String getPrefix(String namespaceURI) { - return URItoPfx.get(namespaceURI); - } - - @Override - public Iterator getPrefixes(String namespaceURI) { - return pfxToURI.keySet().iterator(); - } - }); - return result; - } - - private DMNMarshaller getDMNMarshaller() { - return new DMNMarshaller(new XMLEncoderDiagramMetadataMarshaller(), - api.getFactoryManager(), - dmnMarshallerImportsHelper, - getMarshaller()); - } - - private org.kie.dmn.api.marshalling.DMNMarshaller getMarshaller() { - return new DMNMarshallerProducer().get(); - } - - private void assertXPathEquals(XPath xpathOriginal, XPath xpathRoundtrip, String xpathExpression, String expectedXml, String actualXml) throws XPathExpressionException { - InputSource expected = new InputSource(new StringReader(expectedXml)); - InputSource actual = new InputSource(new StringReader(actualXml)); - assertEquals(xpathOriginal.compile(xpathExpression).evaluate(expected), xpathRoundtrip.compile(xpathExpression).evaluate(actual)); - } - - private DiagramImpl createDiagram() { - return api.getFactoryManager().newDiagram("dmnDiagram", - DMN_DEF_SET_ID, - createMetadata()); - } - - private static Metadata createMetadata() { - return mock(Metadata.class); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNImportTypesHelperImplTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNImportTypesHelperImplTest.java index dfa7daa70a8..f6a9ce1ec2d 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNImportTypesHelperImplTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNImportTypesHelperImplTest.java @@ -19,6 +19,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.kie.workbench.common.dmn.api.marshalling.DMNImportTypesHelper; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.uberfire.backend.vfs.Path; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImplImportsHelperTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImplImportsHelperTest.java new file mode 100644 index 00000000000..951d5e9fa8f --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImplImportsHelperTest.java @@ -0,0 +1,572 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.backend.common; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Scanner; + +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; + +import org.guvnor.common.services.project.model.WorkspaceProject; +import org.guvnor.common.services.project.service.WorkspaceProjectService; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.dmn.api.marshalling.DMNMarshaller; +import org.kie.dmn.model.api.DRGElement; +import org.kie.dmn.model.api.Definitions; +import org.kie.dmn.model.api.Import; +import org.kie.dmn.model.api.InformationItem; +import org.kie.dmn.model.api.ItemDefinition; +import org.kie.dmn.model.v1_2.TDecision; +import org.kie.dmn.model.v1_2.TDecisionService; +import org.kie.dmn.model.v1_2.TInformationItem; +import org.kie.dmn.model.v1_2.TInputData; +import org.kie.dmn.model.v1_2.TItemDefinition; +import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; +import org.kie.workbench.common.dmn.backend.editors.common.PMMLIncludedDocumentFactory; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.uberfire.backend.vfs.Path; +import org.uberfire.io.IOService; +import org.uberfire.java.nio.IOException; + +import static java.util.Arrays.asList; +import static java.util.Collections.singletonList; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.uberfire.backend.vfs.PathFactory.PathImpl; + +@RunWith(MockitoJUnitRunner.class) +public class DMNMarshallerImplImportsHelperTest { + + @Mock + private DMNPathsHelperImpl pathsHelper; + + @Mock + private WorkspaceProjectService projectService; + + @Mock + private IOService ioService; + + @Mock + private DMNMarshaller marshaller; + + @Mock + private DMNIOHelper dmnIOHelper; + + @Mock + private PMMLIncludedDocumentFactory pmmlDocumentFactory; + + private DMNMarshallerImportsHelperStandaloneImpl helper; + + @Before + public void setup() { + helper = spy(new DMNMarshallerImportsHelperStandaloneImpl(pathsHelper, + projectService, + marshaller, + dmnIOHelper, + pmmlDocumentFactory, + ioService)); + } + + @Test + public void testGetImportDefinitions() { + + final Metadata metadata = mock(Metadata.class); + final Import import1 = mock(Import.class); + final Import import2 = mock(Import.class); + final Import import3 = mock(Import.class); + final List imports = asList(import1, import2, import3); + final Definitions definitions1 = mock(Definitions.class); + final Definitions definitions2 = mock(Definitions.class); + final Definitions definitions3 = mock(Definitions.class); + final List definitions = asList(definitions1, definitions2, definitions3); + + when(definitions1.getNamespace()).thenReturn("://namespace1"); + when(definitions2.getNamespace()).thenReturn("://namespace2"); + when(definitions3.getNamespace()).thenReturn("://namespace3"); + when(import1.getNamespace()).thenReturn("://namespace1"); + when(import2.getNamespace()).thenReturn("://namespace2-diff"); + when(import3.getNamespace()).thenReturn("://namespace3"); + doReturn(definitions).when(helper).getOtherDMNDiagramsDefinitions(metadata); + + final Map importDefinitions = helper.getImportDefinitions(metadata, imports); + + assertEquals(2, importDefinitions.size()); + assertEquals(definitions1, importDefinitions.get(import1)); + assertEquals(definitions3, importDefinitions.get(import3)); + } + + @Test + public void testGetPMMLDocuments() { + final Path dmnModelPath = mock(Path.class); + final Metadata metadata = mock(Metadata.class); + final PMMLDocumentMetadata pmmlDocument = mock(PMMLDocumentMetadata.class); + final Import import1 = mock(Import.class); + final List imports = singletonList(import1); + final Path path1 = mock(Path.class); + final Path path2 = mock(Path.class); + final List paths = asList(path1, path2); + + when(metadata.getPath()).thenReturn(dmnModelPath); + when(import1.getLocationURI()).thenReturn("document1.pmml"); + when(pathsHelper.getRelativeURI(dmnModelPath, path1)).thenReturn("document1.pmml"); + when(pathsHelper.getRelativeURI(dmnModelPath, path2)).thenReturn("document2.pmml"); + when(pmmlDocumentFactory.getDocumentByPath(path1)).thenReturn(pmmlDocument); + + doReturn(paths).when(helper).getPMMLDocumentPaths(metadata); + + final Map importDefinitions = helper.getPMMLDocuments(metadata, imports); + + assertEquals(1, importDefinitions.size()); + + assertEquals(pmmlDocument, importDefinitions.get(import1)); + } + + @Test + public void testGetPMMLDocumentPaths() { + final Metadata metadata = mock(Metadata.class); + final WorkspaceProject project = mock(WorkspaceProject.class); + final Path projectPath = mock(Path.class); + + when(metadata.getPath()).thenReturn(projectPath); + when(projectService.resolveProject(any(Path.class))).thenReturn(project); + + helper.getPMMLDocumentPaths(metadata); + + verify(projectService).resolveProject(projectPath); + } + + @Test + public void testGetImportXML() throws java.io.IOException { + final String xml1 = ""; + final String xml2 = ""; + + final Metadata metadata = mock(Metadata.class); + final Import import1 = mock(Import.class); + + final Path path1 = makePath("../file1.dmn"); + final Path path2 = makePath("../file2.dmn"); + + //Mock loading of XML files in Project + final InputStream inputStream1 = mock(InputStream.class); + final InputStream inputStream2 = mock(InputStream.class); + final InputStreamReader inputStreamReader1 = mock(InputStreamReader.class); + final InputStreamReader inputStreamReader2 = mock(InputStreamReader.class); + final List paths = asList(path1, path2); + + when(pathsHelper.getDMNModelsPaths(any())).thenReturn(paths); + when(dmnIOHelper.isAsString(inputStream1)).thenReturn(xml1); + when(dmnIOHelper.isAsString(inputStream2)).thenReturn(xml2); + + doReturn(Optional.of(inputStream1)).when(helper).loadPath(path1); + doReturn(Optional.of(inputStream2)).when(helper).loadPath(path2); + doReturn(inputStreamReader1).when(helper).toInputStreamReader(inputStream1); + doReturn(inputStreamReader2).when(helper).toInputStreamReader(inputStream2); + + //Mock retrieval of Definitions from XML files in Project + final StringReader stringReader1 = mock(StringReader.class); + final StringReader stringReader2 = mock(StringReader.class); + final Definitions definitions1 = mock(Definitions.class); + final Definitions definitions2 = mock(Definitions.class); + + doReturn(stringReader1).when(helper).toStringReader(xml1); + doReturn(stringReader2).when(helper).toStringReader(xml2); + when(marshaller.unmarshal(stringReader1)).thenReturn(definitions1); + when(marshaller.unmarshal(stringReader2)).thenReturn(definitions2); + when(import1.getNamespace()).thenReturn("://namespace1"); + when(definitions1.getNamespace()).thenReturn("://namespace1"); + when(definitions2.getNamespace()).thenReturn("://namespace2-not-imported"); + + final List imports = Collections.singletonList(import1); + + final Map importXML = helper.getImportXML(metadata, imports); + + assertEquals(1, importXML.size()); + assertEquals(xml1, importXML.get(import1)); + } + + @Test + public void testGetImportedDRGElements() { + + final Map importDefinitions = new HashMap<>(); + final Import anImport = mock(Import.class); + final Definitions definitions = mock(Definitions.class); + final DRGElement drgElement1 = mock(DRGElement.class); + final DRGElement drgElement2 = mock(DRGElement.class); + final DRGElement drgElement3 = mock(DRGElement.class); + final List expectedDRGElements = asList(drgElement1, drgElement2, drgElement3); + + doReturn(expectedDRGElements).when(helper).getDrgElementsWithNamespace(definitions, anImport); + + importDefinitions.put(anImport, definitions); + + final List actualDRGElements = helper.getImportedDRGElements(importDefinitions); + + assertEquals(expectedDRGElements, actualDRGElements); + } + + @Test + public void testGetImportedItemDefinitions() { + + final Map importDefinitions = new HashMap<>(); + final Import anImport = mock(Import.class); + final Definitions definitions = mock(Definitions.class); + final ItemDefinition itemDefinition1 = mock(ItemDefinition.class); + final ItemDefinition itemDefinition2 = mock(ItemDefinition.class); + final ItemDefinition itemDefinition3 = mock(ItemDefinition.class); + final List expectedItemDefinitions = asList(itemDefinition1, itemDefinition2, itemDefinition3); + + doReturn(expectedItemDefinitions).when(helper).getItemDefinitionsWithNamespace(definitions, anImport); + + importDefinitions.put(anImport, definitions); + + final List actualItemDefinitions = helper.getImportedItemDefinitions(importDefinitions); + + assertEquals(expectedItemDefinitions, actualItemDefinitions); + } + + @Test + public void testGetDrgElementsWithNamespace() { + + final Definitions definitions = mock(Definitions.class); + final Import anImport = mock(Import.class); + final TDecision drgElement1 = new TDecision(); + final TInputData drgElement2 = new TInputData(); + final TDecisionService drgElement3 = new TDecisionService(); + final InformationItem informationItem1 = new TInformationItem(); + final InformationItem informationItem2 = new TInformationItem(); + final InformationItem informationItem3 = new TInformationItem(); + final List drgElements = asList(drgElement1, drgElement2, drgElement3); + final String namespace = "http://github.com/kiegroup/_something"; + + when(anImport.getName()).thenReturn("model"); + when(anImport.getNamespace()).thenReturn(namespace); + informationItem1.setTypeRef(new QName(XMLConstants.NULL_NS_URI, "tUUID", XMLConstants.DEFAULT_NS_PREFIX)); + informationItem2.setTypeRef(new QName(XMLConstants.NULL_NS_URI, "tAge", XMLConstants.DEFAULT_NS_PREFIX)); + informationItem3.setTypeRef(new QName(XMLConstants.NULL_NS_URI, "tNum", XMLConstants.DEFAULT_NS_PREFIX)); + drgElement1.setId("0000-1111"); + drgElement2.setId("2222-3333"); + drgElement3.setId("4444-5555"); + drgElement1.setName("Decision"); + drgElement2.setName("Input Data"); + drgElement3.setName("Decision Service"); + drgElement1.setVariable(informationItem1); + drgElement2.setVariable(informationItem2); + drgElement3.setVariable(informationItem3); + when(definitions.getDrgElement()).thenReturn(drgElements); + + final List elements = helper.getDrgElementsWithNamespace(definitions, anImport); + + assertEquals(3, elements.size()); + + final TDecision element1 = (TDecision) elements.get(0); + assertEquals("model:0000-1111", element1.getId()); + assertEquals("model.Decision", element1.getName()); + assertEquals("model.tUUID", element1.getVariable().getTypeRef().getLocalPart()); + assertEquals(namespace, getNamespace(element1)); + + final TInputData element2 = (TInputData) elements.get(1); + assertEquals("model:2222-3333", element2.getId()); + assertEquals("model.Input Data", element2.getName()); + assertEquals("model.tAge", element2.getVariable().getTypeRef().getLocalPart()); + assertEquals(namespace, getNamespace(element2)); + + final TDecisionService element3 = (TDecisionService) elements.get(2); + assertEquals("model:4444-5555", element3.getId()); + assertEquals("model.Decision Service", element3.getName()); + assertEquals("model.tNum", element3.getVariable().getTypeRef().getLocalPart()); + assertEquals(namespace, getNamespace(element3)); + } + + private String getNamespace(final DRGElement element) { + return element.getAdditionalAttributes().get(DMNMarshallerImportsHelperStandaloneImpl.NAMESPACE); + } + + @Test + public void testGetItemDefinitionsWithNamespace() { + + final Definitions definitions = mock(Definitions.class); + final Import anImport = mock(Import.class); + final ItemDefinition itemDefinition1 = new TItemDefinition(); + final ItemDefinition itemDefinition2 = new TItemDefinition(); + final ItemDefinition itemDefinition3 = new TItemDefinition(); + final ItemDefinition itemDefinition4 = new TItemDefinition(); + final ItemDefinition itemDefinition5 = new TItemDefinition(); + final List itemDefinitions = asList(itemDefinition1, itemDefinition2, itemDefinition3, itemDefinition4, itemDefinition5); + + itemDefinition1.setName("tUUID"); + itemDefinition2.setName("tPerson"); + itemDefinition3.setName("id"); + itemDefinition4.setName("name"); + itemDefinition5.setName("age"); + itemDefinition1.setTypeRef(new QName("string")); + itemDefinition2.setTypeRef(null); + itemDefinition3.setTypeRef(new QName("tUUID")); + itemDefinition4.setTypeRef(new QName("string")); + itemDefinition5.setTypeRef(new QName("number")); + + when(anImport.getName()).thenReturn("model"); + when(definitions.getItemDefinition()).thenReturn(itemDefinitions); + + final List actualItemDefinitions = helper.getItemDefinitionsWithNamespace(definitions, anImport); + + assertEquals(5, actualItemDefinitions.size()); + + final ItemDefinition actualItemDefinition1 = actualItemDefinitions.get(0); + assertEquals("model.tUUID", actualItemDefinition1.getName()); + assertEquals("string", actualItemDefinition1.getTypeRef().getLocalPart()); + + final ItemDefinition actualItemDefinition2 = actualItemDefinitions.get(1); + assertEquals("model.tPerson", actualItemDefinition2.getName()); + assertNull(actualItemDefinition2.getTypeRef()); + + final ItemDefinition actualItemDefinition3 = actualItemDefinitions.get(2); + assertEquals("model.id", actualItemDefinition3.getName()); + assertEquals("model.tUUID", actualItemDefinition3.getTypeRef().getLocalPart()); + + final ItemDefinition actualItemDefinition4 = actualItemDefinitions.get(3); + assertEquals("model.name", actualItemDefinition4.getName()); + assertEquals("string", actualItemDefinition4.getTypeRef().getLocalPart()); + + final ItemDefinition actualItemDefinition5 = actualItemDefinitions.get(4); + assertEquals("model.age", actualItemDefinition5.getName()); + assertEquals("number", actualItemDefinition5.getTypeRef().getLocalPart()); + } + + @Test + public void testGetOtherDMNDiagramsDefinitions() { + + final Metadata metadata = mock(Metadata.class); + final Path path1 = makePath("../file1.dmn"); + final Path path2 = makePath("../file2.dmn"); + final Path path3 = makePath("../file3.dmn"); + final Path path4 = makePath("../file4.dmn"); + final InputStream inputStream1 = mock(InputStream.class); + final InputStream inputStream2 = mock(InputStream.class); + final InputStream inputStream3 = mock(InputStream.class); + final InputStreamReader inputStreamReader1 = mock(InputStreamReader.class); + final InputStreamReader inputStreamReader2 = mock(InputStreamReader.class); + final InputStreamReader inputStreamReader3 = mock(InputStreamReader.class); + final Definitions definitions1 = mock(Definitions.class); + final Definitions definitions2 = mock(Definitions.class); + final Definitions definitions3 = mock(Definitions.class); + final List paths = asList(path1, path2, path3, path4); + + when(pathsHelper.getDMNModelsPaths(any())).thenReturn(paths); + when(metadata.getPath()).thenReturn(path2); + doReturn(Optional.of(inputStream1)).when(helper).loadPath(path1); + doReturn(Optional.of(inputStream2)).when(helper).loadPath(path2); + doReturn(Optional.of(inputStream3)).when(helper).loadPath(path3); + doReturn(inputStreamReader1).when(helper).toInputStreamReader(inputStream1); + doReturn(inputStreamReader2).when(helper).toInputStreamReader(inputStream2); + doReturn(inputStreamReader3).when(helper).toInputStreamReader(inputStream3); + doReturn(Optional.empty()).when(helper).loadPath(path4); + when(marshaller.unmarshal(inputStreamReader1)).thenReturn(definitions1); + when(marshaller.unmarshal(inputStreamReader2)).thenReturn(definitions2); + when(marshaller.unmarshal(inputStreamReader3)).thenReturn(definitions3); + + final List actualDefinitions = helper.getOtherDMNDiagramsDefinitions(metadata); + final List expectedDefinitions = asList(definitions1, definitions3); + + assertEquals(expectedDefinitions, actualDefinitions); + } + + @Test + public void testGetOtherDMNDiagramsDefinitionsWhenProjectCannotBeFound() { + + final Metadata metadata = mock(Metadata.class); + final Path path1 = makePath("../file1.dmn"); + final Path path2 = makePath("../file2.dmn"); + final Path path3 = makePath("../file3.dmn"); + final InputStream inputStream1 = mock(InputStream.class); + final InputStream inputStream2 = mock(InputStream.class); + final InputStream inputStream3 = mock(InputStream.class); + final InputStreamReader inputStreamReader1 = mock(InputStreamReader.class); + final InputStreamReader inputStreamReader2 = mock(InputStreamReader.class); + final InputStreamReader inputStreamReader3 = mock(InputStreamReader.class); + final Definitions definitions1 = mock(Definitions.class); + final Definitions definitions2 = mock(Definitions.class); + final Definitions definitions3 = mock(Definitions.class); + final List paths = asList(path1, path2, path3); + + when(projectService.resolveProject(any(Path.class))).thenThrow(new NullPointerException()); + when(pathsHelper.getDMNModelsPaths(any())).thenReturn(paths); + when(metadata.getPath()).thenReturn(path2); + doReturn(Optional.of(inputStream1)).when(helper).loadPath(path1); + doReturn(Optional.of(inputStream2)).when(helper).loadPath(path2); + doReturn(Optional.of(inputStream3)).when(helper).loadPath(path3); + doReturn(inputStreamReader1).when(helper).toInputStreamReader(inputStream1); + doReturn(inputStreamReader2).when(helper).toInputStreamReader(inputStream2); + doReturn(inputStreamReader3).when(helper).toInputStreamReader(inputStream3); + when(marshaller.unmarshal(inputStreamReader1)).thenReturn(definitions1); + when(marshaller.unmarshal(inputStreamReader2)).thenReturn(definitions2); + when(marshaller.unmarshal(inputStreamReader3)).thenReturn(definitions3); + + final List actualDefinitions = helper.getOtherDMNDiagramsDefinitions(metadata); + final List expectedDefinitions = asList(definitions1, definitions3); + + assertEquals(expectedDefinitions, actualDefinitions); + } + + @Test + public void testLoadPath() { + + final Path path = mock(Path.class); + final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); + final String expectedContent = ""; + final byte[] contentBytes = expectedContent.getBytes(); + + doReturn(nioPath).when(helper).convertPath(path); + when(ioService.newInputStream(nioPath)).thenReturn(new ByteArrayInputStream(contentBytes)); + + final Optional inputStream = helper.loadPath(path); + + assertTrue(inputStream.isPresent()); + assertEquals(expectedContent, new Scanner(new InputStreamReader(inputStream.get())).next()); + } + + @Test + public void testLoadPathWhenPathDoesNotExist() { + + final Path path = mock(Path.class); + final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); + + doReturn(nioPath).when(helper).convertPath(path); + when(ioService.newInputStream(nioPath)).thenThrow(new IOException()); + + final Optional inputStream = helper.loadPath(path); + + assertFalse(inputStream.isPresent()); + } + + @Test + public void testGetImportedItemDefinitionsByNamespace() { + + final WorkspaceProject workspaceProject = mock(WorkspaceProject.class); + final String modelName = "model1"; + final String namespace = "://namespace1"; + final Path path1 = makePath("../file1.dmn"); + final Path path2 = makePath("../file2.dmn"); + final Path path3 = makePath("../file3.dmn"); + final Path path4 = makePath("../file4.dmn"); + final InputStream inputStream1 = mock(InputStream.class); + final InputStream inputStream2 = mock(InputStream.class); + final InputStream inputStream3 = mock(InputStream.class); + final InputStreamReader inputStreamReader1 = mock(InputStreamReader.class); + final InputStreamReader inputStreamReader2 = mock(InputStreamReader.class); + final InputStreamReader inputStreamReader3 = mock(InputStreamReader.class); + final Definitions definitions1 = mock(Definitions.class); + final Definitions definitions2 = mock(Definitions.class); + final Definitions definitions3 = mock(Definitions.class); + final ItemDefinition itemDefinition1 = mock(ItemDefinition.class); + final ItemDefinition itemDefinition2 = mock(ItemDefinition.class); + final List paths = asList(path1, path2, path3, path4); + + when(pathsHelper.getDMNModelsPaths(any())).thenReturn(paths); + doReturn(Optional.of(inputStream1)).when(helper).loadPath(path1); + doReturn(Optional.of(inputStream2)).when(helper).loadPath(path2); + doReturn(Optional.of(inputStream3)).when(helper).loadPath(path3); + doReturn(inputStreamReader1).when(helper).toInputStreamReader(inputStream1); + doReturn(inputStreamReader2).when(helper).toInputStreamReader(inputStream2); + doReturn(inputStreamReader3).when(helper).toInputStreamReader(inputStream3); + doReturn(Optional.empty()).when(helper).loadPath(path4); + when(marshaller.unmarshal(inputStreamReader1)).thenReturn(definitions1); + when(marshaller.unmarshal(inputStreamReader2)).thenReturn(definitions2); + when(marshaller.unmarshal(inputStreamReader3)).thenReturn(definitions3); + when(definitions1.getNamespace()).thenReturn("://namespace1"); + when(definitions2.getNamespace()).thenReturn("://namespace2"); + when(definitions3.getNamespace()).thenReturn("://namespace3"); + when(definitions1.getItemDefinition()).thenReturn(asList(itemDefinition1, itemDefinition2)); + + final List actualItemDefinitions = helper.getImportedItemDefinitionsByNamespace(workspaceProject, modelName, namespace); + final List expectedItemDefinitions = asList(itemDefinition1, itemDefinition2); + + assertEquals(expectedItemDefinitions, actualItemDefinitions); + } + + @Test + public void testGetModelPath() { + + final Metadata metadata = mock(Metadata.class); + final WorkspaceProject workspaceProject = mock(WorkspaceProject.class); + final Path metadataPath = mock(Path.class); + final Path path1 = mock(Path.class); + final Path path2 = mock(Path.class); + final Path path3 = mock(Path.class); + final Definitions definitions1 = mock(Definitions.class); + final Definitions definitions2 = mock(Definitions.class); + final String modelNamespace = "0000-1111-2222-3333"; + final String modelName = "model name"; + + doReturn(Optional.of(definitions1)).when(helper).getDefinitionsByPath(path1); + doReturn(Optional.of(definitions2)).when(helper).getDefinitionsByPath(path2); + doReturn(Optional.empty()).when(helper).getDefinitionsByPath(path3); + when(definitions1.getNamespace()).thenReturn("0000-0000-0000-0000"); + when(definitions2.getNamespace()).thenReturn("0000-1111-2222-3333"); + when(definitions1.getName()).thenReturn("modll name"); + when(definitions2.getName()).thenReturn("model name"); + when(metadata.getPath()).thenReturn(metadataPath); + when(projectService.resolveProject(metadataPath)).thenReturn(workspaceProject); + when(pathsHelper.getDMNModelsPaths(workspaceProject)).thenReturn(asList(path1, path2, path3)); + + final Path modelPath = helper.getDMNModelPath(metadata, modelNamespace, modelName); + + assertEquals(path2, modelPath); + } + + @Test + public void testGetModelPathWhenDMNModelCouldNotBeFound() { + + final Metadata metadata = mock(Metadata.class); + final String modelNamespace = "0000-1111-2222-3333"; + final String modelName = "model name"; + + assertThatThrownBy(() -> helper.getDMNModelPath(metadata, modelNamespace, modelName)) + .isInstanceOf(IllegalStateException.class) + .hasMessageContaining("A path for the DMN model with namespace [0000-1111-2222-3333] could not be found."); + } + + private Path makePath(final String uri) { + + final PathImpl path = spy(new PathImpl()); + + doReturn(uri).when(path).toURI(); + + return path; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelperImplTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelperImplTest.java deleted file mode 100644 index 2cf972aa2fb..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelperImplTest.java +++ /dev/null @@ -1,572 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.dmn.backend.common; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.StringReader; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Scanner; - -import javax.xml.XMLConstants; -import javax.xml.namespace.QName; - -import org.guvnor.common.services.project.model.WorkspaceProject; -import org.guvnor.common.services.project.service.WorkspaceProjectService; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.dmn.api.marshalling.DMNMarshaller; -import org.kie.dmn.model.api.DRGElement; -import org.kie.dmn.model.api.Definitions; -import org.kie.dmn.model.api.Import; -import org.kie.dmn.model.api.InformationItem; -import org.kie.dmn.model.api.ItemDefinition; -import org.kie.dmn.model.v1_2.TDecision; -import org.kie.dmn.model.v1_2.TDecisionService; -import org.kie.dmn.model.v1_2.TInformationItem; -import org.kie.dmn.model.v1_2.TInputData; -import org.kie.dmn.model.v1_2.TItemDefinition; -import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; -import org.kie.workbench.common.dmn.backend.editors.common.PMMLIncludedDocumentFactory; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; -import org.uberfire.backend.vfs.Path; -import org.uberfire.io.IOService; -import org.uberfire.java.nio.IOException; - -import static java.util.Arrays.asList; -import static java.util.Collections.singletonList; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.uberfire.backend.vfs.PathFactory.PathImpl; - -@RunWith(MockitoJUnitRunner.class) -public class DMNMarshallerImportsHelperImplTest { - - @Mock - private DMNPathsHelperImpl pathsHelper; - - @Mock - private WorkspaceProjectService projectService; - - @Mock - private IOService ioService; - - @Mock - private DMNMarshaller marshaller; - - @Mock - private DMNIOHelper dmnIOHelper; - - @Mock - private PMMLIncludedDocumentFactory pmmlDocumentFactory; - - private DMNMarshallerImportsHelperImpl helper; - - @Before - public void setup() { - helper = spy(new DMNMarshallerImportsHelperImpl(pathsHelper, - projectService, - marshaller, - dmnIOHelper, - pmmlDocumentFactory, - ioService)); - } - - @Test - public void testGetImportDefinitions() { - - final Metadata metadata = mock(Metadata.class); - final Import import1 = mock(Import.class); - final Import import2 = mock(Import.class); - final Import import3 = mock(Import.class); - final List imports = asList(import1, import2, import3); - final Definitions definitions1 = mock(Definitions.class); - final Definitions definitions2 = mock(Definitions.class); - final Definitions definitions3 = mock(Definitions.class); - final List definitions = asList(definitions1, definitions2, definitions3); - - when(definitions1.getNamespace()).thenReturn("://namespace1"); - when(definitions2.getNamespace()).thenReturn("://namespace2"); - when(definitions3.getNamespace()).thenReturn("://namespace3"); - when(import1.getNamespace()).thenReturn("://namespace1"); - when(import2.getNamespace()).thenReturn("://namespace2-diff"); - when(import3.getNamespace()).thenReturn("://namespace3"); - doReturn(definitions).when(helper).getOtherDMNDiagramsDefinitions(metadata); - - final Map importDefinitions = helper.getImportDefinitions(metadata, imports); - - assertEquals(2, importDefinitions.size()); - assertEquals(definitions1, importDefinitions.get(import1)); - assertEquals(definitions3, importDefinitions.get(import3)); - } - - @Test - public void testGetPMMLDocuments() { - final Path dmnModelPath = mock(Path.class); - final Metadata metadata = mock(Metadata.class); - final PMMLDocumentMetadata pmmlDocument = mock(PMMLDocumentMetadata.class); - final Import import1 = mock(Import.class); - final List imports = singletonList(import1); - final Path path1 = mock(Path.class); - final Path path2 = mock(Path.class); - final List paths = asList(path1, path2); - - when(metadata.getPath()).thenReturn(dmnModelPath); - when(import1.getLocationURI()).thenReturn("document1.pmml"); - when(pathsHelper.getRelativeURI(dmnModelPath, path1)).thenReturn("document1.pmml"); - when(pathsHelper.getRelativeURI(dmnModelPath, path2)).thenReturn("document2.pmml"); - when(pmmlDocumentFactory.getDocumentByPath(path1)).thenReturn(pmmlDocument); - - doReturn(paths).when(helper).getPMMLDocumentPaths(metadata); - - final Map importDefinitions = helper.getPMMLDocuments(metadata, imports); - - assertEquals(1, importDefinitions.size()); - - assertEquals(pmmlDocument, importDefinitions.get(import1)); - } - - @Test - public void testGetPMMLDocumentPaths() { - final Metadata metadata = mock(Metadata.class); - final WorkspaceProject project = mock(WorkspaceProject.class); - final Path projectPath = mock(Path.class); - - when(metadata.getPath()).thenReturn(projectPath); - when(projectService.resolveProject(any(Path.class))).thenReturn(project); - - helper.getPMMLDocumentPaths(metadata); - - verify(projectService).resolveProject(projectPath); - } - - @Test - public void testGetImportXML() throws java.io.IOException { - final String xml1 = ""; - final String xml2 = ""; - - final Metadata metadata = mock(Metadata.class); - final Import import1 = mock(Import.class); - - final Path path1 = makePath("../file1.dmn"); - final Path path2 = makePath("../file2.dmn"); - - //Mock loading of XML files in Project - final InputStream inputStream1 = mock(InputStream.class); - final InputStream inputStream2 = mock(InputStream.class); - final InputStreamReader inputStreamReader1 = mock(InputStreamReader.class); - final InputStreamReader inputStreamReader2 = mock(InputStreamReader.class); - final List paths = asList(path1, path2); - - when(pathsHelper.getDMNModelsPaths(any())).thenReturn(paths); - when(dmnIOHelper.isAsString(inputStream1)).thenReturn(xml1); - when(dmnIOHelper.isAsString(inputStream2)).thenReturn(xml2); - - doReturn(Optional.of(inputStream1)).when(helper).loadPath(path1); - doReturn(Optional.of(inputStream2)).when(helper).loadPath(path2); - doReturn(inputStreamReader1).when(helper).toInputStreamReader(inputStream1); - doReturn(inputStreamReader2).when(helper).toInputStreamReader(inputStream2); - - //Mock retrieval of Definitions from XML files in Project - final StringReader stringReader1 = mock(StringReader.class); - final StringReader stringReader2 = mock(StringReader.class); - final Definitions definitions1 = mock(Definitions.class); - final Definitions definitions2 = mock(Definitions.class); - - doReturn(stringReader1).when(helper).toStringReader(xml1); - doReturn(stringReader2).when(helper).toStringReader(xml2); - when(marshaller.unmarshal(stringReader1)).thenReturn(definitions1); - when(marshaller.unmarshal(stringReader2)).thenReturn(definitions2); - when(import1.getNamespace()).thenReturn("://namespace1"); - when(definitions1.getNamespace()).thenReturn("://namespace1"); - when(definitions2.getNamespace()).thenReturn("://namespace2-not-imported"); - - final List imports = Collections.singletonList(import1); - - final Map importXML = helper.getImportXML(metadata, imports); - - assertEquals(1, importXML.size()); - assertEquals(xml1, importXML.get(import1)); - } - - @Test - public void testGetImportedDRGElements() { - - final Map importDefinitions = new HashMap<>(); - final Import anImport = mock(Import.class); - final Definitions definitions = mock(Definitions.class); - final DRGElement drgElement1 = mock(DRGElement.class); - final DRGElement drgElement2 = mock(DRGElement.class); - final DRGElement drgElement3 = mock(DRGElement.class); - final List expectedDRGElements = asList(drgElement1, drgElement2, drgElement3); - - doReturn(expectedDRGElements).when(helper).getDrgElementsWithNamespace(definitions, anImport); - - importDefinitions.put(anImport, definitions); - - final List actualDRGElements = helper.getImportedDRGElements(importDefinitions); - - assertEquals(expectedDRGElements, actualDRGElements); - } - - @Test - public void testGetImportedItemDefinitions() { - - final Map importDefinitions = new HashMap<>(); - final Import anImport = mock(Import.class); - final Definitions definitions = mock(Definitions.class); - final ItemDefinition itemDefinition1 = mock(ItemDefinition.class); - final ItemDefinition itemDefinition2 = mock(ItemDefinition.class); - final ItemDefinition itemDefinition3 = mock(ItemDefinition.class); - final List expectedItemDefinitions = asList(itemDefinition1, itemDefinition2, itemDefinition3); - - doReturn(expectedItemDefinitions).when(helper).getItemDefinitionsWithNamespace(definitions, anImport); - - importDefinitions.put(anImport, definitions); - - final List actualItemDefinitions = helper.getImportedItemDefinitions(importDefinitions); - - assertEquals(expectedItemDefinitions, actualItemDefinitions); - } - - @Test - public void testGetDrgElementsWithNamespace() { - - final Definitions definitions = mock(Definitions.class); - final Import anImport = mock(Import.class); - final TDecision drgElement1 = new TDecision(); - final TInputData drgElement2 = new TInputData(); - final TDecisionService drgElement3 = new TDecisionService(); - final InformationItem informationItem1 = new TInformationItem(); - final InformationItem informationItem2 = new TInformationItem(); - final InformationItem informationItem3 = new TInformationItem(); - final List drgElements = asList(drgElement1, drgElement2, drgElement3); - final String namespace = "http://github.com/kiegroup/_something"; - - when(anImport.getName()).thenReturn("model"); - when(anImport.getNamespace()).thenReturn(namespace); - informationItem1.setTypeRef(new QName(XMLConstants.NULL_NS_URI, "tUUID", XMLConstants.DEFAULT_NS_PREFIX)); - informationItem2.setTypeRef(new QName(XMLConstants.NULL_NS_URI, "tAge", XMLConstants.DEFAULT_NS_PREFIX)); - informationItem3.setTypeRef(new QName(XMLConstants.NULL_NS_URI, "tNum", XMLConstants.DEFAULT_NS_PREFIX)); - drgElement1.setId("0000-1111"); - drgElement2.setId("2222-3333"); - drgElement3.setId("4444-5555"); - drgElement1.setName("Decision"); - drgElement2.setName("Input Data"); - drgElement3.setName("Decision Service"); - drgElement1.setVariable(informationItem1); - drgElement2.setVariable(informationItem2); - drgElement3.setVariable(informationItem3); - when(definitions.getDrgElement()).thenReturn(drgElements); - - final List elements = helper.getDrgElementsWithNamespace(definitions, anImport); - - assertEquals(3, elements.size()); - - final TDecision element1 = (TDecision) elements.get(0); - assertEquals("model:0000-1111", element1.getId()); - assertEquals("model.Decision", element1.getName()); - assertEquals("model.tUUID", element1.getVariable().getTypeRef().getLocalPart()); - assertEquals(namespace, getNamespace(element1)); - - final TInputData element2 = (TInputData) elements.get(1); - assertEquals("model:2222-3333", element2.getId()); - assertEquals("model.Input Data", element2.getName()); - assertEquals("model.tAge", element2.getVariable().getTypeRef().getLocalPart()); - assertEquals(namespace, getNamespace(element2)); - - final TDecisionService element3 = (TDecisionService) elements.get(2); - assertEquals("model:4444-5555", element3.getId()); - assertEquals("model.Decision Service", element3.getName()); - assertEquals("model.tNum", element3.getVariable().getTypeRef().getLocalPart()); - assertEquals(namespace, getNamespace(element3)); - } - - private String getNamespace(final DRGElement element) { - return element.getAdditionalAttributes().get(DMNMarshallerImportsHelperImpl.NAMESPACE); - } - - @Test - public void testGetItemDefinitionsWithNamespace() { - - final Definitions definitions = mock(Definitions.class); - final Import anImport = mock(Import.class); - final ItemDefinition itemDefinition1 = new TItemDefinition(); - final ItemDefinition itemDefinition2 = new TItemDefinition(); - final ItemDefinition itemDefinition3 = new TItemDefinition(); - final ItemDefinition itemDefinition4 = new TItemDefinition(); - final ItemDefinition itemDefinition5 = new TItemDefinition(); - final List itemDefinitions = asList(itemDefinition1, itemDefinition2, itemDefinition3, itemDefinition4, itemDefinition5); - - itemDefinition1.setName("tUUID"); - itemDefinition2.setName("tPerson"); - itemDefinition3.setName("id"); - itemDefinition4.setName("name"); - itemDefinition5.setName("age"); - itemDefinition1.setTypeRef(new QName("string")); - itemDefinition2.setTypeRef(null); - itemDefinition3.setTypeRef(new QName("tUUID")); - itemDefinition4.setTypeRef(new QName("string")); - itemDefinition5.setTypeRef(new QName("number")); - - when(anImport.getName()).thenReturn("model"); - when(definitions.getItemDefinition()).thenReturn(itemDefinitions); - - final List actualItemDefinitions = helper.getItemDefinitionsWithNamespace(definitions, anImport); - - assertEquals(5, actualItemDefinitions.size()); - - final ItemDefinition actualItemDefinition1 = actualItemDefinitions.get(0); - assertEquals("model.tUUID", actualItemDefinition1.getName()); - assertEquals("string", actualItemDefinition1.getTypeRef().getLocalPart()); - - final ItemDefinition actualItemDefinition2 = actualItemDefinitions.get(1); - assertEquals("model.tPerson", actualItemDefinition2.getName()); - assertNull(actualItemDefinition2.getTypeRef()); - - final ItemDefinition actualItemDefinition3 = actualItemDefinitions.get(2); - assertEquals("model.id", actualItemDefinition3.getName()); - assertEquals("model.tUUID", actualItemDefinition3.getTypeRef().getLocalPart()); - - final ItemDefinition actualItemDefinition4 = actualItemDefinitions.get(3); - assertEquals("model.name", actualItemDefinition4.getName()); - assertEquals("string", actualItemDefinition4.getTypeRef().getLocalPart()); - - final ItemDefinition actualItemDefinition5 = actualItemDefinitions.get(4); - assertEquals("model.age", actualItemDefinition5.getName()); - assertEquals("number", actualItemDefinition5.getTypeRef().getLocalPart()); - } - - @Test - public void testGetOtherDMNDiagramsDefinitions() { - - final Metadata metadata = mock(Metadata.class); - final Path path1 = makePath("../file1.dmn"); - final Path path2 = makePath("../file2.dmn"); - final Path path3 = makePath("../file3.dmn"); - final Path path4 = makePath("../file4.dmn"); - final InputStream inputStream1 = mock(InputStream.class); - final InputStream inputStream2 = mock(InputStream.class); - final InputStream inputStream3 = mock(InputStream.class); - final InputStreamReader inputStreamReader1 = mock(InputStreamReader.class); - final InputStreamReader inputStreamReader2 = mock(InputStreamReader.class); - final InputStreamReader inputStreamReader3 = mock(InputStreamReader.class); - final Definitions definitions1 = mock(Definitions.class); - final Definitions definitions2 = mock(Definitions.class); - final Definitions definitions3 = mock(Definitions.class); - final List paths = asList(path1, path2, path3, path4); - - when(pathsHelper.getDMNModelsPaths(any())).thenReturn(paths); - when(metadata.getPath()).thenReturn(path2); - doReturn(Optional.of(inputStream1)).when(helper).loadPath(path1); - doReturn(Optional.of(inputStream2)).when(helper).loadPath(path2); - doReturn(Optional.of(inputStream3)).when(helper).loadPath(path3); - doReturn(inputStreamReader1).when(helper).toInputStreamReader(inputStream1); - doReturn(inputStreamReader2).when(helper).toInputStreamReader(inputStream2); - doReturn(inputStreamReader3).when(helper).toInputStreamReader(inputStream3); - doReturn(Optional.empty()).when(helper).loadPath(path4); - when(marshaller.unmarshal(inputStreamReader1)).thenReturn(definitions1); - when(marshaller.unmarshal(inputStreamReader2)).thenReturn(definitions2); - when(marshaller.unmarshal(inputStreamReader3)).thenReturn(definitions3); - - final List actualDefinitions = helper.getOtherDMNDiagramsDefinitions(metadata); - final List expectedDefinitions = asList(definitions1, definitions3); - - assertEquals(expectedDefinitions, actualDefinitions); - } - - @Test - public void testGetOtherDMNDiagramsDefinitionsWhenProjectCannotBeFound() { - - final Metadata metadata = mock(Metadata.class); - final Path path1 = makePath("../file1.dmn"); - final Path path2 = makePath("../file2.dmn"); - final Path path3 = makePath("../file3.dmn"); - final InputStream inputStream1 = mock(InputStream.class); - final InputStream inputStream2 = mock(InputStream.class); - final InputStream inputStream3 = mock(InputStream.class); - final InputStreamReader inputStreamReader1 = mock(InputStreamReader.class); - final InputStreamReader inputStreamReader2 = mock(InputStreamReader.class); - final InputStreamReader inputStreamReader3 = mock(InputStreamReader.class); - final Definitions definitions1 = mock(Definitions.class); - final Definitions definitions2 = mock(Definitions.class); - final Definitions definitions3 = mock(Definitions.class); - final List paths = asList(path1, path2, path3); - - when(projectService.resolveProject(any(Path.class))).thenThrow(new NullPointerException()); - when(pathsHelper.getDMNModelsPaths(any())).thenReturn(paths); - when(metadata.getPath()).thenReturn(path2); - doReturn(Optional.of(inputStream1)).when(helper).loadPath(path1); - doReturn(Optional.of(inputStream2)).when(helper).loadPath(path2); - doReturn(Optional.of(inputStream3)).when(helper).loadPath(path3); - doReturn(inputStreamReader1).when(helper).toInputStreamReader(inputStream1); - doReturn(inputStreamReader2).when(helper).toInputStreamReader(inputStream2); - doReturn(inputStreamReader3).when(helper).toInputStreamReader(inputStream3); - when(marshaller.unmarshal(inputStreamReader1)).thenReturn(definitions1); - when(marshaller.unmarshal(inputStreamReader2)).thenReturn(definitions2); - when(marshaller.unmarshal(inputStreamReader3)).thenReturn(definitions3); - - final List actualDefinitions = helper.getOtherDMNDiagramsDefinitions(metadata); - final List expectedDefinitions = asList(definitions1, definitions3); - - assertEquals(expectedDefinitions, actualDefinitions); - } - - @Test - public void testLoadPath() { - - final Path path = mock(Path.class); - final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); - final String expectedContent = ""; - final byte[] contentBytes = expectedContent.getBytes(); - - doReturn(nioPath).when(helper).convertPath(path); - when(ioService.newInputStream(nioPath)).thenReturn(new ByteArrayInputStream(contentBytes)); - - final Optional inputStream = helper.loadPath(path); - - assertTrue(inputStream.isPresent()); - assertEquals(expectedContent, new Scanner(new InputStreamReader(inputStream.get())).next()); - } - - @Test - public void testLoadPathWhenPathDoesNotExist() { - - final Path path = mock(Path.class); - final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); - - doReturn(nioPath).when(helper).convertPath(path); - when(ioService.newInputStream(nioPath)).thenThrow(new IOException()); - - final Optional inputStream = helper.loadPath(path); - - assertFalse(inputStream.isPresent()); - } - - @Test - public void testGetImportedItemDefinitionsByNamespace() { - - final WorkspaceProject workspaceProject = mock(WorkspaceProject.class); - final String modelName = "model1"; - final String namespace = "://namespace1"; - final Path path1 = makePath("../file1.dmn"); - final Path path2 = makePath("../file2.dmn"); - final Path path3 = makePath("../file3.dmn"); - final Path path4 = makePath("../file4.dmn"); - final InputStream inputStream1 = mock(InputStream.class); - final InputStream inputStream2 = mock(InputStream.class); - final InputStream inputStream3 = mock(InputStream.class); - final InputStreamReader inputStreamReader1 = mock(InputStreamReader.class); - final InputStreamReader inputStreamReader2 = mock(InputStreamReader.class); - final InputStreamReader inputStreamReader3 = mock(InputStreamReader.class); - final Definitions definitions1 = mock(Definitions.class); - final Definitions definitions2 = mock(Definitions.class); - final Definitions definitions3 = mock(Definitions.class); - final ItemDefinition itemDefinition1 = mock(ItemDefinition.class); - final ItemDefinition itemDefinition2 = mock(ItemDefinition.class); - final List paths = asList(path1, path2, path3, path4); - - when(pathsHelper.getDMNModelsPaths(any())).thenReturn(paths); - doReturn(Optional.of(inputStream1)).when(helper).loadPath(path1); - doReturn(Optional.of(inputStream2)).when(helper).loadPath(path2); - doReturn(Optional.of(inputStream3)).when(helper).loadPath(path3); - doReturn(inputStreamReader1).when(helper).toInputStreamReader(inputStream1); - doReturn(inputStreamReader2).when(helper).toInputStreamReader(inputStream2); - doReturn(inputStreamReader3).when(helper).toInputStreamReader(inputStream3); - doReturn(Optional.empty()).when(helper).loadPath(path4); - when(marshaller.unmarshal(inputStreamReader1)).thenReturn(definitions1); - when(marshaller.unmarshal(inputStreamReader2)).thenReturn(definitions2); - when(marshaller.unmarshal(inputStreamReader3)).thenReturn(definitions3); - when(definitions1.getNamespace()).thenReturn("://namespace1"); - when(definitions2.getNamespace()).thenReturn("://namespace2"); - when(definitions3.getNamespace()).thenReturn("://namespace3"); - when(definitions1.getItemDefinition()).thenReturn(asList(itemDefinition1, itemDefinition2)); - - final List actualItemDefinitions = helper.getImportedItemDefinitionsByNamespace(workspaceProject, modelName, namespace); - final List expectedItemDefinitions = asList(itemDefinition1, itemDefinition2); - - assertEquals(expectedItemDefinitions, actualItemDefinitions); - } - - @Test - public void testGetModelPath() { - - final Metadata metadata = mock(Metadata.class); - final WorkspaceProject workspaceProject = mock(WorkspaceProject.class); - final Path metadataPath = mock(Path.class); - final Path path1 = mock(Path.class); - final Path path2 = mock(Path.class); - final Path path3 = mock(Path.class); - final Definitions definitions1 = mock(Definitions.class); - final Definitions definitions2 = mock(Definitions.class); - final String modelNamespace = "0000-1111-2222-3333"; - final String modelName = "model name"; - - doReturn(Optional.of(definitions1)).when(helper).getDefinitionsByPath(path1); - doReturn(Optional.of(definitions2)).when(helper).getDefinitionsByPath(path2); - doReturn(Optional.empty()).when(helper).getDefinitionsByPath(path3); - when(definitions1.getNamespace()).thenReturn("0000-0000-0000-0000"); - when(definitions2.getNamespace()).thenReturn("0000-1111-2222-3333"); - when(definitions1.getName()).thenReturn("modll name"); - when(definitions2.getName()).thenReturn("model name"); - when(metadata.getPath()).thenReturn(metadataPath); - when(projectService.resolveProject(metadataPath)).thenReturn(workspaceProject); - when(pathsHelper.getDMNModelsPaths(workspaceProject)).thenReturn(asList(path1, path2, path3)); - - final Path modelPath = helper.getDMNModelPath(metadata, modelNamespace, modelName); - - assertEquals(path2, modelPath); - } - - @Test - public void testGetModelPathWhenDMNModelCouldNotBeFound() { - - final Metadata metadata = mock(Metadata.class); - final String modelNamespace = "0000-1111-2222-3333"; - final String modelName = "model name"; - - assertThatThrownBy(() -> helper.getDMNModelPath(metadata, modelNamespace, modelName)) - .isInstanceOf(UnsupportedOperationException.class) - .hasMessageContaining("No DMN model could be found for the following namespace: 0000-1111-2222-3333"); - } - - private Path makePath(final String uri) { - - final PathImpl path = spy(new PathImpl()); - - doReturn(uri).when(path).toURI(); - - return path; - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNPathsHelperImplTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNPathsHelperImplTest.java index c1c4f13db75..5462dd69126 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNPathsHelperImplTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/common/DMNPathsHelperImplTest.java @@ -24,6 +24,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.kie.workbench.common.dmn.api.marshalling.DMNImportTypesHelper; import org.kie.workbench.common.services.refactoring.backend.server.query.RefactoringQueryServiceImpl; import org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRequest; import org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/editors/common/IncludedModelFactoryTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/editors/common/IncludedModelFactoryTest.java index 4c9a50df6d5..cf06a61ccf7 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/editors/common/IncludedModelFactoryTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/editors/common/IncludedModelFactoryTest.java @@ -29,8 +29,8 @@ import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; import org.kie.workbench.common.dmn.api.editors.included.PMMLIncludedModel; import org.kie.workbench.common.dmn.api.editors.included.PMMLModelMetadata; -import org.kie.workbench.common.dmn.backend.common.DMNImportTypesHelper; -import org.kie.workbench.common.dmn.backend.common.DMNPathsHelper; +import org.kie.workbench.common.dmn.api.marshalling.DMNImportTypesHelper; +import org.kie.workbench.common.dmn.api.marshalling.DMNPathsHelper; import org.kie.workbench.common.dmn.backend.editors.types.exceptions.DMNIncludeModelCouldNotBeCreatedException; import org.kie.workbench.common.services.shared.project.KieModuleService; import org.kie.workbench.common.stunner.core.diagram.Diagram; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/editors/common/PMMLIncludedDocumentsFilterTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/editors/common/PMMLIncludedDocumentsFilterTest.java index 3150d7af6c3..9bd808bfc32 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/editors/common/PMMLIncludedDocumentsFilterTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/editors/common/PMMLIncludedDocumentsFilterTest.java @@ -25,7 +25,7 @@ import org.kie.workbench.common.dmn.api.editors.included.DMNImportTypes; import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; import org.kie.workbench.common.dmn.api.editors.included.PMMLIncludedModel; -import org.kie.workbench.common.dmn.backend.common.DMNPathsHelper; +import org.kie.workbench.common.dmn.api.marshalling.DMNPathsHelper; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.uberfire.backend.vfs.Path; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/editors/included/DMNIncludedModelsServiceImplTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/editors/included/DMNIncludedModelsServiceImplTest.java index 0f441727d12..6dbc2b5709b 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/editors/included/DMNIncludedModelsServiceImplTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/editors/included/DMNIncludedModelsServiceImplTest.java @@ -28,8 +28,8 @@ import org.kie.workbench.common.dmn.api.editors.included.IncludedModel; import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; import org.kie.workbench.common.dmn.api.editors.included.PMMLIncludedModel; -import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelper; -import org.kie.workbench.common.dmn.backend.common.DMNPathsHelper; +import org.kie.workbench.common.dmn.api.marshalling.DMNPathsHelper; +import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelperStandalone; import org.kie.workbench.common.dmn.backend.editors.common.DMNIncludedNodesFilter; import org.kie.workbench.common.dmn.backend.editors.common.IncludedModelFactory; import org.kie.workbench.common.dmn.backend.editors.common.PMMLIncludedDocumentsFilter; @@ -62,7 +62,7 @@ public class DMNIncludedModelsServiceImplTest { private PMMLIncludedDocumentsFilter includedDocumentsFilter; @Mock - private DMNMarshallerImportsHelper importsHelper; + private DMNMarshallerImportsHelperStandalone importsHelper; @Mock private Path dmnModelPath; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/validation/DMNDomainValidatorTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/validation/DMNDomainValidatorTest.java index 0fdf6ac26a3..178bde89281 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/validation/DMNDomainValidatorTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-backend/src/test/java/org/kie/workbench/common/dmn/backend/validation/DMNDomainValidatorTest.java @@ -46,9 +46,9 @@ import org.kie.workbench.common.dmn.api.definition.model.Definitions; import org.kie.workbench.common.dmn.api.definition.model.Import; import org.kie.workbench.common.dmn.api.graph.DMNDiagramUtils; -import org.kie.workbench.common.dmn.backend.DMNMarshaller; +import org.kie.workbench.common.dmn.backend.DMNMarshallerStandalone; import org.kie.workbench.common.dmn.backend.common.DMNIOHelper; -import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelper; +import org.kie.workbench.common.dmn.backend.common.DMNMarshallerImportsHelperStandalone; import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.diagram.Metadata; import org.kie.workbench.common.stunner.core.validation.DomainViolation; @@ -82,13 +82,13 @@ public class DMNDomainValidatorTest { private static final String IMPORTED_DMN_XML = ""; @Mock - private DMNMarshaller dmnMarshaller; + private DMNMarshallerStandalone dmnMarshaller; @Mock private DMNDiagramUtils dmnDiagramUtils; @Mock - private DMNMarshallerImportsHelper importsHelper; + private DMNMarshallerImportsHelperStandalone importsHelper; @Mock private DMNValidator dmnValidator; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/pom.xml b/kie-wb-common-dmn/kie-wb-common-dmn-client/pom.xml index 687e1dc2dd3..e9ae1c04c6c 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/pom.xml +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/pom.xml @@ -81,6 +81,7 @@ kie-wb-common-stunner-svg-client + org.kie.workbench.stunner kie-wb-common-stunner-svg-gen diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorChildrenTraverse.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorChildrenTraverse.java similarity index 92% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorChildrenTraverse.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorChildrenTraverse.java index eb314239368..57dd61671be 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorChildrenTraverse.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorChildrenTraverse.java @@ -14,16 +14,17 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision; +package org.kie.workbench.common.dmn.client.docks.navigator; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.Optional; import javax.enterprise.context.Dependent; import javax.inject.Inject; -import org.kie.workbench.common.dmn.client.decision.factories.DecisionNavigatorItemFactory; +import org.kie.workbench.common.dmn.client.docks.navigator.factories.DecisionNavigatorItemFactory; import org.kie.workbench.common.stunner.core.graph.Edge; import org.kie.workbench.common.stunner.core.graph.Graph; import org.kie.workbench.common.stunner.core.graph.Node; @@ -95,7 +96,7 @@ Optional findItem(final Node node) { return getItems() .stream() - .filter(item -> item.getUUID().equals(node.getUUID())) + .filter(item -> Objects.equals(item.getUUID(), node.getUUID())) .findFirst(); } } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorDock.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorDock.java similarity index 98% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorDock.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorDock.java index 589867b6b6f..6eb45544698 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorDock.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorDock.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision; +package org.kie.workbench.common.dmn.client.docks.navigator; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorItem.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorItem.java similarity index 98% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorItem.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorItem.java index 80f47601c87..b9010f10e07 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorItem.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorItem.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision; +package org.kie.workbench.common.dmn.client.docks.navigator; import java.util.Objects; import java.util.TreeSet; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorObserver.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorObserver.java similarity index 96% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorObserver.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorObserver.java index a7df78947fd..fedc63547b2 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorObserver.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorObserver.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision; +package org.kie.workbench.common.dmn.client.docks.navigator; import java.util.Optional; @@ -23,7 +23,7 @@ import org.kie.workbench.common.dmn.api.definition.HasExpression; import org.kie.workbench.common.dmn.api.definition.model.Expression; -import org.kie.workbench.common.dmn.client.decision.tree.DecisionNavigatorTreePresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.tree.DecisionNavigatorTreePresenter; import org.kie.workbench.common.dmn.client.events.EditExpressionEvent; import org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorChanged; import org.kie.workbench.common.stunner.core.client.canvas.event.CanvasClearEvent; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorPresenter.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorPresenter.java similarity index 94% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorPresenter.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorPresenter.java index 8053a27554d..424310fa882 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorPresenter.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorPresenter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision; +package org.kie.workbench.common.dmn.client.docks.navigator; import java.util.List; import java.util.Optional; @@ -27,10 +27,10 @@ import org.jboss.errai.ui.client.local.api.elemental2.IsElement; import org.jboss.errai.ui.client.local.spi.TranslationService; -import org.kie.workbench.common.dmn.client.decision.events.RefreshDecisionComponents; -import org.kie.workbench.common.dmn.client.decision.factories.DecisionNavigatorItemFactory; -import org.kie.workbench.common.dmn.client.decision.included.components.DecisionComponents; -import org.kie.workbench.common.dmn.client.decision.tree.DecisionNavigatorTreePresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.events.RefreshDecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.factories.DecisionNavigatorItemFactory; +import org.kie.workbench.common.dmn.client.docks.navigator.included.components.DecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.tree.DecisionNavigatorTreePresenter; import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.graph.Edge; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorView.html b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorView.html similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorView.html rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorView.html diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorView.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorView.java similarity index 87% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorView.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorView.java index 1eb025e0180..73d67138940 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorView.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorView.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision; +package org.kie.workbench.common.dmn.client.docks.navigator; import javax.inject.Inject; import elemental2.dom.HTMLDivElement; import org.jboss.errai.ui.shared.api.annotations.DataField; import org.jboss.errai.ui.shared.api.annotations.Templated; -import org.kie.workbench.common.dmn.client.decision.included.components.DecisionComponents; -import org.kie.workbench.common.dmn.client.decision.tree.DecisionNavigatorTreePresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.included.components.DecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.tree.DecisionNavigatorTreePresenter; @Templated public class DecisionNavigatorView implements DecisionNavigatorPresenter.View { diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorView.less b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorView.less similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorView.less rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorView.less diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/events/RefreshDecisionComponents.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/events/RefreshDecisionComponents.java similarity index 91% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/events/RefreshDecisionComponents.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/events/RefreshDecisionComponents.java index 1d5122f096d..3944a3484c9 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/events/RefreshDecisionComponents.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/events/RefreshDecisionComponents.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.events; +package org.kie.workbench.common.dmn.client.docks.navigator.events; import org.uberfire.workbench.events.UberFireEvent; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorBaseItemFactory.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorBaseItemFactory.java similarity index 96% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorBaseItemFactory.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorBaseItemFactory.java index 5a84ff02f25..d17403333b2 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorBaseItemFactory.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorBaseItemFactory.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.factories; +package org.kie.workbench.common.dmn.client.docks.navigator.factories; import java.util.ArrayList; import java.util.List; @@ -26,8 +26,8 @@ import org.jboss.errai.ui.client.local.spi.TranslationService; import org.kie.workbench.common.dmn.api.definition.model.DMNDiagram; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorPresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorPresenter; import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; import org.kie.workbench.common.stunner.core.client.canvas.controls.actions.TextPropertyProvider; import org.kie.workbench.common.stunner.core.client.canvas.controls.actions.TextPropertyProviderFactory; @@ -138,7 +138,7 @@ String getLabel(final Element element) { return (name != null ? name : getDefaultName()); } - String getName(final Element element) { + String getName(final Element element) { final TextPropertyProvider provider = textPropertyProviderFactory.getProvider(element); return provider.getText(element); } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorItemFactory.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorItemFactory.java similarity index 80% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorItemFactory.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorItemFactory.java index 0f2bc0e50c3..e5664e4452e 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorItemFactory.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorItemFactory.java @@ -14,18 +14,18 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.factories; +package org.kie.workbench.common.dmn.client.docks.navigator.factories; import javax.enterprise.context.Dependent; import javax.inject.Inject; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem; import org.kie.workbench.common.stunner.core.graph.Edge; import org.kie.workbench.common.stunner.core.graph.Node; import org.kie.workbench.common.stunner.core.graph.content.view.View; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.ITEM; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.ROOT; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.ITEM; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.ROOT; @Dependent public class DecisionNavigatorItemFactory { diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorNestedItemFactory.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorNestedItemFactory.java similarity index 88% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorNestedItemFactory.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorNestedItemFactory.java index df91d2a2fdd..f1690b40f4a 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorNestedItemFactory.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorNestedItemFactory.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.factories; +package org.kie.workbench.common.dmn.client.docks.navigator.factories; import java.util.Map; import java.util.Optional; @@ -38,8 +38,8 @@ import org.kie.workbench.common.dmn.api.definition.model.Relation; import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; import org.kie.workbench.common.dmn.client.common.BoxedExpressionHelper; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorPresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorPresenter; import org.kie.workbench.common.dmn.client.editors.expressions.types.ExpressionEditorDefinitions; import org.kie.workbench.common.dmn.client.events.EditExpressionEvent; import org.kie.workbench.common.stunner.core.client.api.SessionManager; @@ -51,13 +51,13 @@ import org.kie.workbench.common.stunner.core.graph.content.view.View; import org.uberfire.mvp.Command; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.CONTEXT; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.DECISION_TABLE; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.FUNCTION_DEFINITION; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.INVOCATION; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.LIST; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.LITERAL_EXPRESSION; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.RELATION; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.CONTEXT; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.DECISION_TABLE; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.FUNCTION_DEFINITION; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.INVOCATION; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.LIST; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.LITERAL_EXPRESSION; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.RELATION; @Dependent public class DecisionNavigatorNestedItemFactory { diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponent.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponent.java similarity index 96% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponent.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponent.java index 9c4d1d17ae1..1a3388c7355 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponent.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponent.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.included.components; +package org.kie.workbench.common.dmn.client.docks.navigator.included.components; import java.util.Map; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentFilter.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentFilter.java similarity index 96% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentFilter.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentFilter.java index 9ff5ab6c5d0..ed45df15777 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentFilter.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentFilter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.included.components; +package org.kie.workbench.common.dmn.client.docks.navigator.included.components; import java.util.Objects; import java.util.Optional; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponents.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponents.java similarity index 98% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponents.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponents.java index 84be8ec9de9..9c394b991cd 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponents.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponents.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.included.components; +package org.kie.workbench.common.dmn.client.docks.navigator.included.components; import java.util.ArrayList; import java.util.Comparator; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItem.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItem.java similarity index 96% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItem.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItem.java index a6be2d07907..2a951863c95 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItem.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItem.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.included.components; +package org.kie.workbench.common.dmn.client.docks.navigator.included.components; import javax.annotation.PostConstruct; import javax.enterprise.context.Dependent; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItemView.html b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItemView.html similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItemView.html rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItemView.html diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItemView.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItemView.java similarity index 93% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItemView.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItemView.java index 789a076135c..d68659cf0ee 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItemView.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItemView.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.included.components; +package org.kie.workbench.common.dmn.client.docks.navigator.included.components; import java.util.Map; import java.util.Optional; @@ -164,11 +164,11 @@ Map getNsContext() { final Optional diagram = Optional.of(dmnGraphUtils.getDiagram()); return diagram.map(dmnGraphUtils::getDefinitions) - .map(DMNModelInstrumentedBase::getNsContext) - .orElseThrow(UnsupportedOperationException::new); + .map(DMNModelInstrumentedBase::getNsContext) + .orElseThrow(UnsupportedOperationException::new); } - Graph getGraph(){ + Graph getGraph() { final Diagram diagram = sessionManager.getCurrentSession().getCanvasHandler().getDiagram(); return diagram.getGraph(); } @@ -235,12 +235,12 @@ private boolean isDuplicatedNode(final DRGElement drgElement) { final Graph graph = getGraph(); return StreamSupport - .stream(graph.nodes().spliterator(), false) - .filter(node -> node.getContent() instanceof View) - .map(node -> (View) node.getContent()) - .filter(view -> view.getDefinition() instanceof DMNElement) - .map(Definition::getDefinition) - .anyMatch(d -> ((DMNElement) d).getId().getValue().equals(id)); + .stream(graph.nodes().spliterator(), false) + .filter(node -> node.getContent() instanceof View) + .map(node -> (View) node.getContent()) + .filter(view -> view.getDefinition() instanceof DMNElement) + .map(Definition::getDefinition) + .anyMatch(d -> ((DMNElement) d).getId().getValue().equals(id)); } return false; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItemView.less b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItemView.less similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItemView.less rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItemView.less diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsView.html b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsView.html similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsView.html rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsView.html diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsView.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsView.java similarity index 98% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsView.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsView.java index 60ac9d42abd..1e642bba952 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsView.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsView.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.included.components; +package org.kie.workbench.common.dmn.client.docks.navigator.included.components; import javax.annotation.PostConstruct; import javax.enterprise.context.Dependent; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsView.less b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsView.less similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsView.less rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsView.less diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreePresenter.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreePresenter.java similarity index 95% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreePresenter.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreePresenter.java index b11fd08b266..c5e04142548 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreePresenter.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreePresenter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.tree; +package org.kie.workbench.common.dmn.client.docks.navigator.tree; import java.util.Collection; import java.util.HashMap; @@ -27,10 +27,10 @@ import javax.enterprise.context.Dependent; import javax.inject.Inject; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem; import org.uberfire.client.mvp.UberElemental; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.ROOT; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.ROOT; @Dependent public class DecisionNavigatorTreePresenter { diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreeView.html b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreeView.html similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreeView.html rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreeView.html diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreeView.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreeView.java similarity index 98% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreeView.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreeView.java index b006fe715d5..d9d2cea63ee 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreeView.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreeView.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.tree; +package org.kie.workbench.common.dmn.client.docks.navigator.tree; import java.util.Collection; import java.util.List; @@ -36,7 +36,7 @@ import org.jboss.errai.ui.shared.api.annotations.DataField; import org.jboss.errai.ui.shared.api.annotations.EventHandler; import org.jboss.errai.ui.shared.api.annotations.Templated; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem; import org.kie.workbench.common.dmn.client.editors.common.RemoveHelper; import org.uberfire.client.views.pfly.selectpicker.ElementHelper; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreeView.less b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreeView.less similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreeView.less rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreeView.less diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/screens/PreviewDiagramScreen.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/preview/PreviewDiagramScreen.java similarity index 96% rename from kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/screens/PreviewDiagramScreen.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/preview/PreviewDiagramScreen.java index 8d17bfaa282..1292bdb4f72 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/screens/PreviewDiagramScreen.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/preview/PreviewDiagramScreen.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.workbench.common.dmn.project.client.docks.screens; +package org.kie.workbench.common.dmn.client.docks.preview; import java.util.Objects; import java.util.logging.Level; @@ -22,11 +22,11 @@ import javax.enterprise.context.Dependent; import javax.enterprise.event.Observes; import javax.enterprise.inject.Any; -import javax.enterprise.inject.Default; import javax.inject.Inject; import com.google.gwt.user.client.ui.IsWidget; import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; import org.kie.workbench.common.stunner.client.widgets.canvas.StunnerBoundsProviderFactory; import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionDiagramPreview; import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionViewer; @@ -75,7 +75,7 @@ protected PreviewDiagramScreen() { @Inject public PreviewDiagramScreen(final SessionManager clientSessionManager, - final @Any @Default ManagedInstance> sessionPreviews, + final @Any @DMNEditor ManagedInstance> sessionPreviews, final View view) { this.clientSessionManager = clientSessionManager; this.sessionPreviews = sessionPreviews; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/screens/PreviewDiagramScreenView.css b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/preview/PreviewDiagramScreenView.css similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/screens/PreviewDiagramScreenView.css rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/preview/PreviewDiagramScreenView.css diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/screens/PreviewDiagramScreenView.html b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/preview/PreviewDiagramScreenView.html similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/screens/PreviewDiagramScreenView.html rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/preview/PreviewDiagramScreenView.html diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/screens/PreviewDiagramScreenView.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/preview/PreviewDiagramScreenView.java similarity index 95% rename from kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/screens/PreviewDiagramScreenView.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/preview/PreviewDiagramScreenView.java index 2015c9e8a44..76f2974c849 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/screens/PreviewDiagramScreenView.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/docks/preview/PreviewDiagramScreenView.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.project.client.docks.screens; +package org.kie.workbench.common.dmn.client.docks.preview; import javax.enterprise.context.Dependent; import javax.inject.Inject; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditor.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditor.java index 6cb6857d22c..ee5b0993420 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditor.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditor.java @@ -24,7 +24,7 @@ import org.kie.workbench.common.dmn.api.definition.HasName; import org.kie.workbench.common.dmn.api.definition.model.Definitions; import org.kie.workbench.common.dmn.api.property.dmn.Name; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorPresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorPresenter; import org.kie.workbench.common.dmn.client.editors.toolbar.ToolbarStateHandler; import org.kie.workbench.common.dmn.client.graph.DMNGraphUtils; import org.kie.workbench.common.dmn.client.session.DMNSession; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditorControlImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditorControlImpl.java index 25ccb443a81..cad00bd0478 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditorControlImpl.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditorControlImpl.java @@ -24,7 +24,7 @@ import javax.enterprise.event.Observes; import javax.inject.Inject; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorPresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorPresenter; import org.kie.workbench.common.dmn.client.graph.DMNGraphUtils; import org.kie.workbench.common.dmn.client.session.DMNSession; import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvas; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/expressions/types/function/supplementary/pmml/PMMLDocumentMetadataProvider.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/expressions/types/function/supplementary/pmml/PMMLDocumentMetadataProvider.java index e08e848eb63..05f61392ef7 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/expressions/types/function/supplementary/pmml/PMMLDocumentMetadataProvider.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/expressions/types/function/supplementary/pmml/PMMLDocumentMetadataProvider.java @@ -35,7 +35,7 @@ import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; import org.kie.workbench.common.dmn.api.editors.included.PMMLIncludedModel; import org.kie.workbench.common.dmn.api.editors.included.PMMLModelMetadata; -import org.kie.workbench.common.dmn.client.decision.events.RefreshDecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.events.RefreshDecisionComponents; import org.kie.workbench.common.dmn.client.graph.DMNGraphUtils; import org.kie.workbench.common.dmn.client.service.DMNClientServicesProxy; import org.kie.workbench.common.stunner.core.client.api.SessionManager; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/BaseCardComponent.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/BaseCardComponent.java index 28f9f0b5d0e..789c04ce760 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/BaseCardComponent.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/BaseCardComponent.java @@ -25,7 +25,7 @@ import com.google.gwt.event.dom.client.ClickEvent; import elemental2.dom.HTMLElement; import org.jboss.errai.ui.client.local.api.elemental2.IsElement; -import org.kie.workbench.common.dmn.client.decision.events.RefreshDecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.events.RefreshDecisionComponents; import org.kie.workbench.common.dmn.client.editors.included.BaseIncludedModelActiveRecord; import org.kie.workbench.common.widgets.client.cards.CardComponent; import org.uberfire.client.mvp.UberElemental; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/DMNCardComponent.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/DMNCardComponent.java index 23f8ebd29a4..33611afe17e 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/DMNCardComponent.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/DMNCardComponent.java @@ -20,7 +20,7 @@ import javax.enterprise.event.Event; import javax.inject.Inject; -import org.kie.workbench.common.dmn.client.decision.events.RefreshDecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.events.RefreshDecisionComponents; import org.kie.workbench.common.dmn.client.editors.included.DMNIncludedModelActiveRecord; public class DMNCardComponent extends BaseCardComponent { diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/DefaultCardComponent.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/DefaultCardComponent.java index 9cbb9f5610d..a0aaf85d4c8 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/DefaultCardComponent.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/DefaultCardComponent.java @@ -22,7 +22,7 @@ import javax.enterprise.inject.Default; import javax.inject.Inject; -import org.kie.workbench.common.dmn.client.decision.events.RefreshDecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.events.RefreshDecisionComponents; import org.kie.workbench.common.dmn.client.editors.included.DefaultIncludedModelActiveRecord; @Dependent diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/PMMLCardComponent.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/PMMLCardComponent.java index a1fe2f026bd..41c8b456b55 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/PMMLCardComponent.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/grid/PMMLCardComponent.java @@ -20,7 +20,7 @@ import javax.enterprise.event.Event; import javax.inject.Inject; -import org.kie.workbench.common.dmn.client.decision.events.RefreshDecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.events.RefreshDecisionComponents; import org.kie.workbench.common.dmn.client.editors.included.PMMLIncludedModelActiveRecord; public class PMMLCardComponent extends BaseCardComponent { diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/imports/IncludedModelsPageStateProviderImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/imports/IncludedModelsPageStateProviderImpl.java index 164453a6fe6..fda2e9e09ef 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/imports/IncludedModelsPageStateProviderImpl.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/imports/IncludedModelsPageStateProviderImpl.java @@ -44,6 +44,10 @@ public class IncludedModelsPageStateProviderImpl implements IncludedModelsPageSt private Diagram diagram; + public IncludedModelsPageStateProviderImpl() { + this(null, null); + } + @Inject public IncludedModelsPageStateProviderImpl(final DMNGraphUtils dmnGraphUtils, final IncludedModelsFactory factory) { diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/modal/IncludedModelModal.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/modal/IncludedModelModal.java index 1e787e46b12..7b0dfff1ddc 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/modal/IncludedModelModal.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/modal/IncludedModelModal.java @@ -31,7 +31,7 @@ import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; import org.kie.workbench.common.dmn.api.editors.included.DMNImportTypes; import org.kie.workbench.common.dmn.client.api.included.legacy.DMNIncludeModelsClient; -import org.kie.workbench.common.dmn.client.decision.events.RefreshDecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.events.RefreshDecisionComponents; import org.kie.workbench.common.dmn.client.editors.included.BaseIncludedModelActiveRecord; import org.kie.workbench.common.dmn.client.editors.included.DMNIncludedModelActiveRecord; import org.kie.workbench.common.dmn.client.editors.included.DefaultIncludedModelActiveRecord; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/modal/dropdown/DMNAssetsDropdown.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/modal/dropdown/DMNAssetsDropdown.java index 1cc9e7a7ba1..44c3546bfa2 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/modal/dropdown/DMNAssetsDropdown.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/included/modal/dropdown/DMNAssetsDropdown.java @@ -19,16 +19,16 @@ import javax.enterprise.context.Dependent; import javax.inject.Inject; -import org.kie.workbench.common.widgets.client.assets.dropdown.SubmarineKieAssetsDropdown; -import org.kie.workbench.common.widgets.client.submarine.IsSubmarine; +import org.kie.workbench.common.widgets.client.assets.dropdown.KogitoKieAssetsDropdown; +import org.kie.workbench.common.widgets.client.kogito.IsKogito; @Dependent -public class DMNAssetsDropdown extends SubmarineKieAssetsDropdown { +public class DMNAssetsDropdown extends KogitoKieAssetsDropdown { @Inject public DMNAssetsDropdown(final View view, - final IsSubmarine isSubmarine, + final IsKogito isKogito, final DMNAssetsDropdownItemsProvider dataProvider) { - super(view, isSubmarine, dataProvider); + super(view, isKogito, dataProvider); } } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/DataTypePickerWidget.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/DataTypePickerWidget.java index 1d6dbe84825..2151d4551b5 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/DataTypePickerWidget.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/DataTypePickerWidget.java @@ -148,7 +148,7 @@ public void setDMNModel(final DMNModelInstrumentedBase dmnModel) { populateTypeSelector(); } - void populateTypeSelector(){ + void populateTypeSelector() { typeSelector.clear(); addBuiltInTypes(); diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/common/DurationHelper.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/common/DurationHelper.java index 8f908f00647..a0bd5fb779d 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/common/DurationHelper.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/common/DurationHelper.java @@ -32,9 +32,9 @@ public static String addFunctionCall(final String value) { public static String getFunctionParameter(final String rawValue) { return rawValue.replace(PREFIX, "") - .replace(CLOSE_BRACKET, "") - .replace(OPEN_BRACKET, "") - .replace(" ", "") - .replace(QUOTE, ""); + .replace(CLOSE_BRACKET, "") + .replace(OPEN_BRACKET, "") + .replace(" ", "") + .replace(QUOTE, ""); } } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/date/DateSelectorView.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/date/DateSelectorView.java index a0ec1609fc7..54b24d1547c 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/date/DateSelectorView.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/date/DateSelectorView.java @@ -73,7 +73,7 @@ JSONObject makeJsonObject() { @Override public String getValue() { - return StringUtils.isEmpty(dateInput.value) ? "" : valueFormatter.toRaw(dateInput.value); + return StringUtils.isEmpty(dateInput.value) ? "" : valueFormatter.toRaw(dateInput.value); } @Override diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/day/time/DayTimeValueConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/day/time/DayTimeValueConverter.java index b6453329952..0b433cc1a07 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/day/time/DayTimeValueConverter.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/day/time/DayTimeValueConverter.java @@ -78,9 +78,9 @@ String toDisplayValue(final String dmnString) { final String secondsLabel = pluralize(value.getSeconds(), DayTimeValueConverter_Second, DayTimeValueConverter_Seconds); return Stream - .of(daysLabel, hoursLabel, minutesLabel, secondsLabel) - .filter(e -> !isEmpty(e)) - .collect(Collectors.joining(", ")); + .of(daysLabel, hoursLabel, minutesLabel, secondsLabel) + .filter(e -> !isEmpty(e)) + .collect(Collectors.joining(", ")); } private JavaScriptObject makeProperties(final Integer days, diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/time/TimeSelectorView.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/time/TimeSelectorView.java index 18d537fa0f0..f7f1a29f8ea 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/time/TimeSelectorView.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/types/listview/constraint/common/typed/time/TimeSelectorView.java @@ -364,7 +364,7 @@ void refreshToggleTimeZoneIcon() { public boolean isChildOfView(final Object element) { final Element viewElement = getElement(); - return viewElement.contains((Element)element); + return viewElement.contains((Element) element); } @Override diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/resources/i18n/DMNEditorConstants.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/resources/i18n/DMNEditorConstants.java index f0ba3e8c88a..53dac73f8d2 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/resources/i18n/DMNEditorConstants.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/resources/i18n/DMNEditorConstants.java @@ -450,4 +450,7 @@ public class DMNEditorConstants { @TranslationKey(defaultValue = "") public static final String DMNDocumentationFactory_Structure = "DMNDocumentationFactory.Structure"; + + @TranslationKey(defaultValue = "") + public static final String DMNPreviewDiagramDock_Title = "DMNPreviewDiagramDock.Title"; } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/service/DMNClientServicesProxy.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/service/DMNClientServicesProxy.java index f8f1c86b3ab..46dc403c5a6 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/service/DMNClientServicesProxy.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/service/DMNClientServicesProxy.java @@ -33,7 +33,7 @@ /** * This is a proxy for the single provider of (external) services required by the Editor. * An external service is one that may require an RPC in some environments (e.g. Business Central) however may be - * substituted for client-side implementations in other environments (e.g. Submarine). + * substituted for client-side implementations in other environments (e.g. Kogito). */ public interface DMNClientServicesProxy { diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/widgets/toolbar/DMNEditorToolbar.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/widgets/toolbar/DMNEditorToolbar.java index 308e3970d1e..9eff6fe798c 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/widgets/toolbar/DMNEditorToolbar.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/widgets/toolbar/DMNEditorToolbar.java @@ -128,6 +128,10 @@ public SaveToolbarCommand getSaveToolbarCommand() { return (SaveToolbarCommand) toolbar.getCommand(13); } + public DMNPerformAutomaticLayoutToolbarCommand getPerformAutomaticLayoutToolbarCommand() { + return (DMNPerformAutomaticLayoutToolbarCommand) toolbar.getCommand(14); + } + @Override protected ManagedToolbar getDelegate() { return toolbar; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/resources/org/kie/workbench/common/dmn/DMNClient.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/resources/org/kie/workbench/common/dmn/DMNClient.gwt.xml index ace9601a954..0eb8f3f15ed 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/resources/org/kie/workbench/common/dmn/DMNClient.gwt.xml +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/resources/org/kie/workbench/common/dmn/DMNClient.gwt.xml @@ -26,6 +26,7 @@ + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/resources/org/kie/workbench/common/dmn/client/resources/i18n/DMNClientConstants.properties b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/resources/org/kie/workbench/common/dmn/client/resources/i18n/DMNClientConstants.properties index a81bc2dcbc3..ccba114c45e 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/resources/org/kie/workbench/common/dmn/client/resources/i18n/DMNClientConstants.properties +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/resources/org/kie/workbench/common/dmn/client/resources/i18n/DMNClientConstants.properties @@ -278,4 +278,5 @@ DMNDocumentationFactory.Constraints=Constraints: DMNDocumentationFactory.ListYes=List: Yes DMNDocumentationFactory.Structure=Structure DMNDocumentationView.Print=Print +DMNPreviewDiagramDock.Title=Preview DMNDocumentationView.DownloadHtmlFile=Download .HTML file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorChildrenTraverseTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorChildrenTraverseTest.java similarity index 96% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorChildrenTraverseTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorChildrenTraverseTest.java index 9d3cee1a34e..2873d7f7e41 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorChildrenTraverseTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorChildrenTraverseTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision; +package org.kie.workbench.common.dmn.client.docks.navigator; import java.util.ArrayList; import java.util.Arrays; @@ -26,7 +26,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kie.workbench.common.dmn.client.decision.factories.DecisionNavigatorItemFactory; +import org.kie.workbench.common.dmn.client.docks.navigator.factories.DecisionNavigatorItemFactory; import org.kie.workbench.common.stunner.core.graph.Edge; import org.kie.workbench.common.stunner.core.graph.Graph; import org.kie.workbench.common.stunner.core.graph.Node; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorDockTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorDockTest.java similarity index 97% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorDockTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorDockTest.java index e296edbaa26..664bf946e6f 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorDockTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorDockTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision; +package org.kie.workbench.common.dmn.client.docks.navigator; import com.google.gwtmockito.GwtMockitoTestRunner; import org.gwtbootstrap3.client.ui.constants.IconType; @@ -31,7 +31,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorDock.DOCK_SIZE; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorDock.DOCK_SIZE; import static org.kie.workbench.common.dmn.client.resources.i18n.DMNEditorConstants.DecisionNavigatorPresenter_DecisionNavigator; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doReturn; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorItemTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorItemTest.java similarity index 94% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorItemTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorItemTest.java index 3c2821faeca..55d43968434 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorItemTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorItemTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision; +package org.kie.workbench.common.dmn.client.docks.navigator; import java.util.Collections; import java.util.TreeSet; @@ -25,8 +25,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.CONTEXT; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.ITEM; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.CONTEXT; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.ITEM; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorObserverTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorObserverTest.java similarity index 98% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorObserverTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorObserverTest.java index 4000af60e3a..1d99ff0314c 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorObserverTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorObserverTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision; +package org.kie.workbench.common.dmn.client.docks.navigator; import java.util.Arrays; import java.util.Optional; @@ -27,7 +27,7 @@ import org.kie.workbench.common.dmn.api.definition.HasName; import org.kie.workbench.common.dmn.api.definition.model.Expression; import org.kie.workbench.common.dmn.api.property.dmn.Id; -import org.kie.workbench.common.dmn.client.decision.tree.DecisionNavigatorTreePresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.tree.DecisionNavigatorTreePresenter; import org.kie.workbench.common.dmn.client.events.EditExpressionEvent; import org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorChanged; import org.kie.workbench.common.stunner.core.client.canvas.Canvas; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorPresenterTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorPresenterTest.java similarity index 96% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorPresenterTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorPresenterTest.java index 791a2091e00..e67fe4f7ae2 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorPresenterTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorPresenterTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision; +package org.kie.workbench.common.dmn.client.docks.navigator; import java.util.ArrayList; import java.util.List; @@ -25,10 +25,10 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kie.workbench.common.dmn.client.decision.events.RefreshDecisionComponents; -import org.kie.workbench.common.dmn.client.decision.factories.DecisionNavigatorItemFactory; -import org.kie.workbench.common.dmn.client.decision.included.components.DecisionComponents; -import org.kie.workbench.common.dmn.client.decision.tree.DecisionNavigatorTreePresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.events.RefreshDecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.factories.DecisionNavigatorItemFactory; +import org.kie.workbench.common.dmn.client.docks.navigator.included.components.DecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.tree.DecisionNavigatorTreePresenter; import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.graph.Edge; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorViewTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorViewTest.java similarity index 89% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorViewTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorViewTest.java index 20907805788..51fbaac0c81 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/DecisionNavigatorViewTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/DecisionNavigatorViewTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision; +package org.kie.workbench.common.dmn.client.docks.navigator; import com.google.gwtmockito.GwtMockitoTestRunner; import elemental2.dom.HTMLDivElement; @@ -22,8 +22,8 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kie.workbench.common.dmn.client.decision.included.components.DecisionComponents; -import org.kie.workbench.common.dmn.client.decision.tree.DecisionNavigatorTreePresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.included.components.DecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.tree.DecisionNavigatorTreePresenter; import org.mockito.Mock; import static org.mockito.Mockito.mock; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorBaseItemFactoryTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorBaseItemFactoryTest.java similarity index 97% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorBaseItemFactoryTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorBaseItemFactoryTest.java index 9e46f7d173e..c60c864e603 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorBaseItemFactoryTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorBaseItemFactoryTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.factories; +package org.kie.workbench.common.dmn.client.docks.navigator.factories; import java.util.Collections; import java.util.List; @@ -27,8 +27,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.kie.workbench.common.dmn.api.definition.model.DMNDiagram; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorPresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorPresenter; import org.kie.workbench.common.stunner.core.api.DefinitionManager; import org.kie.workbench.common.stunner.core.client.canvas.Canvas; import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; @@ -54,7 +54,7 @@ import static java.util.Collections.singletonList; import static java.util.Optional.empty; import static org.junit.Assert.assertEquals; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.ITEM; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.ITEM; import static org.kie.workbench.common.dmn.client.resources.i18n.DMNEditorConstants.DecisionNavigatorBaseItemFactory_NoName; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorItemFactoryTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorItemFactoryTest.java similarity index 84% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorItemFactoryTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorItemFactoryTest.java index 05d3e6c0f11..46da2639c5a 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorItemFactoryTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorItemFactoryTest.java @@ -14,21 +14,21 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.factories; +package org.kie.workbench.common.dmn.client.docks.navigator.factories; import com.google.gwtmockito.GwtMockitoTestRunner; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem; import org.kie.workbench.common.stunner.core.graph.Edge; import org.kie.workbench.common.stunner.core.graph.Node; import org.kie.workbench.common.stunner.core.graph.content.view.View; import org.mockito.Mock; import static org.junit.Assert.assertEquals; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.ITEM; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.ROOT; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.ITEM; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.ROOT; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorNestedItemFactoryTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorNestedItemFactoryTest.java similarity index 96% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorNestedItemFactoryTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorNestedItemFactoryTest.java index 7b9c871e083..ddab8d2a916 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/factories/DecisionNavigatorNestedItemFactoryTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/factories/DecisionNavigatorNestedItemFactoryTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.factories; +package org.kie.workbench.common.dmn.client.docks.navigator.factories; import java.util.Optional; import java.util.function.Supplier; @@ -29,8 +29,8 @@ import org.kie.workbench.common.dmn.api.definition.model.Expression; import org.kie.workbench.common.dmn.api.property.dmn.Id; import org.kie.workbench.common.dmn.client.common.BoxedExpressionHelper; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorPresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorPresenter; import org.kie.workbench.common.dmn.client.editors.expressions.types.ExpressionEditorDefinition; import org.kie.workbench.common.dmn.client.editors.expressions.types.ExpressionEditorDefinitions; import org.kie.workbench.common.dmn.client.events.EditExpressionEvent; @@ -48,7 +48,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.DECISION_TABLE; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.DECISION_TABLE; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentFilterTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentFilterTest.java similarity index 99% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentFilterTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentFilterTest.java index ab41b669559..67ff59fd996 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentFilterTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentFilterTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.included.components; +package org.kie.workbench.common.dmn.client.docks.navigator.included.components; import java.util.List; import java.util.stream.Collectors; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentTest.java similarity index 96% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentTest.java index 0fbcb57acd0..87e49e9b2d4 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.included.components; +package org.kie.workbench.common.dmn.client.docks.navigator.included.components; import com.google.gwtmockito.GwtMockitoTestRunner; import org.junit.Before; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItemTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItemTest.java similarity index 97% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItemTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItemTest.java index 885a4902955..b2c74e006e3 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItemTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItemTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.included.components; +package org.kie.workbench.common.dmn.client.docks.navigator.included.components; import com.google.gwtmockito.GwtMockitoTestRunner; import elemental2.dom.DOMTokenList; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItemViewTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItemViewTest.java similarity index 99% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItemViewTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItemViewTest.java index 5e9fee77c14..e248bba83ca 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsItemViewTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsItemViewTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.included.components; +package org.kie.workbench.common.dmn.client.docks.navigator.included.components; import java.util.ArrayList; import java.util.HashMap; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsTest.java similarity index 99% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsTest.java index c24f6095028..9f7ff9dfb66 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.included.components; +package org.kie.workbench.common.dmn.client.docks.navigator.included.components; import java.util.ArrayList; import java.util.List; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsViewTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsViewTest.java similarity index 98% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsViewTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsViewTest.java index b18febef3f5..22b8a82bc4d 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/included/components/DecisionComponentsViewTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/included/components/DecisionComponentsViewTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.included.components; +package org.kie.workbench.common.dmn.client.docks.navigator.included.components; import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwtmockito.GwtMockitoTestRunner; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreePresenterTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreePresenterTest.java similarity index 96% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreePresenterTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreePresenterTest.java index 426d0f8ad8d..83213678dcc 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreePresenterTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreePresenterTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.tree; +package org.kie.workbench.common.dmn.client.docks.navigator.tree; import java.util.ArrayList; import java.util.Arrays; @@ -28,15 +28,15 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem; import org.mockito.Mock; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.DECISION_TABLE; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.ITEM; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.ROOT; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.DECISION_TABLE; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.ITEM; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.ROOT; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreeViewTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreeViewTest.java similarity index 98% rename from kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreeViewTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreeViewTest.java index b7750c41068..d04c3a034fa 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/decision/tree/DecisionNavigatorTreeViewTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/navigator/tree/DecisionNavigatorTreeViewTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.dmn.client.decision.tree; +package org.kie.workbench.common.dmn.client.docks.navigator.tree; import java.util.ArrayList; import java.util.Collections; @@ -35,14 +35,14 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem; import org.mockito.Mock; import org.uberfire.mvp.Command; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.kie.workbench.common.dmn.client.decision.DecisionNavigatorItem.Type.CONTEXT; +import static org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem.Type.CONTEXT; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/docks/screens/PreviewDiagramScreenTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/preview/PreviewDiagramScreenTest.java similarity index 98% rename from kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/docks/screens/PreviewDiagramScreenTest.java rename to kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/preview/PreviewDiagramScreenTest.java index e4c0911664c..dc575ab96f6 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/docks/screens/PreviewDiagramScreenTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/docks/preview/PreviewDiagramScreenTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.workbench.common.dmn.project.client.docks.screens; +package org.kie.workbench.common.dmn.client.docks.preview; import com.google.gwt.user.client.ui.IsWidget; import com.google.gwtmockito.GwtMockitoTestRunner; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditorControlImplTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditorControlImplTest.java index 5f851e30c46..87b148cee00 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditorControlImplTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditorControlImplTest.java @@ -22,7 +22,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorPresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorPresenter; import org.kie.workbench.common.dmn.client.graph.DMNGraphUtils; import org.kie.workbench.common.dmn.client.session.DMNSession; import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditorTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditorTest.java index cceb5ec6cf3..1b7f47585d5 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditorTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/expressions/ExpressionEditorTest.java @@ -28,7 +28,7 @@ import org.kie.workbench.common.dmn.api.definition.model.Decision; import org.kie.workbench.common.dmn.api.definition.model.Definitions; import org.kie.workbench.common.dmn.api.property.dmn.Name; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorPresenter; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorPresenter; import org.kie.workbench.common.dmn.client.editors.toolbar.ToolbarStateHandler; import org.kie.workbench.common.dmn.client.graph.DMNGraphUtils; import org.kie.workbench.common.dmn.client.session.DMNSession; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/included/grid/BaseCardComponentTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/included/grid/BaseCardComponentTest.java index 23f36a8ea4e..3a52540a2a4 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/included/grid/BaseCardComponentTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/included/grid/BaseCardComponentTest.java @@ -21,7 +21,7 @@ import org.gwtbootstrap3.client.ui.constants.IconType; import org.junit.Before; import org.junit.Test; -import org.kie.workbench.common.dmn.client.decision.events.RefreshDecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.events.RefreshDecisionComponents; import org.kie.workbench.common.dmn.client.editors.included.BaseIncludedModelActiveRecord; import org.kie.workbench.common.dmn.client.editors.included.DMNIncludedModelActiveRecord; import org.mockito.Mock; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/included/modal/IncludedModelModalTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/included/modal/IncludedModelModalTest.java index 49809f614ae..89e347d8fe0 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/included/modal/IncludedModelModalTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/included/modal/IncludedModelModalTest.java @@ -30,7 +30,7 @@ import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; import org.kie.workbench.common.dmn.api.editors.included.DMNImportTypes; import org.kie.workbench.common.dmn.client.api.included.legacy.DMNIncludeModelsClient; -import org.kie.workbench.common.dmn.client.decision.events.RefreshDecisionComponents; +import org.kie.workbench.common.dmn.client.docks.navigator.events.RefreshDecisionComponents; import org.kie.workbench.common.dmn.client.editors.included.BaseIncludedModelActiveRecord; import org.kie.workbench.common.dmn.client.editors.included.DMNIncludedModelActiveRecord; import org.kie.workbench.common.dmn.client.editors.included.IncludedModelsPagePresenter; diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/types/DataTypePickerWidgetTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/types/DataTypePickerWidgetTest.java index ef44dc1c5ed..d4d1a18b432 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/types/DataTypePickerWidgetTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/editors/types/DataTypePickerWidgetTest.java @@ -382,7 +382,7 @@ public void testNormaliseBuiltInTypeTypeRef() { } @Test - public void testPopulateTypeSelector(){ + public void testPopulateTypeSelector() { picker.populateTypeSelector(); diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/graph/DMNGraphUtilsTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/graph/DMNGraphUtilsTest.java index dc66ab997f0..1c6e2a74bae 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/graph/DMNGraphUtilsTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-client/src/test/java/org/kie/workbench/common/dmn/client/graph/DMNGraphUtilsTest.java @@ -29,19 +29,28 @@ import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; import org.kie.workbench.common.stunner.core.client.session.ClientSession; import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.DiagramImpl; +import org.kie.workbench.common.stunner.core.diagram.Metadata; import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; +import org.kie.workbench.common.stunner.core.graph.impl.GraphImpl; +import org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl; +import org.kie.workbench.common.stunner.core.util.UUID; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import static java.util.Arrays.asList; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) public class DMNGraphUtilsTest { + private static final String NAME = "name"; + @Mock private SessionManager sessionManager; @@ -55,15 +64,19 @@ public class DMNGraphUtilsTest { private CanvasHandler canvasHandler; @Mock - private Diagram diagram; + private Metadata metadata; private DMNGraphUtils utils; - @Before - public void setup() { + private GraphImpl graph; - utils = new DMNGraphUtils(sessionManager, dmnDiagramUtils); + private DiagramImpl diagram; + @Before + public void setup() { + this.utils = new DMNGraphUtils(sessionManager, dmnDiagramUtils); + this.graph = new GraphImpl<>(UUID.uuid(), new GraphNodeStoreImpl()); + this.diagram = new DiagramImpl(NAME, graph, metadata); when(sessionManager.getCurrentSession()).thenReturn(clientSession); when(clientSession.getCanvasHandler()).thenReturn(canvasHandler); when(canvasHandler.getDiagram()).thenReturn(diagram); @@ -96,6 +109,11 @@ public void testGetDefinitionsWithDiagram() { assertEquals(expectedDefinitions, actualDefinitions); } + @Test + public void testGetDefinitionsWithNoNodes() { + assertNull(utils.getDefinitions()); + } + @Test public void testGetDiagram() { final Diagram actualDiagram = utils.getDiagram(); diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-api/pom.xml b/kie-wb-common-dmn/kie-wb-common-dmn-project-api/pom.xml index 1f1abb02fb7..bd9ad38918e 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-api/pom.xml +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-api/pom.xml @@ -41,11 +41,6 @@ kie-wb-common-stunner-core-api - - org.kie.workbench.stunner - kie-wb-common-stunner-core-common - - org.kie.workbench.stunner kie-wb-common-stunner-project-api @@ -57,19 +52,6 @@ kie-wb-common-dmn-api - - - junit - junit - test - - - - org.mockito - mockito-core - test - - \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-api/src/main/java/org/kie/workbench/common/dmn/project/api/factory/impl/DMNProjectDiagramFactory.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-api/src/main/java/org/kie/workbench/common/dmn/project/api/factory/impl/DMNProjectDiagramFactory.java index d8d4682ad91..0e7029c0cc6 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-api/src/main/java/org/kie/workbench/common/dmn/project/api/factory/impl/DMNProjectDiagramFactory.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-api/src/main/java/org/kie/workbench/common/dmn/project/api/factory/impl/DMNProjectDiagramFactory.java @@ -17,11 +17,11 @@ import org.kie.workbench.common.dmn.api.factory.DMNFactory; import org.kie.workbench.common.stunner.core.factory.diagram.DiagramFactory; -import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata; +import org.kie.workbench.common.stunner.project.diagram.impl.ProjectDiagramImpl; public interface DMNProjectDiagramFactory extends DMNFactory, - DiagramFactory { + DiagramFactory { } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-api/src/main/java/org/kie/workbench/common/dmn/project/api/factory/impl/DMNProjectDiagramFactoryImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-api/src/main/java/org/kie/workbench/common/dmn/project/api/factory/impl/DMNProjectDiagramFactoryImpl.java index d28b54da0ad..0f8914531d5 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-api/src/main/java/org/kie/workbench/common/dmn/project/api/factory/impl/DMNProjectDiagramFactoryImpl.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-api/src/main/java/org/kie/workbench/common/dmn/project/api/factory/impl/DMNProjectDiagramFactoryImpl.java @@ -22,13 +22,12 @@ import org.kie.workbench.common.stunner.core.diagram.Metadata; import org.kie.workbench.common.stunner.core.graph.Graph; import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; -import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata; import org.kie.workbench.common.stunner.project.diagram.impl.ProjectDiagramImpl; @Dependent public class DMNProjectDiagramFactoryImpl - extends AbstractDMNDiagramFactory + extends AbstractDMNDiagramFactory implements DMNProjectDiagramFactory { @Override @@ -42,9 +41,9 @@ public Class getMetadataType() { } @Override - public ProjectDiagram doBuild(final String name, - final ProjectMetadata metadata, - final Graph graph) { + public ProjectDiagramImpl doBuild(final String name, + final ProjectMetadata metadata, + final Graph graph) { return new ProjectDiagramImpl(name, graph, metadata); diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/pom.xml b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/pom.xml index 7723ebbe334..bbfa83fffc8 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/pom.xml +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/pom.xml @@ -27,11 +27,6 @@ - - org.kie.soup - kie-soup-commons - - org.kie.workbench.screens kie-wb-common-workbench-client @@ -60,29 +55,12 @@ provided - - org.kie.workbench.stunner - kie-wb-common-stunner-lienzo - provided - - org.kie.workbench.stunner kie-wb-common-stunner-widgets provided - - org.kie.workbench.stunner - kie-wb-common-stunner-shapes-api - - - - org.kie.workbench.stunner - kie-wb-common-stunner-shapes-client - provided - - org.kie.workbench.stunner kie-wb-common-stunner-project-api @@ -116,11 +94,6 @@ kie-wb-common-dmn-client - - org.kie.workbench - kie-wb-common-dmn-project-api - - org.kie.workbench.widgets kie-wb-metadata-widget @@ -145,11 +118,6 @@ uberfire-api - - org.uberfire - uberfire-security-api - - org.uberfire uberfire-client-api @@ -165,12 +133,6 @@ uberfire-project-client - - org.uberfire - uberfire-widgets-properties-editor-api - provided - - org.uberfire uberfire-workbench-client @@ -195,11 +157,6 @@ provided - - org.jboss.errai - errai-bus - - org.jboss.errai errai-common @@ -215,16 +172,6 @@ errai-ui - - org.jboss.errai - errai-security-server - - - - org.jboss.errai - errai-data-binding - - com.google.elemental2 elemental2-dom @@ -262,6 +209,13 @@ test-jar + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client + test + test-jar + + org.kie.workbench.stunner kie-wb-common-stunner-client-common diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/DMNDockSupplierImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/DMNDockSupplierImpl.java index 0f857ab73b8..2e2e92d7fb8 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/DMNDockSupplierImpl.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/docks/DMNDockSupplierImpl.java @@ -22,9 +22,9 @@ import javax.enterprise.context.Dependent; import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; -import org.kie.workbench.common.dmn.project.client.docks.screens.PreviewDiagramScreen; +import org.kie.workbench.common.dmn.client.docks.preview.PreviewDiagramScreen; +import org.kie.workbench.common.stunner.kogito.client.screens.DiagramEditorPropertiesScreen; import org.kie.workbench.common.stunner.project.client.docks.StunnerDockSupplier; -import org.kie.workbench.common.stunner.project.client.screens.ProjectDiagramPropertiesScreen; import org.kie.workbench.common.workbench.client.resources.i18n.DefaultWorkbenchConstants; import org.uberfire.client.workbench.docks.UberfireDock; import org.uberfire.client.workbench.docks.UberfireDockPosition; @@ -46,7 +46,7 @@ public Collection getDocks(String perspectiveIdentifier) { result.add(new UberfireDock(UberfireDockPosition.EAST, PROPERTIES_DOCK_ICON, - new DefaultPlaceRequest(ProjectDiagramPropertiesScreen.SCREEN_ID), + new DefaultPlaceRequest(DiagramEditorPropertiesScreen.SCREEN_ID), perspectiveIdentifier).withSize(450).withLabel(constants.DocksStunnerPropertiesTitle())); result.add(new UberfireDock(UberfireDockPosition.EAST, PREVIEW_DOCK_ICON, diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNDiagramEditor.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNDiagramEditor.java index 827aa6387f4..c7faf52356c 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNDiagramEditor.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNDiagramEditor.java @@ -35,7 +35,7 @@ import org.jboss.errai.ioc.client.api.ManagedInstance; import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; import org.kie.workbench.common.dmn.client.commands.general.NavigateToExpressionEditorCommand; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorDock; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorDock; import org.kie.workbench.common.dmn.client.editors.expressions.ExpressionEditorView; import org.kie.workbench.common.dmn.client.editors.included.IncludedModelsPage; import org.kie.workbench.common.dmn.client.editors.included.imports.IncludedModelsPageStateProviderImpl; @@ -68,12 +68,17 @@ import org.kie.workbench.common.stunner.core.rule.RuleViolation; import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; import org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramLoseFocusEvent; import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditor; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramLoseFocusEvent; +import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditorCore; +import org.kie.workbench.common.stunner.project.client.editor.ProjectDiagramEditorProxy; import org.kie.workbench.common.stunner.project.client.screens.ProjectMessagesListener; import org.kie.workbench.common.stunner.project.client.service.ClientProjectDiagramService; import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; +import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata; +import org.kie.workbench.common.stunner.project.diagram.editor.ProjectDiagramResource; import org.kie.workbench.common.stunner.project.service.ProjectDiagramResourceService; import org.kie.workbench.common.widgets.client.search.component.SearchBarComponent; import org.kie.workbench.common.workbench.client.PerspectiveIds; @@ -83,11 +88,8 @@ import org.uberfire.client.annotations.WorkbenchPartTitle; import org.uberfire.client.annotations.WorkbenchPartTitleDecoration; import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.mvp.PlaceManager; import org.uberfire.client.views.pfly.multipage.MultiPageEditorSelectedPageEvent; -import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.ext.editor.commons.client.file.popups.SavePopUpPresenter; import org.uberfire.ext.editor.commons.client.menu.MenuItems; import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; import org.uberfire.lifecycle.OnClose; @@ -98,6 +100,7 @@ import org.uberfire.lifecycle.OnStartup; import org.uberfire.mvp.Command; import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.events.NotificationEvent; import org.uberfire.workbench.model.menu.Menus; import static elemental2.dom.DomGlobal.setTimeout; @@ -109,15 +112,18 @@ public class DMNDiagramEditor extends AbstractProjectDiagramEditor sessionCommandManager; private final Event refreshFormPropertiesEvent; + private final DecisionNavigatorDock decisionNavigatorDock; + private final LayoutHelper layoutHelper; - private final DataTypesPage dataTypesPage; private final OpenDiagramLayoutExecutor openDiagramLayoutExecutor; + private final DataTypesPage dataTypesPage; private final IncludedModelsPage includedModelsPage; private final IncludedModelsPageStateProviderImpl importsPageProvider; private final DMNEditorSearchIndex editorSearchIndex; @@ -125,59 +131,55 @@ public class DMNDiagramEditor extends AbstractProjectDiagramEditor changeTitleNotificationEvent, - final SavePopUpPresenter savePopUpPresenter, - final DMNDiagramResourceType resourceType, - final ClientProjectDiagramService projectDiagramServices, + final TextEditorView xmlEditorView, final ManagedInstance> editorSessionPresenterInstances, final ManagedInstance> viewerSessionPresenterInstances, - final DMNProjectEditorMenuSessionItems menuSessionItems, final Event onDiagramFocusEvent, final Event onDiagramLostFocusEvent, - final Event refreshFormPropertiesEvent, - final ProjectMessagesListener projectMessagesListener, + final Event notificationEvent, + final ErrorPopupPresenter errorPopupPresenter, final DiagramClientErrorHandler diagramClientErrorHandler, + final @DMNEditor DocumentationView documentationView, + final DMNDiagramResourceType resourceType, + final DMNEditorMenuSessionItems menuSessionItems, + final ProjectMessagesListener projectMessagesListener, final ClientTranslationService translationService, - final TextEditorView xmlEditorView, + final ClientProjectDiagramService projectDiagramServices, final Caller projectDiagramResourceServiceCaller, final SessionManager sessionManager, final @Session SessionCommandManager sessionCommandManager, + final Event refreshFormPropertiesEvent, final DecisionNavigatorDock decisionNavigatorDock, final LayoutHelper layoutHelper, - final DataTypesPage dataTypesPage, final OpenDiagramLayoutExecutor openDiagramLayoutExecutor, + final DataTypesPage dataTypesPage, final IncludedModelsPage includedModelsPage, final IncludedModelsPageStateProviderImpl importsPageProvider, final DMNEditorSearchIndex editorSearchIndex, final SearchBarComponent searchBarComponent) { super(view, - documentationView, - placeManager, - errorPopupPresenter, - changeTitleNotificationEvent, - savePopUpPresenter, - resourceType, - projectDiagramServices, + xmlEditorView, editorSessionPresenterInstances, viewerSessionPresenterInstances, - menuSessionItems, onDiagramFocusEvent, onDiagramLostFocusEvent, - projectMessagesListener, + notificationEvent, + errorPopupPresenter, diagramClientErrorHandler, + documentationView, + resourceType, + menuSessionItems, + projectMessagesListener, translationService, - xmlEditorView, + projectDiagramServices, projectDiagramResourceServiceCaller); this.sessionManager = sessionManager; this.sessionCommandManager = sessionCommandManager; this.refreshFormPropertiesEvent = refreshFormPropertiesEvent; this.decisionNavigatorDock = decisionNavigatorDock; this.layoutHelper = layoutHelper; - this.dataTypesPage = dataTypesPage; this.openDiagramLayoutExecutor = openDiagramLayoutExecutor; + this.dataTypesPage = dataTypesPage; this.includedModelsPage = includedModelsPage; this.importsPageProvider = importsPageProvider; this.editorSearchIndex = editorSearchIndex; @@ -193,6 +195,51 @@ public void init() { editorSearchIndex.setIsDataTypesTabActiveSupplier(getIsDataTypesTabActiveSupplier()); } + @Override + protected AbstractProjectDiagramEditorCore> makeCore(final View view, + final TextEditorView xmlEditorView, + final Event notificationEvent, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService) { + return new ProjectDiagramEditorCore(view, + xmlEditorView, + notificationEvent, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService) { + + /** + * Stunner validates diagrams before saving them. If a {@see Violation.Type.ERROR} is reported by the underlying + * validation implementation Stunner prevents saving of the diagram. DMN's validation reports errors for states + * that can be successfully saved as they represent a partially authored diagram. Therefore override Stunners + * behavior and prevent saving of DMN diagrams containing errors. + * @param continueSaveOnceValid + * @return + */ + @Override + protected ClientSessionCommand.Callback>> getSaveAfterValidationCallback(final Command continueSaveOnceValid) { + return new ClientSessionCommand.Callback>>() { + @Override + public void onSuccess() { + continueSaveOnceValid.execute(); + } + + @Override + public void onError(final Collection> violations) { + continueSaveOnceValid.execute(); + } + }; + } + }; + } + @OnStartup public void onStartup(final ObservablePath path, final PlaceRequest place) { @@ -206,7 +253,7 @@ protected String getDiagramParsingErrorMessage(final DiagramParsingException e) } @Override - protected void initialiseKieEditorForSession(final ProjectDiagram diagram) { + public void initialiseKieEditorForSession(final ProjectDiagram diagram) { superInitialiseKieEditorForSession(diagram); kieView.getMultiPage().addPage(dataTypesPage); @@ -281,29 +328,6 @@ public void open(final ProjectDiagram diagram) { super.open(diagram); } - /** - * Stunner validates diagrams before saving them. If a {@see Violation.Type.ERROR} is reported by the underlying - * validation implementation Stunner prevents saving of the diagram. DMN's validation reports errors for states - * that can be successfully saved as they represent a partially authored diagram. Therefore override Stunners - * behavior and prevent saving of DMN diagrams containing errors. - * @param continueSaveOnceValid - * @return - */ - @Override - protected ClientSessionCommand.Callback>> getSaveAfterValidationCallback(final Command continueSaveOnceValid) { - return new ClientSessionCommand.Callback>>() { - @Override - public void onSuccess() { - continueSaveOnceValid.execute(); - } - - @Override - public void onError(final Collection> violations) { - continueSaveOnceValid.execute(); - } - }; - } - @OnOpen public void onOpen() { super.doOpen(); @@ -318,12 +342,12 @@ public void onClose() { } @Override - protected void onDiagramLoad() { + public void onDiagramLoad() { final Optional canvasHandler = Optional.ofNullable(getCanvasHandler()); canvasHandler.ifPresent(c -> { final ExpressionEditorView.Presenter expressionEditor = ((DMNSession) sessionManager.getCurrentSession()).getExpressionEditor(); - expressionEditor.setToolbarStateHandler(new ProjectToolbarStateHandler(getMenuSessionItems())); + expressionEditor.setToolbarStateHandler(new DMNProjectToolbarStateHandler(getMenuSessionItems())); decisionNavigatorDock.setupCanvasHandler(c); dataTypesPage.reload(); includedModelsPage.setup(importsPageProvider.withDiagram(c.getDiagram())); @@ -374,7 +398,7 @@ public boolean onMayClose() { } @Override - protected String getEditorIdentifier() { + public String getEditorIdentifier() { return EDITOR_ID; } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNEditorMenuItemsBuilder.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNEditorMenuItemsBuilder.java new file mode 100644 index 00000000000..d40ac55e7b3 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNEditorMenuItemsBuilder.java @@ -0,0 +1,51 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.project.client.editor; + +import java.util.Optional; + +import javax.enterprise.context.Dependent; +import javax.enterprise.inject.Typed; +import javax.inject.Inject; + +import org.kie.workbench.common.dmn.project.client.resources.i18n.DMNProjectClientConstants; +import org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuItemsBuilder; + +@Dependent +@Typed(DMNEditorMenuItemsBuilder.class) +public class DMNEditorMenuItemsBuilder extends AbstractDiagramEditorMenuItemsBuilder { + + @SuppressWarnings("unused") + protected DMNEditorMenuItemsBuilder() { + //CDI proxy + super(); + } + + @Inject + public DMNEditorMenuItemsBuilder(final ClientTranslationService translationService, + final PopupUtil popupUtil) { + super(translationService, + popupUtil); + } + + @Override + protected Optional getExportLabelToRawFormatIfSupported() { + return Optional.of(translationService.getValue(DMNProjectClientConstants.DMNDiagramResourceTypeDownload)); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNEditorMenuSessionItems.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNEditorMenuSessionItems.java new file mode 100644 index 00000000000..55305dce660 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNEditorMenuSessionItems.java @@ -0,0 +1,81 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.project.client.editor; + +import javax.enterprise.context.Dependent; +import javax.enterprise.inject.Typed; +import javax.inject.Inject; + +import org.gwtbootstrap3.client.ui.Button; +import org.gwtbootstrap3.client.ui.constants.ButtonSize; +import org.gwtbootstrap3.client.ui.constants.IconType; +import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; +import org.kie.workbench.common.dmn.client.widgets.toolbar.DMNPerformAutomaticLayoutCommand; +import org.kie.workbench.common.dmn.project.client.session.DMNEditorSessionCommands; +import org.kie.workbench.common.stunner.client.widgets.menu.MenuUtils; +import org.kie.workbench.common.stunner.core.i18n.CoreTranslationMessages; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; +import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; +import org.uberfire.workbench.model.menu.MenuItem; + +@Dependent +@Typed(DMNEditorMenuSessionItems.class) +public class DMNEditorMenuSessionItems extends AbstractDiagramEditorMenuSessionItems { + + @Inject + public DMNEditorMenuSessionItems(final DMNEditorMenuItemsBuilder itemsBuilder, + final @DMNEditor DMNEditorSessionCommands sessionCommands) { + super(itemsBuilder, + sessionCommands); + } + + @Override + public void populateMenu(final FileMenuBuilder menu) { + superPopulateMenu(menu); + addPerformAutomaticLayout(menu); + } + + void superPopulateMenu(final FileMenuBuilder menu) { + super.populateMenu(menu); + } + + void addPerformAutomaticLayout(final FileMenuBuilder menu) { + final MenuItem performAutomaticLayoutMenuItem = newPerformAutomaticLayout(); + addMenuItem(DMNPerformAutomaticLayoutCommand.class, performAutomaticLayoutMenuItem); + menu.addNewTopLevelMenu(performAutomaticLayoutMenuItem); + } + + MenuItem newPerformAutomaticLayout() { + final MenuUtils.HasEnabledIsWidget buttonWrapper = MenuUtils.buildHasEnabledWidget(new Button() {{ + setSize(ButtonSize.SMALL); + setTitle(getTranslationService().getValue(CoreTranslationMessages.PERFORM_AUTOMATIC_LAYOUT)); + setIcon(IconType.SITEMAP); + addClickHandler(clickEvent -> ((DMNEditorSessionCommands) getCommands()).getPerformAutomaticLayoutCommand().execute()); + }}); + return MenuUtils.buildItem(buttonWrapper); + } + + @Override + public void setEnabled(final boolean enabled) { + superSetEnabled(enabled); + setItemEnabled(DMNPerformAutomaticLayoutCommand.class, enabled); + } + + void superSetEnabled(final boolean enabled) { + super.setEnabled(enabled); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectDiagramEditorMenuItemsBuilder.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectDiagramEditorMenuItemsBuilder.java deleted file mode 100644 index 076cd627c27..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectDiagramEditorMenuItemsBuilder.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.dmn.project.client.editor; - -import javax.enterprise.context.Dependent; -import javax.enterprise.inject.Typed; -import javax.inject.Inject; - -import org.kie.workbench.common.dmn.project.client.resources.i18n.DMNProjectClientConstants; -import org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil; -import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; -import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditorMenuItemsBuilder; - -@Dependent -@Typed(DMNProjectDiagramEditorMenuItemsBuilder.class) -public class DMNProjectDiagramEditorMenuItemsBuilder extends AbstractProjectDiagramEditorMenuItemsBuilder { - - @SuppressWarnings("unused") - protected DMNProjectDiagramEditorMenuItemsBuilder() { - //CDI proxy - super(); - } - - @Inject - public DMNProjectDiagramEditorMenuItemsBuilder(final ClientTranslationService translationService, - final PopupUtil popupUtil) { - super(translationService, - popupUtil); - } - - @Override - protected String getExportAsRawLabel() { - return translationService.getValue(DMNProjectClientConstants.DMNDiagramResourceTypeDownload); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectEditorMenuSessionItems.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectEditorMenuSessionItems.java deleted file mode 100644 index bce9fd6066b..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectEditorMenuSessionItems.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.dmn.project.client.editor; - -import javax.enterprise.context.Dependent; -import javax.enterprise.inject.Typed; -import javax.inject.Inject; - -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.constants.ButtonSize; -import org.gwtbootstrap3.client.ui.constants.IconType; -import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; -import org.kie.workbench.common.dmn.client.widgets.toolbar.DMNPerformAutomaticLayoutCommand; -import org.kie.workbench.common.dmn.project.client.session.DMNEditorSessionCommands; -import org.kie.workbench.common.stunner.client.widgets.menu.MenuUtils; -import org.kie.workbench.common.stunner.core.i18n.CoreTranslationMessages; -import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectEditorMenuSessionItems; -import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; -import org.uberfire.workbench.model.menu.MenuItem; - -@Dependent -@Typed(DMNProjectEditorMenuSessionItems.class) -public class DMNProjectEditorMenuSessionItems extends AbstractProjectEditorMenuSessionItems { - - @Inject - public DMNProjectEditorMenuSessionItems(final DMNProjectDiagramEditorMenuItemsBuilder itemsBuilder, - final @DMNEditor DMNEditorSessionCommands sessionCommands) { - super(itemsBuilder, - sessionCommands); - } - - @Override - public void populateMenu(final FileMenuBuilder menu) { - superPopulateMenu(menu); - addPerformAutomaticLayout(menu); - } - - void superPopulateMenu(final FileMenuBuilder menu) { - super.populateMenu(menu); - } - - void addPerformAutomaticLayout(final FileMenuBuilder menu) { - final MenuItem performAutomaticLayoutMenuItem = newPerformAutomaticLayout(); - addMenuItem(DMNPerformAutomaticLayoutCommand.class, performAutomaticLayoutMenuItem); - menu.addNewTopLevelMenu(performAutomaticLayoutMenuItem); - } - - MenuItem newPerformAutomaticLayout() { - final MenuUtils.HasEnabledIsWidget buttonWrapper = MenuUtils.buildHasEnabledWidget(new Button() {{ - setSize(ButtonSize.SMALL); - setTitle(getTranslationService().getValue(CoreTranslationMessages.PERFORM_AUTOMATIC_LAYOUT)); - setIcon(IconType.SITEMAP); - addClickHandler(clickEvent -> ((DMNEditorSessionCommands) getCommands()).getPerformAutomaticLayoutCommand().execute()); - }}); - return MenuUtils.buildItem(buttonWrapper); - } - - @Override - public void setEnabled(final boolean enabled) { - superSetEnabled(enabled); - setItemEnabled(DMNPerformAutomaticLayoutCommand.class, enabled); - } - - void superSetEnabled(final boolean enabled) { - super.setEnabled(enabled); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectToolbarStateHandler.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectToolbarStateHandler.java new file mode 100644 index 00000000000..1b3073080b0 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectToolbarStateHandler.java @@ -0,0 +1,75 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.project.client.editor; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import org.kie.workbench.common.dmn.client.editors.toolbar.ToolbarStateHandler; +import org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.PerformAutomaticLayoutCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.SwitchGridSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.VisitGraphSessionCommand; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; + +public class DMNProjectToolbarStateHandler implements ToolbarStateHandler { + + private static final Class[] COMMAND_CLASSES = { + ClearSessionCommand.class, + SwitchGridSessionCommand.class, + VisitGraphSessionCommand.class, + DeleteSelectionSessionCommand.class, + CutSelectionSessionCommand.class, + CopySelectionSessionCommand.class, + PasteSelectionSessionCommand.class, + PerformAutomaticLayoutCommand.class + }; + + private final Map, Boolean> commandStates = new HashMap<>(); + + private final AbstractDiagramEditorMenuSessionItems projectEditorMenuSessionItems; + + @SuppressWarnings("unchecked") + public DMNProjectToolbarStateHandler(final AbstractDiagramEditorMenuSessionItems projectEditorMenuSessionItems) { + this.projectEditorMenuSessionItems = projectEditorMenuSessionItems; + + Arrays.asList(COMMAND_CLASSES).forEach(clazz -> commandStates.put(clazz, false)); + } + + @Override + public void enterGridView() { + commandStates.entrySet().forEach(entry -> { + final Class command = entry.getKey(); + entry.setValue(projectEditorMenuSessionItems.isItemEnabled(command)); + projectEditorMenuSessionItems.setItemEnabled(command, false); + }); + } + + @Override + public void enterGraphView() { + commandStates.entrySet().forEach(entry -> { + final Class command = entry.getKey(); + projectEditorMenuSessionItems.setItemEnabled(command, entry.getValue()); + }); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/ProjectToolbarStateHandler.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/ProjectToolbarStateHandler.java deleted file mode 100644 index 93daf69580d..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/editor/ProjectToolbarStateHandler.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.dmn.project.client.editor; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import org.kie.workbench.common.dmn.client.editors.toolbar.ToolbarStateHandler; -import org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.SwitchGridSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.VisitGraphSessionCommand; -import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectEditorMenuSessionItems; - -public class ProjectToolbarStateHandler implements ToolbarStateHandler { - - private static final Class[] COMMAND_CLASSES = { - ClearSessionCommand.class, - SwitchGridSessionCommand.class, - VisitGraphSessionCommand.class, - DeleteSelectionSessionCommand.class, - CutSelectionSessionCommand.class, - CopySelectionSessionCommand.class, - PasteSelectionSessionCommand.class - }; - - private final Map, Boolean> commandStates = new HashMap<>(); - - private final AbstractProjectEditorMenuSessionItems projectEditorMenuSessionItems; - - @SuppressWarnings("unchecked") - public ProjectToolbarStateHandler(final AbstractProjectEditorMenuSessionItems projectEditorMenuSessionItems) { - this.projectEditorMenuSessionItems = projectEditorMenuSessionItems; - - Arrays.asList(COMMAND_CLASSES).forEach(clazz -> commandStates.put(clazz, false)); - } - - @Override - public void enterGridView() { - commandStates.entrySet().forEach(entry -> { - final Class command = entry.getKey(); - entry.setValue(projectEditorMenuSessionItems.isItemEnabled(command)); - projectEditorMenuSessionItems.setItemEnabled(command, false); - }); - } - - @Override - public void enterGraphView() { - commandStates.entrySet().forEach(entry -> { - final Class command = entry.getKey(); - projectEditorMenuSessionItems.setItemEnabled(command, entry.getValue()); - }); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/resources/i18n/DMNProjectClientConstants.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/resources/i18n/DMNProjectClientConstants.java index eb48e74e32b..fae23f288d4 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/resources/i18n/DMNProjectClientConstants.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/resources/i18n/DMNProjectClientConstants.java @@ -31,5 +31,4 @@ public interface DMNProjectClientConstants { @TranslationKey(defaultValue = "") String DMNDiagramParsingErrorMessage = "DMNDiagramParsingErrorMessage"; - } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/session/DMNEditorSessionCommands.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/session/DMNEditorSessionCommands.java index b43fbb489ec..9d124e97a8e 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/session/DMNEditorSessionCommands.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/java/org/kie/workbench/common/dmn/project/client/session/DMNEditorSessionCommands.java @@ -27,10 +27,10 @@ import org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToBpmnSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToJpgSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPdfSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPngSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToRawFormatSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToSvgSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.PerformAutomaticLayoutCommand; @@ -39,7 +39,7 @@ import org.kie.workbench.common.stunner.core.client.session.command.impl.UndoSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ValidateSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.VisitGraphSessionCommand; -import org.kie.workbench.common.stunner.project.client.session.EditorSessionCommands; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; @Dependent @DMNEditor @@ -63,7 +63,7 @@ protected void registerCommands() { .register(ExportToJpgSessionCommand.class) .register(ExportToPdfSessionCommand.class) .register(ExportToSvgSessionCommand.class) - .register(ExportToBpmnSessionCommand.class) + .register(ExportToRawFormatSessionCommand.class) .register(CopySelectionSessionCommand.class) .register(PasteSelectionSessionCommand.class) .register(CutSelectionSessionCommand.class) @@ -72,6 +72,6 @@ protected void registerCommands() { } public PerformAutomaticLayoutCommand getPerformAutomaticLayoutCommand() { - return getCommands().get(16); + return get(DMNPerformAutomaticLayoutCommand.class); } } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/resources/org/kie/workbench/common/dmn/project/DMNProjectClient.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/resources/org/kie/workbench/common/dmn/project/DMNProjectClient.gwt.xml index eae258e6dcb..53d1404f45a 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/resources/org/kie/workbench/common/dmn/project/DMNProjectClient.gwt.xml +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/main/resources/org/kie/workbench/common/dmn/project/DMNProjectClient.gwt.xml @@ -19,8 +19,8 @@ - + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/docks/DMNDockSupplierImplTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/docks/DMNDockSupplierImplTest.java index c32957af678..7ff4b8c6254 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/docks/DMNDockSupplierImplTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/docks/DMNDockSupplierImplTest.java @@ -23,8 +23,8 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kie.workbench.common.dmn.project.client.docks.screens.PreviewDiagramScreen; -import org.kie.workbench.common.stunner.project.client.screens.ProjectDiagramPropertiesScreen; +import org.kie.workbench.common.dmn.client.docks.preview.PreviewDiagramScreen; +import org.kie.workbench.common.stunner.kogito.client.screens.DiagramEditorPropertiesScreen; import org.kie.workbench.common.workbench.client.resources.i18n.DefaultWorkbenchConstants; import org.uberfire.client.workbench.docks.UberfireDock; import org.uberfire.client.workbench.docks.UberfireDockPosition; @@ -55,7 +55,7 @@ public void testDocks() { assertDock(dock1, DMNDockSupplierImpl.PROPERTIES_DOCK_ICON, - ProjectDiagramPropertiesScreen.SCREEN_ID, + DiagramEditorPropertiesScreen.SCREEN_ID, DefaultWorkbenchConstants.INSTANCE.DocksStunnerPropertiesTitle()); assertDock(dock2, diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNDiagramEditorTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNDiagramEditorTest.java index 1ecc552a959..fbbb6d9538d 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNDiagramEditorTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNDiagramEditorTest.java @@ -20,17 +20,20 @@ import java.util.function.Consumer; import java.util.function.Supplier; +import javax.enterprise.event.Event; + import com.google.gwtmockito.GwtMockitoTestRunner; import com.google.gwtmockito.WithClassesToStub; import elemental2.dom.HTMLElement; import org.guvnor.common.services.shared.metadata.model.Overview; import org.jboss.errai.common.client.ui.ElementWrapperWidget; +import org.jboss.errai.ioc.client.api.ManagedInstance; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; import org.kie.workbench.common.dmn.client.commands.general.NavigateToExpressionEditorCommand; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorDock; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorDock; import org.kie.workbench.common.dmn.client.editors.expressions.ExpressionEditorView; import org.kie.workbench.common.dmn.client.editors.included.IncludedModelsPage; import org.kie.workbench.common.dmn.client.editors.included.imports.IncludedModelsPageStateProviderImpl; @@ -44,16 +47,26 @@ import org.kie.workbench.common.dmn.project.client.resources.i18n.DMNProjectClientConstants; import org.kie.workbench.common.dmn.project.client.type.DMNDiagramResourceType; import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; import org.kie.workbench.common.stunner.core.client.api.SessionManager; import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; import org.kie.workbench.common.stunner.core.client.command.SessionCommandManager; import org.kie.workbench.common.stunner.core.client.components.layout.LayoutHelper; import org.kie.workbench.common.stunner.core.client.components.layout.OpenDiagramLayoutExecutor; -import org.kie.workbench.common.stunner.core.client.session.impl.DefaultEditorSession; +import org.kie.workbench.common.stunner.core.client.error.DiagramClientErrorHandler; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; import org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditor; +import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditorCore; import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditorTest; -import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectEditorMenuSessionItems; +import org.kie.workbench.common.stunner.project.client.editor.ProjectDiagramEditorProxy; +import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; +import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata; +import org.kie.workbench.common.stunner.project.diagram.editor.ProjectDiagramResource; import org.kie.workbench.common.widgets.client.docks.DefaultEditorDock; import org.kie.workbench.common.widgets.client.search.component.SearchBarComponent; import org.kie.workbench.common.workbench.client.PerspectiveIds; @@ -62,8 +75,10 @@ import org.mockito.InOrder; import org.mockito.Mock; import org.uberfire.client.views.pfly.multipage.MultiPageEditorSelectedPageEvent; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; import org.uberfire.client.workbench.widgets.multipage.MultiPageEditor; import org.uberfire.ext.editor.commons.client.menu.MenuItems; +import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; import org.uberfire.mocks.EventSourceMock; import org.uberfire.mvp.PlaceRequest; import org.uberfire.mvp.impl.PathPlaceRequest; @@ -104,7 +119,7 @@ public class DMNDiagramEditorTest extends AbstractProjectDiagramEditorTest { private DMNEditorSession dmnEditorSession; @Mock - private DefaultEditorSession defaultEditorSession; + private DMNEditorSession defaultEditorSession; @Mock private SessionCommandManager sessionCommandManager; @@ -122,7 +137,7 @@ public class DMNDiagramEditorTest extends AbstractProjectDiagramEditorTest { private EditExpressionEvent editExpressionEvent; @Mock - private DMNProjectEditorMenuSessionItems dmnProjectMenuSessionItems; + private DMNEditorMenuSessionItems dmnProjectMenuSessionItems; @Mock private LayoutHelper layoutHelper; @@ -173,9 +188,11 @@ public void before() { @Override public void setUp() { super.setUp(); - + when(sessionManager.getCurrentSession()).thenReturn(dmnEditorSession); when(sessionEditorPresenter.getInstance()).thenReturn(dmnEditorSession); when(dmnEditorSession.getExpressionEditor()).thenReturn(expressionEditor); + when(dmnEditorSession.getCanvasHandler()).thenReturn(canvasHandler); + when(canvasHandler.getDiagram()).thenReturn(diagram); when(searchBarComponent.getView()).thenReturn(searchBarComponentView); when(searchBarComponentView.getElement()).thenReturn(searchBarComponentViewElement); } @@ -192,30 +209,28 @@ protected DMNDiagramResourceType mockResourceType() { @Override protected AbstractProjectDiagramEditor createDiagramEditor() { diagramEditor = spy(new DMNDiagramEditor(view, - documentationView, - placeManager, - errorPopupPresenter, - changeTitleNotificationEvent, - savePopUpPresenter, - (DMNDiagramResourceType) getResourceType(), - clientProjectDiagramService, + xmlEditorView, sessionEditorPresenters, sessionViewerPresenters, - (DMNProjectEditorMenuSessionItems) getMenuSessionItems(), onDiagramFocusEvent, onDiagramLostFocusEvent, - refreshFormPropertiesEvent, - projectMessagesListener, + notificationEvent, + errorPopupPresenter, diagramClientErrorHandler, + documentationView, + (DMNDiagramResourceType) getResourceType(), + (DMNEditorMenuSessionItems) getMenuSessionItems(), + projectMessagesListener, translationService, - xmlEditorView, + clientProjectDiagramService, projectDiagramResourceServiceCaller, sessionManager, sessionCommandManager, + refreshFormPropertiesEvent, decisionNavigatorDock, layoutHelper, - dataTypesPage, layoutExecutor, + dataTypesPage, includedModelsPage, importsPageProvider, editorSearchIndex, @@ -230,17 +245,50 @@ protected AbstractProjectDiagramEditor createDiagramEditor() { alertsButtonMenuItemBuilder = DMNDiagramEditorTest.this.alertsButtonMenuItemBuilder; kieView = DMNDiagramEditorTest.this.kieView; overviewWidget = DMNDiagramEditorTest.this.overviewWidget; - notification = DMNDiagramEditorTest.this.notification; + notification = DMNDiagramEditorTest.this.notificationEvent; + placeManager = DMNDiagramEditorTest.this.placeManager; + changeTitleNotification = DMNDiagramEditorTest.this.changeTitleNotificationEvent; + savePopUpPresenter = DMNDiagramEditorTest.this.savePopUpPresenter; } - }); - doReturn(searchBarComponentWidget).when(diagramEditor).getWidget(searchBarComponentViewElement); + @Override + protected AbstractProjectDiagramEditorCore> makeCore(final AbstractProjectDiagramEditor.View view, + final TextEditorView xmlEditorView, + final Event notificationEvent, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService) { + presenterCore = spy(super.makeCore(view, + xmlEditorView, + notificationEvent, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService)); + return presenterCore; + } + + @Override + protected boolean isReadOnly() { + return DMNDiagramEditorTest.this.isReadOnly; + } + + @Override + ElementWrapperWidget getWidget(final HTMLElement element) { + return searchBarComponentWidget; + } + }); return diagramEditor; } @Override - protected AbstractProjectEditorMenuSessionItems getMenuSessionItems() { + protected AbstractDiagramEditorMenuSessionItems getMenuSessionItems() { return dmnProjectMenuSessionItems; } @@ -331,7 +379,7 @@ public void testOnDiagramLoadWhenCanvasHandlerIsNotNull() { final InOrder inOrder = inOrder(decisionNavigatorDock); inOrder.verify(decisionNavigatorDock).setupCanvasHandler(eq(canvasHandler)); - verify(expressionEditor).setToolbarStateHandler(any(ProjectToolbarStateHandler.class)); + verify(expressionEditor).setToolbarStateHandler(any(DMNProjectToolbarStateHandler.class)); verify(dataTypesPage).reload(); verify(layoutHelper).applyLayout(diagram, layoutExecutor); verify(includedModelsPage).setup(importsPageProvider); @@ -342,7 +390,7 @@ public void testOnDiagramLoadWhenCanvasHandlerIsNotNull() { public void testOnDiagramLoadWhenCanvasHandlerIsNull() { diagramEditor.onDiagramLoad(); - verify(expressionEditor, never()).setToolbarStateHandler(any(ProjectToolbarStateHandler.class)); + verify(expressionEditor, never()).setToolbarStateHandler(any(DMNProjectToolbarStateHandler.class)); verify(decisionNavigatorDock, never()).setupCanvasHandler(any()); verify(decisionNavigatorDock, never()).open(); verify(dataTypesPage, never()).reload(); @@ -385,7 +433,6 @@ public void testOnEditExpressionEvent() { @Test public void testOnDataTypePageNavTabActiveEvent() { - diagramEditor.onDataTypePageNavTabActiveEvent(mock(DataTypePageTabActiveEvent.class)); verify(multiPage).selectPage(3); @@ -393,7 +440,6 @@ public void testOnDataTypePageNavTabActiveEvent() { @Test public void testOnDataTypeEditModeToggleWhenEditModeIsEnabled() { - final DataTypeEditModeToggleEvent editModeToggleEvent = mock(DataTypeEditModeToggleEvent.class); doNothing().when(diagramEditor).disableMenuItem(any()); @@ -406,7 +452,6 @@ public void testOnDataTypeEditModeToggleWhenEditModeIsEnabled() { @Test public void testOnDataTypeEditModeToggleWhenEditModeIsNotEnabled() { - final DataTypeEditModeToggleEvent editModeToggleEvent = mock(DataTypeEditModeToggleEvent.class); doNothing().when(diagramEditor).enableMenuItem(any()); @@ -451,7 +496,7 @@ public void testParsingErrorMessage() { openInvalidBPMNFile(xml); final ArgumentCaptor notificationEventCaptor = ArgumentCaptor.forClass(NotificationEvent.class); - verify(notification).fire(notificationEventCaptor.capture()); + verify(notificationEvent).fire(notificationEventCaptor.capture()); final NotificationEvent notificationEvent = notificationEventCaptor.getValue(); assertEquals(DMNProjectClientConstants.DMNDiagramParsingErrorMessage, @@ -473,6 +518,8 @@ public void testOnMultiPageEditorSelectedPageEvent() { when(sessionPresenter.getInstance()).thenReturn(dmnEditorSession); when(sessionManager.getCurrentSession()).thenReturn(dmnEditorSession); + open(); + diagramEditor.onMultiPageEditorSelectedPageEvent(mock(MultiPageEditorSelectedPageEvent.class)); verify(searchBarComponent).disableSearch(); @@ -486,6 +533,9 @@ public void testOnMultiPageEditorSelectedPageEventWhenEditorIsNotInTheSameSessio doReturn(sessionPresenter).when(diagramEditor).getSessionPresenter(); when(sessionPresenter.getInstance()).thenReturn(dmnEditorSession); when(sessionManager.getCurrentSession()).thenReturn(defaultEditorSession); + when(defaultEditorSession.getExpressionEditor()).thenReturn(expressionEditor); + + open(); diagramEditor.onMultiPageEditorSelectedPageEvent(mock(MultiPageEditorSelectedPageEvent.class)); diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNEditorMenuItemsBuilderTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNEditorMenuItemsBuilderTest.java new file mode 100644 index 00000000000..c47daed36eb --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNEditorMenuItemsBuilderTest.java @@ -0,0 +1,54 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.project.client.editor; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.dmn.project.client.resources.i18n.DMNProjectClientConstants; +import org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class DMNEditorMenuItemsBuilderTest { + + @Mock + private ClientTranslationService translationService; + + @Mock + private PopupUtil popupUtil; + + private DMNEditorMenuItemsBuilder builder; + + @Before + public void setup() { + this.builder = new DMNEditorMenuItemsBuilder(translationService, popupUtil); + + when(translationService.getValue(anyString())).thenAnswer(i -> i.getArguments()[0].toString()); + } + + @Test + public void testExportAsRawLabel() { + assertEquals(DMNProjectClientConstants.DMNDiagramResourceTypeDownload, + builder.getExportLabelToRawFormatIfSupported().get()); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNEditorMenuSessionItemsTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNEditorMenuSessionItemsTest.java new file mode 100644 index 00000000000..f86e47268a9 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNEditorMenuSessionItemsTest.java @@ -0,0 +1,78 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.project.client.editor; + +import com.google.gwtmockito.GwtMockitoTestRunner; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.dmn.client.widgets.toolbar.DMNPerformAutomaticLayoutCommand; +import org.kie.workbench.common.dmn.project.client.session.DMNEditorSessionCommands; +import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; +import org.mockito.Mock; +import org.uberfire.workbench.model.menu.MenuItem; + +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; + +@RunWith(GwtMockitoTestRunner.class) +public class DMNEditorMenuSessionItemsTest { + + @Mock + private FileMenuBuilder fileMenuBuilder; + + @Mock + private DMNEditorMenuItemsBuilder builder; + + @Mock + private DMNEditorSessionCommands sessionCommands; + + @Test + public void testPopulateMenu() { + + final DMNEditorMenuSessionItems menuItems = spy(new DMNEditorMenuSessionItems(builder, sessionCommands)); + final MenuItem menuItem = mock(MenuItem.class); + doNothing().when(menuItems).superPopulateMenu(any()); + doReturn(menuItem).when(menuItems).newPerformAutomaticLayout(); + menuItems.populateMenu(fileMenuBuilder); + + verify(menuItems).addPerformAutomaticLayout(any()); + } + + @Test + public void testEnableMenu() { + testMenu(true); + } + + @Test + public void testDisableMenu() { + testMenu(false); + } + + private void testMenu(final boolean enabled) { + + final DMNEditorMenuSessionItems menuItems = spy(new DMNEditorMenuSessionItems(builder, sessionCommands)); + doNothing().when(menuItems).superSetEnabled(enabled); + + menuItems.setEnabled(enabled); + + verify(menuItems).setItemEnabled(DMNPerformAutomaticLayoutCommand.class, enabled); + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectDiagramEditorMenuItemsBuilderTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectDiagramEditorMenuItemsBuilderTest.java deleted file mode 100644 index 69fd5de5481..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectDiagramEditorMenuItemsBuilderTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.project.client.editor; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.dmn.project.client.resources.i18n.DMNProjectClientConstants; -import org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil; -import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class DMNProjectDiagramEditorMenuItemsBuilderTest { - - @Mock - private ClientTranslationService translationService; - - @Mock - private PopupUtil popupUtil; - - private DMNProjectDiagramEditorMenuItemsBuilder builder; - - @Before - public void setup() { - this.builder = new DMNProjectDiagramEditorMenuItemsBuilder(translationService, popupUtil); - - when(translationService.getValue(anyString())).thenAnswer(i -> i.getArguments()[0].toString()); - } - - @Test - public void testExportAsRawLabel() { - assertEquals(DMNProjectClientConstants.DMNDiagramResourceTypeDownload, - builder.getExportAsRawLabel()); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectEditorMenuSessionItemsTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectEditorMenuSessionItemsTest.java deleted file mode 100644 index 0ba322e065d..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectEditorMenuSessionItemsTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.dmn.project.client.editor; - -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.dmn.client.widgets.toolbar.DMNPerformAutomaticLayoutCommand; -import org.kie.workbench.common.dmn.project.client.session.DMNEditorSessionCommands; -import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; -import org.mockito.Mock; -import org.uberfire.workbench.model.menu.MenuItem; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.verify; - -@RunWith(GwtMockitoTestRunner.class) -public class DMNProjectEditorMenuSessionItemsTest { - - @Mock - private FileMenuBuilder fileMenuBuilder; - - @Mock - private DMNProjectDiagramEditorMenuItemsBuilder builder; - - @Mock - private DMNEditorSessionCommands sessionCommands; - - @Test - public void testPopulateMenu() { - - final DMNProjectEditorMenuSessionItems menuItems = spy(new DMNProjectEditorMenuSessionItems(builder, sessionCommands)); - final MenuItem menuItem = mock(MenuItem.class); - doNothing().when(menuItems).superPopulateMenu(any()); - doReturn(menuItem).when(menuItems).newPerformAutomaticLayout(); - menuItems.populateMenu(fileMenuBuilder); - - verify(menuItems).addPerformAutomaticLayout(any()); - } - - @Test - public void testEnableMenu() { - testMenu(true); - } - - @Test - public void testDisableMenu() { - testMenu(false); - } - - private void testMenu(final boolean enabled) { - - final DMNProjectEditorMenuSessionItems menuItems = spy(new DMNProjectEditorMenuSessionItems(builder, sessionCommands)); - doNothing().when(menuItems).superSetEnabled(enabled); - - menuItems.setEnabled(enabled); - - verify(menuItems).setItemEnabled(DMNPerformAutomaticLayoutCommand.class, enabled); - } -} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectToolbarStateHandlerTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectToolbarStateHandlerTest.java new file mode 100644 index 00000000000..0614b4490f3 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/DMNProjectToolbarStateHandlerTest.java @@ -0,0 +1,84 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.project.client.editor; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.SwitchGridSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.VisitGraphSessionCommand; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class DMNProjectToolbarStateHandlerTest { + + @Mock + private DMNEditorMenuSessionItems editorMenuSessionItems; + + private DMNProjectToolbarStateHandler toolbarStateHandler; + + @Before + public void setup() { + this.toolbarStateHandler = new DMNProjectToolbarStateHandler(editorMenuSessionItems); + + when(editorMenuSessionItems.isItemEnabled(ClearSessionCommand.class)).thenReturn(true); + when(editorMenuSessionItems.isItemEnabled(SwitchGridSessionCommand.class)).thenReturn(true); + when(editorMenuSessionItems.isItemEnabled(VisitGraphSessionCommand.class)).thenReturn(true); + when(editorMenuSessionItems.isItemEnabled(DeleteSelectionSessionCommand.class)).thenReturn(true); + when(editorMenuSessionItems.isItemEnabled(CutSelectionSessionCommand.class)).thenReturn(true); + when(editorMenuSessionItems.isItemEnabled(CopySelectionSessionCommand.class)).thenReturn(true); + when(editorMenuSessionItems.isItemEnabled(PasteSelectionSessionCommand.class)).thenReturn(true); + } + + @Test + public void testEnterGridView() { + toolbarStateHandler.enterGridView(); + + verify(editorMenuSessionItems).setItemEnabled(ClearSessionCommand.class, false); + verify(editorMenuSessionItems).setItemEnabled(SwitchGridSessionCommand.class, false); + verify(editorMenuSessionItems).setItemEnabled(VisitGraphSessionCommand.class, false); + verify(editorMenuSessionItems).setItemEnabled(DeleteSelectionSessionCommand.class, false); + verify(editorMenuSessionItems).setItemEnabled(CutSelectionSessionCommand.class, false); + verify(editorMenuSessionItems).setItemEnabled(CopySelectionSessionCommand.class, false); + verify(editorMenuSessionItems).setItemEnabled(PasteSelectionSessionCommand.class, false); + } + + @Test + public void testEnterGraphView() { + //First enter Grid view to retrieve current state + toolbarStateHandler.enterGridView(); + + toolbarStateHandler.enterGraphView(); + + verify(editorMenuSessionItems).setItemEnabled(ClearSessionCommand.class, true); + verify(editorMenuSessionItems).setItemEnabled(SwitchGridSessionCommand.class, true); + verify(editorMenuSessionItems).setItemEnabled(VisitGraphSessionCommand.class, true); + verify(editorMenuSessionItems).setItemEnabled(DeleteSelectionSessionCommand.class, true); + verify(editorMenuSessionItems).setItemEnabled(CutSelectionSessionCommand.class, true); + verify(editorMenuSessionItems).setItemEnabled(CopySelectionSessionCommand.class, true); + verify(editorMenuSessionItems).setItemEnabled(PasteSelectionSessionCommand.class, true); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/ProjectToolbarStateHandlerTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/ProjectToolbarStateHandlerTest.java deleted file mode 100644 index fc058d5e0f1..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/editor/ProjectToolbarStateHandlerTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.dmn.project.client.editor; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.SwitchGridSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.VisitGraphSessionCommand; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class ProjectToolbarStateHandlerTest { - - @Mock - private DMNProjectEditorMenuSessionItems editorMenuSessionItems; - - private ProjectToolbarStateHandler toolbarStateHandler; - - @Before - public void setup() { - this.toolbarStateHandler = new ProjectToolbarStateHandler(editorMenuSessionItems); - - when(editorMenuSessionItems.isItemEnabled(ClearSessionCommand.class)).thenReturn(true); - when(editorMenuSessionItems.isItemEnabled(SwitchGridSessionCommand.class)).thenReturn(true); - when(editorMenuSessionItems.isItemEnabled(VisitGraphSessionCommand.class)).thenReturn(true); - when(editorMenuSessionItems.isItemEnabled(DeleteSelectionSessionCommand.class)).thenReturn(true); - when(editorMenuSessionItems.isItemEnabled(CutSelectionSessionCommand.class)).thenReturn(true); - when(editorMenuSessionItems.isItemEnabled(CopySelectionSessionCommand.class)).thenReturn(true); - when(editorMenuSessionItems.isItemEnabled(PasteSelectionSessionCommand.class)).thenReturn(true); - } - - @Test - public void testEnterGridView() { - toolbarStateHandler.enterGridView(); - - verify(editorMenuSessionItems).setItemEnabled(ClearSessionCommand.class, false); - verify(editorMenuSessionItems).setItemEnabled(SwitchGridSessionCommand.class, false); - verify(editorMenuSessionItems).setItemEnabled(VisitGraphSessionCommand.class, false); - verify(editorMenuSessionItems).setItemEnabled(DeleteSelectionSessionCommand.class, false); - verify(editorMenuSessionItems).setItemEnabled(CutSelectionSessionCommand.class, false); - verify(editorMenuSessionItems).setItemEnabled(CopySelectionSessionCommand.class, false); - verify(editorMenuSessionItems).setItemEnabled(PasteSelectionSessionCommand.class, false); - } - - @Test - public void testEnterGraphView() { - //First enter Grid view to retrieve current state - toolbarStateHandler.enterGridView(); - - toolbarStateHandler.enterGraphView(); - - verify(editorMenuSessionItems).setItemEnabled(ClearSessionCommand.class, true); - verify(editorMenuSessionItems).setItemEnabled(SwitchGridSessionCommand.class, true); - verify(editorMenuSessionItems).setItemEnabled(VisitGraphSessionCommand.class, true); - verify(editorMenuSessionItems).setItemEnabled(DeleteSelectionSessionCommand.class, true); - verify(editorMenuSessionItems).setItemEnabled(CutSelectionSessionCommand.class, true); - verify(editorMenuSessionItems).setItemEnabled(CopySelectionSessionCommand.class, true); - verify(editorMenuSessionItems).setItemEnabled(PasteSelectionSessionCommand.class, true); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/session/DMNEditorSessionCommandsTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/session/DMNEditorSessionCommandsTest.java index ba3564fae4a..b7874141dd8 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/session/DMNEditorSessionCommandsTest.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-project-client/src/test/java/org/kie/workbench/common/dmn/project/client/session/DMNEditorSessionCommandsTest.java @@ -24,10 +24,10 @@ import org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToBpmnSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToJpgSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPdfSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPngSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToRawFormatSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToSvgSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.RedoSessionCommand; @@ -35,8 +35,8 @@ import org.kie.workbench.common.stunner.core.client.session.command.impl.UndoSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ValidateSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.VisitGraphSessionCommand; -import org.kie.workbench.common.stunner.project.client.session.EditorSessionCommands; -import org.kie.workbench.common.stunner.project.client.session.EditorSessionCommandsTest; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommandsTest; import org.mockito.InOrder; import org.mockito.runners.MockitoJUnitRunner; @@ -67,7 +67,7 @@ public void testInit() { inOrder.verify(commands).register(ExportToJpgSessionCommand.class); inOrder.verify(commands).register(ExportToPdfSessionCommand.class); inOrder.verify(commands).register(ExportToSvgSessionCommand.class); - inOrder.verify(commands).register(ExportToBpmnSessionCommand.class); + inOrder.verify(commands).register(ExportToRawFormatSessionCommand.class); inOrder.verify(commands).register(CopySelectionSessionCommand.class); inOrder.verify(commands).register(PasteSelectionSessionCommand.class); inOrder.verify(commands).register(CutSelectionSessionCommand.class); diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/.gitignore b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/.gitignore new file mode 100644 index 00000000000..94ef3ba19a4 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/.gitignore @@ -0,0 +1,15 @@ +/target +/local + +# Eclipse, Netbeans and IntelliJ files +/.* +/**/.* +!.gitignore +/nbproject +*.ipr +*.iws +*.iml + +# Repository wide ignore mac DS_Store files +.DS_Store + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/pom.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/pom.xml new file mode 100644 index 00000000000..a3890e42158 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/pom.xml @@ -0,0 +1,87 @@ + + + + + org.kie.workbench + kie-wb-common-dmn + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-dmn-webapp-common + Kie Workbench - Common - DMN - Webapp Common + Kie Workbench - Common - DMN - Webapp Common + jar + + + org.kie.wb.common.dmn.webapp.common + true + true + + + + + + org.jboss.errai + errai-ui + + + + org.jboss.errai + errai-ioc + + + + org.uberfire + uberfire-workbench-client + + + + org.kie.workbench + kie-wb-common-dmn-client + + + + org.gwtbootstrap3 + gwtbootstrap3 + + + + + + + org.jacoco + jacoco-maven-plugin + + ${code.coverage.disabled} + + + + maven-surefire-plugin + + + ${jacoco.exec.file} + + ${code.coverage.disabled} + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/java/org/kie/workbench/common/dmn/webapp/common/client/docks/preview/PreviewDiagramDock.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/java/org/kie/workbench/common/dmn/webapp/common/client/docks/preview/PreviewDiagramDock.java new file mode 100644 index 00000000000..9cf8aab6092 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/java/org/kie/workbench/common/dmn/webapp/common/client/docks/preview/PreviewDiagramDock.java @@ -0,0 +1,114 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.common.client.docks.preview; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import org.gwtbootstrap3.client.ui.constants.IconType; +import org.jboss.errai.ui.client.local.spi.TranslationService; +import org.kie.workbench.common.dmn.client.docks.preview.PreviewDiagramScreen; +import org.kie.workbench.common.dmn.client.resources.i18n.DMNEditorConstants; +import org.uberfire.client.workbench.docks.UberfireDock; +import org.uberfire.client.workbench.docks.UberfireDockPosition; +import org.uberfire.client.workbench.docks.UberfireDocks; +import org.uberfire.mvp.impl.DefaultPlaceRequest; + +@ApplicationScoped +public class PreviewDiagramDock { + + static final double DOCK_SIZE = 400d; + + private UberfireDocks uberfireDocks; + + private TranslationService translationService; + + private UberfireDock uberfireDock; + + private boolean isOpened = false; + + private String owningPerspectiveId; + + public PreviewDiagramDock() { + // CDI proxy + } + + @Inject + public PreviewDiagramDock(final UberfireDocks uberfireDocks, + final TranslationService translationService) { + this.uberfireDocks = uberfireDocks; + this.translationService = translationService; + } + + public void init(final String owningPerspectiveId) { + this.owningPerspectiveId = owningPerspectiveId; + this.uberfireDock = makeUberfireDock(); + } + + public void open() { + if (isOpened()) { + return; + } + + isOpened = true; + uberfireDocks.add(getUberfireDock()); + uberfireDocks.show(position(), owningPerspectiveId()); + uberfireDocks.open(getUberfireDock()); + } + + public void close() { + if (!isOpened()) { + return; + } + + isOpened = false; + uberfireDocks.close(getUberfireDock()); + uberfireDocks.remove(getUberfireDock()); + } + + boolean isOpened() { + return isOpened; + } + + UberfireDock makeUberfireDock() { + final UberfireDock uberfireDock = new UberfireDock(position(), icon(), placeRequest(), owningPerspectiveId()); + return uberfireDock.withSize(DOCK_SIZE).withLabel(dockLabel()); + } + + UberfireDockPosition position() { + return UberfireDockPosition.EAST; + } + + private String icon() { + return IconType.EYE.toString(); + } + + private DefaultPlaceRequest placeRequest() { + return new DefaultPlaceRequest(PreviewDiagramScreen.SCREEN_ID); + } + + String owningPerspectiveId() { + return owningPerspectiveId; + } + + UberfireDock getUberfireDock() { + return uberfireDock; + } + + private String dockLabel() { + return translationService.getTranslation(DMNEditorConstants.DMNPreviewDiagramDock_Title); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/java/org/kie/workbench/common/dmn/webapp/common/client/navigator/BaseDMNDiagramsNavigatorScreen.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/java/org/kie/workbench/common/dmn/webapp/common/client/navigator/BaseDMNDiagramsNavigatorScreen.java new file mode 100644 index 00000000000..fa3f29ac5b7 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/java/org/kie/workbench/common/dmn/webapp/common/client/navigator/BaseDMNDiagramsNavigatorScreen.java @@ -0,0 +1,102 @@ +/* + * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.common.client.navigator; + +import java.util.function.Consumer; + +import com.google.gwt.user.client.ui.IsWidget; +import org.kie.workbench.common.stunner.client.widgets.event.LoadDiagramEvent; +import org.kie.workbench.common.stunner.client.widgets.explorer.navigator.diagrams.DiagramsNavigator; +import org.kie.workbench.common.stunner.client.widgets.menu.dev.ShapeSetsMenuItemsBuilder; +import org.kie.workbench.common.stunner.core.client.ShapeSet; +import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.model.menu.MenuFactory; +import org.uberfire.workbench.model.menu.Menus; + +public abstract class BaseDMNDiagramsNavigatorScreen { + + public static final String SCREEN_ID = "DMNDiagramsNavigatorScreen"; + + protected DiagramsNavigator diagramsNavigator; + protected ShapeSetsMenuItemsBuilder newDiagramMenuItemsBuilder; + + protected Menus menu = null; + protected LoadDiagramEvent selectedDiagramEvent = null; + + public BaseDMNDiagramsNavigatorScreen() { + //CDI proxy + } + + public BaseDMNDiagramsNavigatorScreen(final DiagramsNavigator diagramsNavigator, + final ShapeSetsMenuItemsBuilder newDiagramMenuItemsBuilder) { + this.diagramsNavigator = diagramsNavigator; + this.newDiagramMenuItemsBuilder = newDiagramMenuItemsBuilder; + } + + protected void init() { + this.selectedDiagramEvent = null; + } + + @SuppressWarnings("unused") + protected void onStartup(final PlaceRequest placeRequest) { + this.menu = makeMenuBar(); + clear(); + } + + private Menus makeMenuBar() { + final MenuFactory.TopLevelMenusBuilder m = + MenuFactory + .newTopLevelMenu("Load diagrams from server") + .respondsWith(() -> diagramsNavigator.show()) + .endMenu() + .newTopLevelMenu("Edit") + .respondsWith(this::edit) + .endMenu(); + m.newTopLevelMenu(newDiagramMenuItemsBuilder.build("Create", + "Create a new", + this::create)).endMenu(); + return m.build(); + } + + protected abstract void edit(); + + protected abstract void create(final ShapeSet shapeSet); + + private void clear() { + diagramsNavigator.clear(); + selectedDiagramEvent = null; + } + + protected void onClose() { + clear(); + } + + protected void getMenus(final Consumer menusConsumer) { + menusConsumer.accept(menu); + } + + protected String getTitle() { + return "Diagrams Navigator"; + } + + protected IsWidget getWidget() { + return diagramsNavigator.asWidget(); + } + + protected void onLoadDiagramEvent(final LoadDiagramEvent loadDiagramEvent) { + this.selectedDiagramEvent = loadDiagramEvent; + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/META-INF/ErraiApp.properties b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/resources/META-INF/ErraiApp.properties similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/META-INF/ErraiApp.properties rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/resources/META-INF/ErraiApp.properties diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/resources/META-INF/beans.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/resources/META-INF/beans.xml new file mode 100644 index 00000000000..499ab77c7ee --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/resources/META-INF/beans.xml @@ -0,0 +1,20 @@ + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/resources/org/kie/workbench/common/dmn/webapp/common/DMNWebappCommon.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/resources/org/kie/workbench/common/dmn/webapp/common/DMNWebappCommon.gwt.xml new file mode 100644 index 00000000000..541f2b0633e --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-common/src/main/resources/org/kie/workbench/common/dmn/webapp/common/DMNWebappCommon.gwt.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/.gitignore b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/.gitignore similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/.gitignore rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/.gitignore diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/pom.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/pom.xml new file mode 100644 index 00000000000..2180117d627 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/pom.xml @@ -0,0 +1,273 @@ + + + + + org.kie.workbench + kie-wb-common-dmn + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-dmn-webapp-kogito-common + Kie Workbench - Common - DMN - Kogito webapp common + Kie Workbench - Common - DMN - Kogito webapp common + jar + + + ${project.build.directory}/wildfly-${version.org.jboss.errai.wildfly} + 4 + 2.4.0.Final + + + + + + + org.slf4j + slf4j-api + + + + + + + org.jboss.errai + errai-ioc + + + org.jboss.errai + errai-common + + + org.jboss.errai + errai-bus + + + org.jboss.errai + errai-security-server + + + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-client-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-backend-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-common + + + org.kie.workbench.stunner + kie-wb-common-stunner-client-common + + + org.powermock + powermock-api-mockito + + + org.powermock + powermock-module-junit4 + + + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-widgets + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-forms-client + provided + + + + + org.kie.workbench + kie-wb-common-dmn-api + + + org.kie.workbench + kie-wb-common-dmn-backend + + + org.kie.workbench + kie-wb-common-dmn-client + provided + + + org.uberfire + uberfire-servlet-security + + + + + org.kie.workbench + kie-wb-common-dmn-webapp-common + provided + + + org.kie.workbench + kie-wb-common-dmn-webapp-kogito-marshaller + provided + + + + + org.uberfire + uberfire-api + + + org.uberfire + uberfire-client + provided + + + org.uberfire + uberfire-client-api + + + org.uberfire + uberfire-client-backend + provided + + + org.uberfire + uberfire-workbench-client-views-patternfly + provided + + + + + com.google.elemental2 + elemental2-promise + + + + + org.uberfire + uberfire-widgets-core-client + provided + + + + + org.uberfire + uberfire-io + + + + + org.uberfire + uberfire-commons + + + org.apache.activemq + artemis-jms-client + + + org.jboss.spec.javax.jms + jboss-jms-api_2.0_spec + + + + + + + org.kie.workbench.widgets + kie-wb-common-ui + + + org.uberfire + uberfire-servlet-security + + + + + + + + org.uberfire + uberfire-project-api + + + org.kie.workbench.services + kie-wb-common-refactoring-api + + + org.kie.workbench.services + kie-wb-common-refactoring-backend + + + + + org.uberfire + uberfire-structure-api + + + + + com.google.gwt + gwt-user + provided + + + javax.servlet + javax.servlet-api + + + + + org.gwtbootstrap3 + gwtbootstrap3 + provided + + + com.google.elemental2 + elemental2-dom + + + + + org.kie.workbench + kie-wb-common-kogito-client + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client + provided + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/ApplicationScopedProducer.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/ApplicationScopedProducer.java new file mode 100644 index 00000000000..d1b2a930959 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/ApplicationScopedProducer.java @@ -0,0 +1,54 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.common.backend; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.context.RequestScoped; +import javax.enterprise.inject.Produces; +import javax.inject.Named; + +import org.jboss.errai.security.shared.api.identity.User; +import org.jboss.errai.security.shared.api.identity.UserImpl; +import org.uberfire.commons.services.cdi.Startup; +import org.uberfire.commons.services.cdi.StartupType; +import org.uberfire.io.IOService; +import org.uberfire.io.impl.IOServiceNio2WrapperImpl; + +@Startup(value = StartupType.BOOTSTRAP) +@ApplicationScoped +public class ApplicationScopedProducer { + + private IOService ioService; + + @PostConstruct + public void setup() { + ioService = new IOServiceNio2WrapperImpl("dmn"); + } + + @Produces + @Named("ioStrategy") + public IOService ioService() { + return ioService; + } + + @Produces + @RequestScoped + public User user() { + return new UserImpl("admin"); + } +} + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/CORSFilter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/CORSFilter.java new file mode 100644 index 00000000000..43f1f793ecf --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/CORSFilter.java @@ -0,0 +1,85 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.common.backend; + +import java.io.IOException; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.annotation.WebFilter; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Servlet Filter implementation class CORSFilter + * Enabled by default for Servlet 3.x implementations + */ +@WebFilter(asyncSupported = true, urlPatterns = {"/*"}) +public class CORSFilter implements Filter { + + /** + * Default constructor. + */ + public CORSFilter() { + } + + /** + * @see Filter#destroy() + */ + public void destroy() { + } + + /** + * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain) + */ + public void doFilter(final ServletRequest servletRequest, + final ServletResponse servletResponse, + final FilterChain chain) throws IOException, ServletException { + + final HttpServletRequest request = (HttpServletRequest) servletRequest; + + // Authorize (allow) all domains to consume the content + final HttpServletResponse r = (HttpServletResponse) servletResponse; + String origin = request.getHeader("origin"); + r.addHeader("Access-Control-Allow-Origin", origin); + r.addHeader("Access-Control-Allow-Headers", + "Accept,Accept-Encoding,Accept-Language,Cache-Control,Connection,Content-Length,Content-Type," + + "Cookie,Host,Pragma,Referer,RemoteQueueID,User-Agent"); + r.addHeader("Access-Control-Allow-Credentials", "true"); + r.addHeader("Access-Control-Allow-Methods", "GET, OPTIONS, HEAD, PUT, POST"); + + final HttpServletResponse resp = (HttpServletResponse) servletResponse; + + // For HTTP OPTIONS verb/method reply with ACCEPTED status code -- per CORS handshake + if (request.getMethod().equals("OPTIONS")) { + resp.setStatus(HttpServletResponse.SC_ACCEPTED); + return; + } + + // pass the request along the filter chain + chain.doFilter(request, servletResponse); + } + + /** + * @see Filter#init(FilterConfig) + */ + public void init(final FilterConfig fConfig) throws ServletException { + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/services/KogitoDiagramServiceImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/services/KogitoDiagramServiceImpl.java new file mode 100644 index 00000000000..5404a7681e0 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/services/KogitoDiagramServiceImpl.java @@ -0,0 +1,158 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.common.backend.services; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.Objects; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import org.jboss.errai.bus.server.annotations.Service; +import org.kie.workbench.common.dmn.api.definition.model.DMNDiagram; +import org.kie.workbench.common.dmn.api.factory.DMNDiagramFactory; +import org.kie.workbench.common.dmn.backend.DMNBackendService; +import org.kie.workbench.common.dmn.backend.DMNMarshallerStandalone; +import org.kie.workbench.common.stunner.core.api.DefinitionManager; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils; +import org.kie.workbench.common.stunner.core.definition.service.DefinitionSetService; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.DiagramImpl; +import org.kie.workbench.common.stunner.core.diagram.DiagramParsingException; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.diagram.MetadataImpl; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.definition.Definition; +import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; +import org.kie.workbench.common.stunner.core.graph.util.GraphUtils; +import org.kie.workbench.common.stunner.kogito.api.service.KogitoDiagramService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.uberfire.backend.vfs.PathFactory; +import org.uberfire.commons.uuid.UUID; + +@Service +@ApplicationScoped +public class KogitoDiagramServiceImpl implements KogitoDiagramService { + + private static final Logger LOG = LoggerFactory.getLogger(KogitoDiagramServiceImpl.class); + + private static final String DIAGRAMS_PATH = "diagrams"; + + //This path is needed by DiagramsNavigatorImpl's use of AbstractClientDiagramService.lookup(..) to retrieve a list of diagrams + private static final String ROOT = "default://master@system/stunner/" + DIAGRAMS_PATH; + + private DefinitionManager definitionManager; + private FactoryManager factoryManager; + private DMNBackendService dmnBackendService; + private DMNDiagramFactory dmnDiagramFactory; + + protected KogitoDiagramServiceImpl() { + // CDI proxy. + this(null, + null, + null, + null); + } + + @Inject + public KogitoDiagramServiceImpl(final DefinitionManager definitionManager, + final FactoryManager factoryManager, + final DMNBackendService dmnBackendService, + final DMNDiagramFactory dmnDiagramFactory) { + this.definitionManager = definitionManager; + this.factoryManager = factoryManager; + this.dmnBackendService = dmnBackendService; + this.dmnDiagramFactory = dmnDiagramFactory; + } + + @Override + public Diagram transform(final String xml) { + if (Objects.isNull(xml) || xml.isEmpty()) { + return doNewDiagram(); + } + return doTransformation(xml); + } + + private Diagram doNewDiagram() { + final String title = UUID.uuid(); + final String defSetId = getDefinitionSetId(dmnBackendService); + final Metadata metadata = buildMetadataInstance(defSetId); + metadata.setTitle(title); + + try { + return factoryManager.newDiagram(title, + defSetId, + metadata); + } catch (final Exception e) { + LOG.error("Cannot create new diagram", e); + throw new RuntimeException(e); + } + } + + @SuppressWarnings("unchecked") + private Diagram doTransformation(final String xml) { + final String defSetId = getDefinitionSetId(dmnBackendService); + final Metadata metadata = buildMetadataInstance(defSetId); + + try (final InputStream is = new ByteArrayInputStream(xml.getBytes())) { + final DMNMarshallerStandalone dmnMarshaller = (DMNMarshallerStandalone) dmnBackendService.getDiagramMarshaller(); + final Graph graph = dmnMarshaller.unmarshall(metadata, is); + final Node, ?> diagramNode = GraphUtils.getFirstNode((Graph) graph, DMNDiagram.class); + final String title = diagramNode.getContent().getDefinition().getDefinitions().getName().getValue(); + metadata.setTitle(title); + + return dmnDiagramFactory.build(title, + metadata, + graph); + } catch (Exception e) { + LOG.error("Error whilst converting XML to DMNDiagram.", e); + throw new DiagramParsingException(metadata, xml); + } + } + + @Override + public String transform(final Diagram diagram) { + try { + final DMNMarshallerStandalone dmnMarshaller = (DMNMarshallerStandalone) dmnBackendService.getDiagramMarshaller(); + return dmnMarshaller.marshall(convert(diagram)); + } catch (Exception e) { + LOG.error("Error whilst converting DMNDiagram to XML.", e); + throw new RuntimeException(e); + } + } + + private String getDefinitionSetId(final DefinitionSetService services) { + final Class type = services.getResourceType().getDefinitionSetType(); + return BindableAdapterUtils.getDefinitionSetId(type); + } + + private Metadata buildMetadataInstance(final String defSetId) { + return new MetadataImpl.MetadataImplBuilder(defSetId, + definitionManager) + .setRoot(PathFactory.newPath(".", ROOT)) + .build(); + } + + private DiagramImpl convert(final Diagram diagram) { + return new DiagramImpl(diagram.getName(), + diagram.getGraph(), + diagram.getMetadata()); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/DummyAuthenticationService.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/DummyAuthenticationService.java new file mode 100644 index 00000000000..f20a5ab5cb0 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/DummyAuthenticationService.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.common.backend.workarounds; + +import javax.enterprise.context.Dependent; + +import org.jboss.errai.bus.server.annotations.Service; +import org.jboss.errai.security.shared.api.identity.User; +import org.jboss.errai.security.shared.api.identity.UserImpl; +import org.jboss.errai.security.shared.service.AuthenticationService; + +@Service +@Dependent +public class DummyAuthenticationService implements AuthenticationService { + + @Override + public void logout() { + } + + @Override + public User login(String username, String password) { + return new UserImpl("admin"); + } + + @Override + public boolean isLoggedIn() { + return true; + } + + @Override + public User getUser() { + return new UserImpl("admin"); + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockAssetsUsageServiceImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockAssetsUsageServiceImpl.java new file mode 100644 index 00000000000..81382cb4c06 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockAssetsUsageServiceImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.common.backend.workarounds; + +import java.util.List; + +import javax.enterprise.inject.Specializes; + +import org.jboss.errai.bus.server.annotations.Service; +import org.kie.workbench.common.services.refactoring.backend.server.query.assetUsages.AssetsUsageServiceImpl; +import org.kie.workbench.common.services.refactoring.service.PartType; +import org.kie.workbench.common.services.refactoring.service.ResourceType; +import org.uberfire.backend.vfs.Path; + +@Service +@Specializes +public class MockAssetsUsageServiceImpl extends AssetsUsageServiceImpl { + + public MockAssetsUsageServiceImpl() { + super(null, null); + } + + @Override + public List getAssetUsages(final String resourceFQN, + final ResourceType resourceType, + final Path assetPath) { + throw new UnsupportedOperationException("Not available in kogito"); + } + + @Override + public List getAssetPartUsages(final String resourceFQN, + final String resourcePart, + final PartType partType, + final Path assetPath) { + throw new UnsupportedOperationException("Not available in kogito"); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockDMNIncludedModelFactory.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockDMNIncludedModelFactory.java new file mode 100644 index 00000000000..fb6550a2985 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockDMNIncludedModelFactory.java @@ -0,0 +1,39 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.common.backend.workarounds; + +import javax.enterprise.inject.Specializes; + +import org.kie.workbench.common.dmn.api.editors.included.DMNIncludedModel; +import org.kie.workbench.common.dmn.backend.editors.common.IncludedModelFactory; +import org.kie.workbench.common.dmn.backend.editors.types.exceptions.DMNIncludeModelCouldNotBeCreatedException; +import org.uberfire.backend.vfs.Path; + +@Specializes +public class MockDMNIncludedModelFactory extends IncludedModelFactory { + + public MockDMNIncludedModelFactory() { + super(null, null, null, null, null); + } + + @Override + public DMNIncludedModel create(final Path dmnModelPath, + final Path includedModelPath) throws DMNIncludeModelCouldNotBeCreatedException { + throw new DMNIncludeModelCouldNotBeCreatedException("Not available in kogito"); + } +} + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockDMNIncludedModelsServiceImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockDMNIncludedModelsServiceImpl.java new file mode 100644 index 00000000000..26bcce8f1cd --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockDMNIncludedModelsServiceImpl.java @@ -0,0 +1,72 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.common.backend.workarounds; + +import java.util.Collections; +import java.util.List; + +import javax.enterprise.inject.Specializes; + +import org.guvnor.common.services.project.model.WorkspaceProject; +import org.jboss.errai.bus.server.annotations.Service; +import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; +import org.kie.workbench.common.dmn.api.editors.included.DMNIncludedModel; +import org.kie.workbench.common.dmn.api.editors.included.DMNIncludedNode; +import org.kie.workbench.common.dmn.api.editors.included.IncludedModel; +import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; +import org.kie.workbench.common.dmn.api.editors.included.PMMLIncludedModel; +import org.kie.workbench.common.dmn.backend.editors.included.DMNIncludedModelsServiceImpl; +import org.uberfire.backend.vfs.Path; + +/** + * kogito lacks the ability to query the environment (VSCode etc) for additional files. + * Therefore this implementation of the service returns empty collections for all methods. + */ +@Service +@Specializes +public class MockDMNIncludedModelsServiceImpl extends DMNIncludedModelsServiceImpl { + + public MockDMNIncludedModelsServiceImpl() { + super(null, null, null, null, null); + } + + @Override + public List loadModels(final Path path, + final WorkspaceProject workspaceProject) { + return Collections.emptyList(); + } + + @Override + public List loadNodesFromImports(final WorkspaceProject workspaceProject, + final List includedModels) { + return Collections.emptyList(); + } + + @Override + public List loadPMMLDocumentsFromImports(final Path path, + final WorkspaceProject workspaceProject, + final List includedModels) { + return Collections.emptyList(); + } + + @Override + public List loadItemDefinitionsByNamespace(final WorkspaceProject workspaceProject, + final String modelName, + final String namespace) { + return Collections.emptyList(); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockRefactoringQueryServiceImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockRefactoringQueryServiceImpl.java new file mode 100644 index 00000000000..8777e2ec953 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockRefactoringQueryServiceImpl.java @@ -0,0 +1,61 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.common.backend.workarounds; + +import java.util.List; +import java.util.Set; + +import javax.enterprise.inject.Specializes; + +import org.jboss.errai.bus.server.annotations.Service; +import org.kie.workbench.common.services.refactoring.backend.server.query.RefactoringQueryServiceImpl; +import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueIndexTerm; +import org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRequest; +import org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow; +import org.kie.workbench.common.services.refactoring.service.impact.QueryOperationRequest; +import org.uberfire.paging.PageResponse; + +@Service +@Specializes +public class MockRefactoringQueryServiceImpl extends RefactoringQueryServiceImpl { + + @Override + public int queryHitCount(final RefactoringPageRequest request) { + throw new UnsupportedOperationException("Not available in kogito"); + } + + @Override + public PageResponse query(final RefactoringPageRequest request) { + throw new UnsupportedOperationException("Not available in kogito"); + } + + @Override + public List query(final String queryName, + final Set queryTerms) { + throw new UnsupportedOperationException("Not available in kogito"); + } + + @Override + public PageResponse queryToPageResponse(final QueryOperationRequest request) { + throw new UnsupportedOperationException("Not available in kogito"); + } + + @Override + public List queryToList(final QueryOperationRequest request) { + throw new UnsupportedOperationException("Not available in kogito"); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockWorkspaceProjectService.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockWorkspaceProjectService.java new file mode 100644 index 00000000000..68687466560 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/backend/workarounds/MockWorkspaceProjectService.java @@ -0,0 +1,138 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.common.backend.workarounds; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import javax.enterprise.context.ApplicationScoped; + +import org.guvnor.common.services.project.model.Module; +import org.guvnor.common.services.project.model.POM; +import org.guvnor.common.services.project.model.WorkspaceProject; +import org.guvnor.common.services.project.service.DeploymentMode; +import org.guvnor.common.services.project.service.WorkspaceProjectService; +import org.guvnor.structure.contributors.Contributor; +import org.guvnor.structure.organizationalunit.OrganizationalUnit; +import org.guvnor.structure.repositories.Branch; +import org.guvnor.structure.repositories.Repository; +import org.jboss.errai.bus.server.annotations.Service; +import org.uberfire.backend.vfs.Path; +import org.uberfire.spaces.Space; + +/** + * kogito does not have the concept of Workspaces or Projects. Therefore this dummy + * implementation of the WorkspaceProjectService returns non-null sensible defaults. + */ +@Service +@ApplicationScoped +public class MockWorkspaceProjectService implements WorkspaceProjectService { + + private static final WorkspaceProject PROJECT = new WorkspaceProject(); + private static final Collection PROJECTS = Collections.singleton(PROJECT); + + @Override + public Collection getAllWorkspaceProjects() { + return PROJECTS; + } + + @Override + public Collection getAllWorkspaceProjects(final OrganizationalUnit organizationalUnit) { + return PROJECTS; + } + + @Override + public Collection getAllWorkspaceProjectsByName(final OrganizationalUnit organizationalUnit, + final String name) { + return PROJECTS; + } + + @Override + public boolean spaceHasNoProjectsWithName(final OrganizationalUnit organizationalUnit, + final String name, + final WorkspaceProject projectToIgnore) { + return false; + } + + @Override + public WorkspaceProject newProject(final OrganizationalUnit organizationalUnit, + final POM pom) { + return PROJECT; + } + + @Override + public WorkspaceProject newProject(final OrganizationalUnit organizationalUnit, + final POM pom, + final DeploymentMode mode) { + return PROJECT; + } + + @Override + public WorkspaceProject newProject(final OrganizationalUnit organizationalUnit, + final POM pom, + final DeploymentMode mode, + final List contributor) { + return PROJECT; + } + + @Override + public String createFreshProjectName(final OrganizationalUnit organizationalUnit, + final String name) { + return ""; + } + + @Override + public WorkspaceProject resolveProject(final Repository repository) { + return PROJECT; + } + + @Override + public WorkspaceProject resolveProject(final Space space, + final Branch branch) { + return PROJECT; + } + + @Override + public WorkspaceProject resolveProject(final Space space, + final Module module) { + return PROJECT; + } + + @Override + public WorkspaceProject resolveProject(final Path module) { + return PROJECT; + } + + @Override + public WorkspaceProject resolveProject(final Space space, + final Path module) { + return PROJECT; + } + + @Override + public WorkspaceProject resolveProject(final Space space, + final String name) { + return PROJECT; + } + + @Override + public WorkspaceProject resolveProjectByRepositoryAlias(final Space space, + final String repositoryAlias) { + return PROJECT; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/editor/BaseDMNDiagramEditor.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/editor/BaseDMNDiagramEditor.java new file mode 100644 index 00000000000..0d8129315d1 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/editor/BaseDMNDiagramEditor.java @@ -0,0 +1,449 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.common.client.editor; + +import java.util.Optional; +import java.util.function.Consumer; +import java.util.function.Supplier; + +import javax.enterprise.event.Event; + +import com.google.gwt.user.client.ui.IsWidget; +import elemental2.dom.DomGlobal; +import elemental2.dom.HTMLElement; +import elemental2.promise.Promise; +import org.jboss.errai.common.client.ui.ElementWrapperWidget; +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.kie.workbench.common.dmn.client.commands.general.NavigateToExpressionEditorCommand; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorDock; +import org.kie.workbench.common.dmn.client.editors.expressions.ExpressionEditorView; +import org.kie.workbench.common.dmn.client.editors.included.IncludedModelsPage; +import org.kie.workbench.common.dmn.client.editors.included.imports.IncludedModelsPageStateProviderImpl; +import org.kie.workbench.common.dmn.client.editors.search.DMNEditorSearchIndex; +import org.kie.workbench.common.dmn.client.editors.search.DMNSearchableElement; +import org.kie.workbench.common.dmn.client.editors.types.DataTypePageTabActiveEvent; +import org.kie.workbench.common.dmn.client.editors.types.DataTypesPage; +import org.kie.workbench.common.dmn.client.editors.types.listview.common.DataTypeEditModeToggleEvent; +import org.kie.workbench.common.dmn.client.events.EditExpressionEvent; +import org.kie.workbench.common.dmn.client.session.DMNSession; +import org.kie.workbench.common.dmn.webapp.common.client.docks.preview.PreviewDiagramDock; +import org.kie.workbench.common.kogito.client.editor.MultiPageEditorContainerView; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; +import org.kie.workbench.common.stunner.core.client.api.SessionManager; +import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; +import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; +import org.kie.workbench.common.stunner.core.client.command.SessionCommandManager; +import org.kie.workbench.common.stunner.core.client.components.layout.LayoutHelper; +import org.kie.workbench.common.stunner.core.client.components.layout.OpenDiagramLayoutExecutor; +import org.kie.workbench.common.stunner.core.client.error.DiagramClientErrorHandler; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.documentation.DocumentationView; +import org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent; +import org.kie.workbench.common.stunner.kogito.client.docks.DiagramEditorPropertiesDock; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditor; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientDiagramService; +import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; +import org.kie.workbench.common.widgets.client.search.component.SearchBarComponent; +import org.uberfire.backend.vfs.Path; +import org.uberfire.backend.vfs.PathFactory; +import org.uberfire.client.annotations.WorkbenchMenu; +import org.uberfire.client.annotations.WorkbenchPartTitle; +import org.uberfire.client.annotations.WorkbenchPartTitleDecoration; +import org.uberfire.client.annotations.WorkbenchPartView; +import org.uberfire.client.mvp.PlaceManager; +import org.uberfire.client.views.pfly.multipage.MultiPageEditorSelectedPageEvent; +import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; +import org.uberfire.ext.editor.commons.client.menu.MenuItems; +import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; +import org.uberfire.lifecycle.GetContent; +import org.uberfire.lifecycle.IsDirty; +import org.uberfire.lifecycle.OnClose; +import org.uberfire.lifecycle.OnFocus; +import org.uberfire.lifecycle.OnLostFocus; +import org.uberfire.lifecycle.OnMayClose; +import org.uberfire.lifecycle.OnOpen; +import org.uberfire.lifecycle.OnStartup; +import org.uberfire.lifecycle.SetContent; +import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.events.NotificationEvent; +import org.uberfire.workbench.model.menu.Menus; + +import static elemental2.dom.DomGlobal.setTimeout; + +public abstract class BaseDMNDiagramEditor extends AbstractDiagramEditor { + + public static final String PERSPECTIVE_ID = "AuthoringPerspective"; + + public static final String EDITOR_ID = "DMNDiagramEditor"; + + //Editor tabs: [0] Main editor, [1] Documentation, [2] Data-Types, [3] Imported Models + public static final int DATA_TYPES_PAGE_INDEX = 2; + + private final SessionManager sessionManager; + private final SessionCommandManager sessionCommandManager; + private final Event refreshFormPropertiesEvent; + + private final DecisionNavigatorDock decisionNavigatorDock; + private final DiagramEditorPropertiesDock diagramPropertiesDock; + private final PreviewDiagramDock diagramPreviewAndExplorerDock; + + private final LayoutHelper layoutHelper; + private final OpenDiagramLayoutExecutor openDiagramLayoutExecutor; + + private final DataTypesPage dataTypesPage; + private final IncludedModelsPage includedModelsPage; + private final IncludedModelsPageStateProviderImpl importsPageProvider; + + private final DMNEditorSearchIndex editorSearchIndex; + private final SearchBarComponent searchBarComponent; + + private final KogitoClientDiagramService diagramServices; + + public BaseDMNDiagramEditor(final View view, + final FileMenuBuilder fileMenuBuilder, + final PlaceManager placeManager, + final MultiPageEditorContainerView multiPageEditorContainerView, + final Event changeTitleNotificationEvent, + final Event notificationEvent, + final Event onDiagramFocusEvent, + final TextEditorView xmlEditorView, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final DMNEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService, + final DocumentationView documentationView, + final DMNEditorSearchIndex editorSearchIndex, + final SearchBarComponent searchBarComponent, + final SessionManager sessionManager, + final SessionCommandManager sessionCommandManager, + final Event refreshFormPropertiesEvent, + final DecisionNavigatorDock decisionNavigatorDock, + final DiagramEditorPropertiesDock diagramPropertiesDock, + final PreviewDiagramDock diagramPreviewAndExplorerDock, + final LayoutHelper layoutHelper, + final OpenDiagramLayoutExecutor openDiagramLayoutExecutor, + final DataTypesPage dataTypesPage, + final IncludedModelsPage includedModelsPage, + final IncludedModelsPageStateProviderImpl importsPageProvider, + final KogitoClientDiagramService diagramServices) { + super(view, + fileMenuBuilder, + placeManager, + multiPageEditorContainerView, + changeTitleNotificationEvent, + notificationEvent, + onDiagramFocusEvent, + xmlEditorView, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService, + documentationView); + this.sessionManager = sessionManager; + this.sessionCommandManager = sessionCommandManager; + this.refreshFormPropertiesEvent = refreshFormPropertiesEvent; + + this.decisionNavigatorDock = decisionNavigatorDock; + this.diagramPropertiesDock = diagramPropertiesDock; + this.diagramPreviewAndExplorerDock = diagramPreviewAndExplorerDock; + + this.layoutHelper = layoutHelper; + this.openDiagramLayoutExecutor = openDiagramLayoutExecutor; + + this.dataTypesPage = dataTypesPage; + this.includedModelsPage = includedModelsPage; + this.importsPageProvider = importsPageProvider; + + this.editorSearchIndex = editorSearchIndex; + this.searchBarComponent = searchBarComponent; + + this.diagramServices = diagramServices; + } + + @OnStartup + @SuppressWarnings("unused") + public void onStartup(final PlaceRequest place) { + superDoStartUp(place); + + decisionNavigatorDock.init(PERSPECTIVE_ID); + diagramPreviewAndExplorerDock.init(PERSPECTIVE_ID); + diagramPropertiesDock.init(PERSPECTIVE_ID); + + getWidget().init(this); + } + + void superDoStartUp(final PlaceRequest place) { + super.doStartUp(place); + } + + @Override + public void initialiseKieEditorForSession(final Diagram diagram) { + superInitialiseKieEditorForSession(diagram); + + getWidget().getMultiPage().addPage(dataTypesPage); + getWidget().getMultiPage().addPage(includedModelsPage); + + setupEditorSearchIndex(); + setupSearchComponent(); + } + + private void setupEditorSearchIndex() { + editorSearchIndex.setCurrentAssetHashcodeSupplier(getHashcodeSupplier()); + editorSearchIndex.setIsDataTypesTabActiveSupplier(getIsDataTypesTabActiveSupplier()); + } + + Supplier getHashcodeSupplier() { + return this::getCurrentDiagramHash; + } + + Supplier getIsDataTypesTabActiveSupplier() { + return () -> { + final int selectedPageIndex = getWidget().getMultiPage().selectedPage(); + return selectedPageIndex == DATA_TYPES_PAGE_INDEX; + }; + } + + void setupSearchComponent() { + final HTMLElement element = searchBarComponent.getView().getElement(); + + searchBarComponent.init(editorSearchIndex); + getWidget().getMultiPage().addTabBarWidget(getWidget(element)); + } + + ElementWrapperWidget getWidget(final HTMLElement element) { + return ElementWrapperWidget.getWidget(element); + } + + @SuppressWarnings("unused") + public void onDataTypePageNavTabActiveEvent(final DataTypePageTabActiveEvent event) { + getWidget().getMultiPage().selectPage(DATA_TYPES_PAGE_INDEX); + } + + void superInitialiseKieEditorForSession(final Diagram diagram) { + super.initialiseKieEditorForSession(diagram); + } + + @Override + public void open(final Diagram diagram) { + this.layoutHelper.applyLayout(diagram, openDiagramLayoutExecutor); + super.open(diagram); + } + + @OnOpen + @SuppressWarnings("unused") + public void onOpen() { + super.doOpen(); + } + + @OnClose + @SuppressWarnings("unused") + public void onClose() { + superOnClose(); + + decisionNavigatorDock.close(); + decisionNavigatorDock.resetContent(); + + diagramPropertiesDock.close(); + diagramPreviewAndExplorerDock.close(); + + dataTypesPage.disableShortcuts(); + } + + void superOnClose() { + super.doClose(); + } + + @Override + public void onDiagramLoad() { + final Optional canvasHandler = Optional.ofNullable(getCanvasHandler()); + + canvasHandler.ifPresent(c -> { + final Metadata metadata = c.getDiagram().getMetadata(); + metadata.setPath(makeMetadataPath(metadata.getRoot(), metadata.getTitle())); + + final ExpressionEditorView.Presenter expressionEditor = ((DMNSession) sessionManager.getCurrentSession()).getExpressionEditor(); + expressionEditor.setToolbarStateHandler(new DMNProjectToolbarStateHandler(getMenuSessionItems())); + + decisionNavigatorDock.setupCanvasHandler(c); + decisionNavigatorDock.open(); + + diagramPropertiesDock.open(); + diagramPreviewAndExplorerDock.open(); + + dataTypesPage.reload(); + + includedModelsPage.setup(importsPageProvider.withDiagram(c.getDiagram())); + }); + } + + private Path makeMetadataPath(final Path root, + final String title) { + final String uri = root.toURI(); + return PathFactory.newPath(title, uri + "/" + title + ".dmn"); + } + + @OnFocus + @SuppressWarnings("unused") + public void onFocus() { + superDoFocus(); + onDiagramLoad(); + dataTypesPage.onFocus(); + dataTypesPage.enableShortcuts(); + } + + void superDoFocus() { + super.doFocus(); + } + + @OnLostFocus + @SuppressWarnings("unused") + public void onLostFocus() { + super.doLostFocus(); + dataTypesPage.onLostFocus(); + } + + @Override + @WorkbenchPartTitleDecoration + public IsWidget getTitle() { + return super.getTitle(); + } + + @WorkbenchPartTitle + public String getTitleText() { + return ""; + } + + @WorkbenchMenu + public void getMenus(final Consumer menusConsumer) { + menusConsumer.accept(super.getMenus()); + } + + @Override + protected void makeMenuBar() { + if (!menuBarInitialized) { + getMenuSessionItems().populateMenu(getFileMenuBuilder()); + makeAdditionalStunnerMenus(getFileMenuBuilder()); + menuBarInitialized = true; + } + } + + @Override + @WorkbenchPartView + public IsWidget asWidget() { + return super.asWidget(); + } + + @OnMayClose + @SuppressWarnings("unused") + public boolean onMayClose() { + return super.mayClose(); + } + + @Override + public String getEditorIdentifier() { + return EDITOR_ID; + } + + public void onDataTypeEditModeToggle(final DataTypeEditModeToggleEvent event) { + /* Delaying the 'onDataTypeEditModeToggleCallback' since external events + * refresh the menu widget and override this change. */ + setTimeout(getOnDataTypeEditModeToggleCallback(event), 250); + } + + DomGlobal.SetTimeoutCallbackFn getOnDataTypeEditModeToggleCallback(final DataTypeEditModeToggleEvent event) { + return (e) -> { + if (event.isEditModeEnabled()) { + disableMenuItem(MenuItems.SAVE); + } else { + enableMenuItem(MenuItems.SAVE); + } + }; + } + + protected void onMultiPageEditorSelectedPageEvent(final MultiPageEditorSelectedPageEvent event) { + searchBarComponent.disableSearch(); + } + + protected void onRefreshFormPropertiesEvent(final RefreshFormPropertiesEvent event) { + searchBarComponent.disableSearch(); + } + + protected void onEditExpressionEvent(final EditExpressionEvent event) { + searchBarComponent.disableSearch(); + if (isSameSession(event.getSession())) { + final DMNSession session = sessionManager.getCurrentSession(); + final ExpressionEditorView.Presenter expressionEditor = session.getExpressionEditor(); + sessionCommandManager.execute(session.getCanvasHandler(), + new NavigateToExpressionEditorCommand(expressionEditor, + getSessionPresenter(), + sessionManager, + sessionCommandManager, + refreshFormPropertiesEvent, + event.getNodeUUID(), + event.getHasExpression(), + event.getHasName(), + event.isOnlyVisualChangeAllowed())); + } + } + + @Override + @GetContent + public Promise getContent() { + return diagramServices.transform(getEditor().getEditorProxy().getContentSupplier().get()); + } + + @Override + @IsDirty + public boolean isDirty() { + return super.isDirty(); + } + + @Override + @SetContent + public void setContent(final String value) { + diagramServices.transform(value, + new ServiceCallback() { + + @Override + public void onSuccess(final Diagram diagram) { + getEditor().open(diagram); + } + + @Override + public void onError(final ClientRuntimeError error) { + BaseDMNDiagramEditor.this.getEditor().onLoadError(error); + } + }); + } + + @Override + public void resetContentHash() { + setOriginalContentHash(getCurrentDiagramHash()); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/editor/DMNEditorMenuItemsBuilder.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/editor/DMNEditorMenuItemsBuilder.java new file mode 100644 index 00000000000..f3ab8a6a305 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/editor/DMNEditorMenuItemsBuilder.java @@ -0,0 +1,42 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.common.client.editor; + +import javax.enterprise.context.Dependent; +import javax.enterprise.inject.Typed; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuItemsBuilder; + +@Dependent +@Typed(DMNEditorMenuItemsBuilder.class) +public class DMNEditorMenuItemsBuilder extends AbstractDiagramEditorMenuItemsBuilder { + + @SuppressWarnings("unused") + protected DMNEditorMenuItemsBuilder() { + //CDI proxy + super(); + } + + @Inject + public DMNEditorMenuItemsBuilder(final ClientTranslationService translationService, + final PopupUtil popupUtil) { + super(translationService, + popupUtil); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/editor/DMNEditorMenuSessionItems.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/editor/DMNEditorMenuSessionItems.java new file mode 100644 index 00000000000..c5695b78b39 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/editor/DMNEditorMenuSessionItems.java @@ -0,0 +1,80 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.common.client.editor; + +import javax.enterprise.context.Dependent; +import javax.enterprise.inject.Typed; +import javax.inject.Inject; + +import org.gwtbootstrap3.client.ui.Button; +import org.gwtbootstrap3.client.ui.constants.ButtonSize; +import org.gwtbootstrap3.client.ui.constants.IconType; +import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; +import org.kie.workbench.common.dmn.webapp.kogito.common.client.session.DMNEditorSessionCommands; +import org.kie.workbench.common.stunner.client.widgets.menu.MenuUtils; +import org.kie.workbench.common.stunner.core.client.session.command.impl.PerformAutomaticLayoutCommand; +import org.kie.workbench.common.stunner.core.i18n.CoreTranslationMessages; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; +import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; +import org.uberfire.workbench.model.menu.MenuItem; + +@Dependent +@Typed(DMNEditorMenuSessionItems.class) +public class DMNEditorMenuSessionItems extends AbstractDiagramEditorMenuSessionItems { + + @Inject + public DMNEditorMenuSessionItems(final DMNEditorMenuItemsBuilder itemsBuilder, + final @DMNEditor DMNEditorSessionCommands sessionCommands) { + super(itemsBuilder, + sessionCommands); + } + + @Override + public void populateMenu(final FileMenuBuilder menu) { + superPopulateMenu(menu); + addPerformAutomaticLayout(menu); + } + + void superPopulateMenu(final FileMenuBuilder menu) { + super.populateMenu(menu); + } + + void addPerformAutomaticLayout(final FileMenuBuilder menu) { + final MenuItem performAutomaticLayoutMenuItem = newPerformAutomaticLayout(); + addMenuItem(PerformAutomaticLayoutCommand.class, performAutomaticLayoutMenuItem); + menu.addNewTopLevelMenu(performAutomaticLayoutMenuItem); + } + + MenuItem newPerformAutomaticLayout() { + final MenuUtils.HasEnabledIsWidget buttonWrapper = MenuUtils.buildHasEnabledWidget(new Button() {{ + setSize(ButtonSize.SMALL); + setTitle(getTranslationService().getValue(CoreTranslationMessages.PERFORM_AUTOMATIC_LAYOUT)); + setIcon(IconType.SITEMAP); + addClickHandler(clickEvent -> ((DMNEditorSessionCommands) getCommands()).getPerformAutomaticLayoutCommand().execute()); + }}); + return MenuUtils.buildItem(buttonWrapper); + } + + @Override + public void setEnabled(final boolean enabled) { + superSetEnabled(enabled); + setItemEnabled(PerformAutomaticLayoutCommand.class, enabled); + } + + void superSetEnabled(final boolean enabled) { + super.setEnabled(enabled); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/editor/DMNProjectToolbarStateHandler.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/editor/DMNProjectToolbarStateHandler.java new file mode 100644 index 00000000000..b97e7bf6c81 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/editor/DMNProjectToolbarStateHandler.java @@ -0,0 +1,75 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.common.client.editor; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import org.kie.workbench.common.dmn.client.editors.toolbar.ToolbarStateHandler; +import org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.PerformAutomaticLayoutCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.SwitchGridSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.VisitGraphSessionCommand; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; + +public class DMNProjectToolbarStateHandler implements ToolbarStateHandler { + + private static final Class[] COMMAND_CLASSES = { + ClearSessionCommand.class, + SwitchGridSessionCommand.class, + VisitGraphSessionCommand.class, + DeleteSelectionSessionCommand.class, + CutSelectionSessionCommand.class, + CopySelectionSessionCommand.class, + PasteSelectionSessionCommand.class, + PerformAutomaticLayoutCommand.class + }; + + private final Map, Boolean> commandStates = new HashMap<>(); + + private final AbstractDiagramEditorMenuSessionItems projectEditorMenuSessionItems; + + @SuppressWarnings("unchecked") + public DMNProjectToolbarStateHandler(final AbstractDiagramEditorMenuSessionItems projectEditorMenuSessionItems) { + this.projectEditorMenuSessionItems = projectEditorMenuSessionItems; + + Arrays.asList(COMMAND_CLASSES).forEach(clazz -> commandStates.put(clazz, false)); + } + + @Override + public void enterGridView() { + commandStates.entrySet().forEach(entry -> { + final Class command = entry.getKey(); + entry.setValue(projectEditorMenuSessionItems.isItemEnabled(command)); + projectEditorMenuSessionItems.setItemEnabled(command, false); + }); + } + + @Override + public void enterGraphView() { + commandStates.entrySet().forEach(entry -> { + final Class command = entry.getKey(); + projectEditorMenuSessionItems.setItemEnabled(command, entry.getValue()); + }); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/services/DMNClientDiagramServiceImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/services/DMNClientDiagramServiceImpl.java new file mode 100644 index 00000000000..a9717df5980 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/services/DMNClientDiagramServiceImpl.java @@ -0,0 +1,223 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.common.client.services; + +import java.util.Objects; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import com.google.gwt.core.client.GWT; +import elemental2.promise.Promise; +import jsinterop.base.Js; +import org.jboss.errai.common.client.api.Caller; +import org.kie.workbench.common.dmn.api.DMNDefinitionSet; +import org.kie.workbench.common.dmn.api.definition.model.DMNDiagram; +import org.kie.workbench.common.dmn.api.factory.DMNDiagramFactory; +import org.kie.workbench.common.dmn.client.DMNShapeSet; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.MainJs; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.callbacks.DMN12MarshallCallback; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.callbacks.DMN12UnmarshallCallback; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.DMN12; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDefinitions; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.DMNMarshallerKogitoMarshaller; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.DMNMarshallerKogitoUnmarshaller; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.JSIName; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.JsUtils; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.JsonVerifier; +import org.kie.workbench.common.stunner.core.api.DefinitionManager; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.DiagramParsingException; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.diagram.MetadataImpl; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.definition.Definition; +import org.kie.workbench.common.stunner.core.graph.util.GraphUtils; +import org.kie.workbench.common.stunner.core.util.StringUtils; +import org.kie.workbench.common.stunner.kogito.api.editor.DiagramType; +import org.kie.workbench.common.stunner.kogito.api.editor.impl.KogitoDiagramResourceImpl; +import org.kie.workbench.common.stunner.kogito.api.service.KogitoDiagramService; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientDiagramService; +import org.uberfire.backend.vfs.PathFactory; +import org.uberfire.client.promise.Promises; +import org.uberfire.commons.uuid.UUID; + +@ApplicationScoped +public class DMNClientDiagramServiceImpl implements KogitoClientDiagramService { + + private static final String DIAGRAMS_PATH = "diagrams"; + + //This path is needed by DiagramsNavigatorImpl's use of AbstractClientDiagramService.lookup(..) to retrieve a list of diagrams + private static final String ROOT = "default://master@system/stunner/" + DIAGRAMS_PATH; + + private DMNMarshallerKogitoUnmarshaller dmnMarshallerKogitoUnmarshaller; + private DMNMarshallerKogitoMarshaller dmnMarshallerKogitoMarshaller; + private Caller kogitoDiagramServiceCaller; + private FactoryManager factoryManager; + private DefinitionManager definitionManager; + private DMNDiagramFactory dmnDiagramFactory; + private Promises promises; + // TODO {gcardosi} only for developing/debugging purpose - to be removed + private JSITDefinitions unmarshalledDefinitions; + + public DMNClientDiagramServiceImpl() { + //CDI proxy + } + + @Inject + public DMNClientDiagramServiceImpl(final DMNMarshallerKogitoUnmarshaller dmnMarshallerKogitoUnmarshaller, + final DMNMarshallerKogitoMarshaller dmnMarshallerKogitoMarshaller, + final Caller kogitoDiagramServiceCaller, + final FactoryManager factoryManager, + final DefinitionManager definitionManager, + final DMNDiagramFactory dmnDiagramFactory, + final Promises promises) { + this.dmnMarshallerKogitoUnmarshaller = dmnMarshallerKogitoUnmarshaller; + this.dmnMarshallerKogitoMarshaller = dmnMarshallerKogitoMarshaller; + this.kogitoDiagramServiceCaller = kogitoDiagramServiceCaller; + this.factoryManager = factoryManager; + this.definitionManager = definitionManager; + this.dmnDiagramFactory = dmnDiagramFactory; + this.promises = promises; + } + + //Kogito requirements + + @Override + public void transform(final String xml, + final ServiceCallback callback) { + if (Objects.isNull(xml) || xml.isEmpty()) { + doNewDiagram(callback); + } else { + doTransformation(xml, callback); + } + } + + private void doNewDiagram(final ServiceCallback callback) { + final String title = UUID.uuid(); + final Metadata metadata = buildMetadataInstance(); + metadata.setTitle(title); + + try { + final String defSetId = BindableAdapterUtils.getDefinitionSetId(DMNDefinitionSet.class); + final Diagram diagram = factoryManager.newDiagram(title, defSetId, metadata); + updateClientShapeSetId(diagram); + + callback.onSuccess(diagram); + } catch (final Exception e) { + throw new RuntimeException(e); + } + } + + private Metadata buildMetadataInstance() { + final String defSetId = BindableAdapterUtils.getDefinitionSetId(DMNDefinitionSet.class); + final String shapeSetId = BindableAdapterUtils.getShapeSetId(DMNShapeSet.class); + return new MetadataImpl.MetadataImplBuilder(defSetId, + definitionManager) + .setRoot(PathFactory.newPath(".", ROOT)) + .setShapeSetId(shapeSetId) + .build(); + } + + private void updateClientShapeSetId(final Diagram diagram) { + if (Objects.nonNull(diagram)) { + final Metadata metadata = diagram.getMetadata(); + if (Objects.nonNull(metadata) && StringUtils.isEmpty(metadata.getShapeSetId())) { + final String shapeSetId = BindableAdapterUtils.getShapeSetId(DMNShapeSet.class); + metadata.setShapeSetId(shapeSetId); + } + } + } + + @SuppressWarnings("unchecked") + private void doTransformation(final String xml, + final ServiceCallback callback) { + final Metadata metadata = buildMetadataInstance(); + + try { + + final DMN12UnmarshallCallback jsCallback = dmn12 -> { + final JSITDefinitions definitions = Js.uncheckedCast(JsUtils.getUnwrappedElement(dmn12)); + unmarshalledDefinitions = definitions; + final Graph graph = dmnMarshallerKogitoUnmarshaller.unmarshall(metadata, definitions); + final Node, ?> diagramNode = GraphUtils.getFirstNode((Graph) graph, DMNDiagram.class); + final String title = diagramNode.getContent().getDefinition().getDefinitions().getName().getValue(); + metadata.setTitle(title); + + final Diagram diagram = dmnDiagramFactory.build(title, metadata, graph); + updateClientShapeSetId(diagram); + + callback.onSuccess(diagram); + }; + //TODO {gcardosi} retrieve correct "xmlns" namespace + MainJs.unmarshall(xml, "UNKNOWN", jsCallback); + } catch (Exception e) { + GWT.log(e.getMessage(), e); + callback.onError(new ClientRuntimeError(new DiagramParsingException(metadata, xml))); + } + } + + @Override + public Promise transform(final KogitoDiagramResourceImpl resource) { + if (resource.getType() == DiagramType.PROJECT_DIAGRAM) { + return promises.promisify(kogitoDiagramServiceCaller, + s -> { + resource.projectDiagram().ifPresent(diagram -> testClientSideMarshaller(diagram.getGraph())); + return s.transform(resource.projectDiagram().orElseThrow(() -> new IllegalStateException("DiagramType is PROJECT_DIAGRAM however no instance present"))); + }); + } + return promises.resolve(resource.xmlDiagram().orElse("DiagramType is XML_DIAGRAM however no instance present")); + } + + @SuppressWarnings("unchecked") + private void testClientSideMarshaller(final Graph graph) { + if (Objects.isNull(graph)) { + return; + } + + final DMN12MarshallCallback jsCallback = xml -> { + String breakpoint = xml; + if (!breakpoint.startsWith("")) { + breakpoint = "" + breakpoint; + } + }; + try { + final JSITDefinitions jsitDefinitions = dmnMarshallerKogitoMarshaller.marshall(graph); + final JSIName jsiName = JSITDefinitions.getJSIName(); + jsiName.setPrefix("dmn"); + jsiName.setLocalPart("definitions"); + final String key = "{" + jsiName.getNamespaceURI() + "}" + jsiName.getLocalPart(); + jsiName.setKey(key); + final String keyString = "{" + jsiName.getNamespaceURI() + "}" + jsiName.getPrefix() + ":" + jsiName.getLocalPart(); + jsiName.setString(keyString); + if (!Objects.isNull(unmarshalledDefinitions)) { + JsonVerifier.compareJSITDefinitions(unmarshalledDefinitions, jsitDefinitions); + } + final DMN12 dmn12 = Js.uncheckedCast(JsUtils.newWrappedInstance()); + JsUtils.setNameOnWrapped(dmn12, jsiName); + JsUtils.setValueOnWrapped(dmn12, jsitDefinitions); + MainJs.marshall(dmn12, jsitDefinitions.getNamespace(), jsCallback); + } catch (Exception e) { + GWT.log(e.getMessage(), e); + } + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/services/DMNClientServicesProxyImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/services/DMNClientServicesProxyImpl.java new file mode 100644 index 00000000000..c314ba563f2 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/services/DMNClientServicesProxyImpl.java @@ -0,0 +1,100 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.common.client.services; + +import java.util.Collections; +import java.util.List; + +import javax.enterprise.context.Dependent; + +import org.jboss.errai.common.client.api.ErrorCallback; +import org.jboss.errai.common.client.api.RemoteCallback; +import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; +import org.kie.workbench.common.dmn.api.editors.included.DMNIncludedModel; +import org.kie.workbench.common.dmn.api.editors.included.DMNIncludedNode; +import org.kie.workbench.common.dmn.api.editors.included.IncludedModel; +import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; +import org.kie.workbench.common.dmn.api.editors.included.PMMLIncludedModel; +import org.kie.workbench.common.dmn.api.editors.types.DMNSimpleTimeZone; +import org.kie.workbench.common.dmn.api.editors.types.RangeValue; +import org.kie.workbench.common.dmn.client.service.DMNClientServicesProxy; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.uberfire.backend.vfs.Path; + +@Dependent +public class DMNClientServicesProxyImpl implements DMNClientServicesProxy { + + @Override + public void loadModels(final Path path, + final ServiceCallback> callback) { + callback.onSuccess(Collections.emptyList()); + } + + @Override + public void loadNodesFromImports(final List includedModels, + final ServiceCallback> callback) { + callback.onSuccess(Collections.emptyList()); + } + + @Override + public void loadPMMLDocumentsFromImports(final Path path, + final List includedModels, + final ServiceCallback> callback) { + callback.onSuccess(Collections.emptyList()); + } + + @Override + public void loadItemDefinitionsByNamespace(final String modelName, String namespace, + final ServiceCallback> callback) { + callback.onSuccess(Collections.emptyList()); + } + + @Override + public void parseFEELList(final String source, + final ServiceCallback> callback) { + callback.onSuccess(Collections.emptyList()); + } + + @Override + public void parseRangeValue(final String source, + final ServiceCallback callback) { + callback.onSuccess(new RangeValue()); + } + + @Override + public void isValidVariableName(final String source, + final ServiceCallback callback) { + callback.onSuccess(true); + } + + @Override + public void getTimeZones(final ServiceCallback> callback) { + callback.onSuccess(Collections.emptyList()); + } + + RemoteCallback onSuccess(final ServiceCallback callback) { + return callback::onSuccess; + } + + ErrorCallback onError(final ServiceCallback callback) { + return (message, throwable) -> { + callback.onError(new ClientRuntimeError(throwable)); + return false; + }; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/services/DMNClientSideMarshalling.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/services/DMNClientSideMarshalling.java new file mode 100644 index 00000000000..b0e82669f66 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/services/DMNClientSideMarshalling.java @@ -0,0 +1,95 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.common.client.services; + +import java.util.Objects; + +import com.google.gwt.core.client.GWT; +import elemental2.promise.Promise; +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.MainJs; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.callbacks.DMN12MarshallCallback; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.DMN12; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDefinitions; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.DMNMarshallerKogitoMarshaller; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.JSIName; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.JsUtils; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.kogito.api.editor.DiagramType; +import org.kie.workbench.common.stunner.kogito.api.editor.impl.KogitoDiagramResourceImpl; +import org.uberfire.client.promise.Promises; + +/** + * Holder for the final client-side marshaller integration. + * These methods should be pasted into DMNClientDiagramServiceImpl + */ +@SuppressWarnings("unused") +public final class DMNClientSideMarshalling { + + private DMNMarshallerKogitoMarshaller dmnMarshallerKogitoMarshaller; + private Promises promises; + + public Promise transform(final KogitoDiagramResourceImpl resource) { + if (resource.getType() == DiagramType.PROJECT_DIAGRAM) { + return promises.create((resolveCallbackFn, rejectCallbackFn) -> { + if (resource.projectDiagram().isPresent()) { + final Diagram diagram = resource.projectDiagram().get(); + marshall(diagram, + resolveCallbackFn, + rejectCallbackFn); + } else { + rejectCallbackFn.onInvoke(new IllegalStateException("DiagramType is PROJECT_DIAGRAM however no instance present")); + } + }); + } + return promises.resolve(resource.xmlDiagram().orElse("DiagramType is XML_DIAGRAM however no instance present")); + } + + @SuppressWarnings("unchecked") + private void marshall(final Diagram diagram, + final Promise.PromiseExecutorCallbackFn.ResolveCallbackFn resolveCallbackFn, + final Promise.PromiseExecutorCallbackFn.RejectCallbackFn rejectCallbackFn) { + if (Objects.isNull(diagram)) { + return; + } + final Graph graph = diagram.getGraph(); + if (Objects.isNull(graph)) { + return; + } + + final DMN12MarshallCallback jsCallback = resolveCallbackFn::onInvoke; + + try { + final JSITDefinitions jsitDefinitions = dmnMarshallerKogitoMarshaller.marshall(graph); + final JSIName jsiName = JSITDefinitions.getJSIName(); + jsiName.setPrefix("dmn"); + jsiName.setLocalPart("definitions"); + final String key = "{" + jsiName.getNamespaceURI() + "}" + jsiName.getLocalPart(); + jsiName.setKey(key); + final String keyString = "{" + jsiName.getNamespaceURI() + "}" + jsiName.getPrefix() + ":" + jsiName.getLocalPart(); + jsiName.setString(keyString); + final DMN12 dmn12 = Js.uncheckedCast(JsUtils.newWrappedInstance()); + JsUtils.setNameOnWrapped(dmn12, jsiName); + JsUtils.setValueOnWrapped(dmn12, jsitDefinitions); + + MainJs.marshall(dmn12, jsitDefinitions.getNamespace(), jsCallback); + } catch (Exception e) { + GWT.log(e.getMessage(), e); + rejectCallbackFn.onInvoke(e); + } + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/session/DMNEditorSessionCommands.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/session/DMNEditorSessionCommands.java new file mode 100644 index 00000000000..e2faefe0420 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/session/DMNEditorSessionCommands.java @@ -0,0 +1,75 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.common.client.session; + +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; +import org.kie.workbench.common.dmn.webapp.kogito.common.client.session.command.SaveDiagramSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.ManagedClientSessionCommands; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToJpgSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPdfSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPngSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToRawFormatSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToSvgSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.PerformAutomaticLayoutCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.RedoSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.SwitchGridSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.UndoSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ValidateSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.VisitGraphSessionCommand; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; + +@Dependent +@DMNEditor +public class DMNEditorSessionCommands extends EditorSessionCommands { + + @Inject + public DMNEditorSessionCommands(final ManagedClientSessionCommands commands) { + super(commands); + } + + @Override + protected void registerCommands() { + getCommands().register(VisitGraphSessionCommand.class) + .register(SwitchGridSessionCommand.class) + .register(ClearSessionCommand.class) + .register(DeleteSelectionSessionCommand.class) + .register(UndoSessionCommand.class) + .register(RedoSessionCommand.class) + .register(ValidateSessionCommand.class) + .register(ExportToPngSessionCommand.class) + .register(ExportToJpgSessionCommand.class) + .register(ExportToPdfSessionCommand.class) + .register(ExportToSvgSessionCommand.class) + .register(ExportToRawFormatSessionCommand.class) + .register(CopySelectionSessionCommand.class) + .register(PasteSelectionSessionCommand.class) + .register(CutSelectionSessionCommand.class) + .register(SaveDiagramSessionCommand.class) + .register(PerformAutomaticLayoutCommand.class); + } + + public PerformAutomaticLayoutCommand getPerformAutomaticLayoutCommand() { + return get(PerformAutomaticLayoutCommand.class); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/session/command/SaveDiagramSessionCommand.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/session/command/SaveDiagramSessionCommand.java new file mode 100644 index 00000000000..73ae1d89f26 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/session/command/SaveDiagramSessionCommand.java @@ -0,0 +1,59 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.common.client.session.command; + +import javax.enterprise.context.Dependent; + +import org.kie.workbench.common.stunner.core.client.session.ClientSession; +import org.kie.workbench.common.stunner.core.client.session.command.AbstractClientSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; + +@Dependent +public class SaveDiagramSessionCommand extends AbstractClientSessionCommand { + + public SaveDiagramSessionCommand() { + super(false); + } + + @Override + @SuppressWarnings("unchecked") + public void execute(final Callback callback) { + //Do not automatically export a SVG diagram for the DMN Designer + } + + @Override + public boolean accepts(final ClientSession session) { + return false; + } + + /** + * This command is always disabled. + * @param enable Ignored. + */ + @Override + protected void enable(final boolean enable) { + super.enable(false); + } + + /** + * This command is always disabled. + * @param enabled Ignored. + */ + @Override + protected void setEnabled(final boolean enabled) { + super.setEnabled(false); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/workarounds/IsKogito.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/workarounds/IsKogito.java new file mode 100644 index 00000000000..ec837fae46a --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/workarounds/IsKogito.java @@ -0,0 +1,27 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.common.client.workarounds; + +import javax.enterprise.inject.Alternative; + +@Alternative +public class IsKogito extends org.kie.workbench.common.widgets.client.kogito.IsKogito { + + public boolean get() { + return true; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/META-INF/ErraiApp.properties b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/META-INF/ErraiApp.properties new file mode 100644 index 00000000000..8e054054463 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/META-INF/ErraiApp.properties @@ -0,0 +1,32 @@ +# +# Copyright 2019 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +# +# ErraiApp.properties +# +# Do not remove, even if empty! +# +# This is a marker file. When it is detected inside a JAR or at the +# top of any classpath, the subdirectories are scanned for deployable +# components. As such, all Errai application modules in a project +# should contain an ErraiApp.properties at the root of all classpaths +# that you wish to be scanned. +# +# There are also some configuration options that can be set in this +# file, although it is rarely necessary. See the documentation at +# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties +# for details. +errai.ioc.enabled.alternatives=org.kie.workbench.common.dmn.webapp.kogito.common.client.workarounds.IsKogito \ + org.uberfire.preferences.client.store.PreferenceBeanStoreClientImpl diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/META-INF/beans.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/META-INF/beans.xml new file mode 100644 index 00000000000..b14c5593e50 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/META-INF/beans.xml @@ -0,0 +1,20 @@ + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/META-INF/services/org.uberfire.java.nio.file.spi.FileSystemProvider b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/META-INF/services/org.uberfire.java.nio.file.spi.FileSystemProvider similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/META-INF/services/org.uberfire.java.nio.file.spi.FileSystemProvider rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/META-INF/services/org.uberfire.java.nio.file.spi.FileSystemProvider diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/application-roles.properties b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/application-roles.properties new file mode 100644 index 00000000000..f123f3f9768 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/application-roles.properties @@ -0,0 +1,16 @@ +# +# Copyright 2019 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +admin=admin diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/application-users.properties b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/application-users.properties new file mode 100644 index 00000000000..17da85d2cab --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/application-users.properties @@ -0,0 +1,16 @@ +# +# Copyright 2019 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +admin=207b6e0cc556d7084b5e2db7d822555c diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/log4j.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/log4j.xml new file mode 100644 index 00000000000..7d507224b58 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/log4j.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/logback.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/logback.xml new file mode 100644 index 00000000000..fe44d9cfca8 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/logback.xml @@ -0,0 +1,34 @@ + + + + + + + + + + %d [%t] %-5p %m%n + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/common/DMNWebappKogitoCommon.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/common/DMNWebappKogitoCommon.gwt.xml new file mode 100644 index 00000000000..88b1ab517de --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/common/DMNWebappKogitoCommon.gwt.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/org/uberfire/preferences/UberfirePreferencesClientBackend.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/org/uberfire/preferences/UberfirePreferencesClientBackend.gwt.xml new file mode 100644 index 00000000000..2ea4a51b4fa --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/org/uberfire/preferences/UberfirePreferencesClientBackend.gwt.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/project-defaults.yml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/project-defaults.yml new file mode 100644 index 00000000000..e380166f27f --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/project-defaults.yml @@ -0,0 +1,56 @@ +# Sample Swarm config for KIE Drools Workbench +swarm: + management: + blocking: + timeout: 900 # This might need to be higher if the jar has timeout issues on startup + security-realms: + ApplicationRealm: # almost the same as default config in WildFly 10.1.0.Final + local-authentication: + default-user: local + allowed-users: local + skip-group-loading: true + sasasasasasasasasasasasasasasasasasasasasasasasasasasaproperties-authentication: + path: application-users.properties + plain-text: true + properties-authorization: + path: application-roles.properties +# Optional logging + logging: + console-handlers: + CONSOLE: + level: INFO + named-formatter: COLOR_PATTERN + pattern-formatters: + PATTERN: + pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n" + COLOR_PATTERN: + pattern: "%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n" + periodic-rotating-file-handlers: + FILE: + file: + path: server.log + suffix: .yyyy-MM-dd + named-formatter: PATTERN + root-logger: + handlers: + - CONSOLE + - FILE + security: + security-domains: + other: + classic-authentication: + login-modules: + kieLoginModule: + code: org.kie.security.jaas.KieLoginModule + flag: optional + module: deployment.standalone-editor.war + +# This configuration is required to make the users system work. +org: + uberfire: + ext: + security: + management: + wildfly: + cli: + user: admin diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/security-management.properties b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/security-management.properties similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/security-management.properties rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/security-management.properties diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/security-policy.properties b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/security-policy.properties new file mode 100644 index 00000000000..8a2bf69170d --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/resources/security-policy.properties @@ -0,0 +1,48 @@ +# +# Copyright 2019 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# + +# +# Authorization Policy +# +# The entries in this file must comply with the following format: +# +# "classifier.identifier.setting.extra=value" +# +# classifier = role|group +# identifier = An existing role or group identifier (depending on the classifier type) +# setting = home|priority|permission +# extra = Extra setting information. Mandatory, for instance, to define a permission's name +# value = The setting value (depends on the setting selected). Value expected per setting type: +# +# - home: An existing perspective identifier to redirect after login +# - priority: An integer indicating how priority is this role|group compared to others. Used for conflict resolution. +# - permission: A name representing a specific feature or capability over a given resource. +# + +# Default settings +default.home=AuthoringPerspective +default.permission.perspective.create=true +default.permission.perspective.update=true +default.permission.perspective.delete=true +default.permission.perspective.read=true +default.permission.perspective.read.HomePerspective=true + +# Role "admin" +role.admin.permission.perspective.create=true +role.admin.permission.perspective.update=true +role.admin.permission.perspective.delete=true +role.admin.permission.perspective.read=true + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/.gitignore b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/.gitignore new file mode 100644 index 00000000000..dec81d54304 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/.gitignore @@ -0,0 +1,37 @@ +/target +/local + +/src/main/gwt-unitCache/ + +# Generated files +/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/JSIName.java +/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/JsUtils.java +/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/model/MainJs.java +/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/model/callbacks/ +/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/model/dc/ +/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/model/di/ +/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/model/dmn12/ +/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/model/dmndi12/ +/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/model/kie/ +/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/DC.js +/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/DI.js +/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/DMNDI12.js +/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/DMN12.js +/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/KIE.js + +# Copied from dependencies when packaged +/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/Jsonix-all.js + +# Eclipse, Netbeans and IntelliJ files +/.* +/**/.* +!.gitignore +/nbproject +*.ipr +*.iws +*.iml +**/gwt-unitCache/ + +# Repository wide ignore mac DS_Store files +.DS_Store + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/DevelopmentStatus.md b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/DevelopmentStatus.md new file mode 100644 index 00000000000..21e8915494c --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/DevelopmentStatus.md @@ -0,0 +1,22 @@ +Status of dmn verification +-------------------------- + + +DMN to test (src/test/resources) + +| FILE | STATUS (*) | OWNER | +|---|---|---| +|diagram-bkm-complex.dmn|D|gcardosi| +|diagram-bkm-simple.dmn|D|gcardosi| +|diagram-complex.dmn|D|gcardosi| +|diagram-decision-context.dmn|D|gcardosi| +|diagram-decision-decision-table.dmn|D|gcardosi| +|diagram-decision-function-definition.dmn|D|gcardosi| +|diagram-decision-invocation.dmn|D|gcardosi| +|diagram-decision-literal-expression.dmn|D|gcardosi| +|diagram-decision-relation.dmn|D|gcardosi| +|diagram-empty.dmn|D|gcardosi| +|diagram-input-data.dmn|D|gcardosi| +|diagram-knowledge-source.dmn|D|gcardosi| + +(*) STATUS: TBD = to be done; WIP = work in progress; D = done diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/pom.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/pom.xml new file mode 100644 index 00000000000..5bf345ba8a6 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/pom.xml @@ -0,0 +1,246 @@ + + + + + kie-wb-common-dmn + org.kie.workbench + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-dmn-webapp-kogito-marshaller + Kie Workbench - Common - DMN - Kogito Marshaller + Kie Workbench - Common - DMN - Kogito Marshaller + jar + + + 3.0.0 + 1.0d + 0.12.0 + 1.3 + 1.0.0-beta-1 + 0.14.0 + ${project.basedir}/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js + + + + + + org.kogito + gwt-jsonix-schema-compiler + ${version.gwt-jsonix-schema-compiler} + + + org.jvnet.jaxb2_commons + jaxb2-basics + ${version.jaxb2-basics} + + + org.jvnet.jaxb2_commons + jaxb2-namespace-prefix + ${version.jaxb2-namespace-prefix} + + + com.google.jsinterop + base + ${version.com.google.jsinterop.base} + + + + + + + com.google.jsinterop + jsinterop-annotations + + + com.google.jsinterop + base + + + + org.kie.workbench + kie-wb-common-dmn-api + + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-api + + + + com.google.gwt + gwt-user + + + junit + junit + test + + + + + + + org.apache.maven.plugins + maven-clean-plugin + + false + + + src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/model + + ** + + + + ${js.destination} + + DC.js + DI.js + DMNDI12.js + DMN12.js + KIE.js + Jsonix-all.js + + + + src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper + + JsUtils.java + JSIName.java + + + + + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + + + generate-javascript + generate-sources + + generate + + + true + false + false + false + + -Xgwtjsonix + -Xinheritance + -Xnamespace-prefix + -jsid=${project.build.sourceDirectory} + -jsmpkg=org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper + + + + org.kogito + gwt-jsonix-schema-compiler + + + org.jvnet.jaxb2_commons + jaxb2-basics + + + org.jvnet.jaxb2_commons + jaxb2-namespace-prefix + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-javascript + generate-sources + + copy + + + + + org.hisrc.jsonix + jsonix-scripts + ${version.jsonix-scripts} + js + all + ${js.destination} + Jsonix-all.js + + + + + + + + maven-antrun-plugin + + + move-generated-sources + process-sources + + false + + + + + + + + + + run + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/**/*, + org/kie/workbench/common/dmn/webapp/kogito/marshaller/jre/package-info.java, + org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/JsUtils.java, + org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/JSIName.java + + + + + + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + ${version.maven-jaxb2-plugin} + + + + + + \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/jre/javax/xml/XMLConstants.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/jre/javax/xml/XMLConstants.java new file mode 100644 index 00000000000..e45d043d50e --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/jre/javax/xml/XMLConstants.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package javax.xml; + +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsType; + +/** + * GWT Super-source version of javax.xml.XMLConstants. + */ +@SuppressWarnings("unused") +@JsType(namespace = JsPackage.GLOBAL) +public final class XMLConstants { + + public static final String NULL_NS_URI = ""; + + public static final String DEFAULT_NS_PREFIX = ""; + + public static final String XML_NS_URI = "http://www.w3.org/XML/1998/namespace"; + + public static final String XML_NS_PREFIX = "xml"; + + public static final String XMLNS_ATTRIBUTE_NS_URI = "http://www.w3.org/2000/xmlns/"; + + public static final String XMLNS_ATTRIBUTE = "xmlns"; + + public static final String W3C_XML_SCHEMA_NS_URI = "http://www.w3.org/2001/XMLSchema"; + + public static final String W3C_XML_SCHEMA_INSTANCE_NS_URI = "http://www.w3.org/2001/XMLSchema-instance"; + + public static final String W3C_XPATH_DATATYPE_NS_URI = "http://www.w3.org/2003/11/xpath-datatypes"; + + public static final String XML_DTD_NS_URI = "http://www.w3.org/TR/REC-xml"; + + public static final String RELAXNG_NS_URI = "http://relaxng.org/ns/structure/1.0"; + + public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing"; + + public static final String ACCESS_EXTERNAL_DTD = "http://javax.xml.XMLConstants/property/accessExternalDTD"; + + public static final String ACCESS_EXTERNAL_SCHEMA = "http://javax.xml.XMLConstants/property/accessExternalSchema"; + + public static final String ACCESS_EXTERNAL_STYLESHEET = "http://javax.xml.XMLConstants/property/accessExternalStylesheet"; +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/jre/javax/xml/namespace/QName.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/jre/javax/xml/namespace/QName.java new file mode 100644 index 00000000000..3ffe937f149 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/jre/javax/xml/namespace/QName.java @@ -0,0 +1,173 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package javax.xml.namespace; + +import java.util.Objects; + +import javax.xml.XMLConstants; + +import jsinterop.annotations.JsConstructor; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; +import org.kie.workbench.common.stunner.core.util.HashUtil; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +/** + * GWT Super-source version of javax.xml.namespace.QName. + */ +@JsType(namespace = JsPackage.GLOBAL) +public class QName { + + @JsProperty(name = "namespaceURI") + public final native String getNamespaceURI(); + + @JsProperty(name = "namespaceURI") + public final native void setNamespaceURI(final String namespaceURI); + + @JsProperty(name = "localPart") + public final native String getLocalPart(); + + @JsProperty(name = "localPart") + public final native void setLocalPart(final String localPart); + + @JsProperty(name = "prefix") + public final native String getPrefix(); + + @JsProperty(name = "prefix") + public final native void setPrefix(final String prefix); + + @JsProperty(name = "key") + public final native String getKey(); + + @JsProperty(name = "key") + public final native void setKey(String key); + + @JsProperty(name = "string") + public final native String getString(); + + @JsProperty(name = "string") + public final native void setString(String string); + + @JsConstructor + public QName(final String namespaceURI, + final String localPart, + final String prefix) { + if (Objects.isNull(namespaceURI)) { + setNamespaceURI(XMLConstants.NULL_NS_URI); + } else { + setNamespaceURI(namespaceURI); + } + + if (Objects.isNull(localPart)) { + throw new IllegalArgumentException("local part cannot be \"null\" when creating a QName"); + } + setLocalPart(localPart); + + if (Objects.isNull(prefix)) { + throw new IllegalArgumentException("prefix cannot be \"null\" when creating a QName"); + } + setPrefix(prefix); + + //jsonix JSON properties + setKey(toString()); + final String usedPrefix = !StringUtils.isEmpty(getPrefix()) ? getPrefix() + ":" : ""; + final String string = "{" + getNamespaceURI() + "}" + usedPrefix + getLocalPart(); + setString(string); + } + + @Override + public String toString() { + if (getNamespaceURI().equals(XMLConstants.NULL_NS_URI)) { + return getLocalPart(); + } else { + return "{" + getNamespaceURI() + "}" + getLocalPart(); + } + } + + /** + * See {@link javax.xml.namespace.QName#equals(Object)} + */ + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + final QName qName = (QName) o; + + if (!getNamespaceURI().equals(qName.getNamespaceURI())) { + return false; + } + return getLocalPart().equals(qName.getLocalPart()); + } + + /** + * See {@link javax.xml.namespace.QName#hashCode()} + */ + @Override + public int hashCode() { + return HashUtil.combineHashCodes(getNamespaceURI().hashCode(), + getLocalPart().hashCode()); + } + + public static QName valueOf(final String qNameAsString) { + + // null is not valid + if (Objects.isNull(qNameAsString)) { + throw new IllegalArgumentException("cannot create QName from \"null\""); + } + + // "" local part is valid to preserve compatible behavior with QName 1.0 + if (qNameAsString.length() == 0) { + return new javax.xml.namespace.QName(XMLConstants.NULL_NS_URI, + qNameAsString, + XMLConstants.DEFAULT_NS_PREFIX); + } + + // local part only? + if (qNameAsString.charAt(0) != '{') { + return new javax.xml.namespace.QName(XMLConstants.NULL_NS_URI, + qNameAsString, + XMLConstants.DEFAULT_NS_PREFIX); + } + + // Namespace URI improperly specified? + if (qNameAsString.startsWith("{" + XMLConstants.NULL_NS_URI + "}")) { + throw new IllegalArgumentException("Namespace URI .equals(XMLConstants.NULL_NS_URI), " + + ".equals(\"" + XMLConstants.NULL_NS_URI + "\"), " + + "only the local part, " + + "\"" + + qNameAsString.substring(2 + XMLConstants.NULL_NS_URI.length()) + + "\", " + + "should be provided."); + } + + // Namespace URI and local part specified + final int endOfNamespaceURI = qNameAsString.indexOf('}'); + if (endOfNamespaceURI == -1) { + throw new IllegalArgumentException("cannot create QName from \"" + + qNameAsString + + "\", missing closing \"}\""); + } + return new javax.xml.namespace.QName(qNameAsString.substring(1, endOfNamespaceURI), + qNameAsString.substring(endOfNamespaceURI + 1), + XMLConstants.DEFAULT_NS_PREFIX); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/jre/package-info.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/jre/package-info.java new file mode 100644 index 00000000000..5c05b3e8ce5 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/jre/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +/** + * Container for GWT "super source" files where GWT does not provide an emulation of JRE classes. + * See http://www.gwtproject.org/doc/latest/DevGuideOrganizingProjects.html + */ + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/package-info.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/package-info.java new file mode 100644 index 00000000000..17b6ba0e5e9 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +/** + * Container for generated GWT compatible model POJOs and jsonix JS. + */ +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.js; + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/DMNMarshallerImportsHelperKogito.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/DMNMarshallerImportsHelperKogito.java new file mode 100644 index 00000000000..1d089ad02fe --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/DMNMarshallerImportsHelperKogito.java @@ -0,0 +1,26 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper; + +import org.kie.workbench.common.dmn.api.marshalling.DMNMarshallerImportsHelper; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDefinitions; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITImport; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition; + +public interface DMNMarshallerImportsHelperKogito extends DMNMarshallerImportsHelper { + +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/DMNMarshallerImportsHelperKogitoImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/DMNMarshallerImportsHelperKogitoImpl.java new file mode 100644 index 00000000000..71d60daef24 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/DMNMarshallerImportsHelperKogitoImpl.java @@ -0,0 +1,84 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper; + +import java.io.InputStream; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import javax.enterprise.context.ApplicationScoped; + +import org.guvnor.common.services.project.model.WorkspaceProject; +import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDefinitions; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITImport; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.uberfire.backend.vfs.Path; + +@ApplicationScoped +public class DMNMarshallerImportsHelperKogitoImpl implements DMNMarshallerImportsHelperKogito { + + @Override + public Map getImportDefinitions(final Metadata metadata, + final List imports) { + return Collections.emptyMap(); + } + + @Override + public Map getPMMLDocuments(final Metadata metadata, + final List imports) { + return Collections.emptyMap(); + } + + @Override + public Map getImportXML(final Metadata metadata, + final List imports) { + return Collections.emptyMap(); + } + + @Override + public List getImportedDRGElements(final Map importDefinitions) { + return Collections.emptyList(); + } + + @Override + public List getImportedItemDefinitions(final Map importDefinitions) { + return Collections.emptyList(); + } + + @Override + public List getImportedItemDefinitionsByNamespace(final WorkspaceProject workspaceProject, + final String modelName, + final String namespace) { + return Collections.emptyList(); + } + + @Override + public Path getDMNModelPath(final Metadata metadata, + final String modelNamespace, + final String modelName) { + throw new UnsupportedOperationException("Imports are not supported in the kogito-based editors."); + } + + @Override + public Optional loadPath(final Path path) { + return Optional.empty(); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/DMNMarshallerKogitoMarshaller.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/DMNMarshallerKogitoMarshaller.java new file mode 100644 index 00000000000..ddcbcb7fe35 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/DMNMarshallerKogitoMarshaller.java @@ -0,0 +1,339 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Consumer; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.DMNViewDefinition; +import org.kie.workbench.common.dmn.api.definition.model.Association; +import org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel; +import org.kie.workbench.common.dmn.api.definition.model.DMNDiagram; +import org.kie.workbench.common.dmn.api.definition.model.DMNElement; +import org.kie.workbench.common.dmn.api.definition.model.DRGElement; +import org.kie.workbench.common.dmn.api.definition.model.Decision; +import org.kie.workbench.common.dmn.api.definition.model.DecisionService; +import org.kie.workbench.common.dmn.api.definition.model.Definitions; +import org.kie.workbench.common.dmn.api.definition.model.InputData; +import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeSource; +import org.kie.workbench.common.dmn.api.definition.model.TextAnnotation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.MainJs; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.di.JSIDiagramElement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITAssociation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITBusinessKnowledgeModel; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDecision; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDecisionService; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDefinitions; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInputData; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITKnowledgeSource; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITTextAnnotation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNDI; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNDiagram; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNEdge; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentsWidthsExtension; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.AssociationConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.BusinessKnowledgeModelConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.DecisionConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.DecisionServiceConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.DefinitionsConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.InputDataConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.KnowledgeSourceConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.TextAnnotationConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.DMNMarshallerUtils; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.ControlPoint; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; + +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.upperLeftBound; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.xOfBound; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.yOfBound; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.WrapperUtils.getWrappedJSIDMNEdge; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.WrapperUtils.getWrappedJSIDMNShape; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.WrapperUtils.getWrappedJSITAssociation; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.WrapperUtils.getWrappedJSITComponentsWidthsExtension; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.WrapperUtils.getWrappedJSITDRGElement; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.WrapperUtils.getWrappedJSITTextAnnotation; + +@ApplicationScoped +public class DMNMarshallerKogitoMarshaller { + + public static final String PREFIX = "dmn"; + + public enum JSINodeLocalPartName { + + UNKNOWN("UNKNOWN"), + BUSINESS_KNOWLEDGE_MODEL("businessKnowledgeModel"), + DECISION("decision"), + DECISION_SERVICE("decisionService"), + INPUT_DATA("inputData"), + KNOWLEDGE_SOURCE("knowledgeSource"); + + private String localPart; + + JSINodeLocalPartName(final String localPart) { + this.localPart = localPart; + } + + public String getLocalPart() { + return localPart; + } + } + + private InputDataConverter inputDataConverter; + private DecisionConverter decisionConverter; + private BusinessKnowledgeModelConverter bkmConverter; + private KnowledgeSourceConverter knowledgeSourceConverter; + private TextAnnotationConverter textAnnotationConverter; + private DecisionServiceConverter decisionServiceConverter; + + protected DMNMarshallerKogitoMarshaller() { + this(null); + } + + @Inject + public DMNMarshallerKogitoMarshaller(final FactoryManager factoryManager) { + this.inputDataConverter = new InputDataConverter(factoryManager); + this.decisionConverter = new DecisionConverter(factoryManager); + this.bkmConverter = new BusinessKnowledgeModelConverter(factoryManager); + this.knowledgeSourceConverter = new KnowledgeSourceConverter(factoryManager); + this.textAnnotationConverter = new TextAnnotationConverter(factoryManager); + this.decisionServiceConverter = new DecisionServiceConverter(factoryManager); + } + + @PostConstruct + public void init() { + MainJs.initializeJsInteropConstructors(MainJs.getConstructorsMap()); + } + + // ================================== + // MARSHALL + // ================================== + + @SuppressWarnings("unchecked") + public JSITDefinitions marshall(final Graph> graph) { + final Map nodes = new HashMap<>(); + final Map textAnnotations = new HashMap<>(); + final Node, ?> dmnDiagramRoot = (Node, ?>) DMNMarshallerUtils.findDMNDiagramRoot(graph); + final Definitions definitionsStunnerPojo = dmnDiagramRoot.getContent().getDefinition().getDefinitions(); + final List dmnEdges = new ArrayList<>(); + + cleanImportedItemDefinitions(definitionsStunnerPojo); + + final JSITDefinitions definitions = DefinitionsConverter.dmnFromWB(definitionsStunnerPojo); + if (Objects.isNull(definitions.getExtensionElements())) { + JSITDMNElement.JSIExtensionElements jsiExtensionElements = new JSITDMNElement.JSIExtensionElements(); + definitions.setExtensionElements(jsiExtensionElements); + } + + if (Objects.isNull(definitions.getDMNDI())) { + definitions.setDMNDI(new JSIDMNDI()); + } + final JSIDMNDiagram dmnDDDMNDiagram = new JSIDMNDiagram(); + // TODO {gcardosi} add because present in original json + dmnDDDMNDiagram.setDMNDiagramElement(new ArrayList<>()); + definitions.getDMNDI().addDMNDiagram(dmnDDDMNDiagram); + + //Convert relative positioning to absolute + for (Node node : graph.nodes()) { + PointUtils.convertToAbsoluteBounds(node); + } + + //Setup callback for marshalling ComponentWidths + if (Objects.isNull(dmnDDDMNDiagram.getExtension())) { + dmnDDDMNDiagram.setExtension(new JSIDiagramElement.JSIExtension()); + } + final JSITComponentsWidthsExtension componentsWidthsExtension = new JSITComponentsWidthsExtension(); + final JSIDiagramElement.JSIExtension extension = dmnDDDMNDiagram.getExtension(); + JSITComponentsWidthsExtension wrappedComponentsWidthsExtension = getWrappedJSITComponentsWidthsExtension(componentsWidthsExtension); + extension.addAny(wrappedComponentsWidthsExtension); + + final Consumer componentWidthsConsumer = (cw) -> componentsWidthsExtension.addComponentWidths(cw); + + //Iterate Graph processing nodes.. + for (Node node : graph.nodes()) { + if (node.getContent() instanceof View) { + final View view = (View) node.getContent(); + if (view.getDefinition() instanceof DRGElement) { + final DRGElement drgElement = (DRGElement) view.getDefinition(); + if (!drgElement.isAllowOnlyVisualChange()) { + nodes.put(drgElement.getId().getValue(), + stunnerToDMN(node, + componentWidthsConsumer)); + } + + final String namespaceURI = definitionsStunnerPojo.getDefaultNamespace(); + dmnDDDMNDiagram.addDMNDiagramElement(getWrappedJSIDMNShape((View) view, + namespaceURI)); + } else if (view.getDefinition() instanceof TextAnnotation) { + final TextAnnotation textAnnotation = (TextAnnotation) view.getDefinition(); + textAnnotations.put(textAnnotation.getId().getValue(), + textAnnotationConverter.dmnFromNode((Node, ?>) node, + componentWidthsConsumer)); + final String namespaceURI = definitionsStunnerPojo.getDefaultNamespace(); + dmnDDDMNDiagram.addDMNDiagramElement(getWrappedJSIDMNShape((View) view, + namespaceURI)); + + final List associations = AssociationConverter.dmnFromWB((Node, ?>) node); + for (int i = 0; i < associations.size(); i++) { + final JSITAssociation wrappedJSITAssociation = getWrappedJSITAssociation(Js.uncheckedCast(associations.get(i))); + definitions.addArtifact(wrappedJSITAssociation); + } + } + + // DMNDI Edge management. + final List> inEdges = (List>) node.getInEdges(); + for (Edge e : inEdges) { + if (e.getContent() instanceof ViewConnector) { + final ViewConnector connectionContent = (ViewConnector) e.getContent(); + if (connectionContent.getSourceConnection().isPresent() && connectionContent.getTargetConnection().isPresent()) { + Point2D sourcePoint = ((Connection) connectionContent.getSourceConnection().get()).getLocation(); + Point2D targetPoint = ((Connection) connectionContent.getTargetConnection().get()).getLocation(); + final Node sourceNode = e.getSourceNode(); + final View sourceView = (View) sourceNode.getContent(); + double xSource = xOfBound(upperLeftBound(sourceView)); + double ySource = yOfBound(upperLeftBound(sourceView)); + double xTarget = xOfBound(upperLeftBound(view)); + double yTarget = yOfBound(upperLeftBound(view)); + if (Objects.isNull(sourcePoint)) { + // If the "connection source/target location is null" assume it's the centre of the shape. + if (sourceView.getDefinition() instanceof DMNViewDefinition) { + DMNViewDefinition dmnViewDefinition = (DMNViewDefinition) sourceView.getDefinition(); + xSource += dmnViewDefinition.getDimensionsSet().getWidth().getValue() / 2; + ySource += dmnViewDefinition.getDimensionsSet().getHeight().getValue() / 2; + } + sourcePoint = Point2D.create(xSource, ySource); + } else { + // If it is non-null it is relative to the source/target shape location. + sourcePoint = Point2D.create(xSource + sourcePoint.getX(), ySource + sourcePoint.getY()); + } + if (Objects.isNull(targetPoint)) { + // If the "connection source/target location is null" assume it's the centre of the shape. + if (view.getDefinition() instanceof DMNViewDefinition) { + DMNViewDefinition dmnViewDefinition = (DMNViewDefinition) view.getDefinition(); + xTarget += dmnViewDefinition.getDimensionsSet().getWidth().getValue() / 2; + yTarget += dmnViewDefinition.getDimensionsSet().getHeight().getValue() / 2; + } + targetPoint = Point2D.create(xTarget, yTarget); + } else { + // If it is non-null it is relative to the source/target shape location. + targetPoint = Point2D.create(xTarget + targetPoint.getX(), yTarget + targetPoint.getY()); + } + + final JSIDMNEdge dmnEdge = new JSIDMNEdge(); + // DMNDI edge elementRef is uuid of Stunner edge, + // with the only exception when edge contains as content a DMN Association (Association is an edge) + String uuid = e.getUUID(); + if (e.getContent() instanceof View) { + final View edgeView = (View) e.getContent(); + if (edgeView.getDefinition() instanceof Association) { + uuid = ((Association) edgeView.getDefinition()).getId().getValue(); + } + } + dmnEdge.setId("dmnedge-" + uuid); + final String namespaceURI = definitionsStunnerPojo.getDefaultNamespace(); + dmnEdge.setDmnElementRef(new QName(namespaceURI, + uuid, + XMLConstants.DEFAULT_NS_PREFIX)); + dmnEdge.addWaypoint(PointUtils.point2dToDMNDIPoint(sourcePoint)); + for (ControlPoint cp : connectionContent.getControlPoints()) { + dmnEdge.addWaypoint(PointUtils.point2dToDMNDIPoint(cp.getLocation())); + } + dmnEdge.addWaypoint(PointUtils.point2dToDMNDIPoint(targetPoint)); + dmnEdges.add(dmnEdge); + } + } + } + } + } + nodes.values().forEach(n -> { + JSINodeLocalPartName localPart = JSINodeLocalPartName.UNKNOWN; + if (JSITBusinessKnowledgeModel.instanceOf(n)) { + localPart = JSINodeLocalPartName.BUSINESS_KNOWLEDGE_MODEL; + } else if (JSITDecision.instanceOf(n)) { + localPart = JSINodeLocalPartName.DECISION; + } else if (JSITDecisionService.instanceOf(n)) { + localPart = JSINodeLocalPartName.DECISION_SERVICE; + } else if (JSITInputData.instanceOf(n)) { + localPart = JSINodeLocalPartName.INPUT_DATA; + } else if (JSITKnowledgeSource.instanceOf(n)) { + localPart = JSINodeLocalPartName.KNOWLEDGE_SOURCE; + } + final JSITDRGElement toAdd = getWrappedJSITDRGElement(n, PREFIX, localPart.getLocalPart()); + definitions.addDrgElement(toAdd); + }); + textAnnotations.values().forEach(text -> { + final JSITTextAnnotation wrappedText = getWrappedJSITTextAnnotation(text); + definitions.addArtifact(wrappedText); + }); + for (int i = 0; i < dmnEdges.size(); i++) { + dmnDDDMNDiagram.addDMNDiagramElement(getWrappedJSIDMNEdge(Js.uncheckedCast(dmnEdges.get(i)))); + } + return definitions; + } + + void cleanImportedItemDefinitions(final Definitions definitions) { + definitions.getItemDefinition().removeIf(ItemDefinition::isAllowOnlyVisualChange); + } + + @SuppressWarnings("unchecked") + public JSITDRGElement stunnerToDMN(final Node node, + final Consumer componentWidthsConsumer) { + if (node.getContent() instanceof View) { + final View view = (View) node.getContent(); + if (view.getDefinition() instanceof InputData) { + return inputDataConverter.dmnFromNode((Node, ?>) node, + componentWidthsConsumer); + } else if (view.getDefinition() instanceof Decision) { + return decisionConverter.dmnFromNode((Node, ?>) node, + componentWidthsConsumer); + } else if (view.getDefinition() instanceof BusinessKnowledgeModel) { + return bkmConverter.dmnFromNode((Node, ?>) node, + componentWidthsConsumer); + } else if (view.getDefinition() instanceof KnowledgeSource) { + return knowledgeSourceConverter.dmnFromNode((Node, ?>) node, + componentWidthsConsumer); + } else if (view.getDefinition() instanceof DecisionService) { + return decisionServiceConverter.dmnFromNode((Node, ?>) node, + componentWidthsConsumer); + } else { + throw new UnsupportedOperationException("Unsupported View type [" + view.getDefinition().getClass().getName() + "]"); + } + } + throw new RuntimeException("wrong diagram structure to marshall"); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/DMNMarshallerKogitoUnmarshaller.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/DMNMarshallerKogitoUnmarshaller.java new file mode 100644 index 00000000000..5a2fdb350a7 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/DMNMarshallerKogitoUnmarshaller.java @@ -0,0 +1,1049 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper; + +import java.util.AbstractMap; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.DMNDefinitionSet; +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.Association; +import org.kie.workbench.common.dmn.api.definition.model.AuthorityRequirement; +import org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel; +import org.kie.workbench.common.dmn.api.definition.model.DMNDiagram; +import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase; +import org.kie.workbench.common.dmn.api.definition.model.DRGElement; +import org.kie.workbench.common.dmn.api.definition.model.Decision; +import org.kie.workbench.common.dmn.api.definition.model.DecisionService; +import org.kie.workbench.common.dmn.api.definition.model.Definitions; +import org.kie.workbench.common.dmn.api.definition.model.InformationRequirement; +import org.kie.workbench.common.dmn.api.definition.model.InputData; +import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeRequirement; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeSource; +import org.kie.workbench.common.dmn.api.definition.model.TextAnnotation; +import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; +import org.kie.workbench.common.dmn.api.property.background.BackgroundSet; +import org.kie.workbench.common.dmn.api.property.background.BgColour; +import org.kie.workbench.common.dmn.api.property.background.BorderColour; +import org.kie.workbench.common.dmn.api.property.dimensions.Height; +import org.kie.workbench.common.dmn.api.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.dmn.api.property.dimensions.Width; +import org.kie.workbench.common.dmn.api.property.dmn.DecisionServiceDividerLineY; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.font.FontSet; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.MainJs; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dc.JSIPoint; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.di.JSIDiagramElement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.di.JSIStyle; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITArtifact; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITAssociation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITAuthorityRequirement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITBusinessKnowledgeModel; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElementReference; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDecision; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDecisionService; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDefinitions; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITImport; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationRequirement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInputData; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITKnowledgeRequirement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITKnowledgeSource; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITTextAnnotation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNDecisionServiceDividerLine; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNDiagram; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNEdge; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNShape; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNStyle; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentsWidthsExtension; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.BusinessKnowledgeModelConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.DecisionConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.DecisionServiceConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.DefinitionsConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.IdPropertyConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.InputDataConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.ItemDefinitionPropertyConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.KnowledgeSourceConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.TextAnnotationConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.ColorUtils; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.FontSetPropertyConverter; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.DMNMarshallerUtils; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.NameSpaceUtils; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bound; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Child; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.ControlPoint; +import org.kie.workbench.common.stunner.core.graph.content.view.MagnetConnection; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; +import org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl; +import org.kie.workbench.common.stunner.core.util.DefinitionUtils; +import org.kie.workbench.common.stunner.core.util.StringUtils; +import org.kie.workbench.common.stunner.core.util.UUID; + +import static java.util.stream.Collectors.toList; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.heightOfShape; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.lowerRightBound; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.upperLeftBound; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.widthOfShape; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.xOfBound; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.xOfShape; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.yOfBound; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.yOfShape; +import static org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId; + +@ApplicationScoped +public class DMNMarshallerKogitoUnmarshaller { + + private static final String INFO_REQ_ID = getDefinitionId(InformationRequirement.class); + private static final String KNOWLEDGE_REQ_ID = getDefinitionId(KnowledgeRequirement.class); + private static final String AUTH_REQ_ID = getDefinitionId(AuthorityRequirement.class); + private static final String ASSOCIATION_ID = getDefinitionId(Association.class); + + private static final double CENTRE_TOLERANCE = 1.0; + + private final FactoryManager factoryManager; + private final DMNMarshallerImportsHelperKogito dmnMarshallerImportsHelper; + + private InputDataConverter inputDataConverter; + private DecisionConverter decisionConverter; + private BusinessKnowledgeModelConverter bkmConverter; + private KnowledgeSourceConverter knowledgeSourceConverter; + private TextAnnotationConverter textAnnotationConverter; + private DecisionServiceConverter decisionServiceConverter; + + protected DMNMarshallerKogitoUnmarshaller() { + this(null, null); + } + + @Inject + public DMNMarshallerKogitoUnmarshaller(final FactoryManager factoryManager, + final DMNMarshallerImportsHelperKogito dmnMarshallerImportsHelper) { + this.factoryManager = factoryManager; + this.dmnMarshallerImportsHelper = dmnMarshallerImportsHelper; + + this.inputDataConverter = new InputDataConverter(factoryManager); + this.decisionConverter = new DecisionConverter(factoryManager); + this.bkmConverter = new BusinessKnowledgeModelConverter(factoryManager); + this.knowledgeSourceConverter = new KnowledgeSourceConverter(factoryManager); + this.textAnnotationConverter = new TextAnnotationConverter(factoryManager); + this.decisionServiceConverter = new DecisionServiceConverter(factoryManager); + } + + @PostConstruct + public void init() { + MainJs.initializeJsInteropConstructors(MainJs.getConstructorsMap()); + } + + // ================================== + // UNMARSHALL + // ================================== + + @SuppressWarnings("unchecked") + public Graph unmarshall(final Metadata metadata, + final JSITDefinitions jsiDefinitions) { + final Map hasComponentWidthsMap = new HashMap<>(); + final BiConsumer hasComponentWidthsConsumer = (uuid, hcw) -> { + if (Objects.nonNull(uuid)) { + hasComponentWidthsMap.put(uuid, hcw); + } + }; + + final List diagramDrgElements = jsiDefinitions.getDrgElement(); + final Optional dmnDDDiagram = findJSIDiagram(jsiDefinitions); + + // Get external DMN model information + final Map importDefinitions = dmnMarshallerImportsHelper.getImportDefinitions(metadata, jsiDefinitions.getImport()); + + // Get external PMML model information + final Map pmmlDocuments = dmnMarshallerImportsHelper.getPMMLDocuments(metadata, jsiDefinitions.getImport()); + + // Map external DRGElements + final List dmnShapes = new ArrayList<>(); + final List importedDrgElements = new ArrayList<>(); + if (dmnDDDiagram.isPresent()) { + final JSIDMNDiagram jsidmnDiagram = Js.uncheckedCast(dmnDDDiagram.get()); + dmnShapes.addAll(getUniqueDMNShapes(jsidmnDiagram)); + importedDrgElements.addAll(getImportedDrgElementsByShape(dmnShapes, + importDefinitions, + jsiDefinitions)); + } + + // Combine all explicit and imported elements into one + final List drgElements = new ArrayList<>(); + final Set dmnDecisionServices = new HashSet<>(); + drgElements.addAll(diagramDrgElements); + drgElements.addAll(importedDrgElements); + + // Remove DRGElements that doesn't have any local or imported shape. + removeDrgElementsWithoutShape(drgElements, dmnShapes); + + // Main conversion from DMN to Stunner + final Map> elems = new HashMap<>(); + for (int i = 0; i < drgElements.size(); i++) { + final JSITDRGElement drgElement = Js.uncheckedCast(drgElements.get(i)); + final String id = drgElement.getId(); + final Node stunnerNode = dmnToStunner(drgElement, + hasComponentWidthsConsumer, + importedDrgElements); + elems.put(id, + new AbstractMap.SimpleEntry<>(drgElement, stunnerNode)); + } + + // Stunner rely on relative positioning for Edge connections, so need to cycle on DMNShape first. + for (Entry kv : elems.values()) { + ddExtAugmentStunner(dmnDDDiagram, kv.getValue()); + } + + // Setup Node Relationships and Connections all based on absolute positioning + for (Entry kv : elems.values()) { + final JSITDRGElement element = Js.uncheckedCast(kv.getKey()); + final Node currentNode = kv.getValue(); + + // For imported nodes, we don't have its connections + if (isImportedDRGElement(importedDrgElements, element)) { + continue; + } + + // DMN spec table 2: Requirements connection rules + if (JSITDecision.instanceOf(element)) { + final JSITDecision decision = Js.uncheckedCast(element); + final List jsiInformationRequirements = decision.getInformationRequirement(); + for (int i = 0; i < jsiInformationRequirements.size(); i++) { + final JSITInformationRequirement ir = Js.uncheckedCast(jsiInformationRequirements.get(i)); + connectEdgeToNodes(INFO_REQ_ID, + ir, + ir.getRequiredInput(), + elems, + jsiDefinitions, + currentNode); + connectEdgeToNodes(INFO_REQ_ID, + ir, + ir.getRequiredDecision(), + elems, + jsiDefinitions, + currentNode); + } + final List jsiKnowledgeRequirements = decision.getKnowledgeRequirement(); + for (int i = 0; i < jsiKnowledgeRequirements.size(); i++) { + final JSITKnowledgeRequirement kr = Js.uncheckedCast(jsiKnowledgeRequirements.get(i)); + connectEdgeToNodes(KNOWLEDGE_REQ_ID, + kr, + kr.getRequiredKnowledge(), + elems, + jsiDefinitions, + currentNode); + } + final List jsiAuthorityRequirements = decision.getAuthorityRequirement(); + for (int i = 0; i < jsiAuthorityRequirements.size(); i++) { + final JSITAuthorityRequirement ar = Js.uncheckedCast(jsiAuthorityRequirements.get(i)); + connectEdgeToNodes(AUTH_REQ_ID, + ar, + ar.getRequiredAuthority(), + elems, + jsiDefinitions, + currentNode); + } + } else if (JSITBusinessKnowledgeModel.instanceOf(element)) { + final JSITBusinessKnowledgeModel bkm = Js.uncheckedCast(element); + final List jsiKnowledgeRequirements = bkm.getKnowledgeRequirement(); + for (int i = 0; i < jsiKnowledgeRequirements.size(); i++) { + final JSITKnowledgeRequirement kr = Js.uncheckedCast(jsiKnowledgeRequirements.get(i)); + connectEdgeToNodes(KNOWLEDGE_REQ_ID, + kr, + kr.getRequiredKnowledge(), + elems, + jsiDefinitions, + currentNode); + } + final List jsiAuthorityRequirements = bkm.getAuthorityRequirement(); + for (int i = 0; i < jsiAuthorityRequirements.size(); i++) { + final JSITAuthorityRequirement ar = Js.uncheckedCast(jsiAuthorityRequirements.get(i)); + connectEdgeToNodes(AUTH_REQ_ID, + ar, + ar.getRequiredAuthority(), + elems, + jsiDefinitions, + currentNode); + } + } else if (JSITKnowledgeSource.instanceOf(element)) { + final JSITKnowledgeSource ks = Js.uncheckedCast(element); + final List jsiAuthorityRequirements = ks.getAuthorityRequirement(); + for (int i = 0; i < jsiAuthorityRequirements.size(); i++) { + final JSITAuthorityRequirement ar = Js.uncheckedCast(jsiAuthorityRequirements.get(i)); + connectEdgeToNodes(AUTH_REQ_ID, + ar, + ar.getRequiredInput(), + elems, + jsiDefinitions, + currentNode); + connectEdgeToNodes(AUTH_REQ_ID, + ar, + ar.getRequiredDecision(), + elems, + jsiDefinitions, + currentNode); + connectEdgeToNodes(AUTH_REQ_ID, + ar, + ar.getRequiredAuthority(), + elems, + jsiDefinitions, + currentNode); + } + } else if (JSITDecisionService.instanceOf(element)) { + final JSITDecisionService ds = Js.uncheckedCast(element); + dmnDecisionServices.add(ds); + final List jsiEncapsulatedDecisions = ds.getEncapsulatedDecision(); + for (int i = 0; i < jsiEncapsulatedDecisions.size(); i++) { + final JSITDMNElementReference er = Js.uncheckedCast(jsiEncapsulatedDecisions.get(i)); + final String reqInputID = getId(er); + final Node requiredNode = getRequiredNode(elems, reqInputID); + if (Objects.nonNull(requiredNode)) { + connectDSChildEdge(currentNode, requiredNode); + } + } + final List jsiOutputDecisions = ds.getOutputDecision(); + for (int i = 0; i < jsiOutputDecisions.size(); i++) { + final JSITDMNElementReference er = Js.uncheckedCast(jsiOutputDecisions.get(i)); + final String reqInputID = getId(er); + final Node requiredNode = getRequiredNode(elems, reqInputID); + if (Objects.nonNull(requiredNode)) { + connectDSChildEdge(currentNode, requiredNode); + } + } + } + } + + final Map, ?>> textAnnotations = new HashMap<>(); + final List jsiArtifacts = jsiDefinitions.getArtifact(); + for (int i = 0; i < jsiArtifacts.size(); i++) { + final JSITArtifact jsiArtifact = Js.uncheckedCast(jsiArtifacts.get(i)); + if (JSITTextAnnotation.instanceOf(jsiArtifact)) { + final String id = jsiArtifact.getId(); + final JSITTextAnnotation jsiTextAnnotation = Js.uncheckedCast(jsiArtifact); + final Node, ?> textAnnotation = textAnnotationConverter.nodeFromDMN(jsiTextAnnotation, + hasComponentWidthsConsumer); + textAnnotations.put(id, + textAnnotation); + } + } + textAnnotations.values().forEach(n -> ddExtAugmentStunner(dmnDDDiagram, n)); + + final List associations = new ArrayList<>(); + for (int i = 0; i < jsiArtifacts.size(); i++) { + final JSITArtifact jsiArtifact = Js.uncheckedCast(jsiArtifacts.get(i)); + if (JSITAssociation.instanceOf(jsiArtifact)) { + final JSITAssociation jsiAssociation = Js.uncheckedCast(jsiArtifact); + associations.add(jsiAssociation); + } + } + for (int i = 0; i < associations.size(); i++) { + final JSITAssociation jsiAssociation = Js.uncheckedCast(associations.get(i)); + final String sourceId = getId(jsiAssociation.getSourceRef()); + final Node sourceNode = Optional.ofNullable(elems.get(sourceId)).map(Entry::getValue).orElse(textAnnotations.get(sourceId)); + + final String targetId = getId(jsiAssociation.getTargetRef()); + final Node targetNode = Optional.ofNullable(elems.get(targetId)).map(Entry::getValue).orElse(textAnnotations.get(targetId)); + + @SuppressWarnings("unchecked") + final Edge, ?> myEdge = (Edge, ?>) factoryManager.newElement(idOfDMNorWBUUID(jsiAssociation), + ASSOCIATION_ID).asEdge(); + + final Id id = IdPropertyConverter.wbFromDMN(jsiAssociation.getId()); + final Description description = new Description(jsiAssociation.getDescription()); + final Association definition = new Association(id, description); + myEdge.getContent().setDefinition(definition); + + connectEdge(myEdge, + sourceNode, + targetNode); + setConnectionMagnets(myEdge, jsiAssociation.getId(), jsiDefinitions); + } + + //Ensure all locations are updated to relative for Stunner + for (Entry kv : elems.values()) { + PointUtils.convertToRelativeBounds(kv.getValue()); + } + + final Graph graph = factoryManager.newDiagram("prova", + BindableAdapterUtils.getDefinitionSetId(DMNDefinitionSet.class), + metadata).getGraph(); + elems.values().stream().map(Entry::getValue).forEach(graph::addNode); + textAnnotations.values().forEach(graph::addNode); + + final Node dmnDiagramRoot = DMNMarshallerUtils.findDMNDiagramRoot(graph); + final Definitions definitionsStunnerPojo = DefinitionsConverter.wbFromDMN(jsiDefinitions, + importDefinitions, + pmmlDocuments); + loadImportedItemDefinitions(definitionsStunnerPojo, importDefinitions); + ((View) dmnDiagramRoot.getContent()).getDefinition().setDefinitions(definitionsStunnerPojo); + + //Only connect Nodes to the Diagram that are not referenced by DecisionServices + final List references = new ArrayList<>(); + final List lstDecisionServices = new ArrayList<>(dmnDecisionServices); + for (int iDS = 0; iDS < lstDecisionServices.size(); iDS++) { + final JSITDecisionService jsiDecisionService = Js.uncheckedCast(lstDecisionServices.get(iDS)); + final List jsiEncapsulatedDecisions = jsiDecisionService.getEncapsulatedDecision(); + if (Objects.nonNull(jsiEncapsulatedDecisions)) { + for (int i = 0; i < jsiEncapsulatedDecisions.size(); i++) { + final JSITDMNElementReference jsiEncapsulatedDecision = Js.uncheckedCast(jsiEncapsulatedDecisions.get(i)); + references.add(jsiEncapsulatedDecision.getHref()); + } + } + + final List jsiOutputDecisions = jsiDecisionService.getOutputDecision(); + if (Objects.nonNull(jsiOutputDecisions)) { + for (int i = 0; i < jsiOutputDecisions.size(); i++) { + final JSITDMNElementReference jsiOutputDecision = Js.uncheckedCast(jsiOutputDecisions.get(i)); + references.add(jsiOutputDecision.getHref()); + } + } + } + + final Map elementsToConnectToRoot = new HashMap<>(); + for (Entry kv : elems.values()) { + final JSITDRGElement element = Js.uncheckedCast(kv.getKey()); + final Node node = kv.getValue(); + if (!references.contains("#" + element.getId())) { + elementsToConnectToRoot.put(element, node); + } + } + elementsToConnectToRoot.values().forEach(node -> connectRootWithChild(dmnDiagramRoot, node)); + textAnnotations.values().forEach(node -> connectRootWithChild(dmnDiagramRoot, node)); + + //Copy ComponentWidths information + final Optional extension = findComponentsWidthsExtension(dmnDDDiagram); + extension.ifPresent(componentsWidthsExtension -> { + //This condition is required because a node with ComponentsWidthsExtension + //can be imported from another diagram but the extension is not imported or present in this diagram. + if (Objects.nonNull(componentsWidthsExtension.getComponentWidths())) { + hasComponentWidthsMap.entrySet().forEach(es -> { + final List jsiComponentWidths = componentsWidthsExtension.getComponentWidths(); + for (int i = 0; i < jsiComponentWidths.size(); i++) { + final JSITComponentWidths jsiWidths = Js.uncheckedCast(jsiComponentWidths.get(i)); + if (Objects.equals(jsiWidths.getDmnElementRef(), es.getKey())) { + final List widths = es.getValue().getComponentWidths(); + if (Objects.nonNull(jsiWidths.getWidth())) { + widths.clear(); + for (int w = 0; w < jsiWidths.getWidth().size(); w++) { + final double width = jsiWidths.getWidth().get(w).doubleValue(); + widths.add(width); + } + } + } + } + }); + } + }); + + return graph; + } + + private Optional findJSIDiagram(final JSITDefinitions dmnXml) { + if (Objects.isNull(dmnXml.getDMNDI())) { + return Optional.empty(); + } + final List elems = dmnXml.getDMNDI().getDMNDiagram(); + if (elems.size() != 1) { + return Optional.empty(); + } else { + return Optional.of(Js.uncheckedCast(elems.get(0))); + } + } + + private void removeDrgElementsWithoutShape(final List drgElements, + final List dmnShapes) { + // DMN 1.1 doesn't have DMNShape, so we include all DRGElements and create all the shapes. + if (dmnShapes.isEmpty()) { + return; + } + + drgElements.removeIf(element -> dmnShapes.stream().noneMatch(s -> Objects.equals(s.getDmnElementRef().getLocalPart(), + element.getId()))); + } + + private void updateIDsWithAlias(final Map indexByUri, + final List importedDrgElements) { + if (importedDrgElements.isEmpty()) { + return; + } + + final QName defaultNamespace = new QName(XMLConstants.NULL_NS_URI, + "Namespace", + XMLConstants.DEFAULT_NS_PREFIX); + + for (JSITDRGElement element : importedDrgElements) { + final Map otherAttributes = JSITUnaryTests.getOtherAttributesMap(element); + final String namespaceAttribute = otherAttributes.getOrDefault(defaultNamespace, ""); + if (!StringUtils.isEmpty(namespaceAttribute)) { + if (indexByUri.containsKey(namespaceAttribute)) { + final String alias = indexByUri.get(namespaceAttribute); + changeAlias(alias, element); + } + } + } + } + + private void changeAlias(final String alias, + final JSITDRGElement drgElement) { + if (drgElement.getId().contains(":")) { + final String id = drgElement.getId().split(":")[1]; + drgElement.setId(alias + ":" + id); + } + } + + private Node getRequiredNode(final Map> elems, + final String reqInputID) { + if (elems.containsKey(reqInputID)) { + return elems.get(reqInputID).getValue(); + } else { + + final Optional match = elems.keySet().stream() + .filter(k -> k.contains(reqInputID)) + .findFirst(); + if (match.isPresent()) { + return elems.get(match.get()).getValue(); + } + } + + return null; + } + + private List getImportedDrgElementsByShape(final List dmnShapes, + final Map importDefinitions, + final JSITDefinitions dmnXml) { + + final List importedDRGElements = dmnMarshallerImportsHelper.getImportedDRGElements(importDefinitions); + + // Update IDs with the alias used in this file for the respective imports + final Map indexByUri = NameSpaceUtils.extractNamespacesKeyedByUri(dmnXml); + updateIDsWithAlias(indexByUri, importedDRGElements); + + return dmnShapes + .stream() + .map(shape -> { + final String dmnElementRef = getDmnElementRef(shape); + final Optional ref = getReference(importedDRGElements, dmnElementRef); + return ref.orElse(null); + }) + .filter(Objects::nonNull) + .collect(toList()); + } + + private Optional getReference(final List importedDRGElements, + final String dmnElementRef) { + for (JSITDRGElement importedDRGElement : importedDRGElements) { + final String importedDRGElementId = importedDRGElement.getId(); + if (Objects.equals(importedDRGElementId, dmnElementRef)) { + return Optional.of(importedDRGElement); + } + } + return Optional.empty(); + } + + private String getDmnElementRef(final JSIDMNShape dmnShape) { + final QName elementRef = dmnShape.getDmnElementRef(); + if (Objects.nonNull(elementRef)) { + return elementRef.getLocalPart(); + } + return ""; + } + + private List getUniqueDMNShapes(final JSIDMNDiagram dmnDDDiagram) { + final Map jsidmnShapes = new HashMap<>(); + final List unwrapped = dmnDDDiagram.getDMNDiagramElement(); + for (int i = 0; i < unwrapped.size(); i++) { + final JSIDiagramElement jsiDiagramElement = Js.uncheckedCast(unwrapped.get(i)); + if (JSIDMNShape.instanceOf(jsiDiagramElement)) { + final JSIDMNShape jsidmnShape = Js.uncheckedCast(jsiDiagramElement); + if (!jsidmnShapes.containsKey(jsidmnShape.getId())) { + jsidmnShapes.put(jsidmnShape.getId(), jsidmnShape); + } + } + } + return new ArrayList<>(jsidmnShapes.values()); + } + + /** + * Stunner's factoryManager is only used to create Nodes that are considered part of a "Definition Set" (a collection of nodes visible to the User e.g. BPMN2 StartNode, EndNode and DMN's DecisionNode etc). + * Relationships are not created with the factory. + * This method specializes to connect with an Edge containing a Child relationship the target Node. + */ + private void connectDSChildEdge(final Node dsNode, + final Node requiredNode) { + final String uuid = dsNode.getUUID() + "er" + requiredNode.getUUID(); + final Edge myEdge = new EdgeImpl<>(uuid); + myEdge.setContent(new Child()); + connectEdge(myEdge, + dsNode, + requiredNode); + } + + private String idOfDMNorWBUUID(final JSITDMNElement dmn) { + return Objects.nonNull(dmn.getId()) ? dmn.getId() : UUID.uuid(); + } + + private String getId(final JSITDMNElementReference er) { + String href = er.getHref(); + return href.contains("#") ? href.substring(href.indexOf('#') + 1) : href; + } + + private void connectEdgeToNodes(final String connectorTypeId, + final JSITDMNElement jsiDMNElement, + final JSITDMNElementReference jsiDMNElementReference, + final Map> elems, + final JSITDefinitions jsiDefinitions, + final Node currentNode) { + if (Objects.nonNull(jsiDMNElementReference)) { + final String reqInputID = getId(jsiDMNElementReference); + final Node requiredNode = getRequiredNode(elems, reqInputID); + final Edge myEdge = factoryManager.newElement(idOfDMNorWBUUID(jsiDMNElement), + connectorTypeId).asEdge(); + connectEdge(myEdge, + requiredNode, + currentNode); + setConnectionMagnets(myEdge, jsiDMNElement.getId(), jsiDefinitions); + } + } + + private Node dmnToStunner(final JSITDRGElement dmn, + final BiConsumer hasComponentWidthsConsumer, + final List importedDrgElements) { + + final Node node = createNode(dmn, + hasComponentWidthsConsumer); + return setAllowOnlyVisualChange(importedDrgElements, node); + } + + private Node createNode(final JSITDRGElement dmn, + final BiConsumer hasComponentWidthsConsumer) { + if (JSITInputData.instanceOf(dmn)) { + return inputDataConverter.nodeFromDMN(Js.uncheckedCast(dmn), + hasComponentWidthsConsumer); + } else if (JSITDecision.instanceOf(dmn)) { + return decisionConverter.nodeFromDMN(Js.uncheckedCast(dmn), + hasComponentWidthsConsumer); + } else if (JSITBusinessKnowledgeModel.instanceOf(dmn)) { + return bkmConverter.nodeFromDMN(Js.uncheckedCast(dmn), + hasComponentWidthsConsumer); + } else if (JSITKnowledgeSource.instanceOf(dmn)) { + return knowledgeSourceConverter.nodeFromDMN(Js.uncheckedCast(dmn), + hasComponentWidthsConsumer); + } else if (JSITDecisionService.instanceOf(dmn)) { + return decisionServiceConverter.nodeFromDMN(Js.uncheckedCast(dmn), + hasComponentWidthsConsumer); + } else { + throw new UnsupportedOperationException("Unsupported DRGElement type [" + dmn.getTYPE_NAME() + "]"); + } + } + + private Node setAllowOnlyVisualChange(final List importedDrgElements, + final Node node) { + getDRGElement(node).ifPresent(drgElement -> { + if (isImportedDRGElement(importedDrgElements, drgElement)) { + drgElement.setAllowOnlyVisualChange(true); + } else { + drgElement.setAllowOnlyVisualChange(false); + } + }); + + return node; + } + + private Optional getDRGElement(final Node node) { + final Object objectDefinition = DefinitionUtils.getElementDefinition(node); + + if (objectDefinition instanceof DRGElement) { + return Optional.of((DRGElement) objectDefinition); + } + + return Optional.empty(); + } + + private boolean isImportedDRGElement(final List importedDrgElements, + final JSITDRGElement drgElement) { + return isImportedIdNode(importedDrgElements, drgElement.getId()); + } + + private boolean isImportedDRGElement(final List importedDrgElements, + final DRGElement drgElement) { + return isImportedIdNode(importedDrgElements, drgElement.getId().getValue()); + } + + private boolean isImportedIdNode(final List importedDrgElements, + final String id) { + return importedDrgElements + .stream() + .anyMatch(drgElement -> Objects.equals(drgElement.getId(), id)); + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + private void connectRootWithChild(final Node dmnDiagramRoot, + final Node child) { + final String uuid = UUID.uuid(); + final Edge edge = new EdgeImpl<>(uuid); + edge.setContent(new Child()); + connectEdge(edge, dmnDiagramRoot, child); + final Definitions definitions = ((DMNDiagram) ((View) dmnDiagramRoot.getContent()).getDefinition()).getDefinitions(); + final DMNModelInstrumentedBase childDRG = (DMNModelInstrumentedBase) ((View) child.getContent()).getDefinition(); + childDRG.setParent(definitions); + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + private void connectEdge(final Edge edge, + final Node source, + final Node target) { + edge.setSourceNode(source); + edge.setTargetNode(target); + source.getOutEdges().add(edge); + target.getInEdges().add(edge); + } + + @SuppressWarnings("unchecked") + private void setConnectionMagnets(final Edge edge, + final String dmnEdgeElementRef, + final JSITDefinitions dmnXml) { + final ViewConnector connectionContent = (ViewConnector) edge.getContent(); + final Optional dmnDiagram = findJSIDiagram(dmnXml); + + Optional dmnEdge = Optional.empty(); + if (dmnDiagram.isPresent()) { + final JSIDMNDiagram jsiDiagram = Js.uncheckedCast(dmnDiagram.get()); + final List jsiDiagramElements = jsiDiagram.getDMNDiagramElement(); + for (int i = 0; i < jsiDiagramElements.size(); i++) { + final JSIDiagramElement jsiDiagramElement = Js.uncheckedCast(jsiDiagramElements.get(i)); + if (JSIDMNEdge.instanceOf(jsiDiagramElement)) { + final JSIDMNEdge jsiEdge = Js.uncheckedCast(jsiDiagramElement); + if (Objects.equals(jsiEdge.getDmnElementRef().getLocalPart(), dmnEdgeElementRef)) { + dmnEdge = Optional.of(jsiEdge); + break; + } + } + } + } + if (dmnEdge.isPresent()) { + final JSIDMNEdge e = Js.uncheckedCast(dmnEdge.get()); + final JSIPoint source = Js.uncheckedCast(e.getWaypoint().get(0)); + final Node, Edge> sourceNode = edge.getSourceNode(); + if (null != sourceNode) { + setConnectionMagnet(sourceNode, + source, + connectionContent::setSourceConnection); + } + final JSIPoint target = Js.uncheckedCast(e.getWaypoint().get(e.getWaypoint().size() - 1)); + final Node, Edge> targetNode = edge.getTargetNode(); + if (null != targetNode) { + setConnectionMagnet(targetNode, + target, + connectionContent::setTargetConnection); + } + if (e.getWaypoint().size() > 2) { + connectionContent.setControlPoints(e.getWaypoint() + .subList(1, e.getWaypoint().size() - 1) + .stream() + .map(p -> ControlPoint.build(PointUtils.dmndiPointToPoint2D(p))) + .toArray(ControlPoint[]::new)); + } + } else { + // Set the source connection, if any. + final Node sourceNode = edge.getSourceNode(); + if (null != sourceNode) { + connectionContent.setSourceConnection(MagnetConnection.Builder.atCenter(sourceNode)); + } + // Set the target connection, if any. + final Node targetNode = edge.getTargetNode(); + if (null != targetNode) { + connectionContent.setTargetConnection(MagnetConnection.Builder.atCenter(targetNode)); + } + } + } + + private void setConnectionMagnet(final Node, Edge> node, + final JSIPoint magnetPoint, + final Consumer connectionConsumer) { + final View view = node.getContent(); + final double viewX = xOfBound(upperLeftBound(view)); + final double viewY = yOfBound(upperLeftBound(view)); + final double magnetRelativeX = magnetPoint.getX() - viewX; + final double magnetRelativeY = magnetPoint.getY() - viewY; + final double viewWidth = view.getBounds().getWidth(); + final double viewHeight = view.getBounds().getHeight(); + if (isCentre(magnetRelativeX, + magnetRelativeY, + viewWidth, + viewHeight)) { + connectionConsumer.accept(MagnetConnection.Builder.atCenter(node)); + } else { + connectionConsumer.accept(MagnetConnection.Builder.at(magnetRelativeX, magnetRelativeY).setAuto(true)); + } + } + + private boolean isCentre(final double magnetRelativeX, + final double magnetRelativeY, + final double viewWidth, + final double viewHeight) { + return Math.abs((viewWidth / 2) - magnetRelativeX) < CENTRE_TOLERANCE && + Math.abs((viewHeight / 2) - magnetRelativeY) < CENTRE_TOLERANCE; + } + + private Optional findComponentsWidthsExtension(final Optional dmnDDDiagram) { + if (!dmnDDDiagram.isPresent()) { + return Optional.empty(); + } + final JSIDMNDiagram jsiDiagram = Js.uncheckedCast(dmnDDDiagram.get()); + final JSIDiagramElement.JSIExtension dmnDDExtensions = Js.uncheckedCast(jsiDiagram.getExtension()); + + if (Objects.isNull(dmnDDExtensions)) { + return Optional.empty(); + } + if (Objects.isNull(dmnDDExtensions.getAny())) { + return Optional.empty(); + } + final List extensions = dmnDDExtensions.getAny(); + if (!Objects.isNull(extensions)) { + for (int i = 0; i < extensions.size(); i++) { + final Object wrapped = extensions.get(i); + final Object extension = JsUtils.getUnwrappedElement(wrapped); + if (JSITComponentsWidthsExtension.instanceOf(extension)) { + final JSITComponentsWidthsExtension jsiExtension = Js.uncheckedCast(extension); + return Optional.of(jsiExtension); + } + } + } + return Optional.empty(); + } + + private void loadImportedItemDefinitions(final Definitions definitions, + final Map importDefinitions) { + definitions.getItemDefinition().addAll(getWbImportedItemDefinitions(importDefinitions)); + } + + private List getWbImportedItemDefinitions(final Map importDefinitions) { + return dmnMarshallerImportsHelper + .getImportedItemDefinitions(importDefinitions) + .stream() + .map(ItemDefinitionPropertyConverter::wbFromDMN) + .peek(itemDefinition -> itemDefinition.setAllowOnlyVisualChange(true)) + .collect(toList()); + } + + private void ddExtAugmentStunner(final Optional dmnDDDiagram, + final Node currentNode) { + if (!dmnDDDiagram.isPresent()) { + return; + } + + final JSIDMNDiagram jsiDiagram = Js.uncheckedCast(dmnDDDiagram.get()); + final List jsiDiagramElements = jsiDiagram.getDMNDiagramElement(); + + final List drgShapes = new ArrayList<>(); + for (int i = 0; i < jsiDiagramElements.size(); i++) { + final JSIDiagramElement jsiDiagramElement = Js.uncheckedCast(jsiDiagramElements.get(i)); + if (JSIDMNShape.instanceOf(jsiDiagramElement)) { + drgShapes.add(Js.uncheckedCast(jsiDiagramElement)); + } + } + final View content = (View) currentNode.getContent(); + final Bound ulBound = upperLeftBound(content); + final Bound lrBound = lowerRightBound(content); + if (content.getDefinition() instanceof Decision) { + final Decision d = (Decision) content.getDefinition(); + internalAugment(drgShapes, d.getId(), + ulBound, + d.getDimensionsSet(), + lrBound, + d.getBackgroundSet(), + d::setFontSet); + } else if (content.getDefinition() instanceof InputData) { + final InputData d = (InputData) content.getDefinition(); + internalAugment(drgShapes, + d.getId(), + ulBound, + d.getDimensionsSet(), + lrBound, + d.getBackgroundSet(), + d::setFontSet); + } else if (content.getDefinition() instanceof BusinessKnowledgeModel) { + final BusinessKnowledgeModel d = (BusinessKnowledgeModel) content.getDefinition(); + internalAugment(drgShapes, + d.getId(), + ulBound, + d.getDimensionsSet(), + lrBound, + d.getBackgroundSet(), + d::setFontSet); + } else if (content.getDefinition() instanceof KnowledgeSource) { + final KnowledgeSource d = (KnowledgeSource) content.getDefinition(); + internalAugment(drgShapes, + d.getId(), + ulBound, + d.getDimensionsSet(), + lrBound, + d.getBackgroundSet(), + d::setFontSet); + } else if (content.getDefinition() instanceof TextAnnotation) { + final TextAnnotation d = (TextAnnotation) content.getDefinition(); + internalAugment(drgShapes, + d.getId(), + ulBound, + d.getDimensionsSet(), + lrBound, + d.getBackgroundSet(), + d::setFontSet); + } else if (content.getDefinition() instanceof DecisionService) { + final DecisionService d = (DecisionService) content.getDefinition(); + internalAugment(drgShapes, + d.getId(), + ulBound, + d.getDimensionsSet(), + lrBound, + d.getBackgroundSet(), + d::setFontSet, + (dividerLineY) -> d.setDividerLineY(new DecisionServiceDividerLineY(dividerLineY - ulBound.getY()))); + } + } + + @SuppressWarnings("unchecked") + private void internalAugment(final List drgShapeStream, + final Id id, + final Bound ulBound, + final RectangleDimensionsSet dimensionsSet, + final Bound lrBound, + final BackgroundSet bgset, + final Consumer fontSetSetter) { + internalAugment(drgShapeStream, + id, + ulBound, + dimensionsSet, + lrBound, + bgset, + fontSetSetter, + (line) -> {/*NOP*/}); + } + + @SuppressWarnings("unchecked") + private void internalAugment(final List drgShapes, + final Id id, + final Bound ulBound, + final RectangleDimensionsSet dimensionsSet, + final Bound lrBound, + final BackgroundSet bgset, + final Consumer fontSetSetter, + final Consumer decisionServiceDividerLineYSetter) { + //Lookup JSIDMNShape corresponding to DRGElement... + Optional drgShapeOpt = Optional.empty(); + for (int i = 0; i < drgShapes.size(); i++) { + final JSIDMNShape jsiShape = Js.uncheckedCast(drgShapes.get(i)); + if (Objects.equals(id.getValue(), jsiShape.getDmnElementRef().getLocalPart())) { + drgShapeOpt = Optional.of(jsiShape); + } + } + if (!drgShapeOpt.isPresent()) { + return; + } + + //Augment Stunner Node with Shape data + final JSIDMNShape drgShape = Js.uncheckedCast(drgShapeOpt.get()); + + if (Objects.nonNull(ulBound)) { + ulBound.setX(xOfShape(drgShape)); + ulBound.setY(yOfShape(drgShape)); + } + dimensionsSet.setWidth(new Width(widthOfShape(drgShape))); + dimensionsSet.setHeight(new Height(heightOfShape(drgShape))); + if (Objects.nonNull(lrBound)) { + lrBound.setX(xOfShape(drgShape) + widthOfShape(drgShape)); + lrBound.setY(yOfShape(drgShape) + heightOfShape(drgShape)); + } + + final JSIStyle drgStyle = Js.uncheckedCast(JsUtils.getUnwrappedElement(drgShape.getStyle())); + final JSIDMNStyle dmnStyleOfDrgShape = JSIDMNStyle.instanceOf(drgStyle) ? Js.uncheckedCast(drgStyle) : null; + if (Objects.nonNull(dmnStyleOfDrgShape)) { + if (Objects.nonNull(dmnStyleOfDrgShape.getFillColor())) { + bgset.setBgColour(new BgColour(ColorUtils.wbFromDMN(dmnStyleOfDrgShape.getFillColor()))); + } + if (Objects.nonNull(dmnStyleOfDrgShape.getStrokeColor())) { + bgset.setBorderColour(new BorderColour(ColorUtils.wbFromDMN(dmnStyleOfDrgShape.getStrokeColor()))); + } + } + + final FontSet fontSet = new FontSet(); + if (Objects.nonNull(dmnStyleOfDrgShape)) { + mergeFontSet(fontSet, FontSetPropertyConverter.wbFromDMN(dmnStyleOfDrgShape)); + } + if (Objects.nonNull(drgShape.getDMNLabel())) { + final JSIDMNShape jsiLabel = Js.uncheckedCast(drgShape.getDMNLabel()); + final JSIStyle jsiLabelStyle = jsiLabel.getStyle(); + final Object jsiLabelSharedStyle = Js.uncheckedCast(jsiLabel.getSharedStyle()); + if (Objects.nonNull(jsiLabelSharedStyle) && JSIDMNStyle.instanceOf(jsiLabelSharedStyle)) { + mergeFontSet(fontSet, FontSetPropertyConverter.wbFromDMN((Js.uncheckedCast(jsiLabelSharedStyle)))); + } + if (Objects.nonNull(jsiLabelStyle) && JSIDMNStyle.instanceOf(jsiLabelStyle)) { + mergeFontSet(fontSet, FontSetPropertyConverter.wbFromDMN(Js.uncheckedCast(jsiLabelStyle))); + } + } + fontSetSetter.accept(fontSet); + + if (Objects.nonNull(drgShape.getDMNDecisionServiceDividerLine())) { + final JSIDMNDecisionServiceDividerLine divider = Js.uncheckedCast(drgShape.getDMNDecisionServiceDividerLine()); + final List dividerPoints = divider.getWaypoint(); + final JSIPoint dividerY = Js.uncheckedCast(dividerPoints.get(0)); + decisionServiceDividerLineYSetter.accept(dividerY.getY()); + } + } + + private void mergeFontSet(final FontSet fontSet, + final FontSet additional) { + if (Objects.nonNull(additional.getFontFamily())) { + fontSet.setFontFamily(additional.getFontFamily()); + } + if (Objects.nonNull(additional.getFontSize())) { + fontSet.setFontSize(additional.getFontSize()); + } + if (Objects.nonNull(additional.getFontColour())) { + fontSet.setFontColour(additional.getFontColour()); + } + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/AllowedAnswersPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/AllowedAnswersPropertyConverter.java new file mode 100644 index 00000000000..c290c407ddd --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/AllowedAnswersPropertyConverter.java @@ -0,0 +1,43 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; + +import org.kie.workbench.common.dmn.api.property.dmn.AllowedAnswers; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +public class AllowedAnswersPropertyConverter { + + public static AllowedAnswers wbFromDMN(final String dmn) { + if (Objects.isNull(dmn)) { + return new AllowedAnswers(""); + } else { + return new AllowedAnswers(dmn); + } + } + + public static String dmnFromWB(final AllowedAnswers wb) { + if (Objects.isNull(wb)) { + return null; + } else if (StringUtils.isEmpty(wb.getValue())) { + return null; + } else { + return wb.getValue(); + } + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/AssociationConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/AssociationConverter.java new file mode 100644 index 00000000000..8bae032b00d --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/AssociationConverter.java @@ -0,0 +1,91 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.model.Association; +import org.kie.workbench.common.dmn.api.definition.model.DRGElement; +import org.kie.workbench.common.dmn.api.definition.model.TextAnnotation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITAssociation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITAssociationDirection; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElementReference; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.HrefBuilder.getHref; + +public class AssociationConverter { + + @SuppressWarnings("unchecked") + public static List dmnFromWB(final Node, ?> node) { + final TextAnnotation ta = node.getContent().getDefinition(); + final JSITDMNElementReference ta_elementReference = new JSITDMNElementReference(); + ta_elementReference.setHref(new StringBuilder("#").append(ta.getId().getValue()).toString()); + + final List result = new ArrayList<>(); + + final List> inEdges = (List>) node.getInEdges(); + for (Edge e : inEdges) { + final Node sourceNode = e.getSourceNode(); + if (sourceNode.getContent() instanceof View) { + final View view = (View) sourceNode.getContent(); + if (view.getDefinition() instanceof DRGElement) { + final DRGElement drgElement = (DRGElement) view.getDefinition(); + final JSITDMNElementReference sourceRef = new JSITDMNElementReference(); + sourceRef.setHref(getHref(drgElement)); + + final JSITAssociation adding = new JSITAssociation(); + adding.setId(((View) e.getContent()).getDefinition().getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(((View) e.getContent()).getDefinition().getDescription())); + description.ifPresent(adding::setDescription); + adding.setSourceRef(sourceRef); + adding.setTargetRef(ta_elementReference); + adding.setAssociationDirection(Js.uncheckedCast(JSITAssociationDirection.NONE.value())); + result.add(adding); + } + } + } + final List> outEdges = (List>) node.getOutEdges(); + for (Edge e : outEdges) { + final Node targetNode = e.getTargetNode(); + if (targetNode.getContent() instanceof View) { + final View view = (View) targetNode.getContent(); + if (view.getDefinition() instanceof DRGElement) { + final DRGElement drgElement = (DRGElement) view.getDefinition(); + final JSITDMNElementReference targetRef = new JSITDMNElementReference(); + targetRef.setHref(getHref(drgElement)); + + final JSITAssociation adding = new JSITAssociation(); + adding.setId(((View) e.getContent()).getDefinition().getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(((View) e.getContent()).getDefinition().getDescription())); + description.ifPresent(adding::setDescription); + adding.setSourceRef(ta_elementReference); + adding.setTargetRef(targetRef); + adding.setAssociationDirection(Js.uncheckedCast(JSITAssociationDirection.NONE.value())); + result.add(adding); + } + } + } + + return result; + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/BindingPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/BindingPropertyConverter.java new file mode 100644 index 00000000000..5394151cd24 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/BindingPropertyConverter.java @@ -0,0 +1,73 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.Binding; +import org.kie.workbench.common.dmn.api.definition.model.Expression; +import org.kie.workbench.common.dmn.api.definition.model.InformationItem; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITBinding; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITExpression; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.JsUtils; + +public class BindingPropertyConverter { + + public static Binding wbFromDMN(final JSITBinding dmn, + final BiConsumer hasComponentWidthsConsumer) { + if (Objects.isNull(dmn)) { + return null; + } + final InformationItem convertedParameter = InformationItemPropertyConverter.wbFromDMN(dmn.getParameter()); + final JSITExpression jsiExpression = Js.uncheckedCast(JsUtils.getUnwrappedElement(dmn.getExpression())); + final Expression convertedExpression = ExpressionPropertyConverter.wbFromDMN(jsiExpression, + Js.uncheckedCast(dmn), + hasComponentWidthsConsumer); + + final Binding result = new Binding(); + if (Objects.nonNull(convertedParameter)) { + convertedParameter.setParent(result); + } + result.setParameter(convertedParameter); + if (Objects.nonNull(convertedExpression)) { + convertedExpression.setParent(result); + } + result.setExpression(convertedExpression); + return result; + } + + public static JSITBinding dmnFromWB(final Binding wb, + final Consumer componentWidthsConsumer) { + if (Objects.isNull(wb)) { + return null; + } + final JSITBinding result = new JSITBinding(); + final JSITInformationItem convertedParameter = InformationItemPropertyConverter.dmnFromWB(wb.getParameter()); + final JSITExpression convertedExpression = ExpressionPropertyConverter.dmnFromWB(wb.getExpression(), + componentWidthsConsumer); + result.setParameter(convertedParameter); + result.setExpression(convertedExpression); + + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/BusinessKnowledgeModelConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/BusinessKnowledgeModelConverter.java new file mode 100644 index 00000000000..1b65eb9dd56 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/BusinessKnowledgeModelConverter.java @@ -0,0 +1,186 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel; +import org.kie.workbench.common.dmn.api.definition.model.DRGElement; +import org.kie.workbench.common.dmn.api.definition.model.DecisionService; +import org.kie.workbench.common.dmn.api.definition.model.FunctionDefinition; +import org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeRequirement; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeSource; +import org.kie.workbench.common.dmn.api.property.background.BackgroundSet; +import org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.Name; +import org.kie.workbench.common.dmn.api.property.font.FontSet; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITAuthorityRequirement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITBusinessKnowledgeModel; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElementReference; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITFunctionDefinition; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITKnowledgeRequirement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.HrefBuilder.getHref; +import static org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId; + +public class BusinessKnowledgeModelConverter implements NodeConverter { + + private FactoryManager factoryManager; + + public BusinessKnowledgeModelConverter(final FactoryManager factoryManager) { + super(); + this.factoryManager = factoryManager; + } + + @Override + public Node, ?> nodeFromDMN(final JSITBusinessKnowledgeModel dmn, + final BiConsumer hasComponentWidthsConsumer) { + @SuppressWarnings("unchecked") + final Node, ?> node = (Node, ?>) factoryManager.newElement(dmn.getId(), + getDefinitionId(BusinessKnowledgeModel.class)).asNode(); + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final Name name = new Name(dmn.getName()); + final InformationItemPrimary informationItem = InformationItemPrimaryPropertyConverter.wbFromDMN(dmn.getVariable(), dmn); + final JSITFunctionDefinition dmnFunctionDefinition = dmn.getEncapsulatedLogic(); + final FunctionDefinition functionDefinition = FunctionDefinitionPropertyConverter.wbFromDMN(dmnFunctionDefinition, + hasComponentWidthsConsumer); + final BusinessKnowledgeModel bkm = new BusinessKnowledgeModel(id, + description, + name, + informationItem, + functionDefinition, + new BackgroundSet(), + new FontSet(), + new GeneralRectangleDimensionsSet()); + node.getContent().setDefinition(bkm); + + if (Objects.nonNull(informationItem)) { + informationItem.setParent(bkm); + } + if (Objects.nonNull(functionDefinition)) { + functionDefinition.setParent(bkm); + } + + if (Objects.nonNull(dmnFunctionDefinition)) { + hasComponentWidthsConsumer.accept(dmnFunctionDefinition.getId(), + functionDefinition); + } + + DMNExternalLinksToExtensionElements.loadExternalLinksFromExtensionElements(dmn, bkm); + + return node; + } + + @Override + @SuppressWarnings("unchecked") + public JSITBusinessKnowledgeModel dmnFromNode(final Node, ?> node, + final Consumer componentWidthsConsumer) { + final BusinessKnowledgeModel source = node.getContent().getDefinition(); + final JSITBusinessKnowledgeModel result = new JSITBusinessKnowledgeModel(); + result.setId(source.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(source.getDescription())); + description.ifPresent(result::setDescription); + result.setName(source.getName().getValue()); + // Add because it is present in the original JSON when unmarshalling + if (Objects.isNull(result.getKnowledgeRequirement())) { + result.setKnowledgeRequirement(new ArrayList<>()); + } + // Add because it is present in the original JSON when unmarshalling + if (Objects.isNull(result.getAuthorityRequirement())) { + result.setAuthorityRequirement(new ArrayList<>()); + } + + DMNExternalLinksToExtensionElements.loadExternalLinksIntoExtensionElements(source, result); + final JSITInformationItem variable = InformationItemPrimaryPropertyConverter.dmnFromWB(source.getVariable(), source); + result.setVariable(variable); + final JSITFunctionDefinition functionDefinition = FunctionDefinitionPropertyConverter.dmnFromWB(source.getEncapsulatedLogic(), + componentWidthsConsumer); + + final FunctionDefinition wbFunctionDefinition = source.getEncapsulatedLogic(); + if (Objects.nonNull(wbFunctionDefinition)) { + final String uuid = wbFunctionDefinition.getId().getValue(); + if (Objects.nonNull(uuid)) { + final JSITComponentWidths componentWidths = new JSITComponentWidths(); + componentWidths.setDmnElementRef(uuid); + source.getEncapsulatedLogic().getComponentWidths() + .stream() + .filter(Objects::nonNull) + .forEach(w -> componentWidths.addWidth(new Float(w))); + componentWidthsConsumer.accept(componentWidths); + } + } + + result.setEncapsulatedLogic(functionDefinition); + + // DMN spec table 2: Requirements connection rules + final List> inEdges = (List>) node.getInEdges(); + for (Edge e : inEdges) { + final Node sourceNode = e.getSourceNode(); + if (sourceNode.getContent() instanceof View) { + final View view = (View) sourceNode.getContent(); + if (view.getDefinition() instanceof DRGElement) { + final DRGElement drgElement = (DRGElement) view.getDefinition(); + if (drgElement instanceof BusinessKnowledgeModel) { + final JSITKnowledgeRequirement iReq = new JSITKnowledgeRequirement(); + iReq.setId(e.getUUID()); + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(getHref(drgElement)); + iReq.setRequiredKnowledge(ri); + result.addKnowledgeRequirement(iReq); + } else if (drgElement instanceof KnowledgeSource) { + final JSITAuthorityRequirement iReq = new JSITAuthorityRequirement(); + iReq.setId(e.getUUID()); + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(getHref(drgElement)); + iReq.setRequiredAuthority(ri); + result.addAuthorityRequirement(iReq); + } else if (drgElement instanceof DecisionService) { + if (e.getContent() instanceof View && ((View) e.getContent()).getDefinition() instanceof KnowledgeRequirement) { + final JSITKnowledgeRequirement iReq = new JSITKnowledgeRequirement(); + iReq.setId(e.getUUID()); + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(getHref(drgElement)); + iReq.setRequiredKnowledge(ri); + result.addKnowledgeRequirement(iReq); + } else { + throw new UnsupportedOperationException("wrong model definition."); + } + } else { + throw new UnsupportedOperationException("wrong model definition."); + } + } + } + } + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ConstraintTypeFieldPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ConstraintTypeFieldPropertyConverter.java new file mode 100644 index 00000000000..ef808515ec1 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ConstraintTypeFieldPropertyConverter.java @@ -0,0 +1,39 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; + +import org.kie.workbench.common.dmn.api.definition.model.ConstraintType; + +public class ConstraintTypeFieldPropertyConverter { + + public static ConstraintType wbFromDMN(final String constraintType) { + if (Objects.isNull(constraintType)) { + return null; + } else { + return ConstraintType.fromString(constraintType); + } + } + + public static String dmnFromWB(final ConstraintType constraintType) { + if (Objects.isNull(constraintType)) { + return null; + } + return constraintType.value(); + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ContextEntryPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ContextEntryPropertyConverter.java new file mode 100644 index 00000000000..9ca6f32025d --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ContextEntryPropertyConverter.java @@ -0,0 +1,68 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.ContextEntry; +import org.kie.workbench.common.dmn.api.definition.model.Expression; +import org.kie.workbench.common.dmn.api.definition.model.InformationItem; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITContextEntry; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITExpression; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.JsUtils; + +public class ContextEntryPropertyConverter { + + public static ContextEntry wbFromDMN(final JSITContextEntry dmn, + final BiConsumer hasComponentWidthsConsumer) { + final InformationItem variable = InformationItemPropertyConverter.wbFromDMN(dmn.getVariable()); + final JSITExpression jsiExpression = Js.uncheckedCast(JsUtils.getUnwrappedElement(dmn.getExpression())); + final Expression expression = ExpressionPropertyConverter.wbFromDMN(jsiExpression, + Js.uncheckedCast(dmn), + hasComponentWidthsConsumer); + + final ContextEntry result = new ContextEntry(); + if (Objects.nonNull(variable)) { + variable.setParent(result); + result.setVariable(variable); + } + if (Objects.nonNull(expression)) { + expression.setParent(result); + result.setExpression(expression); + } + return result; + } + + public static JSITContextEntry dmnFromWB(final ContextEntry wb, + final Consumer componentWidthsConsumer) { + final JSITContextEntry result = new JSITContextEntry(); + + final JSITInformationItem variable = InformationItemPropertyConverter.dmnFromWB(wb.getVariable()); + final JSITExpression expression = ExpressionPropertyConverter.dmnFromWB(wb.getExpression(), + componentWidthsConsumer); + + result.setVariable(variable); + result.setExpression(expression); + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ContextPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ContextPropertyConverter.java new file mode 100644 index 00000000000..3bbfc130010 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ContextPropertyConverter.java @@ -0,0 +1,106 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.Context; +import org.kie.workbench.common.dmn.api.definition.model.ContextEntry; +import org.kie.workbench.common.dmn.api.definition.model.FunctionDefinition.Kind; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITContext; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITContextEntry; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITExpression; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITFunctionDefinition; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; + +public class ContextPropertyConverter { + + public static Context wbFromDMN(final JSITContext dmn, + final JSITExpression parent, + final BiConsumer hasComponentWidthsConsumer) { + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); + final Context result = new Context(id, + description, + typeRef); + final List jsiContextEntries = dmn.getContextEntry(); + for (int i = 0; i < jsiContextEntries.size(); i++) { + final JSITContextEntry jsiContextentry = Js.uncheckedCast(jsiContextEntries.get(i)); + final ContextEntry ceConverted = ContextEntryPropertyConverter.wbFromDMN(jsiContextentry, hasComponentWidthsConsumer); + if (Objects.nonNull(ceConverted)) { + ceConverted.setParent(result); + result.getContextEntry().add(ceConverted); + } + } + + //No need to append a _default_ row if the Context is part of a JAVA or PMML FunctionDefinition + if (JSITFunctionDefinition.instanceOf(parent)) { + final JSITFunctionDefinition functionDefinition = Js.uncheckedCast(parent); + final String sKind = Js.uncheckedCast(functionDefinition.getKind()); + final Kind kind = Kind.fromValue(sKind); + if (!Objects.equals(Kind.FEEL, kind)) { + return result; + } + } + + //The UI requires a ContextEntry for the _default_ result even if none has been defined + final int contextEntriesCount = result.getContextEntry().size(); + if (contextEntriesCount == 0) { + result.getContextEntry().add(new ContextEntry()); + } else if (!Objects.isNull(result.getContextEntry().get(contextEntriesCount - 1).getVariable())) { + result.getContextEntry().add(new ContextEntry()); + } + + return result; + } + + public static JSITContext dmnFromWB(final Context wb, + final Consumer componentWidthsConsumer) { + final JSITContext result = new JSITContext(); + result.setId(wb.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(result::setDescription); + QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef); + for (ContextEntry ce : wb.getContextEntry()) { + final JSITContextEntry ceConverted = ContextEntryPropertyConverter.dmnFromWB(ce, componentWidthsConsumer); + result.addContextEntry(ceConverted); + } + + //The UI appends a ContextEntry for the _default_ result that may contain an undefined Expression. + //If this is the case then DMN does not require the ContextEntry to be written out to the XML. + //Conversion of ContextEntries will always create a _mock_ LiteralExpression if no Expression has + //been defined therefore remove the last entry from the org.kie.dmn.model if the WB had no Expression. + final int contextEntriesCount = result.getContextEntry().size(); + if (contextEntriesCount > 0) { + if (Objects.isNull(wb.getContextEntry().get(contextEntriesCount - 1).getExpression())) { + result.removeContextEntry(contextEntriesCount - 1); + } + } + + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DMNElementReferenceConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DMNElementReferenceConverter.java new file mode 100644 index 00000000000..e783a7a2990 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DMNElementReferenceConverter.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import org.kie.workbench.common.dmn.api.definition.model.DMNElementReference; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElementReference; + +public class DMNElementReferenceConverter { + + public static DMNElementReference wbFromDMN(final JSITDMNElementReference dmn) { + final DMNElementReference result = new DMNElementReference(); + result.setHref(dmn.getHref()); + return result; + } + + public static JSITDMNElementReference dmnFromWB(final DMNElementReference wb) { + final JSITDMNElementReference result = new JSITDMNElementReference(); + result.setHref(wb.getHref()); + + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DMNExternalLinksToExtensionElements.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DMNExternalLinksToExtensionElements.java new file mode 100644 index 00000000000..3565960e88e --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DMNExternalLinksToExtensionElements.java @@ -0,0 +1,98 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.model.DRGElement; +import org.kie.workbench.common.dmn.api.property.dmn.DMNExternalLink; +import org.kie.workbench.common.dmn.api.property.dmn.DocumentationLinks; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITAttachment; + +class DMNExternalLinksToExtensionElements { + + static void loadExternalLinksFromExtensionElements(final JSITDRGElement source, + final DRGElement target) { + + if (!Objects.isNull(source.getExtensionElements())) { + final List extensions = source.getExtensionElements().getAny(); + if (!Objects.isNull(extensions)) { + for (int i = 0; i < extensions.size(); i++) { + final Object extension = extensions.get(i); + if (JSITAttachment.instanceOf(extension)) { + final JSITAttachment jsiExtension = Js.uncheckedCast(extension); + final DMNExternalLink external = new DMNExternalLink(); + external.setDescription(jsiExtension.getName()); + external.setUrl(jsiExtension.getUrl()); + target.getLinksHolder().getValue().addLink(external); + } + } + } + } + } + + static void loadExternalLinksIntoExtensionElements(final DRGElement source, + final JSITDRGElement target) { + + if (Objects.isNull(source.getLinksHolder()) || Objects.isNull(source.getLinksHolder().getValue())) { + return; + } + + final DocumentationLinks links = source.getLinksHolder().getValue(); + final JSITDMNElement.JSIExtensionElements elements = getOrCreateExtensionElements(target); + + removeAllExistingLinks(elements); + + for (final DMNExternalLink link : links.getLinks()) { + final JSITAttachment attachment = new JSITAttachment(); + attachment.setName(link.getDescription()); + attachment.setUrl(link.getUrl()); + elements.addAny(attachment); + } + target.setExtensionElements(elements); + } + + private static void removeAllExistingLinks(final JSITDMNElement.JSIExtensionElements elements) { + final JSITDMNElement.JSIExtensionElements others = new JSITDMNElement.JSIExtensionElements(); + // Add because it is present in the original JSON when unmarshalling + others.setAny(new ArrayList<>()); + final List any = elements.getAny(); + for (int i = 0; i < any.size(); i++) { + final Object extension = any.get(i); + if (!JSITAttachment.instanceOf(extension)) { + others.addAny(extension); + } + } + elements.setAny(others.getAny()); + } + + private static JSITDMNElement.JSIExtensionElements getOrCreateExtensionElements(final JSITDRGElement target) { + // Add because it is present in the original JSON when unmarshalling + JSITDMNElement.JSIExtensionElements toReturn = Objects.isNull(target.getExtensionElements()) + ? new JSITDMNElement.JSIExtensionElements() + : target.getExtensionElements(); + if (!Objects.isNull(toReturn) && Objects.isNull(toReturn.getAny())) { + toReturn.setAny(new ArrayList<>()); + } + return toReturn; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DecisionConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DecisionConverter.java new file mode 100644 index 00000000000..d75a87667b7 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DecisionConverter.java @@ -0,0 +1,211 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel; +import org.kie.workbench.common.dmn.api.definition.model.DRGElement; +import org.kie.workbench.common.dmn.api.definition.model.Decision; +import org.kie.workbench.common.dmn.api.definition.model.DecisionService; +import org.kie.workbench.common.dmn.api.definition.model.Expression; +import org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary; +import org.kie.workbench.common.dmn.api.definition.model.InputData; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeRequirement; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeSource; +import org.kie.workbench.common.dmn.api.property.background.BackgroundSet; +import org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet; +import org.kie.workbench.common.dmn.api.property.dmn.AllowedAnswers; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.Name; +import org.kie.workbench.common.dmn.api.property.dmn.Question; +import org.kie.workbench.common.dmn.api.property.font.FontSet; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITAuthorityRequirement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElementReference; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDecision; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITExpression; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationRequirement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITKnowledgeRequirement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.JsUtils; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Child; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.HrefBuilder.getHref; +import static org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId; + +public class DecisionConverter implements NodeConverter { + + private FactoryManager factoryManager; + + public DecisionConverter(final FactoryManager factoryManager) { + super(); + this.factoryManager = factoryManager; + } + + @Override + public Node, ?> nodeFromDMN(final JSITDecision dmn, + final BiConsumer hasComponentWidthsConsumer) { + @SuppressWarnings("unchecked") + final Node, ?> node = (Node, ?>) factoryManager.newElement(dmn.getId(), + getDefinitionId(Decision.class)).asNode(); + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final Name name = new Name(dmn.getName()); + final InformationItemPrimary informationItem = InformationItemPrimaryPropertyConverter.wbFromDMN(dmn.getVariable(), dmn); + final JSITExpression jsiExpression = Js.uncheckedCast(JsUtils.getUnwrappedElement(dmn.getExpression())); + final Expression expression = ExpressionPropertyConverter.wbFromDMN(jsiExpression, + Js.uncheckedCast(dmn), + hasComponentWidthsConsumer); + final Decision decision = new Decision(id, + description, + name, + new Question(), + new AllowedAnswers(), + informationItem, + expression, + new BackgroundSet(), + new FontSet(), + new GeneralRectangleDimensionsSet()); + decision.setQuestion(QuestionPropertyConverter.wbFromDMN(dmn.getQuestion())); + decision.setAllowedAnswers(AllowedAnswersPropertyConverter.wbFromDMN(dmn.getAllowedAnswers())); + node.getContent().setDefinition(decision); + + if (Objects.nonNull(informationItem)) { + informationItem.setParent(decision); + } + if (Objects.nonNull(expression)) { + expression.setParent(decision); + } + + DMNExternalLinksToExtensionElements.loadExternalLinksFromExtensionElements(dmn, decision); + return node; + } + + @Override + @SuppressWarnings("unchecked") + public JSITDecision dmnFromNode(final Node, ?> node, + final Consumer componentWidthsConsumer) { + final Decision source = node.getContent().getDefinition(); + final JSITDecision d = new JSITDecision(); + d.setId(source.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(source.getDescription())); + description.ifPresent(d::setDescription); + d.setName(source.getName().getValue()); + final JSITInformationItem variable = InformationItemPrimaryPropertyConverter.dmnFromWB(source.getVariable(), source); + d.setVariable(variable); + final JSITExpression expression = ExpressionPropertyConverter.dmnFromWB(source.getExpression(), + componentWidthsConsumer); + + if (Objects.nonNull(expression)) { + d.setExpression(expression); + } + final String question = QuestionPropertyConverter.dmnFromWB(source.getQuestion()); + if (!StringUtils.isEmpty(question)) { + d.setQuestion(question); + } + final String allowedAnswers = AllowedAnswersPropertyConverter.dmnFromWB(source.getAllowedAnswers()); + if (!StringUtils.isEmpty(allowedAnswers)) { + d.setAllowedAnswers(allowedAnswers); + } + // Add because it is present in the original JSON when unmarshalling + if (Objects.isNull(d.getInformationRequirement())) { + d.setInformationRequirement(new ArrayList<>()); + } + // Add because it is present in the original JSON when unmarshalling + if (Objects.isNull(d.getKnowledgeRequirement())) { + d.setKnowledgeRequirement(new ArrayList<>()); + } + // Add because it is present in the original JSON when unmarshalling + if (Objects.isNull(d.getAuthorityRequirement())) { + d.setAuthorityRequirement(new ArrayList<>()); + } + + // DMN spec table 2: Requirements connection rules + final List> inEdges = (List>) node.getInEdges(); + for (Edge e : inEdges) { + final Node sourceNode = e.getSourceNode(); + if (sourceNode.getContent() instanceof View) { + final View view = (View) sourceNode.getContent(); + if (view.getDefinition() instanceof DRGElement) { + final DRGElement drgElement = (DRGElement) view.getDefinition(); + if (drgElement instanceof Decision) { + final JSITInformationRequirement iReq = new JSITInformationRequirement(); + iReq.setId(e.getUUID()); + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(getHref(drgElement)); + iReq.setRequiredDecision(ri); + d.addInformationRequirement(iReq); + } else if (drgElement instanceof BusinessKnowledgeModel) { + final JSITKnowledgeRequirement iReq = new JSITKnowledgeRequirement(); + iReq.setId(e.getUUID()); + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(getHref(drgElement)); + iReq.setRequiredKnowledge(ri); + d.addKnowledgeRequirement(iReq); + } else if (drgElement instanceof KnowledgeSource) { + final JSITAuthorityRequirement iReq = new JSITAuthorityRequirement(); + iReq.setId(e.getUUID()); + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(getHref(drgElement)); + iReq.setRequiredAuthority(ri); + d.addAuthorityRequirement(iReq); + } else if (drgElement instanceof InputData) { + final JSITInformationRequirement iReq = new JSITInformationRequirement(); + iReq.setId(e.getUUID()); + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(getHref(drgElement)); + iReq.setRequiredInput(ri); + d.addInformationRequirement(iReq); + } else if (drgElement instanceof DecisionService) { + if (e.getContent() instanceof Child) { + // Stunner relationship of this Decision be encapsulated by the DecisionService, not managed here. + } else if (e.getContent() instanceof View && ((View) e.getContent()).getDefinition() instanceof KnowledgeRequirement) { + final JSITKnowledgeRequirement iReq = new JSITKnowledgeRequirement(); + iReq.setId(e.getUUID()); + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(getHref(drgElement)); + iReq.setRequiredKnowledge(ri); + d.addKnowledgeRequirement(iReq); + } else { + throw new UnsupportedOperationException("wrong model definition."); + } + } else { + throw new UnsupportedOperationException("wrong model definition."); + } + } + } + } + + DMNExternalLinksToExtensionElements.loadExternalLinksIntoExtensionElements(source, d); + + return d; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DecisionRulePropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DecisionRulePropertyConverter.java new file mode 100644 index 00000000000..ac0687a595e --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DecisionRulePropertyConverter.java @@ -0,0 +1,83 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.model.DecisionRule; +import org.kie.workbench.common.dmn.api.definition.model.LiteralExpression; +import org.kie.workbench.common.dmn.api.definition.model.UnaryTests; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDecisionRule; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITLiteralExpression; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests; + +public class DecisionRulePropertyConverter { + + public static DecisionRule wbFromDMN(final JSITDecisionRule dmn) { + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + + final DecisionRule result = new DecisionRule(); + result.setId(id); + result.setDescription(description); + + final List jsiInputEntries = dmn.getInputEntry(); + for (int i = 0; i < jsiInputEntries.size(); i++) { + final JSITUnaryTests jsiInputEntry = Js.uncheckedCast(jsiInputEntries.get(i)); + final UnaryTests inputEntryConverted = UnaryTestsPropertyConverter.wbFromDMN(jsiInputEntry); + if (Objects.nonNull(inputEntryConverted)) { + inputEntryConverted.setParent(result); + result.getInputEntry().add(inputEntryConverted); + } + } + + final List jsiOutputEntries = dmn.getOutputEntry(); + for (int i = 0; i < jsiOutputEntries.size(); i++) { + final JSITLiteralExpression jsiOutputEntry = Js.uncheckedCast(jsiOutputEntries.get(i)); + final LiteralExpression outputEntryConverted = LiteralExpressionPropertyConverter.wbFromDMN(jsiOutputEntry); + if (Objects.nonNull(outputEntryConverted)) { + outputEntryConverted.setParent(result); + result.getOutputEntry().add(outputEntryConverted); + } + } + + return result; + } + + public static JSITDecisionRule dmnFromWB(final DecisionRule wb) { + final JSITDecisionRule result = new JSITDecisionRule(); + result.setId(wb.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(result::setDescription); + + for (UnaryTests ie : wb.getInputEntry()) { + final JSITUnaryTests inputEntryConverted = UnaryTestsPropertyConverter.dmnFromWB(ie); + result.addInputEntry(inputEntryConverted); + } + for (LiteralExpression oe : wb.getOutputEntry()) { + final JSITLiteralExpression outputEntryConverted = LiteralExpressionPropertyConverter.dmnFromWB(oe); + result.addOutputEntry(outputEntryConverted); + } + + return result; + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DecisionServiceConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DecisionServiceConverter.java new file mode 100644 index 00000000000..21da149205e --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DecisionServiceConverter.java @@ -0,0 +1,270 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.DMNElementReference; +import org.kie.workbench.common.dmn.api.definition.model.DRGElement; +import org.kie.workbench.common.dmn.api.definition.model.Decision; +import org.kie.workbench.common.dmn.api.definition.model.DecisionService; +import org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary; +import org.kie.workbench.common.dmn.api.definition.model.InputData; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeRequirement; +import org.kie.workbench.common.dmn.api.property.background.BackgroundSet; +import org.kie.workbench.common.dmn.api.property.dimensions.DecisionServiceRectangleDimensionsSet; +import org.kie.workbench.common.dmn.api.property.dmn.DecisionServiceDividerLineY; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.Name; +import org.kie.workbench.common.dmn.api.property.font.FontSet; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElementReference; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDecisionService; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Child; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId; + +public class DecisionServiceConverter implements NodeConverter { + + private FactoryManager factoryManager; + + public DecisionServiceConverter(final FactoryManager factoryManager) { + super(); + this.factoryManager = factoryManager; + } + + private static boolean isOutputDecision(final View childView, + final View decisionServiceView) { + //ChildViewY is absolute + //DecisionServiceViewY is absolute + //DecisionServiceViewLineY is relative to the DecisionService + final double childViewY = childView.getBounds().getUpperLeft().getY(); + final double decisionServiceViewY = decisionServiceView.getBounds().getUpperLeft().getY(); + final double decisionServiceViewLineY = decisionServiceView.getDefinition().getDividerLineY().getValue(); + return childViewY < decisionServiceViewY + decisionServiceViewLineY; + } + + @Override + public Node, ?> nodeFromDMN(final JSITDecisionService dmn, + final BiConsumer hasComponentWidthsConsumer) { + @SuppressWarnings("unchecked") + final Node, ?> node = (Node, ?>) factoryManager.newElement(dmn.getId(), + getDefinitionId(DecisionService.class)).asNode(); + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final Name name = new Name(dmn.getName()); + final InformationItemPrimary informationItem = InformationItemPrimaryPropertyConverter.wbFromDMN(dmn.getVariable(), dmn); + + final List outputDecision = new ArrayList<>(); + final List encapsulatedDecision = new ArrayList<>(); + final List inputDecision = new ArrayList<>(); + final List inputData = new ArrayList<>(); + + final List jsiOutputDecisions = dmn.getOutputDecision(); + if (Objects.nonNull(jsiOutputDecisions)) { + for (int i = 0; i < jsiOutputDecisions.size(); i++) { + final JSITDMNElementReference jsiOutputDecision = Js.uncheckedCast(jsiOutputDecisions.get(i)); + outputDecision.add(DMNElementReferenceConverter.wbFromDMN(jsiOutputDecision)); + } + } + + final List jsiEncapsulatedDecisions = dmn.getEncapsulatedDecision(); + if (Objects.nonNull(jsiEncapsulatedDecisions)) { + for (int i = 0; i < jsiEncapsulatedDecisions.size(); i++) { + final JSITDMNElementReference jsiEncapsulatedDecision = Js.uncheckedCast(jsiEncapsulatedDecisions.get(i)); + outputDecision.add(DMNElementReferenceConverter.wbFromDMN(jsiEncapsulatedDecision)); + } + } + + final List jsiInputDecisions = dmn.getInputDecision(); + if (Objects.nonNull(jsiInputDecisions)) { + for (int i = 0; i < jsiInputDecisions.size(); i++) { + final JSITDMNElementReference jsiInputDecision = Js.uncheckedCast(jsiInputDecisions.get(i)); + inputDecision.add(DMNElementReferenceConverter.wbFromDMN(jsiInputDecision)); + } + } + + final List jsiInputDatas = dmn.getInputData(); + if (Objects.nonNull(jsiInputDatas)) { + for (int i = 0; i < jsiInputDatas.size(); i++) { + final JSITDMNElementReference jsiInputData = Js.uncheckedCast(jsiInputDatas.get(i)); + inputData.add(DMNElementReferenceConverter.wbFromDMN(jsiInputData)); + } + } + + final DecisionService decisionService = new DecisionService(id, + description, + name, + informationItem, + outputDecision, + encapsulatedDecision, + inputDecision, + inputData, + new BackgroundSet(), + new FontSet(), + new DecisionServiceRectangleDimensionsSet(), + new DecisionServiceDividerLineY()); + node.getContent().setDefinition(decisionService); + + if (Objects.nonNull(informationItem)) { + informationItem.setParent(decisionService); + } + + DMNExternalLinksToExtensionElements.loadExternalLinksFromExtensionElements(dmn, decisionService); + + return node; + } + + @Override + @SuppressWarnings("unchecked") + public JSITDecisionService dmnFromNode(final Node, ?> node, + final Consumer componentWidthsConsumer) { + final DecisionService source = node.getContent().getDefinition(); + final JSITDecisionService ds = new JSITDecisionService(); + ds.setId(source.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(source.getDescription())); + description.ifPresent(ds::setDescription); + ds.setName(source.getName().getValue()); + final JSITInformationItem variable = InformationItemPrimaryPropertyConverter.dmnFromWB(source.getVariable(), source); + ds.setVariable(variable); + + final List existing_outputDecision = source.getOutputDecision().stream().map(DMNElementReferenceConverter::dmnFromWB).collect(Collectors.toList()); + final List existing_encapsulatedDecision = source.getEncapsulatedDecision().stream().map(DMNElementReferenceConverter::dmnFromWB).collect(Collectors.toList()); + final List existing_inputDecision = source.getInputDecision().stream().map(DMNElementReferenceConverter::dmnFromWB).collect(Collectors.toList()); + final List existing_inputData = source.getInputData().stream().map(DMNElementReferenceConverter::dmnFromWB).collect(Collectors.toList()); + final List candidate_outputDecision = new ArrayList<>(); + final List candidate_encapsulatedDecision = new ArrayList<>(); + final List candidate_inputDecision = new ArrayList<>(); + final List candidate_inputData = new ArrayList<>(); + + final List reqInputs = new ArrayList<>(); + final List reqDecisions = new ArrayList<>(); + + // DMN spec table 2: Requirements connection rules + final List> outEdges = (List>) node.getOutEdges(); + for (Edge e : outEdges) { + if (e.getContent() instanceof Child) { + @SuppressWarnings("unchecked") + final Node, ?> targetNode = e.getTargetNode(); + final View targetNodeView = targetNode.getContent(); + if (targetNodeView.getDefinition() instanceof DRGElement) { + final DRGElement drgElement = (DRGElement) targetNodeView.getDefinition(); + if (drgElement instanceof Decision) { + final Decision decision = (Decision) drgElement; + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(new StringBuilder("#").append(decision.getId().getValue()).toString()); + if (isOutputDecision(targetNode.getContent(), node.getContent())) { + candidate_outputDecision.add(ri); + } else { + candidate_encapsulatedDecision.add(ri); + } + inspectDecisionForDSReqs(targetNode, reqInputs, reqDecisions); + } else { + throw new UnsupportedOperationException("wrong model definition: a DecisionService is expected to encapsulate only Decision"); + } + } + } else if (e.getContent() instanceof View && ((View) e.getContent()).getDefinition() instanceof KnowledgeRequirement) { + // this was taken care by the receiving Decision or BKM. + } else { + throw new UnsupportedOperationException("wrong model definition."); + } + } + reqInputs.stream() + .sorted(Comparator.comparing(x -> x.getName().getValue())) + .map(x -> { + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(new StringBuilder("#").append(x.getId().getValue()).toString()); + return ri; + }) + .forEach(candidate_inputData::add); + reqDecisions.stream() + .sorted(Comparator.comparing(x -> x.getName().getValue())) + .map(x -> { + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(new StringBuilder("#").append(x.getId().getValue()).toString()); + return ri; + }) + .forEach(candidate_inputDecision::add); + for (JSITDMNElementReference er : candidate_outputDecision) { + candidate_inputDecision.removeIf(x -> x.getHref().equals(er.getHref())); + } + for (JSITDMNElementReference er : candidate_encapsulatedDecision) { + candidate_inputDecision.removeIf(x -> x.getHref().equals(er.getHref())); + } + + reconcileExistingAndCandidate(ds.getInputData(), existing_inputData, candidate_inputData); + reconcileExistingAndCandidate(ds.getInputDecision(), existing_inputDecision, candidate_inputDecision); + reconcileExistingAndCandidate(ds.getEncapsulatedDecision(), existing_encapsulatedDecision, candidate_encapsulatedDecision); + reconcileExistingAndCandidate(ds.getOutputDecision(), existing_outputDecision, candidate_outputDecision); + + DMNExternalLinksToExtensionElements.loadExternalLinksIntoExtensionElements(source, ds); + + return ds; + } + + private void reconcileExistingAndCandidate(final List targetList, + final List existingList, + final List candidateList) { + final List existing = new ArrayList<>(existingList); + final List candidate = new ArrayList<>(candidateList); + for (JSITDMNElementReference e : existing) { + boolean existingIsAlsoCandidate = candidate.removeIf(er -> er.getHref().equals(e.getHref())); + if (existingIsAlsoCandidate) { + targetList.add(e); + } + } + for (JSITDMNElementReference c : candidate) { + targetList.add(c); + } + } + + @SuppressWarnings("unchecked") + private void inspectDecisionForDSReqs(final Node, ?> targetNode, + final List reqInputs, + final List reqDecisions) { + final List> inEdges = (List>) targetNode.getInEdges(); + for (Edge e : inEdges) { + final Node sourceNode = e.getSourceNode(); + if (sourceNode.getContent() instanceof View) { + final View view = (View) sourceNode.getContent(); + if (view.getDefinition() instanceof DRGElement) { + final DRGElement drgElement = (DRGElement) view.getDefinition(); + if (drgElement instanceof Decision) { + reqDecisions.add((Decision) drgElement); + } else if (drgElement instanceof InputData) { + reqInputs.add((InputData) drgElement); + } + } + } + } + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DecisionTablePropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DecisionTablePropertyConverter.java new file mode 100644 index 00000000000..d1631185425 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DecisionTablePropertyConverter.java @@ -0,0 +1,166 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.model.BuiltinAggregator; +import org.kie.workbench.common.dmn.api.definition.model.DecisionRule; +import org.kie.workbench.common.dmn.api.definition.model.DecisionTable; +import org.kie.workbench.common.dmn.api.definition.model.DecisionTableOrientation; +import org.kie.workbench.common.dmn.api.definition.model.HitPolicy; +import org.kie.workbench.common.dmn.api.definition.model.InputClause; +import org.kie.workbench.common.dmn.api.definition.model.OutputClause; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDecisionRule; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDecisionTable; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITHitPolicy; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInputClause; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITOutputClause; + +public class DecisionTablePropertyConverter { + + public static DecisionTable wbFromDMN(final JSITDecisionTable dmn) { + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); + + final DecisionTable result = new DecisionTable(); + result.setId(id); + result.setDescription(description); + result.setTypeRef(typeRef); + + final List jsiInputClauses = dmn.getInput(); + for (int i = 0; i < jsiInputClauses.size(); i++) { + final JSITInputClause input = Js.uncheckedCast(jsiInputClauses.get(i)); + final InputClause inputClauseConverted = InputClausePropertyConverter.wbFromDMN(input); + if (Objects.nonNull(inputClauseConverted)) { + inputClauseConverted.setParent(result); + result.getInput().add(inputClauseConverted); + } + } + + final List jsiOutputClauses = dmn.getOutput(); + for (int i = 0; i < jsiOutputClauses.size(); i++) { + final JSITOutputClause output = Js.uncheckedCast(jsiOutputClauses.get(i)); + final OutputClause outputClauseConverted = OutputClausePropertyConverter.wbFromDMN(output); + if (Objects.nonNull(outputClauseConverted)) { + outputClauseConverted.setParent(result); + result.getOutput().add(outputClauseConverted); + } + } + + final List jsiDecisionRules = dmn.getRule(); + for (int i = 0; i < jsiDecisionRules.size(); i++) { + final JSITDecisionRule dr = Js.uncheckedCast(jsiDecisionRules.get(i)); + final DecisionRule decisionRuleConverted = DecisionRulePropertyConverter.wbFromDMN(dr); + if (Objects.nonNull(decisionRuleConverted)) { + decisionRuleConverted.setParent(result); + } + result.getRule().add(decisionRuleConverted); + } + + //JSITHitPolicy is a String JSO so convert into the real type + final String hitPolicy = Js.uncheckedCast(dmn.getHitPolicy()); + if (Objects.nonNull(hitPolicy)) { + result.setHitPolicy(HitPolicy.fromValue(hitPolicy)); + } + + //JSITBuiltinAggregator is a String JSO so convert into the real type + final String aggregation = Js.uncheckedCast(dmn.getAggregation()); + if (Objects.nonNull(aggregation)) { + result.setAggregation(BuiltinAggregator.fromValue(aggregation)); + } + + //JSITDecisionTableOrientation is a String JSO so convert into the real type + final String orientation = Js.uncheckedCast(dmn.getPreferredOrientation()); + if (Objects.nonNull(orientation)) { + result.setPreferredOrientation(DecisionTableOrientation.fromValue(orientation)); + } + + result.setOutputLabel(dmn.getOutputLabel()); + + return result; + } + + public static JSITDecisionTable dmnFromWB(final DecisionTable wb) { + final JSITDecisionTable result = new JSITDecisionTable(); + result.setId(wb.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(result::setDescription); + QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef); + + for (InputClause input : wb.getInput()) { + final JSITInputClause c = InputClausePropertyConverter.dmnFromWB(input); + result.addInput(c); + } + for (OutputClause input : wb.getOutput()) { + final JSITOutputClause c = OutputClausePropertyConverter.dmnFromWB(input); + result.addOutput(c); + } + if (result.getOutput().size() == 1) { + final JSITOutputClause at = Js.uncheckedCast(result.getOutput().get(0)); + at.setName(null); // DROOLS-3281 + } + for (DecisionRule dr : wb.getRule()) { + final JSITDecisionRule c = DecisionRulePropertyConverter.dmnFromWB(dr); + result.addRule(c); + } + if (Objects.nonNull(wb.getHitPolicy())) { + switch (wb.getHitPolicy()) { + case ANY: + result.setHitPolicy(Js.uncheckedCast(JSITHitPolicy.ANY.value())); + break; + case COLLECT: + result.setHitPolicy(Js.uncheckedCast(JSITHitPolicy.COLLECT.value())); + break; + case FIRST: + result.setHitPolicy(Js.uncheckedCast(JSITHitPolicy.FIRST.value())); + break; + case UNIQUE: + result.setHitPolicy(Js.uncheckedCast(JSITHitPolicy.UNIQUE.value())); + break; + case PRIORITY: + result.setHitPolicy(Js.uncheckedCast(JSITHitPolicy.PRIORITY.value())); + break; + case RULE_ORDER: + result.setHitPolicy(Js.uncheckedCast(JSITHitPolicy.RULE_ORDER.value())); + break; + case OUTPUT_ORDER: + result.setHitPolicy(Js.uncheckedCast(JSITHitPolicy.OUTPUT_ORDER.value())); + break; + } + } + if (Objects.nonNull(wb.getAggregation())) { + final String wbBuiltinAggregator = wb.getAggregation().value(); + result.setAggregation(Js.uncheckedCast(wbBuiltinAggregator)); + } + if (Objects.nonNull(wb.getPreferredOrientation())) { + final String wbPreferredOrientation = wb.getPreferredOrientation().value(); + result.setPreferredOrientation(Js.uncheckedCast(wbPreferredOrientation)); + } + + result.setOutputLabel(wb.getOutputLabel()); + + return result; + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DefinitionsConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DefinitionsConverter.java new file mode 100644 index 00000000000..74aa6d5ce64 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DefinitionsConverter.java @@ -0,0 +1,181 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Optional; + +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase; +import org.kie.workbench.common.dmn.api.definition.model.Definitions; +import org.kie.workbench.common.dmn.api.definition.model.Import; +import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; +import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.Name; +import org.kie.workbench.common.dmn.api.property.dmn.Text; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDefinitions; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITImport; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.NameSpaceUtils; +import org.kie.workbench.common.stunner.core.util.StringUtils; +import org.kie.workbench.common.stunner.core.util.UUID; + +public class DefinitionsConverter { + + public static Definitions wbFromDMN(final JSITDefinitions dmn, + final Map importDefinitions, + final Map pmmlDocuments) { + if (Objects.isNull(dmn)) { + return null; + } + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Name name = new Name(dmn.getName()); + final String namespace = dmn.getNamespace(); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final Definitions result = new Definitions(); + result.setId(id); + result.setName(name); + result.setNamespace(new Text(namespace)); + result.getNsContext().putIfAbsent(DMNModelInstrumentedBase.Namespace.DEFAULT.getPrefix(), namespace); + result.setExpressionLanguage(ExpressionLanguagePropertyConverter.wbFromDMN(dmn.getExpressionLanguage())); + result.setTypeLanguage(dmn.getTypeLanguage()); + result.setDescription(description); + + final Map namespaces = NameSpaceUtils.extractNamespacesKeyedByPrefix(dmn); + for (Entry kv : namespaces.entrySet()) { + String mappedURI = kv.getValue(); + switch (mappedURI) { + case org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase.URI_DMN: + mappedURI = org.kie.dmn.model.v1_2.KieDMNModelInstrumentedBase.URI_DMN; + break; + case org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase.URI_FEEL: + mappedURI = org.kie.dmn.model.v1_2.KieDMNModelInstrumentedBase.URI_FEEL; + break; + case org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase.URI_KIE: + mappedURI = org.kie.dmn.model.v1_2.KieDMNModelInstrumentedBase.URI_KIE; + break; + } + if (kv.getKey().equalsIgnoreCase(DMNModelInstrumentedBase.Namespace.DEFAULT.getPrefix())) { + result.getNsContext().putIfAbsent(kv.getKey(), mappedURI); + } else { + result.getNsContext().put(kv.getKey(), mappedURI); + } + } + + final List jsiItemDefinitions = dmn.getItemDefinition(); + for (int i = 0; i < jsiItemDefinitions.size(); i++) { + final JSITItemDefinition jsiItemDefinition = Js.uncheckedCast(jsiItemDefinitions.get(i)); + final ItemDefinition itemDefConverted = ItemDefinitionPropertyConverter.wbFromDMN(jsiItemDefinition); + if (Objects.nonNull(itemDefConverted)) { + itemDefConverted.setParent(result); + result.getItemDefinition().add(itemDefConverted); + } + } + + final List jsiImports = dmn.getImport(); + for (int i = 0; i < jsiImports.size(); i++) { + final JSITImport jsiImport = Js.uncheckedCast(jsiImports.get(i)); + final JSITDefinitions definitions = importDefinitions.get(jsiImport); + final PMMLDocumentMetadata pmmlDocument = pmmlDocuments.get(jsiImport); + final Import importConverted = ImportConverter.wbFromDMN(jsiImport, definitions, pmmlDocument); + if (Objects.nonNull(importConverted)) { + importConverted.setParent(result); + result.getImport().add(importConverted); + } + } + + return result; + } + + public static JSITDefinitions dmnFromWB(final Definitions wb) { + if (Objects.isNull(wb)) { + return null; + } + final JSITDefinitions result = new JSITDefinitions(); + + // TODO currently DMN wb UI does not offer feature to set these required DMN properties, setting some hardcoded defaults for now. + final String defaultId = Objects.nonNull(wb.getId()) ? wb.getId().getValue() : UUID.uuid(); + final String defaultName = Objects.nonNull(wb.getName()) ? wb.getName().getValue() : UUID.uuid(8); + final String defaultNamespace = !StringUtils.isEmpty(wb.getNamespace().getValue()) + ? wb.getNamespace().getValue() + : DMNModelInstrumentedBase.Namespace.DEFAULT.getUri() + UUID.uuid(); + + result.setId(defaultId); + result.setName(defaultName); + result.setNamespace(defaultNamespace); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(result::setDescription); + final String typeLanguage = wb.getTypeLanguage(); + final String expressionLanguage = ExpressionLanguagePropertyConverter.dmnFromWB(wb.getExpressionLanguage()); + if (!StringUtils.isEmpty(typeLanguage)) { + result.setTypeLanguage(typeLanguage); + } + if (!StringUtils.isEmpty(expressionLanguage)) { + result.setExpressionLanguage(expressionLanguage); + } + final Map otherAttributes = new HashMap<>(); + wb.getNsContext().forEach((k, v) -> { + // jsonix does not like marshalling xmlns="a url" so remove the default namespace. + // The default namespace is now set when jsonix is invoked in MainJs.marshall(dmn12) + // See https://github.com/highsource/jsonix/issues/227 + if (!Objects.equals(k, DMNModelInstrumentedBase.Namespace.DEFAULT.getPrefix())) { + otherAttributes.put(new QName(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, + k, + XMLConstants.DEFAULT_NS_PREFIX), + v); + } + }); + result.setOtherAttributes(otherAttributes); + + // Add because it is present in the original JSON when unmarshalling + if (Objects.isNull(result.getItemDefinition())) { + result.setItemDefinition(new ArrayList<>()); + } + for (ItemDefinition itemDef : wb.getItemDefinition()) { + final JSITItemDefinition itemDefConverted = ItemDefinitionPropertyConverter.dmnFromWB(itemDef); + result.addItemDefinition(itemDefConverted); + } + // Add because it is present in the original JSON when unmarshalling + if (Objects.isNull(result.getImport())) { + result.setImport(new ArrayList<>()); + } + // Add because it is present in the original JSON when unmarshalling + if (Objects.isNull(result.getDrgElement())) { + result.setDrgElement(new ArrayList<>()); + } + // Add because it is present in the original JSON when unmarshalling + if (Objects.isNull(result.getArtifact())) { + result.setArtifact(new ArrayList<>()); + } + for (Import i : wb.getImport()) { + final JSITImport importConverted = ImportConverter.dmnFromWb(i); + result.addImport(importConverted); + } + + return result; + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DescriptionPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DescriptionPropertyConverter.java new file mode 100644 index 00000000000..198f548a588 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/DescriptionPropertyConverter.java @@ -0,0 +1,43 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; + +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +public class DescriptionPropertyConverter { + + public static Description wbFromDMN(final String description) { + if (Objects.isNull(description)) { + return new Description(""); + } else { + return new Description(description); + } + } + + public static String dmnFromWB(final Description description) { + if (Objects.isNull(description)) { + return null; + } else if (StringUtils.isEmpty(description.getValue())) { + return null; + } else { + return description.getValue(); + } + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ExpressionLanguagePropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ExpressionLanguagePropertyConverter.java new file mode 100644 index 00000000000..e006fcfbbb6 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ExpressionLanguagePropertyConverter.java @@ -0,0 +1,43 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; + +import org.kie.workbench.common.dmn.api.property.dmn.ExpressionLanguage; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +public class ExpressionLanguagePropertyConverter { + + public static ExpressionLanguage wbFromDMN(final String language) { + if (Objects.isNull(language)) { + return new ExpressionLanguage(""); + } else { + return new ExpressionLanguage(language); + } + } + + public static String dmnFromWB(final ExpressionLanguage language) { + if (Objects.isNull(language)) { + return null; + } else if (StringUtils.isEmpty(language.getValue())) { + return null; + } else { + return language.getValue(); + } + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ExpressionPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ExpressionPropertyConverter.java new file mode 100644 index 00000000000..9b7e4c5856c --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ExpressionPropertyConverter.java @@ -0,0 +1,161 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.Context; +import org.kie.workbench.common.dmn.api.definition.model.DecisionTable; +import org.kie.workbench.common.dmn.api.definition.model.Expression; +import org.kie.workbench.common.dmn.api.definition.model.FunctionDefinition; +import org.kie.workbench.common.dmn.api.definition.model.Invocation; +import org.kie.workbench.common.dmn.api.definition.model.IsLiteralExpression; +import org.kie.workbench.common.dmn.api.definition.model.List; +import org.kie.workbench.common.dmn.api.definition.model.LiteralExpression; +import org.kie.workbench.common.dmn.api.definition.model.Relation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITContext; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDecisionTable; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITExpression; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITFunctionDefinition; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInvocation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITList; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITLiteralExpression; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITRelation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; + +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.WrapperUtils.getWrappedJSITContext; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.WrapperUtils.getWrappedJSITDecisionTable; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.WrapperUtils.getWrappedJSITFunctionDefinition; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.WrapperUtils.getWrappedJSITInvocation; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.WrapperUtils.getWrappedJSITList; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.WrapperUtils.getWrappedJSITLiteralExpression; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.WrapperUtils.getWrappedJSITRelation; + +public class ExpressionPropertyConverter { + + public static Expression wbFromDMN(final JSITExpression dmn, + final JSITExpression parent, + final BiConsumer hasComponentWidthsConsumer) { + if (JSITLiteralExpression.instanceOf(dmn)) { + final JSITLiteralExpression jsiExpression = Js.uncheckedCast(dmn); + final LiteralExpression e = LiteralExpressionPropertyConverter.wbFromDMN(jsiExpression); + hasComponentWidthsConsumer.accept(dmn.getId(), + e); + return e; + } else if (JSITContext.instanceOf(dmn)) { + final JSITContext jsiExpression = Js.uncheckedCast(dmn); + final Context e = ContextPropertyConverter.wbFromDMN(jsiExpression, + parent, + hasComponentWidthsConsumer); + hasComponentWidthsConsumer.accept(dmn.getId(), + e); + return e; + } else if (JSITRelation.instanceOf(dmn)) { + final JSITRelation jsiExpression = Js.uncheckedCast(dmn); + final Relation e = RelationPropertyConverter.wbFromDMN(jsiExpression, + hasComponentWidthsConsumer); + hasComponentWidthsConsumer.accept(dmn.getId(), + e); + return e; + } else if (JSITList.instanceOf(dmn)) { + final JSITList jsiExpression = Js.uncheckedCast(dmn); + final List e = ListPropertyConverter.wbFromDMN(jsiExpression, + hasComponentWidthsConsumer); + hasComponentWidthsConsumer.accept(dmn.getId(), + e); + return e; + } else if (JSITInvocation.instanceOf(dmn)) { + final JSITInvocation jsiExpression = Js.uncheckedCast(dmn); + final Invocation e = InvocationPropertyConverter.wbFromDMN(jsiExpression, + hasComponentWidthsConsumer); + hasComponentWidthsConsumer.accept(dmn.getId(), + e); + return e; + } else if (JSITFunctionDefinition.instanceOf(dmn)) { + final JSITFunctionDefinition jsiExpression = Js.uncheckedCast(dmn); + final FunctionDefinition e = FunctionDefinitionPropertyConverter.wbFromDMN(jsiExpression, + hasComponentWidthsConsumer); + hasComponentWidthsConsumer.accept(dmn.getId(), + e); + return e; + } else if (JSITDecisionTable.instanceOf(dmn)) { + final JSITDecisionTable jsiExpression = Js.uncheckedCast(dmn); + final DecisionTable e = DecisionTablePropertyConverter.wbFromDMN(jsiExpression); + hasComponentWidthsConsumer.accept(dmn.getId(), + e); + return e; + } + return null; + } + + public static JSITExpression dmnFromWB(final Expression wb, + final Consumer componentWidthsConsumer) { + // SPECIAL CASE: to represent a partially edited DMN file. + // reference above. + if (Objects.isNull(wb)) { + final JSITLiteralExpression mockedExpression = new JSITLiteralExpression(); + final JSITLiteralExpression wrappedMockedExpression = getWrappedJSITLiteralExpression(mockedExpression, "dmn", "literalExpression"); + return wrappedMockedExpression; + } + + final String uuid = wb.getId().getValue(); + if (Objects.nonNull(uuid)) { + final JSITComponentWidths componentWidths = new JSITComponentWidths(); + componentWidths.setDmnElementRef(uuid); + wb.getComponentWidths() + .stream() + .filter(Objects::nonNull) + .forEach(w -> componentWidths.addWidth(new Float(w))); + componentWidthsConsumer.accept(componentWidths); + } + + if (wb instanceof IsLiteralExpression) { + final JSITLiteralExpression unwrappedJSITLiteralExpression = LiteralExpressionPropertyConverter.dmnFromWB((IsLiteralExpression) wb); + final JSITLiteralExpression wrappedJSITLiteralExpression = getWrappedJSITLiteralExpression(unwrappedJSITLiteralExpression, "dmn", "literalExpression"); + return wrappedJSITLiteralExpression; + } else if (wb instanceof Context) { + final JSITContext unwrappedJSITContext = ContextPropertyConverter.dmnFromWB((Context) wb, componentWidthsConsumer); + final JSITContext wrappedJSITContext = getWrappedJSITContext(unwrappedJSITContext, "dmn", "context"); + return wrappedJSITContext; + } else if (wb instanceof Relation) { + final JSITRelation unwrappedJSITRelation = RelationPropertyConverter.dmnFromWB((Relation) wb, componentWidthsConsumer); + final JSITRelation wrappedJSITRelation = getWrappedJSITRelation(unwrappedJSITRelation, "dmn", "relation"); + return wrappedJSITRelation; + } else if (wb instanceof List) { + final JSITList unwrappedJSITList = ListPropertyConverter.dmnFromWB((List) wb, componentWidthsConsumer); + final JSITList wrappedJSITList = getWrappedJSITList(unwrappedJSITList, "dmn", "list"); + return wrappedJSITList; + } else if (wb instanceof Invocation) { + final JSITInvocation unwrappedJSITInvocation = InvocationPropertyConverter.dmnFromWB((Invocation) wb, componentWidthsConsumer); + final JSITInvocation wrappedJSITInvocation = getWrappedJSITInvocation(unwrappedJSITInvocation, "dmn", "invocation"); + return wrappedJSITInvocation; + } else if (wb instanceof FunctionDefinition) { + final JSITFunctionDefinition unwrappedJSITFunctionDefinition = FunctionDefinitionPropertyConverter.dmnFromWB((FunctionDefinition) wb, componentWidthsConsumer); + final JSITFunctionDefinition wrappedJSITFunctionDefinition = getWrappedJSITFunctionDefinition(unwrappedJSITFunctionDefinition, "dmn", "functionDefinition"); + return wrappedJSITFunctionDefinition; + } else if (wb instanceof DecisionTable) { + final JSITDecisionTable unwrappedJSITDecisionTable = DecisionTablePropertyConverter.dmnFromWB((DecisionTable) wb); + final JSITDecisionTable wrappedJSITDecisionTable = getWrappedJSITDecisionTable(unwrappedJSITDecisionTable, "dmn", "decisionTable"); + return wrappedJSITDecisionTable; + } + return null; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/FunctionDefinitionPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/FunctionDefinitionPropertyConverter.java new file mode 100644 index 00000000000..76b8c959fcc --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/FunctionDefinitionPropertyConverter.java @@ -0,0 +1,182 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.Context; +import org.kie.workbench.common.dmn.api.definition.model.ContextEntry; +import org.kie.workbench.common.dmn.api.definition.model.Expression; +import org.kie.workbench.common.dmn.api.definition.model.FunctionDefinition; +import org.kie.workbench.common.dmn.api.definition.model.FunctionDefinition.Kind; +import org.kie.workbench.common.dmn.api.definition.model.InformationItem; +import org.kie.workbench.common.dmn.api.definition.model.LiteralExpression; +import org.kie.workbench.common.dmn.api.definition.model.LiteralExpressionPMMLDocument; +import org.kie.workbench.common.dmn.api.definition.model.LiteralExpressionPMMLDocumentModel; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITExpression; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITFunctionDefinition; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITFunctionKind; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.JsUtils; + +public class FunctionDefinitionPropertyConverter { + + public static FunctionDefinition wbFromDMN(final JSITFunctionDefinition dmn, + final BiConsumer hasComponentWidthsConsumer) { + if (Objects.isNull(dmn)) { + return null; + } + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); + final JSITExpression jsiExpression = Js.uncheckedCast(JsUtils.getUnwrappedElement(dmn.getExpression())); + final Expression expression = ExpressionPropertyConverter.wbFromDMN(jsiExpression, + Js.uncheckedCast(dmn), + hasComponentWidthsConsumer); + final FunctionDefinition result = new FunctionDefinition(id, + description, + typeRef, + expression); + if (Objects.nonNull(expression)) { + expression.setParent(result); + } + + //JSITFunctionKind is a String JSO so convert into the real type + final String sKind = Js.uncheckedCast(dmn.getKind()); + final Kind kind = Kind.fromValue(sKind); + switch (kind) { + case FEEL: + result.setKind(Kind.FEEL); + break; + case JAVA: + result.setKind(Kind.JAVA); + break; + case PMML: + result.setKind(Kind.PMML); + convertPMMLFunctionExpression(result); + break; + default: + result.setKind(Kind.FEEL); + break; + } + + final List jsiInformationItems = dmn.getFormalParameter(); + for (int i = 0; i < jsiInformationItems.size(); i++) { + final JSITInformationItem jsiInformationItem = Js.uncheckedCast(jsiInformationItems.get(i)); + final InformationItem iiConverted = InformationItemPropertyConverter.wbFromDMN(jsiInformationItem); + if (Objects.nonNull(iiConverted)) { + iiConverted.setParent(result); + } + result.getFormalParameter().add(iiConverted); + } + + return result; + } + + private static void convertPMMLFunctionExpression(final FunctionDefinition function) { + final Expression expression = function.getExpression(); + if (expression instanceof Context) { + final Context context = (Context) expression; + context.getContextEntry().forEach(FunctionDefinitionPropertyConverter::convertContextEntryExpression); + } + } + + private static void convertContextEntryExpression(final ContextEntry contextEntry) { + final Expression expression = contextEntry.getExpression(); + if (expression instanceof LiteralExpression) { + final LiteralExpression le = (LiteralExpression) expression; + final String variableName = contextEntry.getVariable().getName().getValue(); + if (Objects.equals(LiteralExpressionPMMLDocument.VARIABLE_DOCUMENT, + variableName)) { + contextEntry.setExpression(convertLiteralExpressionToPMMLDocument(le)); + } else if (Objects.equals(LiteralExpressionPMMLDocumentModel.VARIABLE_MODEL, + variableName)) { + contextEntry.setExpression(convertLiteralExpressionToPMMLDocumentModel(le)); + } + } + } + + private static LiteralExpressionPMMLDocument convertLiteralExpressionToPMMLDocument(final LiteralExpression le) { + return new LiteralExpressionPMMLDocument(le.getId(), + le.getDescription(), + le.getTypeRef(), + le.getText(), + le.getImportedValues(), + le.getExpressionLanguage()); + } + + private static LiteralExpressionPMMLDocumentModel convertLiteralExpressionToPMMLDocumentModel(final LiteralExpression le) { + return new LiteralExpressionPMMLDocumentModel(le.getId(), + le.getDescription(), + le.getTypeRef(), + le.getText(), + le.getImportedValues(), + le.getExpressionLanguage()); + } + + public static JSITFunctionDefinition dmnFromWB(final FunctionDefinition wb, + final Consumer componentWidthsConsumer) { + if (Objects.isNull(wb)) { + return null; + } + final JSITFunctionDefinition result = new JSITFunctionDefinition(); + result.setId(wb.getId().getValue()); + // TODO {gcardosi} add because present in original json + if (Objects.isNull(result.getFormalParameter())) { + result.setFormalParameter(new ArrayList<>()); + } + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(result::setDescription); + QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef); + result.setExpression(ExpressionPropertyConverter.dmnFromWB(wb.getExpression(), + componentWidthsConsumer)); + + final Kind kind = wb.getKind(); + switch (kind) { + case FEEL: + result.setKind(Js.uncheckedCast(JSITFunctionKind.FEEL.value())); + break; + case JAVA: + result.setKind(Js.uncheckedCast(JSITFunctionKind.JAVA.value())); + break; + case PMML: + result.setKind(Js.uncheckedCast(JSITFunctionKind.PMML.value())); + break; + default: + result.setKind(Js.uncheckedCast(JSITFunctionKind.FEEL.value())); + break; + } + + for (InformationItem ii : wb.getFormalParameter()) { + final JSITInformationItem iiConverted = InformationItemPropertyConverter.dmnFromWB(ii); + result.addFormalParameter(iiConverted); + } + + return result; + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/HrefBuilder.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/HrefBuilder.java new file mode 100644 index 00000000000..944d9051c5d --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/HrefBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Map; + +import org.kie.workbench.common.dmn.api.definition.model.DMNDiagram; +import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase; +import org.kie.workbench.common.dmn.api.definition.model.DRGElement; +import org.kie.workbench.common.dmn.api.definition.model.Definitions; + +public class HrefBuilder { + + public static String getHref(final DRGElement drgElement) { + if (!drgElement.getId().getValue().contains(":")) { + return "#" + drgElement.getId().getValue(); + } + + // If it have ":" it is an imported element + final DMNModelInstrumentedBase parent = drgElement.getParent(); + final Definitions definitions; + if (parent instanceof DMNDiagram) { + final DMNDiagram diagram = (DMNDiagram) parent; + definitions = diagram.getDefinitions(); + } else { + definitions = (Definitions) parent; + } + + final String[] split = drgElement.getId().getValue().split(":"); + final String namespace = getNamespaceForImport(split[0], definitions.getNsContext()); + return namespace + "#" + split[1]; + } + + static String getNamespaceForImport(final String importName, + final Map nsContext) { + return nsContext.get(importName); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/IdPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/IdPropertyConverter.java new file mode 100644 index 00000000000..151ac5a41df --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/IdPropertyConverter.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; + +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +/** + * Client-side marshalling does not pass through Errai's RPC marshaller. Errai uses default constructors when + * instantiating objects on the client side and hence, although the Object instantiated on the server may have had null + * values, the Object that is instantiated on the client does not have null values. This is problematic for a specific + * scenario where a LiteralExpression is added to _empty_ Decision nodes as the Id is null. However the Decision + * Navigator needs non-null values. + */ +public class IdPropertyConverter { + + public static Id wbFromDMN(final String id) { + if (Objects.isNull(id)) { + return new Id(); + } else { + return new Id(id); + } + } + + public static String dmnFromWB(final Id id) { + if (Objects.isNull(id)) { + return null; + } else if (StringUtils.isEmpty(id.getValue())) { + return null; + } else { + return id.getValue(); + } + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ImportConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ImportConverter.java new file mode 100644 index 00000000000..eeee1714fda --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ImportConverter.java @@ -0,0 +1,126 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Function; +import java.util.function.Supplier; + +import javax.xml.XMLConstants; + +import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase; +import org.kie.workbench.common.dmn.api.definition.model.Import; +import org.kie.workbench.common.dmn.api.definition.model.ImportDMN; +import org.kie.workbench.common.dmn.api.definition.model.ImportPMML; +import org.kie.workbench.common.dmn.api.editors.included.DMNImportTypes; +import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; +import org.kie.workbench.common.dmn.api.property.dmn.LocationURI; +import org.kie.workbench.common.dmn.api.property.dmn.Name; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDefinitions; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITImport; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils.NameSpaceUtils; + +import static org.kie.workbench.common.dmn.api.editors.included.DMNImportTypes.determineImportType; + +public final class ImportConverter { + + public static Import wbFromDMN(final JSITImport dmn, + final JSITDefinitions definitions, + final PMMLDocumentMetadata pmmlDocument) { + final Import result = createWBImport(dmn, definitions, pmmlDocument); + final Map additionalAttributes = new HashMap<>(); + final Map otherAttributes = JSITUnaryTests.getOtherAttributesMap(dmn); + for (Map.Entry entry : otherAttributes.entrySet()) { + additionalAttributes.put(QNamePropertyConverter.wbFromDMN(entry.getKey().toString()), entry.getValue()); + } + result.setAdditionalAttributes(additionalAttributes); + final String name = dmn.getName(); + final String description = dmn.getDescription(); + result.setId(IdPropertyConverter.wbFromDMN(dmn.getId())); + result.setName(new Name(name)); + result.setDescription(DescriptionPropertyConverter.wbFromDMN(description)); + + NameSpaceUtils.extractNamespacesKeyedByPrefix(dmn).forEach((key, value) -> result.getNsContext().put(key, value)); + + return result; + } + + private static Import createWBImport(final JSITImport dmn, + final JSITDefinitions definitions, + final PMMLDocumentMetadata pmmlDocument) { + final LocationURI locationURI = new LocationURI(dmn.getLocationURI()); + if (Objects.equals(DMNImportTypes.DMN, determineImportType(dmn.getImportType()))) { + final ImportDMN result = new ImportDMN(dmn.getNamespace(), locationURI, dmn.getImportType()); + result.setDrgElementsCount(countDefinitionElement(definitions, () -> d -> d.getDrgElement().size())); + result.setItemDefinitionsCount(countDefinitionElement(definitions, () -> d -> d.getItemDefinition().size())); + return result; + } else if (Objects.equals(DMNImportTypes.PMML, determineImportType(dmn.getImportType()))) { + final ImportPMML result = new ImportPMML(dmn.getNamespace(), locationURI, dmn.getImportType()); + result.setModelCount(pmmlDocument.getModels().size()); + return result; + } else { + return new Import(dmn.getNamespace(), locationURI, dmn.getImportType()); + } + } + + static JSITImport dmnFromWb(final Import wb) { + final JSITImport result = new JSITImport(); + result.setImportType(wb.getImportType()); + result.setLocationURI(wb.getLocationURI().getValue()); + result.setNamespace(wb.getNamespace()); + final Map otherAttributes = new HashMap<>(); + for (Map.Entry entry : wb.getAdditionalAttributes().entrySet()) { + QNamePropertyConverter.dmnFromWB(entry.getKey()) + .ifPresent(qName -> otherAttributes.put(qName, entry.getValue())); + } + wb.getNsContext().forEach((k, v) -> { + // jsonix does not like marshalling xmlns="a url" so remove the default namespace. + // The default namespace is now set when jsonix is invoked in MainJs.marshall(dmn12) + // See https://github.com/highsource/jsonix/issues/227 + if (!Objects.equals(k, DMNModelInstrumentedBase.Namespace.DEFAULT.getPrefix())) { + otherAttributes.put(new javax.xml.namespace.QName(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, + k, + XMLConstants.DEFAULT_NS_PREFIX), + v); + } + }); + otherAttributes.remove(new javax.xml.namespace.QName(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, + DMNModelInstrumentedBase.Namespace.DEFAULT.getPrefix(), + XMLConstants.DEFAULT_NS_PREFIX)); + + result.setId(wb.getId().getValue()); + result.setName(wb.getName().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(result::setDescription); + result.setOtherAttributes(otherAttributes); + + return result; + } + + private static Integer countDefinitionElement(final JSITDefinitions definitions, + final Supplier> supplier) { + final Integer none = 0; + return Optional + .ofNullable(definitions) + .map(supplier.get()) + .orElse(none); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ImportedValuesConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ImportedValuesConverter.java new file mode 100644 index 00000000000..bd405bfca4d --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ImportedValuesConverter.java @@ -0,0 +1,68 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; +import java.util.Optional; + +import org.kie.workbench.common.dmn.api.definition.model.ImportedValues; +import org.kie.workbench.common.dmn.api.property.dmn.ExpressionLanguage; +import org.kie.workbench.common.dmn.api.property.dmn.LocationURI; +import org.kie.workbench.common.dmn.api.property.dmn.Name; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITImportedValues; + +public class ImportedValuesConverter { + + public static ImportedValues wbFromDMN(final JSITImportedValues dmn) { + if (Objects.isNull(dmn)) { + return null; + } + final String namespace = dmn.getNamespace(); + final LocationURI locationURI = new LocationURI(dmn.getLocationURI()); + final String importType = dmn.getImportType(); + final String importedElement = dmn.getImportedElement(); + final ExpressionLanguage expressionLanguage = ExpressionLanguagePropertyConverter.wbFromDMN(dmn.getExpressionLanguage()); + final ImportedValues wb = new ImportedValues(namespace, + locationURI, + importType, + importedElement, + expressionLanguage); + final String name = dmn.getName(); + final String description = dmn.getDescription(); + wb.setId(IdPropertyConverter.wbFromDMN(dmn.getId())); + wb.setName(new Name(Objects.nonNull(name) ? name : wb.getId().getValue())); + wb.setDescription(DescriptionPropertyConverter.wbFromDMN(description)); + return wb; + } + + public static JSITImportedValues dmnFromWB(final ImportedValues wb) { + if (Objects.isNull(wb)) { + return null; + } + final JSITImportedValues dmn = new JSITImportedValues(); + dmn.setNamespace(wb.getNamespace()); + dmn.setLocationURI(wb.getLocationURI().getValue()); + dmn.setImportType(wb.getImportType()); + dmn.setImportedElement(wb.getImportedElement()); + dmn.setId(wb.getId().getValue()); + dmn.setName(wb.getName().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(dmn::setDescription); + dmn.setExpressionLanguage(ExpressionLanguagePropertyConverter.dmnFromWB(wb.getExpressionLanguage())); + return dmn; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InformationItemPrimaryPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InformationItemPrimaryPropertyConverter.java new file mode 100644 index 00000000000..502f35db67b --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InformationItemPrimaryPropertyConverter.java @@ -0,0 +1,81 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; +import java.util.Optional; + +import org.kie.workbench.common.dmn.api.definition.HasName; +import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase; +import org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.Name; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITNamedElement; + +public class InformationItemPrimaryPropertyConverter { + + private static final String DEFAULT_NAME = ""; + + public static InformationItemPrimary wbFromDMN(final JSITInformationItem dmn, + final Object parent) { + if (Objects.isNull(dmn)) { + return null; + } + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Name name = new Name(getParentName(parent)); + final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); + + return new InformationItemPrimary(id, + name, + typeRef); + } + + public static JSITInformationItem dmnFromWB(final InformationItemPrimary wb, + final DMNModelInstrumentedBase parent) { + if (Objects.isNull(wb)) { + return null; + } + final JSITInformationItem result = new JSITInformationItem(); + result.setId(wb.getId().getValue()); + result.setName(getParentName(parent)); + + final QName typeRef = wb.getTypeRef(); + QNamePropertyConverter.setDMNfromWB(typeRef, result::setTypeRef); + + return result; + } + + static String getParentName(final Object parent) { + if (JSITNamedElement.instanceOf(parent)) { + final JSITNamedElement namedElement = (JSITNamedElement) parent; + final Optional name = Optional.ofNullable(namedElement.getName()); + return name.orElse(DEFAULT_NAME); + } + return DEFAULT_NAME; + } + + static String getParentName(final DMNModelInstrumentedBase parent) { + if (parent instanceof HasName) { + final HasName hasName = (HasName) parent; + final Optional name = Optional.ofNullable(hasName.getName()); + return name.map(Name::getValue).orElse(DEFAULT_NAME); + } + return DEFAULT_NAME; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InformationItemPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InformationItemPropertyConverter.java new file mode 100644 index 00000000000..72b27e2ac41 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InformationItemPropertyConverter.java @@ -0,0 +1,59 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; +import java.util.Optional; + +import org.kie.workbench.common.dmn.api.definition.model.InformationItem; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.Name; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem; + +public class InformationItemPropertyConverter { + + public static InformationItem wbFromDMN(final JSITInformationItem dmn) { + if (Objects.isNull(dmn)) { + return null; + } + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final Name name = new Name(dmn.getName()); + final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); + final InformationItem result = new InformationItem(id, + description, + name, + typeRef); + return result; + } + + public static JSITInformationItem dmnFromWB(final InformationItem wb) { + if (Objects.isNull(wb)) { + return null; + } + final JSITInformationItem result = new JSITInformationItem(); + result.setId(wb.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(result::setDescription); + result.setName(wb.getName().getValue()); + QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef); + + return result; + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InputClauseLiteralExpressionPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InputClauseLiteralExpressionPropertyConverter.java new file mode 100644 index 00000000000..0caf859f13a --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InputClauseLiteralExpressionPropertyConverter.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; + +import org.kie.workbench.common.dmn.api.definition.model.ImportedValues; +import org.kie.workbench.common.dmn.api.definition.model.InputClauseLiteralExpression; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.api.property.dmn.Text; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITLiteralExpression; + +public class InputClauseLiteralExpressionPropertyConverter { + + public static InputClauseLiteralExpression wbFromDMN(final JSITLiteralExpression dmn) { + if (Objects.isNull(dmn)) { + return null; + } + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); + final Text text = new Text(dmn.getText()); + final ImportedValues importedValues = ImportedValuesConverter.wbFromDMN(dmn.getImportedValues()); + final InputClauseLiteralExpression result = new InputClauseLiteralExpression(id, + description, + typeRef, + text, + importedValues); + if (Objects.nonNull(importedValues)) { + importedValues.setParent(result); + } + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InputClausePropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InputClausePropertyConverter.java new file mode 100644 index 00000000000..abd0090dcdb --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InputClausePropertyConverter.java @@ -0,0 +1,71 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; +import java.util.Optional; + +import org.kie.workbench.common.dmn.api.definition.model.InputClause; +import org.kie.workbench.common.dmn.api.definition.model.InputClauseLiteralExpression; +import org.kie.workbench.common.dmn.api.definition.model.InputClauseUnaryTests; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInputClause; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITLiteralExpression; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +public class InputClausePropertyConverter { + + public static InputClause wbFromDMN(final JSITInputClause dmn) { + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final InputClauseLiteralExpression inputExpression = InputClauseLiteralExpressionPropertyConverter.wbFromDMN(dmn.getInputExpression()); + final InputClauseUnaryTests inputValues = InputClauseUnaryTestsPropertyConverter.wbFromDMN(dmn.getInputValues()); + + final InputClause result = new InputClause(id, + description, + inputExpression, + inputValues); + + if (Objects.nonNull(inputExpression)) { + inputExpression.setParent(result); + } + if (Objects.nonNull(inputValues)) { + inputValues.setParent(result); + } + + return result; + } + + public static JSITInputClause dmnFromWB(final InputClause wb) { + final JSITInputClause result = new JSITInputClause(); + result.setId(wb.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(result::setDescription); + final JSITLiteralExpression expression = LiteralExpressionPropertyConverter.dmnFromWB(wb.getInputExpression()); + final JSITUnaryTests inputValues = UnaryTestsPropertyConverter.dmnFromWB(wb.getInputValues()); + + result.setInputExpression(expression); + + if (Objects.nonNull(inputValues) && StringUtils.nonEmpty(inputValues.getText())) { + result.setInputValues(inputValues); + } + + return result; + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InputClauseUnaryTestsPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InputClauseUnaryTestsPropertyConverter.java new file mode 100644 index 00000000000..164da4b0ed4 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InputClauseUnaryTestsPropertyConverter.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Map; +import java.util.Objects; + +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; + +import org.kie.workbench.common.dmn.api.definition.model.ConstraintType; +import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase; +import org.kie.workbench.common.dmn.api.definition.model.InputClauseUnaryTests; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.Text; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests; + +public class InputClauseUnaryTestsPropertyConverter { + + public static InputClauseUnaryTests wbFromDMN(final JSITUnaryTests dmn) { + if (Objects.isNull(dmn)) { + return null; + } + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final QName key = new QName(DMNModelInstrumentedBase.Namespace.KIE.getUri(), + ConstraintType.CONSTRAINT_KEY, + XMLConstants.DEFAULT_NS_PREFIX); + final Map otherAttributes = JSITUnaryTests.getOtherAttributesMap(dmn); + final String constraintString = otherAttributes.getOrDefault(key, ""); + final ConstraintType constraint = ConstraintType.fromString(constraintString); + final InputClauseUnaryTests result = new InputClauseUnaryTests(id, + new Text(dmn.getText()), + constraint); + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InputDataConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InputDataConverter.java new file mode 100644 index 00000000000..744b4d1448d --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InputDataConverter.java @@ -0,0 +1,94 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; +import java.util.Optional; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary; +import org.kie.workbench.common.dmn.api.definition.model.InputData; +import org.kie.workbench.common.dmn.api.property.background.BackgroundSet; +import org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.Name; +import org.kie.workbench.common.dmn.api.property.font.FontSet; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInputData; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId; + +public class InputDataConverter implements NodeConverter { + + private FactoryManager factoryManager; + + public InputDataConverter(final FactoryManager factoryManager) { + super(); + this.factoryManager = factoryManager; + } + + @Override + public Node, ?> nodeFromDMN(final JSITInputData dmn, + final BiConsumer hasComponentWidthsConsumer) { + @SuppressWarnings("unchecked") + final Node, ?> node = (Node, ?>) factoryManager.newElement(dmn.getId(), + getDefinitionId(InputData.class)).asNode(); + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final Name name = new Name(dmn.getName()); + final InformationItemPrimary informationItem = InformationItemPrimaryPropertyConverter.wbFromDMN(dmn.getVariable(), + dmn); + final InputData inputData = new InputData(id, + description, + name, + informationItem, + new BackgroundSet(), + new FontSet(), + new GeneralRectangleDimensionsSet()); + node.getContent().setDefinition(inputData); + + if (Objects.nonNull(informationItem)) { + informationItem.setParent(inputData); + } + + DMNExternalLinksToExtensionElements.loadExternalLinksFromExtensionElements(dmn, inputData); + + return node; + } + + @Override + public JSITInputData dmnFromNode(final Node, ?> node, + final Consumer componentWidthsConsumer) { + final InputData source = node.getContent().getDefinition(); + final JSITInputData result = new JSITInputData(); + result.setId(source.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(source.getDescription())); + description.ifPresent(result::setDescription); + result.setName(source.getName().getValue()); + final JSITInformationItem variable = InformationItemPrimaryPropertyConverter.dmnFromWB(source.getVariable(), source); + result.setVariable(variable); + DMNExternalLinksToExtensionElements.loadExternalLinksIntoExtensionElements(source, result); + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InvocationPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InvocationPropertyConverter.java new file mode 100644 index 00000000000..9cb618aaf86 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/InvocationPropertyConverter.java @@ -0,0 +1,100 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.Binding; +import org.kie.workbench.common.dmn.api.definition.model.Expression; +import org.kie.workbench.common.dmn.api.definition.model.Invocation; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITBinding; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITExpression; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInvocation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.JsUtils; + +public class InvocationPropertyConverter { + + public static Invocation wbFromDMN(final JSITInvocation dmn, + final BiConsumer hasComponentWidthsConsumer) { + if (Objects.isNull(dmn)) { + return null; + } + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); + + final Invocation result = new Invocation(); + result.setId(id); + result.setDescription(description); + result.setTypeRef(typeRef); + + final JSITExpression jsiExpression = Js.uncheckedCast(JsUtils.getUnwrappedElement(dmn.getExpression())); + final Expression convertedExpression = ExpressionPropertyConverter.wbFromDMN(jsiExpression, + Js.uncheckedCast(dmn), + hasComponentWidthsConsumer); + result.setExpression(convertedExpression); + if (Objects.nonNull(convertedExpression)) { + convertedExpression.setParent(result); + } + + final List jsiBindings = dmn.getBinding(); + for (int i = 0; i < jsiBindings.size(); i++) { + final JSITBinding jsiBinding = Js.uncheckedCast(jsiBindings.get(i)); + final Binding bConverted = BindingPropertyConverter.wbFromDMN(jsiBinding, + hasComponentWidthsConsumer); + if (Objects.nonNull(bConverted)) { + bConverted.setParent(result); + } + result.getBinding().add(bConverted); + } + + return result; + } + + public static JSITInvocation dmnFromWB(final Invocation wb, + final Consumer componentWidthsConsumer) { + if (Objects.isNull(wb)) { + return null; + } + final JSITInvocation result = new JSITInvocation(); + result.setId(wb.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(result::setDescription); + QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef); + + final JSITExpression convertedExpression = ExpressionPropertyConverter.dmnFromWB(wb.getExpression(), + componentWidthsConsumer); + result.setExpression(convertedExpression); + + for (Binding b : wb.getBinding()) { + final JSITBinding bConverted = BindingPropertyConverter.dmnFromWB(b, componentWidthsConsumer); + result.addBinding(bConverted); + } + + return result; + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ItemDefinitionPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ItemDefinitionPropertyConverter.java new file mode 100644 index 00000000000..2b9d8a2e99d --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ItemDefinitionPropertyConverter.java @@ -0,0 +1,139 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; +import org.kie.workbench.common.dmn.api.definition.model.UnaryTests; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.Name; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.api.property.dmn.types.BuiltInType; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests; + +import static java.util.Optional.ofNullable; + +public class ItemDefinitionPropertyConverter { + + public static ItemDefinition wbFromDMN(final JSITItemDefinition dmn) { + + if (Objects.isNull(dmn)) { + return null; + } + + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Name name = new Name(dmn.getName()); + + final Description description = wbDescriptionFromDMN(dmn); + final QName typeRef = wbTypeRefFromDMN(dmn); + + final String typeLanguage = dmn.getTypeLanguage(); + final boolean isCollection = dmn.getIsCollection(); + + final ItemDefinition wb = new ItemDefinition(id, + description, + name, + typeRef, + null, + null, + typeLanguage, + isCollection, + false); + + setUnaryTests(wb, dmn); + setItemComponent(wb, dmn); + + return wb; + } + + static void setUnaryTests(final ItemDefinition wb, + final JSITItemDefinition dmn) { + + final JSITUnaryTests dmnAllowedValues = dmn.getAllowedValues(); + final Optional wbUnaryTests = ofNullable(UnaryTestsPropertyConverter.wbFromDMN(dmnAllowedValues)); + + wbUnaryTests.ifPresent(unaryTests -> { + wb.setAllowedValues(unaryTests); + unaryTests.setParent(wb); + }); + } + + static void setItemComponent(final ItemDefinition wb, + final JSITItemDefinition dmn) { + final List jsiItemDefinitions = dmn.getItemComponent(); + if (Objects.nonNull(jsiItemDefinitions)) { + for (int i = 0; i < jsiItemDefinitions.size(); i++) { + final JSITItemDefinition jsiItemDefinition = Js.uncheckedCast(jsiItemDefinitions.get(i)); + wb.getItemComponent().add(wbChildFromDMN(wb, jsiItemDefinition)); + } + } + } + + static ItemDefinition wbChildFromDMN(final ItemDefinition wbParent, + final JSITItemDefinition dmnChild) { + + final ItemDefinition wbChild = wbFromDMN(dmnChild); + + if (Objects.nonNull(wbChild)) { + wbChild.setParent(wbParent); + } + + return wbChild; + } + + static Description wbDescriptionFromDMN(final JSITItemDefinition dmn) { + return DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + } + + static QName wbTypeRefFromDMN(final JSITItemDefinition dmn) { + final QName wbQName = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); + final QName undefinedQName = BuiltInType.UNDEFINED.asQName(); + + return Objects.equals(wbQName, undefinedQName) ? null : wbQName; + } + + public static JSITItemDefinition dmnFromWB(final ItemDefinition wb) { + if (Objects.isNull(wb)) { + return null; + } + final JSITItemDefinition result = new JSITItemDefinition(); + result.setId(wb.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(result::setDescription); + result.setName(wb.getName().getValue()); + QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef); + + result.setTypeLanguage(wb.getTypeLanguage()); + result.setIsCollection(wb.isIsCollection()); + + final JSITUnaryTests utConverted = UnaryTestsPropertyConverter.dmnFromWB(wb.getAllowedValues()); + result.setAllowedValues(utConverted); + + for (ItemDefinition child : wb.getItemComponent()) { + final JSITItemDefinition convertedChild = ItemDefinitionPropertyConverter.dmnFromWB(child); + result.addItemComponent(convertedChild); + } + + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/KnowledgeSourceConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/KnowledgeSourceConverter.java new file mode 100644 index 00000000000..66e0b90aa52 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/KnowledgeSourceConverter.java @@ -0,0 +1,137 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.DRGElement; +import org.kie.workbench.common.dmn.api.definition.model.Decision; +import org.kie.workbench.common.dmn.api.definition.model.InputData; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeSource; +import org.kie.workbench.common.dmn.api.property.background.BackgroundSet; +import org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.KnowledgeSourceType; +import org.kie.workbench.common.dmn.api.property.dmn.LocationURI; +import org.kie.workbench.common.dmn.api.property.dmn.Name; +import org.kie.workbench.common.dmn.api.property.font.FontSet; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITAuthorityRequirement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElementReference; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITKnowledgeSource; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.HrefBuilder.getHref; +import static org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId; + +public class KnowledgeSourceConverter implements NodeConverter { + + private FactoryManager factoryManager; + + public KnowledgeSourceConverter(final FactoryManager factoryManager) { + super(); + this.factoryManager = factoryManager; + } + + @Override + public Node, ?> nodeFromDMN(final JSITKnowledgeSource dmn, + final BiConsumer hasComponentWidthsConsumer) { + @SuppressWarnings("unchecked") + final Node, ?> node = (Node, ?>) factoryManager.newElement(dmn.getId(), + getDefinitionId(KnowledgeSource.class)).asNode(); + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final Name name = new Name(dmn.getName()); + final KnowledgeSourceType ksType = new KnowledgeSourceType(dmn.getType()); + final LocationURI locationURI = new LocationURI(dmn.getLocationURI()); + final KnowledgeSource ks = new KnowledgeSource(id, + description, + name, + ksType, + locationURI, + new BackgroundSet(), + new FontSet(), + new GeneralRectangleDimensionsSet()); + node.getContent().setDefinition(ks); + + DMNExternalLinksToExtensionElements.loadExternalLinksFromExtensionElements(dmn, ks); + + return node; + } + + @Override + @SuppressWarnings("unchecked") + public JSITKnowledgeSource dmnFromNode(final Node, ?> node, + final Consumer componentWidthsConsumer) { + final KnowledgeSource source = node.getContent().getDefinition(); + final JSITKnowledgeSource result = new JSITKnowledgeSource(); + result.setId(source.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(source.getDescription())); + description.ifPresent(result::setDescription); + result.setName(source.getName().getValue()); + result.setType(source.getType().getValue()); + result.setLocationURI(source.getLocationURI().getValue()); + result.setAuthorityRequirement(new ArrayList<>()); + DMNExternalLinksToExtensionElements.loadExternalLinksIntoExtensionElements(source, result); + + // DMN spec table 2: Requirements connection rules + final List> inEdges = (List>) node.getInEdges(); + for (Edge e : inEdges) { + final Node sourceNode = e.getSourceNode(); + if (sourceNode.getContent() instanceof View) { + final View view = (View) sourceNode.getContent(); + if (view.getDefinition() instanceof DRGElement) { + final DRGElement drgElement = (DRGElement) view.getDefinition(); + if (drgElement instanceof Decision) { + final JSITAuthorityRequirement iReq = new JSITAuthorityRequirement(); + iReq.setId(e.getUUID()); + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(getHref(drgElement)); + iReq.setRequiredDecision(ri); + result.addAuthorityRequirement(iReq); + } else if (drgElement instanceof KnowledgeSource) { + final JSITAuthorityRequirement iReq = new JSITAuthorityRequirement(); + iReq.setId(e.getUUID()); + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(getHref(drgElement)); + iReq.setRequiredAuthority(ri); + result.addAuthorityRequirement(iReq); + } else if (drgElement instanceof InputData) { + final JSITAuthorityRequirement iReq = new JSITAuthorityRequirement(); + iReq.setId(e.getUUID()); + final JSITDMNElementReference ri = new JSITDMNElementReference(); + ri.setHref(getHref(drgElement)); + iReq.setRequiredInput(ri); + result.addAuthorityRequirement(iReq); + } else { + throw new UnsupportedOperationException("wrong model definition."); + } + } + } + } + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ListPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ListPropertyConverter.java new file mode 100644 index 00000000000..b785cf2c80f --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/ListPropertyConverter.java @@ -0,0 +1,79 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.ArrayList; +import java.util.Objects; +import java.util.Optional; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.Expression; +import org.kie.workbench.common.dmn.api.definition.model.List; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITExpression; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITList; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; + +public class ListPropertyConverter { + + public static List wbFromDMN(final JSITList dmn, + final BiConsumer hasComponentWidthsConsumer) { + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); + + final java.util.List expression = new ArrayList<>(); + final List result = new List(id, description, typeRef, expression); + final java.util.List jsiExpressions = dmn.getExpression(); + for (int i = 0; i < jsiExpressions.size(); i++) { + final JSITExpression jsitExpression = Js.uncheckedCast(jsiExpressions.get(i)); + Expression eConverted = ExpressionPropertyConverter.wbFromDMN(jsitExpression, + Js.uncheckedCast(dmn), + hasComponentWidthsConsumer); + expression.add(eConverted); + } + + for (Expression e : expression) { + if (Objects.nonNull(e)) { + e.setParent(result); + } + } + + return result; + } + + public static JSITList dmnFromWB(final List wb, + final Consumer componentWidthsConsumer) { + final JSITList result = new JSITList(); + result.setId(wb.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(result::setDescription); + QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef); + + for (Expression e : wb.getExpression()) { + final JSITExpression eConverted = ExpressionPropertyConverter.dmnFromWB(e, componentWidthsConsumer); + result.addExpression(eConverted); + } + + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/LiteralExpressionPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/LiteralExpressionPropertyConverter.java new file mode 100644 index 00000000000..06a9cea28fe --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/LiteralExpressionPropertyConverter.java @@ -0,0 +1,70 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; + +import org.kie.workbench.common.dmn.api.definition.model.ImportedValues; +import org.kie.workbench.common.dmn.api.definition.model.IsLiteralExpression; +import org.kie.workbench.common.dmn.api.definition.model.LiteralExpression; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.ExpressionLanguage; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.api.property.dmn.Text; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITImportedValues; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITLiteralExpression; + +public class LiteralExpressionPropertyConverter { + + public static LiteralExpression wbFromDMN(final JSITLiteralExpression dmn) { + if (Objects.isNull(dmn)) { + return null; + } + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); + final Text text = new Text(Objects.nonNull(dmn.getText()) ? dmn.getText() : ""); + final ExpressionLanguage expressionLanguage = ExpressionLanguagePropertyConverter.wbFromDMN(dmn.getExpressionLanguage()); + final ImportedValues importedValues = ImportedValuesConverter.wbFromDMN(dmn.getImportedValues()); + final LiteralExpression result = new LiteralExpression(id, + description, + typeRef, + text, + importedValues, + expressionLanguage); + if (Objects.nonNull(importedValues)) { + importedValues.setParent(result); + } + return result; + } + + public static JSITLiteralExpression dmnFromWB(final IsLiteralExpression wb) { + if (Objects.isNull(wb)) { + return null; + } + final JSITLiteralExpression result = new JSITLiteralExpression(); + result.setId(wb.getId().getValue()); + QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef); + result.setText(wb.getText().getValue()); + final JSITImportedValues importedValues = ImportedValuesConverter.dmnFromWB(wb.getImportedValues()); + if (Objects.nonNull(importedValues)) { + result.setImportedValues(importedValues); + } + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/NodeConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/NodeConverter.java new file mode 100644 index 00000000000..903a55e3a42 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/NodeConverter.java @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +interface NodeConverter { + + Node, ?> nodeFromDMN(final D source, + final BiConsumer hasComponentWidthsConsumer); + + D dmnFromNode(final Node, ?> source, + final Consumer componentWidthsConsumer); +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/OutputClauseLiteralExpressionPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/OutputClauseLiteralExpressionPropertyConverter.java new file mode 100644 index 00000000000..e78d01edd81 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/OutputClauseLiteralExpressionPropertyConverter.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; + +import org.kie.workbench.common.dmn.api.definition.model.ImportedValues; +import org.kie.workbench.common.dmn.api.definition.model.OutputClauseLiteralExpression; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.api.property.dmn.Text; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITLiteralExpression; + +public class OutputClauseLiteralExpressionPropertyConverter { + + public static OutputClauseLiteralExpression wbFromDMN(final JSITLiteralExpression dmn) { + if (Objects.isNull(dmn)) { + return null; + } + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); + final Text text = new Text(dmn.getText()); + final ImportedValues importedValues = ImportedValuesConverter.wbFromDMN(dmn.getImportedValues()); + final OutputClauseLiteralExpression result = new OutputClauseLiteralExpression(id, + description, + typeRef, + text, + importedValues); + if (Objects.nonNull(importedValues)) { + importedValues.setParent(result); + } + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/OutputClausePropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/OutputClausePropertyConverter.java new file mode 100644 index 00000000000..79f07d902d9 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/OutputClausePropertyConverter.java @@ -0,0 +1,81 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; +import java.util.Optional; + +import org.kie.workbench.common.dmn.api.definition.model.OutputClause; +import org.kie.workbench.common.dmn.api.definition.model.OutputClauseLiteralExpression; +import org.kie.workbench.common.dmn.api.definition.model.OutputClauseUnaryTests; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITLiteralExpression; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITOutputClause; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +public class OutputClausePropertyConverter { + + public static OutputClause wbFromDMN(final JSITOutputClause dmn) { + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final OutputClauseUnaryTests outputValues = OutputClauseUnaryTestsPropertyConverter.wbFromDMN(dmn.getOutputValues()); + final OutputClauseLiteralExpression defaultOutputEntry = OutputClauseLiteralExpressionPropertyConverter.wbFromDMN(dmn.getDefaultOutputEntry()); + final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); + + final OutputClause result = new OutputClause(); + result.setId(id); + result.setName(dmn.getName()); + result.setDescription(description); + result.setOutputValues(outputValues); + result.setDefaultOutputEntry(defaultOutputEntry); + result.setTypeRef(typeRef); + + if (Objects.nonNull(outputValues)) { + outputValues.setParent(result); + } + if (Objects.nonNull(defaultOutputEntry)) { + defaultOutputEntry.setParent(result); + } + + return result; + } + + public static JSITOutputClause dmnFromWB(final OutputClause wb) { + final JSITOutputClause result = new JSITOutputClause(); + result.setId(wb.getId().getValue()); + result.setName(wb.getName()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(result::setDescription); + + final JSITUnaryTests outputValues = UnaryTestsPropertyConverter.dmnFromWB(wb.getOutputValues()); + if (Objects.nonNull(outputValues) && StringUtils.nonEmpty(outputValues.getText())) { + result.setOutputValues(outputValues); + } + + final JSITLiteralExpression defaultOutputEntry = LiteralExpressionPropertyConverter.dmnFromWB(wb.getDefaultOutputEntry()); + if (Objects.nonNull(defaultOutputEntry) && StringUtils.nonEmpty(defaultOutputEntry.getText())) { + result.setDefaultOutputEntry(defaultOutputEntry); + } + + QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef); + + return result; + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/OutputClauseUnaryTestsPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/OutputClauseUnaryTestsPropertyConverter.java new file mode 100644 index 00000000000..f0023ea1087 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/OutputClauseUnaryTestsPropertyConverter.java @@ -0,0 +1,49 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Map; +import java.util.Objects; + +import javax.xml.namespace.QName; + +import org.kie.workbench.common.dmn.api.definition.model.ConstraintType; +import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase; +import org.kie.workbench.common.dmn.api.definition.model.OutputClauseUnaryTests; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.Text; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests; + +public class OutputClauseUnaryTestsPropertyConverter { + + public static OutputClauseUnaryTests wbFromDMN(final JSITUnaryTests dmn) { + if (Objects.isNull(dmn)) { + return null; + } + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final QName key = new QName(DMNModelInstrumentedBase.Namespace.KIE.getUri(), + ConstraintType.CONSTRAINT_KEY, + DMNModelInstrumentedBase.Namespace.KIE.getPrefix()); + final Map otherAttributes = JSITUnaryTests.getOtherAttributesMap(dmn); + final String constraintString = otherAttributes.getOrDefault(key, ""); + final ConstraintType constraint = ConstraintType.fromString(constraintString); + final OutputClauseUnaryTests result = new OutputClauseUnaryTests(id, + new Text(dmn.getText()), + constraint); + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/QNamePropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/QNamePropertyConverter.java new file mode 100644 index 00000000000..1d34715d6bc --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/QNamePropertyConverter.java @@ -0,0 +1,63 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; +import java.util.Optional; +import java.util.function.Consumer; + +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.api.property.dmn.types.BuiltInType; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +public class QNamePropertyConverter { + + public static QName wbFromDMN(final String qNameAsString) { + if (StringUtils.isEmpty(qNameAsString)) { + return BuiltInType.UNDEFINED.asQName(); + } + final javax.xml.namespace.QName qName = javax.xml.namespace.QName.valueOf(qNameAsString); + + return new QName(qName.getNamespaceURI(), + qName.getLocalPart(), + qName.getPrefix()); + } + + /* + * Handles setting QName as appropriate back on DMN node + */ + public static void setDMNfromWB(final QName qname, + final Consumer setter) { + if (Objects.nonNull(qname)) { + final Optional dmnTypeRef = dmnFromWB(qname); + dmnTypeRef.ifPresent(typeRef -> setter.accept(typeRef.toString())); + } + } + + public static Optional dmnFromWB(final QName wb) { + if (Objects.nonNull(wb)) { + if (Objects.equals(wb, BuiltInType.UNDEFINED.asQName())) { + return Optional.empty(); + } + return Optional.of(new javax.xml.namespace.QName(wb.getNamespaceURI(), + wb.getLocalPart(), + wb.getPrefix())); + } else { + return Optional.empty(); + } + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/QuestionPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/QuestionPropertyConverter.java new file mode 100644 index 00000000000..6b3e3583d1b --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/QuestionPropertyConverter.java @@ -0,0 +1,43 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Objects; + +import org.kie.workbench.common.dmn.api.property.dmn.Question; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +public class QuestionPropertyConverter { + + public static Question wbFromDMN(final String dmn) { + if (Objects.isNull(dmn)) { + return new Question(""); + } else { + return new Question(dmn); + } + } + + public static String dmnFromWB(final Question wb) { + if (Objects.isNull(wb)) { + return null; + } else if (StringUtils.isEmpty(wb.getValue())) { + return null; + } else { + return wb.getValue(); + } + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/RelationPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/RelationPropertyConverter.java new file mode 100644 index 00000000000..0373a30108e --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/RelationPropertyConverter.java @@ -0,0 +1,94 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.InformationItem; +import org.kie.workbench.common.dmn.api.definition.model.Relation; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.QName; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITList; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITRelation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; + +public class RelationPropertyConverter { + + public static Relation wbFromDMN(final JSITRelation dmn, + final BiConsumer hasComponentWidthsConsumer) { + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); + + final List convertedColumns = new ArrayList<>(); + final List jsiColumns = dmn.getColumn(); + for (int i = 0; i < jsiColumns.size(); i++) { + final JSITInformationItem jsiColumn = Js.uncheckedCast(jsiColumns.get(i)); + convertedColumns.add(InformationItemPropertyConverter.wbFromDMN(jsiColumn)); + } + + final List convertedRows = new ArrayList<>(); + final List jsiRows = dmn.getRow(); + for (int i = 0; i < jsiRows.size(); i++) { + final JSITList jsiRow = Js.uncheckedCast(jsiRows.get(i)); + convertedRows.add(ListPropertyConverter.wbFromDMN(jsiRow, hasComponentWidthsConsumer)); + } + + final Relation result = new Relation(id, description, typeRef, convertedColumns, convertedRows); + for (InformationItem column : convertedColumns) { + if (Objects.nonNull(column)) { + column.setParent(result); + } + } + for (org.kie.workbench.common.dmn.api.definition.model.List row : convertedRows) { + if (Objects.nonNull(row)) { + row.setParent(result); + } + } + return result; + } + + public static JSITRelation dmnFromWB(final Relation wb, + final Consumer componentWidthsConsumer) { + final JSITRelation result = new JSITRelation(); + result.setId(wb.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); + description.ifPresent(result::setDescription); + QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef); + + for (InformationItem iitem : wb.getColumn()) { + final JSITInformationItem iitemConverted = InformationItemPropertyConverter.dmnFromWB(iitem); + result.addColumn(iitemConverted); + } + + for (org.kie.workbench.common.dmn.api.definition.model.List list : wb.getRow()) { + final JSITList listConverted = ListPropertyConverter.dmnFromWB(list, componentWidthsConsumer); + result.addRow(listConverted); + } + + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/TextAnnotationConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/TextAnnotationConverter.java new file mode 100644 index 00000000000..2934d9bcbcc --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/TextAnnotationConverter.java @@ -0,0 +1,82 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.Optional; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import org.kie.workbench.common.dmn.api.definition.HasComponentWidths; +import org.kie.workbench.common.dmn.api.definition.model.TextAnnotation; +import org.kie.workbench.common.dmn.api.property.background.BackgroundSet; +import org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.Text; +import org.kie.workbench.common.dmn.api.property.dmn.TextFormat; +import org.kie.workbench.common.dmn.api.property.font.FontSet; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITTextAnnotation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentWidths; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId; + +public class TextAnnotationConverter implements NodeConverter { + + private FactoryManager factoryManager; + + public TextAnnotationConverter(final FactoryManager factoryManager) { + super(); + this.factoryManager = factoryManager; + } + + @Override + public Node, ?> nodeFromDMN(final JSITTextAnnotation dmn, + final BiConsumer hasComponentWidthsConsumer) { + @SuppressWarnings("unchecked") + final Node, ?> node = (Node, ?>) factoryManager.newElement(dmn.getId(), + getDefinitionId(TextAnnotation.class)).asNode(); + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final Text text = new Text(dmn.getText()); + final TextFormat textFormat = new TextFormat(dmn.getTextFormat()); + final TextAnnotation textAnnotation = new TextAnnotation(id, + description, + text, + textFormat, + new BackgroundSet(), + new FontSet(), + new GeneralRectangleDimensionsSet()); + node.getContent().setDefinition(textAnnotation); + return node; + } + + @Override + public JSITTextAnnotation dmnFromNode(final Node, ?> node, + final Consumer componentWidthsConsumer) { + final TextAnnotation source = node.getContent().getDefinition(); + final JSITTextAnnotation result = new JSITTextAnnotation(); + result.setId(source.getId().getValue()); + final Optional description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(source.getDescription())); + description.ifPresent(result::setDescription); + result.setText(source.getText().getValue()); + result.setTextFormat(source.getTextFormat().getValue()); + return result; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/UnaryTestsPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/UnaryTestsPropertyConverter.java new file mode 100644 index 00000000000..efa536d6748 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/UnaryTestsPropertyConverter.java @@ -0,0 +1,93 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import javax.xml.namespace.QName; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.model.ConstraintType; +import org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase; +import org.kie.workbench.common.dmn.api.definition.model.IsUnaryTests; +import org.kie.workbench.common.dmn.api.definition.model.UnaryTests; +import org.kie.workbench.common.dmn.api.property.dmn.Description; +import org.kie.workbench.common.dmn.api.property.dmn.ExpressionLanguage; +import org.kie.workbench.common.dmn.api.property.dmn.Id; +import org.kie.workbench.common.dmn.api.property.dmn.Text; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.JsUtils; + +import static org.kie.workbench.common.dmn.api.definition.model.ConstraintType.NONE; + +public class UnaryTestsPropertyConverter { + + public static UnaryTests wbFromDMN(final JSITUnaryTests dmn) { + if (Objects.isNull(dmn)) { + return null; + } + final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); + final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); + final ExpressionLanguage expressionLanguage = ExpressionLanguagePropertyConverter.wbFromDMN(dmn.getExpressionLanguage()); + final ConstraintType constraintTypeField; + final QName key = new QName(DMNModelInstrumentedBase.Namespace.KIE.getUri(), + ConstraintType.CONSTRAINT_KEY, + DMNModelInstrumentedBase.Namespace.KIE.getPrefix()); + + final Map otherAttributes = JSITUnaryTests.getOtherAttributesMap(dmn); + if (otherAttributes.containsKey(key)) { + constraintTypeField = ConstraintTypeFieldPropertyConverter.wbFromDMN(otherAttributes.get(key)); + } else { + constraintTypeField = NONE; + } + final UnaryTests result = new UnaryTests(id, + description, + new Text(dmn.getText()), + expressionLanguage, + constraintTypeField); + return result; + } + + public static JSITUnaryTests dmnFromWB(final IsUnaryTests wb) { + if (Objects.isNull(wb)) { + return null; + } + final JSITUnaryTests result = new JSITUnaryTests(); + final Map otherAttributes = new HashMap<>(); + result.setId(wb.getId().getValue()); + result.setText(wb.getText().getValue()); + result.setOtherAttributes(Js.uncheckedCast(JsUtils.fromAttributesMap(otherAttributes))); + + final ConstraintType constraint = wb.getConstraintType(); + + if (isNotNone(constraint)) { + final QName key = new QName(DMNModelInstrumentedBase.Namespace.KIE.getUri(), + ConstraintType.CONSTRAINT_KEY, + DMNModelInstrumentedBase.Namespace.KIE.getPrefix()); + otherAttributes.put(key, constraint.value()); + result.setOtherAttributes(Js.uncheckedCast(JsUtils.fromAttributesMap(otherAttributes))); + } + + return result; + } + + private static boolean isNotNone(final ConstraintType constraint) { + return !Objects.equals(constraint, NONE); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/dd/ColorUtils.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/dd/ColorUtils.java new file mode 100644 index 00000000000..c9a5dce09de --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/dd/ColorUtils.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd; + +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dc.JSIColor; + +public class ColorUtils { + + public static JSIColor dmnFromWB(final String colorString) { + final JSIColor result = new JSIColor(); + + try { + final Integer intval = Integer.decode(colorString); + final int i = intval.intValue(); + result.setRed((i >> 16) & 0xFF); + result.setGreen((i >> 8) & 0xFF); + result.setBlue(i & 0xFF); + } catch (NumberFormatException nfe) { + //Return default + } + + return result; + } + + public static String wbFromDMN(final JSIColor color) { + return "#" + toHexString(color.getRed()) + toHexString(color.getGreen()) + toHexString(color.getBlue()); + } + + private static String toHexString(final int value) { + final String hex = Integer.toHexString(value & 0xFF); + return hex.length() > 1 ? hex : "0" + hex; + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/dd/FontSetPropertyConverter.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/dd/FontSetPropertyConverter.java new file mode 100644 index 00000000000..f8219f6b1be --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/dd/FontSetPropertyConverter.java @@ -0,0 +1,53 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd; + +import java.util.Objects; + +import org.kie.workbench.common.dmn.api.property.font.FontSet; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNStyle; + +public class FontSetPropertyConverter { + + public static FontSet wbFromDMN(final JSIDMNStyle dmn) { + final FontSet result = new FontSet(); + if (Objects.nonNull(dmn.getFontFamily())) { + result.getFontFamily().setValue(dmn.getFontFamily()); + } + if (dmn.getFontSize() > 0) { + result.getFontSize().setValue(dmn.getFontSize()); + } + if (Objects.nonNull(dmn.getFontColor())) { + result.getFontColour().setValue(ColorUtils.wbFromDMN(dmn.getFontColor())); + } + return result; + } + + public static JSIDMNStyle dmnFromWB(final FontSet wb) { + final JSIDMNStyle result = new JSIDMNStyle(); + if (Objects.nonNull(wb.getFontFamily().getValue())) { + result.setFontFamily(wb.getFontFamily().getValue()); + } + if (Objects.nonNull(wb.getFontSize().getValue())) { + result.setFontSize(wb.getFontSize().getValue()); + } + if (Objects.nonNull(wb.getFontColour().getValue())) { + result.setFontColor(ColorUtils.dmnFromWB(wb.getFontColour().getValue())); + } + return result; + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/dd/PointUtils.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/dd/PointUtils.java new file mode 100644 index 00000000000..3bc4a1cdf0e --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/definition/model/dd/PointUtils.java @@ -0,0 +1,171 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd; + +import java.util.List; +import java.util.Objects; +import java.util.function.BiFunction; +import java.util.function.Function; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dc.JSIBounds; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dc.JSIPoint; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNShape; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bound; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Child; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class PointUtils { + + private PointUtils() { + // util class. + } + + public static JSIPoint point2dToDMNDIPoint(final Point2D point2d) { + final JSIPoint result = new JSIPoint(); + result.setX(point2d.getX()); + result.setY(point2d.getY()); + return result; + } + + public static Point2D dmndiPointToPoint2D(final JSIPoint dmndiPoint) { + final Point2D result = new Point2D(dmndiPoint.getX(), dmndiPoint.getY()); + return result; + } + + // In Stunner terms the location of a child (target) is always relative to the + // Parent (source) location however DMN requires all locations to be absolute. + public static void convertToAbsoluteBounds(final Node targetNode) { + convertBounds(targetNode, + (base, delta) -> base + delta); + } + + // In DMN terms the location of a Node is always absolute however Stunner requires + // children (target) to have a relative location to their Parent (source). + public static void convertToRelativeBounds(final Node targetNode) { + convertBounds(targetNode, + (base, delta) -> base - delta); + } + + @SuppressWarnings("unchecked") + private static void convertBounds(final Node targetNode, + final BiFunction convertor) { + if (targetNode.getContent() instanceof View) { + final View targetNodeView = (View) targetNode.getContent(); + double boundsX = xOfBound(upperLeftBound(targetNodeView)); + double boundsY = yOfBound(upperLeftBound(targetNodeView)); + final double boundsWidth = xOfBound(lowerRightBound(targetNodeView)) - boundsX; + final double boundsHeight = yOfBound(lowerRightBound(targetNodeView)) - boundsY; + final List> inEdges = (List>) targetNode.getInEdges(); + for (Edge e : inEdges) { + if (e.getContent() instanceof Child) { + final Node sourceNode = e.getSourceNode(); + final View sourceView = (View) sourceNode.getContent(); + final Bound sourceViewULBound = sourceView.getBounds().getUpperLeft(); + final double dx = sourceViewULBound.getX(); + final double dy = sourceViewULBound.getY(); + boundsX = convertor.apply(boundsX, dx); + boundsY = convertor.apply(boundsY, dy); + targetNodeView.setBounds(Bounds.create(boundsX, boundsY, boundsX + boundsWidth, boundsY + boundsHeight)); + break; + } + } + } + } + + public static double xOfShape(final JSIDMNShape shape) { + return extractValue(shape, + bounds -> { + final JSIBounds _bounds = Js.uncheckedCast(bounds); + return _bounds.getX(); + }); + } + + public static double yOfShape(final JSIDMNShape shape) { + return extractValue(shape, + bounds -> { + final JSIBounds _bounds = Js.uncheckedCast(bounds); + return _bounds.getY(); + }); + } + + public static double widthOfShape(final JSIDMNShape shape) { + return extractValue(shape, + bounds -> { + final JSIBounds _bounds = Js.uncheckedCast(bounds); + return _bounds.getWidth(); + }); + } + + public static double heightOfShape(final JSIDMNShape shape) { + return extractValue(shape, + bounds -> { + final JSIBounds _bounds = Js.uncheckedCast(bounds); + return _bounds.getHeight(); + }); + } + + public static Bound upperLeftBound(final View view) { + return extractBounds(view, Bounds::getUpperLeft); + } + + public static Bound lowerRightBound(final View view) { + return extractBounds(view, Bounds::getLowerRight); + } + + public static double xOfBound(final Bound bound) { + return extractBound(bound, Bound::getX); + } + + public static double yOfBound(final Bound bound) { + return extractBound(bound, Bound::getY); + } + + private static double extractValue(final JSIDMNShape shape, + final Function extractor) { + if (Objects.nonNull(shape)) { + final JSIDMNShape _shape = Js.uncheckedCast(shape); + if (Objects.nonNull(_shape.getBounds())) { + final JSIBounds bounds = Js.uncheckedCast(_shape.getBounds()); + return extractor.apply(bounds); + } + } + return 0.0; + } + + private static Bound extractBounds(final View view, + final Function extractor) { + if (Objects.nonNull(view)) { + if (Objects.nonNull(view.getBounds())) { + return extractor.apply(view.getBounds()); + } + } + return null; + } + + private static double extractBound(final Bound bound, + final Function extractor) { + if (Objects.nonNull(bound)) { + return extractor.apply(bound); + } + return 0.0; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/utils/DMNMarshallerUtils.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/utils/DMNMarshallerUtils.java new file mode 100644 index 00000000000..f2c397963a6 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/utils/DMNMarshallerUtils.java @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils; + +import java.util.stream.StreamSupport; + +import org.kie.workbench.common.dmn.api.definition.model.DMNDiagram; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class DMNMarshallerUtils { + + private DMNMarshallerUtils() { + //Private constructor to prevent instantiation + } + + public static Node findDMNDiagramRoot(final Graph> graph) { + return StreamSupport.stream(graph.nodes().spliterator(), false) + .filter(n -> n.getContent().getDefinition() instanceof DMNDiagram) + .findFirst() + .orElseThrow(() -> new IllegalStateException("DMNDiagram root not found.")); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/utils/JsonVerifier.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/utils/JsonVerifier.java new file mode 100644 index 00000000000..4f403603667 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/utils/JsonVerifier.java @@ -0,0 +1,221 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils; + +import java.util.Objects; +import java.util.Set; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.json.client.JSONArray; +import com.google.gwt.json.client.JSONObject; +import com.google.gwt.json.client.JSONParser; +import com.google.gwt.json.client.JSONValue; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDefinitions; + +public class JsonVerifier { + + private static final String WARNING = "*******************WARNING*******************"; + private static final String OTHER_ATTRIBUTES = "otherAttributes"; + private static final String H_$ = "$H"; + + public static void compareJSITDefinitions(JSITDefinitions original, JSITDefinitions marshalled) { + final String originalString = asString(original); + final String marshalledString = asString(marshalled); + checkCircularIssue(originalString, "originalString"); + checkCircularIssue(marshalledString, "marshalledString"); + JSONValue originalJSONValue = getJSONValue(originalString); + JSONValue marshalledJSONValue = getJSONValue(marshalledString); + if (checkNotNull(originalJSONValue, marshalledJSONValue)) { + compareJSONValue(originalJSONValue, marshalledJSONValue); + } else { + GWT.log(WARNING); + GWT.log("originalJSONValue is null ? " + Objects.isNull(originalJSONValue)); + GWT.log("marshalledJSONValue is null ? " + Objects.isNull(marshalledJSONValue)); + } + } + + private static void checkCircularIssue(String toCheck, String name) { + if (toCheck.contains("Circular~")) { + GWT.log(WARNING); + GWT.log(name + " contains Circular issue"); + GWT.log(toCheck); + } + } + + private static void compareJSONValue(JSONValue original, JSONValue marshalled) { + JSONObject originalJSONObject = original.isObject(); + JSONObject marshalledJSONObject = marshalled.isObject(); + JSONArray originalJSONArray = original.isArray(); + JSONArray marshalledJSONArray = marshalled.isArray(); + if (checkNotNull(originalJSONObject, originalJSONObject)) { + compareJSONObject(originalJSONObject, marshalledJSONObject); + } else if (checkNotNull(originalJSONArray, marshalledJSONArray)) { + compareJSONArray(originalJSONArray, marshalledJSONArray); + } else if (!Objects.equals(original, marshalled)) { + GWT.log(WARNING); + GWT.log("original expected : " + limitedString(original)); + GWT.log("marshalled retrieved : " + limitedString(marshalled)); + } + } + + private static void compareJSONObject(JSONObject original, JSONObject marshalled) { + checkKeys(original, marshalled); + for (String originalKey : original.keySet()) { + // TODO {gcardosi} to remove after otherAttributes are populated + if (!Objects.equals(OTHER_ATTRIBUTES, originalKey) && !Objects.equals(H_$, originalKey)) { + compareJSONObjectKey(original, marshalled, originalKey); + } + } + } + + private static void checkKeys(JSONObject original, JSONObject marshalled) { + final Set originalKeys = original.keySet(); + final Set marshalledKeys = marshalled.keySet(); + for (String originalKey : originalKeys) { + if (!marshalledKeys.contains(originalKey)) { + GWT.log(WARNING); + GWT.log("original key " + originalKey + " missing in marshalled " + limitedString(marshalled)); + } + } + } + + private static void compareJSONObjectKey(JSONObject original, JSONObject marshalled, String key) { + final JSONValue originalJSONValue = original.get(key); + final JSONValue marshalledJSONValue = marshalled.get(key); + if (checkNotNull(originalJSONValue, marshalledJSONValue)) { + compareJSONValue(originalJSONValue, marshalledJSONValue); + } else { + GWT.log(WARNING); + GWT.log("original " + limitedString(original) + ":" + key + " is null ? " + Objects.isNull(originalJSONValue)); + GWT.log("marshalled " + limitedString(marshalled) + ":" + key + " is null ? " + Objects.isNull(marshalledJSONValue)); + } + } + + private static boolean compareJSONArray(JSONArray original, JSONArray marshalled) { + boolean toReturn = true; + for (int i = 0; i < original.size(); i++) { + boolean retrieved = false; + for (int j = 0; j < marshalled.size(); j++) { + if (compareJSONValueForArray(original.get(i), marshalled.get(j))) { + retrieved = true; + break; + } + } + if (!retrieved) { + GWT.log(WARNING); + GWT.log("original expected " + limitedString(original.get(i)) + " not found in " + limitedString(marshalled)); + toReturn = false; + } + } + return toReturn; + } + + // COPY'N'PASTE - TO BE DONE BETTER + + private static boolean compareJSONValueForArray(JSONValue original, JSONValue marshalled) { + JSONObject originalJSONObject = original.isObject(); + JSONObject marshalledJSONObject = marshalled.isObject(); + JSONArray originalJSONArray = original.isArray(); + JSONArray marshalledJSONArray = marshalled.isArray(); + boolean toReturn = true; + if (checkNotNull(originalJSONObject, originalJSONObject)) { + toReturn = compareJSONObjectForArray(originalJSONObject, marshalledJSONObject); + } else if (checkNotNull(originalJSONArray, marshalledJSONArray)) { + toReturn = compareJSONArray(originalJSONArray, marshalledJSONArray); + } else { + toReturn = Objects.equals(original, marshalled); + } + return toReturn; + } + + private static boolean compareJSONObjectForArray(JSONObject original, JSONObject marshalled) { + boolean toReturn = checkKeysForArray(original, marshalled); + for (String originalKey : original.keySet()) { + toReturn = toReturn && compareJSONObjectKeyForArray(original, marshalled, originalKey); + } + return toReturn; + } + + private static boolean checkKeysForArray(JSONObject original, JSONObject marshalled) { + final Set originalKeys = original.keySet(); + final Set marshalledKeys = marshalled.keySet(); + boolean toReturn = true; + for (String originalKey : originalKeys) { + // TODO {gcardosi} to remove after otherAttributes are populated + if (!marshalledKeys.contains(originalKey) && !Objects.equals(OTHER_ATTRIBUTES, originalKey) && !Objects.equals(H_$, originalKey)) { + GWT.log(WARNING); + GWT.log("original key " + originalKey + " missing in marshalled " + limitedString(marshalled)); + toReturn = false; + } + } + return toReturn; + } + + private static boolean compareJSONObjectKeyForArray(JSONObject original, JSONObject marshalled, String key) { + final JSONValue originalJSONValue = original.get(key); + final JSONValue marshalledJSONValue = marshalled.get(key); + boolean toReturn = true; + // TODO {gcardosi} to remove after otherAttributes are populated + if (!Objects.equals(OTHER_ATTRIBUTES, key) && !Objects.equals(H_$, key)) { + toReturn = checkNotNull(originalJSONValue, marshalledJSONValue) && compareJSONValueForArray(originalJSONValue, marshalledJSONValue); + } + return toReturn; + } + + private static boolean checkNotNull(JSONValue original, JSONValue marshalled) { + return !Objects.isNull(original) && !Objects.isNull(marshalled); + } + + private static JSONValue getJSONValue(String jsonString) { + try { + return JSONParser.parseStrict(jsonString); + } catch (Exception e) { + return null; + } + } + + private static String limitedString(D toConvert) { + String toReturn = asString(toConvert); + if (toReturn.length() > 100) { + toReturn = toReturn.substring(0, 100); + } + return toReturn; + } + + private static native String asString(D toConvert) /*-{ + + function serializer(replacer, cycleReplacer) { + var stack = [], keys = [] + + if (cycleReplacer == null) cycleReplacer = function (key, value) { + if (stack[0] === value) return "[Circular ~]" + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" + } + return function (key, value) { + if (stack.length > 0) { + var thisPos = stack.indexOf(this) + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) + if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) + } else stack.push(value) + + return replacer == null ? value : replacer.call(this, key, value) + } + } + + return JSON.stringify(toConvert, serializer(null, null), 2) + }-*/; +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/utils/NameSpaceUtils.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/utils/NameSpaceUtils.java new file mode 100644 index 00000000000..12f6c561741 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/utils/NameSpaceUtils.java @@ -0,0 +1,64 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; + +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElement; + +public class NameSpaceUtils { + + public static Map extractNamespacesKeyedByUri(final JSITDMNElement jsiDMNElement) { + final Map namespaces = new HashMap<>(); + final Map otherAttributes = JSITDMNElement.getOtherAttributesMap(jsiDMNElement); + + //Filter otherAttributes by NameSpace definitions + for (Map.Entry e : otherAttributes.entrySet()) { + final QName qName = e.getKey(); + final String nsLocalPart = qName.getLocalPart(); + final String nsNamespaceURI = qName.getNamespaceURI(); + if (Objects.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, nsNamespaceURI)) { + if (!Objects.equals(XMLConstants.XMLNS_ATTRIBUTE, nsLocalPart)) { + namespaces.put(e.getValue(), nsLocalPart); + } + } + } + return namespaces; + } + + public static Map extractNamespacesKeyedByPrefix(final JSITDMNElement jsiDMNElement) { + final Map namespaces = new HashMap<>(); + final Map otherAttributes = JSITDMNElement.getOtherAttributesMap(jsiDMNElement); + + //Filter otherAttributes by NameSpace definitions + for (Map.Entry e : otherAttributes.entrySet()) { + final QName qName = e.getKey(); + final String nsLocalPart = qName.getLocalPart(); + final String nsNamespaceURI = qName.getNamespaceURI(); + if (Objects.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, nsNamespaceURI)) { + if (!Objects.equals(XMLConstants.XMLNS_ATTRIBUTE, nsLocalPart)) { + namespaces.put(nsLocalPart, e.getValue()); + } + } + } + return namespaces; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/utils/WrapperUtils.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/utils/WrapperUtils.java new file mode 100644 index 00000000000..f6ca70b3afc --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/utils/WrapperUtils.java @@ -0,0 +1,284 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.utils; + +import java.util.Objects; + +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; + +import jsinterop.base.Js; +import org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel; +import org.kie.workbench.common.dmn.api.definition.model.DMNElement; +import org.kie.workbench.common.dmn.api.definition.model.Decision; +import org.kie.workbench.common.dmn.api.definition.model.DecisionService; +import org.kie.workbench.common.dmn.api.definition.model.InputData; +import org.kie.workbench.common.dmn.api.definition.model.KnowledgeSource; +import org.kie.workbench.common.dmn.api.definition.model.TextAnnotation; +import org.kie.workbench.common.dmn.api.property.background.BackgroundSet; +import org.kie.workbench.common.dmn.api.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.dmn.api.property.font.FontSet; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dc.JSIBounds; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dc.JSIColor; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dc.JSIPoint; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITAssociation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITContext; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDecisionTable; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITFunctionDefinition; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInvocation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITList; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITLiteralExpression; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITRelation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITTextAnnotation; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNDecisionServiceDividerLine; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNEdge; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNLabel; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNShape; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNStyle; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.kie.JSITComponentsWidthsExtension; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.JSIName; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.JsUtils; +import org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.ColorUtils; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.upperLeftBound; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.xOfBound; +import static org.kie.workbench.common.dmn.webapp.kogito.marshaller.mapper.definition.model.dd.PointUtils.yOfBound; + +/** + * Class used to holds all common wrapping methods + */ +public class WrapperUtils { + + public static JSITAssociation getWrappedJSITAssociation(JSITAssociation toWrap) { + JSITAssociation toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(toWrap)); + JSIName jsiName = JSITTextAnnotation.getJSIName(); + updateJSIName(jsiName, "dmn", "association"); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static JSITTextAnnotation getWrappedJSITTextAnnotation(JSITTextAnnotation toWrap) { + JSITTextAnnotation toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(toWrap)); + JSIName jsiName = JSITTextAnnotation.getJSIName(); + updateJSIName(jsiName, "dmn", "textAnnotation"); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static JSIDMNStyle getWrappedJSIDMNStyle(JSIDMNStyle toWrap) { + JSIDMNStyle toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(toWrap)); + JSIName jsiName = JSIDMNStyle.getJSIName(); + updateJSIName(jsiName, "dmndi", "DMNStyle"); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static JSITDecisionTable getWrappedJSITDecisionTable(JSITDecisionTable toWrap, String prefix, String localPart) { + JSITDecisionTable toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(toWrap)); + JSIName jsiName = JSITDecisionTable.getJSIName(); + updateJSIName(jsiName, prefix, localPart); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static JSITFunctionDefinition getWrappedJSITFunctionDefinition(JSITFunctionDefinition toWrap, String prefix, String localPart) { + JSITFunctionDefinition toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(toWrap)); + JSIName jsiName = JSITFunctionDefinition.getJSIName(); + updateJSIName(jsiName, prefix, localPart); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static JSITInvocation getWrappedJSITInvocation(JSITInvocation toWrap, String prefix, String localPart) { + JSITInvocation toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(toWrap)); + JSIName jsiName = JSITInvocation.getJSIName(); + updateJSIName(jsiName, prefix, localPart); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static JSITList getWrappedJSITList(JSITList toWrap, String prefix, String localPart) { + JSITList toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(toWrap)); + JSIName jsiName = JSITList.getJSIName(); + updateJSIName(jsiName, prefix, localPart); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static JSITRelation getWrappedJSITRelation(JSITRelation toWrap, String prefix, String localPart) { + JSITRelation toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(toWrap)); + JSIName jsiName = JSITRelation.getJSIName(); + updateJSIName(jsiName, prefix, localPart); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static JSITContext getWrappedJSITContext(JSITContext toWrap, String prefix, String localPart) { + JSITContext toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(toWrap)); + JSIName jsiName = JSITContext.getJSIName(); + updateJSIName(jsiName, prefix, localPart); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static JSITLiteralExpression getWrappedJSITLiteralExpression(JSITLiteralExpression toWrap, String prefix, String localPart) { + JSITLiteralExpression toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(toWrap)); + JSIName jsiName = JSITLiteralExpression.getJSIName(); + updateJSIName(jsiName, prefix, localPart); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static JSIDMNEdge getWrappedJSIDMNEdge(JSIDMNEdge toWrap) { + JSIDMNEdge toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(toWrap)); + JSIName jsiName = JSIDMNEdge.getJSIName(); + updateJSIName(jsiName, "dmndi", "DMNEdge"); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static JSIDMNShape getWrappedJSIDMNShape(final View v, + final String namespaceURI) { + JSIDMNShape unwrappedJSIDMNShape = stunnerToDDExt(v, namespaceURI); + JSIDMNShape toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(unwrappedJSIDMNShape)); + JSIName jsiName = JSIDMNShape.getJSIName(); + updateJSIName(jsiName, "dmndi", "DMNShape"); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static JSITComponentsWidthsExtension getWrappedJSITComponentsWidthsExtension(JSITComponentsWidthsExtension componentsWidthsExtension) { + JSITComponentsWidthsExtension toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(componentsWidthsExtension)); + JSIName jsiName = JSITComponentsWidthsExtension.getJSIName(); + updateJSIName(jsiName, "kie", "ComponentsWidthsExtension"); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static JSITDRGElement getWrappedJSITDRGElement(JSITDRGElement toWrap, String prefix, String localPart) { + JSITDRGElement toReturn = Js.uncheckedCast(JsUtils.getWrappedElement(toWrap)); + JSIName jsiName = JSITDRGElement.getJSIName(); + updateJSIName(jsiName, prefix, localPart); + JsUtils.setNameOnWrapped(toReturn, jsiName); + return toReturn; + } + + public static void updateJSIName(JSIName toUpdate, String prefix, String localPart) { + toUpdate.setPrefix(prefix); + toUpdate.setLocalPart(localPart); + String key = "{" + toUpdate.getNamespaceURI() + "}" + toUpdate.getLocalPart(); + toUpdate.setKey(key); + prefix = !StringUtils.isEmpty(toUpdate.getPrefix()) ? toUpdate.getPrefix() + ":" : ""; + String string = "{" + toUpdate.getNamespaceURI() + "}" + prefix + toUpdate.getLocalPart(); + toUpdate.setString(string); + } + + private static JSIDMNShape stunnerToDDExt(final View v, + final String namespaceURI) { + final JSIDMNShape result = new JSIDMNShape(); + result.setId("dmnshape-" + v.getDefinition().getId().getValue()); + result.setDmnElementRef(new QName(namespaceURI, + v.getDefinition().getId().getValue(), + XMLConstants.DEFAULT_NS_PREFIX)); + final JSIBounds bounds = new JSIBounds(); + result.setBounds(bounds); + bounds.setX(xOfBound(upperLeftBound(v))); + bounds.setY(yOfBound(upperLeftBound(v))); + result.setDMNLabel(new JSIDMNLabel()); + // TODO {gcardosi}: HARDCODED + result.setIsCollapsed(false); + final JSIDMNStyle style = new JSIDMNStyle(); + if (v.getDefinition() instanceof Decision) { + final Decision d = (Decision) v.getDefinition(); + applyBounds(d.getDimensionsSet(), bounds); + applyBackgroundStyles(d.getBackgroundSet(), style); + applyFontStyle(d.getFontSet(), style); + } else if (v.getDefinition() instanceof InputData) { + InputData d = (InputData) v.getDefinition(); + applyBounds(d.getDimensionsSet(), bounds); + applyBackgroundStyles(d.getBackgroundSet(), style); + applyFontStyle(d.getFontSet(), style); + } else if (v.getDefinition() instanceof BusinessKnowledgeModel) { + final BusinessKnowledgeModel d = (BusinessKnowledgeModel) v.getDefinition(); + applyBounds(d.getDimensionsSet(), bounds); + applyBackgroundStyles(d.getBackgroundSet(), style); + applyFontStyle(d.getFontSet(), style); + } else if (v.getDefinition() instanceof KnowledgeSource) { + final KnowledgeSource d = (KnowledgeSource) v.getDefinition(); + applyBounds(d.getDimensionsSet(), bounds); + applyBackgroundStyles(d.getBackgroundSet(), style); + applyFontStyle(d.getFontSet(), style); + } else if (v.getDefinition() instanceof TextAnnotation) { + final TextAnnotation d = (TextAnnotation) v.getDefinition(); + applyBounds(d.getDimensionsSet(), bounds); + applyBackgroundStyles(d.getBackgroundSet(), style); + applyFontStyle(d.getFontSet(), style); + } else if (v.getDefinition() instanceof DecisionService) { + final DecisionService d = (DecisionService) v.getDefinition(); + applyBounds(d.getDimensionsSet(), bounds); + applyBackgroundStyles(d.getBackgroundSet(), style); + applyFontStyle(d.getFontSet(), style); + final JSIDMNDecisionServiceDividerLine dl = new JSIDMNDecisionServiceDividerLine(); + final JSIPoint leftPoint = new JSIPoint(); + leftPoint.setX(v.getBounds().getUpperLeft().getX()); + final double dlY = v.getBounds().getUpperLeft().getY() + d.getDividerLineY().getValue(); + leftPoint.setY(dlY); + dl.addWaypoint(leftPoint); + final JSIPoint rightPoint = new JSIPoint(); + rightPoint.setX(v.getBounds().getLowerRight().getX()); + rightPoint.setY(dlY); + dl.addWaypoint(rightPoint); + result.setDMNDecisionServiceDividerLine(dl); + } + result.setStyle(getWrappedJSIDMNStyle(style)); + + return result; + } + + private static void applyFontStyle(final FontSet fontSet, + final JSIDMNStyle style) { + final JSIColor fontColor = ColorUtils.dmnFromWB(fontSet.getFontColour().getValue()); + style.setFontColor(fontColor); + if (Objects.nonNull(fontSet.getFontFamily().getValue())) { + style.setFontFamily(fontSet.getFontFamily().getValue()); + } + if (Objects.nonNull(fontSet.getFontSize().getValue())) { + style.setFontSize(fontSet.getFontSize().getValue()); + } + } + + private static void applyBounds(final RectangleDimensionsSet dimensionsSet, + final JSIBounds bounds) { + if (null != dimensionsSet.getWidth().getValue() && + null != dimensionsSet.getHeight().getValue()) { + bounds.setWidth(dimensionsSet.getWidth().getValue()); + bounds.setHeight(dimensionsSet.getHeight().getValue()); + } + } + + private static void applyBackgroundStyles(final BackgroundSet bgset, + final JSIDMNStyle style) { + if (Objects.nonNull(bgset.getBgColour().getValue())) { + style.setFillColor(ColorUtils.dmnFromWB(bgset.getBgColour().getValue())); + } + if (Objects.nonNull(bgset.getBorderColour().getValue())) { + style.setStrokeColor(ColorUtils.dmnFromWB(bgset.getBorderColour().getValue())); + } + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DC.xsd b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DC.xsd new file mode 100644 index 00000000000..634ba13a3ef --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DC.xsd @@ -0,0 +1,159 @@ + + + + + + + + + + + Color is a data type that represents a color value in the RGB format. + + + + + + + + + + + + + + + + A Point specifies an location in some x-y coordinate system. + + + + + + + + Dimension specifies two lengths (width and height) along the x and y axes in some x-y coordinate system. + + + + + + + + Bounds specifies a rectangular area in some x-y coordinate system that is defined by a location (x and y) and a size (width and height). + + + + + + + + + + AlignmentKind enumerates the possible options for alignment for layout purposes. + + + + + + + + + + + KnownColor is an enumeration of 17 known colors. + + + + + a color with a value of #800000 + + + + + a color with a value of #FF0000 + + + + + a color with a value of #FFA500 + + + + + a color with a value of #FFFF00 + + + + + a color with a value of #808000 + + + + + a color with a value of #800080 + + + + + a color with a value of #FF00FF + + + + + a color with a value of #FFFFFF + + + + + a color with a value of #00FF00 + + + + + a color with a value of #008000 + + + + + a color with a value of #000080 + + + + + a color with a value of #0000FF + + + + + a color with a value of #00FFFF + + + + + a color with a value of #008080 + + + + + a color with a value of #000000 + + + + + a color with a value of #C0C0C0 + + + + + a color with a value of #808080 + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DI.xsd b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DI.xsd new file mode 100644 index 00000000000..9022a67145e --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DI.xsd @@ -0,0 +1,115 @@ + + + + + + The Diagram Interchange (DI) package enables interchange of graphical information that language users have control over, such as position of nodes and line routing points. Language specifications specialize elements of DI to define diagram interchange elements for a language. + + + + + This element should never be instantiated directly, but rather concrete implementation should. It is placed there only to be referred in the sequence + + + + + + DiagramElement is the abstract super type of all elements in diagrams, including diagrams themselves. When contained in a diagram, diagram elements are laid out relative to the diagram's origin. + + + + + + + + + + + + an optional locally-owned style for this diagram element. + + + + + + a reference to an optional shared style element for this diagram element. + + + + + + + + + + + + the name of the diagram. + + + + + the documentation of the diagram. + + + + + the resolution of the diagram expressed in user units per inch. + + + + + + + + + + + + + the optional bounds of the shape relative to the origin of its nesting plane. + + + + + + + + + + + + + + an optional list of points relative to the origin of the nesting diagram that specifies the connected line segments of the edge + + + + + + + + + + Style contains formatting properties that affect the appearance or style of diagram elements, including diagram themselves. + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DMN12.xsd b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DMN12.xsd new file mode 100644 index 00000000000..47ade4cedde --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DMN12.xsd @@ -0,0 +1,504 @@ + + + + + + + Include the DMN Diagram Interchange (DI) schema + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DMNDI12.xsd b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DMNDI12.xsd new file mode 100644 index 00000000000..c3776064d82 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DMNDI12.xsd @@ -0,0 +1,106 @@ + + + + + + + + + + + This element should never be instantiated directly, but rather concrete implementation should. It is placed there only to be referred in the sequence + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/KIE.xsd b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/KIE.xsd new file mode 100644 index 00000000000..5ec0adefe40 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/KIE.xsd @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/META-INF/ErraiApp.properties b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/META-INF/ErraiApp.properties new file mode 100644 index 00000000000..c9f20acfa4a --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/META-INF/ErraiApp.properties @@ -0,0 +1,31 @@ +# +# Copyright 2019 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# + +# ErraiApp.properties +# +# Do not remove, even if empty! +# + +# This is a marker file. When it is detected inside a JAR or at the +# top of any classpath, the subdirectories are scanned for deployable +# components. As such, all Errai application modules in a project +# should contain an ErraiApp.properties at the root of all classpaths +# that you wish to be scanned. +# +# There are also some configuration options that can be set in this +# file, although it is rarely necessary. See the documentation at +# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties +# for details. diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/META-INF/beans.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/META-INF/beans.xml new file mode 100644 index 00000000000..dedc0d79328 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/META-INF/beans.xml @@ -0,0 +1,20 @@ + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/bindings.xjb b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/bindings.xjb new file mode 100644 index 00000000000..c2f34067f64 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/bindings.xjb @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/marshaller/DMNMarshaller.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/marshaller/DMNMarshaller.gwt.xml new file mode 100644 index 00000000000..acf72615565 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/marshaller/DMNMarshaller.gwt.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/MainJs.js b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/MainJs.js new file mode 100644 index 00000000000..cdd318f8493 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/MainJs.js @@ -0,0 +1,111 @@ +/** + * == READ ME == + * + * This file has been manually modified to include *ALL* mappings (and not just DMN12) + * + * @type {{marshall: MainJs.marshall, unmarshall: MainJs.unmarshall}} + */ +MainJs = { + + mappings: [DC, DI, DMNDI12, DMN12, KIE], + + initializeJsInteropConstructors: function (constructorsMap) { + + var extraTypes = [{typeName: 'Name', namespace: null}]; + + function createFunction(typeName) { + return new Function('return { "TYPE_NAME" : "' + typeName + '" }'); + } + + function createNoTypedFunction() { + return new Function('return { }'); + } + + function createConstructor(value) { + console.log("Create createConstructor " + value) + const parsedJson = JSON.parse(value) + const name = parsedJson["name"] + const nameSpace = parsedJson["nameSpace"] + const typeName = parsedJson["typeName"] + console.log("parsedJson " + parsedJson) + console.log("name " + name) + console.log("nameSpace " + nameSpace) + console.log("typeName " + typeName) + if (nameSpace != null) { + if (typeName != null) { + window[nameSpace][name] = createFunction(typeName); + } else { + window[nameSpace][name] = createNoTypedFunction(); + } + } else { + if (typeName != null) { + window[name] = createFunction(typeName); + } else { + window[name] = createNoTypedFunction(); + } + } + } + + function hasNameSpace(value) { + return JSON.parse(value)["nameSpace"] != null + } + + function hasNotNameSpace(value) { + return JSON.parse(value)["nameSpace"] == null + } + + function iterateValueEntry(values) { + console.log("iterateValueEntry " + values); + const baseTypes = values.filter(hasNotNameSpace) + const innerTypes = values.filter(hasNameSpace) + baseTypes.forEach(createConstructor) + innerTypes.forEach(createConstructor) + } + + function iterateKeyValueEntry(key, values) { + console.log("iterateKeyValueEntry " + key + " " + values); + iterateValueEntry(values) + } + + console.log('Generating JsInterop constructors.'); + + for (const property in constructorsMap) { + if (constructorsMap.hasOwnProperty(property)) { + iterateKeyValueEntry(property, constructorsMap[property]) + } + } + }, + + unmarshall: function (text, dynamicNamespace, callback) { + // Create Jsonix context + var context = new Jsonix.Context(this.mappings); + + // Create unmarshaller + var unmarshaller = context.createUnmarshaller(); + var toReturn = unmarshaller.unmarshalString(text); + callback(toReturn); + }, + + marshall: function (value, defaultNamespace, callback) { + // Create Jsonix context + var namespaces = {}; + namespaces[defaultNamespace] = ""; + namespaces["http://www.omg.org/spec/DMN/20180521/MODEL/"] = "dmn"; + namespaces["http://www.omg.org/spec/DMN/20180521/DI/"] = "di"; + namespaces["http://www.drools.org/kie/dmn/1.2"] = "kie"; + namespaces["http://www.omg.org/spec/DMN/20180521/DMNDI/"] = "dmndi"; + namespaces["http://www.omg.org/spec/DMN/20180521/DC/"] = "dc"; + namespaces["http://www.omg.org/spec/DMN/20180521/FEEL/"] = "feel"; + var context = new Jsonix.Context(this.mappings, { + namespacePrefixes: namespaces + }); + + // Create unmarshaller + var marshaller = context.createMarshaller(); + + var xmlDocument = marshaller.marshalDocument(value); + var s = new XMLSerializer(); + var toReturn = s.serializeToString(xmlDocument); + callback(toReturn); + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-bkm-complex.dmn b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-bkm-complex.dmn new file mode 100644 index 00000000000..95dfcdb378e --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-bkm-complex.dmn @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + 150.0 + + + 50.0 + 150.0 + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-bkm-simple.dmn b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-bkm-simple.dmn new file mode 100644 index 00000000000..4909410dca4 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-bkm-simple.dmn @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + 150.0 + + + 50.0 + 150.0 + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-complex.dmn b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-complex.dmn new file mode 100644 index 00000000000..12561637d5c --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-complex.dmn @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TextAnnotation-1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-context.dmn b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-context.dmn new file mode 100644 index 00000000000..bf80295ec85 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-context.dmn @@ -0,0 +1,58 @@ + + + + + + + + + + + 1 + + + + + + 2 + + + + + 3 + + + + + + + + + + 50.0 + 100.0 + 150.0 + + + 150.0 + + + 150.0 + + + 150.0 + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-decision-table.dmn b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-decision-table.dmn new file mode 100644 index 00000000000..5def6e9ac09 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-decision-table.dmn @@ -0,0 +1,77 @@ + + + + + + + + + + input-1 + + + + + input-2 + + + + + + 5 + + 1 + + + 2 + + + 3 + + + 4 + + + + 10 + + 6 + + + 7 + + + 8 + + + 9 + + + + + + + + + + 50.0 + 100.0 + 100.0 + 100.0 + 100.0 + 100.0 + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-function-definition.dmn b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-function-definition.dmn new file mode 100644 index 00000000000..c5f0d830254 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-function-definition.dmn @@ -0,0 +1,39 @@ + + + + + + + + + + + 123 + + + + + + + + + 50.0 + 150.0 + + + 150.0 + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-invocation.dmn b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-invocation.dmn new file mode 100644 index 00000000000..6045973bdd6 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-invocation.dmn @@ -0,0 +1,54 @@ + + + + + + + + + sum( p-1, p-2 ) + + + + + 1 + + + + + + 2 + + + + + + + + + + 50.0 + 100.0 + 150.0 + + + + 150.0 + + + 150.0 + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-literal-expression.dmn b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-literal-expression.dmn new file mode 100644 index 00000000000..bd8e2c8874c --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-literal-expression.dmn @@ -0,0 +1,31 @@ + + + + + + + + 123 + + + + + + + + 130.0 + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-relation.dmn b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-relation.dmn new file mode 100644 index 00000000000..ea6291c6454 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-decision-relation.dmn @@ -0,0 +1,54 @@ + + + + + + + + + + + + 1 + + + 2 + + + + + 3 + + + 4 + + + + + + + + + + 50.0 + 100.0 + 100.0 + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-empty.dmn b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-empty.dmn new file mode 100644 index 00000000000..f7a25aecc83 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-empty.dmn @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-input-data.dmn b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-input-data.dmn new file mode 100644 index 00000000000..10b8ca70c9c --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-input-data.dmn @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-knowledge-source.dmn b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-knowledge-source.dmn new file mode 100644 index 00000000000..0ef8796f740 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/test/resources/diagram-knowledge-source.dmn @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/.gitignore b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/.gitignore new file mode 100644 index 00000000000..a4eba87eabf --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/.gitignore @@ -0,0 +1,31 @@ +/target +/local + +/src/main/gwt-unitCache/ +/src/main/webapp/WEB-INF/classes/ +/src/main/webapp/WEB-INF/deploy/ +/src/main/webapp/WEB-INF/lib/ +/src/main/webapp/org.kie.workbench.common.dmn.showcase.DMNKogitoRuntimeWebapp/ + +# Copied during build from kie-wb-common-dmn-webapp-kogito-marshaller +/src/main/webapp/model/DC.js +/src/main/webapp/model/DI.js +/src/main/webapp/model/DMN12.js +/src/main/webapp/model/DMNDI12.js +/src/main/webapp/model/KIE.js +/src/main/webapp/model/Jsonix-all.js +/src/main/webapp/model/MainJs.js + +# Eclipse, Netbeans and IntelliJ files +/.* +/**/.* +!.gitignore +/nbproject +*.ipr +*.iws +*.iml +**/gwt-unitCache/ + +# Repository wide ignore mac DS_Store files +.DS_Store + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/pom.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/pom.xml new file mode 100644 index 00000000000..a9d967b3bcd --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/pom.xml @@ -0,0 +1,783 @@ + + + + + org.kie.workbench + kie-wb-common-dmn + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-dmn-webapp-kogito-runtime + Kie Workbench - Common - DMN - Kogito runtime webapp + Kie Workbench - Common - DMN - Kogito runtime webapp + war + + + ${project.build.directory}/wildfly-${version.org.jboss.errai.wildfly} + 4 + 2.4.0.Final + + + + + + + org.slf4j + slf4j-api + + + + org.slf4j + slf4j-ext + + + + + ch.qos.logback + logback-classic + + + + org.slf4j + log4j-over-slf4j + + + + + + + com.google.inject + guice + + + org.jboss.errai + errai-ioc + + + org.jboss.errai + errai-ui + provided + + + org.jboss.errai + errai-cdi-server + + + org.jboss.errai + errai-cdi-client + provided + + + org.jboss.errai + errai-cdi-shared + + + org.jboss.errai + errai-cdi-jboss + + + xml-apis + xml-apis + + + provided + + + org.jboss.errai + errai-jboss-as-support + + + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-client-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-processors + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-backend + + + org.kie.workbench.stunner + kie-wb-common-stunner-client-common + + + org.powermock + powermock-api-mockito + + + org.powermock + powermock-module-junit4 + + + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-svg-gen + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-widgets + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-forms-client + provided + + + + + + org.uberfire + uberfire-preferences-api + + + + org.uberfire + uberfire-preferences-backend + + + + org.uberfire + uberfire-preferences-client + + + + + org.kie.workbench + kie-wb-common-dmn-api + + + org.kie.workbench + kie-wb-common-dmn-client + provided + + + org.uberfire + uberfire-servlet-security + + + + + org.kie.workbench + kie-wb-common-dmn-webapp-common + provided + + + org.kie.workbench + kie-wb-common-dmn-webapp-kogito-common + + + org.kie.workbench + kie-wb-common-dmn-backend + + + + + org.kie.workbench + kie-wb-common-dmn-webapp-kogito-marshaller + provided + + + org.uberfire + uberfire-wires-core-grids + provided + + + + + + org.kie.workbench.forms + kie-wb-common-forms-fields + + + org.kie.workbench.forms + kie-wb-common-forms-processing-engine + provided + + + org.kie.workbench.forms + kie-wb-common-forms-adf-engine-api + + + org.kie.workbench.forms + kie-wb-common-forms-adf-engine-backend + + + org.kie.workbench.forms + kie-wb-common-forms-adf-engine-client + provided + + + org.kie.workbench.forms + kie-wb-common-dynamic-forms-client + + + org.kie.workbench.forms + kie-wb-common-forms-backend-services + + + + + org.hibernate + hibernate-validator + sources + + + + + org.uberfire + uberfire-api + + + org.uberfire + uberfire-backend-cdi + + + org.uberfire + uberfire-client-api + + + org.uberfire + uberfire-workbench-client + provided + + + org.uberfire + uberfire-simple-docks-client + provided + + + org.uberfire + uberfire-workbench-processors + provided + + + org.uberfire + uberfire-workbench-client-views-patternfly + provided + + + + + com.google.elemental2 + elemental2-promise + + + + + org.uberfire + uberfire-widgets-core-client + provided + + + + + org.uberfire + uberfire-nio2-model + + + org.uberfire + uberfire-nio2-fs + + + org.uberfire + uberfire-nio2-jgit + + + + + + org.uberfire + uberfire-ssh-backend + + + + + + org.uberfire + uberfire-experimental-api + + + org.uberfire + uberfire-experimental-backend + + + org.uberfire + uberfire-experimental-client + provided + + + + + org.kie.workbench.widgets + kie-wb-common-ui + + + org.uberfire + uberfire-servlet-security + + + + + + + org.uberfire + uberfire-structure-api + + + org.uberfire + uberfire-structure-backend + + + org.uberfire + uberfire-servlet-security + + + + + + + com.google.gwt + gwt-user + provided + + + javax.servlet + javax.servlet-api + + + + + + + org.kie.workbench + kie-wb-common-kogito-client + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client + provided + + + + org.kie.soup + kie-soup-project-datamodel-api + + + + + + ${project.artifactId} + src/main/webapp/WEB-INF/classes + + + + + org.codehaus.mojo + gwt-maven-plugin + + true + ${gwt.compiler.localWorkers} + ${project.build.directory}/gwt-symbols-deploy + true + -Xmx4096m -Xms1024m -Xss1M -XX:CompileThreshold=7000 -Derrai.dynamic_validation.enabled=true -Derrai.jboss.home=${errai.jboss.home} + org.kie.workbench.common.dmn.showcase.FastCompiledDMNKogitoRuntimeWebapp + INFO + false + org.jboss.errai.cdi.server.gwt.EmbeddedWildFlyLauncher + true + index.html + src/main/webapp + false + INFO + + + + org.kie.soup:kie-soup-commons + + + org.uberfire:uberfire-commons + org.uberfire:uberfire-nio2-model + org.uberfire:uberfire-io + org.uberfire:uberfire-api + org.uberfire:uberfire-js + org.uberfire:uberfire-security-api + org.uberfire:uberfire-security-client + org.uberfire:uberfire-client-api + org.uberfire:uberfire-workbench-client + org.uberfire:uberfire-workbench-client-views-patternfly + org.uberfire:uberfire-simple-docks-client + org.uberfire:uberfire-backend-api + org.uberfire:uberfire-project-api + org.uberfire:uberfire-project-client + org.uberfire:uberfire-services-api + org.uberfire:uberfire-structure-api + org.uberfire:uberfire-workingset-api + org.uberfire:uberfire-message-console-api + org.uberfire:uberfire-message-console-client + + + org.jboss.errai:errai-data-binding + org.kie.workbench.widgets:kie-wb-common-ui + org.kie.workbench.profile:kie-wb-common-profile-api + org.kie.workbench.services:kie-wb-common-datamodel-api + org.kie.workbench.services:kie-wb-common-services-api + org.kie.workbench:kie-wb-common-kogito-client + + + org.uberfire:uberfire-runtime-plugins-api + org.uberfire:uberfire-commons-editor-api + org.uberfire:uberfire-commons-editor-client + org.uberfire:uberfire-widgets-commons + org.uberfire:uberfire-widgets-table + org.uberfire:uberfire-widgets-properties-editor-api + org.uberfire:uberfire-widgets-properties-editor-client + org.uberfire:uberfire-widgets-service-api + org.uberfire:uberfire-widgets-core-client + + + org.uberfire:uberfire-preferences-api + org.uberfire:uberfire-preferences-client + org.uberfire:uberfire-preferences-ui-client + + + org.uberfire:uberfire-experimental-api + org.uberfire:uberfire-experimental-client + + + org.kie.workbench.forms:kie-wb-common-forms-api + org.kie.workbench.forms:kie-wb-common-forms-adf-base + org.kie.workbench.forms:kie-wb-common-forms-adf-engine-api + org.kie.workbench.forms:kie-wb-common-forms-adf-engine-client + org.kie.workbench.forms:kie-wb-common-forms-fields + org.kie.workbench.forms:kie-wb-common-forms-processing-engine + org.kie.workbench.forms:kie-wb-common-forms-common-rendering-shared + org.kie.workbench.forms:kie-wb-common-forms-common-rendering-client + org.kie.workbench.forms:kie-wb-common-forms-crud-component + org.kie.workbench.forms:kie-wb-common-dynamic-forms-api + org.kie.workbench.forms:kie-wb-common-dynamic-forms-client + + + org.kie.workbench.stunner:kie-wb-common-stunner-core-api + org.kie.workbench.stunner:kie-wb-common-stunner-backend-api + org.kie.workbench.stunner:kie-wb-common-stunner-client-api + org.kie.workbench.stunner:kie-wb-common-stunner-core-common + org.kie.workbench.stunner:kie-wb-common-stunner-client-common + org.kie.workbench.stunner:kie-wb-common-stunner-lienzo + org.kie.workbench.stunner:kie-wb-common-stunner-shapes-api + org.kie.workbench.stunner:kie-wb-common-stunner-shapes-client + org.kie.workbench.stunner:kie-wb-common-stunner-lienzo-extensions + org.kie.workbench.stunner:kie-wb-common-stunner-svg-client + org.kie.workbench.stunner:kie-wb-common-stunner-widgets + org.kie.workbench.stunner:kie-wb-common-stunner-forms-api + org.kie.workbench.stunner:kie-wb-common-stunner-forms-client + org.kie.workbench.stunner:kie-wb-common-stunner-kogito-api + org.kie.workbench.stunner:kie-wb-common-stunner-kogito-client + + + org.kie.workbench:kie-wb-common-dmn-api + org.kie.workbench:kie-wb-common-dmn-client + org.kie.workbench:kie-wb-common-dmn-webapp-common + org.kie.workbench:kie-wb-common-dmn-webapp-kogito-common + org.kie.workbench:kie-wb-common-dmn-webapp-kogito-marshaller + org.uberfire:uberfire-wires-core-grids + + org.uberfire:appformer-js-bridge + + + + + + gwt-clean + clean + + clean + + + + gwt-compile + + resources + compile + + + + + + + maven-war-plugin + + **/javax/**/*.*,**/client/**/*.class,**/*.symbolMap + + false + + + + + + maven-clean-plugin + + + + ${basedir} + + www-test/** + src/main/webapp/org.kie.workbench.common.dmn.showcase.DMNKogitoRuntimeWebapp/ + src/main/webapp/WEB-INF/classes/ + src/main/webapp/WEB-INF/deploy/ + src/main/webapp/WEB-INF/lib/ + **/gwt-unitCache/** + .gwt/** + .errai/ + .security/ + .niogit/** + .index/** + **/*.JUnit/** + repositories/ + + + + ${basedir}/src/main/webapp/model/ + + **.js + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + process-resources + + unpack + + + + + org.jboss.errai + wildfly-dist + ${version.org.jboss.errai.wildfly} + zip + false + ${project.build.directory} + + + + + + Unpack DMNMarshaller JS from dependency + process-sources + + unpack + + + + + org.kie.workbench + kie-wb-common-dmn-webapp-kogito-marshaller + ${version.org.kie} + jar + true + ${project.build.directory}/DMNMarshaller + **/*.js + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + Copy DMNMarshaller JS to WAR + process-resources + + run + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/**/*, + org/kie/workbench/common/dmn/webapp/kogito/marshaller/jre/package-info.java, + org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/JSIName.java, + org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/JsUtils.java + + + + + + + + + + + + thorntail + + + thorntail + + + + + + + io.thorntail + bom-all + ${version.thorntail} + import + pom + + + + + + + + + + + io.thorntail + cdi + + + + io.thorntail + undertow + + + + io.thorntail + messaging + + + + + + + io.thorntail + thorntail-maven-plugin + ${version.thorntail} + + + package + + package + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + none + + + + + + + + + + fullProfile + + + full + + + + -Xmx3g -Xms1g -Xss1M + 4 + + + + + + org.codehaus.mojo + gwt-maven-plugin + + org.kie.workbench.common.dmn.showcase.DMNShowcase + false + + + + + + + + + + no-showcase + + + + org.codehaus.mojo + gwt-maven-plugin + + true + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNDiagramEditor.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNDiagramEditor.java new file mode 100644 index 00000000000..9d5a8973cb3 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNDiagramEditor.java @@ -0,0 +1,157 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.editor; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.event.Event; +import javax.enterprise.event.Observes; +import javax.inject.Inject; + +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorDock; +import org.kie.workbench.common.dmn.client.editors.included.IncludedModelsPage; +import org.kie.workbench.common.dmn.client.editors.included.imports.IncludedModelsPageStateProviderImpl; +import org.kie.workbench.common.dmn.client.editors.search.DMNEditorSearchIndex; +import org.kie.workbench.common.dmn.client.editors.search.DMNSearchableElement; +import org.kie.workbench.common.dmn.client.editors.types.DataTypePageTabActiveEvent; +import org.kie.workbench.common.dmn.client.editors.types.DataTypesPage; +import org.kie.workbench.common.dmn.client.editors.types.listview.common.DataTypeEditModeToggleEvent; +import org.kie.workbench.common.dmn.client.events.EditExpressionEvent; +import org.kie.workbench.common.dmn.webapp.common.client.docks.preview.PreviewDiagramDock; +import org.kie.workbench.common.dmn.webapp.kogito.common.client.editor.BaseDMNDiagramEditor; +import org.kie.workbench.common.dmn.webapp.kogito.common.client.editor.DMNEditorMenuSessionItems; +import org.kie.workbench.common.kogito.client.editor.MultiPageEditorContainerView; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; +import org.kie.workbench.common.stunner.core.client.annotation.DiagramEditor; +import org.kie.workbench.common.stunner.core.client.api.SessionManager; +import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; +import org.kie.workbench.common.stunner.core.client.command.SessionCommandManager; +import org.kie.workbench.common.stunner.core.client.components.layout.LayoutHelper; +import org.kie.workbench.common.stunner.core.client.components.layout.OpenDiagramLayoutExecutor; +import org.kie.workbench.common.stunner.core.client.error.DiagramClientErrorHandler; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.core.client.session.Session; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.documentation.DocumentationView; +import org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent; +import org.kie.workbench.common.stunner.kogito.client.docks.DiagramEditorPropertiesDock; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientDiagramService; +import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; +import org.kie.workbench.common.widgets.client.search.component.SearchBarComponent; +import org.uberfire.client.annotations.WorkbenchClientEditor; +import org.uberfire.client.mvp.PlaceManager; +import org.uberfire.client.views.pfly.multipage.MultiPageEditorSelectedPageEvent; +import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; +import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; +import org.uberfire.workbench.events.NotificationEvent; + +@ApplicationScoped +@DiagramEditor +@WorkbenchClientEditor(identifier = BaseDMNDiagramEditor.EDITOR_ID) +public class DMNDiagramEditor extends BaseDMNDiagramEditor { + + @Inject + public DMNDiagramEditor(final View view, + final FileMenuBuilder fileMenuBuilder, + final PlaceManager placeManager, + final MultiPageEditorContainerView multiPageEditorContainerView, + final Event changeTitleNotificationEvent, + final Event notificationEvent, + final Event onDiagramFocusEvent, + final TextEditorView xmlEditorView, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final DMNEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService, + final @DMNEditor DocumentationView documentationView, + final DMNEditorSearchIndex editorSearchIndex, + final SearchBarComponent searchBarComponent, + final SessionManager sessionManager, + final @Session SessionCommandManager sessionCommandManager, + final Event refreshFormPropertiesEvent, + final DecisionNavigatorDock decisionNavigatorDock, + final DiagramEditorPropertiesDock diagramPropertiesDock, + final PreviewDiagramDock diagramPreviewAndExplorerDock, + final LayoutHelper layoutHelper, + final OpenDiagramLayoutExecutor openDiagramLayoutExecutor, + final DataTypesPage dataTypesPage, + final IncludedModelsPage includedModelsPage, + final IncludedModelsPageStateProviderImpl importsPageProvider, + final KogitoClientDiagramService diagramServices) { + super(view, + fileMenuBuilder, + placeManager, + multiPageEditorContainerView, + changeTitleNotificationEvent, + notificationEvent, + onDiagramFocusEvent, + xmlEditorView, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService, + documentationView, + editorSearchIndex, + searchBarComponent, + sessionManager, + sessionCommandManager, + refreshFormPropertiesEvent, + decisionNavigatorDock, + diagramPropertiesDock, + diagramPreviewAndExplorerDock, + layoutHelper, + openDiagramLayoutExecutor, + dataTypesPage, + includedModelsPage, + importsPageProvider, + diagramServices); + } + + @Override + public void onDataTypePageNavTabActiveEvent(final @Observes DataTypePageTabActiveEvent event) { + super.onDataTypePageNavTabActiveEvent(event); + } + + @Override + public void onDataTypeEditModeToggle(final @Observes DataTypeEditModeToggleEvent event) { + super.onDataTypeEditModeToggle(event); + } + + @Override + public void onEditExpressionEvent(final @Observes EditExpressionEvent event) { + super.onEditExpressionEvent(event); + } + + @Override + public void onMultiPageEditorSelectedPageEvent(final @Observes MultiPageEditorSelectedPageEvent event) { + super.onMultiPageEditorSelectedPageEvent(event); + } + + @Override + public void onRefreshFormPropertiesEvent(final @Observes RefreshFormPropertiesEvent event) { + super.onRefreshFormPropertiesEvent(event); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/java/org/kie/workbench/common/dmn/showcase/client/perspectives/AuthoringPerspective.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/java/org/kie/workbench/common/dmn/showcase/client/perspectives/AuthoringPerspective.java new file mode 100644 index 00000000000..f74e57c2847 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/java/org/kie/workbench/common/dmn/showcase/client/perspectives/AuthoringPerspective.java @@ -0,0 +1,40 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.perspectives; + +import javax.enterprise.context.ApplicationScoped; + +import org.kie.workbench.common.dmn.webapp.kogito.common.client.editor.BaseDMNDiagramEditor; +import org.uberfire.client.annotations.Perspective; +import org.uberfire.client.annotations.WorkbenchPerspective; +import org.uberfire.client.workbench.panels.impl.SimpleNoExpandWorkbenchPanelPresenter; +import org.uberfire.mvp.impl.DefaultPlaceRequest; +import org.uberfire.workbench.model.PerspectiveDefinition; +import org.uberfire.workbench.model.impl.PartDefinitionImpl; +import org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl; + +@ApplicationScoped +@WorkbenchPerspective(identifier = BaseDMNDiagramEditor.PERSPECTIVE_ID, isDefault = true) +public class AuthoringPerspective { + + @Perspective + public PerspectiveDefinition buildPerspective() { + final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(SimpleNoExpandWorkbenchPanelPresenter.class.getName()); + perspective.setName("Authoring"); + perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest(BaseDMNDiagramEditor.EDITOR_ID))); + return perspective; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/resources/META-INF/ErraiApp.properties b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/resources/META-INF/ErraiApp.properties new file mode 100644 index 00000000000..a5c05ef86cf --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/resources/META-INF/ErraiApp.properties @@ -0,0 +1,34 @@ +# +# Copyright 2019 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +# +# ErraiApp.properties +# +# Do not remove, even if empty! +# +# This is a marker file. When it is detected inside a JAR or at the +# top of any classpath, the subdirectories are scanned for deployable +# components. As such, all Errai application modules in a project +# should contain an ErraiApp.properties at the root of all classpaths +# that you wish to be scanned. +# +# There are also some configuration options that can be set in this +# file, although it is rarely necessary. See the documentation at +# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties +# for details. +errai.ioc.enabled.alternatives=org.uberfire.client.workbench.VFSServiceProxyClientImpl \ + org.uberfire.client.workbench.VFSLockServiceProxyClientImpl \ + org.uberfire.client.workbench.WorkbenchServicesProxyClientImpl \ + org.uberfire.client.plugin.RuntimePluginsServiceProxyClientImpl diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/resources/org/kie/workbench/common/dmn/showcase/DMNKogitoRuntimeWebapp.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/resources/org/kie/workbench/common/dmn/showcase/DMNKogitoRuntimeWebapp.gwt.xml new file mode 100644 index 00000000000..2c1cf29cff8 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/resources/org/kie/workbench/common/dmn/showcase/DMNKogitoRuntimeWebapp.gwt.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/resources/org/kie/workbench/common/dmn/showcase/FastCompiledDMNKogitoRuntimeWebapp.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/resources/org/kie/workbench/common/dmn/showcase/FastCompiledDMNKogitoRuntimeWebapp.gwt.xml new file mode 100644 index 00000000000..f73ab8a3760 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/resources/org/kie/workbench/common/dmn/showcase/FastCompiledDMNKogitoRuntimeWebapp.gwt.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/resources/org/uberfire/UberfireWorkbenchBackend.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/resources/org/uberfire/UberfireWorkbenchBackend.gwt.xml new file mode 100644 index 00000000000..b7e1a90cd73 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/resources/org/uberfire/UberfireWorkbenchBackend.gwt.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/WEB-INF/beans.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 00000000000..5f26b19e75b --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/WEB-INF/jboss-deployment-structure.xml new file mode 100644 index 00000000000..4c375602fb3 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/WEB-INF/jboss-deployment-structure.xml @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/WEB-INF/web.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000000..c4a3949640c --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,43 @@ + + + + + + + ErraiServlet + org.jboss.errai.bus.server.servlet.DefaultBlockingServlet + + + service-locator + org.jboss.errai.cdi.server.CDIServiceLocator + + 1 + + + + ErraiServlet + *.erraiBus + + + + index.html + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/afjs-manifest.json b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/afjs-manifest.json new file mode 100644 index 00000000000..769c59c02bf --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/afjs-manifest.json @@ -0,0 +1,9 @@ +{ + "name": "demo", + "editors": [ + { + "regex": "*.dmn", + "editor": "DMNDiagramEditor" + } + ] +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/favicon.ico b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/favicon.ico similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/favicon.ico rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/favicon.ico diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/index.html b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/index.html new file mode 100644 index 00000000000..d3afd8eae3e --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/index.html @@ -0,0 +1,49 @@ + + + + + + + + DMN Editor Showcase + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/model/readme.md b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/model/readme.md new file mode 100644 index 00000000000..7407e63c1b2 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/src/main/webapp/model/readme.md @@ -0,0 +1 @@ +The content of this folder is created by `kie-wb-common-dmn-webapp-kogito-marshaller` and copied here by Maven. diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/.gitignore b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/.gitignore new file mode 100644 index 00000000000..9daa7e834e3 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/.gitignore @@ -0,0 +1,31 @@ +/target +/local + +/src/main/gwt-unitCache/ +/src/main/webapp/WEB-INF/classes/ +/src/main/webapp/WEB-INF/deploy/ +/src/main/webapp/WEB-INF/lib/ +/src/main/webapp/org.kie.workbench.common.dmn.showcase.DMNKogitoTestingWebapp/ + +# Copied during build from kie-wb-common-dmn-webapp-kogito-marshaller +/src/main/webapp/model/DC.js +/src/main/webapp/model/DI.js +/src/main/webapp/model/DMN12.js +/src/main/webapp/model/DMNDI12.js +/src/main/webapp/model/KIE.js +/src/main/webapp/model/Jsonix-all.js +/src/main/webapp/model/MainJs.js + +# Eclipse, Netbeans and IntelliJ files +/.* +/**/.* +!.gitignore +/nbproject +*.ipr +*.iws +*.iml +**/gwt-unitCache/ + +# Repository wide ignore mac DS_Store files +.DS_Store + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/pom.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/pom.xml new file mode 100644 index 00000000000..65ba5cd25f7 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/pom.xml @@ -0,0 +1,833 @@ + + + + + org.kie.workbench + kie-wb-common-dmn + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-dmn-webapp-kogito-testing + Kie Workbench - Common - DMN - Kogito testing webapp + Kie Workbench - Common - DMN - Kogito testing webapp + war + + + ${project.build.directory}/wildfly-${version.org.jboss.errai.wildfly} + 4 + 2.4.0.Final + Marshaller + ${project.parent.basedir}/ + + + + + + + org.slf4j + slf4j-api + + + + org.slf4j + slf4j-ext + + + + + ch.qos.logback + logback-classic + + + + org.slf4j + log4j-over-slf4j + + + + + + + com.google.inject + guice + + + org.jboss.errai + errai-ioc + + + org.jboss.errai + errai-common + + + org.jboss.errai + errai-bus + + + org.jboss.errai + errai-ui + provided + + + org.jboss.errai + errai-data-binding + provided + + + org.jboss.errai + errai-marshalling + + + org.jboss.errai + errai-security-server + + + org.jboss.errai + errai-cdi-server + + + org.jboss.errai + errai-cdi-client + provided + + + org.jboss.errai + errai-cdi-shared + + + org.jboss.errai + errai-cdi-jboss + + + xml-apis + xml-apis + + + provided + + + org.jboss.errai + errai-jboss-as-support + + + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-client-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-processors + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-backend + + + org.kie.workbench.stunner + kie-wb-common-stunner-client-common + + + org.powermock + powermock-api-mockito + + + org.powermock + powermock-module-junit4 + + + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-svg-gen + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-widgets + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-forms-client + provided + + + + + + org.uberfire + uberfire-preferences-api + + + + org.uberfire + uberfire-preferences-backend + + + + org.uberfire + uberfire-preferences-client + + + + + org.kie + kie-dmn-backend + + + org.kie.workbench + kie-wb-common-dmn-api + + + org.kie.workbench + kie-wb-common-dmn-backend + + + org.kie.workbench.services + kie-wb-common-datamodel-backend + + + + + org.kie.workbench + kie-wb-common-dmn-client + provided + + + org.uberfire + uberfire-servlet-security + + + + + org.kie.workbench + kie-wb-common-dmn-webapp-common + provided + + + org.kie.workbench + kie-wb-common-dmn-webapp-kogito-common + + + org.kie.workbench + kie-wb-common-dmn-webapp-kogito-marshaller + provided + + + org.uberfire + uberfire-wires-core-grids + provided + + + + + + + org.kie.workbench.forms + kie-wb-common-forms-fields + + + org.kie.workbench.forms + kie-wb-common-forms-processing-engine + provided + + + org.kie.workbench.forms + kie-wb-common-forms-adf-engine-api + + + org.kie.workbench.forms + kie-wb-common-forms-adf-engine-backend + + + org.kie.workbench.forms + kie-wb-common-forms-adf-engine-client + provided + + + org.kie.workbench.forms + kie-wb-common-dynamic-forms-client + + + org.kie.workbench.forms + kie-wb-common-forms-backend-services + + + + + org.hibernate + hibernate-validator + sources + + + + + + org.uberfire + uberfire-api + + + org.uberfire + uberfire-backend-cdi + + + org.uberfire + uberfire-client-api + + + org.uberfire + uberfire-workbench-client + provided + + + org.uberfire + uberfire-simple-docks-client + provided + + + org.uberfire + uberfire-workbench-processors + provided + + + org.uberfire + uberfire-workbench-client-views-patternfly + provided + + + + + com.google.elemental2 + elemental2-promise + + + + + org.uberfire + uberfire-widgets-core-client + provided + + + + + org.uberfire + uberfire-nio2-model + + + org.uberfire + uberfire-nio2-fs + + + org.uberfire + uberfire-nio2-jgit + + + + + + org.uberfire + uberfire-ssh-backend + + + + + + org.uberfire + uberfire-experimental-api + + + org.uberfire + uberfire-experimental-backend + + + org.uberfire + uberfire-experimental-client + provided + + + + + org.kie.workbench.widgets + kie-wb-common-ui + + + org.uberfire + uberfire-servlet-security + + + + + + + org.uberfire + uberfire-structure-api + + + org.uberfire + uberfire-structure-backend + + + org.uberfire + uberfire-servlet-security + + + + + + + com.google.gwt + gwt-user + provided + + + javax.servlet + javax.servlet-api + + + + + + + org.kie.workbench + kie-wb-common-kogito-client + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client + provided + + + + org.kie.soup + kie-soup-project-datamodel-api + + + + + + ${project.artifactId} + src/main/webapp/WEB-INF/classes + + + + + org.kie + kie-gwthelper-maven-plugin + + + add-source + + add-source + + + ${gwt.helper.includes} + ${gwt.helper.rootDirectories} + + + + + + org.codehaus.mojo + gwt-maven-plugin + + true + ${gwt.compiler.localWorkers} + ${project.build.directory}/gwt-symbols-deploy + true + -Xmx4096m -Xms1024m -Xss1M -XX:CompileThreshold=7000 -Derrai.dynamic_validation.enabled=true -Derrai.jboss.home=${errai.jboss.home} + org.kie.workbench.common.dmn.showcase.FastCompiledDMNKogitoTestingWebapp + INFO + false + org.jboss.errai.cdi.server.gwt.EmbeddedWildFlyLauncher + true + index.html + src/main/webapp + false + INFO + + + + org.kie.soup:kie-soup-commons + + + org.uberfire:uberfire-commons + org.uberfire:uberfire-nio2-model + org.uberfire:uberfire-io + org.uberfire:uberfire-api + org.uberfire:uberfire-js + org.uberfire:uberfire-security-api + org.uberfire:uberfire-security-client + org.uberfire:uberfire-client-api + org.uberfire:uberfire-workbench-client + org.uberfire:uberfire-workbench-client-backend + org.uberfire:uberfire-workbench-client-views-patternfly + org.uberfire:uberfire-simple-docks-client + org.uberfire:uberfire-backend-api + org.uberfire:uberfire-project-api + org.uberfire:uberfire-project-client + org.uberfire:uberfire-services-api + org.uberfire:uberfire-structure-api + org.uberfire:uberfire-workingset-api + org.uberfire:uberfire-message-console-api + org.uberfire:uberfire-message-console-client + + + org.jboss.errai:errai-data-binding + org.kie.workbench.widgets:kie-wb-common-ui + org.kie.workbench.profile:kie-wb-common-profile-api + org.kie.workbench.services:kie-wb-common-datamodel-api + org.kie.workbench.services:kie-wb-common-services-api + org.kie.workbench:kie-wb-common-kogito-client + + + org.uberfire:uberfire-runtime-plugins-api + org.uberfire:uberfire-commons-editor-api + org.uberfire:uberfire-commons-editor-client + org.uberfire:uberfire-widgets-commons + org.uberfire:uberfire-widgets-table + org.uberfire:uberfire-widgets-properties-editor-api + org.uberfire:uberfire-widgets-properties-editor-client + org.uberfire:uberfire-widgets-service-api + org.uberfire:uberfire-widgets-core-client + + + org.uberfire:uberfire-preferences-api + org.uberfire:uberfire-preferences-client + org.uberfire:uberfire-preferences-ui-client + + + org.uberfire:uberfire-experimental-api + org.uberfire:uberfire-experimental-client + + + org.kie.workbench.forms:kie-wb-common-forms-api + org.kie.workbench.forms:kie-wb-common-forms-adf-base + org.kie.workbench.forms:kie-wb-common-forms-adf-engine-api + org.kie.workbench.forms:kie-wb-common-forms-adf-engine-client + org.kie.workbench.forms:kie-wb-common-forms-fields + org.kie.workbench.forms:kie-wb-common-forms-processing-engine + org.kie.workbench.forms:kie-wb-common-forms-common-rendering-shared + org.kie.workbench.forms:kie-wb-common-forms-common-rendering-client + org.kie.workbench.forms:kie-wb-common-forms-crud-component + org.kie.workbench.forms:kie-wb-common-dynamic-forms-api + org.kie.workbench.forms:kie-wb-common-dynamic-forms-client + + + org.kie.workbench.stunner:kie-wb-common-stunner-core-api + org.kie.workbench.stunner:kie-wb-common-stunner-backend-api + org.kie.workbench.stunner:kie-wb-common-stunner-client-api + org.kie.workbench.stunner:kie-wb-common-stunner-core-common + org.kie.workbench.stunner:kie-wb-common-stunner-client-common + org.kie.workbench.stunner:kie-wb-common-stunner-lienzo + org.kie.workbench.stunner:kie-wb-common-stunner-shapes-api + org.kie.workbench.stunner:kie-wb-common-stunner-shapes-client + org.kie.workbench.stunner:kie-wb-common-stunner-lienzo-extensions + org.kie.workbench.stunner:kie-wb-common-stunner-svg-client + org.kie.workbench.stunner:kie-wb-common-stunner-widgets + org.kie.workbench.stunner:kie-wb-common-stunner-forms-api + org.kie.workbench.stunner:kie-wb-common-stunner-forms-client + org.kie.workbench.stunner:kie-wb-common-stunner-kogito-api + org.kie.workbench.stunner:kie-wb-common-stunner-kogito-client + + + org.kie.workbench:kie-wb-common-dmn-api + org.kie.workbench:kie-wb-common-dmn-client + org.kie.workbench:kie-wb-common-dmn-webapp-common + org.kie.workbench:kie-wb-common-dmn-webapp-kogito-common + org.kie.workbench:kie-wb-common-dmn-webapp-kogito-marshaller + org.uberfire:uberfire-wires-core-grids + + org.uberfire:appformer-js-bridge + + + + + + gwt-clean + clean + + clean + + + + gwt-compile + + resources + compile + + + + + + + maven-war-plugin + + **/javax/**/*.*,**/client/**/*.class,**/*.symbolMap + + false + + + + + + maven-clean-plugin + + + + ${basedir} + + www-test/** + src/main/webapp/org.kie.workbench.common.dmn.showcase.DMNShowcase/ + src/main/webapp/WEB-INF/classes/ + src/main/webapp/WEB-INF/deploy/ + src/main/webapp/WEB-INF/lib/ + **/gwt-unitCache/** + .gwt/** + .errai/ + .security/ + .niogit/** + .index/** + **/*.JUnit/** + repositories/ + + + + ${basedir}/src/main/webapp/model/ + + **.js + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + process-resources + + unpack + + + + + org.jboss.errai + wildfly-dist + ${version.org.jboss.errai.wildfly} + zip + false + ${project.build.directory} + + + + + + Unpack DMNMarshaller JS from dependency + process-sources + + unpack + + + + + org.kie.workbench + kie-wb-common-dmn-webapp-kogito-marshaller + ${version.org.kie} + jar + true + ${project.build.directory}/DMNMarshaller + **/*.js + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + Copy DMNMarshaller JS to WAR + process-resources + + run + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + org/kie/workbench/common/dmn/webapp/kogito/marshaller/js/**/*, + org/kie/workbench/common/dmn/webapp/kogito/marshaller/jre/package-info.java, + org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/JSIName.java, + org/kie/workbench/common/dmn/webapp/kogito/marshaller/mapper/JsUtils.java + + + + + + + + + + + + thorntail + + + thorntail + + + + + + + io.thorntail + bom-all + ${version.thorntail} + import + pom + + + + + + + + + + + io.thorntail + cdi + + + + io.thorntail + undertow + + + + io.thorntail + messaging + + + + + + + io.thorntail + thorntail-maven-plugin + ${version.thorntail} + + + package + + package + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + none + + + + + + + + + + fullProfile + + + full + + + + -Xmx3g -Xms1g -Xss1M + 4 + + + + + + org.codehaus.mojo + gwt-maven-plugin + + org.kie.workbench.common.dmn.showcase.DMNShowcase + false + + + + + + + + + + no-showcase + + + + org.codehaus.mojo + gwt-maven-plugin + + true + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNDiagramEditor.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNDiagramEditor.java new file mode 100644 index 00000000000..6847da1b696 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNDiagramEditor.java @@ -0,0 +1,231 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.editor; + +import java.util.function.Consumer; + +import javax.enterprise.context.Dependent; +import javax.enterprise.event.Event; +import javax.enterprise.event.Observes; +import javax.inject.Inject; + +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorDock; +import org.kie.workbench.common.dmn.client.editors.included.IncludedModelsPage; +import org.kie.workbench.common.dmn.client.editors.included.imports.IncludedModelsPageStateProviderImpl; +import org.kie.workbench.common.dmn.client.editors.search.DMNEditorSearchIndex; +import org.kie.workbench.common.dmn.client.editors.search.DMNSearchableElement; +import org.kie.workbench.common.dmn.client.editors.types.DataTypePageTabActiveEvent; +import org.kie.workbench.common.dmn.client.editors.types.DataTypesPage; +import org.kie.workbench.common.dmn.client.editors.types.listview.common.DataTypeEditModeToggleEvent; +import org.kie.workbench.common.dmn.client.events.EditExpressionEvent; +import org.kie.workbench.common.dmn.showcase.client.navigator.DMNVFSService; +import org.kie.workbench.common.dmn.webapp.common.client.docks.preview.PreviewDiagramDock; +import org.kie.workbench.common.dmn.webapp.kogito.common.client.editor.BaseDMNDiagramEditor; +import org.kie.workbench.common.dmn.webapp.kogito.common.client.editor.DMNEditorMenuSessionItems; +import org.kie.workbench.common.kogito.client.editor.MultiPageEditorContainerView; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; +import org.kie.workbench.common.stunner.core.client.annotation.DiagramEditor; +import org.kie.workbench.common.stunner.core.client.api.SessionManager; +import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; +import org.kie.workbench.common.stunner.core.client.command.SessionCommandManager; +import org.kie.workbench.common.stunner.core.client.components.layout.LayoutHelper; +import org.kie.workbench.common.stunner.core.client.components.layout.OpenDiagramLayoutExecutor; +import org.kie.workbench.common.stunner.core.client.error.DiagramClientErrorHandler; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.kie.workbench.common.stunner.core.client.session.Session; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.documentation.DocumentationView; +import org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent; +import org.kie.workbench.common.stunner.kogito.client.docks.DiagramEditorPropertiesDock; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientDiagramService; +import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; +import org.kie.workbench.common.widgets.client.search.component.SearchBarComponent; +import org.uberfire.backend.vfs.Path; +import org.uberfire.client.annotations.WorkbenchMenu; +import org.uberfire.client.annotations.WorkbenchScreen; +import org.uberfire.client.mvp.PlaceManager; +import org.uberfire.client.promise.Promises; +import org.uberfire.client.views.pfly.multipage.MultiPageEditorSelectedPageEvent; +import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; +import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; +import org.uberfire.lifecycle.OnStartup; +import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.events.NotificationEvent; +import org.uberfire.workbench.model.menu.Menus; + +import static org.uberfire.ext.editor.commons.client.resources.i18n.CommonConstants.INSTANCE; + +@Dependent +@DiagramEditor +@WorkbenchScreen(identifier = BaseDMNDiagramEditor.EDITOR_ID) +public class DMNDiagramEditor extends BaseDMNDiagramEditor { + + public static final String CONTENT_PARAMETER_NAME = "content"; + + private final Event notificationEvent; + private final DMNVFSService vfsService; + private final Promises promises; + + @Inject + public DMNDiagramEditor(final View view, + final FileMenuBuilder fileMenuBuilder, + final PlaceManager placeManager, + final MultiPageEditorContainerView multiPageEditorContainerView, + final Event changeTitleNotificationEvent, + final Event notificationEvent, + final Event onDiagramFocusEvent, + final TextEditorView xmlEditorView, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final DMNEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService, + final @DMNEditor DocumentationView documentationView, + final DMNEditorSearchIndex editorSearchIndex, + final SearchBarComponent searchBarComponent, + final SessionManager sessionManager, + final @Session SessionCommandManager sessionCommandManager, + final Event refreshFormPropertiesEvent, + final DecisionNavigatorDock decisionNavigatorDock, + final DiagramEditorPropertiesDock diagramPropertiesDock, + final PreviewDiagramDock diagramPreviewAndExplorerDock, + final LayoutHelper layoutHelper, + final OpenDiagramLayoutExecutor openDiagramLayoutExecutor, + final DataTypesPage dataTypesPage, + final IncludedModelsPage includedModelsPage, + final IncludedModelsPageStateProviderImpl importsPageProvider, + final KogitoClientDiagramService diagramServices, + final DMNVFSService vfsService, + final Promises promises) { + super(view, + fileMenuBuilder, + placeManager, + multiPageEditorContainerView, + changeTitleNotificationEvent, + notificationEvent, + onDiagramFocusEvent, + xmlEditorView, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService, + documentationView, + editorSearchIndex, + searchBarComponent, + sessionManager, + sessionCommandManager, + refreshFormPropertiesEvent, + decisionNavigatorDock, + diagramPropertiesDock, + diagramPreviewAndExplorerDock, + layoutHelper, + openDiagramLayoutExecutor, + dataTypesPage, + includedModelsPage, + importsPageProvider, + diagramServices); + this.notificationEvent = notificationEvent; + this.vfsService = vfsService; + this.promises = promises; + } + + @Override + @OnStartup + @SuppressWarnings("unused") + public void onStartup(final PlaceRequest place) { + super.onStartup(place); + + setContent(place.getParameter(CONTENT_PARAMETER_NAME, "")); + } + + @Override + public void onDataTypePageNavTabActiveEvent(final @Observes DataTypePageTabActiveEvent event) { + super.onDataTypePageNavTabActiveEvent(event); + } + + @Override + protected void makeMenuBar() { + if (!menuBarInitialized) { + getFileMenuBuilder().addSave(this::doSave); + getMenuSessionItems().populateMenu(getFileMenuBuilder()); + makeAdditionalStunnerMenus(getFileMenuBuilder()); + menuBarInitialized = true; + } + } + + @Override + @WorkbenchMenu + //AppFormer does not generate menus when the @WorkbenchMenu annotation is on the super class + public void getMenus(final Consumer menusConsumer) { + super.getMenus(menusConsumer); + } + + @SuppressWarnings("unchecked") + private void doSave() { + final Path path = getCanvasHandler().getDiagram().getMetadata().getPath(); + + getContent().then(xml -> { + vfsService.saveFile(path, + (String) xml, + new ServiceCallback() { + @Override + public void onSuccess(final String xml) { + resetContentHash(); + notificationEvent.fire(new NotificationEvent(INSTANCE.ItemSavedSuccessfully())); + hideLoadingViews(); + } + + @Override + public void onError(final ClientRuntimeError error) { + onSaveError(error); + } + }); + return promises.resolve(); + }); + } + + @Override + public void onDataTypeEditModeToggle(final @Observes DataTypeEditModeToggleEvent event) { + super.onDataTypeEditModeToggle(event); + } + + @Override + public void onEditExpressionEvent(final @Observes EditExpressionEvent event) { + super.onEditExpressionEvent(event); + } + + @Override + public void onMultiPageEditorSelectedPageEvent(final @Observes MultiPageEditorSelectedPageEvent event) { + super.onMultiPageEditorSelectedPageEvent(event); + } + + @Override + public void onRefreshFormPropertiesEvent(final @Observes RefreshFormPropertiesEvent event) { + super.onRefreshFormPropertiesEvent(event); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNDiagramsNavigatorScreen.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNDiagramsNavigatorScreen.java new file mode 100644 index 00000000000..41bc231179c --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNDiagramsNavigatorScreen.java @@ -0,0 +1,113 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.navigator; + +import java.util.Objects; +import java.util.function.Consumer; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.Dependent; +import javax.enterprise.event.Observes; +import javax.inject.Inject; + +import com.google.gwt.user.client.ui.IsWidget; +import org.kie.workbench.common.dmn.webapp.common.client.navigator.BaseDMNDiagramsNavigatorScreen; +import org.kie.workbench.common.stunner.client.widgets.event.LoadDiagramEvent; +import org.kie.workbench.common.stunner.client.widgets.explorer.navigator.diagrams.DiagramsNavigator; +import org.kie.workbench.common.stunner.client.widgets.menu.dev.ShapeSetsMenuItemsBuilder; +import org.kie.workbench.common.stunner.core.client.ShapeSet; +import org.uberfire.client.annotations.WorkbenchMenu; +import org.uberfire.client.annotations.WorkbenchPartTitle; +import org.uberfire.client.annotations.WorkbenchPartView; +import org.uberfire.client.annotations.WorkbenchScreen; +import org.uberfire.lifecycle.OnClose; +import org.uberfire.lifecycle.OnStartup; +import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.model.menu.Menus; + +@Dependent +@WorkbenchScreen(identifier = BaseDMNDiagramsNavigatorScreen.SCREEN_ID) +public class DMNDiagramsNavigatorScreen extends BaseDMNDiagramsNavigatorScreen { + + private DMNVFSService vfsService; + + public DMNDiagramsNavigatorScreen() { + //CDI proxy + } + + @Inject + public DMNDiagramsNavigatorScreen(final DiagramsNavigator diagramsNavigator, + final ShapeSetsMenuItemsBuilder newDiagramMenuItemsBuilder, + final DMNVFSService vfsService) { + super(diagramsNavigator, + newDiagramMenuItemsBuilder); + this.vfsService = vfsService; + } + + @Override + @PostConstruct + public void init() { + super.init(); + } + + @Override + @OnStartup + @SuppressWarnings("unused") + public void onStartup(final PlaceRequest placeRequest) { + super.onStartup(placeRequest); + } + + @Override + public void edit() { + if (Objects.nonNull(selectedDiagramEvent)) { + vfsService.openFile(selectedDiagramEvent.getPath()); + } + } + + @Override + public void create(final ShapeSet shapeSet) { + vfsService.newFile(); + } + + @Override + @OnClose + public void onClose() { + super.onClose(); + } + + @Override + @WorkbenchMenu + public void getMenus(final Consumer menusConsumer) { + super.getMenus(menusConsumer); + } + + @Override + @WorkbenchPartTitle + public String getTitle() { + return super.getTitle(); + } + + @Override + @WorkbenchPartView + public IsWidget getWidget() { + return super.getWidget(); + } + + @Override + public void onLoadDiagramEvent(final @Observes LoadDiagramEvent loadDiagramEvent) { + super.onLoadDiagramEvent(loadDiagramEvent); + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNShapeSetThumbProvider.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNShapeSetThumbProvider.java new file mode 100644 index 00000000000..60faef31201 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNShapeSetThumbProvider.java @@ -0,0 +1,41 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.navigator; + +import javax.enterprise.context.ApplicationScoped; + +import com.google.gwt.safehtml.shared.SafeUri; +import com.google.gwt.safehtml.shared.UriUtils; +import org.kie.workbench.common.stunner.core.client.ShapeSetThumbProvider; + +@ApplicationScoped +public class DMNShapeSetThumbProvider implements ShapeSetThumbProvider { + + @Override + public SafeUri getThumbnailUri() { + return UriUtils.fromSafeConstant("/images/default-diagram-thumbnail.png"); + } + + @Override + public Class getSourceType() { + return String.class; + } + + @Override + public boolean thumbFor(final String definitionSetId) { + return true; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNVFSService.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNVFSService.java new file mode 100644 index 00000000000..1c9d1fa6324 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNVFSService.java @@ -0,0 +1,68 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.showcase.client.navigator; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import org.jboss.errai.common.client.api.Caller; +import org.kie.workbench.common.dmn.showcase.client.editor.DMNDiagramEditor; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.uberfire.backend.vfs.Path; +import org.uberfire.backend.vfs.VFSService; +import org.uberfire.client.mvp.PlaceManager; +import org.uberfire.mvp.PlaceRequest; +import org.uberfire.mvp.impl.DefaultPlaceRequest; + +@ApplicationScoped +public class DMNVFSService { + + private static final PlaceRequest DIAGRAM_EDITOR = new DefaultPlaceRequest(DMNDiagramEditor.EDITOR_ID); + + private PlaceManager placeManager; + private Caller vfsServiceCaller; + + public DMNVFSService() { + //CDI proxy + } + + @Inject + public DMNVFSService(final PlaceManager placeManager, + final Caller vfsServiceCaller) { + this.placeManager = placeManager; + this.vfsServiceCaller = vfsServiceCaller; + } + + public void newFile() { + DIAGRAM_EDITOR.getParameters().clear(); + placeManager.goTo(DIAGRAM_EDITOR); + } + + public void openFile(final Path path) { + vfsServiceCaller.call((String xml) -> { + DIAGRAM_EDITOR.addParameter(DMNDiagramEditor.CONTENT_PARAMETER_NAME, xml); + placeManager.goTo(DIAGRAM_EDITOR); + }).readAllString(path); + } + + @SuppressWarnings("unchecked") + public void saveFile(final Path path, + final String xml, + final ServiceCallback callback) { + vfsServiceCaller.call((Path p) -> callback.onSuccess(xml)).write(path, xml); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/perspectives/AuthoringPerspective.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/perspectives/AuthoringPerspective.java new file mode 100644 index 00000000000..23a4d576bba --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/java/org/kie/workbench/common/dmn/showcase/client/perspectives/AuthoringPerspective.java @@ -0,0 +1,41 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.perspectives; + +import javax.enterprise.context.ApplicationScoped; + +import org.kie.workbench.common.dmn.showcase.client.navigator.DMNDiagramsNavigatorScreen; +import org.kie.workbench.common.dmn.webapp.kogito.common.client.editor.BaseDMNDiagramEditor; +import org.uberfire.client.annotations.Perspective; +import org.uberfire.client.annotations.WorkbenchPerspective; +import org.uberfire.client.workbench.panels.impl.MultiListWorkbenchPanelPresenter; +import org.uberfire.mvp.impl.DefaultPlaceRequest; +import org.uberfire.workbench.model.PerspectiveDefinition; +import org.uberfire.workbench.model.impl.PartDefinitionImpl; +import org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl; + +@ApplicationScoped +@WorkbenchPerspective(identifier = BaseDMNDiagramEditor.PERSPECTIVE_ID, isDefault = true) +public class AuthoringPerspective { + + @Perspective + public PerspectiveDefinition buildPerspective() { + final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); + perspective.setName("Authoring"); + perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest(DMNDiagramsNavigatorScreen.SCREEN_ID))); + return perspective; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/resources/org/kie/workbench/common/dmn/showcase/DMNKogitoTestingWebapp.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/resources/org/kie/workbench/common/dmn/showcase/DMNKogitoTestingWebapp.gwt.xml new file mode 100644 index 00000000000..9f010962ce7 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/resources/org/kie/workbench/common/dmn/showcase/DMNKogitoTestingWebapp.gwt.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/resources/org/kie/workbench/common/dmn/showcase/FastCompiledDMNKogitoTestingWebapp.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/resources/org/kie/workbench/common/dmn/showcase/FastCompiledDMNKogitoTestingWebapp.gwt.xml new file mode 100644 index 00000000000..7c6970891c0 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/resources/org/kie/workbench/common/dmn/showcase/FastCompiledDMNKogitoTestingWebapp.gwt.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/WEB-INF/beans.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 00000000000..5f26b19e75b --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/WEB-INF/jboss-deployment-structure.xml new file mode 100644 index 00000000000..4c375602fb3 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/WEB-INF/jboss-deployment-structure.xml @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/WEB-INF/web.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000000..c4a3949640c --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,43 @@ + + + + + + + ErraiServlet + org.jboss.errai.bus.server.servlet.DefaultBlockingServlet + + + service-locator + org.jboss.errai.cdi.server.CDIServiceLocator + + 1 + + + + ErraiServlet + *.erraiBus + + + + index.html + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/afjs-manifest.json b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/afjs-manifest.json new file mode 100644 index 00000000000..769c59c02bf --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/afjs-manifest.json @@ -0,0 +1,9 @@ +{ + "name": "demo", + "editors": [ + { + "regex": "*.dmn", + "editor": "DMNDiagramEditor" + } + ] +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/favicon.ico b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/favicon.ico new file mode 100644 index 00000000000..cefe23f9c00 Binary files /dev/null and b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/favicon.ico differ diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/images/default-diagram-thumbnail.png b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/images/default-diagram-thumbnail.png new file mode 100644 index 00000000000..d032580aef4 Binary files /dev/null and b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/images/default-diagram-thumbnail.png differ diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/index.html b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/index.html new file mode 100644 index 00000000000..224bf786c1c --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/index.html @@ -0,0 +1,46 @@ + + + + + + + + DMN Editor Showcase + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/model/readme.md b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/model/readme.md new file mode 100644 index 00000000000..7407e63c1b2 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-testing/src/main/webapp/model/readme.md @@ -0,0 +1 @@ +The content of this folder is created by `kie-wb-common-dmn-webapp-kogito-marshaller` and copied here by Maven. diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/.gitignore b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/.gitignore new file mode 100644 index 00000000000..0d5c9c55009 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/.gitignore @@ -0,0 +1,22 @@ +/target +/local + +/src/main/gwt-unitCache/ +/src/main/webapp/WEB-INF/classes/ +/src/main/webapp/WEB-INF/deploy/ +/src/main/webapp/WEB-INF/lib/ +/src/main/webapp/org.kie.workbench.common.dmn.showcase.DMNShowcase/ + +# Eclipse, Netbeans and IntelliJ files +/.* +/**/.* +!.gitignore +/nbproject +*.ipr +*.iws +*.iml +**/gwt-unitCache/ + +# Repository wide ignore mac DS_Store files +.DS_Store + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/pom.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/pom.xml new file mode 100644 index 00000000000..567f23681f9 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/pom.xml @@ -0,0 +1,1049 @@ + + + + + org.kie.workbench + kie-wb-common-dmn + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-dmn-webapp-standalone + Kie Workbench - Common - DMN - Standalone Showcase webapp + Kie Workbench - Common - DMN - Standalone Showcase webapp + war + + + ${project.build.directory}/wildfly-${version.org.jboss.errai.wildfly} + 4 + 2.4.0.Final + true + true + + + + + + + org.slf4j + slf4j-api + + + + org.slf4j + slf4j-ext + + + + + ch.qos.logback + logback-classic + + + com.google.inject + guice + + + + + + org.slf4j + log4j-over-slf4j + + + + + + + com.google.inject + guice + + + org.jboss.errai + errai-ioc + + + org.jboss.errai + errai-common + + + org.jboss.errai + errai-bus + + + org.jboss.errai + errai-ui + provided + + + org.jboss.errai + errai-data-binding + provided + + + org.jboss.errai + errai-marshalling + + + org.jboss.errai + errai-security-server + + + org.jboss.errai + errai-cdi-server + + + org.jboss.errai + errai-cdi-client + provided + + + org.jboss.errai + errai-cdi-shared + + + org.jboss.errai + errai-cdi-jboss + provided + + + ant + ant + + + + + org.jboss.errai + errai-jboss-as-support + + + org.jboss.errai + errai-codegen-gwt + provided + + + org.jboss.errai + errai-validation + provided + + + + org.owasp.encoder + encoder + + + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-client-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-backend-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-common + + + org.kie.workbench.stunner + kie-wb-common-stunner-processors + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-backend + + + org.kie.workbench.stunner + kie-wb-common-stunner-client-common + + + org.powermock + powermock-api-mockito + + + org.powermock + powermock-module-junit4 + + + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-lienzo + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-shapes-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-shapes-client + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-lienzo-extensions + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-svg-client + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-svg-gen + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-widgets + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-forms-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-forms-client + provided + + + + + + org.uberfire + uberfire-preferences-api + + + + org.uberfire + uberfire-preferences-backend + + + + org.uberfire + uberfire-preferences-client + + + org.uberfire + uberfire-preferences-client-backend + + + + + org.kie + kie-dmn-backend + + + org.kie.workbench + kie-wb-common-dmn-api + + + org.kie.workbench + kie-wb-common-dmn-backend + + + org.kie.workbench + kie-wb-common-dmn-client + provided + + + org.kie.workbench + kie-wb-common-dmn-webapp-common + provided + + + org.uberfire + uberfire-wires-core-grids + provided + + + + + org.kie + lienzo-core + provided + + + com.ahome-it + ahome-tooling-nativetools + provided + + + com.ahome-it + ahome-tooling-common + provided + + + + + + org.kie.workbench.forms + kie-wb-common-forms-crud-component + provided + + + org.kie.workbench.forms + kie-wb-common-forms-api + + + org.kie.workbench.forms + kie-wb-common-forms-fields + + + org.kie.workbench.forms + kie-wb-common-forms-processing-engine + provided + + + org.kie.workbench.forms + kie-wb-common-forms-adf-base + + + org.kie.workbench.forms + kie-wb-common-forms-adf-engine-api + + + org.kie.workbench.forms + kie-wb-common-forms-adf-engine-backend + + + org.kie.workbench.forms + kie-wb-common-forms-adf-engine-client + provided + + + org.kie.workbench.forms + kie-wb-common-dynamic-forms-api + + + org.kie.workbench.forms + kie-wb-common-dynamic-forms-backend + + + org.kie.workbench.services + kie-wb-common-datamodel-backend + + + + + org.kie.workbench.forms + kie-wb-common-dynamic-forms-client + + + org.kie.workbench.forms + kie-wb-common-forms-backend-services + + + org.kie.workbench.forms + kie-wb-common-forms-common-rendering-shared + + + org.kie.workbench.forms + kie-wb-common-forms-common-rendering-client + provided + + + + + javax.validation + validation-api + + + javax.validation + validation-api + sources + + + org.hibernate + hibernate-validator + + + org.hibernate + hibernate-validator + sources + + + + + + org.uberfire + uberfire-layout-editor-api + + + org.uberfire + uberfire-layout-editor-client + + + org.uberfire + uberfire-experimental-client + + + provided + + + + + + org.uberfire + uberfire-runtime-plugins-api + + + + + + org.uberfire + uberfire-widgets-properties-editor-api + + + org.uberfire + uberfire-widgets-properties-editor-client + provided + + + + + + org.uberfire + uberfire-js + provided + + + + + + org.uberfire + uberfire-commons-editor-api + + + org.uberfire + uberfire-commons-editor-client + provided + + + + + org.uberfire + uberfire-all + + + log4j + log4j + + + + + org.uberfire + uberfire-api + + + org.uberfire + uberfire-backend-api + + + org.uberfire + uberfire-backend-server + + + org.uberfire + uberfire-services-api + + + org.uberfire + uberfire-services-backend + + + org.uberfire + uberfire-client + provided + + + org.uberfire + uberfire-client-api + + + org.uberfire + uberfire-client-backend + provided + + + org.uberfire + uberfire-workbench-client + provided + + + org.uberfire + uberfire-workbench-client-backend + provided + + + org.uberfire + uberfire-security-api + + + org.uberfire + uberfire-security-client + provided + + + org.uberfire + uberfire-simple-docks-client + provided + + + org.uberfire + uberfire-workbench-processors + provided + + + org.uberfire + uberfire-workbench-client-views-patternfly + provided + + + org.uberfire + uberfire-metadata-commons-io + + + org.uberfire + uberfire-servlet-security + + + + + com.google.elemental2 + elemental2-promise + + + + + org.uberfire + uberfire-widgets-core-client + provided + + + + + org.uberfire + uberfire-io + + + org.uberfire + uberfire-nio2-model + + + + + + org.uberfire + uberfire-ssh-backend + + + + + + org.uberfire + uberfire-experimental-api + + + org.uberfire + uberfire-experimental-backend + + + org.uberfire + uberfire-experimental-client + provided + + + + + org.kie.soup + kie-soup-commons + + + + + org.uberfire + uberfire-commons + + + org.apache.activemq + artemis-jms-client + + + org.jboss.spec.javax.jms + jboss-jms-api_2.0_spec + + + + + + + org.uberfire + uberfire-widgets-commons + provided + + + org.uberfire + uberfire-widgets-table + provided + + + org.kie.workbench.widgets + kie-wb-common-ui + provided + + + org.kie.workbench.widgets + kie-wb-metadata-widget + provided + + + org.kie.workbench.widgets + kie-wb-config-resource-widget + provided + + + + + + org.uberfire + uberfire-project-api + + + org.uberfire + uberfire-project-client + + + org.kie.workbench.services + kie-wb-common-services-api + + + org.kie.workbench.services + kie-wb-common-services-backend + + + com.google.inject + guice + + + + + org.kie.workbench.services + kie-wb-common-refactoring-api + + + org.kie.workbench.services + kie-wb-common-refactoring-backend + + + org.kie.workbench.services + kie-wb-common-datamodel-api + + + + + org.uberfire + uberfire-structure-api + + + org.uberfire + uberfire-structure-backend + + + + + org.uberfire + uberfire-preferences-ui-client + provided + + + + + com.google.gwt + gwt-user + provided + + + javax.servlet + javax.servlet-api + + + + + org.gwtbootstrap3 + gwtbootstrap3 + provided + + + org.gwtbootstrap3 + gwtbootstrap3-extras + provided + + + com.google.elemental2 + elemental2-dom + + + + + org.kie.workbench + kie-wb-common-kogito-client + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client + provided + + + + + com.google.gwt.gwtmockito + gwtmockito + test + + + org.uberfire + uberfire-testing-utils + test + + + + + org.kie.soup + kie-soup-project-datamodel-api + + + org.uberfire + uberfire-message-console-api + + + org.uberfire + uberfire-workingset-api + + + org.uberfire + uberfire-widgets-service-api + + + org.drools + drools-workbench-models-datamodel-api + + + org.kie.workbench.profile + kie-wb-common-profile-api + + + + + org.drools + drools-cdi + + + org.drools + drools-compiler + + + + + + + + ${project.artifactId} + src/main/webapp/WEB-INF/classes + + + + + org.codehaus.mojo + gwt-maven-plugin + + true + ${gwt.compiler.localWorkers} + ${project.build.directory}/gwt-symbols-deploy + true + -Xmx4096m -Xms1024m -Xss1M -XX:CompileThreshold=7000 -Derrai.dynamic_validation.enabled=true -Derrai.jboss.home=${errai.jboss.home} + org.kie.workbench.common.dmn.showcase.FastCompiledDMNShowcase + INFO + false + org.jboss.errai.cdi.server.gwt.EmbeddedWildFlyLauncher + true + dmn-editor.html + src/main/webapp + false + INFO + + + + org.kie.soup:kie-soup-commons + + + org.uberfire:uberfire-commons + org.uberfire:uberfire-nio2-model + org.uberfire:uberfire-io + org.uberfire:uberfire-api + org.uberfire:uberfire-js + org.uberfire:uberfire-security-api + org.uberfire:uberfire-security-client + org.uberfire:uberfire-client-api + org.uberfire:uberfire-workbench-client + org.uberfire:uberfire-workbench-client-backend + org.uberfire:uberfire-workbench-client-views-patternfly + org.uberfire:uberfire-simple-docks-client + org.uberfire:uberfire-backend-api + org.uberfire:uberfire-project-api + org.uberfire:uberfire-project-client + org.uberfire:uberfire-services-api + org.uberfire:uberfire-structure-api + org.uberfire:uberfire-workingset-api + org.uberfire:uberfire-message-console-api + org.uberfire:uberfire-message-console-client + + + org.jboss.errai:errai-data-binding + org.kie.workbench.widgets:kie-wb-common-ui + org.kie.workbench.widgets:kie-wb-metadata-widget + org.kie.workbench.widgets:kie-wb-config-resource-widget + org.kie.workbench.profile:kie-wb-common-profile-api + org.kie.workbench.services:kie-wb-common-datamodel-api + org.kie.workbench.services:kie-wb-common-services-api + org.kie.workbench:kie-wb-common-kogito-client + + + org.uberfire:uberfire-runtime-plugins-api + org.uberfire:uberfire-commons-editor-api + org.uberfire:uberfire-commons-editor-client + org.uberfire:uberfire-widgets-commons + org.uberfire:uberfire-widgets-table + org.uberfire:uberfire-widgets-properties-editor-api + org.uberfire:uberfire-widgets-properties-editor-client + org.uberfire:uberfire-widgets-service-api + org.uberfire:uberfire-widgets-core-client + + + org.uberfire:uberfire-preferences-api + org.uberfire:uberfire-preferences-client + org.uberfire:uberfire-preferences-client-backend + org.uberfire:uberfire-preferences-ui-client + + + org.uberfire:uberfire-experimental-api + org.uberfire:uberfire-experimental-client + + + org.kie.workbench.forms:kie-wb-common-forms-api + org.kie.workbench.forms:kie-wb-common-forms-adf-base + org.kie.workbench.forms:kie-wb-common-forms-adf-engine-api + org.kie.workbench.forms:kie-wb-common-forms-adf-engine-client + org.kie.workbench.forms:kie-wb-common-forms-fields + org.kie.workbench.forms:kie-wb-common-forms-processing-engine + org.kie.workbench.forms:kie-wb-common-forms-common-rendering-shared + org.kie.workbench.forms:kie-wb-common-forms-common-rendering-client + org.kie.workbench.forms:kie-wb-common-forms-crud-component + org.kie.workbench.forms:kie-wb-common-dynamic-forms-api + org.kie.workbench.forms:kie-wb-common-dynamic-forms-client + + + org.kie.workbench.stunner:kie-wb-common-stunner-core-api + org.kie.workbench.stunner:kie-wb-common-stunner-backend-api + org.kie.workbench.stunner:kie-wb-common-stunner-client-api + org.kie.workbench.stunner:kie-wb-common-stunner-core-common + org.kie.workbench.stunner:kie-wb-common-stunner-client-common + org.kie.workbench.stunner:kie-wb-common-stunner-lienzo + org.kie.workbench.stunner:kie-wb-common-stunner-shapes-api + org.kie.workbench.stunner:kie-wb-common-stunner-shapes-client + org.kie.workbench.stunner:kie-wb-common-stunner-lienzo-extensions + org.kie.workbench.stunner:kie-wb-common-stunner-svg-client + org.kie.workbench.stunner:kie-wb-common-stunner-widgets + org.kie.workbench.stunner:kie-wb-common-stunner-forms-api + org.kie.workbench.stunner:kie-wb-common-stunner-forms-client + org.kie.workbench.stunner:kie-wb-common-stunner-kogito-api + org.kie.workbench.stunner:kie-wb-common-stunner-kogito-client + + + org.kie.workbench:kie-wb-common-dmn-api + org.kie.workbench:kie-wb-common-dmn-client + org.kie.workbench:kie-wb-common-dmn-webapp-common + org.uberfire:uberfire-wires-core-grids + + org.uberfire:appformer-js-bridge + + + + + + gwt-clean + clean + + clean + + + + gwt-compile + + resources + compile + + + + + + + maven-war-plugin + + **/javax/**/*.*,**/client/**/*.class,**/*.symbolMap + + false + + + + + + maven-clean-plugin + + + + ${basedir} + + www-test/** + src/main/webapp/org.kie.workbench.common.dmn.showcase.DMNShowcase/ + src/main/webapp/WEB-INF/classes/ + src/main/webapp/WEB-INF/deploy/ + src/main/webapp/WEB-INF/lib/ + **/gwt-unitCache/** + .gwt/** + .errai/ + .security/ + .niogit/** + .index/** + **/*.JUnit/** + repositories/ + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + process-resources + + unpack + + + + + org.jboss.errai + wildfly-dist + ${version.org.jboss.errai.wildfly} + zip + false + ${project.build.directory} + + + + + + + + org.jacoco + jacoco-maven-plugin + + ${code.coverage.disabled} + + + + maven-surefire-plugin + + + ${jacoco.exec.file} + + ${code.coverage.disabled} + + + + + + + + + + + fullProfile + + + full + + + + -Xmx3g -Xms1g -Xss1M + 4 + + + + + + org.codehaus.mojo + gwt-maven-plugin + + org.kie.workbench.common.dmn.showcase.DMNShowcase + false + + + + + + + + + + no-showcase + + + + org.codehaus.mojo + gwt-maven-plugin + + true + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-api/kie-wb-common-stunner-core-api/src/main/java/org/kie/workbench/common/stunner/core/validation/ValidationService.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/api/ValidationService.java similarity index 82% rename from kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-api/kie-wb-common-stunner-core-api/src/main/java/org/kie/workbench/common/stunner/core/validation/ValidationService.java rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/api/ValidationService.java index fff31dd5551..c2f5c5a3ae7 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-api/kie-wb-common-stunner-core-api/src/main/java/org/kie/workbench/common/stunner/core/validation/ValidationService.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/api/ValidationService.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,17 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -package org.kie.workbench.common.stunner.core.validation; +package org.kie.workbench.common.dmn.showcase.api; import java.util.Collection; import org.jboss.errai.bus.server.annotations.Remote; import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.rule.RuleViolation; +import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; @Remote public interface ValidationService { Collection> validate(Diagram diagram); + } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/backend/ApplicationScopedProducer.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/backend/ApplicationScopedProducer.java new file mode 100644 index 00000000000..eefdcdfd5b7 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/backend/ApplicationScopedProducer.java @@ -0,0 +1,63 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.backend; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.context.RequestScoped; +import javax.enterprise.inject.Produces; +import javax.inject.Inject; +import javax.inject.Named; + +import org.jboss.errai.security.shared.api.identity.User; +import org.jboss.errai.security.shared.service.AuthenticationService; +import org.uberfire.backend.server.IOWatchServiceAllImpl; +import org.uberfire.commons.services.cdi.Startup; +import org.uberfire.commons.services.cdi.StartupType; +import org.uberfire.io.IOService; +import org.uberfire.io.impl.IOServiceNio2WrapperImpl; + +@Startup(value = StartupType.BOOTSTRAP) +@ApplicationScoped +public class ApplicationScopedProducer { + + @Inject + private AuthenticationService authenticationService; + + @Inject + private IOWatchServiceAllImpl watchService; + + private IOService ioService; + + @PostConstruct + public void setup() { + ioService = new IOServiceNio2WrapperImpl("1", + watchService); + } + + @Produces + @Named("ioStrategy") + public IOService ioService() { + return ioService; + } + + @Produces + @RequestScoped + public User getIdentity() { + return authenticationService.getUser(); + } +} + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/backend/DefaultLuceneConfigProducer.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/backend/DefaultLuceneConfigProducer.java new file mode 100644 index 00000000000..9c0f399050c --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/backend/DefaultLuceneConfigProducer.java @@ -0,0 +1,72 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.backend; + +import java.util.Map; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.inject.Produces; +import javax.inject.Named; + +import org.apache.lucene.analysis.Analyzer; +import org.kie.soup.commons.util.Maps; +import org.kie.workbench.common.services.refactoring.backend.server.indexing.ImpactAnalysisAnalyzerWrapperFactory; +import org.kie.workbench.common.services.refactoring.backend.server.indexing.LowerCaseOnlyAnalyzer; +import org.kie.workbench.common.services.refactoring.model.index.terms.ModuleNameIndexTerm; +import org.kie.workbench.common.services.refactoring.model.index.terms.ModuleRootPathIndexTerm; +import org.kie.workbench.common.services.refactoring.model.index.terms.PackageNameIndexTerm; +import org.uberfire.ext.metadata.MetadataConfig; +import org.uberfire.ext.metadata.backend.lucene.analyzer.FilenameAnalyzer; +import org.uberfire.ext.metadata.io.MetadataConfigBuilder; + +/** + * This class contains the default Lucene configuration, and can be + * replaced by using CDI alternatives. + */ +@ApplicationScoped +public class DefaultLuceneConfigProducer { + + private MetadataConfig config; + + @PostConstruct + public void setup() { + final Map analyzers = getAnalyzers(); + this.config = new MetadataConfigBuilder().withInMemoryMetaModelStore() + .usingAnalyzers(analyzers) + .usingAnalyzerWrapperFactory(ImpactAnalysisAnalyzerWrapperFactory.getInstance()) + .useDirectoryBasedIndex() + .useNIODirectory() + .build(); + } + + @Produces + @Named("luceneConfig") + public MetadataConfig configProducer() { + return this.config; + } + + private Map getAnalyzers() { + return new Maps.Builder() + .put(ModuleRootPathIndexTerm.TERM, + new FilenameAnalyzer()) + .put(ModuleNameIndexTerm.TERM, + new LowerCaseOnlyAnalyzer()) + .put(PackageNameIndexTerm.TERM, + new LowerCaseOnlyAnalyzer()) + .build(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/src/main/java/org/kie/workbench/common/stunner/core/backend/service/ValidationServiceImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/backend/validation/ValidationServiceImpl.java similarity index 82% rename from kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/src/main/java/org/kie/workbench/common/stunner/core/backend/service/ValidationServiceImpl.java rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/backend/validation/ValidationServiceImpl.java index 2e80d80f84b..15ca6ed522e 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/src/main/java/org/kie/workbench/common/stunner/core/backend/service/ValidationServiceImpl.java +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/backend/validation/ValidationServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,8 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -package org.kie.workbench.common.stunner.core.backend.service; +package org.kie.workbench.common.dmn.showcase.backend.validation; import java.util.ArrayList; import java.util.Collection; @@ -29,22 +28,18 @@ import javax.inject.Inject; import org.jboss.errai.bus.server.annotations.Service; +import org.kie.workbench.common.dmn.showcase.api.ValidationService; import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.rule.RuleViolation; import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; import org.kie.workbench.common.stunner.core.validation.DomainValidator; import org.kie.workbench.common.stunner.core.validation.DomainViolation; -import org.kie.workbench.common.stunner.core.validation.ValidationService; import org.kie.workbench.common.stunner.core.validation.impl.ElementViolationImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -@ApplicationScoped @Service +@ApplicationScoped public class ValidationServiceImpl implements ValidationService { - private static final Logger LOG = LoggerFactory.getLogger(ValidationServiceImpl.class.getName()); - private final Instance validators; protected ValidationServiceImpl() { @@ -52,13 +47,12 @@ protected ValidationServiceImpl() { } @Inject - public ValidationServiceImpl(Instance validators) { + public ValidationServiceImpl(final Instance validators) { this.validators = validators; } @Override public Collection> validate(Diagram diagram) { - //handle domain violations (BPMN, DMN, CM...) return domainViolations(diagram).stream() .filter(v -> Objects.nonNull(v.getUUID())) .filter(v -> !"null".equals(v.getUUID())) @@ -75,7 +69,7 @@ private Collection domainViolations(Diagram diagram) { .findFirst() .map(validator -> { final List domainViolations = new ArrayList<>(); - validator.validate(diagram, violations -> domainViolations.addAll(violations)); + validator.validate(diagram, domainViolations::addAll); return domainViolations; }).orElseGet(Collections::emptyList); } diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNDiagramEditor.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNDiagramEditor.java new file mode 100644 index 00000000000..43704599ca2 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNDiagramEditor.java @@ -0,0 +1,623 @@ +/* + * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.editor; + +import java.util.Collection; +import java.util.function.Consumer; +import java.util.function.Supplier; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.Dependent; +import javax.enterprise.event.Event; +import javax.enterprise.event.Observes; +import javax.inject.Inject; + +import com.google.gwt.logging.client.LogConfiguration; +import com.google.gwt.user.client.ui.IsWidget; +import elemental2.dom.HTMLElement; +import org.jboss.errai.common.client.ui.ElementWrapperWidget; +import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; +import org.kie.workbench.common.dmn.client.commands.general.NavigateToExpressionEditorCommand; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorDock; +import org.kie.workbench.common.dmn.client.editors.expressions.ExpressionEditorView; +import org.kie.workbench.common.dmn.client.editors.included.IncludedModelsPage; +import org.kie.workbench.common.dmn.client.editors.included.imports.IncludedModelsPageStateProviderImpl; +import org.kie.workbench.common.dmn.client.editors.search.DMNEditorSearchIndex; +import org.kie.workbench.common.dmn.client.editors.search.DMNSearchableElement; +import org.kie.workbench.common.dmn.client.editors.toolbar.ToolbarStateHandler; +import org.kie.workbench.common.dmn.client.editors.types.DataTypePageTabActiveEvent; +import org.kie.workbench.common.dmn.client.editors.types.DataTypesPage; +import org.kie.workbench.common.dmn.client.editors.types.listview.common.DataTypeEditModeToggleEvent; +import org.kie.workbench.common.dmn.client.events.EditExpressionEvent; +import org.kie.workbench.common.dmn.client.session.DMNSession; +import org.kie.workbench.common.dmn.client.widgets.toolbar.DMNEditorToolbar; +import org.kie.workbench.common.dmn.showcase.client.perspectives.AuthoringPerspective; +import org.kie.workbench.common.dmn.showcase.client.services.DMNShowcaseDiagramService; +import org.kie.workbench.common.dmn.webapp.common.client.docks.preview.PreviewDiagramDock; +import org.kie.workbench.common.stunner.client.widgets.event.SessionFocusedEvent; +import org.kie.workbench.common.stunner.client.widgets.menu.dev.MenuDevCommandsBuilder; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; +import org.kie.workbench.common.stunner.client.widgets.views.session.ScreenErrorView; +import org.kie.workbench.common.stunner.client.widgets.views.session.ScreenPanelView; +import org.kie.workbench.common.stunner.core.api.DefinitionManager; +import org.kie.workbench.common.stunner.core.client.annotation.DiagramEditor; +import org.kie.workbench.common.stunner.core.client.api.SessionManager; +import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; +import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; +import org.kie.workbench.common.stunner.core.client.command.SessionCommandManager; +import org.kie.workbench.common.stunner.core.client.components.layout.LayoutHelper; +import org.kie.workbench.common.stunner.core.client.components.layout.OpenDiagramLayoutExecutor; +import org.kie.workbench.common.stunner.core.client.service.ClientFactoryService; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.kie.workbench.common.stunner.core.client.session.ClientSession; +import org.kie.workbench.common.stunner.core.client.session.Session; +import org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.event.OnSessionErrorEvent; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.diagram.MetadataImpl; +import org.kie.workbench.common.stunner.core.documentation.DocumentationPage; +import org.kie.workbench.common.stunner.core.documentation.DocumentationView; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.rule.RuleViolation; +import org.kie.workbench.common.stunner.core.util.UUID; +import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; +import org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent; +import org.kie.workbench.common.stunner.kogito.client.docks.DiagramEditorPropertiesDock; +import org.kie.workbench.common.widgets.client.search.component.SearchBarComponent; +import org.kie.workbench.common.widgets.metadata.client.KieEditorWrapperView; +import org.uberfire.client.annotations.WorkbenchContextId; +import org.uberfire.client.annotations.WorkbenchMenu; +import org.uberfire.client.annotations.WorkbenchPartTitle; +import org.uberfire.client.annotations.WorkbenchPartView; +import org.uberfire.client.annotations.WorkbenchScreen; +import org.uberfire.client.views.pfly.multipage.MultiPageEditorSelectedPageEvent; +import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; +import org.uberfire.ext.widgets.common.client.common.BusyPopup; +import org.uberfire.lifecycle.OnClose; +import org.uberfire.lifecycle.OnFocus; +import org.uberfire.lifecycle.OnStartup; +import org.uberfire.mvp.Command; +import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.model.menu.MenuFactory; +import org.uberfire.workbench.model.menu.MenuItem; +import org.uberfire.workbench.model.menu.Menus; + +@Dependent +@DiagramEditor +@WorkbenchScreen(identifier = DMNDiagramEditor.EDITOR_ID) +public class DMNDiagramEditor implements KieEditorWrapperView.KieEditorWrapperPresenter { + + public static final String EDITOR_ID = "DMNDiagramEditor"; + + //Editor tabs: [0] Main editor, [1] Documentation, [2] Data-Types, [3] Imported Models + public static final int DATA_TYPES_PAGE_INDEX = 2; + + private static Logger LOGGER = Logger.getLogger(DMNDiagramEditor.class.getName()); + + private final SessionManager sessionManager; + private final SessionCommandManager sessionCommandManager; + private final SessionEditorPresenter presenter; + private final Event refreshFormPropertiesEvent; + private final Event changeTitleNotificationEvent; + private final Event sessionFocusedEvent; + + private final DecisionNavigatorDock decisionNavigatorDock; + private final DiagramEditorPropertiesDock diagramPropertiesDock; + private final PreviewDiagramDock diagramPreviewAndExplorerDock; + + private final LayoutHelper layoutHelper; + private final OpenDiagramLayoutExecutor layoutExecutor; + + private final DataTypesPage dataTypesPage; + private final IncludedModelsPage includedModelsPage; + private final IncludedModelsPageStateProviderImpl importsPageProvider; + private final DocumentationView documentationView; + private final DMNEditorSearchIndex editorSearchIndex; + private final SearchBarComponent searchBarComponent; + + private final DefinitionManager definitionManager; + private final ClientFactoryService clientFactoryServices; + private final DMNShowcaseDiagramService diagramService; + private final MenuDevCommandsBuilder menuDevCommandsBuilder; + private final ScreenPanelView screenPanelView; + private final ScreenErrorView screenErrorView; + private final KieEditorWrapperView kieView; + + private PlaceRequest placeRequest; + private String title = "Authoring Screen"; + private Menus menu = null; + + @Inject + public DMNDiagramEditor(final SessionManager sessionManager, + final @Session SessionCommandManager sessionCommandManager, + final SessionEditorPresenter presenter, + final Event refreshFormPropertiesEvent, + final Event changeTitleNotificationEvent, + final Event sessionFocusedEvent, + final DecisionNavigatorDock decisionNavigatorDock, + final DiagramEditorPropertiesDock diagramPropertiesDock, + final PreviewDiagramDock diagramPreviewAndExplorerDock, + final LayoutHelper layoutHelper, + final OpenDiagramLayoutExecutor layoutExecutor, + final DataTypesPage dataTypesPage, + final IncludedModelsPage includedModelsPage, + final IncludedModelsPageStateProviderImpl importsPageProvider, + final @DMNEditor DocumentationView documentationView, + final DMNEditorSearchIndex editorSearchIndex, + final SearchBarComponent searchBarComponent, + final DefinitionManager definitionManager, + final ClientFactoryService clientFactoryServices, + final DMNShowcaseDiagramService diagramService, + final MenuDevCommandsBuilder menuDevCommandsBuilder, + final ScreenPanelView screenPanelView, + final ScreenErrorView screenErrorView, + final KieEditorWrapperView kieView) { + this.sessionManager = sessionManager; + this.sessionCommandManager = sessionCommandManager; + this.presenter = presenter; + this.refreshFormPropertiesEvent = refreshFormPropertiesEvent; + this.changeTitleNotificationEvent = changeTitleNotificationEvent; + this.sessionFocusedEvent = sessionFocusedEvent; + + this.decisionNavigatorDock = decisionNavigatorDock; + this.diagramPropertiesDock = diagramPropertiesDock; + this.diagramPreviewAndExplorerDock = diagramPreviewAndExplorerDock; + + this.layoutHelper = layoutHelper; + this.layoutExecutor = layoutExecutor; + + this.dataTypesPage = dataTypesPage; + this.includedModelsPage = includedModelsPage; + this.importsPageProvider = importsPageProvider; + this.documentationView = documentationView; + this.editorSearchIndex = editorSearchIndex; + this.searchBarComponent = searchBarComponent; + + this.definitionManager = definitionManager; + this.clientFactoryServices = clientFactoryServices; + this.diagramService = diagramService; + this.menuDevCommandsBuilder = menuDevCommandsBuilder; + this.screenPanelView = screenPanelView; + this.screenErrorView = screenErrorView; + this.kieView = kieView; + } + + @PostConstruct + public void init() { + decisionNavigatorDock.init(AuthoringPerspective.PERSPECTIVE_ID); + diagramPropertiesDock.init(AuthoringPerspective.PERSPECTIVE_ID); + diagramPreviewAndExplorerDock.init(AuthoringPerspective.PERSPECTIVE_ID); + + kieView.setPresenter(this); + kieView.clear(); + kieView.addMainEditorPage(screenPanelView.asWidget()); + kieView.getMultiPage().addPage(getDocumentationPage()); + kieView.getMultiPage().addPage(dataTypesPage); + kieView.getMultiPage().addPage(includedModelsPage); + + setupEditorSearchIndex(); + setupSearchComponent(); + } + + private void setupEditorSearchIndex() { + editorSearchIndex.setCurrentAssetHashcodeSupplier(getHashcodeSupplier()); + editorSearchIndex.setIsDataTypesTabActiveSupplier(getIsDataTypesTabActiveSupplier()); + } + + Supplier getHashcodeSupplier() { + return () -> getDiagram().hashCode(); + } + + Supplier getIsDataTypesTabActiveSupplier() { + return () -> { + final int selectedPageIndex = kieView.getMultiPage().selectedPage(); + return selectedPageIndex == DATA_TYPES_PAGE_INDEX; + }; + } + + void setupSearchComponent() { + final HTMLElement element = searchBarComponent.getView().getElement(); + + searchBarComponent.init(editorSearchIndex); + kieView.getMultiPage().addTabBarWidget(getWidget(element)); + } + + DocumentationPage getDocumentationPage() { + return new DocumentationPage(documentationView, "Documentation", () -> { /* Nothing. */ }, () -> true); + } + + public void onDataTypePageNavTabActiveEvent(final @Observes DataTypePageTabActiveEvent event) { + kieView.getMultiPage().selectPage(DATA_TYPES_PAGE_INDEX); + } + + @OnStartup + public void onStartup(final PlaceRequest placeRequest) { + this.placeRequest = placeRequest; + this.menu = makeMenuBar(); + final String name = placeRequest.getParameter("name", + ""); + final boolean isCreate = name == null || name.trim().length() == 0; + final Command callback = getOnStartupDiagramEditorCallback(); + if (isCreate) { + final String defSetId = placeRequest.getParameter("defSetId", + ""); + final String shapeSetd = placeRequest.getParameter("shapeSetId", + ""); + final String title = placeRequest.getParameter("title", + ""); + // Create a new diagram. + newDiagram(UUID.uuid(), + title, + defSetId, + shapeSetd, + callback); + } else { + // Load an existing diagram. + load(name, + callback); + } + } + + Command getOnStartupDiagramEditorCallback() { + return () -> { + + final Diagram diagram = getDiagram(); + + if (null != diagram) { + updateTitle(diagram.getMetadata().getTitle()); + documentationView.initialize(diagram); + } + }; + } + + public void onDataTypeEditModeToggle(final @Observes DataTypeEditModeToggleEvent editModeToggleEvent) { + + if (editModeToggleEvent.isEditModeEnabled()) { + disableSaveMenuItem(); + } else { + enableSaveMenuItem(); + } + } + + private void disableSaveMenuItem() { + getSaveMenuItem(saveMenuItem -> saveMenuItem.setEnabled(false)); + } + + private void enableSaveMenuItem() { + getSaveMenuItem(saveMenuItem -> saveMenuItem.setEnabled(true)); + } + + private void getSaveMenuItem(final Consumer saveMenuItemConsumer) { + getMenu(menus -> saveMenuItemConsumer.accept(menus.getItems().get(0))); + } + + private Menus makeMenuBar() { + final MenuFactory.TopLevelMenusBuilder m = + MenuFactory + .newTopLevelMenu("Save") + .respondsWith(getSaveCommand()) + .endMenu(); + m.newTopLevelMenu(menuDevCommandsBuilder.build()).endMenu(); + return m.build(); + } + + private Command getSaveCommand() { + return this::validateAndSave; + } + + private void validateAndSave() { + final Command save = this::save; + final DMNEditorToolbar toolbar = (DMNEditorToolbar) presenter.getToolbar(); + toolbar + .getValidateCommand() + .execute(new ClientSessionCommand.Callback>>() { + @Override + public void onSuccess() { + save.execute(); + } + + @Override + public void onError(final Collection> violations) { + save.execute(); + } + }); + } + + private void save() { + diagramService.save(getSession(), + new ServiceCallback>() { + @Override + public void onSuccess(Diagram item) { + log(Level.INFO, "Save operation finished for diagram [" + item.getName() + "]."); + } + + @Override + public void onError(ClientRuntimeError error) { + showError(error); + } + }); + } + + private void newDiagram(final String uuid, + final String title, + final String definitionSetId, + final String shapeSetId, + final Command callback) { + BusyPopup.showMessage("Loading"); + final Metadata metadata = buildMetadata(definitionSetId, + shapeSetId, + title); + clientFactoryServices.newDiagram(uuid, + definitionSetId, + metadata, + new ServiceCallback() { + @Override + public void onSuccess(final Diagram diagram) { + final Metadata metadata = diagram.getMetadata(); + metadata.setShapeSetId(shapeSetId); + metadata.setTitle(title); + open(diagram, + callback); + } + + @Override + public void onError(final ClientRuntimeError error) { + showError(error); + callback.execute(); + } + }); + } + + private Metadata buildMetadata(final String defSetId, + final String shapeSetId, + final String title) { + return new MetadataImpl.MetadataImplBuilder(defSetId, + definitionManager) + .setTitle(title) + .setShapeSetId(shapeSetId) + .build(); + } + + public void onMultiPageEditorSelectedPageEvent(final @Observes MultiPageEditorSelectedPageEvent event) { + searchBarComponent.disableSearch(); + } + + public void onRefreshFormPropertiesEvent(final @Observes RefreshFormPropertiesEvent event) { + searchBarComponent.disableSearch(); + } + + private void load(final String name, + final Command callback) { + BusyPopup.showMessage("Loading"); + diagramService.loadByName(name, + new ServiceCallback() { + @Override + public void onSuccess(final Diagram diagram) { + open(diagram, + callback); + } + + @Override + public void onError(final ClientRuntimeError error) { + showError(error); + callback.execute(); + } + }); + } + + void open(final Diagram diagram, + final Command callback) { + screenPanelView.setWidget(presenter.getView()); + layoutHelper.applyLayout(diagram, layoutExecutor); + presenter + .withToolbar(true) + .withPalette(true) + .displayNotifications(type -> true) + .open(diagram, + new ScreenPresenterCallback(() -> { + final ToolbarStateHandler toolbarStateHandler = new DMNStandaloneToolbarStateHandler((DMNEditorToolbar) presenter.getToolbar()); + final ExpressionEditorView.Presenter expressionEditor = ((DMNSession) sessionManager.getCurrentSession()).getExpressionEditor(); + expressionEditor.setToolbarStateHandler(toolbarStateHandler); + dataTypesPage.reload(); + dataTypesPage.enableShortcuts(); + includedModelsPage.setup(importsPageProvider.withDiagram(diagram)); + setupCanvasHandler(presenter.getInstance()); + openDock(); + callback.execute(); + })); + } + + @OnFocus + public void onFocus() { + final EditorSession session = presenter.getInstance(); + log(Level.INFO, "FOCUS [" + session + "]"); + if (null != session) { + sessionFocusedEvent.fire(new SessionFocusedEvent(session)); + } + } + + private boolean isSameSession(final ClientSession other) { + return null != other && null != getSession() && other.equals(getSession()); + } + + @OnClose + public void onClose() { + destroyDock(); + destroySession(); + dataTypesPage.disableShortcuts(); + } + + void setupCanvasHandler(final EditorSession session) { + decisionNavigatorDock.setupCanvasHandler(session.getCanvasHandler()); + } + + void openDock() { + decisionNavigatorDock.open(); + diagramPropertiesDock.open(); + diagramPreviewAndExplorerDock.open(); + } + + void destroyDock() { + decisionNavigatorDock.close(); + decisionNavigatorDock.resetContent(); + diagramPropertiesDock.close(); + diagramPreviewAndExplorerDock.close(); + } + + void destroySession() { + presenter.destroy(); + } + + @WorkbenchMenu + public void getMenu(final Consumer menusConsumer) { + menusConsumer.accept(menu); + } + + @WorkbenchPartTitle + public String getTitle() { + return title; + } + + @WorkbenchPartView + public IsWidget getWidget() { + return kieView.asWidget(); + } + + @WorkbenchContextId + public String getMyContextRef() { + return "sessionDiagramEditorScreenContext"; + } + + @Override + public void onSourceTabSelected() { + + } + + @Override + public void onEditTabSelected() { + + } + + @Override + public void onEditTabUnselected() { + + } + + @Override + public void onOverviewSelected() { + + } + + void updateTitle(final String title) { + // Change screen title. + DMNDiagramEditor.this.title = title; + changeTitleNotificationEvent.fire(new ChangeTitleWidgetEvent(placeRequest, + this.title)); + } + + private EditorSession getSession() { + return null != presenter ? presenter.getInstance() : null; + } + + private CanvasHandler getCanvasHandler() { + return null != getSession() ? getSession().getCanvasHandler() : null; + } + + Diagram getDiagram() { + return null != getCanvasHandler() ? getCanvasHandler().getDiagram() : null; + } + + private void showError(final ClientRuntimeError error) { + screenErrorView.showError(error); + screenPanelView.setWidget(screenErrorView.asWidget()); + log(Level.SEVERE, + error.toString()); + BusyPopup.close(); + } + + private void onSessionErrorEvent(@Observes OnSessionErrorEvent errorEvent) { + if (isSameSession(errorEvent.getSession())) { + showError(errorEvent.getError()); + } + } + + void onEditExpressionEvent(final @Observes EditExpressionEvent event) { + searchBarComponent.disableSearch(); + if (isSameSession(event.getSession())) { + final DMNSession session = sessionManager.getCurrentSession(); + final ExpressionEditorView.Presenter expressionEditor = session.getExpressionEditor(); + sessionCommandManager.execute(session.getCanvasHandler(), + new NavigateToExpressionEditorCommand(expressionEditor, + presenter, + sessionManager, + sessionCommandManager, + refreshFormPropertiesEvent, + event.getNodeUUID(), + event.getHasExpression(), + event.getHasName(), + event.isOnlyVisualChangeAllowed())); + } + } + + private void log(final Level level, + final String message) { + if (LogConfiguration.loggingIsEnabled()) { + LOGGER.log(level, + message); + } + } + + ElementWrapperWidget getWidget(final HTMLElement element) { + return ElementWrapperWidget.getWidget(element); + } + + private final class ScreenPresenterCallback implements SessionPresenter.SessionPresenterCallback { + + private final Command callback; + + private ScreenPresenterCallback(final Command callback) { + this.callback = callback; + } + + @Override + public void afterSessionOpened() { + + } + + @Override + public void afterCanvasInitialized() { + + } + + @Override + public void onSuccess() { + BusyPopup.close(); + callback.execute(); + } + + @Override + public void onError(final ClientRuntimeError error) { + showError(error); + callback.execute(); + } + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNStandaloneToolbarStateHandler.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNStandaloneToolbarStateHandler.java new file mode 100644 index 00000000000..d929d1f5611 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNStandaloneToolbarStateHandler.java @@ -0,0 +1,135 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.showcase.client.editor; + +import org.kie.workbench.common.dmn.client.editors.toolbar.ToolbarStateHandler; +import org.kie.workbench.common.dmn.client.widgets.toolbar.DMNEditorToolbar; +import org.kie.workbench.common.stunner.client.widgets.toolbar.ToolbarCommand; + +public class DMNStandaloneToolbarStateHandler implements ToolbarStateHandler { + + private DMNEditorToolbar toolbar; + + private boolean visitGraphToolbarCommandEnabled = false; + private boolean clearToolbarCommandEnabled = false; + private boolean deleteSelectionToolbarCommandEnabled = false; + private boolean switchGridToolbarCommandEnabled = false; + private boolean undoToolbarCommandEnabled = false; + private boolean redoToolbarCommandEnabled = false; + private boolean exportToPngToolbarCommandEnabled = false; + private boolean exportToJpgToolbarCommandEnabled = false; + private boolean exportToPdfToolbarCommandEnabled = false; + private boolean copyCommandEnabled = false; + private boolean cutCommandEnabled = false; + private boolean pasteCommandEnabled = false; + private boolean saveCommandEnabled = false; + private boolean automaticLayoutCommandEnabled = false; + + public DMNStandaloneToolbarStateHandler(final DMNEditorToolbar toolbar) { + this.toolbar = toolbar; + } + + @Override + @SuppressWarnings("unchecked") + public void enterGridView() { + this.visitGraphToolbarCommandEnabled = toolbar.isEnabled((ToolbarCommand) toolbar.getVisitGraphToolbarCommand()); + this.clearToolbarCommandEnabled = toolbar.isEnabled(toolbar.getClearToolbarCommand()); + this.deleteSelectionToolbarCommandEnabled = toolbar.isEnabled(toolbar.getDeleteSelectionToolbarCommand()); + this.switchGridToolbarCommandEnabled = toolbar.isEnabled(toolbar.getSwitchGridToolbarCommand()); + this.undoToolbarCommandEnabled = toolbar.isEnabled(toolbar.getUndoToolbarCommand()); + this.redoToolbarCommandEnabled = toolbar.isEnabled(toolbar.getRedoToolbarCommand()); + this.exportToPngToolbarCommandEnabled = toolbar.isEnabled((ToolbarCommand) toolbar.getExportToPngToolbarCommand()); + this.exportToJpgToolbarCommandEnabled = toolbar.isEnabled((ToolbarCommand) toolbar.getExportToJpgToolbarCommand()); + this.exportToPdfToolbarCommandEnabled = toolbar.isEnabled((ToolbarCommand) toolbar.getExportToPdfToolbarCommand()); + this.copyCommandEnabled = toolbar.isEnabled(toolbar.getCopyToolbarCommand()); + this.cutCommandEnabled = toolbar.isEnabled(toolbar.getCutToolbarCommand()); + this.pasteCommandEnabled = toolbar.isEnabled(toolbar.getPasteToolbarCommand()); + this.saveCommandEnabled = toolbar.isEnabled(toolbar.getSaveToolbarCommand()); + this.automaticLayoutCommandEnabled = toolbar.isEnabled(toolbar.getPerformAutomaticLayoutToolbarCommand()); + + enableToolbarCommand(toolbar.getVisitGraphToolbarCommand(), + false); + enableToolbarCommand(toolbar.getClearToolbarCommand(), + false); + enableToolbarCommand(toolbar.getDeleteSelectionToolbarCommand(), + false); + enableToolbarCommand(toolbar.getSwitchGridToolbarCommand(), + false); + enableToolbarCommand(toolbar.getUndoToolbarCommand(), + false); + enableToolbarCommand(toolbar.getRedoToolbarCommand(), + false); + enableToolbarCommand(toolbar.getExportToPngToolbarCommand(), + false); + enableToolbarCommand(toolbar.getExportToJpgToolbarCommand(), + false); + enableToolbarCommand(toolbar.getExportToPdfToolbarCommand(), + false); + enableToolbarCommand(toolbar.getCopyToolbarCommand(), + false); + enableToolbarCommand(toolbar.getCutToolbarCommand(), + false); + enableToolbarCommand(toolbar.getPasteToolbarCommand(), + false); + enableToolbarCommand(toolbar.getSaveToolbarCommand(), + false); + enableToolbarCommand(toolbar.getPerformAutomaticLayoutToolbarCommand(), + false); + } + + @Override + public void enterGraphView() { + enableToolbarCommand(toolbar.getVisitGraphToolbarCommand(), + visitGraphToolbarCommandEnabled); + enableToolbarCommand(toolbar.getClearToolbarCommand(), + clearToolbarCommandEnabled); + enableToolbarCommand(toolbar.getDeleteSelectionToolbarCommand(), + deleteSelectionToolbarCommandEnabled); + enableToolbarCommand(toolbar.getSwitchGridToolbarCommand(), + switchGridToolbarCommandEnabled); + enableToolbarCommand(toolbar.getUndoToolbarCommand(), + undoToolbarCommandEnabled); + enableToolbarCommand(toolbar.getRedoToolbarCommand(), + redoToolbarCommandEnabled); + enableToolbarCommand(toolbar.getExportToPngToolbarCommand(), + exportToPngToolbarCommandEnabled); + enableToolbarCommand(toolbar.getExportToJpgToolbarCommand(), + exportToJpgToolbarCommandEnabled); + enableToolbarCommand(toolbar.getExportToPdfToolbarCommand(), + exportToPdfToolbarCommandEnabled); + enableToolbarCommand(toolbar.getCopyToolbarCommand(), + copyCommandEnabled); + enableToolbarCommand(toolbar.getCutToolbarCommand(), + cutCommandEnabled); + enableToolbarCommand(toolbar.getPasteToolbarCommand(), + pasteCommandEnabled); + enableToolbarCommand(toolbar.getSaveToolbarCommand(), + saveCommandEnabled); + enableToolbarCommand(toolbar.getPerformAutomaticLayoutToolbarCommand(), + automaticLayoutCommandEnabled); + } + + @SuppressWarnings("unchecked") + private void enableToolbarCommand(final ToolbarCommand command, + final boolean enabled) { + if (enabled) { + toolbar.enable(command); + } else { + toolbar.disable(command); + } + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/navbar/AppNavBar.html b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/navbar/AppNavBar.html similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/navbar/AppNavBar.html rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/navbar/AppNavBar.html diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/navbar/AppNavBar.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/navbar/AppNavBar.java similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/navbar/AppNavBar.java rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/navbar/AppNavBar.java diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNDiagramsNavigatorScreen.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNDiagramsNavigatorScreen.java new file mode 100644 index 00000000000..4addb0a4cc1 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNDiagramsNavigatorScreen.java @@ -0,0 +1,131 @@ +/* + * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.navigator; + +import java.util.Map; +import java.util.Objects; +import java.util.function.Consumer; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.Dependent; +import javax.enterprise.event.Observes; +import javax.inject.Inject; + +import com.google.gwt.user.client.ui.IsWidget; +import org.kie.soup.commons.util.Maps; +import org.kie.workbench.common.dmn.showcase.client.editor.DMNDiagramEditor; +import org.kie.workbench.common.dmn.webapp.common.client.navigator.BaseDMNDiagramsNavigatorScreen; +import org.kie.workbench.common.stunner.client.widgets.event.LoadDiagramEvent; +import org.kie.workbench.common.stunner.client.widgets.explorer.navigator.diagrams.DiagramsNavigator; +import org.kie.workbench.common.stunner.client.widgets.menu.dev.ShapeSetsMenuItemsBuilder; +import org.kie.workbench.common.stunner.core.client.ShapeSet; +import org.uberfire.client.annotations.WorkbenchMenu; +import org.uberfire.client.annotations.WorkbenchPartTitle; +import org.uberfire.client.annotations.WorkbenchPartView; +import org.uberfire.client.annotations.WorkbenchScreen; +import org.uberfire.client.mvp.PlaceManager; +import org.uberfire.lifecycle.OnClose; +import org.uberfire.lifecycle.OnStartup; +import org.uberfire.mvp.PlaceRequest; +import org.uberfire.mvp.impl.DefaultPlaceRequest; +import org.uberfire.workbench.model.menu.Menus; + +@Dependent +@WorkbenchScreen(identifier = DMNDiagramsNavigatorScreen.SCREEN_ID) +public class DMNDiagramsNavigatorScreen extends BaseDMNDiagramsNavigatorScreen { + + private PlaceManager placeManager; + + public DMNDiagramsNavigatorScreen() { + //CDI proxy + } + + @Inject + public DMNDiagramsNavigatorScreen(final DiagramsNavigator diagramsNavigator, + final ShapeSetsMenuItemsBuilder newDiagramMenuItemsBuilder, + final PlaceManager placeManager) { + super(diagramsNavigator, + newDiagramMenuItemsBuilder); + this.placeManager = placeManager; + } + + @Override + @PostConstruct + public void init() { + super.init(); + } + + @Override + @OnStartup + @SuppressWarnings("unused") + public void onStartup(final PlaceRequest placeRequest) { + super.onStartup(placeRequest); + } + + @Override + public void edit() { + if (Objects.nonNull(selectedDiagramEvent)) { + final Maps.Builder builder = new Maps.Builder<>(); + builder.put("name", selectedDiagramEvent.getName()); + launchEditor(builder.build()); + } + } + + @Override + public void create(final ShapeSet shapeSet) { + final String shapeSetName = shapeSet.getDescription(); + final String defSetId = shapeSet.getDefinitionSetId(); + final Maps.Builder builder = new Maps.Builder<>(); + builder.put("defSetId", defSetId); + builder.put("shapeSetId", shapeSet.getId()); + builder.put("title", "New " + shapeSetName + " diagram"); + launchEditor(builder.build()); + } + + private void launchEditor(final Map params) { + final PlaceRequest diagramScreenPlaceRequest = new DefaultPlaceRequest(DMNDiagramEditor.EDITOR_ID, params); + placeManager.goTo(diagramScreenPlaceRequest); + } + + @Override + @OnClose + public void onClose() { + super.onClose(); + } + + @Override + @WorkbenchMenu + public void getMenus(final Consumer menusConsumer) { + super.getMenus(menusConsumer); + } + + @Override + @WorkbenchPartTitle + public String getTitle() { + return super.getTitle(); + } + + @Override + @WorkbenchPartView + public IsWidget getWidget() { + return super.getWidget(); + } + + @Override + public void onLoadDiagramEvent(final @Observes LoadDiagramEvent loadDiagramEvent) { + super.onLoadDiagramEvent(loadDiagramEvent); + } +} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNShapeSetThumbProvider.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNShapeSetThumbProvider.java new file mode 100644 index 00000000000..60faef31201 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/navigator/DMNShapeSetThumbProvider.java @@ -0,0 +1,41 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.navigator; + +import javax.enterprise.context.ApplicationScoped; + +import com.google.gwt.safehtml.shared.SafeUri; +import com.google.gwt.safehtml.shared.UriUtils; +import org.kie.workbench.common.stunner.core.client.ShapeSetThumbProvider; + +@ApplicationScoped +public class DMNShapeSetThumbProvider implements ShapeSetThumbProvider { + + @Override + public SafeUri getThumbnailUri() { + return UriUtils.fromSafeConstant("/images/default-diagram-thumbnail.png"); + } + + @Override + public Class getSourceType() { + return String.class; + } + + @Override + public boolean thumbFor(final String definitionSetId) { + return true; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/notifications/Notifications.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/notifications/Notifications.java new file mode 100644 index 00000000000..dce5f11f021 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/notifications/Notifications.java @@ -0,0 +1,183 @@ +/* + * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.notifications; + +import java.util.List; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import com.google.gwt.cell.client.Cell; +import com.google.gwt.cell.client.TextCell; +import com.google.gwt.user.cellview.client.Column; +import com.google.gwt.user.cellview.client.ColumnSortEvent; +import com.google.gwt.user.client.ui.IsWidget; +import com.google.gwt.user.client.ui.Widget; +import com.google.gwt.view.client.HasData; +import com.google.gwt.view.client.ListDataProvider; +import org.kie.workbench.common.stunner.client.widgets.notification.Notification; +import org.kie.workbench.common.stunner.client.widgets.notification.NotificationsObserver; +import org.uberfire.client.mvp.UberView; + +@Dependent +public class Notifications implements IsWidget { + + public interface View extends UberView { + + View setColumnSortHandler(final ColumnSortEvent.ListHandler sortHandler); + + View addColumn(final Column column, + final String name); + + View removeColumn(final int index); + + int getColumnCount(); + + View redraw(); + + View clear(); + } + + private final View view; + private final NotificationsObserver notificationsObserver; + + final ListDataProvider logsProvider = new ListDataProvider<>(); + + @Inject + public Notifications(final View view, + final NotificationsObserver notificationsObserver) { + this.view = view; + this.notificationsObserver = notificationsObserver; + } + + @PostConstruct + public void init() { + view.init(this); + notificationsObserver.onNotification(this::add); + notificationsObserver.onValidationFailed(this::add); + buildViewColumns(); + } + + @Override + public Widget asWidget() { + return view.asWidget(); + } + + public void add(final Notification notification) { + if (null != notification) { + addLogEntry(notification); + view.redraw(); + } + } + + public void clear() { + logsProvider.getList().clear(); + view.clear(); + } + + public void addDataDisplay(final HasData display) { + logsProvider.addDataDisplay(display); + } + + protected void buildViewColumns() { + //Remove existing columns should this be called again.. + int columnCount = view.getColumnCount(); + while (columnCount > 0) { + view.removeColumn(0); + columnCount = view.getColumnCount(); + } + + // Attach a column sort handler to the ListDataProvider to sort the list. + final ColumnSortEvent.ListHandler sortHandler = new ColumnSortEvent.ListHandler<>(logsProvider.getList()); + view.setColumnSortHandler(sortHandler); + + // Log's type. + view.addColumn(createTypeColumn(sortHandler), + "Type"); + + // Log element's UUID. + view.addColumn(createContextColumn(), + "Context"); + + // Log's message. + view.addColumn(createMessageColumn(), + "Message"); + } + + private void addLogEntry(final Notification entry) { + List logs = logsProvider.getList(); + logs.remove(entry); + logs.add(entry); + } + + private Column createTypeColumn(final ColumnSortEvent.ListHandler sortHandler) { + final Cell typeCell = new TextCell(); + final Column typeColumn = new Column(typeCell) { + @Override + public String getValue(final Notification object) { + return getNotificationTypeMessage(object); + } + }; + typeColumn.setSortable(true); + sortHandler.setComparator(typeColumn, + (o1, o2) -> o1.getType().compareTo(o2.getType())); + return typeColumn; + } + + private Column createContextColumn() { + final Cell contextCell = new TextCell(); + final Column contextColumn = new Column(contextCell) { + @Override + public String getValue(final Notification object) { + return getNotificationContextMessage(object); + } + }; + contextColumn.setSortable(false); + return contextColumn; + } + + private com.google.gwt.user.cellview.client.Column createMessageColumn() { + final Cell messageCell = new TextCell(); + final Column messageColumn = new Column(messageCell) { + @Override + public String getValue(final Notification object) { + return getNotificationMessage(object); + } + }; + messageColumn.setSortable(false); + return messageColumn; + } + + @SuppressWarnings("unchecked") + private String getNotificationMessage(final Notification notification) { + return notification.getMessage(); + } + + @SuppressWarnings("unchecked") + private String getNotificationContextMessage(final Notification notification) { + return notification.getContext() != null ? + notification.getContext().toString() : + "-- No context --"; + } + + @SuppressWarnings("unchecked") + private String getNotificationTypeMessage(final Notification notification) { + return notification.getType() != null ? + notification.getType().name() : + "-- No type --"; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/notifications/NotificationsScreen.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/notifications/NotificationsScreen.java new file mode 100644 index 00000000000..2b20dd8f3c8 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/notifications/NotificationsScreen.java @@ -0,0 +1,81 @@ +/* + * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.notifications; + +import java.util.function.Consumer; + +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import com.google.gwt.user.client.ui.IsWidget; +import org.uberfire.client.annotations.WorkbenchMenu; +import org.uberfire.client.annotations.WorkbenchPartTitle; +import org.uberfire.client.annotations.WorkbenchPartView; +import org.uberfire.client.annotations.WorkbenchScreen; +import org.uberfire.lifecycle.OnStartup; +import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.model.menu.MenuFactory; +import org.uberfire.workbench.model.menu.Menus; + +@Dependent +@WorkbenchScreen(identifier = NotificationsScreen.SCREEN_ID) +public class NotificationsScreen { + + public static final String SCREEN_ID = "NotificationsScreen"; + public static final String TITLE = "Notifications"; + + private Notifications notifications; + + private Menus menu = null; + + public NotificationsScreen() { + //CDI proxy + } + + @Inject + public NotificationsScreen(final Notifications notifications) { + this.notifications = notifications; + } + + @OnStartup + @SuppressWarnings("unused") + public void onStartup(final PlaceRequest placeRequest) { + this.menu = makeMenuBar(); + } + + private Menus makeMenuBar() { + return MenuFactory + .newTopLevelMenu("Clear") + .respondsWith(() -> notifications.clear()) + .endMenu() + .build(); + } + + @WorkbenchMenu + public void getMenus(final Consumer menusConsumer) { + menusConsumer.accept(menu); + } + + @WorkbenchPartTitle + public String getTitle() { + return TITLE; + } + + @WorkbenchPartView + public IsWidget getWidget() { + return notifications.asWidget(); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/notifications/NotificationsView.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/notifications/NotificationsView.java new file mode 100644 index 00000000000..01fb99f665a --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/notifications/NotificationsView.java @@ -0,0 +1,121 @@ +/* + * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.notifications; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.dom.client.Style; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.uibinder.client.UiField; +import com.google.gwt.user.cellview.client.Column; +import com.google.gwt.user.cellview.client.ColumnSortEvent; +import com.google.gwt.user.cellview.client.SimplePager; +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.Widget; +import com.google.gwt.view.client.ProvidesKey; +import org.gwtbootstrap3.client.ui.Row; +import org.gwtbootstrap3.client.ui.gwt.CellTable; +import org.kie.workbench.common.stunner.client.widgets.notification.Notification; + +public class NotificationsView extends Composite implements Notifications.View { + + interface ViewBinder extends UiBinder { + + } + + private static ProvidesKey KEY_PROVIDER = item -> item == null ? null : item.hashCode(); + + private static ViewBinder uiBinder = GWT.create(ViewBinder.class); + + @UiField + Row logsRow; + + @UiField(provided = true) + CellTable logsGrid; + + @UiField(provided = true) + SimplePager logsGridPager; + + Notifications presenter; + + @Override + public void init(final Notifications presenter) { + this.presenter = presenter; + initGrid(); + initWidget(uiBinder.createAndBindUi(this)); + } + + private void initGrid() { + // Init the logs grid. + logsGrid = new CellTable<>(KEY_PROVIDER); + logsGrid.setWidth("100%", + true); + + // Do not refresh the headers and footers every time the data is updated. + logsGrid.setAutoHeaderRefreshDisabled(true); + logsGrid.setAutoFooterRefreshDisabled(true); + + // Create a Pager to control the table. + final SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class); + logsGridPager = new SimplePager(SimplePager.TextLocation.CENTER, + pagerResources, + false, + 0, + true); + + logsGridPager.setDisplay(logsGrid); + presenter.addDataDisplay(logsGrid); + } + + @Override + public Notifications.View setColumnSortHandler(final ColumnSortEvent.ListHandler sortHandler) { + logsGrid.addColumnSortHandler(sortHandler); + return this; + } + + @Override + @SuppressWarnings("unchecked") + public Notifications.View addColumn(final Column column, + final String name) { + logsGrid.addColumn(column, + name); + logsGrid.setColumnWidth(column, + 5, + Style.Unit.PCT); + return this; + } + + @Override + public Notifications.View removeColumn(final int index) { + logsGrid.removeColumn(index); + return this; + } + + @Override + public int getColumnCount() { + return logsGrid.getColumnCount(); + } + + @Override + public Notifications.View redraw() { + logsGrid.redraw(); + return this; + } + + @Override + public Notifications.View clear() { + return this; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/notifications/NotificationsView.ui.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/notifications/NotificationsView.ui.xml similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/notifications/NotificationsView.ui.xml rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/notifications/NotificationsView.ui.xml diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/perspectives/AuthoringPerspective.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/perspectives/AuthoringPerspective.java new file mode 100644 index 00000000000..738416a7df5 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/perspectives/AuthoringPerspective.java @@ -0,0 +1,55 @@ +/* + * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.perspectives; + +import javax.enterprise.context.ApplicationScoped; + +import org.kie.workbench.common.dmn.showcase.client.navigator.DMNDiagramsNavigatorScreen; +import org.kie.workbench.common.dmn.showcase.client.notifications.NotificationsScreen; +import org.uberfire.client.annotations.Perspective; +import org.uberfire.client.annotations.WorkbenchPerspective; +import org.uberfire.client.workbench.panels.impl.MultiListWorkbenchPanelPresenter; +import org.uberfire.mvp.impl.DefaultPlaceRequest; +import org.uberfire.workbench.model.CompassPosition; +import org.uberfire.workbench.model.PanelDefinition; +import org.uberfire.workbench.model.PerspectiveDefinition; +import org.uberfire.workbench.model.impl.PanelDefinitionImpl; +import org.uberfire.workbench.model.impl.PartDefinitionImpl; +import org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl; + +@ApplicationScoped +@WorkbenchPerspective(identifier = AuthoringPerspective.PERSPECTIVE_ID, isDefault = true) +public class AuthoringPerspective { + + public static final String PERSPECTIVE_ID = "AuthoringPerspective"; + + @Perspective + public PerspectiveDefinition buildPerspective() { + final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); + perspective.setName("Authoring"); + perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest(DMNDiagramsNavigatorScreen.SCREEN_ID))); + + final PanelDefinition notificationsPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); + notificationsPanel.setWidth(400); + notificationsPanel.setHeight(100); + notificationsPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(NotificationsScreen.SCREEN_ID))); + + perspective.getRoot().insertChild(CompassPosition.SOUTH, + notificationsPanel); + + return perspective; + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/services/DMNClientServicesProxyImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/services/DMNClientServicesProxyImpl.java new file mode 100644 index 00000000000..b5a518a94d4 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/services/DMNClientServicesProxyImpl.java @@ -0,0 +1,136 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.showcase.client.services; + +import java.util.List; + +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import org.guvnor.common.services.project.client.context.WorkspaceProjectContext; +import org.guvnor.common.services.project.model.WorkspaceProject; +import org.jboss.errai.common.client.api.Caller; +import org.jboss.errai.common.client.api.ErrorCallback; +import org.jboss.errai.common.client.api.RemoteCallback; +import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; +import org.kie.workbench.common.dmn.api.editors.included.DMNIncludedModel; +import org.kie.workbench.common.dmn.api.editors.included.DMNIncludedModelsService; +import org.kie.workbench.common.dmn.api.editors.included.DMNIncludedNode; +import org.kie.workbench.common.dmn.api.editors.included.IncludedModel; +import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; +import org.kie.workbench.common.dmn.api.editors.included.PMMLIncludedModel; +import org.kie.workbench.common.dmn.api.editors.types.DMNParseService; +import org.kie.workbench.common.dmn.api.editors.types.DMNSimpleTimeZone; +import org.kie.workbench.common.dmn.api.editors.types.DMNValidationService; +import org.kie.workbench.common.dmn.api.editors.types.RangeValue; +import org.kie.workbench.common.dmn.api.editors.types.TimeZoneService; +import org.kie.workbench.common.dmn.client.service.DMNClientServicesProxy; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.uberfire.backend.vfs.Path; + +@Dependent +public class DMNClientServicesProxyImpl implements DMNClientServicesProxy { + + private final WorkspaceProjectContext projectContext; + private final Caller includedModelsService; + private final Caller parserService; + private final Caller validationService; + private final Caller timeZoneService; + + @Inject + public DMNClientServicesProxyImpl(final WorkspaceProjectContext projectContext, + final Caller includedModelsService, + final Caller parserService, + final Caller validationService, + final Caller timeZoneService) { + this.projectContext = projectContext; + this.includedModelsService = includedModelsService; + this.parserService = parserService; + this.validationService = validationService; + this.timeZoneService = timeZoneService; + } + + @Override + public void loadModels(final Path path, + final ServiceCallback> callback) { + includedModelsService.call(onSuccess(callback), onError(callback)).loadModels(path, + getWorkspaceProject()); + } + + @Override + public void loadNodesFromImports(final List includedModels, + final ServiceCallback> callback) { + includedModelsService.call(onSuccess(callback), onError(callback)).loadNodesFromImports(getWorkspaceProject(), + includedModels); + } + + @Override + public void loadPMMLDocumentsFromImports(final Path path, + final List includedModels, + final ServiceCallback> callback) { + includedModelsService.call(onSuccess(callback), onError(callback)).loadPMMLDocumentsFromImports(path, + getWorkspaceProject(), + includedModels); + } + + @Override + public void loadItemDefinitionsByNamespace(final String modelName, String namespace, + final ServiceCallback> callback) { + includedModelsService.call(onSuccess(callback), onError(callback)).loadItemDefinitionsByNamespace(getWorkspaceProject(), + modelName, + namespace); + } + + @Override + public void parseFEELList(final String source, + final ServiceCallback> callback) { + parserService.call(onSuccess(callback), onError(callback)).parseFEELList(source); + } + + @Override + public void parseRangeValue(final String source, + final ServiceCallback callback) { + parserService.call(onSuccess(callback), onError(callback)).parseRangeValue(source); + } + + @Override + public void isValidVariableName(final String source, + final ServiceCallback callback) { + validationService.call(onSuccess(callback), onError(callback)).isValidVariableName(source); + } + + @Override + public void getTimeZones(final ServiceCallback> callback) { + timeZoneService.call(onSuccess(callback), onError(callback)).getTimeZones(); + } + + RemoteCallback onSuccess(final ServiceCallback callback) { + return callback::onSuccess; + } + + ErrorCallback onError(final ServiceCallback callback) { + return (message, throwable) -> { + callback.onError(new ClientRuntimeError(throwable)); + return false; + }; + } + + private WorkspaceProject getWorkspaceProject() { + return projectContext.getActiveWorkspaceProject().orElse(null); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/services/DMNShowcaseDiagramService.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/services/DMNShowcaseDiagramService.java new file mode 100644 index 00000000000..e079e6ef456 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/services/DMNShowcaseDiagramService.java @@ -0,0 +1,116 @@ +/* + * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.services; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; +import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; +import org.kie.workbench.common.stunner.core.client.canvas.export.CanvasExport; +import org.kie.workbench.common.stunner.core.client.canvas.export.CanvasURLExportSettings; +import org.kie.workbench.common.stunner.core.client.service.ClientDiagramServiceImpl; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.lookup.LookupManager; +import org.kie.workbench.common.stunner.core.lookup.diagram.DiagramLookupRequest; +import org.kie.workbench.common.stunner.core.lookup.diagram.DiagramRepresentation; +import org.uberfire.backend.vfs.Path; + +@ApplicationScoped +public class DMNShowcaseDiagramService { + + private final ClientDiagramServiceImpl clientDiagramServices; + private final CanvasExport canvasExport; + + protected DMNShowcaseDiagramService() { + this(null, + null); + } + + @Inject + public DMNShowcaseDiagramService(final ClientDiagramServiceImpl clientDiagramServices, + final CanvasExport canvasExport) { + this.clientDiagramServices = clientDiagramServices; + this.canvasExport = canvasExport; + } + + public void loadByName(final String name, + final ServiceCallback callback) { + final DiagramLookupRequest request = new DiagramLookupRequest.Builder().withName(name).build(); + clientDiagramServices.lookup(request, + new ServiceCallback>() { + @Override + public void onSuccess(LookupManager.LookupResponse diagramRepresentations) { + if (null != diagramRepresentations && !diagramRepresentations.getResults().isEmpty()) { + final Path path = diagramRepresentations.getResults().get(0).getPath(); + loadByPath(path, + callback); + } + } + + @Override + public void onError(final ClientRuntimeError error) { + callback.onError(error); + } + }); + } + + @SuppressWarnings("unchecked") + public void loadByPath(final Path path, + final ServiceCallback callback) { + clientDiagramServices.getByPath(path, + new ServiceCallback>() { + @Override + public void onSuccess(final Diagram diagram) { + callback.onSuccess(diagram); + } + + @Override + public void onError(final ClientRuntimeError error) { + callback.onError(error); + } + }); + } + + @SuppressWarnings("unchecked") + public void save(final Diagram diagram, + final ServiceCallback> diagramServiceCallback) { + // Perform update operation remote call. + clientDiagramServices.saveOrUpdate(diagram, + diagramServiceCallback); + } + + public void save(final EditorSession session, + final ServiceCallback> diagramServiceCallback) { + // Update diagram's image data as thumbnail. + final String thumbData = toImageData(session); + final CanvasHandler canvasHandler = session.getCanvasHandler(); + final Diagram diagram = canvasHandler.getDiagram(); + diagram.getMetadata().setThumbData(thumbData); + save(diagram, + diagramServiceCallback); + } + + private String toImageData(final EditorSession session) { + return canvasExport.toImageData(session.getCanvasHandler(), + CanvasURLExportSettings.build(CanvasExport.URLDataType.JPG)); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/validation/DelegatingClientDiagramValidator.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/validation/DelegatingClientDiagramValidator.java new file mode 100644 index 00000000000..8e6a33e49b7 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/java/org/kie/workbench/common/dmn/showcase/client/validation/DelegatingClientDiagramValidator.java @@ -0,0 +1,88 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.dmn.showcase.client.validation; + +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Objects; +import java.util.function.Consumer; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.inject.Specializes; +import javax.inject.Inject; + +import org.jboss.errai.common.client.api.Caller; +import org.kie.workbench.common.dmn.showcase.api.ValidationService; +import org.kie.workbench.common.stunner.core.api.DefinitionManager; +import org.kie.workbench.common.stunner.core.client.validation.ClientDiagramValidator; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessor; +import org.kie.workbench.common.stunner.core.rule.RuleManager; +import org.kie.workbench.common.stunner.core.rule.RuleViolation; +import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; +import org.kie.workbench.common.stunner.core.validation.ModelValidator; + +@Specializes +@ApplicationScoped +public class DelegatingClientDiagramValidator extends ClientDiagramValidator { + + private final Caller validationService; + + // CDI proxy. + protected DelegatingClientDiagramValidator() { + this(null, + null, + null, + null, + null); + } + + @Inject + public DelegatingClientDiagramValidator(final DefinitionManager definitionManager, + final RuleManager ruleManager, + final TreeWalkTraverseProcessor treeWalkTraverseProcessor, + final ModelValidator modelValidator, + final Caller validationService) { + super(definitionManager, + ruleManager, + treeWalkTraverseProcessor, + modelValidator); + this.validationService = validationService; + } + + @Override + public void validate(Diagram diagram, Consumer>> resultConsumer) { + super.validate(diagram, diagramElementViolations -> { + final List> violations = + (Objects.nonNull(diagramElementViolations) ? new LinkedList<>(diagramElementViolations) : new LinkedList<>()); + backendValidation(diagram, backendViolations -> { + violations.addAll(backendViolations); + resultConsumer.accept(violations); + }); + }); + } + + @SuppressWarnings("unchecked") + private void backendValidation(Diagram diagram, final Consumer>> callback) { + validationService.call(result -> callback.accept((Collection>) result), + (msg, error) -> { + callback.accept(Collections.emptyList()); + return false; + }).validate(diagram); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/META-INF/ErraiApp.properties b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/META-INF/ErraiApp.properties new file mode 100644 index 00000000000..d9d8b19036d --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/META-INF/ErraiApp.properties @@ -0,0 +1,30 @@ +# +# Copyright 2017 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +# +# ErraiApp.properties +# +# Do not remove, even if empty! +# +# This is a marker file. When it is detected inside a JAR or at the +# top of any classpath, the subdirectories are scanned for deployable +# components. As such, all Errai application modules in a project +# should contain an ErraiApp.properties at the root of all classpaths +# that you wish to be scanned. +# +# There are also some configuration options that can be set in this +# file, although it is rarely necessary. See the documentation at +# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties +# for details. diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/META-INF/services/org.uberfire.java.nio.file.spi.FileSystemProvider b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/META-INF/services/org.uberfire.java.nio.file.spi.FileSystemProvider new file mode 100644 index 00000000000..a841dd260e1 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/META-INF/services/org.uberfire.java.nio.file.spi.FileSystemProvider @@ -0,0 +1,2 @@ +org.uberfire.java.nio.fs.jgit.JGitFileSystemProvider # file system provider, also default (1st) +org.uberfire.java.nio.fs.file.SimpleFileSystemProvider diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/application-roles.properties b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/application-roles.properties similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/application-roles.properties rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/application-roles.properties diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/application-users.properties b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/application-users.properties similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/application-users.properties rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/application-users.properties diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/log4j.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/log4j.xml similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/log4j.xml rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/log4j.xml diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/logback.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/logback.xml similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/logback.xml rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/logback.xml diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/org/kie/workbench/common/dmn/showcase/DMNShowcase.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/org/kie/workbench/common/dmn/showcase/DMNShowcase.gwt.xml similarity index 88% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/org/kie/workbench/common/dmn/showcase/DMNShowcase.gwt.xml rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/org/kie/workbench/common/dmn/showcase/DMNShowcase.gwt.xml index bff93e945f6..90e89835207 100644 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/org/kie/workbench/common/dmn/showcase/DMNShowcase.gwt.xml +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/org/kie/workbench/common/dmn/showcase/DMNShowcase.gwt.xml @@ -22,35 +22,33 @@ - - - - - - - - - - - + + + - - + + + + - - - + + + + + + + @@ -68,6 +66,7 @@ + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/org/kie/workbench/common/dmn/showcase/FastCompiledDMNShowcase.gwt.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/org/kie/workbench/common/dmn/showcase/FastCompiledDMNShowcase.gwt.xml similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/org/kie/workbench/common/dmn/showcase/FastCompiledDMNShowcase.gwt.xml rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/org/kie/workbench/common/dmn/showcase/FastCompiledDMNShowcase.gwt.xml diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/security-management.properties b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/security-management.properties new file mode 100644 index 00000000000..48efe4f3922 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/security-management.properties @@ -0,0 +1,16 @@ +# +# Copyright 2016 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +org.uberfire.ext.security.management.api.userManagementServices=WildflyCLIUserManagementService diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/security-policy.properties b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/security-policy.properties similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/resources/security-policy.properties rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/resources/security-policy.properties diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/WEB-INF/beans.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/WEB-INF/beans.xml similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/WEB-INF/beans.xml rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/WEB-INF/beans.xml diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/WEB-INF/jboss-deployment-structure.xml similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/WEB-INF/jboss-deployment-structure.xml rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/WEB-INF/jboss-deployment-structure.xml diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/WEB-INF/web.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/WEB-INF/web.xml rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/WEB-INF/web.xml diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/dmn-editor.html b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/dmn-editor.html similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/dmn-editor.html rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/dmn-editor.html diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/favicon.ico b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/favicon.ico new file mode 100644 index 00000000000..cefe23f9c00 Binary files /dev/null and b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/favicon.ico differ diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/images/UberFireLogo.png b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/images/UberFireLogo.png similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/images/UberFireLogo.png rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/images/UberFireLogo.png diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/images/bg-login-top.png b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/images/bg-login-top.png similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/images/bg-login-top.png rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/images/bg-login-top.png diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/images/bg-login.png b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/images/bg-login.png similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/images/bg-login.png rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/images/bg-login.png diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/images/default-diagram-thumbnail.png b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/images/default-diagram-thumbnail.png new file mode 100644 index 00000000000..d032580aef4 Binary files /dev/null and b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/images/default-diagram-thumbnail.png differ diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/images/loading-icon.gif b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/images/loading-icon.gif similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/images/loading-icon.gif rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/images/loading-icon.gif diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/index.html b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/index.html new file mode 100644 index 00000000000..a61264ff115 --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/index.html @@ -0,0 +1,36 @@ + + + + + + + + DMN Editor Showcase + + + + + + + + + + + + + + diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/index.jsp b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/index.jsp similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/index.jsp rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/index.jsp diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/login.jsp b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/login.jsp similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/login.jsp rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/login.jsp diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/logout.jsp b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/logout.jsp similarity index 100% rename from kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/webapp/logout.jsp rename to kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/main/webapp/logout.jsp diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/test/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNDiagramEditorTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/test/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNDiagramEditorTest.java new file mode 100644 index 00000000000..5e80005273a --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/test/java/org/kie/workbench/common/dmn/showcase/client/editor/DMNDiagramEditorTest.java @@ -0,0 +1,440 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.showcase.client.editor; + +import java.util.List; +import java.util.function.Consumer; +import java.util.function.Supplier; + +import com.google.gwt.user.client.ui.Widget; +import com.google.gwtmockito.GwtMockitoTestRunner; +import elemental2.dom.HTMLElement; +import org.jboss.errai.common.client.ui.ElementWrapperWidget; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorDock; +import org.kie.workbench.common.dmn.client.editors.expressions.ExpressionEditorView; +import org.kie.workbench.common.dmn.client.editors.included.IncludedModelsPage; +import org.kie.workbench.common.dmn.client.editors.included.imports.IncludedModelsPageStateProviderImpl; +import org.kie.workbench.common.dmn.client.editors.search.DMNEditorSearchIndex; +import org.kie.workbench.common.dmn.client.editors.search.DMNSearchableElement; +import org.kie.workbench.common.dmn.client.editors.types.DataTypePageTabActiveEvent; +import org.kie.workbench.common.dmn.client.editors.types.DataTypesPage; +import org.kie.workbench.common.dmn.client.editors.types.listview.common.DataTypeEditModeToggleEvent; +import org.kie.workbench.common.dmn.client.events.EditExpressionEvent; +import org.kie.workbench.common.dmn.client.session.DMNEditorSession; +import org.kie.workbench.common.dmn.showcase.client.perspectives.AuthoringPerspective; +import org.kie.workbench.common.dmn.webapp.common.client.docks.preview.PreviewDiagramDock; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; +import org.kie.workbench.common.stunner.client.widgets.views.session.ScreenPanelView; +import org.kie.workbench.common.stunner.core.client.api.SessionManager; +import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; +import org.kie.workbench.common.stunner.core.client.components.layout.LayoutHelper; +import org.kie.workbench.common.stunner.core.client.components.layout.OpenDiagramLayoutExecutor; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.DiagramImpl; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.documentation.DocumentationPage; +import org.kie.workbench.common.stunner.core.documentation.DocumentationView; +import org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent; +import org.kie.workbench.common.stunner.kogito.client.docks.DiagramEditorPropertiesDock; +import org.kie.workbench.common.widgets.client.search.component.SearchBarComponent; +import org.kie.workbench.common.widgets.metadata.client.KieEditorWrapperView; +import org.mockito.InOrder; +import org.mockito.Mock; +import org.uberfire.client.views.pfly.multipage.MultiPageEditorSelectedPageEvent; +import org.uberfire.client.workbench.widgets.multipage.MultiPageEditor; +import org.uberfire.mocks.EventSourceMock; +import org.uberfire.mvp.Command; +import org.uberfire.workbench.model.menu.MenuItem; +import org.uberfire.workbench.model.menu.Menus; + +import static java.util.Collections.singletonList; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.kie.workbench.common.dmn.showcase.client.editor.DMNDiagramEditor.DATA_TYPES_PAGE_INDEX; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyBoolean; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.inOrder; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(GwtMockitoTestRunner.class) +public class DMNDiagramEditorTest { + + @Mock + private SessionManager sessionManager; + + @Mock + private SessionEditorPresenter presenter; + + @Mock + private EventSourceMock refreshFormPropertiesEvent; + + @Mock + private DecisionNavigatorDock decisionNavigatorDock; + + @Mock + private DiagramEditorPropertiesDock diagramPropertiesDock; + + @Mock + private PreviewDiagramDock diagramPreviewAndExplorerDock; + + @Mock + private LayoutHelper layoutHelper; + + @Mock + private OpenDiagramLayoutExecutor layoutExecutor; + + @Mock + private DataTypesPage dataTypesPage; + + @Mock + private IncludedModelsPage includedModelsPage; + + @Mock + private IncludedModelsPageStateProviderImpl importsPageProvider; + + @Mock + private DocumentationView documentationView; + + @Mock + private ScreenPanelView screenPanelView; + + @Mock + private KieEditorWrapperView kieView; + + @Mock + private ExpressionEditorView.Presenter expressionEditor; + + @Mock + private DMNEditorSession session; + + @Mock + private DMNEditorSearchIndex editorSearchIndex; + + @Mock + private SearchBarComponent searchBarComponent; + + @Mock + private SearchBarComponent.View searchBarComponentView; + + @Mock + private HTMLElement searchBarComponentViewElement; + + @Mock + private ElementWrapperWidget searchBarComponentWidget; + private DMNDiagramEditor editor; + + @Before + @SuppressWarnings("unchecked") + public void setup() { + when(searchBarComponent.getView()).thenReturn(searchBarComponentView); + when(searchBarComponentView.getElement()).thenReturn(searchBarComponentViewElement); + doReturn(presenter).when(presenter).withToolbar(anyBoolean()); + doReturn(presenter).when(presenter).withPalette(anyBoolean()); + doReturn(presenter).when(presenter).displayNotifications(any()); + doReturn(session).when(presenter).getInstance(); + doReturn(session).when(sessionManager).getCurrentSession(); + doReturn(expressionEditor).when(session).getExpressionEditor(); + doAnswer((invocation) -> { + Diagram diagram = (Diagram) invocation.getArguments()[0]; + SessionPresenter.SessionPresenterCallback callback = (SessionPresenter.SessionPresenterCallback) invocation.getArguments()[1]; + callback.onOpen(diagram); + callback.afterCanvasInitialized(); + callback.afterSessionOpened(); + callback.onSuccess(); + return null; + }).when(presenter).open(any(Diagram.class), + any(SessionPresenter.SessionPresenterCallback.class)); + + editor = spy(new DMNDiagramEditor(sessionManager, + null, + presenter, + refreshFormPropertiesEvent, + null, + null, + decisionNavigatorDock, + diagramPropertiesDock, + diagramPreviewAndExplorerDock, + layoutHelper, + layoutExecutor, + dataTypesPage, + includedModelsPage, + importsPageProvider, + documentationView, + editorSearchIndex, + searchBarComponent, + null, + null, + null, + null, + screenPanelView, + null, + kieView)); + + doReturn(searchBarComponentWidget).when(editor).getWidget(searchBarComponentViewElement); + } + + @Test + public void testInit() { + + final Widget screenPanelWidget = mock(Widget.class); + final MultiPageEditor multiPageEditor = mock(MultiPageEditor.class); + final DocumentationPage documentationPage = mock(DocumentationPage.class); + final Supplier isDataTypesTabActiveSupplier = () -> true; + final Supplier hashcodeSupplier = () -> 123; + + doReturn(hashcodeSupplier).when(editor).getHashcodeSupplier(); + doReturn(isDataTypesTabActiveSupplier).when(editor).getIsDataTypesTabActiveSupplier(); + doReturn(documentationPage).when(editor).getDocumentationPage(); + when(kieView.getMultiPage()).thenReturn(multiPageEditor); + when(screenPanelView.asWidget()).thenReturn(screenPanelWidget); + + editor.init(); + + verify(decisionNavigatorDock).init(AuthoringPerspective.PERSPECTIVE_ID); + verify(diagramPreviewAndExplorerDock).init(AuthoringPerspective.PERSPECTIVE_ID); + verify(diagramPropertiesDock).init(AuthoringPerspective.PERSPECTIVE_ID); + verify(kieView).setPresenter(editor); + verify(kieView).clear(); + verify(kieView).addMainEditorPage(screenPanelWidget); + verify(multiPageEditor).addPage(dataTypesPage); + verify(multiPageEditor).addPage(includedModelsPage); + verify(multiPageEditor).addPage(documentationPage); + verify(editorSearchIndex).setIsDataTypesTabActiveSupplier(isDataTypesTabActiveSupplier); + verify(editorSearchIndex).setCurrentAssetHashcodeSupplier(hashcodeSupplier); + + verify(editor).setupSearchComponent(); + } + + @Test + public void testGetHashcodeSupplier() { + + final Diagram diagram = new DiagramImpl("something", null); + final Integer expectedHashcode = diagram.hashCode(); + + doReturn(diagram).when(editor).getDiagram(); + + final Integer actualHashcode = editor.getHashcodeSupplier().get(); + + assertEquals(expectedHashcode, actualHashcode); + } + + @Test + public void testGetIsDataTypesTabActiveSupplierWhenDataTypesTabIsActive() { + + final MultiPageEditor multiPageEditor = mock(MultiPageEditor.class); + + when(kieView.getMultiPage()).thenReturn(multiPageEditor); + when(multiPageEditor.selectedPage()).thenReturn(DATA_TYPES_PAGE_INDEX); + + assertTrue(editor.getIsDataTypesTabActiveSupplier().get()); + } + + @Test + public void testGetIsDataTypesTabActiveSupplierWhenDataTypesTabIsNotActive() { + final MultiPageEditor multiPageEditor = mock(MultiPageEditor.class); + + when(kieView.getMultiPage()).thenReturn(multiPageEditor); + when(multiPageEditor.selectedPage()).thenReturn(DATA_TYPES_PAGE_INDEX + 1); + + assertFalse(editor.getIsDataTypesTabActiveSupplier().get()); + } + + @Test + public void testSetupSearchComponent() { + + final MultiPageEditor multiPageEditor = mock(MultiPageEditor.class); + + when(kieView.getMultiPage()).thenReturn(multiPageEditor); + + editor.setupSearchComponent(); + + verify(searchBarComponent).init(editorSearchIndex); + verify(multiPageEditor).addTabBarWidget(searchBarComponentWidget); + } + + @Test + public void testOpenDiagram() { + + final Diagram diagram = mock(Diagram.class); + final Command callback = mock(Command.class); + final Metadata metadata = mock(Metadata.class); + final AbstractCanvasHandler canvasHandler = mock(AbstractCanvasHandler.class); + + when(importsPageProvider.withDiagram(diagram)).thenReturn(importsPageProvider); + when(session.getCanvasHandler()).thenReturn(canvasHandler); + when(diagram.getMetadata()).thenReturn(metadata); + + editor.open(diagram, callback); + + final InOrder inOrder = inOrder(decisionNavigatorDock, diagramPreviewAndExplorerDock, diagramPropertiesDock); + inOrder.verify(decisionNavigatorDock).setupCanvasHandler(canvasHandler); + inOrder.verify(decisionNavigatorDock).open(); + inOrder.verify(diagramPropertiesDock).open(); + inOrder.verify(diagramPreviewAndExplorerDock).open(); + + verify(dataTypesPage).reload(); + verify(dataTypesPage).enableShortcuts(); + verify(includedModelsPage).setup(importsPageProvider); + } + + @Test + public void testOnClose() { + + doNothing().when(editor).destroyDock(); + doNothing().when(editor).destroySession(); + + editor.onClose(); + + verify(editor).destroyDock(); + verify(editor).destroySession(); + verify(dataTypesPage).disableShortcuts(); + } + + @Test + public void testOpenDock() { + + final EditorSession session = mock(EditorSession.class); + final AbstractCanvasHandler canvasHandler = mock(AbstractCanvasHandler.class); + + when(session.getCanvasHandler()).thenReturn(canvasHandler); + + editor.openDock(); + + verify(decisionNavigatorDock).open(); + } + + @Test + public void testDestroyDock() { + + editor.destroyDock(); + + verify(decisionNavigatorDock).close(); + verify(decisionNavigatorDock).resetContent(); + } + + @Test + public void testOnDataTypePageNavTabActiveEvent() { + + final MultiPageEditor multiPageEditor = mock(MultiPageEditor.class); + + when(kieView.getMultiPage()).thenReturn(multiPageEditor); + + editor.onDataTypePageNavTabActiveEvent(mock(DataTypePageTabActiveEvent.class)); + + verify(multiPageEditor).selectPage(DMNDiagramEditor.DATA_TYPES_PAGE_INDEX); + } + + @Test + @SuppressWarnings("unchecked") + public void testOnDataTypeEditModeToggleWhenEditModeIsEnabled() { + + final DataTypeEditModeToggleEvent event = mock(DataTypeEditModeToggleEvent.class); + final MenuItem menuItem = mock(MenuItem.class); + final Menus menus = mock(Menus.class); + final List items = singletonList(menuItem); + + when(menus.getItems()).thenReturn(items); + when(event.isEditModeEnabled()).thenReturn(true); + doAnswer(invocationOnMock -> { + invocationOnMock.getArgumentAt(0, Consumer.class).accept(menus); + return null; + }).when(editor).getMenu(any()); + + editor.onDataTypeEditModeToggle(event); + + verify(menuItem).setEnabled(false); + } + + @Test + @SuppressWarnings("unchecked") + public void testOnDataTypeEditModeToggleWhenEditModeIsNotEnabled() { + + final DataTypeEditModeToggleEvent event = mock(DataTypeEditModeToggleEvent.class); + final MenuItem menuItem = mock(MenuItem.class); + final Menus menus = mock(Menus.class); + final List items = singletonList(menuItem); + + when(menus.getItems()).thenReturn(items); + when(event.isEditModeEnabled()).thenReturn(false); + doAnswer(invocationOnMock -> { + invocationOnMock.getArgumentAt(0, Consumer.class).accept(menus); + return null; + }).when(editor).getMenu(any()); + + editor.onDataTypeEditModeToggle(event); + + verify(menuItem).setEnabled(true); + } + + @Test + public void testGetOnStartupDiagramEditorCallback() { + + final Diagram diagram = mock(Diagram.class); + final Metadata metadata = mock(Metadata.class); + final String title = "title"; + + doNothing().when(editor).updateTitle(anyString()); + doReturn(diagram).when(editor).getDiagram(); + when(diagram.getMetadata()).thenReturn(metadata); + when(metadata.getTitle()).thenReturn(title); + + editor.getOnStartupDiagramEditorCallback().execute(); + + verify(editor).updateTitle(title); + verify(documentationView).initialize(diagram); + } + + @Test + public void testGetDocumentationPage() { + + final DocumentationPage documentationPage = editor.getDocumentationPage(); + + assertEquals("Documentation", documentationPage.getLabel()); + assertEquals(documentationView, documentationPage.getDocumentationView()); + } + + @Test + public void testOnEditExpressionEvent() { + editor.onEditExpressionEvent(mock(EditExpressionEvent.class)); + verify(searchBarComponent).disableSearch(); + } + + @Test + public void testOnMultiPageEditorSelectedPageEvent() { + editor.onMultiPageEditorSelectedPageEvent(mock(MultiPageEditorSelectedPageEvent.class)); + verify(searchBarComponent).disableSearch(); + } + + @Test + public void testOnRefreshFormPropertiesEvent() { + editor.onRefreshFormPropertiesEvent(mock(RefreshFormPropertiesEvent.class)); + verify(searchBarComponent).disableSearch(); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/test/java/org/kie/workbench/common/dmn/showcase/client/toolbar/DMNStandaloneToolbarStateHandlerTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/test/java/org/kie/workbench/common/dmn/showcase/client/toolbar/DMNStandaloneToolbarStateHandlerTest.java new file mode 100644 index 00000000000..790973129bd --- /dev/null +++ b/kie-wb-common-dmn/kie-wb-common-dmn-webapp-standalone/src/test/java/org/kie/workbench/common/dmn/showcase/client/toolbar/DMNStandaloneToolbarStateHandlerTest.java @@ -0,0 +1,65 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.dmn.showcase.client.toolbar; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.dmn.client.widgets.toolbar.DMNEditorToolbar; +import org.kie.workbench.common.dmn.showcase.client.editor.DMNStandaloneToolbarStateHandler; +import org.kie.workbench.common.stunner.client.widgets.toolbar.ToolbarCommand; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class DMNStandaloneToolbarStateHandlerTest { + + @Mock + private DMNEditorToolbar toolbar; + + private DMNStandaloneToolbarStateHandler toolbarStateHandler; + + @Before + @SuppressWarnings("unchecked") + public void setUp() { + this.toolbarStateHandler = new DMNStandaloneToolbarStateHandler(toolbar); + when(toolbar.isEnabled(any(ToolbarCommand.class))).thenReturn(true); + } + + @Test + @SuppressWarnings("unchecked") + public void testEnterGridView() { + toolbarStateHandler.enterGridView(); + + verify(toolbar, atLeast(1)).disable(any(ToolbarCommand.class)); + } + + @Test + @SuppressWarnings("unchecked") + public void testEnterGraphView() { + toolbarStateHandler.enterGridView(); + + toolbarStateHandler.enterGraphView(); + + verify(toolbar, atLeast(1)).enable(any(ToolbarCommand.class)); + } +} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/pom.xml b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/pom.xml deleted file mode 100644 index 7f6f4568f62..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/pom.xml +++ /dev/null @@ -1,1151 +0,0 @@ - - - - - org.kie.workbench - kie-wb-common-dmn - 7.29.0-SNAPSHOT - - 4.0.0 - - kie-wb-common-dmn-webapp - Kie Workbench - Common - DMN - Showcase webapp - Kie Workbench - Common - DMN - Showcase webapp - war - - - ${project.build.directory}/wildfly-${version.org.jboss.errai.wildfly} - 4 - - - - - - org.jboss.xnio - xnio-api - - - - org.uberfire - uberfire-widgets-service-backend - - - - org.uberfire - uberfire-backend-api - - - - org.uberfire - uberfire-api - - - org.uberfire - uberfire-commons - - - org.kie.soup - kie-soup-commons - - - org.uberfire - uberfire-io - - - - - org.uberfire - uberfire-metadata-api - - - - org.uberfire - uberfire-metadata-backend-lucene - - - jakarta-regexp - jakarta-regexp - - - - - - org.uberfire - uberfire-metadata-backend-elasticsearch - - - jakarta-regexp - jakarta-regexp - - - - - - org.uberfire - uberfire-metadata-commons-io - - - - org.apache.lucene - lucene-core - - - - - org.slf4j - slf4j-api - - - - org.slf4j - slf4j-ext - - - - - ch.qos.logback - logback-classic - - - - org.slf4j - log4j-over-slf4j - - - - - org.uberfire - uberfire-all - - - log4j - log4j - - - - - - org.uberfire - uberfire-backend-server - - - - org.uberfire - uberfire-backend-cdi - - - - org.uberfire - uberfire-security-api - - - - org.uberfire - uberfire-security-client - provided - - - - org.uberfire - uberfire-servlet-security - - - - org.uberfire - uberfire-client - provided - - - - org.uberfire - uberfire-js - provided - - - - org.uberfire - uberfire-workbench-client-backend - provided - - - - org.uberfire - uberfire-workbench-client - provided - - - - org.uberfire - uberfire-simple-docks-client - provided - - - - org.uberfire - uberfire-client-backend - provided - - - - org.uberfire - uberfire-workbench-processors - provided - - - - org.uberfire - uberfire-nio2-model - - - - org.uberfire - uberfire-client-api - - - - org.uberfire - uberfire-workbench-client-views-patternfly - provided - - - - org.uberfire - uberfire-widgets-properties-editor-api - - - - org.uberfire - uberfire-widgets-properties-editor-backend - - - - org.uberfire - uberfire-widgets-properties-editor-client - provided - - - - org.uberfire - uberfire-widgets-commons - provided - - - - org.uberfire - uberfire-widgets-table - provided - - - - - org.uberfire - uberfire-preferences-api - - - - org.uberfire - uberfire-preferences-backend - - - - org.uberfire - uberfire-preferences-client - - - - org.uberfire - uberfire-preferences-client-backend - - - - org.uberfire - uberfire-preferences-ui-client - provided - - - - org.uberfire - uberfire-widgets-service-api - - - - - org.uberfire - uberfire-ssh-api - - - org.uberfire - uberfire-ssh-backend - - - org.uberfire - uberfire-ssh-client - provided - - - - - org.uberfire - uberfire-security-management-api - - - - org.uberfire - uberfire-security-management-backend - - - - org.uberfire - uberfire-security-management-wildfly - - - - org.uberfire - uberfire-security-management-client - provided - - - - org.uberfire - uberfire-widgets-security-management - provided - - - - org.uberfire - uberfire-security-management-client-wb - provided - - - - - org.uberfire - uberfire-experimental-api - - - - org.uberfire - uberfire-experimental-backend - - - - org.uberfire - uberfire-experimental-client - provided - - - - - org.uberfire - uberfire-wires-core-grids - provided - - - - - org.jboss.errai - errai-ioc - - - - org.jboss.errai - errai-common - - - - org.jboss.errai - errai-bus - - - - org.jboss.errai - errai-ui - provided - - - - org.jboss.errai - errai-data-binding - provided - - - - org.jboss.errai - errai-marshalling - - - - org.jboss.errai - errai-security-server - - - - org.jboss.errai - errai-security-client - provided - - - - org.jboss.errai - errai-navigation - provided - - - - org.jboss.errai - errai-cdi-server - - - - org.jboss.errai - errai-cdi-client - provided - - - - org.jboss.errai - errai-cdi-shared - - - - org.jboss.errai - errai-jaxrs-client - provided - - - - org.jboss.errai - errai-cdi-jboss - provided - - - ant - ant - - - - - - org.jboss.errai - errai-jboss-as-support - - - - org.jboss.errai - errai-codegen-gwt - provided - - - - org.jboss.errai - errai-validation - provided - - - - org.owasp.encoder - encoder - - - - - org.kie.workbench.services - kie-wb-common-refactoring-backend - - - - - org.kie.workbench.stunner - kie-wb-common-stunner-core-api - - - - org.kie.workbench.stunner - kie-wb-common-stunner-client-api - - - - org.kie.workbench.stunner - kie-wb-common-stunner-backend-api - - - - org.kie.workbench.stunner - kie-wb-common-stunner-core-common - - - - org.kie.workbench.stunner - kie-wb-common-stunner-backend-common - - - - org.kie.workbench.stunner - kie-wb-common-stunner-processors - provided - - - - org.kie.workbench.stunner - kie-wb-common-stunner-backend - - - - org.kie.workbench.stunner - kie-wb-common-stunner-client-common - provided - - - - org.kie.workbench.stunner - kie-wb-common-stunner-lienzo - provided - - - - org.kie.workbench.stunner - kie-wb-common-stunner-shapes-api - - - - org.kie.workbench.stunner - kie-wb-common-stunner-shapes-client - provided - - - - org.kie.workbench.stunner - kie-wb-common-stunner-lienzo-extensions - provided - - - - org.kie.workbench.stunner - kie-wb-common-stunner-svg-client - provided - - - - org.kie.workbench.stunner - kie-wb-common-stunner-svg-gen - provided - - - - org.kie.workbench.stunner - kie-wb-common-stunner-widgets - provided - - - - org.kie.workbench.stunner - kie-wb-common-stunner-forms-api - - - - org.kie.workbench.stunner - kie-wb-common-stunner-forms-client - provided - - - - - org.kie - kie-dmn-backend - - - org.kie.workbench - kie-wb-common-dmn-api - - - - org.kie.workbench - kie-wb-common-dmn-backend - - - - org.kie.workbench - kie-wb-common-dmn-client - provided - - - - - org.kie - lienzo-core - provided - - - - com.ahome-it - ahome-tooling-nativetools - provided - - - - com.ahome-it - ahome-tooling-common - provided - - - - - org.kie.workbench.forms - kie-wb-common-forms-crud-component - provided - - - - org.kie.workbench.forms - kie-wb-common-forms-api - - - - org.kie.workbench.forms - kie-wb-common-forms-fields - - - - org.kie.workbench.forms - kie-wb-common-forms-processing-engine - provided - - - - org.kie.workbench.forms - kie-wb-common-forms-adf-base - - - - org.kie.workbench.forms - kie-wb-common-forms-adf-engine-api - - - - org.kie.workbench.forms - kie-wb-common-forms-adf-engine-backend - - - - org.kie.workbench.forms - kie-wb-common-forms-adf-engine-client - provided - - - - org.kie.workbench.forms - kie-wb-common-dynamic-forms-api - - - - org.kie.workbench.forms - kie-wb-common-dynamic-forms-backend - - - - org.kie.workbench.forms - kie-wb-common-dynamic-forms-client - - - - org.kie.workbench.forms - kie-wb-common-forms-backend-services - - - - org.kie.workbench.forms - kie-wb-common-forms-common-rendering-shared - - - - org.kie.workbench.forms - kie-wb-common-forms-common-rendering-client - provided - - - - javax.validation - validation-api - - - - javax.validation - validation-api - sources - - - - org.hibernate - hibernate-validator - - - - org.hibernate - hibernate-validator - sources - - - - org.kie.workbench.services - kie-wb-common-datamodel-api - - - - org.kie.workbench.widgets - kie-wb-metadata-widget - - - - org.kie.workbench.widgets - kie-wb-common-ui - - - - org.kie.soup - kie-soup-project-datamodel-api - - - - - org.drools - drools-cdi - - - org.drools - drools-compiler - - - - - - org.jbpm - jbpm-bpmn2 - - - - - org.uberfire - uberfire-project-api - - - - org.uberfire - uberfire-project-client - - - - - org.uberfire - uberfire-runtime-plugins-api - - - - org.uberfire - uberfire-runtime-plugins-backend - - - - org.uberfire - uberfire-runtime-plugins-client - provided - - - - - org.uberfire - uberfire-commons-editor-api - - - - org.uberfire - uberfire-commons-editor-client - provided - - - - org.uberfire - uberfire-commons-editor-backend - - - - com.google.elemental2 - elemental2-dom - - - - - org.uberfire - uberfire-layout-editor-api - - - - org.uberfire - uberfire-layout-editor-client - provided - - - - - org.uberfire - uberfire-apps-api - - - - org.uberfire - uberfire-apps-client - provided - - - - org.uberfire - uberfire-apps-backend - - - - - com.google.gwt - gwt-user - provided - - - javax.servlet - javax.servlet-api - - - - - - org.gwtbootstrap3 - gwtbootstrap3 - provided - - - - org.gwtbootstrap3 - gwtbootstrap3-extras - provided - - - - com.google.gwt.gwtmockito - gwtmockito - test - - - - org.uberfire - uberfire-testing-utils - test - - - - - org.drools - drools-workbench-models-datamodel-api - - - org.uberfire - uberfire-services-api - - - org.uberfire - uberfire-workingset-api - - - org.uberfire - uberfire-message-console-api - - - org.uberfire - uberfire-structure-api - - - org.kie.workbench.services - kie-wb-common-services-api - - - org.kie.workbench.profile - kie-wb-common-profile-api - - - - - ${project.artifactId} - src/main/webapp/WEB-INF/classes - - - - - org.codehaus.mojo - gwt-maven-plugin - - true - ${gwt.compiler.localWorkers} - ${project.build.directory}/gwt-symbols-deploy - true - -Xmx4096m -Xms1024m -Xss1M -XX:CompileThreshold=7000 -Derrai.jboss.home=${errai.jboss.home} -Derrai.dynamic_validation.enabled=true - org.kie.workbench.common.dmn.showcase.FastCompiledDMNShowcase - INFO - false - org.jboss.errai.cdi.server.gwt.EmbeddedWildFlyLauncher - true - dmn-editor.html - src/main/webapp - false - INFO - - - - org.kie.soup:kie-soup-commons - - - org.uberfire:uberfire-commons - org.uberfire:uberfire-nio2-model - org.uberfire:uberfire-io - org.uberfire:uberfire-api - org.uberfire:uberfire-js - org.uberfire:uberfire-security-api - org.uberfire:uberfire-security-client - org.uberfire:uberfire-client-api - org.uberfire:uberfire-workbench-client - org.uberfire:uberfire-workbench-client-backend - org.uberfire:uberfire-workbench-client-views-patternfly - org.uberfire:uberfire-simple-docks-client - org.uberfire:uberfire-backend-api - org.uberfire:uberfire-project-api - org.uberfire:uberfire-project-client - org.uberfire:uberfire-services-api - org.uberfire:uberfire-structure-api - org.uberfire:uberfire-workingset-api - org.uberfire:uberfire-message-console-api - org.uberfire:uberfire-message-console-client - - - org.jboss.errai:errai-data-binding - org.kie.workbench.services:kie-wb-common-datamodel-api - org.kie.workbench.services:kie-wb-common-services-api - org.kie.soup:kie-soup-project-datamodel-api - - - org.uberfire:uberfire-runtime-plugins-api - org.uberfire:uberfire-runtime-plugins-client - org.uberfire:uberfire-apps-api - org.uberfire:uberfire-apps-client - org.uberfire:uberfire-commons-editor-api - org.uberfire:uberfire-commons-editor-client - org.uberfire:uberfire-widgets-commons - org.uberfire:uberfire-widgets-table - org.uberfire:uberfire-widgets-properties-editor-api - org.uberfire:uberfire-widgets-properties-editor-client - org.uberfire:uberfire-widgets-service-api - org.uberfire:uberfire-widgets-core-client - org.uberfire:uberfire-ssh-api - org.uberfire:uberfire-ssh-client - - - org.uberfire:uberfire-preferences-api - org.uberfire:uberfire-preferences-client - org.uberfire:uberfire-preferences-client-backend - org.uberfire:uberfire-preferences-ui-client - - - org.uberfire:uberfire-security-management-api - org.uberfire:uberfire-security-management-client - org.uberfire:uberfire-security-management-client-wb - org.uberfire:uberfire-widgets-security-management - - - org.uberfire:uberfire-experimental-api - org.uberfire:uberfire-experimental-client - - - org.kie.workbench.forms:kie-wb-common-forms-api - org.kie.workbench.forms:kie-wb-common-forms-adf-base - org.kie.workbench.forms:kie-wb-common-forms-adf-engine-api - org.kie.workbench.forms:kie-wb-common-forms-adf-engine-client - org.kie.workbench.forms:kie-wb-common-forms-fields - org.kie.workbench.forms:kie-wb-common-forms-processing-engine - org.kie.workbench.forms:kie-wb-common-forms-common-rendering-shared - org.kie.workbench.forms:kie-wb-common-forms-common-rendering-client - org.kie.workbench.forms:kie-wb-common-forms-crud-component - org.kie.workbench.forms:kie-wb-common-dynamic-forms-api - org.kie.workbench.forms:kie-wb-common-dynamic-forms-client - - - org.kie.workbench.stunner:kie-wb-common-stunner-core-api - org.kie.workbench.stunner:kie-wb-common-stunner-backend-api - org.kie.workbench.stunner:kie-wb-common-stunner-client-api - org.kie.workbench.stunner:kie-wb-common-stunner-core-common - org.kie.workbench.stunner:kie-wb-common-stunner-client-common - org.kie.workbench.stunner:kie-wb-common-stunner-lienzo - org.kie.workbench.stunner:kie-wb-common-stunner-shapes-api - org.kie.workbench.stunner:kie-wb-common-stunner-shapes-client - org.kie.workbench.stunner:kie-wb-common-stunner-lienzo-extensions - org.kie.workbench.stunner:kie-wb-common-stunner-svg-client - org.kie.workbench.stunner:kie-wb-common-stunner-widgets - org.kie.workbench.stunner:kie-wb-common-stunner-forms-api - org.kie.workbench.stunner:kie-wb-common-stunner-forms-client - - org.kie.workbench.widgets:kie-wb-common-ui - org.kie.workbench.widgets:kie-wb-metadata-widget - org.kie.workbench.widgets:kie-wb-config-resource-widget - org.kie.workbench.profile:kie-wb-common-profile-api - - - org.kie.workbench:kie-wb-common-dmn-api - org.kie.workbench:kie-wb-common-dmn-client - - - org.uberfire:uberfire-wires-core-grids - - org.uberfire:appformer-js-bridge - - - - - - gwt-clean - clean - - clean - - - - gwt-compile - - resources - compile - - - - - - - maven-war-plugin - - **/javax/**/*.*,**/client/**/*.class,**/*.symbolMap - - false - - - - - - maven-clean-plugin - - - - ${basedir} - - www-test/** - src/main/webapp/org.kie.workbench.common.dmn.showcase.DMNShowcase/ - src/main/webapp/WEB-INF/classes/ - src/main/webapp/WEB-INF/deploy/ - src/main/webapp/WEB-INF/lib/ - **/gwt-unitCache/** - .gwt/** - .errai/ - .security/ - .niogit/** - .index/** - **/*.JUnit/** - repositories/ - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack - process-resources - - unpack - - - - - org.jboss.errai - wildfly-dist - ${version.org.jboss.errai.wildfly} - zip - false - ${project.build.directory} - - - - - - - - - - - - - - - - fullProfile - - - full - - - - -Xmx3g -Xms1g -Xss1M - 4 - - - - - - org.codehaus.mojo - gwt-maven-plugin - - org.kie.workbench.common.dmn.showcase.DMNShowcase - false - - - - - - - - - no-showcase - - - - org.codehaus.mojo - gwt-maven-plugin - - true - - - - - - - - diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/backend/ApplicationScopedProducer.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/backend/ApplicationScopedProducer.java deleted file mode 100644 index 11cdf54da60..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/backend/ApplicationScopedProducer.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.backend; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.context.RequestScoped; -import javax.enterprise.inject.Produces; -import javax.inject.Inject; -import javax.inject.Named; - -import org.jboss.errai.security.shared.api.identity.User; -import org.jboss.errai.security.shared.service.AuthenticationService; -import org.uberfire.backend.server.IOWatchServiceAllImpl; -import org.uberfire.commons.services.cdi.Startup; -import org.uberfire.commons.services.cdi.StartupType; -import org.uberfire.io.IOService; -import org.uberfire.io.impl.IOServiceNio2WrapperImpl; - -@Startup(value = StartupType.BOOTSTRAP) -@ApplicationScoped -public class ApplicationScopedProducer { - - @Inject - private AuthenticationService authenticationService; - - @Inject - private IOWatchServiceAllImpl watchService; - - private IOService ioService; - - @PostConstruct - public void setup() { - ioService = new IOServiceNio2WrapperImpl("1", - watchService); - } - - @Produces - @Named("ioStrategy") - public IOService ioService() { - return ioService; - } - - @Produces - @RequestScoped - public User getIdentity() { - return authenticationService.getUser(); - } -} - diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/backend/DefaultLuceneConfigProducer.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/backend/DefaultLuceneConfigProducer.java deleted file mode 100644 index 372d02da4e6..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/backend/DefaultLuceneConfigProducer.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.backend; - -import java.util.Map; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Produces; -import javax.inject.Named; - -import org.apache.lucene.analysis.Analyzer; -import org.kie.soup.commons.util.Maps; -import org.kie.workbench.common.services.refactoring.backend.server.indexing.ImpactAnalysisAnalyzerWrapperFactory; -import org.kie.workbench.common.services.refactoring.backend.server.indexing.LowerCaseOnlyAnalyzer; -import org.kie.workbench.common.services.refactoring.model.index.terms.ModuleNameIndexTerm; -import org.kie.workbench.common.services.refactoring.model.index.terms.ModuleRootPathIndexTerm; -import org.kie.workbench.common.services.refactoring.model.index.terms.PackageNameIndexTerm; -import org.uberfire.ext.metadata.MetadataConfig; -import org.uberfire.ext.metadata.backend.lucene.analyzer.FilenameAnalyzer; -import org.uberfire.ext.metadata.io.MetadataConfigBuilder; - -/** - * This class contains the default Lucene configuration, and can be - * replaced by using CDI alternatives. - */ -@ApplicationScoped -public class DefaultLuceneConfigProducer { - - private MetadataConfig config; - - @PostConstruct - public void setup() { - final Map analyzers = getAnalyzers(); - this.config = new MetadataConfigBuilder().withInMemoryMetaModelStore() - .usingAnalyzers(analyzers) - .usingAnalyzerWrapperFactory(ImpactAnalysisAnalyzerWrapperFactory.getInstance()) - .useDirectoryBasedIndex() - .useNIODirectory() - .build(); - } - - @Produces - @Named("luceneConfig") - public MetadataConfig configProducer() { - return this.config; - } - - private Map getAnalyzers() { - return new Maps.Builder() - .put(ModuleRootPathIndexTerm.TERM, - new FilenameAnalyzer()) - .put(ModuleNameIndexTerm.TERM, - new LowerCaseOnlyAnalyzer()) - .put(PackageNameIndexTerm.TERM, - new LowerCaseOnlyAnalyzer()) - .build(); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/ShowcaseEntryPoint.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/ShowcaseEntryPoint.java deleted file mode 100644 index 7bfa28e26ed..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/ShowcaseEntryPoint.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.client; - -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.inject.Inject; - -import com.google.gwt.animation.client.Animation; -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.Style; -import com.google.gwt.logging.client.LogConfiguration; -import com.google.gwt.user.client.ui.RootPanel; -import org.jboss.errai.common.client.api.Caller; -import org.jboss.errai.ioc.client.api.AfterInitialization; -import org.jboss.errai.ioc.client.api.EntryPoint; -import org.jboss.errai.security.shared.api.identity.User; -import org.jboss.errai.security.shared.service.AuthenticationService; -import org.kie.workbench.common.dmn.showcase.client.perspectives.AuthoringPerspective; -import org.uberfire.client.views.pfly.menu.UserMenu; -import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.client.workbench.widgets.menu.UtilityMenuBar; -import org.uberfire.client.workbench.widgets.menu.WorkbenchMenuBarPresenter; -import org.uberfire.ext.security.management.client.ClientUserSystemManager; -import org.uberfire.mvp.Command; -import org.uberfire.workbench.model.menu.MenuFactory; -import org.uberfire.workbench.model.menu.Menus; - -import static org.uberfire.workbench.model.menu.MenuFactory.newTopLevelMenu; - -@EntryPoint -public class ShowcaseEntryPoint { - - private static Logger LOGGER = Logger.getLogger(ShowcaseEntryPoint.class.getName()); - - private User identity; - private UserMenu userMenu; - private WorkbenchMenuBarPresenter menuBar; - private UtilityMenuBar utilityMenuBar; - private Caller authService; - private ClientUserSystemManager userSystemManager; - private ErrorPopupPresenter errorPopupPresenter; - - public ShowcaseEntryPoint() { - //CDI proxy - } - - @Inject - public ShowcaseEntryPoint(final User identity, - final UserMenu userMenu, - final WorkbenchMenuBarPresenter menubar, - final UtilityMenuBar utilityMenuBar, - final Caller authService, - final ClientUserSystemManager userSystemManager, - final ErrorPopupPresenter errorPopupPresenter) { - this.identity = identity; - this.userMenu = userMenu; - this.menuBar = menubar; - this.utilityMenuBar = utilityMenuBar; - this.authService = authService; - this.userSystemManager = userSystemManager; - this.errorPopupPresenter = errorPopupPresenter; - } - - @AfterInitialization - public void startApp() { - userSystemManager.waitForInitialization(() -> { - setupGlobalErrorHandler(); - setupMenus(); - hideLoadingPopup(); - }); - } - - private void setupGlobalErrorHandler() { - GWT.setUncaughtExceptionHandler(throwable -> { - final String message = "Uncaught error on client side: " + throwable.getMessage(); - errorPopupPresenter.showMessage(message); - log(Level.SEVERE, - throwable.getMessage()); - }); - } - - private void setupMenus() { - for (Menus roleMenus : getRoles()) { - userMenu.addMenus(roleMenus); - } - refreshMenus(); - } - - private void refreshMenus() { - menuBar.clear(); - menuBar.addMenus(createMenuBar()); - final Menus utilityMenus = - MenuFactory.newTopLevelCustomMenu(userMenu) - .endMenu() - .build(); - utilityMenuBar.addMenus(utilityMenus); - } - - private Menus createMenuBar() { - return newTopLevelMenu("Authoring") - .perspective(AuthoringPerspective.PERSPECTIVE_ID) - .endMenu() - .build(); - } - - private List getRoles() { - final List result = new ArrayList<>(identity.getRoles().size()); - result.add(MenuFactory.newSimpleItem("Logout").respondsWith(new LogoutCommand()).endMenu().build()); - identity.getRoles() - .stream() - .filter((r) -> !r.getName().equals("IS_REMEMBER_ME")) - .forEach((r) -> result.add(MenuFactory.newSimpleItem("Role: " + r.getName()).endMenu().build())); - return result; - } - - // Fade out the "Loading application" pop-up - private void hideLoadingPopup() { - final Element e = RootPanel.get("loading").getElement(); - new Animation() { - - @Override - protected void onUpdate(double progress) { - e.getStyle().setOpacity(1.0 - progress); - } - - @Override - protected void onComplete() { - e.getStyle().setVisibility(Style.Visibility.HIDDEN); - } - }.run(500); - } - - private class LogoutCommand implements Command { - - @Override - public void execute() { - authService.call((response) -> { - final String location = GWT.getModuleBaseURL().replaceFirst("/" + GWT.getModuleName() + "/", - "/logout.jsp"); - redirect(location); - }).logout(); - } - } - - public static native void redirect(String url)/*-{ - $wnd.location = url; - }-*/; - - private void log(final Level level, - final String message) { - if (LogConfiguration.loggingIsEnabled()) { - LOGGER.log(level, - message); - } - } -} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/perspectives/AuthoringPerspective.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/perspectives/AuthoringPerspective.java deleted file mode 100644 index 31227cddd0e..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/perspectives/AuthoringPerspective.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.client.perspectives; - -import javax.enterprise.context.ApplicationScoped; - -import org.kie.workbench.common.dmn.showcase.client.screens.editor.DiagramsNavigatorScreen; -import org.kie.workbench.common.dmn.showcase.client.screens.notifications.NotificationsScreen; -import org.kie.workbench.common.dmn.showcase.client.screens.preview.SessionDiagramPreviewScreen; -import org.kie.workbench.common.dmn.showcase.client.screens.properties.SessionPropertiesScreen; -import org.uberfire.client.annotations.Perspective; -import org.uberfire.client.annotations.WorkbenchPerspective; -import org.uberfire.client.workbench.panels.impl.MultiListWorkbenchPanelPresenter; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.mvp.impl.DefaultPlaceRequest; -import org.uberfire.workbench.model.CompassPosition; -import org.uberfire.workbench.model.PanelDefinition; -import org.uberfire.workbench.model.PerspectiveDefinition; -import org.uberfire.workbench.model.impl.PanelDefinitionImpl; -import org.uberfire.workbench.model.impl.PartDefinitionImpl; -import org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl; - -@ApplicationScoped -@WorkbenchPerspective(identifier = AuthoringPerspective.PERSPECTIVE_ID, isTransient = false, isDefault = true) -public class AuthoringPerspective { - - public static final String PERSPECTIVE_ID = "AuthoringPerspective"; - - public static final int EAST_PANEL_WIDTH = 450; - - public static final int EAST_PANEL_HEIGHT = 300; - - @OnStartup - @SuppressWarnings("unused") - public void onStartup(final PlaceRequest placeRequest) { - //Nothing to do, move on... - } - - @Perspective - public PerspectiveDefinition buildPerspective() { - final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); - perspective.setName("Authoring"); - perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest(DiagramsNavigatorScreen.SCREEN_ID))); - - final PanelDefinition previewPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); - previewPanel.setWidth(EAST_PANEL_WIDTH); - previewPanel.setHeight(EAST_PANEL_HEIGHT); - previewPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(SessionDiagramPreviewScreen.SCREEN_ID))); - - final PanelDefinition propertiesPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); - propertiesPanel.setWidth(EAST_PANEL_WIDTH); - propertiesPanel.setHeight(EAST_PANEL_HEIGHT); - propertiesPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(SessionPropertiesScreen.SCREEN_ID))); - propertiesPanel.appendChild(CompassPosition.NORTH, - previewPanel); - - final PanelDefinition notificationsPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); - notificationsPanel.setWidth(400); - notificationsPanel.setHeight(100); - notificationsPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(NotificationsScreen.SCREEN_ID))); - - perspective.getRoot().insertChild(CompassPosition.EAST, - propertiesPanel); - perspective.getRoot().insertChild(CompassPosition.SOUTH, - notificationsPanel); - return perspective; - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/BaseSessionScreen.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/BaseSessionScreen.java deleted file mode 100644 index 51a235ac6fb..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/BaseSessionScreen.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.client.screens; - -import javax.enterprise.event.Observes; - -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvas; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.session.ClientSession; -import org.kie.workbench.common.stunner.core.client.session.event.SessionDestroyedEvent; -import org.kie.workbench.common.stunner.core.client.session.event.SessionDiagramOpenedEvent; -import org.kie.workbench.common.stunner.core.client.session.event.SessionOpenedEvent; -import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -public abstract class BaseSessionScreen { - - private ClientSession session; - - protected abstract void doOpenSession(); - - protected abstract void doOpenDiagram(); - - protected abstract void doCloseSession(); - - public void open(final ClientSession session) { - if (this.session == null) { - this.session = session; - doOpenSession(); - } else if (isSameSession(session)) { - doOpenDiagram(); - } - } - - public void close() { - doCloseSession(); - this.session = null; - } - - @SuppressWarnings("unchecked") - void onCanvasSessionOpened(final @Observes SessionOpenedEvent sessionOpenedEvent) { - checkNotNull("sessionOpenedEvent", - sessionOpenedEvent); - open(sessionOpenedEvent.getSession()); - } - - void onCanvasSessionDestroyed(final @Observes SessionDestroyedEvent sessionDestroyedEvent) { - checkNotNull("sessionDestroyedEvent", - sessionDestroyedEvent); - close(); - } - - void onSessionDiagramOpenedEvent(final @Observes SessionDiagramOpenedEvent sessionDiagramOpenedEvent) { - checkNotNull("sessionDiagramOpenedEvent", - sessionDiagramOpenedEvent); - final AbstractCanvas canvas = getCanvas(); - if (canvas != null && canvas.equals(sessionDiagramOpenedEvent.getSession().getCanvas())) { - // Force to reload current session, for example, when a new diagram is just created. - open(session); - } - } - - protected boolean isSameSession(final ClientSession session) { - final AbstractCanvasHandler handler = getCanvasHandler(); - return handler != null && handler.equals(session.getCanvasHandler()); - } - - protected AbstractCanvasHandler getCanvasHandler() { - return null != session ? session.getCanvasHandler() : null; - } - - protected AbstractCanvas getCanvas() { - return null != session ? session.getCanvas() : null; - } - - protected EditorSession getSession() { - return (EditorSession) session; - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/SessionScreenView.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/SessionScreenView.java deleted file mode 100644 index a5b823f820c..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/SessionScreenView.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.client.screens; - -import com.google.gwt.user.client.ui.IsWidget; - -public interface SessionScreenView extends IsWidget { - - void showEmptySession(); - - void showScreenView(final IsWidget view); - - void clear(); -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/SessionScreenViewImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/SessionScreenViewImpl.java deleted file mode 100644 index ae3a6edef3f..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/SessionScreenViewImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.client.screens; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; - -import com.google.gwt.dom.client.Style; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.Heading; -import org.gwtbootstrap3.client.ui.constants.HeadingSize; - -@Dependent -public class SessionScreenViewImpl implements SessionScreenView { - - private static final String EMPTY_TEXT = "No diagram session active."; - - private final FlowPanel mainPanel = new FlowPanel(); - private final FlowPanel emptyViewPanel = new FlowPanel(); - private final FlowPanel screenViewPanel = new FlowPanel(); - - @PostConstruct - public void init() { - mainPanel.add(emptyViewPanel); - mainPanel.add(screenViewPanel); - mainPanel.setHeight("100%"); - this.emptyViewPanel.setHeight("100%"); - this.emptyViewPanel.getElement().getStyle().setTextAlign(Style.TextAlign.CENTER); - this.screenViewPanel.setHeight("100%"); - this.emptyViewPanel.add(new Heading(HeadingSize.H5, - EMPTY_TEXT)); - showEmptySession(); - } - - @Override - public void showEmptySession() { - emptyViewPanel.setVisible(true); - screenViewPanel.setVisible(false); - } - - @Override - public void showScreenView(final IsWidget viewWidget) { - emptyViewPanel.setVisible(false); - setScreenView(viewWidget); - screenViewPanel.setVisible(true); - } - - @Override - public void clear() { - this.screenViewPanel.clear(); - } - - private SessionScreenView setScreenView(final IsWidget view) { - this.screenViewPanel.clear(); - this.screenViewPanel.add(view); - return this; - } - - @Override - public Widget asWidget() { - return mainPanel; - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/ShowcaseDiagramService.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/ShowcaseDiagramService.java deleted file mode 100644 index c30b5ccea4f..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/ShowcaseDiagramService.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.client.screens; - -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; - -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; -import org.kie.workbench.common.stunner.core.client.canvas.export.CanvasExport; -import org.kie.workbench.common.stunner.core.client.canvas.export.CanvasURLExportSettings; -import org.kie.workbench.common.stunner.core.client.service.ClientDiagramServiceImpl; -import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; -import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; -import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.kie.workbench.common.stunner.core.graph.Graph; -import org.kie.workbench.common.stunner.core.lookup.LookupManager; -import org.kie.workbench.common.stunner.core.lookup.diagram.DiagramLookupRequest; -import org.kie.workbench.common.stunner.core.lookup.diagram.DiagramRepresentation; -import org.uberfire.backend.vfs.Path; - -@ApplicationScoped -public class ShowcaseDiagramService { - - private final ClientDiagramServiceImpl clientDiagramServices; - private final CanvasExport canvasExport; - - protected ShowcaseDiagramService() { - this(null, - null); - } - - @Inject - public ShowcaseDiagramService(final ClientDiagramServiceImpl clientDiagramServices, - final CanvasExport canvasExport) { - this.clientDiagramServices = clientDiagramServices; - this.canvasExport = canvasExport; - } - - public void loadByName(final String name, - final ServiceCallback callback) { - final DiagramLookupRequest request = new DiagramLookupRequest.Builder().withName(name).build(); - clientDiagramServices.lookup(request, - new ServiceCallback>() { - @Override - public void onSuccess(LookupManager.LookupResponse diagramRepresentations) { - if (null != diagramRepresentations && !diagramRepresentations.getResults().isEmpty()) { - final Path path = diagramRepresentations.getResults().get(0).getPath(); - loadByPath(path, - callback); - } - } - - @Override - public void onError(final ClientRuntimeError error) { - callback.onError(error); - } - }); - } - - @SuppressWarnings("unchecked") - public void loadByPath(final Path path, - final ServiceCallback callback) { - clientDiagramServices.getByPath(path, - new ServiceCallback>() { - @Override - public void onSuccess(final Diagram diagram) { - callback.onSuccess(diagram); - } - - @Override - public void onError(final ClientRuntimeError error) { - callback.onError(error); - } - }); - } - - @SuppressWarnings("unchecked") - public void save(final Diagram diagram, - final ServiceCallback> diagramServiceCallback) { - // Perform update operation remote call. - clientDiagramServices.saveOrUpdate(diagram, - diagramServiceCallback); - } - - public void save(final EditorSession session, - final ServiceCallback> diagramServiceCallback) { - // Update diagram's image data as thumbnail. - final String thumbData = toImageData(session); - final CanvasHandler canvasHandler = session.getCanvasHandler(); - final Diagram diagram = canvasHandler.getDiagram(); - diagram.getMetadata().setThumbData(thumbData); - save(diagram, - diagramServiceCallback); - } - - private String toImageData(final EditorSession session) { - return canvasExport.toImageData(session.getCanvasHandler(), - CanvasURLExportSettings.build(CanvasExport.URLDataType.JPG)); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/DiagramsNavigatorScreen.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/DiagramsNavigatorScreen.java deleted file mode 100644 index d950729fc0d..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/DiagramsNavigatorScreen.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.client.screens.editor; - -import java.util.HashMap; -import java.util.Map; -import java.util.function.Consumer; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.enterprise.event.Observes; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.IsWidget; -import org.kie.workbench.common.stunner.client.widgets.event.LoadDiagramEvent; -import org.kie.workbench.common.stunner.client.widgets.explorer.navigator.diagrams.DiagramsNavigator; -import org.kie.workbench.common.stunner.client.widgets.menu.dev.ShapeSetsMenuItemsBuilder; -import org.kie.workbench.common.stunner.core.client.ShapeSet; -import org.uberfire.client.annotations.WorkbenchMenu; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.mvp.impl.DefaultPlaceRequest; -import org.uberfire.workbench.model.menu.MenuFactory; -import org.uberfire.workbench.model.menu.Menus; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -@Dependent -@WorkbenchScreen(identifier = DiagramsNavigatorScreen.SCREEN_ID) -public class DiagramsNavigatorScreen { - - private static Logger LOGGER = Logger.getLogger(DiagramsNavigatorScreen.class.getName()); - - public static final String SCREEN_ID = "DiagramsNavigatorScreen"; - public static final String NO_ITEM_SELECTED = "No diagram selected!"; - - private DiagramsNavigator diagramsNavigator; - private ShapeSetsMenuItemsBuilder newDiagramMenuItemsBuilder; - private ErrorPopupPresenter errorPopupPresenter; - private PlaceManager placeManager; - - private Menus menu = null; - private String selectedDiagramName; - - public DiagramsNavigatorScreen() { - //CDI proxy - } - - @Inject - public DiagramsNavigatorScreen(final DiagramsNavigator diagramsNavigator, - final ShapeSetsMenuItemsBuilder newDiagramMenuItemsBuilder, - final ErrorPopupPresenter errorPopupPresenter, - final PlaceManager placeManager) { - this.diagramsNavigator = diagramsNavigator; - this.newDiagramMenuItemsBuilder = newDiagramMenuItemsBuilder; - this.errorPopupPresenter = errorPopupPresenter; - this.placeManager = placeManager; - } - - @PostConstruct - public void init() { - this.selectedDiagramName = null; - } - - @OnStartup - @SuppressWarnings("unused") - public void onStartup(final PlaceRequest placeRequest) { - this.menu = makeMenuBar(); - clear(); - } - - private Menus makeMenuBar() { - final MenuFactory.TopLevelMenusBuilder m = - MenuFactory - .newTopLevelMenu("Load diagrams from server") - .respondsWith(() -> diagramsNavigator.show()) - .endMenu() - .newTopLevelMenu("Edit") - .respondsWith(this::editSelected) - .endMenu(); - m.newTopLevelMenu(newDiagramMenuItemsBuilder.build("Create", - "Create a new", - DiagramsNavigatorScreen.this::create)).endMenu(); - return m.build(); - } - - private void clear() { - diagramsNavigator.clear(); - selectedDiagramName = null; - } - - @OnClose - public void onClose() { - clear(); - } - - @WorkbenchMenu - public void getMenus(final Consumer menusConsumer) { - menusConsumer.accept(menu); - } - - @WorkbenchPartTitle - public String getTitle() { - return "Diagrams Navigator"; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return diagramsNavigator.asWidget(); - } - - private void onLoadDiagramEvent(final @Observes LoadDiagramEvent loadDiagramEvent) { - checkNotNull("loadDiagramEvent", - loadDiagramEvent); - this.selectedDiagramName = loadDiagramEvent.getName(); - } - - private void editSelected() { - if (checkItemSelected()) { - final Map params = new HashMap(); - params.put("name", - this.selectedDiagramName); - edit(params); - } - } - - private boolean checkItemSelected() { - if (null != selectedDiagramName) { - return true; - } else { - LOGGER.log(Level.WARNING, - NO_ITEM_SELECTED); - errorPopupPresenter.showMessage(NO_ITEM_SELECTED); - return false; - } - } - - private void edit(final Map params) { - final PlaceRequest diagramScreenPlaceRequest = new DefaultPlaceRequest(SessionDiagramEditorScreen.SCREEN_ID, - params); - placeManager.goTo(diagramScreenPlaceRequest); - } - - private void create(final ShapeSet shapeSet) { - final String shapeSetName = shapeSet.getDescription(); - final String defSetId = shapeSet.getDefinitionSetId(); - final Map params = new HashMap(); - params.put("defSetId", - defSetId); - params.put("shapeSetId", - shapeSet.getId()); - params.put("title", - "New " + shapeSetName + " diagram"); - edit(params); - } -} \ No newline at end of file diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/SessionDiagramEditorScreen.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/SessionDiagramEditorScreen.java deleted file mode 100644 index 69f641b9afa..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/SessionDiagramEditorScreen.java +++ /dev/null @@ -1,609 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.client.screens.editor; - -import java.util.Collection; -import java.util.function.Consumer; -import java.util.function.Supplier; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.enterprise.event.Event; -import javax.enterprise.event.Observes; -import javax.inject.Inject; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.logging.client.LogConfiguration; -import com.google.gwt.user.client.ui.IsWidget; -import elemental2.dom.HTMLElement; -import org.jboss.errai.common.client.ui.ElementWrapperWidget; -import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; -import org.kie.workbench.common.dmn.client.commands.general.NavigateToExpressionEditorCommand; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorDock; -import org.kie.workbench.common.dmn.client.editors.expressions.ExpressionEditorView; -import org.kie.workbench.common.dmn.client.editors.included.IncludedModelsPage; -import org.kie.workbench.common.dmn.client.editors.included.imports.IncludedModelsPageStateProviderImpl; -import org.kie.workbench.common.dmn.client.editors.search.DMNEditorSearchIndex; -import org.kie.workbench.common.dmn.client.editors.search.DMNSearchableElement; -import org.kie.workbench.common.dmn.client.editors.toolbar.ToolbarStateHandler; -import org.kie.workbench.common.dmn.client.editors.types.DataTypePageTabActiveEvent; -import org.kie.workbench.common.dmn.client.editors.types.DataTypesPage; -import org.kie.workbench.common.dmn.client.editors.types.listview.common.DataTypeEditModeToggleEvent; -import org.kie.workbench.common.dmn.client.events.EditExpressionEvent; -import org.kie.workbench.common.dmn.client.session.DMNSession; -import org.kie.workbench.common.dmn.client.widgets.toolbar.DMNEditorToolbar; -import org.kie.workbench.common.dmn.showcase.client.perspectives.AuthoringPerspective; -import org.kie.workbench.common.dmn.showcase.client.screens.ShowcaseDiagramService; -import org.kie.workbench.common.stunner.client.widgets.event.SessionFocusedEvent; -import org.kie.workbench.common.stunner.client.widgets.menu.dev.MenuDevCommandsBuilder; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionPresenter; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; -import org.kie.workbench.common.stunner.client.widgets.views.session.ScreenErrorView; -import org.kie.workbench.common.stunner.client.widgets.views.session.ScreenPanelView; -import org.kie.workbench.common.stunner.core.api.DefinitionManager; -import org.kie.workbench.common.stunner.core.client.annotation.DiagramEditor; -import org.kie.workbench.common.stunner.core.client.api.SessionManager; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; -import org.kie.workbench.common.stunner.core.client.command.SessionCommandManager; -import org.kie.workbench.common.stunner.core.client.components.layout.LayoutHelper; -import org.kie.workbench.common.stunner.core.client.components.layout.OpenDiagramLayoutExecutor; -import org.kie.workbench.common.stunner.core.client.service.ClientFactoryService; -import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; -import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; -import org.kie.workbench.common.stunner.core.client.session.ClientSession; -import org.kie.workbench.common.stunner.core.client.session.Session; -import org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.event.OnSessionErrorEvent; -import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.kie.workbench.common.stunner.core.diagram.MetadataImpl; -import org.kie.workbench.common.stunner.core.documentation.DocumentationPage; -import org.kie.workbench.common.stunner.core.documentation.DocumentationView; -import org.kie.workbench.common.stunner.core.graph.Graph; -import org.kie.workbench.common.stunner.core.rule.RuleViolation; -import org.kie.workbench.common.stunner.core.util.UUID; -import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; -import org.kie.workbench.common.stunner.core.validation.Violation; -import org.kie.workbench.common.stunner.core.validation.impl.ValidationUtils; -import org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent; -import org.kie.workbench.common.widgets.client.search.component.SearchBarComponent; -import org.kie.workbench.common.widgets.metadata.client.KieEditorWrapperView; -import org.uberfire.client.annotations.WorkbenchContextId; -import org.uberfire.client.annotations.WorkbenchMenu; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.client.views.pfly.multipage.MultiPageEditorSelectedPageEvent; -import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; -import org.uberfire.ext.widgets.common.client.common.BusyPopup; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnFocus; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.Command; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.menu.MenuFactory; -import org.uberfire.workbench.model.menu.MenuItem; -import org.uberfire.workbench.model.menu.Menus; - -@Dependent -@DiagramEditor -@WorkbenchScreen(identifier = SessionDiagramEditorScreen.SCREEN_ID) -public class SessionDiagramEditorScreen implements KieEditorWrapperView.KieEditorWrapperPresenter { - - public static final String SCREEN_ID = "SessionDiagramEditorScreen"; - static final int DATA_TYPES_PAGE_INDEX = 1; - private static Logger LOGGER = Logger.getLogger(SessionDiagramEditorScreen.class.getName()); - private final DefinitionManager definitionManager; - private final ClientFactoryService clientFactoryServices; - private final ShowcaseDiagramService diagramService; - private final SessionManager sessionManager; - private final SessionCommandManager sessionCommandManager; - private final SessionEditorPresenter presenter; - private final Event changeTitleNotificationEvent; - private final Event sessionFocusedEvent; - private final Event refreshFormPropertiesEvent; - private final MenuDevCommandsBuilder menuDevCommandsBuilder; - private final ScreenPanelView screenPanelView; - private final ScreenErrorView screenErrorView; - private final DecisionNavigatorDock decisionNavigatorDock; - private final LayoutHelper layoutHelper; - private final OpenDiagramLayoutExecutor layoutExecutor; - private final KieEditorWrapperView kieView; - private final DataTypesPage dataTypesPage; - private final IncludedModelsPage includedModelsPage; - private final IncludedModelsPageStateProviderImpl importsPageProvider; - private final DocumentationView documentationView; - private final DMNEditorSearchIndex editorSearchIndex; - private final SearchBarComponent searchBarComponent; - - private PlaceRequest placeRequest; - private String title = "Authoring Screen"; - private Menus menu = null; - - @Inject - public SessionDiagramEditorScreen(final DefinitionManager definitionManager, - final ClientFactoryService clientFactoryServices, - final ShowcaseDiagramService diagramService, - final SessionManager sessionManager, - final @Session SessionCommandManager sessionCommandManager, - final SessionEditorPresenter presenter, - final Event changeTitleNotificationEvent, - final Event sessionFocusedEvent, - final Event refreshFormPropertiesEvent, - final MenuDevCommandsBuilder menuDevCommandsBuilder, - final ScreenPanelView screenPanelView, - final ScreenErrorView screenErrorView, - final DecisionNavigatorDock decisionNavigatorDock, - final LayoutHelper layoutHelper, - final KieEditorWrapperView kieView, - final DataTypesPage dataTypesPage, - final OpenDiagramLayoutExecutor layoutExecutor, - final IncludedModelsPage includedModelsPage, - final IncludedModelsPageStateProviderImpl importsPageProvider, - final @DMNEditor DocumentationView documentationView, - final DMNEditorSearchIndex editorSearchIndex, - final SearchBarComponent searchBarComponent) { - this.definitionManager = definitionManager; - this.clientFactoryServices = clientFactoryServices; - this.diagramService = diagramService; - this.sessionManager = sessionManager; - this.sessionCommandManager = sessionCommandManager; - this.presenter = presenter; - this.changeTitleNotificationEvent = changeTitleNotificationEvent; - this.sessionFocusedEvent = sessionFocusedEvent; - this.refreshFormPropertiesEvent = refreshFormPropertiesEvent; - this.menuDevCommandsBuilder = menuDevCommandsBuilder; - this.screenPanelView = screenPanelView; - this.screenErrorView = screenErrorView; - this.decisionNavigatorDock = decisionNavigatorDock; - this.layoutHelper = layoutHelper; - this.kieView = kieView; - this.dataTypesPage = dataTypesPage; - this.layoutExecutor = layoutExecutor; - this.includedModelsPage = includedModelsPage; - this.importsPageProvider = importsPageProvider; - this.documentationView = documentationView; - this.editorSearchIndex = editorSearchIndex; - this.searchBarComponent = searchBarComponent; - } - - @PostConstruct - public void init() { - decisionNavigatorDock.init(AuthoringPerspective.PERSPECTIVE_ID); - - kieView.setPresenter(this); - kieView.clear(); - kieView.addMainEditorPage(screenPanelView.asWidget()); - kieView.getMultiPage().addPage(dataTypesPage); - kieView.getMultiPage().addPage(includedModelsPage); - kieView.getMultiPage().addPage(getDocumentationPage()); - - setupEditorSearchIndex(); - setupSearchComponent(); - } - - private void setupEditorSearchIndex() { - editorSearchIndex.setCurrentAssetHashcodeSupplier(getHashcodeSupplier()); - editorSearchIndex.setIsDataTypesTabActiveSupplier(getIsDataTypesTabActiveSupplier()); - } - - Supplier getHashcodeSupplier() { - return () -> getDiagram().hashCode(); - } - - Supplier getIsDataTypesTabActiveSupplier() { - return () -> { - final int selectedPageIndex = kieView.getMultiPage().selectedPage(); - return selectedPageIndex == DATA_TYPES_PAGE_INDEX; - }; - } - - void setupSearchComponent() { - final HTMLElement element = searchBarComponent.getView().getElement(); - - searchBarComponent.init(editorSearchIndex); - kieView.getMultiPage().addTabBarWidget(getWidget(element)); - } - - DocumentationPage getDocumentationPage() { - return new DocumentationPage(documentationView, "Documentation", () -> { /* Nothing. */ }, () -> true); - } - - public void onDataTypePageNavTabActiveEvent(final @Observes DataTypePageTabActiveEvent event) { - kieView.getMultiPage().selectPage(DATA_TYPES_PAGE_INDEX); - } - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.placeRequest = placeRequest; - this.menu = makeMenuBar(); - final String name = placeRequest.getParameter("name", - ""); - final boolean isCreate = name == null || name.trim().length() == 0; - final Command callback = getOnStartupDiagramEditorCallback(); - if (isCreate) { - final String defSetId = placeRequest.getParameter("defSetId", - ""); - final String shapeSetd = placeRequest.getParameter("shapeSetId", - ""); - final String title = placeRequest.getParameter("title", - ""); - // Create a new diagram. - newDiagram(UUID.uuid(), - title, - defSetId, - shapeSetd, - callback); - } else { - // Load an existing diagram. - load(name, - callback); - } - } - - Command getOnStartupDiagramEditorCallback() { - return () -> { - - final Diagram diagram = getDiagram(); - - if (null != diagram) { - updateTitle(diagram.getMetadata().getTitle()); - documentationView.initialize(diagram); - } - }; - } - - public void onDataTypeEditModeToggle(final @Observes DataTypeEditModeToggleEvent editModeToggleEvent) { - - if (editModeToggleEvent.isEditModeEnabled()) { - disableSaveMenuItem(); - } else { - enableSaveMenuItem(); - } - } - - private void disableSaveMenuItem() { - getSaveMenuItem(saveMenuItem -> saveMenuItem.setEnabled(false)); - } - - private void enableSaveMenuItem() { - getSaveMenuItem(saveMenuItem -> saveMenuItem.setEnabled(true)); - } - - private void getSaveMenuItem(final Consumer saveMenuItemConsumer) { - getMenu(menus -> saveMenuItemConsumer.accept(menus.getItems().get(0))); - } - - private Menus makeMenuBar() { - final MenuFactory.TopLevelMenusBuilder m = - MenuFactory - .newTopLevelMenu("Save") - .respondsWith(getSaveCommand()) - .endMenu(); - m.newTopLevelMenu(menuDevCommandsBuilder.build()).endMenu(); - return m.build(); - } - - private Command getSaveCommand() { - return this::validateAndSave; - } - - private void validateAndSave() { - final Command save = this::save; - final DMNEditorToolbar toolbar = (DMNEditorToolbar) presenter.getToolbar(); - toolbar - .getValidateCommand() - .execute(new ClientSessionCommand.Callback>>() { - @Override - public void onSuccess() { - log(Level.INFO, - "Validation success."); - save.execute(); - } - - @Override - public void onError(final Collection> violations) { - log(Level.WARNING, - "Validation failed [violations=" + violations.toString() + "]."); - // Allow saving when only warnings founds. - final Violation.Type maxSeverity = ValidationUtils.getMaxSeverity(violations); - if (!maxSeverity.equals(Violation.Type.ERROR)) { - save.execute(); - } - } - }); - } - - private void save() { - diagramService.save(getSession(), - new ServiceCallback>() { - @Override - public void onSuccess(Diagram item) { - log(Level.INFO, - "Save operation finished for diagram [" + item.getName() + "]."); - } - - @Override - public void onError(ClientRuntimeError error) { - showError(error); - } - }); - } - - private void newDiagram(final String uuid, - final String title, - final String definitionSetId, - final String shapeSetId, - final Command callback) { - BusyPopup.showMessage("Loading"); - final Metadata metadata = buildMetadata(definitionSetId, - shapeSetId, - title); - clientFactoryServices.newDiagram(uuid, - definitionSetId, - metadata, - new ServiceCallback() { - @Override - public void onSuccess(final Diagram diagram) { - final Metadata metadata = diagram.getMetadata(); - metadata.setShapeSetId(shapeSetId); - metadata.setTitle(title); - open(diagram, - callback); - } - - @Override - public void onError(final ClientRuntimeError error) { - showError(error); - callback.execute(); - } - }); - } - - private Metadata buildMetadata(final String defSetId, - final String shapeSetId, - final String title) { - return new MetadataImpl.MetadataImplBuilder(defSetId, - definitionManager) - .setTitle(title) - .setShapeSetId(shapeSetId) - .build(); - } - - public void onMultiPageEditorSelectedPageEvent(final @Observes MultiPageEditorSelectedPageEvent event) { - searchBarComponent.disableSearch(); - } - - public void onRefreshFormPropertiesEvent(final @Observes RefreshFormPropertiesEvent event) { - searchBarComponent.disableSearch(); - } - - private void load(final String name, - final Command callback) { - BusyPopup.showMessage("Loading"); - diagramService.loadByName(name, - new ServiceCallback() { - @Override - public void onSuccess(final Diagram diagram) { - open(diagram, - callback); - } - - @Override - public void onError(final ClientRuntimeError error) { - showError(error); - callback.execute(); - } - }); - } - - void open(final Diagram diagram, - final Command callback) { - screenPanelView.setWidget(presenter.getView()); - layoutHelper.applyLayout(diagram, layoutExecutor); - presenter - .withToolbar(true) - .withPalette(true) - .displayNotifications(type -> true) - .open(diagram, - new ScreenPresenterCallback(() -> { - final ToolbarStateHandler toolbarStateHandler = new StandaloneToolbarStateHandler((DMNEditorToolbar) presenter.getToolbar()); - final ExpressionEditorView.Presenter expressionEditor = ((DMNSession) sessionManager.getCurrentSession()).getExpressionEditor(); - expressionEditor.setToolbarStateHandler(toolbarStateHandler); - dataTypesPage.reload(); - dataTypesPage.enableShortcuts(); - includedModelsPage.setup(importsPageProvider.withDiagram(diagram)); - setupCanvasHandler(presenter.getInstance()); - openDock(); - callback.execute(); - })); - } - - @OnFocus - public void onFocus() { - final EditorSession session = presenter.getInstance(); - GWT.log("FOCUS [" + session + "]"); - if (null != session) { - sessionFocusedEvent.fire(new SessionFocusedEvent(session)); - } - } - - private boolean isSameSession(final ClientSession other) { - return null != other && null != getSession() && other.equals(getSession()); - } - - @OnClose - public void onClose() { - destroyDock(); - destroySession(); - dataTypesPage.disableShortcuts(); - } - - void setupCanvasHandler(final EditorSession session) { - decisionNavigatorDock.setupCanvasHandler(session.getCanvasHandler()); - } - - void openDock() { - decisionNavigatorDock.open(); - } - - void destroyDock() { - decisionNavigatorDock.close(); - decisionNavigatorDock.resetContent(); - } - - void destroySession() { - presenter.destroy(); - } - - @WorkbenchMenu - public void getMenu(final Consumer menusConsumer) { - menusConsumer.accept(menu); - } - - @WorkbenchPartTitle - public String getTitle() { - return title; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return kieView.asWidget(); - } - - @WorkbenchContextId - public String getMyContextRef() { - return "sessionDiagramEditorScreenContext"; - } - - @Override - public void onSourceTabSelected() { - - } - - @Override - public void onEditTabSelected() { - - } - - @Override - public void onEditTabUnselected() { - - } - - @Override - public void onOverviewSelected() { - - } - - void updateTitle(final String title) { - // Change screen title. - SessionDiagramEditorScreen.this.title = title; - changeTitleNotificationEvent.fire(new ChangeTitleWidgetEvent(placeRequest, - this.title)); - } - - private EditorSession getSession() { - return null != presenter ? presenter.getInstance() : null; - } - - private CanvasHandler getCanvasHandler() { - return null != getSession() ? getSession().getCanvasHandler() : null; - } - - Diagram getDiagram() { - return null != getCanvasHandler() ? getCanvasHandler().getDiagram() : null; - } - - private void showError(final ClientRuntimeError error) { - screenErrorView.showError(error); - screenPanelView.setWidget(screenErrorView.asWidget()); - log(Level.SEVERE, - error.toString()); - BusyPopup.close(); - } - - private void onSessionErrorEvent(@Observes OnSessionErrorEvent errorEvent) { - if (isSameSession(errorEvent.getSession())) { - showError(errorEvent.getError()); - } - } - - void onEditExpressionEvent(final @Observes EditExpressionEvent event) { - searchBarComponent.disableSearch(); - if (isSameSession(event.getSession())) { - final DMNSession session = sessionManager.getCurrentSession(); - final ExpressionEditorView.Presenter expressionEditor = session.getExpressionEditor(); - sessionCommandManager.execute(session.getCanvasHandler(), - new NavigateToExpressionEditorCommand(expressionEditor, - presenter, - sessionManager, - sessionCommandManager, - refreshFormPropertiesEvent, - event.getNodeUUID(), - event.getHasExpression(), - event.getHasName(), - event.isOnlyVisualChangeAllowed())); - } - } - - private void log(final Level level, - final String message) { - if (LogConfiguration.loggingIsEnabled()) { - LOGGER.log(level, - message); - } - } - - ElementWrapperWidget getWidget(final HTMLElement element) { - return ElementWrapperWidget.getWidget(element); - } - - private final class ScreenPresenterCallback implements SessionPresenter.SessionPresenterCallback { - - private final Command callback; - - private ScreenPresenterCallback(final Command callback) { - this.callback = callback; - } - - @Override - public void afterSessionOpened() { - - } - - @Override - public void afterCanvasInitialized() { - - } - - @Override - public void onSuccess() { - BusyPopup.close(); - callback.execute(); - } - - @Override - public void onError(final ClientRuntimeError error) { - showError(error); - callback.execute(); - } - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/StandaloneToolbarStateHandler.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/StandaloneToolbarStateHandler.java deleted file mode 100644 index 20b5bdeb9b2..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/StandaloneToolbarStateHandler.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.dmn.showcase.client.screens.editor; - -import org.kie.workbench.common.dmn.client.editors.toolbar.ToolbarStateHandler; -import org.kie.workbench.common.dmn.client.widgets.toolbar.DMNEditorToolbar; -import org.kie.workbench.common.stunner.client.widgets.toolbar.ToolbarCommand; - -public class StandaloneToolbarStateHandler implements ToolbarStateHandler { - - private DMNEditorToolbar toolbar; - - //Package-protected for Unit Tests - private boolean visitGraphToolbarCommandEnabled = false; - private boolean clearToolbarCommandEnabled = false; - private boolean deleteSelectionToolbarCommandEnabled = false; - private boolean switchGridToolbarCommandEnabled = false; - private boolean undoToolbarCommandEnabled = false; - private boolean redoToolbarCommandEnabled = false; - private boolean exportToPngToolbarCommandEnabled = false; - private boolean exportToJpgToolbarCommandEnabled = false; - private boolean exportToPdfToolbarCommandEnabled = false; - private boolean copyCommandEnabled = false; - private boolean cutCommandEnabled = false; - private boolean pasteCommandEnabled = false; - private boolean saveCommandEnabled = false; - - public StandaloneToolbarStateHandler(final DMNEditorToolbar toolbar) { - this.toolbar = toolbar; - } - - @Override - @SuppressWarnings("unchecked") - public void enterGridView() { - this.visitGraphToolbarCommandEnabled = toolbar.isEnabled((ToolbarCommand) toolbar.getVisitGraphToolbarCommand()); - this.clearToolbarCommandEnabled = toolbar.isEnabled(toolbar.getClearToolbarCommand()); - this.deleteSelectionToolbarCommandEnabled = toolbar.isEnabled(toolbar.getDeleteSelectionToolbarCommand()); - this.switchGridToolbarCommandEnabled = toolbar.isEnabled(toolbar.getSwitchGridToolbarCommand()); - this.undoToolbarCommandEnabled = toolbar.isEnabled(toolbar.getUndoToolbarCommand()); - this.redoToolbarCommandEnabled = toolbar.isEnabled(toolbar.getRedoToolbarCommand()); - this.exportToPngToolbarCommandEnabled = toolbar.isEnabled((ToolbarCommand) toolbar.getExportToPngToolbarCommand()); - this.exportToJpgToolbarCommandEnabled = toolbar.isEnabled((ToolbarCommand) toolbar.getExportToJpgToolbarCommand()); - this.exportToPdfToolbarCommandEnabled = toolbar.isEnabled((ToolbarCommand) toolbar.getExportToPdfToolbarCommand()); - this.copyCommandEnabled = toolbar.isEnabled(toolbar.getCopyToolbarCommand()); - this.cutCommandEnabled = toolbar.isEnabled(toolbar.getCutToolbarCommand()); - this.pasteCommandEnabled = toolbar.isEnabled(toolbar.getPasteToolbarCommand()); - this.saveCommandEnabled = toolbar.isEnabled(toolbar.getSaveToolbarCommand()); - - enableToolbarCommand(toolbar.getVisitGraphToolbarCommand(), - false); - enableToolbarCommand(toolbar.getClearToolbarCommand(), - false); - enableToolbarCommand(toolbar.getDeleteSelectionToolbarCommand(), - false); - enableToolbarCommand(toolbar.getSwitchGridToolbarCommand(), - false); - enableToolbarCommand(toolbar.getUndoToolbarCommand(), - false); - enableToolbarCommand(toolbar.getRedoToolbarCommand(), - false); - enableToolbarCommand(toolbar.getExportToPngToolbarCommand(), - false); - enableToolbarCommand(toolbar.getExportToJpgToolbarCommand(), - false); - enableToolbarCommand(toolbar.getExportToPdfToolbarCommand(), - false); - enableToolbarCommand(toolbar.getCopyToolbarCommand(), - false); - enableToolbarCommand(toolbar.getCutToolbarCommand(), - false); - enableToolbarCommand(toolbar.getPasteToolbarCommand(), - false); - enableToolbarCommand(toolbar.getSaveToolbarCommand(), - false); - } - - @Override - public void enterGraphView() { - enableToolbarCommand(toolbar.getVisitGraphToolbarCommand(), - visitGraphToolbarCommandEnabled); - enableToolbarCommand(toolbar.getClearToolbarCommand(), - clearToolbarCommandEnabled); - enableToolbarCommand(toolbar.getDeleteSelectionToolbarCommand(), - deleteSelectionToolbarCommandEnabled); - enableToolbarCommand(toolbar.getSwitchGridToolbarCommand(), - switchGridToolbarCommandEnabled); - enableToolbarCommand(toolbar.getUndoToolbarCommand(), - undoToolbarCommandEnabled); - enableToolbarCommand(toolbar.getRedoToolbarCommand(), - redoToolbarCommandEnabled); - enableToolbarCommand(toolbar.getExportToPngToolbarCommand(), - exportToPngToolbarCommandEnabled); - enableToolbarCommand(toolbar.getExportToJpgToolbarCommand(), - exportToJpgToolbarCommandEnabled); - enableToolbarCommand(toolbar.getExportToPdfToolbarCommand(), - exportToPdfToolbarCommandEnabled); - enableToolbarCommand(toolbar.getCopyToolbarCommand(), - copyCommandEnabled); - enableToolbarCommand(toolbar.getCutToolbarCommand(), - cutCommandEnabled); - enableToolbarCommand(toolbar.getPasteToolbarCommand(), - pasteCommandEnabled); - enableToolbarCommand(toolbar.getSaveToolbarCommand(), - saveCommandEnabled); - } - - @SuppressWarnings("unchecked") - private void enableToolbarCommand(final ToolbarCommand command, - final boolean enabled) { - if (enabled) { - toolbar.enable(command); - } else { - toolbar.disable(command); - } - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/notifications/Notifications.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/notifications/Notifications.java deleted file mode 100644 index 7e52719e8fb..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/notifications/Notifications.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.client.screens.notifications; - -import java.util.List; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.cell.client.Cell; -import com.google.gwt.cell.client.TextCell; -import com.google.gwt.user.cellview.client.Column; -import com.google.gwt.user.cellview.client.ColumnSortEvent; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.Widget; -import com.google.gwt.view.client.HasData; -import com.google.gwt.view.client.ListDataProvider; -import org.kie.workbench.common.stunner.client.widgets.notification.Notification; -import org.kie.workbench.common.stunner.client.widgets.notification.NotificationsObserver; -import org.uberfire.client.mvp.UberView; - -@Dependent -public class Notifications implements IsWidget { - - public interface View extends UberView { - - View setColumnSortHandler(final ColumnSortEvent.ListHandler sortHandler); - - View addColumn(final Column column, - final String name); - - View removeColumn(final int index); - - int getColumnCount(); - - View redraw(); - - View clear(); - } - - private final View view; - private final NotificationsObserver notificationsObserver; - - final ListDataProvider logsProvider = new ListDataProvider(); - - @Inject - public Notifications(final View view, - final NotificationsObserver notificationsObserver) { - this.view = view; - this.notificationsObserver = notificationsObserver; - } - - @PostConstruct - public void init() { - view.init(this); - notificationsObserver.onNotification(this::add); - notificationsObserver.onValidationFailed(this::add); - buildViewColumns(); - } - - @Override - public Widget asWidget() { - return view.asWidget(); - } - - public void add(final Notification notification) { - if (null != notification) { - addLogEntry(notification); - view.redraw(); - } - } - - public void clear() { - logsProvider.getList().clear(); - view.clear(); - } - - public void addDataDisplay(final HasData display) { - logsProvider.addDataDisplay(display); - } - - protected void buildViewColumns() { - //Remove existing columns should this be called again.. - int columnCount = view.getColumnCount(); - while (columnCount > 0) { - view.removeColumn(0); - columnCount = view.getColumnCount(); - } - - // Attach a column sort handler to the ListDataProvider to sort the list. - final ColumnSortEvent.ListHandler sortHandler = new ColumnSortEvent.ListHandler<>(logsProvider.getList()); - view.setColumnSortHandler(sortHandler); - - // Log's type. - view.addColumn(createTypeColumn(sortHandler), - "Type"); - - // Log element's UUID. - view.addColumn(createContextColumn(), - "Context"); - - // Log's message. - view.addColumn(createMessageColumn(), - "Message"); - } - - private void addLogEntry(final Notification entry) { - List logs = logsProvider.getList(); - logs.remove(entry); - logs.add(entry); - } - - private Column createTypeColumn(final ColumnSortEvent.ListHandler sortHandler) { - final Cell typeCell = new TextCell(); - final Column typeColumn = new Column(typeCell) { - @Override - public String getValue(final Notification object) { - return getNotificationTypeMessage(object); - } - }; - typeColumn.setSortable(true); - sortHandler.setComparator(typeColumn, - (o1, o2) -> o1.getType().compareTo(o2.getType())); - return typeColumn; - } - - private Column createContextColumn() { - final Cell contextCell = new TextCell(); - final Column contextColumn = new Column(contextCell) { - @Override - public String getValue(final Notification object) { - return getNotificationContextMessage(object); - } - }; - contextColumn.setSortable(false); - return contextColumn; - } - - private com.google.gwt.user.cellview.client.Column createMessageColumn() { - final Cell messageCell = new TextCell(); - final Column messageColumn = new Column(messageCell) { - @Override - public String getValue(final Notification object) { - return getNotificationMessage(object); - } - }; - messageColumn.setSortable(false); - return messageColumn; - } - - @SuppressWarnings("unchecked") - private String getNotificationMessage(final Notification notification) { - return notification.getMessage(); - } - - @SuppressWarnings("unchecked") - private String getNotificationContextMessage(final Notification notification) { - return notification.getContext() != null ? - notification.getContext().toString() : - "-- No context --"; - } - - @SuppressWarnings("unchecked") - private String getNotificationTypeMessage(final Notification notification) { - return notification.getType() != null ? - notification.getType().name() : - "-- No type --"; - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/notifications/NotificationsScreen.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/notifications/NotificationsScreen.java deleted file mode 100644 index bbf40196770..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/notifications/NotificationsScreen.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.client.screens.notifications; - -import java.util.function.Consumer; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.IsWidget; -import org.uberfire.client.annotations.WorkbenchMenu; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.menu.MenuFactory; -import org.uberfire.workbench.model.menu.Menus; - -@Dependent -@WorkbenchScreen(identifier = NotificationsScreen.SCREEN_ID) -public class NotificationsScreen { - - public static final String SCREEN_ID = "NotificationsScreen"; - public static final String TITLE = "Notifications"; - - private Notifications notifications; - - private Menus menu = null; - - public NotificationsScreen() { - //CDI proxy - } - - @Inject - public NotificationsScreen(final Notifications notifications) { - this.notifications = notifications; - } - - @OnStartup - @SuppressWarnings("unused") - public void onStartup(final PlaceRequest placeRequest) { - this.menu = makeMenuBar(); - } - - private Menus makeMenuBar() { - return MenuFactory - .newTopLevelMenu("Clear") - .respondsWith(() -> notifications.clear()) - .endMenu() - .build(); - } - - @WorkbenchMenu - public void getMenus(final Consumer menusConsumer) { - menusConsumer.accept(menu); - } - - @WorkbenchPartTitle - public String getTitle() { - return TITLE; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return notifications.asWidget(); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/notifications/NotificationsView.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/notifications/NotificationsView.java deleted file mode 100644 index 4454c12dd9c..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/notifications/NotificationsView.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.client.screens.notifications; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.Style; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.cellview.client.Column; -import com.google.gwt.user.cellview.client.ColumnSortEvent; -import com.google.gwt.user.cellview.client.SimplePager; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.Widget; -import com.google.gwt.view.client.ProvidesKey; -import org.gwtbootstrap3.client.ui.Row; -import org.gwtbootstrap3.client.ui.gwt.CellTable; -import org.kie.workbench.common.stunner.client.widgets.notification.Notification; - -public class NotificationsView extends Composite implements Notifications.View { - - interface ViewBinder extends UiBinder { - - } - - private static ProvidesKey KEY_PROVIDER = item -> item == null ? null : item.hashCode(); - - private static ViewBinder uiBinder = GWT.create(ViewBinder.class); - - @UiField - Row logsRow; - - @UiField(provided = true) - CellTable logsGrid; - - @UiField(provided = true) - SimplePager logsGridPager; - - Notifications presenter; - - @Override - public void init(final Notifications presenter) { - this.presenter = presenter; - initGrid(); - initWidget(uiBinder.createAndBindUi(this)); - } - - private void initGrid() { - // Init the logs grid. - logsGrid = new CellTable<>(KEY_PROVIDER); - logsGrid.setWidth("100%", - true); - - // Do not refresh the headers and footers every time the data is updated. - logsGrid.setAutoHeaderRefreshDisabled(true); - logsGrid.setAutoFooterRefreshDisabled(true); - - // Create a Pager to control the table. - final SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class); - logsGridPager = new SimplePager(SimplePager.TextLocation.CENTER, - pagerResources, - false, - 0, - true); - - logsGridPager.setDisplay(logsGrid); - presenter.addDataDisplay(logsGrid); - } - - @Override - public Notifications.View setColumnSortHandler(final ColumnSortEvent.ListHandler sortHandler) { - logsGrid.addColumnSortHandler(sortHandler); - return this; - } - - @Override - @SuppressWarnings("unchecked") - public Notifications.View addColumn(final Column column, - final String name) { - logsGrid.addColumn(column, - name); - logsGrid.setColumnWidth(column, - 5, - Style.Unit.PCT); - return this; - } - - @Override - public Notifications.View removeColumn(final int index) { - logsGrid.removeColumn(index); - return this; - } - - @Override - public int getColumnCount() { - return logsGrid.getColumnCount(); - } - - @Override - public Notifications.View redraw() { - logsGrid.redraw(); - return this; - } - - @Override - public Notifications.View clear() { - return this; - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/preview/SessionDiagramPreviewScreen.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/preview/SessionDiagramPreviewScreen.java deleted file mode 100644 index 2e0f18b656d..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/preview/SessionDiagramPreviewScreen.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.client.screens.preview; - -import java.util.function.Consumer; -import java.util.logging.Logger; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.enterprise.inject.Any; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.IsWidget; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.constants.ButtonSize; -import org.gwtbootstrap3.client.ui.constants.IconType; -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.kie.workbench.common.dmn.api.qualifiers.DMNEditor; -import org.kie.workbench.common.dmn.showcase.client.screens.BaseSessionScreen; -import org.kie.workbench.common.dmn.showcase.client.screens.SessionScreenView; -import org.kie.workbench.common.stunner.client.widgets.menu.MenuUtils; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionDiagramPreview; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionViewer; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvas; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; -import org.kie.workbench.common.stunner.core.client.session.ClientSession; -import org.kie.workbench.common.stunner.core.client.session.impl.AbstractSession; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.uberfire.client.annotations.WorkbenchMenu; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.menu.MenuFactory; -import org.uberfire.workbench.model.menu.MenuItem; -import org.uberfire.workbench.model.menu.Menus; - -import static java.util.logging.Level.FINE; -import static java.util.logging.Level.SEVERE; -import static java.util.logging.Level.WARNING; - -@Dependent -@WorkbenchScreen(identifier = SessionDiagramPreviewScreen.SCREEN_ID) -public class SessionDiagramPreviewScreen extends BaseSessionScreen { - - private static Logger LOGGER = Logger.getLogger(SessionDiagramPreviewScreen.class.getName()); - - public static final String SCREEN_ID = "SessionDiagramPreviewScreen"; - public static final String TITLE = "Preview"; - public static final int WIDTH = 420; - public static final int HEIGHT = 280; - - private final ManagedInstance> sessionPreviews; - private final SessionScreenView view; - - private SessionDiagramPreview preview; - private Menus menu = null; - - public SessionDiagramPreviewScreen() { - this.view = null; - this.sessionPreviews = null; - } - - @Inject - public SessionDiagramPreviewScreen(final SessionScreenView view, - final @Any @DMNEditor ManagedInstance> sessionPreviews) { - this.view = view; - this.sessionPreviews = sessionPreviews; - } - - @PostConstruct - public void init() { - view.showEmptySession(); - } - - @OnStartup - @SuppressWarnings("unused") - public void onStartup(final PlaceRequest placeRequest) { - this.menu = makeMenuBar(); - } - - @OnClose - public void onClose() { - close(); - } - - @WorkbenchMenu - public void getMenus(final Consumer menusConsumer) { - menusConsumer.accept(menu); - } - - @WorkbenchPartTitle - public String getTitle() { - return TITLE; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return view; - } - - @Override - protected void doOpenSession() { - // No need to initialize state or views if no diagram is present. - } - - @Override - protected void doOpenDiagram() { - final AbstractSession session = getSession(); - if (null != session) { - if (null != preview) { - doCloseSession(); - } - preview = sessionPreviews.get(); - preview.open(session, - WIDTH, - HEIGHT, - new SessionViewer.SessionViewerCallback() { - @Override - public void afterCanvasInitialized() { - } - - @Override - public void onSuccess() { - LOGGER.log(FINE, - "Session's preview completed for [" + session + "]"); - view.showScreenView(preview.getView()); - } - - @Override - public void onError(final ClientRuntimeError error) { - LOGGER.log(SEVERE, - "Error while showing session preview for [" + session + "]. " + - "Error=[" + error + "]"); - } - }); - } else { - LOGGER.log(WARNING, - "Trying to open a null session!"); - } - } - - @Override - protected void doCloseSession() { - view.showEmptySession(); - preview.destroy(); - sessionPreviews.destroy(preview); - preview = null; - } - - private Menus makeMenuBar() { - return MenuFactory.newTopLevelCustomMenu(new MenuFactory.CustomMenuBuilder() { - @Override - public void push(MenuFactory.CustomMenuBuilder element) { - - } - - @Override - public MenuItem build() { - return buildRefreshMenuItem(); - } - }).endMenu().build(); - } - - private MenuItem buildRefreshMenuItem() { - final Button button = new Button(); - - button.setIcon(IconType.REFRESH); - button.setSize(ButtonSize.SMALL); - button.setTitle("Refresh"); - button.addClickHandler(e -> SessionDiagramPreviewScreen.this.refresh()); - - return MenuUtils.buildItem(button); - } - - private void refresh() { - final ClientSession session = getSession(); - open(session); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/properties/SessionPropertiesScreen.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/properties/SessionPropertiesScreen.java deleted file mode 100644 index 852677d7401..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/screens/properties/SessionPropertiesScreen.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.dmn.showcase.client.screens.properties; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.IsWidget; -import org.jboss.errai.common.client.ui.ElementWrapperWidget; -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.kie.workbench.common.dmn.showcase.client.screens.BaseSessionScreen; -import org.kie.workbench.common.dmn.showcase.client.screens.SessionScreenView; -import org.kie.workbench.common.stunner.forms.client.widgets.FormPropertiesWidget; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; - -@Dependent -@WorkbenchScreen(identifier = SessionPropertiesScreen.SCREEN_ID) -public class SessionPropertiesScreen extends BaseSessionScreen { - - public static final String SCREEN_ID = "SessionPropertiesScreen"; - public static final String TITLE = "Properties"; - - private SessionScreenView view; - private ManagedInstance formPropertiesWidgets; - private FormPropertiesWidget widget; - - public SessionPropertiesScreen() { - //CDI proxy - } - - @Inject - public SessionPropertiesScreen(final SessionScreenView view, - final ManagedInstance formPropertiesWidgets) { - this.view = view; - this.formPropertiesWidgets = formPropertiesWidgets; - } - - @PostConstruct - public void init() { - view.showEmptySession(); - } - - @OnStartup - @SuppressWarnings("unused") - public void onStartup(final PlaceRequest placeRequest) { - //Nothing to do, move on... - } - - @WorkbenchPartTitle - public String getTitle() { - return TITLE; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return view; - } - - @Override - protected void doOpenSession() { - } - - @Override - protected void doOpenDiagram() { - widget = formPropertiesWidgets.get(); - view.showScreenView(ElementWrapperWidget.getWidget(widget.getElement())); - widget.bind(getSession()).show(); - } - - @Override - protected void doCloseSession() { - view.clear(); - if (null != widget) { - widget.destroy(); - widget = null; - } - formPropertiesWidgets.destroyAll(); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/service/DMNClientServicesProxyImpl.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/service/DMNClientServicesProxyImpl.java deleted file mode 100644 index d1a269264be..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/main/java/org/kie/workbench/common/dmn/showcase/client/service/DMNClientServicesProxyImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.dmn.showcase.client.service; - -import java.util.List; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import org.guvnor.common.services.project.client.context.WorkspaceProjectContext; -import org.guvnor.common.services.project.model.WorkspaceProject; -import org.jboss.errai.common.client.api.Caller; -import org.jboss.errai.common.client.api.ErrorCallback; -import org.jboss.errai.common.client.api.RemoteCallback; -import org.kie.workbench.common.dmn.api.definition.model.ItemDefinition; -import org.kie.workbench.common.dmn.api.editors.included.DMNIncludedModel; -import org.kie.workbench.common.dmn.api.editors.included.DMNIncludedModelsService; -import org.kie.workbench.common.dmn.api.editors.included.DMNIncludedNode; -import org.kie.workbench.common.dmn.api.editors.included.IncludedModel; -import org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata; -import org.kie.workbench.common.dmn.api.editors.included.PMMLIncludedModel; -import org.kie.workbench.common.dmn.api.editors.types.DMNParseService; -import org.kie.workbench.common.dmn.api.editors.types.DMNSimpleTimeZone; -import org.kie.workbench.common.dmn.api.editors.types.DMNValidationService; -import org.kie.workbench.common.dmn.api.editors.types.RangeValue; -import org.kie.workbench.common.dmn.api.editors.types.TimeZoneService; -import org.kie.workbench.common.dmn.client.service.DMNClientServicesProxy; -import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; -import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; -import org.uberfire.backend.vfs.Path; - -@Dependent -public class DMNClientServicesProxyImpl implements DMNClientServicesProxy { - - private final WorkspaceProjectContext projectContext; - private final Caller includedModelsService; - private final Caller parserService; - private final Caller validationService; - private final Caller timeZoneService; - - @Inject - public DMNClientServicesProxyImpl(final WorkspaceProjectContext projectContext, - final Caller includedModelsService, - final Caller parserService, - final Caller validationService, - final Caller timeZoneService) { - this.projectContext = projectContext; - this.includedModelsService = includedModelsService; - this.parserService = parserService; - this.validationService = validationService; - this.timeZoneService = timeZoneService; - } - - @Override - public void loadModels(final Path path, - final ServiceCallback> callback) { - includedModelsService.call(onSuccess(callback), onError(callback)).loadModels(path, - getWorkspaceProject()); - } - - @Override - public void loadNodesFromImports(final List includedModels, - final ServiceCallback> callback) { - includedModelsService.call(onSuccess(callback), onError(callback)).loadNodesFromImports(getWorkspaceProject(), - includedModels); - } - - @Override - public void loadPMMLDocumentsFromImports(final Path path, - final List includedModels, - final ServiceCallback> callback) { - includedModelsService.call(onSuccess(callback), onError(callback)).loadPMMLDocumentsFromImports(path, - getWorkspaceProject(), - includedModels); - } - - @Override - public void loadItemDefinitionsByNamespace(final String modelName, String namespace, - final ServiceCallback> callback) { - includedModelsService.call(onSuccess(callback), onError(callback)).loadItemDefinitionsByNamespace(getWorkspaceProject(), - modelName, - namespace); - } - - @Override - public void parseFEELList(final String source, - final ServiceCallback> callback) { - parserService.call(onSuccess(callback), onError(callback)).parseFEELList(source); - } - - @Override - public void parseRangeValue(final String source, - final ServiceCallback callback) { - parserService.call(onSuccess(callback), onError(callback)).parseRangeValue(source); - } - - @Override - public void isValidVariableName(final String source, - final ServiceCallback callback) { - validationService.call(onSuccess(callback), onError(callback)).isValidVariableName(source); - } - - @Override - public void getTimeZones(final ServiceCallback> callback) { - timeZoneService.call(onSuccess(callback), onError(callback)).getTimeZones(); - } - - RemoteCallback onSuccess(final ServiceCallback callback) { - return callback::onSuccess; - } - - ErrorCallback onError(final ServiceCallback callback) { - return (message, throwable) -> { - callback.onError(new ClientRuntimeError(throwable)); - return false; - }; - } - - private WorkspaceProject getWorkspaceProject() { - return projectContext.getActiveWorkspaceProject().orElse(null); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/test/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/SessionDiagramEditorScreenTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/test/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/SessionDiagramEditorScreenTest.java deleted file mode 100644 index 713397871ef..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/test/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/SessionDiagramEditorScreenTest.java +++ /dev/null @@ -1,435 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.dmn.showcase.client.screens.editor; - -import java.util.List; -import java.util.function.Consumer; -import java.util.function.Supplier; - -import com.google.gwt.user.client.ui.Widget; -import com.google.gwtmockito.GwtMockitoTestRunner; -import elemental2.dom.HTMLElement; -import org.jboss.errai.common.client.ui.ElementWrapperWidget; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.dmn.client.decision.DecisionNavigatorDock; -import org.kie.workbench.common.dmn.client.editors.expressions.ExpressionEditorView; -import org.kie.workbench.common.dmn.client.editors.included.IncludedModelsPage; -import org.kie.workbench.common.dmn.client.editors.included.imports.IncludedModelsPageStateProviderImpl; -import org.kie.workbench.common.dmn.client.editors.search.DMNEditorSearchIndex; -import org.kie.workbench.common.dmn.client.editors.search.DMNSearchableElement; -import org.kie.workbench.common.dmn.client.editors.types.DataTypePageTabActiveEvent; -import org.kie.workbench.common.dmn.client.editors.types.DataTypesPage; -import org.kie.workbench.common.dmn.client.editors.types.listview.common.DataTypeEditModeToggleEvent; -import org.kie.workbench.common.dmn.client.events.EditExpressionEvent; -import org.kie.workbench.common.dmn.client.session.DMNEditorSession; -import org.kie.workbench.common.dmn.showcase.client.perspectives.AuthoringPerspective; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionPresenter; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; -import org.kie.workbench.common.stunner.client.widgets.views.session.ScreenPanelView; -import org.kie.workbench.common.stunner.core.client.api.SessionManager; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.components.layout.LayoutHelper; -import org.kie.workbench.common.stunner.core.client.components.layout.OpenDiagramLayoutExecutor; -import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.kie.workbench.common.stunner.core.diagram.DiagramImpl; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.kie.workbench.common.stunner.core.documentation.DocumentationPage; -import org.kie.workbench.common.stunner.core.documentation.DocumentationView; -import org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent; -import org.kie.workbench.common.widgets.client.search.component.SearchBarComponent; -import org.kie.workbench.common.widgets.metadata.client.KieEditorWrapperView; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.InOrder; -import org.mockito.Mock; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; -import org.uberfire.client.views.pfly.multipage.MultiPageEditorSelectedPageEvent; -import org.uberfire.client.workbench.widgets.multipage.MultiPageEditor; -import org.uberfire.mocks.EventSourceMock; -import org.uberfire.mvp.Command; -import org.uberfire.workbench.model.menu.MenuItem; -import org.uberfire.workbench.model.menu.Menus; - -import static java.util.Collections.singletonList; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.kie.workbench.common.dmn.showcase.client.screens.editor.SessionDiagramEditorScreen.DATA_TYPES_PAGE_INDEX; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyBoolean; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.inOrder; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class SessionDiagramEditorScreenTest { - - @Mock - private DecisionNavigatorDock decisionNavigatorDock; - - @Mock - private ScreenPanelView screenPanelView; - - @Mock - private SessionEditorPresenter presenter; - - @Mock - private ExpressionEditorView.Presenter expressionEditor; - - @Mock - private SessionManager sessionManager; - - @Mock - private DMNEditorSession session; - - @Mock - private EventSourceMock refreshFormPropertiesEvent; - - @Captor - private ArgumentCaptor> clientFullSessionConsumer; - - @Mock - private LayoutHelper layoutHelper; - - @Mock - private OpenDiagramLayoutExecutor layoutExecutor; - - @Mock - private KieEditorWrapperView kieView; - - @Mock - private DataTypesPage dataTypesPage; - - @Mock - private IncludedModelsPage includedModelsPage; - - @Mock - private IncludedModelsPageStateProviderImpl importsPageProvider; - - @Mock - private DocumentationView documentationView; - - @Mock - private DMNEditorSearchIndex editorSearchIndex; - - @Mock - private SearchBarComponent searchBarComponent; - - @Mock - private SearchBarComponent.View searchBarComponentView; - - @Mock - private HTMLElement searchBarComponentViewElement; - - @Mock - private ElementWrapperWidget searchBarComponentWidget; - - private SessionDiagramEditorScreen editor; - - @Before - @SuppressWarnings("unchecked") - public void setup() { - when(searchBarComponent.getView()).thenReturn(searchBarComponentView); - when(searchBarComponentView.getElement()).thenReturn(searchBarComponentViewElement); - doReturn(presenter).when(presenter).withToolbar(anyBoolean()); - doReturn(presenter).when(presenter).withPalette(anyBoolean()); - doReturn(presenter).when(presenter).displayNotifications(any()); - doReturn(session).when(presenter).getInstance(); - doReturn(session).when(sessionManager).getCurrentSession(); - doReturn(expressionEditor).when(session).getExpressionEditor(); - doAnswer(new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - Diagram diagram = (Diagram) invocation.getArguments()[0]; - SessionPresenter.SessionPresenterCallback callback = (SessionPresenter.SessionPresenterCallback) invocation.getArguments()[1]; - callback.onOpen(diagram); - callback.afterCanvasInitialized(); - callback.afterSessionOpened(); - callback.onSuccess(); - return null; - } - }).when(presenter).open(any(Diagram.class), - any(SessionPresenter.SessionPresenterCallback.class)); - - editor = spy(new SessionDiagramEditorScreen(null, - null, - null, - sessionManager, - null, - presenter, - null, - null, - refreshFormPropertiesEvent, - null, - screenPanelView, - null, - decisionNavigatorDock, - layoutHelper, - kieView, - dataTypesPage, - layoutExecutor, - includedModelsPage, - importsPageProvider, - documentationView, - editorSearchIndex, - searchBarComponent)); - - doReturn(searchBarComponentWidget).when(editor).getWidget(searchBarComponentViewElement); - } - - @Test - public void testInit() { - - final Widget screenPanelWidget = mock(Widget.class); - final MultiPageEditor multiPageEditor = mock(MultiPageEditor.class); - final DocumentationPage documentationPage = mock(DocumentationPage.class); - final Supplier isDataTypesTabActiveSupplier = () -> true; - final Supplier hashcodeSupplier = () -> 123; - - doReturn(hashcodeSupplier).when(editor).getHashcodeSupplier(); - doReturn(isDataTypesTabActiveSupplier).when(editor).getIsDataTypesTabActiveSupplier(); - doReturn(documentationPage).when(editor).getDocumentationPage(); - when(kieView.getMultiPage()).thenReturn(multiPageEditor); - when(screenPanelView.asWidget()).thenReturn(screenPanelWidget); - - editor.init(); - - verify(decisionNavigatorDock).init(AuthoringPerspective.PERSPECTIVE_ID); - verify(searchBarComponent).init(editorSearchIndex); - verify(kieView).setPresenter(editor); - verify(kieView).clear(); - verify(kieView).addMainEditorPage(screenPanelWidget); - verify(multiPageEditor).addPage(dataTypesPage); - verify(multiPageEditor).addPage(includedModelsPage); - verify(multiPageEditor).addPage(documentationPage); - verify(editorSearchIndex).setIsDataTypesTabActiveSupplier(isDataTypesTabActiveSupplier); - verify(editorSearchIndex).setCurrentAssetHashcodeSupplier(hashcodeSupplier); - verify(editor).setupSearchComponent(); - } - - @Test - public void testGetHashcodeSupplier() { - - final Diagram diagram = new DiagramImpl("something", null); - final Integer expectedHashcode = diagram.hashCode(); - - doReturn(diagram).when(editor).getDiagram(); - - final Integer actualHashcode = editor.getHashcodeSupplier().get(); - - assertEquals(expectedHashcode, actualHashcode); - } - - @Test - public void testGetIsDataTypesTabActiveSupplierWhenDataTypesTabIsActive() { - - final MultiPageEditor multiPageEditor = mock(MultiPageEditor.class); - - when(kieView.getMultiPage()).thenReturn(multiPageEditor); - when(multiPageEditor.selectedPage()).thenReturn(DATA_TYPES_PAGE_INDEX); - - assertTrue(editor.getIsDataTypesTabActiveSupplier().get()); - } - - @Test - public void testGetIsDataTypesTabActiveSupplierWhenDataTypesTabIsNotActive() { - final MultiPageEditor multiPageEditor = mock(MultiPageEditor.class); - - when(kieView.getMultiPage()).thenReturn(multiPageEditor); - when(multiPageEditor.selectedPage()).thenReturn(DATA_TYPES_PAGE_INDEX + 1); - - assertFalse(editor.getIsDataTypesTabActiveSupplier().get()); - } - - @Test - public void testSetupSearchComponent() { - - final MultiPageEditor multiPageEditor = mock(MultiPageEditor.class); - - when(kieView.getMultiPage()).thenReturn(multiPageEditor); - - editor.setupSearchComponent(); - - verify(searchBarComponent).init(editorSearchIndex); - verify(multiPageEditor).addTabBarWidget(searchBarComponentWidget); - } - - @Test - public void testOpenDiagram() { - - final Diagram diagram = mock(Diagram.class); - final Command callback = mock(Command.class); - final Metadata metadata = mock(Metadata.class); - final AbstractCanvasHandler canvasHandler = mock(AbstractCanvasHandler.class); - - when(importsPageProvider.withDiagram(diagram)).thenReturn(importsPageProvider); - when(session.getCanvasHandler()).thenReturn(canvasHandler); - when(diagram.getMetadata()).thenReturn(metadata); - - editor.open(diagram, callback); - - final InOrder inOrder = inOrder(decisionNavigatorDock); - inOrder.verify(decisionNavigatorDock).setupCanvasHandler(canvasHandler); - inOrder.verify(decisionNavigatorDock).open(); - - verify(dataTypesPage).reload(); - verify(dataTypesPage).enableShortcuts(); - verify(includedModelsPage).setup(importsPageProvider); - } - - @Test - public void testOnClose() { - - doNothing().when(editor).destroyDock(); - doNothing().when(editor).destroySession(); - - editor.onClose(); - - verify(editor).destroyDock(); - verify(editor).destroySession(); - verify(dataTypesPage).disableShortcuts(); - } - - @Test - public void testOpenDock() { - - final EditorSession session = mock(EditorSession.class); - final AbstractCanvasHandler canvasHandler = mock(AbstractCanvasHandler.class); - - when(session.getCanvasHandler()).thenReturn(canvasHandler); - - editor.openDock(); - - verify(decisionNavigatorDock).open(); - } - - @Test - public void testDestroyDock() { - - editor.destroyDock(); - - verify(decisionNavigatorDock).close(); - verify(decisionNavigatorDock).resetContent(); - } - - @Test - public void testOnDataTypePageNavTabActiveEvent() { - - final MultiPageEditor multiPageEditor = mock(MultiPageEditor.class); - - when(kieView.getMultiPage()).thenReturn(multiPageEditor); - - editor.onDataTypePageNavTabActiveEvent(mock(DataTypePageTabActiveEvent.class)); - - verify(multiPageEditor).selectPage(1); - } - - @Test - public void testOnDataTypeEditModeToggleWhenEditModeIsEnabled() { - - final DataTypeEditModeToggleEvent event = mock(DataTypeEditModeToggleEvent.class); - final MenuItem menuItem = mock(MenuItem.class); - final Menus menus = mock(Menus.class); - final List items = singletonList(menuItem); - - when(menus.getItems()).thenReturn(items); - when(event.isEditModeEnabled()).thenReturn(true); - doAnswer(invocationOnMock -> { - invocationOnMock.getArgumentAt(0, Consumer.class).accept(menus); - return null; - }).when(editor).getMenu(any()); - - editor.onDataTypeEditModeToggle(event); - - verify(menuItem).setEnabled(false); - } - - @Test - public void testOnDataTypeEditModeToggleWhenEditModeIsNotEnabled() { - - final DataTypeEditModeToggleEvent event = mock(DataTypeEditModeToggleEvent.class); - final MenuItem menuItem = mock(MenuItem.class); - final Menus menus = mock(Menus.class); - final List items = singletonList(menuItem); - - when(menus.getItems()).thenReturn(items); - when(event.isEditModeEnabled()).thenReturn(false); - doAnswer(invocationOnMock -> { - invocationOnMock.getArgumentAt(0, Consumer.class).accept(menus); - return null; - }).when(editor).getMenu(any()); - - editor.onDataTypeEditModeToggle(event); - - verify(menuItem).setEnabled(true); - } - - @Test - public void testGetOnStartupDiagramEditorCallback() { - - final Diagram diagram = mock(Diagram.class); - final Metadata metadata = mock(Metadata.class); - final String title = "title"; - - doNothing().when(editor).updateTitle(anyString()); - doReturn(diagram).when(editor).getDiagram(); - when(diagram.getMetadata()).thenReturn(metadata); - when(metadata.getTitle()).thenReturn(title); - - editor.getOnStartupDiagramEditorCallback().execute(); - - verify(editor).updateTitle(title); - verify(documentationView).initialize(diagram); - } - - @Test - public void testGetDocumentationPage() { - - final DocumentationPage documentationPage = editor.getDocumentationPage(); - - assertEquals("Documentation", documentationPage.getLabel()); - assertEquals(documentationView, documentationPage.getDocumentationView()); - } - - @Test - public void testOnEditExpressionEvent() { - editor.onEditExpressionEvent(mock(EditExpressionEvent.class)); - verify(searchBarComponent).disableSearch(); - } - - @Test - public void testOnMultiPageEditorSelectedPageEvent() { - editor.onMultiPageEditorSelectedPageEvent(mock(MultiPageEditorSelectedPageEvent.class)); - verify(searchBarComponent).disableSearch(); - } - - @Test - public void testOnRefreshFormPropertiesEvent() { - editor.onRefreshFormPropertiesEvent(mock(RefreshFormPropertiesEvent.class)); - verify(searchBarComponent).disableSearch(); - } -} diff --git a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/test/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/StandaloneToolbarStateHandlerTest.java b/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/test/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/StandaloneToolbarStateHandlerTest.java deleted file mode 100644 index 1827dafe0e1..00000000000 --- a/kie-wb-common-dmn/kie-wb-common-dmn-webapp/src/test/java/org/kie/workbench/common/dmn/showcase/client/screens/editor/StandaloneToolbarStateHandlerTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.dmn.showcase.client.screens.editor; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.dmn.client.widgets.toolbar.DMNEditorToolbar; -import org.kie.workbench.common.stunner.client.widgets.toolbar.ToolbarCommand; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.atLeast; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class StandaloneToolbarStateHandlerTest { - - @Mock - private DMNEditorToolbar toolbar; - - private StandaloneToolbarStateHandler toolbarStateHandler; - - @Before - @SuppressWarnings("unchecked") - public void setUp() throws Exception { - this.toolbarStateHandler = new StandaloneToolbarStateHandler(toolbar); - when(toolbar.isEnabled(any(ToolbarCommand.class))).thenReturn(true); - } - - @Test - @SuppressWarnings("unchecked") - public void testEnterGridView() { - toolbarStateHandler.enterGridView(); - - verify(toolbar, atLeast(1)).disable(any(ToolbarCommand.class)); - } - - @Test - @SuppressWarnings("unchecked") - public void testEnterGraphView() { - toolbarStateHandler.enterGridView(); - - toolbarStateHandler.enterGraphView(); - - verify(toolbar, atLeast(1)).enable(any(ToolbarCommand.class)); - } -} diff --git a/kie-wb-common-dmn/pom.xml b/kie-wb-common-dmn/pom.xml index 67ea647defb..4f4413254c9 100644 --- a/kie-wb-common-dmn/pom.xml +++ b/kie-wb-common-dmn/pom.xml @@ -36,17 +36,33 @@ true - kie-wb-common-dmn-api kie-wb-common-dmn-client kie-wb-common-dmn-backend kie-wb-common-dmn-project-api kie-wb-common-dmn-project-client - kie-wb-common-dmn-webapp + kie-wb-common-dmn-webapp-common + kie-wb-common-dmn-webapp-standalone + + kogito + + kie-wb-common-dmn-api + kie-wb-common-dmn-client + kie-wb-common-dmn-backend + kie-wb-common-dmn-project-api + kie-wb-common-dmn-project-client + kie-wb-common-dmn-webapp-common + kie-wb-common-dmn-webapp-standalone + kie-wb-common-dmn-webapp-kogito-common + kie-wb-common-dmn-webapp-kogito-marshaller + kie-wb-common-dmn-webapp-kogito-runtime + kie-wb-common-dmn-webapp-kogito-testing + + run-code-coverage diff --git a/kie-wb-common-kogito/.gitignore b/kie-wb-common-kogito/.gitignore new file mode 100644 index 00000000000..94ef3ba19a4 --- /dev/null +++ b/kie-wb-common-kogito/.gitignore @@ -0,0 +1,15 @@ +/target +/local + +# Eclipse, Netbeans and IntelliJ files +/.* +/**/.* +!.gitignore +/nbproject +*.ipr +*.iws +*.iml + +# Repository wide ignore mac DS_Store files +.DS_Store + diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-api/.gitignore b/kie-wb-common-kogito/kie-wb-common-kogito-api/.gitignore new file mode 100644 index 00000000000..94ef3ba19a4 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-api/.gitignore @@ -0,0 +1,15 @@ +/target +/local + +# Eclipse, Netbeans and IntelliJ files +/.* +/**/.* +!.gitignore +/nbproject +*.ipr +*.iws +*.iml + +# Repository wide ignore mac DS_Store files +.DS_Store + diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-api/pom.xml b/kie-wb-common-kogito/kie-wb-common-kogito-api/pom.xml new file mode 100644 index 00000000000..2d3e228661b --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-api/pom.xml @@ -0,0 +1,50 @@ + + + + + org.kie.workbench + kie-wb-common-kogito + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-kogito-api + Kie Workbench - Common - Kogito - API + Kie Workbench - Common - Kogito - API + jar + + + org.kie.wb.common.kogito.api + + + + + + + org.jboss.errai + errai-ioc + + + org.jboss.errai + errai-ui + + + + + diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/java/org/kie/workbench/common/kogito/api/KogitoAPIEntryPoint.java b/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/java/org/kie/workbench/common/kogito/api/KogitoAPIEntryPoint.java new file mode 100644 index 00000000000..5796e2c157d --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/java/org/kie/workbench/common/kogito/api/KogitoAPIEntryPoint.java @@ -0,0 +1,25 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.api; + +import org.jboss.errai.ioc.client.api.EntryPoint; +import org.jboss.errai.ui.shared.api.annotations.Bundle; + +@EntryPoint +@Bundle("resources/i18n/KogitoAPIConstants.properties") +public class KogitoAPIEntryPoint { + +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/java/org/kie/workbench/common/kogito/api/resources/i18n/KogitoAPIConstants.java b/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/java/org/kie/workbench/common/kogito/api/resources/i18n/KogitoAPIConstants.java new file mode 100644 index 00000000000..c0120ed49fd --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/java/org/kie/workbench/common/kogito/api/resources/i18n/KogitoAPIConstants.java @@ -0,0 +1,20 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.api.resources.i18n; + +public class KogitoAPIConstants { + +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/resources/META-INF/ErraiApp.properties b/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/resources/META-INF/ErraiApp.properties new file mode 100644 index 00000000000..a2bf4c7a45a --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/resources/META-INF/ErraiApp.properties @@ -0,0 +1,31 @@ +# +# Copyright 2019 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +# +# ErraiApp.properties +# +# Do not remove, even if empty! +# +# This is a marker file. When it is detected inside a JAR or at the +# top of any classpath, the subdirectories are scanned for deployable +# components. As such, all Errai application modules in a project +# should contain an ErraiApp.properties at the root of all classpaths +# that you wish to be scanned. +# +# There are also some configuration options that can be set in this +# file, although it is rarely necessary. See the documentation at +# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties +# for details. + diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/resources/META-INF/beans.xml b/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/resources/META-INF/beans.xml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/resources/org/kie/workbench/common/kogito/KogitoAPI.gwt.xml b/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/resources/org/kie/workbench/common/kogito/KogitoAPI.gwt.xml new file mode 100644 index 00000000000..1d46e9c3e43 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/resources/org/kie/workbench/common/kogito/KogitoAPI.gwt.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/resources/org/kie/workbench/common/kogito/api/resources/i18n/KogitoAPIConstants.properties b/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/resources/org/kie/workbench/common/kogito/api/resources/i18n/KogitoAPIConstants.properties new file mode 100644 index 00000000000..482bf93ec4a --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-api/src/main/resources/org/kie/workbench/common/kogito/api/resources/i18n/KogitoAPIConstants.properties @@ -0,0 +1 @@ +keep=keep \ No newline at end of file diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-client/.gitignore b/kie-wb-common-kogito/kie-wb-common-kogito-client/.gitignore new file mode 100644 index 00000000000..94ef3ba19a4 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-client/.gitignore @@ -0,0 +1,15 @@ +/target +/local + +# Eclipse, Netbeans and IntelliJ files +/.* +/**/.* +!.gitignore +/nbproject +*.ipr +*.iws +*.iml + +# Repository wide ignore mac DS_Store files +.DS_Store + diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-client/pom.xml b/kie-wb-common-kogito/kie-wb-common-kogito-client/pom.xml new file mode 100644 index 00000000000..9c184833612 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-client/pom.xml @@ -0,0 +1,86 @@ + + + + + org.kie.workbench + kie-wb-common-kogito + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-kogito-client + Kie Workbench - Common - Kogito - Client + Kie Workbench - Common - Kogito - Client + jar + + + org.kie.wb.common.kogito.client + + + + + + + org.jboss.errai + errai-ioc + + + org.jboss.errai + errai-ui + + + + + org.uberfire + uberfire-api + + + org.uberfire + uberfire-client-api + + + org.uberfire + uberfire-workbench-client + provided + + + org.uberfire + uberfire-commons-editor-client + provided + + + org.uberfire + uberfire-workbench-client-views-patternfly + provided + + + com.google.elemental2 + elemental2-promise + + + + + com.google.gwt + gwt-user + provided + + + + + diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/KogitoClientEntryPoint.java b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/KogitoClientEntryPoint.java new file mode 100644 index 00000000000..a0c47102e93 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/KogitoClientEntryPoint.java @@ -0,0 +1,25 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.client; + +import org.jboss.errai.ioc.client.api.EntryPoint; +import org.jboss.errai.ui.shared.api.annotations.Bundle; + +@EntryPoint +@Bundle("resources/i18n/KogitoClientConstants.properties") +public class KogitoClientEntryPoint { + +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/editor/BaseKogitoEditor.java b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/editor/BaseKogitoEditor.java new file mode 100644 index 00000000000..24b86c8608c --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/editor/BaseKogitoEditor.java @@ -0,0 +1,156 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.client.editor; + +import java.util.Objects; +import java.util.function.Supplier; + +import com.google.gwt.user.client.ui.IsWidget; +import elemental2.promise.Promise; +import org.uberfire.client.mvp.PlaceManager; +import org.uberfire.ext.editor.commons.client.BaseEditorView; +import org.uberfire.ext.editor.commons.client.menu.MenuItems; +import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.model.menu.Menus; + +/** + * This is a trimmed down {@code org.uberfire.ext.editor.commons.client.BaseEditor} for Kogito. + * @param The domain model of the editor + */ +public abstract class BaseKogitoEditor { + + private boolean isReadOnly; + + private BaseEditorView baseEditorView; + private PlaceManager placeManager; + private Menus menus; + private PlaceRequest place; + private Integer originalHash; + + protected BaseKogitoEditor() { + //CDI proxy + } + + protected BaseKogitoEditor(final BaseEditorView baseView, + final PlaceManager placeManager) { + this.baseEditorView = baseView; + this.placeManager = placeManager; + } + + protected void init(final PlaceRequest place) { + this.place = place; + this.isReadOnly = this.place.getParameter("readOnly", null) != null; + + makeMenuBar(); + + buildMenuBar(); + } + + protected abstract void makeMenuBar(); + + protected abstract void buildMenuBar(); + + public void disableMenuItem(final MenuItems menuItem) { + setEnableMenuItem(menuItem, false); + } + + public void enableMenuItem(final MenuItems menuItem) { + setEnableMenuItem(menuItem, true); + } + + private void setEnableMenuItem(final MenuItems menuItem, + final boolean isEnabled) { + if (getMenus().getItemsMap().containsKey(menuItem)) { + getMenus().getItemsMap().get(menuItem).setEnabled(isEnabled); + } + } + + protected PlaceRequest getPlaceRequest() { + return place; + } + + protected PlaceManager getPlaceManager() { + return placeManager; + } + + protected Menus getMenus() { + return menus; + } + + protected void setMenus(final Menus menus) { + this.menus = menus; + } + + protected BaseEditorView getBaseEditorView() { + return baseEditorView; + } + + protected IsWidget getTitle() { + return baseEditorView.getTitleWidget(); + } + + protected Supplier getContentSupplier() { + return () -> null; + } + + public void setOriginalContentHash(final Integer originalHash) { + this.originalHash = originalHash; + } + + protected Integer getOriginalContentHash() { + return originalHash; + } + + protected Integer getCurrentContentHash() { + try { + return getContentSupplier().get().hashCode(); + } catch (final Exception e) { + return null; + } + } + + public boolean isReadOnly() { + return isReadOnly; + } + + public boolean mayClose() { + return !isDirty() || baseEditorView.confirmClose(); + } + + /** + * Used by Kogito to determine whether the content has unsaved changes. + * @return true if there are unsaved changes. + */ + public boolean isDirty() { + return !Objects.equals(getCurrentContentHash(), getOriginalContentHash()); + } + + /** + * Used by Kogito to set the XML content of the editor. + */ + public abstract void setContent(final String value); + + /** + * Used by Kogito to get the XML content of the editor. This should return a {@link String} + * representation of the editors content to persist to an underlying persistent store. + */ + public abstract Promise getContent(); + + /** + * Used by Kogito to reset the editors "dirty" state following a successful save. + */ + public abstract void resetContentHash(); +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/editor/MultiPageEditorContainerPresenter.java b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/editor/MultiPageEditorContainerPresenter.java new file mode 100644 index 00000000000..2e1cbfb7a8e --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/editor/MultiPageEditorContainerPresenter.java @@ -0,0 +1,96 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.client.editor; + +import com.google.gwt.user.client.ui.IsWidget; +import org.uberfire.client.mvp.PlaceManager; +import org.uberfire.client.workbench.widgets.multipage.Page; +import org.uberfire.ext.editor.commons.client.BaseEditorView; +import org.uberfire.mvp.PlaceRequest; + +/** + * This is a trimmed down {@code org.kie.workbench.common.widgets.metadata.client.KieEditor} for Kogito. + * @param The domain model of the editor + */ +public abstract class MultiPageEditorContainerPresenter + extends BaseKogitoEditor + implements MultiPageEditorContainerView.Presenter { + + private MultiPageEditorContainerView multiPageEditorContainerView; + + protected MultiPageEditorContainerPresenter() { + //CDI proxy + } + + protected MultiPageEditorContainerPresenter(final BaseEditorView baseEditorView, + final PlaceManager placeManager, + final MultiPageEditorContainerView multiPageEditorContainerView) { + super(baseEditorView, + placeManager); + this.multiPageEditorContainerView = multiPageEditorContainerView; + } + + @Override + protected void init(final PlaceRequest place) { + multiPageEditorContainerView.init(this); + super.init(place); + } + + protected void addPage(final Page page) { + multiPageEditorContainerView.addPage(page); + } + + protected void resetEditorPages() { + multiPageEditorContainerView.clear(); + multiPageEditorContainerView.setEditorWidget(getBaseEditorView()); + } + + protected void OnClose() { + multiPageEditorContainerView.clear(); + } + + protected void selectEditorTab() { + multiPageEditorContainerView.selectEditorTab(); + } + + protected boolean isEditorTabSelected() { + return multiPageEditorContainerView.isEditorTabSelected(); + } + + public void setSelectedTab(final int index) { + multiPageEditorContainerView.setSelectedTab(index); + } + + protected int getSelectedTabIndex() { + return multiPageEditorContainerView.getSelectedTabIndex(); + } + + public IsWidget asWidget() { + return getWidget().asWidget(); + } + + protected MultiPageEditorContainerView getWidget() { + return multiPageEditorContainerView; + } + + @Override + public void onEditTabSelected() { + } + + @Override + public void onEditTabUnselected() { + } +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/editor/MultiPageEditorContainerView.java b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/editor/MultiPageEditorContainerView.java new file mode 100644 index 00000000000..be52d776989 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/editor/MultiPageEditorContainerView.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.client.editor; + +import com.google.gwt.user.client.ui.IsWidget; +import org.uberfire.client.mvp.UberView; +import org.uberfire.client.workbench.widgets.multipage.MultiPageEditor; +import org.uberfire.client.workbench.widgets.multipage.Page; + +public interface MultiPageEditorContainerView + extends UberView { + + interface Presenter { + + void onEditTabSelected(); + + void onEditTabUnselected(); + } + + void setEditorWidget(final IsWidget editorView); + + MultiPageEditor getMultiPage(); + + void addPage(final Page page); + + void clear(); + + void selectEditorTab(); + + boolean isEditorTabSelected(); + + void setSelectedTab(final int tabIndex); + + int getSelectedTabIndex(); +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/editor/MultiPageEditorContainerViewImpl.java b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/editor/MultiPageEditorContainerViewImpl.java new file mode 100644 index 00000000000..52e0ca81e6f --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/editor/MultiPageEditorContainerViewImpl.java @@ -0,0 +1,90 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.client.editor; + +import javax.inject.Inject; + +import com.google.gwt.user.client.ui.IsWidget; +import org.jboss.errai.ui.client.local.spi.TranslationService; +import org.kie.workbench.common.kogito.client.resources.i18n.KogitoClientConstants; +import org.uberfire.client.views.pfly.multipage.MultiPageEditorImpl; +import org.uberfire.client.views.pfly.multipage.PageImpl; +import org.uberfire.client.workbench.widgets.multipage.MultiPageEditor; + +public class MultiPageEditorContainerViewImpl + extends MultiPageEditorImpl + implements MultiPageEditorContainerView { + + protected static final int EDITOR_TAB_INDEX = 0; + + private TranslationService translationService; + private Presenter presenter; + + public MultiPageEditorContainerViewImpl() { + //CDI proxy + } + + @Inject + public MultiPageEditorContainerViewImpl(final TranslationService translationService) { + this.translationService = translationService; + } + + @Override + public void init(final Presenter presenter) { + this.presenter = presenter; + } + + @Override + public void setEditorWidget(final IsWidget editorView) { + addPage(new PageImpl(editorView, + translationService.format(KogitoClientConstants.KieEditorWrapperView_EditTabTitle)) { + @Override + public void onFocus() { + presenter.onEditTabSelected(); + } + + @Override + public void onLostFocus() { + presenter.onEditTabUnselected(); + } + }); + } + + @Override + public MultiPageEditor getMultiPage() { + return this; + } + + @Override + public void selectEditorTab() { + setSelectedTab(EDITOR_TAB_INDEX); + } + + @Override + public boolean isEditorTabSelected() { + return selectedPage() == EDITOR_TAB_INDEX; + } + + @Override + public void setSelectedTab(final int tabIndex) { + selectPage(tabIndex); + } + + @Override + public int getSelectedTabIndex() { + return selectedPage(); + } +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/resources/i18n/KogitoClientConstants.java b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/resources/i18n/KogitoClientConstants.java new file mode 100644 index 00000000000..5f7be85874b --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/java/org/kie/workbench/common/kogito/client/resources/i18n/KogitoClientConstants.java @@ -0,0 +1,24 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.client.resources.i18n; + +import org.jboss.errai.ui.shared.api.annotations.TranslationKey; + +public class KogitoClientConstants { + + @TranslationKey(defaultValue = "") + public static final String KieEditorWrapperView_EditTabTitle = "KieEditorWrapperView.EditTabTitle"; +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/resources/META-INF/ErraiApp.properties b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/resources/META-INF/ErraiApp.properties new file mode 100644 index 00000000000..a2bf4c7a45a --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/resources/META-INF/ErraiApp.properties @@ -0,0 +1,31 @@ +# +# Copyright 2019 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +# +# ErraiApp.properties +# +# Do not remove, even if empty! +# +# This is a marker file. When it is detected inside a JAR or at the +# top of any classpath, the subdirectories are scanned for deployable +# components. As such, all Errai application modules in a project +# should contain an ErraiApp.properties at the root of all classpaths +# that you wish to be scanned. +# +# There are also some configuration options that can be set in this +# file, although it is rarely necessary. See the documentation at +# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties +# for details. + diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/resources/META-INF/beans.xml b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/resources/META-INF/beans.xml new file mode 100644 index 00000000000..e140971cf5a --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/resources/META-INF/beans.xml @@ -0,0 +1,20 @@ + + + + + + + diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/resources/org/kie/workbench/common/kogito/KogitoClient.gwt.xml b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/resources/org/kie/workbench/common/kogito/KogitoClient.gwt.xml new file mode 100644 index 00000000000..71fd8441cd6 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/resources/org/kie/workbench/common/kogito/KogitoClient.gwt.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/resources/org/kie/workbench/common/kogito/client/resources/i18n/KogitoClientConstants.properties b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/resources/org/kie/workbench/common/kogito/client/resources/i18n/KogitoClientConstants.properties new file mode 100644 index 00000000000..9165ab6fc8b --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-client/src/main/resources/org/kie/workbench/common/kogito/client/resources/i18n/KogitoClientConstants.properties @@ -0,0 +1 @@ +KieEditorWrapperView.EditTabTitle=Editor diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/Readme.md b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/Readme.md new file mode 100644 index 00000000000..095d776910c --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/Readme.md @@ -0,0 +1,5 @@ +Kogito Webapp-base +================================== + +This module is meant as base to be *used* (declared as dependency) by Kogito' running and testing webapps and/or extended by +editor-specific common jar. diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/pom.xml b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/pom.xml new file mode 100644 index 00000000000..2be4f8bc35f --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/pom.xml @@ -0,0 +1,111 @@ + + + + kie-wb-common-kogito + org.kie.workbench + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-kogito-webapp-base + jar + + + 0.3.0 + + + + + javax.enterprise + cdi-api + + + javax.inject + javax.inject + + + + org.jboss.errai + errai-bus + + + org.jboss.errai + errai-javax-enterprise + + + org.jboss.errai + errai-security-server + + + org.jboss.spec.javax.annotation + jboss-annotations-api_1.2_spec + + + org.jboss.spec.javax.servlet + jboss-servlet-api_3.1_spec + provided + + + + org.kie.workbench.widgets + kie-wb-common-ui + + + org.uberfire + uberfire-servlet-security + + + + + + org.uberfire + uberfire-api + + + org.uberfire + uberfire-client-api + + + + org.uberfire + uberfire-commons + + + org.apache.activemq + artemis-jms-client + + + org.jboss.spec.javax.jms + jboss-jms-api_2.0_spec + + + + + + org.uberfire + uberfire-io + + + org.uberfire + uberfire-project-api + + + + org.uberfire + uberfire-structure-api + + + org.uberfire + uberfire-workbench-client + + + + org.kie.workbench + kie-wb-common-kogito-client + + + + + \ No newline at end of file diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/ApplicationScopedProducer.java b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/ApplicationScopedProducer.java new file mode 100644 index 00000000000..248269f5b79 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/ApplicationScopedProducer.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.webapp.base.backend; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.context.RequestScoped; +import javax.enterprise.inject.Produces; +import javax.inject.Inject; +import javax.inject.Named; + +import org.jboss.errai.security.shared.api.identity.User; +import org.jboss.errai.security.shared.api.identity.UserImpl; +import org.uberfire.commons.services.cdi.Startup; +import org.uberfire.commons.services.cdi.StartupType; +import org.uberfire.io.IOService; + +@Startup(value = StartupType.BOOTSTRAP) +@ApplicationScoped +public class ApplicationScopedProducer { + + private IOService ioService; + + @Inject + protected IOServiceNio2WrapperProvider ioServiceNio2WrapperProvider; + + @PostConstruct + public void setup() { + ioService = ioServiceNio2WrapperProvider.getIOServiceNio2(); + } + + @Produces + @Named("ioStrategy") + public IOService ioService() { + return ioService; + } + + @Produces + @RequestScoped + public User user() { + return new UserImpl("admin"); + } +} + diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/CORSFilter.java b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/CORSFilter.java new file mode 100644 index 00000000000..421c1974c39 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/CORSFilter.java @@ -0,0 +1,85 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.webapp.base.backend; + +import java.io.IOException; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.annotation.WebFilter; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Servlet Filter implementation class CORSFilter + */ +// Enable it for Servlet 3.x implementations +@WebFilter(asyncSupported = true, urlPatterns = {"/*"}) +public class CORSFilter implements Filter { + + /** + * Default constructor. + */ + public CORSFilter() { + } + + /** + * @see Filter#destroy() + */ + public void destroy() { + } + + /** + * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain) + */ + public void doFilter(final ServletRequest servletRequest, + final ServletResponse servletResponse, + final FilterChain chain) throws IOException, ServletException { + + final HttpServletRequest request = (HttpServletRequest) servletRequest; + + // Authorize (allow) all domains to consume the content + final HttpServletResponse r = (HttpServletResponse) servletResponse; + String origin = request.getHeader("origin"); + r.addHeader("Access-Control-Allow-Origin", origin); + r.addHeader("Access-Control-Allow-Headers", + "Accept,Accept-Encoding,Accept-Language,Cache-Control,Connection,Content-Length,Content-Type," + + "Cookie,Host,Pragma,Referer,RemoteQueueID,User-Agent"); + r.addHeader("Access-Control-Allow-Credentials", "true"); + r.addHeader("Access-Control-Allow-Methods", "GET, OPTIONS, HEAD, PUT, POST"); + + final HttpServletResponse resp = (HttpServletResponse) servletResponse; + + // For HTTP OPTIONS verb/method reply with ACCEPTED status code -- per CORS handshake + if (request.getMethod().equals("OPTIONS")) { + resp.setStatus(HttpServletResponse.SC_ACCEPTED); + return; + } + + // pass the request along the filter chain + chain.doFilter(request, servletResponse); + } + + /** + * @see Filter#init(FilterConfig) + */ + public void init(final FilterConfig fConfig) throws ServletException { + } +} \ No newline at end of file diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/IOServiceNio2WrapperProvider.java b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/IOServiceNio2WrapperProvider.java new file mode 100644 index 00000000000..5ecaf6b5adf --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/IOServiceNio2WrapperProvider.java @@ -0,0 +1,26 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.webapp.base.backend; + +import org.uberfire.io.impl.IOServiceNio2WrapperImpl; + +/** + * Interface used so that specific webapp may provide they own IOServiceNio2WrapperImpl + */ +public interface IOServiceNio2WrapperProvider { + + IOServiceNio2WrapperImpl getIOServiceNio2(); +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/workarounds/DummyAuthenticationService.java b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/workarounds/DummyAuthenticationService.java new file mode 100644 index 00000000000..31666604c49 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/workarounds/DummyAuthenticationService.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.kogito.webapp.base.backend.workarounds; + +import javax.enterprise.context.Dependent; + +import org.jboss.errai.bus.server.annotations.Service; +import org.jboss.errai.security.shared.api.identity.User; +import org.jboss.errai.security.shared.api.identity.UserImpl; +import org.jboss.errai.security.shared.service.AuthenticationService; + +@Service +@Dependent +public class DummyAuthenticationService implements AuthenticationService { + + @Override + public void logout() { + } + + @Override + public User login(String username, String password) { + return new UserImpl("admin"); + } + + @Override + public boolean isLoggedIn() { + return true; + } + + @Override + public User getUser() { + return new UserImpl("admin"); + } +} \ No newline at end of file diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/workarounds/MockWorkspaceProjectService.java b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/workarounds/MockWorkspaceProjectService.java new file mode 100644 index 00000000000..3ef740f8892 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/backend/workarounds/MockWorkspaceProjectService.java @@ -0,0 +1,134 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.kogito.webapp.base.backend.workarounds; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import javax.enterprise.context.ApplicationScoped; + +import org.guvnor.common.services.project.model.Module; +import org.guvnor.common.services.project.model.POM; +import org.guvnor.common.services.project.model.WorkspaceProject; +import org.guvnor.common.services.project.service.DeploymentMode; +import org.guvnor.common.services.project.service.WorkspaceProjectService; +import org.guvnor.structure.contributors.Contributor; +import org.guvnor.structure.organizationalunit.OrganizationalUnit; +import org.guvnor.structure.repositories.Branch; +import org.guvnor.structure.repositories.Repository; +import org.jboss.errai.bus.server.annotations.Service; +import org.uberfire.backend.vfs.Path; +import org.uberfire.spaces.Space; + +@Service +@ApplicationScoped +public class MockWorkspaceProjectService implements WorkspaceProjectService { + + private static final WorkspaceProject PROJECT = new WorkspaceProject(); + private static final Collection PROJECTS = Collections.singleton(PROJECT); + + @Override + public Collection getAllWorkspaceProjects() { + return PROJECTS; + } + + @Override + public Collection getAllWorkspaceProjects(final OrganizationalUnit organizationalUnit) { + return PROJECTS; + } + + @Override + public Collection getAllWorkspaceProjectsByName(final OrganizationalUnit organizationalUnit, + final String name) { + return PROJECTS; + } + + @Override + public boolean spaceHasNoProjectsWithName(final OrganizationalUnit organizationalUnit, + final String name, + final WorkspaceProject projectToIgnore) { + return false; + } + + @Override + public WorkspaceProject newProject(final OrganizationalUnit organizationalUnit, + final POM pom) { + return PROJECT; + } + + @Override + public WorkspaceProject newProject(final OrganizationalUnit organizationalUnit, + final POM pom, + final DeploymentMode mode) { + return PROJECT; + } + + @Override + public WorkspaceProject newProject(final OrganizationalUnit organizationalUnit, + final POM pom, + final DeploymentMode mode, + final List contributor) { + return PROJECT; + } + + @Override + public String createFreshProjectName(final OrganizationalUnit organizationalUnit, + final String name) { + return ""; + } + + @Override + public WorkspaceProject resolveProject(final Repository repository) { + return PROJECT; + } + + @Override + public WorkspaceProject resolveProject(final Space space, + final Branch branch) { + return PROJECT; + } + + @Override + public WorkspaceProject resolveProject(final Space space, + final Module module) { + return PROJECT; + } + + @Override + public WorkspaceProject resolveProject(final Path module) { + return PROJECT; + } + + @Override + public WorkspaceProject resolveProject(final Space space, + final Path module) { + return PROJECT; + } + + @Override + public WorkspaceProject resolveProject(final Space space, + final String name) { + return PROJECT; + } + + @Override + public WorkspaceProject resolveProjectByRepositoryAlias(final Space space, + final String repositoryAlias) { + return PROJECT; + } +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/client/editor/KogitoScreen.java b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/client/editor/KogitoScreen.java new file mode 100644 index 00000000000..ba07f0a63ff --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/client/editor/KogitoScreen.java @@ -0,0 +1,26 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.webapp.base.client.editor; + +import org.uberfire.mvp.PlaceRequest; + +/** + * Interface meant to be implemented by actual Kogito screens to allow abstraction from actual implementation + */ +public interface KogitoScreen { + + PlaceRequest getPlaceRequest(); +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/client/perspectives/AuthoringPerspective.java b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/client/perspectives/AuthoringPerspective.java new file mode 100644 index 00000000000..475d2611c23 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/client/perspectives/AuthoringPerspective.java @@ -0,0 +1,45 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.webapp.base.client.perspectives; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import org.kie.workbench.common.kogito.webapp.base.client.editor.KogitoScreen; +import org.uberfire.client.annotations.Perspective; +import org.uberfire.client.annotations.WorkbenchPerspective; +import org.uberfire.client.workbench.panels.impl.MultiListWorkbenchPanelPresenter; +import org.uberfire.workbench.model.PerspectiveDefinition; +import org.uberfire.workbench.model.impl.PartDefinitionImpl; +import org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl; + +@ApplicationScoped +@WorkbenchPerspective(identifier = AuthoringPerspective.PERSPECTIVE_ID, isTransient = false, isDefault = true) +public class AuthoringPerspective { + + public static final String PERSPECTIVE_ID = "AuthoringPerspective"; + + @Inject + protected KogitoScreen kogitoScreen; + + @Perspective + public PerspectiveDefinition buildPerspective() { + final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); + perspective.setName("Authoring"); + perspective.getRoot().addPart(new PartDefinitionImpl(kogitoScreen.getPlaceRequest())); + return perspective; + } +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/client/resources/i18n/KogitoClientConstants.java b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/client/resources/i18n/KogitoClientConstants.java new file mode 100644 index 00000000000..64926a3e0be --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/client/resources/i18n/KogitoClientConstants.java @@ -0,0 +1,20 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.kogito.webapp.base.client.resources.i18n; + +public interface KogitoClientConstants { + +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/client/workarounds/IsKogito.java b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/client/workarounds/IsKogito.java new file mode 100644 index 00000000000..3b8f44b2373 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/java/org/kie/workbench/common/kogito/webapp/base/client/workarounds/IsKogito.java @@ -0,0 +1,27 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.kogito.webapp.base.client.workarounds; + +import javax.enterprise.inject.Alternative; + +@Alternative +public class IsKogito extends org.kie.workbench.common.widgets.client.kogito.IsKogito { + + public boolean get() { + return true; + } +} diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/resources/META-INF/ErraiApp.properties b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/resources/META-INF/ErraiApp.properties new file mode 100644 index 00000000000..778b28c9703 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/resources/META-INF/ErraiApp.properties @@ -0,0 +1,32 @@ +# +# Copyright 2019 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +# +# ErraiApp.properties +# +# Do not remove, even if empty! +# +# This is a marker file. When it is detected inside a JAR or at the +# top of any classpath, the subdirectories are scanned for deployable +# components. As such, all Errai application modules in a project +# should contain an ErraiApp.properties at the root of all classpaths +# that you wish to be scanned. +# +# There are also some configuration options that can be set in this +# file, although it is rarely necessary. See the documentation at +# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties +# for details. +errai.ioc.enabled.alternatives=org.kie.workbench.common.kogito.webapp.base.client.workarounds.IsKogito + diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/resources/org/kie/workbench/common/kogito/webapp/base/KogitoWebappBase.gwt.xml b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/resources/org/kie/workbench/common/kogito/webapp/base/KogitoWebappBase.gwt.xml new file mode 100644 index 00000000000..2f4d0569013 --- /dev/null +++ b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/resources/org/kie/workbench/common/kogito/webapp/base/KogitoWebappBase.gwt.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/resources/org/kie/workbench/common/kogito/webapp/base/client/resources/i18n/KogitoClientConstants.properties b/kie-wb-common-kogito/kie-wb-common-kogito-webapp-base/src/main/resources/org/kie/workbench/common/kogito/webapp/base/client/resources/i18n/KogitoClientConstants.properties new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kie-wb-common-kogito/pom.xml b/kie-wb-common-kogito/pom.xml new file mode 100644 index 00000000000..a6e68bcf7b8 --- /dev/null +++ b/kie-wb-common-kogito/pom.xml @@ -0,0 +1,44 @@ + + + + + org.kie.workbench + kie-wb-common + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-kogito + Kie Workbench - Common - Kogito + Kie Workbench - Common - Kogito + pom + + + true + true + true + + + + kie-wb-common-kogito-api + kie-wb-common-kogito-client + kie-wb-common-kogito-webapp-base + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-backend/src/main/java/org/kie/workbench/common/stunner/backend/service/DiagramServiceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-backend/src/main/java/org/kie/workbench/common/stunner/backend/service/DiagramServiceImpl.java index 0ec02a90ec0..249ed891dab 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-backend/src/main/java/org/kie/workbench/common/stunner/backend/service/DiagramServiceImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-backend/src/main/java/org/kie/workbench/common/stunner/backend/service/DiagramServiceImpl.java @@ -17,7 +17,6 @@ package org.kie.workbench.common.stunner.backend.service; import java.io.File; -import java.io.InputStream; import java.util.Collection; import javax.annotation.PostConstruct; @@ -116,26 +115,6 @@ protected Metadata buildMetadataInstance(final org.uberfire.backend.vfs.Path pat .build(); } - @Override - protected Metadata obtainMetadata(DefinitionSetService services, - final org.uberfire.backend.vfs.Path diagramFilePath, - final String defSetId, - final String fileName) { - Metadata metadata = null; - final InputStream metaDataStream = loadMetadataForPath(diagramFilePath); - if (null != metaDataStream) { - try { - metadata = services.getDiagramMarshaller().getMetadataMarshaller().unmarshall(metaDataStream); - if (null == metadata.getRoot() || null == metadata.getRoot().toURI()) { - metadata.setRoot(getRoot()); - } - } catch (java.io.IOException e) { - LOG.error("Cannot unmarshall metadata for diagram's path [{}]", diagramFilePath, e); - } - } - return metadata; - } - private org.uberfire.backend.vfs.Path getRoot() { return Paths.convert(backendFileSystemManager.getRootPath()); } @@ -145,10 +124,6 @@ protected Class getMetadataType() { return Metadata.class; } - private InputStream loadMetadataForPath(final Path path) { - return doLoadMetadataStreamByDiagramPath(path); - } - @Override protected Metadata doSave(final Diagram diagram, final String raw, @@ -211,18 +186,6 @@ public org.uberfire.java.nio.file.Path getDiagramsPath() { return backendFileSystemManager.getRootPath().resolve(DIAGRAMS_PATH); } - private InputStream doLoadMetadataStreamByDiagramPath(final Path dPath) { - org.uberfire.java.nio.file.Path path = getDiagramsPath().resolve(getMetadataFileName(dPath.getFileName())); - if (null != path) { - try { - return loadPath(path); - } catch (Exception e) { - LOG.warn("Cannot load metadata for [{}].", dPath.toString(), e); - } - } - return null; - } - private String getMetadataFileName(final String uri) { return uri + "." + METADATA_EXTENSION; } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-lienzo/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-lienzo/pom.xml index c46c4e2321b..c6871ac1db5 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-lienzo/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-lienzo/pom.xml @@ -175,22 +175,6 @@ uberfire-workbench-client - - - org.uberfire - uberfire-widgets-properties-editor-client - - - - org.uberfire - uberfire-widgets-properties-editor-api - - - - org.uberfire - uberfire-widgets-properties-editor-backend - - javax.inject javax.inject diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/pom.xml index a4921eebe34..f698af641a5 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/pom.xml @@ -64,6 +64,11 @@ kie-wb-common-stunner-lienzo + + org.kie.workbench.stunner + kie-wb-common-stunner-lienzo-extensions + + org.kie.workbench.stunner kie-wb-common-stunner-svg-client @@ -121,11 +126,21 @@ uberfire-api + + org.uberfire + uberfire-all + + org.uberfire uberfire-client-api + + org.uberfire + uberfire-commons + + org.kie.soup kie-soup-commons @@ -174,6 +189,12 @@ provided + + javax.inject + javax.inject + provided + + @@ -190,6 +211,12 @@ test-jar + + org.apache.commons + commons-lang3 + test + + org.mockito mockito-core diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/event/LoadDiagramEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/event/LoadDiagramEvent.java index 4f9c9cf37e5..7415bec7cc2 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/event/LoadDiagramEvent.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/event/LoadDiagramEvent.java @@ -16,6 +16,7 @@ package org.kie.workbench.common.stunner.client.widgets.event; +import org.uberfire.backend.vfs.Path; import org.uberfire.workbench.events.UberFireEvent; /** @@ -23,17 +24,17 @@ */ public final class LoadDiagramEvent implements UberFireEvent { - private final String uri; + private final Path path; private final String name; - public LoadDiagramEvent(final String uri, + public LoadDiagramEvent(final Path path, final String name) { this.name = name; - this.uri = uri; + this.path = path; } - public String getURI() { - return uri; + public Path getPath() { + return path; } public String getName() { @@ -42,6 +43,6 @@ public String getName() { @Override public String toString() { - return "LoadDiagramEvent [name=" + name + ", uri=" + uri + "]"; + return "LoadDiagramEvent [name=" + name + ", uri=" + path.toURI() + "]"; } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/explorer/navigator/diagrams/DiagramsNavigatorImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/explorer/navigator/diagrams/DiagramsNavigatorImpl.java index 2b121b80cc8..ef375c468a6 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/explorer/navigator/diagrams/DiagramsNavigatorImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/explorer/navigator/diagrams/DiagramsNavigatorImpl.java @@ -43,6 +43,7 @@ import org.kie.workbench.common.stunner.core.lookup.LookupManager; import org.kie.workbench.common.stunner.core.lookup.diagram.DiagramLookupRequest; import org.kie.workbench.common.stunner.core.lookup.diagram.DiagramRepresentation; +import org.uberfire.backend.vfs.Path; import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; @Dependent @@ -175,7 +176,7 @@ private void onItemSelected(final DiagramNavigatorItem item, private void fireLoadDiagram(final DiagramRepresentation diagramRepresentation) { final String name = diagramRepresentation.getName(); - final String path = diagramRepresentation.getPath().toURI(); + final Path path = diagramRepresentation.getPath(); loadDiagramEventEvent.fire(new LoadDiagramEvent(path, name)); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/presenters/session/impl/SessionPresenterNoOpCallback.java b/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/presenters/session/impl/SessionPresenterNoOpCallback.java new file mode 100644 index 00000000000..784e9903e54 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/presenters/session/impl/SessionPresenterNoOpCallback.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.client.widgets.presenters.session.impl; + +import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionPresenter; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.diagram.Diagram; + +public class SessionPresenterNoOpCallback + implements SessionPresenter.SessionPresenterCallback { + + public static SessionPresenterNoOpCallback INSTANCE = new SessionPresenterNoOpCallback<>(); + + @Override + public void afterSessionOpened() { + + } + + @Override + public void afterCanvasInitialized() { + + } + + @Override + public void onSuccess() { + + } + + @Override + public void onError(ClientRuntimeError error) { + + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/toolbar/command/ExportToBpmnToolbarCommand.java b/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/toolbar/command/ExportToBpmnToolbarCommand.java index adbe3ed2370..b5a3f3cdd8f 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/toolbar/command/ExportToBpmnToolbarCommand.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-widgets/src/main/java/org/kie/workbench/common/stunner/client/widgets/toolbar/command/ExportToBpmnToolbarCommand.java @@ -24,16 +24,16 @@ import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvas; import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToBpmnSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToRawFormatSessionCommand; import org.kie.workbench.common.stunner.core.client.session.impl.AbstractSession; import org.kie.workbench.common.stunner.core.i18n.CoreTranslationMessages; import org.kie.workbench.common.stunner.core.util.DefinitionUtils; -public class ExportToBpmnToolbarCommand extends AbstractToolbarCommand, ExportToBpmnSessionCommand> { +public class ExportToBpmnToolbarCommand extends AbstractToolbarCommand, ExportToRawFormatSessionCommand> { @Inject public ExportToBpmnToolbarCommand(final DefinitionUtils definitionUtils, - final @Any ManagedInstance command, + final @Any ManagedInstance command, final ClientTranslationService translationService) { super(definitionUtils, command, diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/pom.xml index 74d2deaaf23..5be4677cc43 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/pom.xml @@ -98,6 +98,11 @@ uberfire-services-api + + org.uberfire + uberfire-services-backend + + org.jboss.errai errai-marshalling diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/src/main/java/org/kie/workbench/common/stunner/core/backend/service/AbstractVFSDiagramService.java b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/src/main/java/org/kie/workbench/common/stunner/core/backend/service/AbstractVFSDiagramService.java index d8bbad998b0..f999eb6924f 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/src/main/java/org/kie/workbench/common/stunner/core/backend/service/AbstractVFSDiagramService.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/src/main/java/org/kie/workbench/common/stunner/core/backend/service/AbstractVFSDiagramService.java @@ -156,16 +156,9 @@ public D getDiagramByPath(final org.uberfire.backend.vfs.Path file) { final String defSetId = getDefinitionSetId(services); final String name = parseFileName(file, services); - // Check if any metadata definition exist. - M metadata = obtainMetadata(services, - file, - defSetId, - name); - if (null == metadata) { - metadata = (M) buildMetadataInstance(file, - defSetId, - name); - } + final M metadata = (M) buildMetadataInstance(file, + defSetId, + name); metadata.setPath(file); // Parse and load the diagram raw data. final InputStream is = loadPath(file); @@ -195,12 +188,6 @@ public D getDiagramByPath(final org.uberfire.backend.vfs.Path file) { throw new UnsupportedOperationException("Diagram format not supported [" + file + "]"); } - @SuppressWarnings("unchecked") - protected abstract M obtainMetadata(final DefinitionSetService services, - final org.uberfire.backend.vfs.Path diagramFilePath, - final String defSetId, - final String fileName); - private String parseFileName(final org.uberfire.backend.vfs.Path file, final DefinitionSetService services) { final String n = file.getFileName(); @@ -333,11 +320,6 @@ protected InputStream loadPath(final org.uberfire.backend.vfs.Path _path) { return new ByteArrayInputStream(bytes); } - protected InputStream loadPath(final org.uberfire.java.nio.file.Path _path) { - final byte[] bytes = getIoService().readAllBytes(_path); - return new ByteArrayInputStream(bytes); - } - public boolean accepts(final org.uberfire.backend.vfs.Path path) { if (path != null) { // Look for the specific services definition. diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/src/test/java/org/kie/workbench/common/stunner/core/backend/service/ValidationServiceImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/src/test/java/org/kie/workbench/common/stunner/core/backend/service/ValidationServiceImplTest.java deleted file mode 100644 index bc47a3a2c5d..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-backend-common/src/test/java/org/kie/workbench/common/stunner/core/backend/service/ValidationServiceImplTest.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.core.backend.service; - -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.function.Consumer; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.kie.workbench.common.stunner.core.graph.Graph; -import org.kie.workbench.common.stunner.core.rule.RuleViolation; -import org.kie.workbench.common.stunner.core.util.UUID; -import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; -import org.kie.workbench.common.stunner.core.validation.DomainValidator; -import org.kie.workbench.common.stunner.core.validation.DomainViolation; -import org.kie.workbench.common.stunner.core.validation.Violation; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; -import org.uberfire.mocks.MockInstanceImpl; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class ValidationServiceImplTest { - - public static final String DEF_SET_ID = "defSetId"; - public static final String UUID_0 = "uuid0"; - public static final String UUID_1 = "uuid1"; - - private ValidationServiceImpl validationService; - - @Mock - private DomainValidator domainValidator; - - @Mock - private Diagram diagram; - - @Mock - private Metadata metadata; - - @Mock - private DomainViolation domainViolation; - - @Mock - private DomainViolation domainViolation2; - - @Mock - private DomainViolation domainViolation3; - - @Mock - private DomainViolation domainViolation4; - - @Mock - private DomainViolation domainViolationNull; - - @Mock - private DomainViolation domainViolationNullStr; - - @Mock - private Graph graph; - - private static final String GRAPH_UUID = UUID.uuid(); - - private List domainViolationList; - - @Before - public void setUp() { - domainViolationList = Arrays.asList(domainViolation, - domainViolation2, - domainViolation3, - domainViolation4, - domainViolationNull, - domainViolationNullStr); - domainValidator = new DomainValidator() { - @Override - public String getDefinitionSetId() { - return DEF_SET_ID; - } - - @Override - public void validate(Diagram entity, Consumer> resultConsumer) { - resultConsumer.accept(domainViolationList); - } - }; - - when(diagram.getMetadata()).thenReturn(metadata); - when(metadata.getDefinitionSetId()).thenReturn(DEF_SET_ID); - when(diagram.getGraph()).thenReturn(graph); - when(graph.getUUID()).thenReturn(GRAPH_UUID); - mockViolations(domainViolationList); - - validationService = new ValidationServiceImpl(new MockInstanceImpl(domainValidator)); - } - - private void mockViolations(List violations) { - violations.stream().forEach(v -> { - when(v.getViolationType()).thenReturn(Violation.Type.ERROR); - when(v.getUUID()).thenReturn(UUID_1); - }); - - DomainViolation first = violations.get(0); - when(first.getUUID()).thenReturn(UUID_0); - - DomainViolation last1 = violations.get(violations.size() - 2); - when(last1.getUUID()).thenReturn(null); - - DomainViolation last = violations.get(violations.size() - 1); - when(last.getUUID()).thenReturn("null"); - } - - @Test - public void validate() { - final Collection> violations = validationService.validate(diagram); - verify(diagram).getMetadata(); - verify(metadata).getDefinitionSetId(); - assertEquals(violations.size(), 2); - - List violations0 = Arrays.asList(domainViolation); - List violations1 = - Arrays.asList(domainViolation2, domainViolation3, domainViolation4); - - assertEquals(violations.stream() - .filter(v -> UUID_1.equals(v.getUUID())) - .findFirst() - .map(DiagramElementViolation::getDomainViolations) - .get(), violations1); - - assertEquals(violations.stream() - .filter(v -> UUID_0.equals(v.getUUID())) - .findFirst() - .map(DiagramElementViolation::getDomainViolations) - .get(), violations0); - } -} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/annotation/DiagramEditor.java b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/annotation/DiagramEditor.java index 1b8e0bd7ed5..3130055e497 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/annotation/DiagramEditor.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/annotation/DiagramEditor.java @@ -33,7 +33,7 @@ */ @Qualifier @Retention(RUNTIME) -@Target({ElementType.TYPE, ElementType.FIELD}) +@Target({ElementType.TYPE, ElementType.FIELD, ElementType.PARAMETER}) public @interface DiagramEditor { } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/ManagedClientSessionCommands.java b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/ManagedClientSessionCommands.java index 83424b8e57b..47fb68fea13 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/ManagedClientSessionCommands.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/ManagedClientSessionCommands.java @@ -85,6 +85,10 @@ public S get(final int index) { return (S) commands.get(index); } + public S get(final Class type) { + return get(types.indexOf(type)); + } + @SuppressWarnings("unchecked") public void visit(final BiConsumer, S> visitor) { for (int i = 0; i < commands.size(); i++) { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/impl/ExportToBpmnSessionCommand.java b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/impl/ExportToBpmnSessionCommand.java deleted file mode 100644 index 08d53e48f29..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/impl/ExportToBpmnSessionCommand.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.core.client.session.command.impl; - -import javax.enterprise.context.Dependent; -import javax.enterprise.inject.Default; -import javax.inject.Inject; - -import org.kie.workbench.common.stunner.core.client.service.ClientDiagramService; -import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; -import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; -import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.ext.editor.commons.client.file.exports.TextContent; -import org.uberfire.ext.editor.commons.client.file.exports.TextFileExport; - -@Dependent -@Default -public class ExportToBpmnSessionCommand extends AbstractExportSessionCommand { - - private final ClientDiagramService clientDiagramService; - private final ErrorPopupPresenter errorPopupPresenter; - private final TextFileExport textFileExport; - - protected ExportToBpmnSessionCommand() { - this(null, - null, - null); - } - - @Inject - public ExportToBpmnSessionCommand(final ClientDiagramService clientDiagramService, - final ErrorPopupPresenter errorPopupPresenter, - final TextFileExport textFileExport) { - super(true); - this.clientDiagramService = clientDiagramService; - this.errorPopupPresenter = errorPopupPresenter; - this.textFileExport = textFileExport; - } - - @SuppressWarnings("unchecked") - @Override - protected void export(final String fileName) { - clientDiagramService.getRawContent(getSession().getCanvasHandler().getDiagram(), - new ServiceCallback() { - @Override - public void onSuccess(String rawContent) { - textFileExport.export(TextContent.create(rawContent), - fileName); - } - - @Override - public void onError(ClientRuntimeError error) { - errorPopupPresenter.showMessage(error.getMessage()); - } - }); - } -} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/impl/ExportToRawFormatSessionCommand.java b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/impl/ExportToRawFormatSessionCommand.java new file mode 100644 index 00000000000..077ccbd07f6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/impl/ExportToRawFormatSessionCommand.java @@ -0,0 +1,71 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.core.client.session.command.impl; + +import javax.enterprise.context.Dependent; +import javax.enterprise.inject.Default; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.core.client.service.ClientDiagramService; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; +import org.uberfire.ext.editor.commons.client.file.exports.TextContent; +import org.uberfire.ext.editor.commons.client.file.exports.TextFileExport; + +@Dependent +@Default +public class ExportToRawFormatSessionCommand extends AbstractExportSessionCommand { + + private final ClientDiagramService clientDiagramService; + private final ErrorPopupPresenter errorPopupPresenter; + private final TextFileExport textFileExport; + + protected ExportToRawFormatSessionCommand() { + this(null, + null, + null); + } + + @Inject + public ExportToRawFormatSessionCommand(final ClientDiagramService clientDiagramService, + final ErrorPopupPresenter errorPopupPresenter, + final TextFileExport textFileExport) { + super(true); + this.clientDiagramService = clientDiagramService; + this.errorPopupPresenter = errorPopupPresenter; + this.textFileExport = textFileExport; + } + + @SuppressWarnings("unchecked") + @Override + protected void export(final String fileName) { + clientDiagramService.getRawContent(getSession().getCanvasHandler().getDiagram(), + new ServiceCallback() { + @Override + public void onSuccess(String rawContent) { + textFileExport.export(TextContent.create(rawContent), + fileName); + } + + @Override + public void onError(ClientRuntimeError error) { + errorPopupPresenter.showMessage(error.getMessage()); + } + }); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/impl/SaveDiagramSessionCommand.java b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/impl/SaveDiagramSessionCommand.java index 1fa242726a9..3636e8bf45a 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/impl/SaveDiagramSessionCommand.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/session/command/impl/SaveDiagramSessionCommand.java @@ -39,7 +39,7 @@ public SaveDiagramSessionCommand() { @Override public void execute(final Callback callback) { - //TODO: call the diagram client and remove the logic from Editor Screens + //TODO (kogito): call the diagram client and remove the logic from Editor Screens } @Override diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/validation/ClientDiagramValidator.java b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/validation/ClientDiagramValidator.java index 16511b36226..fe869ad9e79 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/validation/ClientDiagramValidator.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/main/java/org/kie/workbench/common/stunner/core/client/validation/ClientDiagramValidator.java @@ -16,35 +16,21 @@ package org.kie.workbench.common.stunner.core.client.validation; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Objects; -import java.util.function.Consumer; - import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; -import org.jboss.errai.common.client.api.Caller; import org.kie.workbench.common.stunner.core.api.DefinitionManager; -import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessor; import org.kie.workbench.common.stunner.core.rule.RuleManager; -import org.kie.workbench.common.stunner.core.rule.RuleViolation; -import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; import org.kie.workbench.common.stunner.core.validation.ModelValidator; -import org.kie.workbench.common.stunner.core.validation.ValidationService; import org.kie.workbench.common.stunner.core.validation.impl.AbstractDiagramValidator; @ApplicationScoped public class ClientDiagramValidator extends AbstractDiagramValidator { - private final Caller validationService; - + // CDI proxy. protected ClientDiagramValidator() { this(null, - null, null, null, null); @@ -54,32 +40,10 @@ protected ClientDiagramValidator() { public ClientDiagramValidator(final DefinitionManager definitionManager, final RuleManager ruleManager, final TreeWalkTraverseProcessor treeWalkTraverseProcessor, - final ModelValidator modelValidator, - final Caller validationService) { + final ModelValidator modelValidator) { super(definitionManager, ruleManager, treeWalkTraverseProcessor, modelValidator); - this.validationService = validationService; - } - - @Override - public void validate(Diagram diagram, Consumer>> resultConsumer) { - super.validate(diagram, diagramElementViolations -> { - final List> violations = - (Objects.nonNull(diagramElementViolations) ? new LinkedList<>(diagramElementViolations) : new LinkedList<>()); - backendValidation(diagram, backendViolations -> { - violations.addAll(backendViolations); - resultConsumer.accept(violations); - }); - }); - } - - private void backendValidation(Diagram diagram, final Consumer>> callback) { - validationService.call(result -> callback.accept((Collection>) result), - (msg, error) -> { - callback.accept(Collections.emptyList()); - return false; - }).validate(diagram); } } \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/test/java/org/kie/workbench/common/stunner/core/client/session/command/impl/ExportToBpmnSessionCommandTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/test/java/org/kie/workbench/common/stunner/core/client/session/command/impl/ExportToBpmnSessionCommandTest.java deleted file mode 100644 index 58bbc172e99..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/test/java/org/kie/workbench/common/stunner/core/client/session/command/impl/ExportToBpmnSessionCommandTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.core.client.session.command.impl; - -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.core.client.service.ClientDiagramService; -import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; -import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; -import org.kie.workbench.common.stunner.core.client.session.command.AbstractClientSessionCommand; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.ext.editor.commons.client.file.exports.TextContent; -import org.uberfire.ext.editor.commons.client.file.exports.TextFileExport; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -@RunWith(GwtMockitoTestRunner.class) -public class ExportToBpmnSessionCommandTest extends AbstractExportSessionCommandTest { - - private static final String FILE_RAW_CONTENT = "FILE_RAW_CONTENT"; - - private static final String ERROR = "ERROR"; - - @Mock - private ClientDiagramService clientDiagramService; - - @Mock - private ErrorPopupPresenter errorPopupPresenter; - - @Mock - private TextFileExport textFileExport; - - private ExportToBpmnSessionCommand command; - - private ArgumentCaptor callbackCaptor; - - private ArgumentCaptor textContentCaptor; - - @Before - public void setUp() { - super.setup(); - callbackCaptor = ArgumentCaptor.forClass(ServiceCallback.class); - textContentCaptor = ArgumentCaptor.forClass(TextContent.class); - command = new ExportToBpmnSessionCommand(clientDiagramService, - errorPopupPresenter, - textFileExport); - command.bind(session); - } - - @Test - @SuppressWarnings("unchecked") - public void testExportSuccessful() { - command.execute(callback); - - verify(clientDiagramService, - times(1)).getRawContent(eq(diagram), - callbackCaptor.capture()); - callbackCaptor.getValue().onSuccess(FILE_RAW_CONTENT); - - verify(textFileExport, - times(1)).export(textContentCaptor.capture(), - eq(FILE_NAME)); - assertEquals(FILE_RAW_CONTENT, - textContentCaptor.getValue().getText()); - } - - @Test - @SuppressWarnings("unchecked") - public void testExportUnSuccessful() { - command.execute(callback); - - verify(clientDiagramService, - times(1)).getRawContent(eq(diagram), - callbackCaptor.capture()); - callbackCaptor.getValue().onError(new ClientRuntimeError(ERROR)); - - verify(textFileExport, - never()).export(anyObject(), - anyObject()); - verify(errorPopupPresenter, - times(1)).showMessage(ERROR); - } - - @Override - protected AbstractClientSessionCommand getCommand() { - return command; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/test/java/org/kie/workbench/common/stunner/core/client/session/command/impl/ExportToRawFormatSessionCommandTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/test/java/org/kie/workbench/common/stunner/core/client/session/command/impl/ExportToRawFormatSessionCommandTest.java new file mode 100644 index 00000000000..4d117524775 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/test/java/org/kie/workbench/common/stunner/core/client/session/command/impl/ExportToRawFormatSessionCommandTest.java @@ -0,0 +1,111 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.core.client.session.command.impl; + +import com.google.gwtmockito.GwtMockitoTestRunner; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.core.client.service.ClientDiagramService; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.kie.workbench.common.stunner.core.client.session.command.AbstractClientSessionCommand; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; +import org.uberfire.ext.editor.commons.client.file.exports.TextContent; +import org.uberfire.ext.editor.commons.client.file.exports.TextFileExport; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +@RunWith(GwtMockitoTestRunner.class) +public class ExportToRawFormatSessionCommandTest extends AbstractExportSessionCommandTest { + + private static final String FILE_RAW_CONTENT = "FILE_RAW_CONTENT"; + + private static final String ERROR = "ERROR"; + + @Mock + private ClientDiagramService clientDiagramService; + + @Mock + private ErrorPopupPresenter errorPopupPresenter; + + @Mock + private TextFileExport textFileExport; + + private ExportToRawFormatSessionCommand command; + + private ArgumentCaptor callbackCaptor; + + private ArgumentCaptor textContentCaptor; + + @Before + public void setUp() { + super.setup(); + callbackCaptor = ArgumentCaptor.forClass(ServiceCallback.class); + textContentCaptor = ArgumentCaptor.forClass(TextContent.class); + command = new ExportToRawFormatSessionCommand(clientDiagramService, + errorPopupPresenter, + textFileExport); + command.bind(session); + } + + @Test + @SuppressWarnings("unchecked") + public void testExportSuccessful() { + command.execute(callback); + + verify(clientDiagramService, + times(1)).getRawContent(eq(diagram), + callbackCaptor.capture()); + callbackCaptor.getValue().onSuccess(FILE_RAW_CONTENT); + + verify(textFileExport, + times(1)).export(textContentCaptor.capture(), + eq(FILE_NAME)); + assertEquals(FILE_RAW_CONTENT, + textContentCaptor.getValue().getText()); + } + + @Test + @SuppressWarnings("unchecked") + public void testExportUnSuccessful() { + command.execute(callback); + + verify(clientDiagramService, + times(1)).getRawContent(eq(diagram), + callbackCaptor.capture()); + callbackCaptor.getValue().onError(new ClientRuntimeError(ERROR)); + + verify(textFileExport, + never()).export(anyObject(), + anyObject()); + verify(errorPopupPresenter, + times(1)).showMessage(ERROR); + } + + @Override + protected AbstractClientSessionCommand getCommand() { + return command; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/test/java/org/kie/workbench/common/stunner/core/client/validation/ClientDiagramValidatorTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/test/java/org/kie/workbench/common/stunner/core/client/validation/ClientDiagramValidatorTest.java deleted file mode 100644 index ddd9ba34f75..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-client-common/src/test/java/org/kie/workbench/common/stunner/core/client/validation/ClientDiagramValidatorTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.core.client.validation; - -import java.util.Collection; -import java.util.Collections; -import java.util.Objects; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.core.TestingGraphMockHandler; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessor; -import org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessorImpl; -import org.kie.workbench.common.stunner.core.rule.RuleViolation; -import org.kie.workbench.common.stunner.core.util.UUID; -import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; -import org.kie.workbench.common.stunner.core.validation.ModelValidator; -import org.kie.workbench.common.stunner.core.validation.ValidationService; -import org.kie.workbench.common.stunner.core.validation.impl.ElementViolationImpl; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; -import org.uberfire.mocks.CallerMock; - -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class ClientDiagramValidatorTest { - - private ClientDiagramValidator clientDiagramValidator; - - @Mock - private TreeWalkTraverseProcessor treeWalkTraverseProcessor; - - @Mock - private ModelValidator modelValidator; - - @Mock - private ValidationService validationService; - - @Mock - private Diagram diagram; - - @Mock - private Metadata metadata; - - private TestingGraphMockHandler graphTestHandler; - - private String uuid = UUID.uuid(); - - private ElementViolationImpl backendViolation; - - @Before - public void setUp() throws Exception { - this.graphTestHandler = new TestingGraphMockHandler(); - treeWalkTraverseProcessor = new TreeWalkTraverseProcessorImpl(); - backendViolation = new ElementViolationImpl.Builder().setUuid(uuid).build(); - Collection> violations = Collections.singletonList(backendViolation); - when(diagram.getName()).thenReturn("Test diagram"); - when(diagram.getMetadata()).thenReturn(metadata); - when(validationService.validate(diagram)).thenReturn(violations); - clientDiagramValidator = new ClientDiagramValidator(graphTestHandler.getDefinitionManager(), - graphTestHandler.getRuleManager(), - treeWalkTraverseProcessor, - modelValidator, - new CallerMock<>(validationService)); - } - - @Test - public void validate() { - when(diagram.getGraph()).thenReturn(graphTestHandler.graph); - clientDiagramValidator.validate(diagram, result -> assertTrue(result.stream().anyMatch(v -> Objects.equals(backendViolation, v)))); - verify(validationService).validate(diagram); - } -} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-core-common/src/main/java/org/kie/workbench/common/stunner/core/diagram/DiagramImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-core-common/src/main/java/org/kie/workbench/common/stunner/core/diagram/DiagramImpl.java index 0cf7886b728..f6b60060829 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-core-common/src/main/java/org/kie/workbench/common/stunner/core/diagram/DiagramImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-core-common/src/main/java/org/kie/workbench/common/stunner/core/diagram/DiagramImpl.java @@ -30,6 +30,14 @@ public DiagramImpl(final @MapsTo("name") String name, metadata); } + public DiagramImpl(final String name, + final Graph graph, + final Metadata metadata) { + super(name, + graph, + metadata); + } + @Override public int hashCode() { int graphHash = (null != getGraph()) ? getGraph().hashCode() : 0; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/main/java/org/kie/workbench/common/stunner/forms/client/event/RefreshFormPropertiesEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/main/java/org/kie/workbench/common/stunner/forms/client/event/RefreshFormPropertiesEvent.java index 21c0539b13a..8417de0b715 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/main/java/org/kie/workbench/common/stunner/forms/client/event/RefreshFormPropertiesEvent.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/main/java/org/kie/workbench/common/stunner/forms/client/event/RefreshFormPropertiesEvent.java @@ -23,12 +23,20 @@ public final class RefreshFormPropertiesEvent implements UberFireEvent { private final ClientSession session; private final String uuid; + public RefreshFormPropertiesEvent(final ClientSession session) { + this(session, null); + } + public RefreshFormPropertiesEvent(final ClientSession session, final String uuid) { this.session = session; this.uuid = uuid; } + public boolean hasUuid() { + return null != uuid; + } + public String getUuid() { return uuid; } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/main/java/org/kie/workbench/common/stunner/forms/client/session/StunnerFormsHandler.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/main/java/org/kie/workbench/common/stunner/forms/client/session/StunnerFormsHandler.java new file mode 100644 index 00000000000..718832e759e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/main/java/org/kie/workbench/common/stunner/forms/client/session/StunnerFormsHandler.java @@ -0,0 +1,72 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.forms.client.session; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.event.Event; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.core.client.api.SessionManager; +import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; +import org.kie.workbench.common.stunner.core.client.session.ClientSession; +import org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils; +import org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent; + +@ApplicationScoped +public class StunnerFormsHandler { + + private final SessionManager sessionManager; + private final Event refreshFormsEvent; + + // CDI proxy. + public StunnerFormsHandler() { + this(null, null); + } + + @Inject + public StunnerFormsHandler(final SessionManager sessionManager, + final Event refreshFormsEvent) { + this.sessionManager = sessionManager; + this.refreshFormsEvent = refreshFormsEvent; + } + + public void refreshCurrentSessionForms() { + refreshCurrentSessionForms(null); + } + + public void refreshCurrentSessionForms(final Class defSetType) { + final ClientSession session = sessionManager.getCurrentSession(); + boolean fireEvent = false; + if (null != session) { + if (null != defSetType) { + final CanvasHandler canvasHandler = session.getCanvasHandler(); + if (null != canvasHandler) { + final String id = canvasHandler.getDiagram().getMetadata().getDefinitionSetId(); + final String expected = BindableAdapterUtils.getDefinitionSetId(defSetType); + if (id.equals(expected)) { + fireEvent = true; + } + } + } else { + fireEvent = true; + } + if (fireEvent) { + refreshFormsEvent.fire(new RefreshFormPropertiesEvent(session)); + } + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/main/java/org/kie/workbench/common/stunner/forms/client/widgets/FormsCanvasSessionHandler.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/main/java/org/kie/workbench/common/stunner/forms/client/widgets/FormsCanvasSessionHandler.java index 2b412db7491..c9e63d5a8c6 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/main/java/org/kie/workbench/common/stunner/forms/client/widgets/FormsCanvasSessionHandler.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/main/java/org/kie/workbench/common/stunner/forms/client/widgets/FormsCanvasSessionHandler.java @@ -27,6 +27,7 @@ import org.kie.workbench.common.forms.dynamic.service.shared.RenderMode; import org.kie.workbench.common.stunner.core.api.DefinitionManager; import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; +import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; import org.kie.workbench.common.stunner.core.client.canvas.controls.SelectionControl; import org.kie.workbench.common.stunner.core.client.canvas.event.selection.CanvasSelectionEvent; import org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent; @@ -163,17 +164,21 @@ private boolean execute(CanvasCommand command, FormsListe void onRefreshFormPropertiesEvent(@Observes RefreshFormPropertiesEvent event) { checkNotNull("event", event); - if (!Objects.isNull(getCanvasHandler())) { - final String uuid = event.getUuid(); - final Element> element = CanvasLayoutUtils.getElement(getCanvasHandler(), uuid); - render(element); + if (checkSession(event.getSession())) { + if (event.hasUuid()) { + final String uuid = event.getUuid(); + final Element> element = CanvasLayoutUtils.getElement(getCanvasHandler(), uuid); + render(element); + } else { + show(); + } } } void onCanvasSelectionEvent(@Observes CanvasSelectionEvent event) { checkNotNull("event", event); - if (!Objects.isNull(getCanvasHandler())) { + if (checkCanvasHandler(event.getCanvasHandler())) { if (event.getIdentifiers().size() == 1) { final String uuid = event.getIdentifiers().iterator().next(); final Element> element = CanvasLayoutUtils.getElement(getCanvasHandler(), uuid); @@ -185,7 +190,7 @@ void onCanvasSelectionEvent(@Observes CanvasSelectionEvent event) { void onDomainObjectSelectionEvent(@Observes DomainObjectSelectionEvent event) { checkNotNull("event", event); - if (!Objects.isNull(getCanvasHandler())) { + if (checkCanvasHandler(event.getCanvasHandler())) { final DomainObject domainObject = event.getDomainObject(); render(domainObject); } @@ -253,6 +258,15 @@ private void render(final DomainObject domainObject, } } + private boolean checkCanvasHandler(final CanvasHandler ch) { + AbstractCanvasHandler canvasHandler = getCanvasHandler(); + return !Objects.isNull(canvasHandler) && canvasHandler.equals(ch); + } + + private boolean checkSession(final ClientSession s) { + return checkCanvasHandler(s.getCanvasHandler()); + } + /** * A listener that refresh the forms once an element has been updated, * but it skips the refreshing when updates come from this forms widget instance. diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/test/java/org/kie/workbench/common/stunner/forms/client/session/StunnerFormsHandlerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/test/java/org/kie/workbench/common/stunner/forms/client/session/StunnerFormsHandlerTest.java new file mode 100644 index 00000000000..1c6b18979f8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-forms/kie-wb-common-stunner-forms-client/src/test/java/org/kie/workbench/common/stunner/forms/client/session/StunnerFormsHandlerTest.java @@ -0,0 +1,112 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.forms.client.session; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.core.client.api.SessionManager; +import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; +import org.kie.workbench.common.stunner.core.client.session.ClientSession; +import org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.uberfire.mocks.EventSourceMock; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class StunnerFormsHandlerTest { + + @Mock + private SessionManager sessionManager; + + @Mock + private EventSourceMock refreshFormsEvent; + + private StunnerFormsHandler tested; + + @Before + @SuppressWarnings("unchecked") + public void init() { + tested = new StunnerFormsHandler(sessionManager, refreshFormsEvent); + } + + @Test + @SuppressWarnings("unchecked") + public void testRefreshCurrentSessionForms() { + ClientSession session = mock(ClientSession.class); + when(sessionManager.getCurrentSession()).thenReturn(session); + tested.refreshCurrentSessionForms(); + ArgumentCaptor eventCaptor = ArgumentCaptor.forClass(RefreshFormPropertiesEvent.class); + verify(refreshFormsEvent, times(1)).fire(eventCaptor.capture()); + RefreshFormPropertiesEvent event = eventCaptor.getValue(); + assertEquals(session, event.getSession()); + assertNull(event.getUuid()); + } + + @Test + @SuppressWarnings("unchecked") + public void testRefreshCurrentSessionFormsByDomain() { + ClientSession session = mock(ClientSession.class); + CanvasHandler handler = mock(CanvasHandler.class); + Diagram diagram = mock(Diagram.class); + Metadata metadata = mock(Metadata.class); + when(sessionManager.getCurrentSession()).thenReturn(session); + when(session.getCanvasHandler()).thenReturn(handler); + when(handler.getDiagram()).thenReturn(diagram); + when(diagram.getMetadata()).thenReturn(metadata); + when(metadata.getDefinitionSetId()).thenReturn(BindableAdapterUtils.getDefinitionSetId(SomeDomain.class)); + tested.refreshCurrentSessionForms(SomeDomain.class); + ArgumentCaptor eventCaptor = ArgumentCaptor.forClass(RefreshFormPropertiesEvent.class); + verify(refreshFormsEvent, times(1)).fire(eventCaptor.capture()); + RefreshFormPropertiesEvent event = eventCaptor.getValue(); + assertEquals(session, event.getSession()); + assertNull(event.getUuid()); + } + + @Test + @SuppressWarnings("unchecked") + public void testRefreshCurrentSessionFormsByNotMatchingDomain() { + ClientSession session = mock(ClientSession.class); + CanvasHandler handler = mock(CanvasHandler.class); + Diagram diagram = mock(Diagram.class); + Metadata metadata = mock(Metadata.class); + when(sessionManager.getCurrentSession()).thenReturn(session); + when(session.getCanvasHandler()).thenReturn(handler); + when(handler.getDiagram()).thenReturn(diagram); + when(diagram.getMetadata()).thenReturn(metadata); + when(metadata.getDefinitionSetId()).thenReturn("ds1"); + tested.refreshCurrentSessionForms(SomeDomain.class); + verify(refreshFormsEvent, never()).fire(any(RefreshFormPropertiesEvent.class)); + } + + private static class SomeDomain { + + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/.gitignore b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/.gitignore new file mode 100644 index 00000000000..94ef3ba19a4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/.gitignore @@ -0,0 +1,15 @@ +/target +/local + +# Eclipse, Netbeans and IntelliJ files +/.* +/**/.* +!.gitignore +/nbproject +*.ipr +*.iws +*.iml + +# Repository wide ignore mac DS_Store files +.DS_Store + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/README.md b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/README.md new file mode 100644 index 00000000000..a6c0a8e47d7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/README.md @@ -0,0 +1,5 @@ +Stunner - Kogito integration modules +======================================= + +These children modules provide the different assets and services to achieve the Stunner integration with the Kogito +initiative. \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/.gitignore b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/.gitignore new file mode 100644 index 00000000000..94ef3ba19a4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/.gitignore @@ -0,0 +1,15 @@ +/target +/local + +# Eclipse, Netbeans and IntelliJ files +/.* +/**/.* +!.gitignore +/nbproject +*.ipr +*.iws +*.iml + +# Repository wide ignore mac DS_Store files +.DS_Store + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/pom.xml new file mode 100644 index 00000000000..de0e18e4966 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/pom.xml @@ -0,0 +1,118 @@ + + + + + kie-wb-common-stunner-kogito + org.kie.workbench.stunner + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-stunner-kogito-api + Kie Workbench - Common - Stunner - Kogito - API + Kie Workbench - Common - Stunner - Kogito - API + jar + + + org.kie.wb.common.kogito.api + + + + + + + org.kie.soup + kie-soup-commons + + + + + org.uberfire + uberfire-api + + + org.uberfire + uberfire-services-api + + + org.uberfire + uberfire-project-api + + + org.uberfire + uberfire-commons-editor-api + + + + + org.jboss.errai + errai-bus + + + org.jboss.errai + errai-common + + + + + com.google.elemental2 + elemental2-promise + + + + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-common + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-client-api + + + + + junit + junit + test + + + org.mockito + mockito-core + test + + + com.google.gwt.gwtmockito + gwtmockito + test + + + org.uberfire + uberfire-testing-utils + test + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/Kogito.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/Kogito.java new file mode 100644 index 00000000000..a398b53865a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/Kogito.java @@ -0,0 +1,39 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.api; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + *

+ * Using this interface just to easily identify all types resulting from the functional decomposition being performed + * during the kogito initiative refactoring. + * Any component, service or whatever managed bean that requires access to any remote context should, at least, provide + * two implementations for its declared KogitoContext subtype: + *

    + *
  • The "Standalone" implementation - This implementation targets kogito based editors - it should depend as less as possible on backend
  • + *
  • The "Project" implementation - This implementation targets KIE Workbench based editors - it's able to depend on all KIE related services
  • + *
+ */ +@Retention(RetentionPolicy.SOURCE) +@Target({ElementType.TYPE}) +public @interface Kogito { + +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/editor/DiagramType.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/editor/DiagramType.java new file mode 100644 index 00000000000..cfecc4cc14e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/editor/DiagramType.java @@ -0,0 +1,22 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.api.editor; + +public enum DiagramType { + XML_DIAGRAM, + PROJECT_DIAGRAM + +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/editor/KogitoDiagramResource.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/editor/KogitoDiagramResource.java new file mode 100644 index 00000000000..0e17fb8ad9b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/editor/KogitoDiagramResource.java @@ -0,0 +1,27 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.api.editor; + +import java.util.Optional; + +public interface KogitoDiagramResource { + + Optional projectDiagram(); + + Optional xmlDiagram(); + + DiagramType getType(); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/editor/impl/KogitoDiagramResourceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/editor/impl/KogitoDiagramResourceImpl.java new file mode 100644 index 00000000000..679a21b007b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/editor/impl/KogitoDiagramResourceImpl.java @@ -0,0 +1,97 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.api.editor.impl; + +import java.util.Objects; +import java.util.Optional; + +import org.jboss.errai.common.client.api.annotations.MapsTo; +import org.jboss.errai.common.client.api.annotations.Portable; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.util.HashUtil; +import org.kie.workbench.common.stunner.kogito.api.editor.DiagramType; +import org.kie.workbench.common.stunner.kogito.api.editor.KogitoDiagramResource; + +import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; + +@Portable +public class KogitoDiagramResourceImpl implements KogitoDiagramResource { + + private Diagram projectDiagram = null; + + private String xmlDiagram = ""; + + private DiagramType type = DiagramType.PROJECT_DIAGRAM; + + public KogitoDiagramResourceImpl(final @MapsTo("projectDiagram") Diagram projectDiagram, + final @MapsTo("xmlDiagram") String xmlDiagram, + final @MapsTo("type") DiagramType type) { + checkNotNull("type", type); + + this.projectDiagram = projectDiagram; + this.xmlDiagram = xmlDiagram; + this.type = type; + } + + public KogitoDiagramResourceImpl(final Diagram projectDiagram) { + this(projectDiagram, null, DiagramType.PROJECT_DIAGRAM); + } + + public KogitoDiagramResourceImpl(final String xmlDiagram) { + this(null, xmlDiagram, DiagramType.XML_DIAGRAM); + } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final KogitoDiagramResourceImpl that = (KogitoDiagramResourceImpl) o; + if (projectDiagram != null ? !projectDiagram.equals(that.projectDiagram) : that.projectDiagram != null) { + return false; + } + if (xmlDiagram != null ? !xmlDiagram.equals(that.xmlDiagram) : that.xmlDiagram != null) { + return false; + } + + return type == that.type; + } + + @Override + public int hashCode() { + return HashUtil.combineHashCodes(Objects.hashCode(projectDiagram), + Objects.hashCode(xmlDiagram), + Objects.hashCode(type)); + } + + @Override + public Optional projectDiagram() { + return Optional.ofNullable(projectDiagram); + } + + @Override + public Optional xmlDiagram() { + return Optional.ofNullable(xmlDiagram); + } + + @Override + public DiagramType getType() { + return type; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/service/KogitoDiagramService.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/service/KogitoDiagramService.java new file mode 100644 index 00000000000..da289b26a3c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/java/org/kie/workbench/common/stunner/kogito/api/service/KogitoDiagramService.java @@ -0,0 +1,29 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.api.service; + +import org.jboss.errai.bus.server.annotations.Remote; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.kogito.api.Kogito; + +@Kogito +@Remote +public interface KogitoDiagramService { + + Diagram transform(final String xml); + + String transform(final Diagram diagram); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/resources/META-INF/ErraiApp.properties b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/resources/META-INF/ErraiApp.properties new file mode 100644 index 00000000000..4245e78c846 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/resources/META-INF/ErraiApp.properties @@ -0,0 +1,29 @@ +# +# Copyright 2016 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +# ErraiApp.properties +# +# Do not remove, even if empty! +# +# This is a marker file. When it is detected inside a JAR or at the +# top of any classpath, the subdirectories are scanned for deployable +# components. As such, all Errai application modules in a project +# should contain an ErraiApp.properties at the root of all classpaths +# that you wish to be scanned. +# +# There are also some configuration options that can be set in this +# file, although it is rarely necessary. See the documentation at +# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties +# for details. diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/resources/META-INF/beans.xml b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/resources/META-INF/beans.xml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/resources/org/kie/workbench/common/stunner/kogito/StunnerKogitoAPI.gwt.xml b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/resources/org/kie/workbench/common/stunner/kogito/StunnerKogitoAPI.gwt.xml new file mode 100644 index 00000000000..22c8ff56466 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/main/resources/org/kie/workbench/common/stunner/kogito/StunnerKogitoAPI.gwt.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/test/java/org/kie/workbench/common/stunner/kogito/api/editor/impl/KogitoDiagramResourceImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/test/java/org/kie/workbench/common/stunner/kogito/api/editor/impl/KogitoDiagramResourceImplTest.java new file mode 100644 index 00000000000..3e4bd78686c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-api/src/test/java/org/kie/workbench/common/stunner/kogito/api/editor/impl/KogitoDiagramResourceImplTest.java @@ -0,0 +1,126 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.api.editor.impl; + +import org.junit.Test; +import org.kie.workbench.common.stunner.core.diagram.DiagramImpl; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.graph.impl.GraphImpl; +import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; +import org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl; +import org.kie.workbench.common.stunner.kogito.api.editor.DiagramType; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + +public class KogitoDiagramResourceImplTest { + + @Test + @SuppressWarnings("unchecked") + public void testEqualsWhenProjectDiagramIsDifferent() { + final DiagramImpl projectDiagram1 = new DiagramImpl("Diagram", makeGraph(), makeMetadata()); + final DiagramImpl projectDiagram2 = new DiagramImpl("Diagram_", makeGraph(), makeMetadata()); + final KogitoDiagramResourceImpl projectDiagramResource1 = new KogitoDiagramResourceImpl(projectDiagram1); + final KogitoDiagramResourceImpl projectDiagramResource2 = new KogitoDiagramResourceImpl(projectDiagram2); + + assertNotEquals(projectDiagramResource1, projectDiagramResource2); + assertNotEquals(projectDiagramResource1.hashCode(), projectDiagramResource2.hashCode()); + } + + @Test + public void testEqualsWhenXmlDiagramIsDifferent() { + final KogitoDiagramResourceImpl projectDiagramResource1 = new KogitoDiagramResourceImpl(""); + final KogitoDiagramResourceImpl projectDiagramResource2 = new KogitoDiagramResourceImpl(""); + + assertNotEquals(projectDiagramResource1, projectDiagramResource2); + assertNotEquals(projectDiagramResource1.hashCode(), projectDiagramResource2.hashCode()); + } + + @Test + public void testEqualsWhenTypeIsDifferent() { + final KogitoDiagramResourceImpl projectDiagramResource1 = new KogitoDiagramResourceImpl(null, null, DiagramType.PROJECT_DIAGRAM); + final KogitoDiagramResourceImpl projectDiagramResource2 = new KogitoDiagramResourceImpl(null, null, DiagramType.XML_DIAGRAM); + + assertNotEquals(projectDiagramResource1, projectDiagramResource2); + assertNotEquals(projectDiagramResource1.hashCode(), projectDiagramResource2.hashCode()); + } + + @Test + @SuppressWarnings("unchecked") + public void testEqualsWhenProjectDiagramIsDifferentGraph() { + final GraphImpl graphOne = makeGraph(); + final GraphImpl graphTwo = makeGraph(); + + graphTwo.addNode(new NodeImpl("unique id")); + + final DiagramImpl projectDiagram1 = new DiagramImpl("Diagram", graphOne, makeMetadata()); + final DiagramImpl projectDiagram2 = new DiagramImpl("Diagram", graphTwo, makeMetadata()); + final KogitoDiagramResourceImpl projectDiagramResource1 = new KogitoDiagramResourceImpl(projectDiagram1); + final KogitoDiagramResourceImpl projectDiagramResource2 = new KogitoDiagramResourceImpl(projectDiagram2); + + assertNotEquals(projectDiagramResource1, projectDiagramResource2); + assertNotEquals(projectDiagramResource1.hashCode(), projectDiagramResource2.hashCode()); + } + + @Test + @SuppressWarnings("unchecked") + public void testEqualsWhenProjectDiagramIsDifferentMetadata() { + final Metadata metadataOne = makeMetadata(); + final Metadata metadataTwo = makeMetadata(); + + doReturn("moduleOne").when(metadataOne).getTitle(); + doReturn("moduleTwo").when(metadataTwo).getTitle(); + + final DiagramImpl projectDiagram1 = new DiagramImpl("Diagram", makeGraph(), metadataOne); + final DiagramImpl projectDiagram2 = new DiagramImpl("Diagram", makeGraph(), metadataTwo); + final KogitoDiagramResourceImpl projectDiagramResource1 = new KogitoDiagramResourceImpl(projectDiagram1); + final KogitoDiagramResourceImpl projectDiagramResource2 = new KogitoDiagramResourceImpl(projectDiagram2); + + assertNotEquals(projectDiagramResource1, projectDiagramResource2); + assertNotEquals(projectDiagramResource1.hashCode(), projectDiagramResource2.hashCode()); + } + + @Test + @SuppressWarnings("unchecked") + public void testEqualsWhenObjectsAreEqual() { + final GraphImpl graph = makeGraph(); + final Metadata metadata = makeMetadata(); + final String diagramName = "Diagram"; + final DiagramImpl projectDiagram1 = new DiagramImpl(diagramName, graph, metadata); + final DiagramImpl projectDiagram2 = new DiagramImpl(diagramName, graph, metadata); + final KogitoDiagramResourceImpl projectDiagramResource1 = new KogitoDiagramResourceImpl(projectDiagram1); + final KogitoDiagramResourceImpl projectDiagramResource2 = new KogitoDiagramResourceImpl(projectDiagram2); + + assertEquals(projectDiagramResource1, projectDiagramResource2); + assertEquals(projectDiagramResource1.hashCode(), projectDiagramResource2.hashCode()); + } + + @Test(expected = IllegalArgumentException.class) + public void testInstanceCreationWhenTypeIsNull() { + new KogitoDiagramResourceImpl(null, null, null); + } + + private GraphImpl makeGraph() { + return new GraphImpl("Graph", new GraphNodeStoreImpl()); + } + + private Metadata makeMetadata() { + return mock(Metadata.class); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/.gitignore b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/.gitignore new file mode 100644 index 00000000000..94ef3ba19a4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/.gitignore @@ -0,0 +1,15 @@ +/target +/local + +# Eclipse, Netbeans and IntelliJ files +/.* +/**/.* +!.gitignore +/nbproject +*.ipr +*.iws +*.iml + +# Repository wide ignore mac DS_Store files +.DS_Store + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/pom.xml new file mode 100644 index 00000000000..76c923d895a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/pom.xml @@ -0,0 +1,183 @@ + + + + + kie-wb-common-stunner-kogito + org.kie.workbench.stunner + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-stunner-kogito-client + Kie Workbench - Common - Stunner - Kogito - Client + Kie Workbench - Common - Stunner - Kogito - Client + jar + + + org.kie.wb.common.kogito.client + + + + + + + org.kie.soup + kie-soup-commons + + + + + org.jboss.errai + errai-common + + + org.jboss.errai + errai-ioc + + + org.jboss.errai + errai-ui + + + + + org.uberfire + uberfire-api + + + org.uberfire + uberfire-client-api + + + org.uberfire + uberfire-project-api + + + org.uberfire + uberfire-services-api + + + org.uberfire + uberfire-workbench-client + + + org.uberfire + uberfire-widgets-core-client + + + org.uberfire + uberfire-widgets-commons + + + org.uberfire + uberfire-commons-editor-client + + + org.kie.workbench.widgets + kie-wb-common-ui + + + + + com.google.elemental2 + elemental2-promise + + + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-client-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-client-common + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-widgets + + + org.kie.workbench.stunner + kie-wb-common-stunner-forms-client + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-common + + + + + org.kie.workbench + kie-wb-common-kogito-client + + + + + com.google.gwt + gwt-user + + + org.gwtbootstrap3 + gwtbootstrap3 + + + + + junit + junit + test + + + + org.mockito + mockito-core + test + + + + com.google.gwt.gwtmockito + gwtmockito + test + + + + org.uberfire + uberfire-testing-utils + test + + + + org.kie.workbench.stunner + kie-wb-common-stunner-client-common + test + test-jar + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/KogitoClientEntryPoint.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/KogitoClientEntryPoint.java new file mode 100644 index 00000000000..724333d2656 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/KogitoClientEntryPoint.java @@ -0,0 +1,26 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client; + +import org.jboss.errai.ioc.client.api.EntryPoint; +import org.jboss.errai.ui.shared.api.annotations.Bundle; + +@EntryPoint +@Bundle("resources/i18n/KogitoClientConstants.properties") +public class KogitoClientEntryPoint { + +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/docks/BaseDiagramEditorDock.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/docks/BaseDiagramEditorDock.java new file mode 100644 index 00000000000..0b32b59af8e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/docks/BaseDiagramEditorDock.java @@ -0,0 +1,98 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.docks; + +import org.jboss.errai.ui.client.local.spi.TranslationService; +import org.uberfire.client.workbench.docks.UberfireDock; +import org.uberfire.client.workbench.docks.UberfireDockPosition; +import org.uberfire.client.workbench.docks.UberfireDocks; +import org.uberfire.mvp.impl.DefaultPlaceRequest; + +public abstract class BaseDiagramEditorDock { + + static final double DOCK_SIZE = 400d; + + private final UberfireDocks uberfireDocks; + private UberfireDock uberfireDock; + private boolean isOpened = false; + private String owningPerspectiveId; + private final TranslationService translationService; + + public BaseDiagramEditorDock(UberfireDocks uberfireDocks, TranslationService translationService) { + this.uberfireDocks = uberfireDocks; + this.translationService = translationService; + } + + public void init(final String owningPerspectiveId) { + this.owningPerspectiveId = owningPerspectiveId; + this.uberfireDock = makeUberfireDock(); + } + + public void open() { + if (isOpened()) { + return; + } + + isOpened = true; + uberfireDocks.add(getUberfireDock()); + uberfireDocks.show(position(), owningPerspectiveId()); + } + + public void close() { + if (!isOpened()) { + return; + } + + isOpened = false; + uberfireDocks.close(getUberfireDock()); + uberfireDocks.remove(getUberfireDock()); + } + + public boolean isOpened() { + return isOpened; + } + + private UberfireDockPosition position() { + return UberfireDockPosition.EAST; + } + + private String owningPerspectiveId() { + return owningPerspectiveId; + } + + private UberfireDock getUberfireDock() { + return uberfireDock; + } + + private UberfireDock makeUberfireDock() { + final UberfireDock uberfireDock = new UberfireDock(position(), icon(), placeRequest(), owningPerspectiveId()); + return uberfireDock.withSize(DOCK_SIZE).withLabel(dockLabel()); + } + + private DefaultPlaceRequest placeRequest() { + return new DefaultPlaceRequest(getScreenId()); + } + + abstract String getScreenId(); + + private String dockLabel() { + return translationService.getTranslation(getLabelKey()); + } + + abstract String getLabelKey(); + + abstract String icon(); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/docks/DiagramEditorPreviewAndExplorerDock.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/docks/DiagramEditorPreviewAndExplorerDock.java new file mode 100644 index 00000000000..f7b7dabdb0d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/docks/DiagramEditorPreviewAndExplorerDock.java @@ -0,0 +1,55 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.docks; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import org.gwtbootstrap3.client.ui.constants.IconType; +import org.jboss.errai.ui.client.local.spi.TranslationService; +import org.kie.workbench.common.stunner.kogito.client.resources.i18n.KogitoClientMessages; +import org.kie.workbench.common.stunner.kogito.client.screens.DiagramEditorExplorerScreen; +import org.uberfire.client.workbench.docks.UberfireDocks; + +@ApplicationScoped +public class DiagramEditorPreviewAndExplorerDock extends BaseDiagramEditorDock { + + public DiagramEditorPreviewAndExplorerDock() { + // CDI proxy + this(null, null); + } + + @Inject + public DiagramEditorPreviewAndExplorerDock(final UberfireDocks uberfireDocks, + final TranslationService translationService) { + super(uberfireDocks, translationService); + } + + @Override + final String icon() { + return IconType.EYE.toString(); + } + + @Override + final String getScreenId() { + return DiagramEditorExplorerScreen.SCREEN_ID; + } + + @Override + final String getLabelKey() { + return KogitoClientMessages.EXPLORER_DOCK_TITLE; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/docks/DiagramEditorPropertiesDock.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/docks/DiagramEditorPropertiesDock.java new file mode 100644 index 00000000000..d01175a7092 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/docks/DiagramEditorPropertiesDock.java @@ -0,0 +1,55 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.docks; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import org.gwtbootstrap3.client.ui.constants.IconType; +import org.jboss.errai.ui.client.local.spi.TranslationService; +import org.kie.workbench.common.stunner.kogito.client.resources.i18n.KogitoClientMessages; +import org.kie.workbench.common.stunner.kogito.client.screens.DiagramEditorPropertiesScreen; +import org.uberfire.client.workbench.docks.UberfireDocks; + +@ApplicationScoped +public class DiagramEditorPropertiesDock extends BaseDiagramEditorDock { + + public DiagramEditorPropertiesDock() { + // CDI proxy + this(null, null); + } + + @Inject + public DiagramEditorPropertiesDock(final UberfireDocks uberfireDocks, + final TranslationService translationService) { + super(uberfireDocks, translationService); + } + + @Override + final String icon() { + return IconType.PENCIL_SQUARE_O.toString(); + } + + @Override + final String getScreenId() { + return DiagramEditorPropertiesScreen.SCREEN_ID; + } + + @Override + final String getLabelKey() { + return KogitoClientMessages.PROPERTIES_DOCK_TITLE; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditor.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditor.java new file mode 100644 index 00000000000..d014853cd2f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditor.java @@ -0,0 +1,406 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.editor; + +import java.lang.annotation.Annotation; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Supplier; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.annotation.PostConstruct; +import javax.enterprise.event.Event; + +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.logging.client.LogConfiguration; +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.kie.workbench.common.kogito.client.editor.MultiPageEditorContainerPresenter; +import org.kie.workbench.common.kogito.client.editor.MultiPageEditorContainerView; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; +import org.kie.workbench.common.stunner.core.api.DefinitionManager; +import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; +import org.kie.workbench.common.stunner.core.client.error.DiagramClientErrorHandler; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.session.ClientSession; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.DiagramParsingException; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.documentation.DocumentationPage; +import org.kie.workbench.common.stunner.core.documentation.DocumentationView; +import org.kie.workbench.common.stunner.kogito.api.editor.impl.KogitoDiagramResourceImpl; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.resources.i18n.KogitoClientConstants; +import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; +import org.uberfire.client.mvp.PlaceManager; +import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; +import org.uberfire.ext.widgets.common.client.ace.AceEditorMode; +import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; +import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.events.NotificationEvent; +import org.uberfire.workbench.model.menu.Menus; + +public abstract class AbstractDiagramEditor extends MultiPageEditorContainerPresenter implements DiagramEditorCore { + + private static final Logger LOGGER = Logger.getLogger(AbstractDiagramEditor.class.getName()); + + private final AbstractDiagramEditorMenuSessionItems menuSessionItems; + private final Event changeTitleEvent; + private final Event onDiagramFocusEvent; + private final ClientTranslationService translationService; + private final DocumentationView documentationView; + private final FileMenuBuilder fileMenuBuilder; + + private String title = "Diagram Editor"; + + protected boolean menuBarInitialized = false; + + public class DiagramEditorCore extends AbstractDiagramEditorCore> { + + public DiagramEditorCore(final View baseEditorView, + final TextEditorView xmlEditorView, + final Event notificationEvent, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService) { + super(baseEditorView, + xmlEditorView, + notificationEvent, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService); + } + + @Override + protected boolean isReadOnly() { + return AbstractDiagramEditor.this.isReadOnly(); + } + + @Override + protected KogitoDiagramResourceImpl makeDiagramResourceImpl(final Diagram diagram) { + return new KogitoDiagramResourceImpl(diagram); + } + + @Override + protected KogitoDiagramResourceImpl makeDiagramResourceImpl(final String xml) { + return new KogitoDiagramResourceImpl(xml); + } + + @Override + protected DiagramEditorProxy makeEditorProxy() { + return new DiagramEditorProxy<>(); + } + + @Override + public Annotation[] getDockQualifiers() { + return AbstractDiagramEditor.this.getDockQualifiers(); + } + + @Override + public void initialiseKieEditorForSession(final Diagram diagram) { + AbstractDiagramEditor.this.initialiseKieEditorForSession(diagram); + } + + @Override + public String getEditorIdentifier() { + return AbstractDiagramEditor.this.getEditorIdentifier(); + } + + @Override + public void onLoadError(final ClientRuntimeError error) { + final Throwable e = error.getThrowable(); + if (e instanceof DiagramParsingException) { + final DiagramParsingException dpe = (DiagramParsingException) e; + final Metadata metadata = dpe.getMetadata(); + final String xml = dpe.getXml(); + + setOriginalContentHash(xml.hashCode()); + updateTitle(metadata.getTitle()); + resetEditorPages(); + menuSessionItems.setEnabled(false); + getXMLEditorView().setReadOnly(isReadOnly()); + getXMLEditorView().setContent(xml, AceEditorMode.XML); + getView().setWidget(getXMLEditorView().asWidget()); + setEditorProxy(makeXmlEditorProxy()); + hideLoadingViews(); + getNotificationEvent().fire(new NotificationEvent(translationService.getValue(KogitoClientConstants.DIAGRAM_PARSING_ERROR, Objects.toString(e.getMessage(), "")), + NotificationEvent.NotificationType.ERROR)); + + Scheduler.get().scheduleDeferred(getXMLEditorView()::onResize); + } else { + setEditorProxy(new DiagramEditorProxy<>()); + showError(error); + + //close editor in case of error when opening the editor + getPlaceManager().forceClosePlace(getPlaceRequest()); + } + } + } + + private final AbstractDiagramEditorCore> editor; + + public AbstractDiagramEditor(final View view, + final FileMenuBuilder fileMenuBuilder, + final PlaceManager placeManager, + final MultiPageEditorContainerView multiPageEditorContainerView, + final Event changeTitleEvent, + final Event notificationEvent, + final Event onDiagramFocusEvent, + final TextEditorView xmlEditorView, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService, + final DocumentationView documentationView) { + super(view, + placeManager, + multiPageEditorContainerView); + this.menuSessionItems = menuSessionItems; + this.changeTitleEvent = changeTitleEvent; + this.onDiagramFocusEvent = onDiagramFocusEvent; + this.translationService = translationService; + this.documentationView = documentationView; + this.fileMenuBuilder = fileMenuBuilder; + + this.editor = makeCore(view, + xmlEditorView, + notificationEvent, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService); + } + + protected AbstractDiagramEditorCore> makeCore(final View view, + final TextEditorView xmlEditorView, + final Event notificationEvent, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService) { + return new DiagramEditorCore(view, + xmlEditorView, + notificationEvent, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService); + } + + @PostConstruct + @SuppressWarnings("unchecked") + public void init() { + title = translationService.getValue(KogitoClientConstants.DIAGRAM_EDITOR_DEFAULT_TITLE); + menuSessionItems + .setLoadingStarts(this::showLoadingViews) + .setLoadingCompleted(this::hideLoadingViews) + .setErrorConsumer(editor::showError); + } + + protected void doStartUp(final PlaceRequest place) { + init(place); + } + + @Override + protected void makeMenuBar() { + if (!menuBarInitialized) { + menuSessionItems.populateMenu(fileMenuBuilder); + makeAdditionalStunnerMenus(fileMenuBuilder); + menuBarInitialized = true; + } + } + + @Override + protected void buildMenuBar() { + if (fileMenuBuilder != null) { + setMenus(fileMenuBuilder.build()); + } + } + + @Override + protected Supplier getContentSupplier() { + return editor.getEditorProxy().getContentSupplier(); + } + + @Override + protected Integer getCurrentContentHash() { + return editor.getCurrentDiagramHash(); + } + + protected void doOpen() { + } + + protected void doClose() { + menuSessionItems.destroy(); + editor.destroySession(); + } + + protected void showLoadingViews() { + getView().showLoading(); + } + + protected void hideLoadingViews() { + getView().hideBusyIndicator(); + } + + @Override + protected Menus getMenus() { + if (super.getMenus() == null) { + makeMenuBar(); + } + return super.getMenus(); + } + + protected View getView() { + return (View) getBaseEditorView(); + } + + @Override + public void open(final Diagram diagram) { + editor.open(diagram); + } + + @Override + public Annotation[] getDockQualifiers() { + return new Annotation[]{DefinitionManager.DEFAULT_QUALIFIER}; + } + + @Override + public void initialiseKieEditorForSession(final Diagram diagram) { + resetEditorPages(); + updateTitle(diagram.getMetadata().getTitle()); + onDiagramLoad(); + + //Set original hash after onDiagramLoad that may have modified the Diagram + setOriginalContentHash(getCurrentDiagramHash()); + + addDocumentationPage(diagram); + hideLoadingViews(); + } + + protected void updateTitle(final String title) { + this.title = title; + changeTitleEvent.fire(new ChangeTitleWidgetEvent(getPlaceRequest(), + this.title)); + } + + @SuppressWarnings("unchecked") + protected void addDocumentationPage(final Diagram diagram) { + Optional.of(documentationView.isEnabled()) + .filter(Boolean.TRUE::equals) + .ifPresent(enabled -> { + final String label = translationService.getValue(KogitoClientConstants.DOCUMENTATION); + addPage(new DocumentationPage(documentationView.initialize(diagram), + label, + //firing the OnDiagramFocusEvent will force the docks to be minimized + () -> onDiagramFocusEvent.fire(new OnDiagramFocusEvent(getDockQualifiers())), + //check the DocumentationPage is active, the index is 2 + () -> Objects.equals(2, getSelectedTabIndex()))); + }); + } + + protected void onDiagramLoad() { + /* Override this method to trigger some action after a Diagram is loaded. */ + } + + @Override + public SessionEditorPresenter newSessionEditorPresenter() { + return editor.newSessionEditorPresenter(); + } + + @Override + public SessionViewerPresenter newSessionViewerPresenter() { + return editor.newSessionViewerPresenter(); + } + + @Override + public int getCurrentDiagramHash() { + return editor.getCurrentDiagramHash(); + } + + @Override + public CanvasHandler getCanvasHandler() { + return editor.getCanvasHandler(); + } + + @Override + public void onSaveError(final ClientRuntimeError error) { + editor.onSaveError(error); + } + + @Override + public SessionPresenter getSessionPresenter() { + return editor.getSessionPresenter(); + } + + @Override + public void doFocus() { + editor.doFocus(); + } + + @Override + public void doLostFocus() { + editor.doLostFocus(); + } + + protected boolean isSameSession(final ClientSession other) { + return editor.isSameSession(other); + } + + protected void log(final Level level, + final String message) { + if (LogConfiguration.loggingIsEnabled()) { + LOGGER.log(level, message); + } + } + + @SuppressWarnings("unused") + protected void makeAdditionalStunnerMenus(final FileMenuBuilder fileMenuBuilder) { + } + + public AbstractDiagramEditorMenuSessionItems getMenuSessionItems() { + return menuSessionItems; + } + + public FileMenuBuilder getFileMenuBuilder() { + return fileMenuBuilder; + } + + protected AbstractDiagramEditorCore> getEditor() { + return editor; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditorCore.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditorCore.java new file mode 100644 index 00000000000..76ab710f6f6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditorCore.java @@ -0,0 +1,360 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.editor; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Optional; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.enterprise.event.Event; +import javax.enterprise.event.Observes; + +import com.google.gwt.logging.client.LogConfiguration; +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; +import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; +import org.kie.workbench.common.stunner.core.client.error.DiagramClientErrorHandler; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.session.ClientSession; +import org.kie.workbench.common.stunner.core.client.session.command.impl.UndoSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.event.OnSessionErrorEvent; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; +import org.kie.workbench.common.stunner.core.client.shape.Shape; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.util.HashUtil; +import org.kie.workbench.common.stunner.kogito.api.editor.KogitoDiagramResource; +import org.kie.workbench.common.stunner.kogito.client.resources.i18n.KogitoClientConstants; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; +import org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup; +import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; +import org.uberfire.mvp.Command; +import org.uberfire.workbench.events.NotificationEvent; + +public abstract class AbstractDiagramEditorCore, + P extends DiagramEditorProxy> implements DiagramEditorCore { + + private static final Logger LOGGER = Logger.getLogger(AbstractDiagramEditorCore.class.getName()); + + private final View baseEditorView; + private final TextEditorView xmlEditorView; + private final Event notificationEvent; + private final ManagedInstance> editorSessionPresenterInstances; + private final ManagedInstance> viewerSessionPresenterInstances; + private final Optional> menuSessionItems; + private final ErrorPopupPresenter errorPopupPresenter; + private final DiagramClientErrorHandler diagramClientErrorHandler; + private final ClientTranslationService translationService; + + private Optional> editorSessionPresenter = Optional.empty(); + private Optional> viewerSessionPresenter = Optional.empty(); + + private P editorProxy = makeEditorProxy(); + + public AbstractDiagramEditorCore() { + this(null, null, null, null, null, null, null, null, null); + } + + public AbstractDiagramEditorCore(final View baseEditorView, + final TextEditorView xmlEditorView, + final Event notificationEvent, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService) { + this.baseEditorView = baseEditorView; + this.xmlEditorView = xmlEditorView; + this.notificationEvent = notificationEvent; + this.editorSessionPresenterInstances = editorSessionPresenterInstances; + this.viewerSessionPresenterInstances = viewerSessionPresenterInstances; + this.menuSessionItems = Optional.ofNullable(menuSessionItems); + this.errorPopupPresenter = errorPopupPresenter; + this.diagramClientErrorHandler = diagramClientErrorHandler; + this.translationService = translationService; + } + + @Override + @SuppressWarnings("unchecked") + public void open(final D diagram) { + editorProxy = makeStunnerEditorProxy(); + baseEditorView.showLoading(); + + //Open applicable SessionPresenter + if (!isReadOnly()) { + openSession(diagram); + } else { + openReadOnlySession(diagram); + } + } + + protected abstract boolean isReadOnly(); + + protected abstract C makeDiagramResourceImpl(final D diagram); + + protected abstract C makeDiagramResourceImpl(final String xml); + + protected abstract P makeEditorProxy(); + + @SuppressWarnings("unchecked") + public P makeStunnerEditorProxy() { + final P proxy = makeEditorProxy(); + proxy.setContentSupplier(() -> makeDiagramResourceImpl(getDiagram())); + proxy.setHashCodeSupplier(() -> { + if (null == getDiagram()) { + return 0; + } + int hash = getDiagram().hashCode(); + if (null == getCanvasHandler() || + null == getCanvasHandler().getCanvas() || + null == getCanvasHandler().getCanvas().getShapes()) { + return hash; + } + Collection collectionOfShapes = getCanvasHandler().getCanvas().getShapes(); + ArrayList shapes = new ArrayList<>(); + shapes.addAll(collectionOfShapes); + shapes.sort((a, b) -> (a.getShapeView().getShapeX() == b.getShapeView().getShapeX()) ? + (int) Math.round(a.getShapeView().getShapeY() - b.getShapeView().getShapeY()) : + (int) Math.round(a.getShapeView().getShapeX() - b.getShapeView().getShapeX())); + for (Shape shape : shapes) { + hash = HashUtil.combineHashCodes(hash, + Double.hashCode(shape.getShapeView().getShapeX()), + Double.hashCode(shape.getShapeView().getShapeY())); + } + return hash; + }); + + return proxy; + } + + public P makeXmlEditorProxy() { + final P proxy = makeEditorProxy(); + proxy.setContentSupplier(() -> makeDiagramResourceImpl(xmlEditorView.getContent())); + proxy.setHashCodeSupplier(() -> xmlEditorView.getContent().hashCode()); + return proxy; + } + + public void openSession(final D diagram) { + editorSessionPresenter = Optional.ofNullable(newSessionEditorPresenter()); + editorSessionPresenter.ifPresent(p -> p.open(diagram, getSessionPresenterCallback(diagram))); + } + + private SessionPresenter.SessionPresenterCallback getSessionPresenterCallback(D diagram) { + return new SessionPresenter.SessionPresenterCallback() { + @Override + public void afterSessionOpened() { + + } + + @Override + public void afterCanvasInitialized() { + + } + + @Override + public void onSuccess() { + initialiseKieEditorForSession(diagram); + menuSessionItems.ifPresent(menuItems -> menuItems.bind(getSession())); + } + + @Override + public void onError(final ClientRuntimeError error) { + onLoadError(error); + } + }; + } + + public void openReadOnlySession(final D diagram) { + viewerSessionPresenter = Optional.ofNullable(newSessionViewerPresenter()); + viewerSessionPresenter.ifPresent(p -> p.open(diagram, getSessionPresenterCallback(diagram))); + } + + public abstract void onLoadError(final ClientRuntimeError error); + + @Override + public SessionEditorPresenter newSessionEditorPresenter() { + final SessionEditorPresenter presenter = + (SessionEditorPresenter) editorSessionPresenterInstances.get() + .withToolbar(false) + .withPalette(true) + .displayNotifications(type -> true); + baseEditorView.setWidget(presenter.getView()); + return presenter; + } + + @Override + public SessionViewerPresenter newSessionViewerPresenter() { + final SessionViewerPresenter presenter = + (SessionViewerPresenter) viewerSessionPresenterInstances.get() + .withToolbar(false) + .withPalette(false) + .displayNotifications(type -> true); + baseEditorView.setWidget(presenter.getView()); + return presenter; + } + + @SuppressWarnings("unused") + void onSessionErrorEvent(final @Observes OnSessionErrorEvent errorEvent) { + if (isSameSession(errorEvent.getSession())) { + executeWithConfirm(translationService.getValue(KogitoClientConstants.ON_ERROR_CONFIRM_UNDO_LAST_ACTION, + errorEvent.getError()), + () -> menuSessionItems + .map(AbstractDiagramEditorMenuSessionItems::getCommands) + .map(EditorSessionCommands::getUndoSessionCommand) + .ifPresent(UndoSessionCommand::execute)); + } + } + + protected boolean isSameSession(final ClientSession other) { + return null != other && null != getSession() && other.equals(getSession()); + } + + private void executeWithConfirm(final String message, + final Command command) { + final Command yesCommand = command::execute; + final Command noCommand = () -> {/*NOP*/}; + final YesNoCancelPopup popup = + YesNoCancelPopup.newYesNoCancelPopup(message, + null, + yesCommand, + noCommand, + noCommand); + popup.show(); + } + + public P getEditorProxy() { + return editorProxy; + } + + protected void setEditorProxy(final P editorProxy) { + this.editorProxy = editorProxy; + } + + protected View getBaseEditorView() { + return baseEditorView; + } + + protected TextEditorView getXMLEditorView() { + return xmlEditorView; + } + + protected Event getNotificationEvent() { + return notificationEvent; + } + + protected AbstractDiagramEditorMenuSessionItems getMenuSessionItems() { + return menuSessionItems.orElse(null); + } + + public void destroySession() { + //Release existing SessionPresenter + editorSessionPresenter.ifPresent(session -> { + session.destroy(); + editorSessionPresenter = Optional.empty(); + }); + viewerSessionPresenter.ifPresent(session -> { + session.destroy(); + viewerSessionPresenter = Optional.empty(); + }); + editorSessionPresenterInstances.destroyAll(); + viewerSessionPresenterInstances.destroyAll(); + } + + private ClientSession getSession() { + return null != getSessionPresenter() ? getSessionPresenter().getInstance() : null; + } + + @Override + public int getCurrentDiagramHash() { + return editorProxy.getEditorHashCode(); + } + + @Override + public CanvasHandler getCanvasHandler() { + return null != getSession() ? getSession().getCanvasHandler() : null; + } + + @SuppressWarnings("unchecked") + public D getDiagram() { + return null != getCanvasHandler() ? (D) getCanvasHandler().getDiagram() : null; + } + + @Override + public void onSaveError(final ClientRuntimeError error) { + showError(error); + } + + public void showError(final ClientRuntimeError error) { + diagramClientErrorHandler.handleError(error, this::showError); + log(Level.SEVERE, error.toString()); + } + + public void showError(final String message) { + errorPopupPresenter.showMessage(message); + baseEditorView.hideBusyIndicator(); + } + + protected void log(final Level level, + final String message) { + if (LogConfiguration.loggingIsEnabled()) { + LOGGER.log(level, + message); + } + } + + @Override + public SessionPresenter getSessionPresenter() { + if (editorSessionPresenter.isPresent()) { + return editorSessionPresenter.get(); + } else if (viewerSessionPresenter.isPresent()) { + return viewerSessionPresenter.get(); + } + return null; + } + + @Override + public void doFocus() { + if (null != getSessionPresenter()) { + getSessionPresenter().focus(); + } + } + + @Override + public void doLostFocus() { + if (null != getSessionPresenter()) { + getSessionPresenter().lostFocus(); + } + } + + //For Unit Testing + public void setEditorSessionPresenter(final SessionEditorPresenter presenter) { + this.editorSessionPresenter = Optional.ofNullable(presenter); + } + + //For Unit Testing + public void setReadOnlySessionPresenter(final SessionViewerPresenter presenter) { + this.viewerSessionPresenter = Optional.ofNullable(presenter); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditorMenuItemsBuilder.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditorMenuItemsBuilder.java new file mode 100644 index 00000000000..88da243d7ad --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditorMenuItemsBuilder.java @@ -0,0 +1,279 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.editor; + +import java.util.Optional; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.user.client.ui.IsWidget; +import org.gwtbootstrap3.client.ui.AnchorListItem; +import org.gwtbootstrap3.client.ui.Button; +import org.gwtbootstrap3.client.ui.ButtonGroup; +import org.gwtbootstrap3.client.ui.DropDownMenu; +import org.gwtbootstrap3.client.ui.constants.ButtonSize; +import org.gwtbootstrap3.client.ui.constants.IconPosition; +import org.gwtbootstrap3.client.ui.constants.IconType; +import org.gwtbootstrap3.client.ui.constants.Pull; +import org.gwtbootstrap3.client.ui.constants.Toggle; +import org.kie.workbench.common.stunner.client.widgets.menu.MenuUtils; +import org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.core.i18n.CoreTranslationMessages; +import org.kie.workbench.common.stunner.kogito.client.resources.i18n.KogitoClientConstants; +import org.uberfire.mvp.Command; +import org.uberfire.workbench.model.menu.MenuItem; + +public abstract class AbstractDiagramEditorMenuItemsBuilder { + + protected final ClientTranslationService translationService; + + protected final PopupUtil popupUtil; + + protected AbstractDiagramEditorMenuItemsBuilder() { + this(null, + null); + } + + public AbstractDiagramEditorMenuItemsBuilder(final ClientTranslationService translationService, + final PopupUtil popupUtil) { + this.translationService = translationService; + this.popupUtil = popupUtil; + } + + public MenuItem newVisitGraphItem(final Command command) { + return buildItem(buildVisitGraphItem(command)); + } + + private IsWidget buildVisitGraphItem(final Command command) { + return MenuUtils.buildHasEnabledWidget( + new Button() {{ + setSize(ButtonSize.SMALL); + setIcon(IconType.PLAY); + setTitle(translationService.getValue(CoreTranslationMessages.VISIT_GRAPH)); + addClickHandler(clickEvent -> command.execute()); + }}); + } + + public MenuItem newSwitchGridItem(final Command command) { + return buildItem(buildSwitchGridItem(command)); + } + + private IsWidget buildSwitchGridItem(final Command command) { + return MenuUtils.buildHasEnabledWidget( + new Button() {{ + setSize(ButtonSize.SMALL); + setIcon(IconType.TH); + setTitle(translationService.getValue(CoreTranslationMessages.SWITCH_GRID)); + addClickHandler(clickEvent -> command.execute()); + }}); + } + + /** + * Builds a menu item with a clear icon and executes the given callback. + * Added alert message - the operation cannot be reverted. + * See org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand + */ + public MenuItem newClearItem(final Command command) { + return buildItem(buildClearItem(command)); + } + + private IsWidget buildClearItem(final Command command) { + return MenuUtils.buildHasEnabledWidget( + new Button() {{ + setSize(ButtonSize.SMALL); + setIcon(IconType.ERASER); + setTitle(translationService.getValue(CoreTranslationMessages.CLEAR_DIAGRAM)); + addClickHandler(clickEvent -> + AbstractDiagramEditorMenuItemsBuilder.this.executeWithConfirm(command, + translationService.getValue(CoreTranslationMessages.CLEAR_DIAGRAM), + translationService.getValue(CoreTranslationMessages.CLEAR_DIAGRAM), + translationService.getValue(CoreTranslationMessages.CONFIRM_CLEAR_DIAGRAM))); + }}); + } + + public MenuItem newCopyItem(final Command command) { + return buildItem(buildCopyItem(command)); + } + + private IsWidget buildCopyItem(final Command command) { + return MenuUtils.buildHasEnabledWidget( + new Button() {{ + setSize(ButtonSize.SMALL); + setIcon(IconType.COPY); + setTitle(translationService.getValue(CoreTranslationMessages.COPY_SELECTION)); + addClickHandler(clickEvent -> command.execute()); + }}); + } + + public MenuItem newPasteItem(final Command command) { + return buildItem(buildPasteItem(command)); + } + + private IsWidget buildPasteItem(final Command command) { + return MenuUtils.buildHasEnabledWidget( + new Button() {{ + setSize(ButtonSize.SMALL); + setIcon(IconType.PASTE); + setTitle(translationService.getValue(CoreTranslationMessages.PASTE_SELECTION)); + addClickHandler(clickEvent -> command.execute()); + }}); + } + + public MenuItem newCutItem(final Command command) { + return buildItem(buildCutItem(command)); + } + + private IsWidget buildCutItem(final Command command) { + return MenuUtils.buildHasEnabledWidget( + new Button() {{ + setSize(ButtonSize.SMALL); + setIcon(IconType.CUT); + setTitle(translationService.getValue(CoreTranslationMessages.CUT_SELECTION)); + addClickHandler(clickEvent -> command.execute()); + }}); + } + + public MenuItem newDeleteSelectionItem(final Command command) { + return buildItem(buildDeleteSelectionItem(command)); + } + + private IsWidget buildDeleteSelectionItem(final Command command) { + return MenuUtils.buildHasEnabledWidget( + new Button() {{ + setSize(ButtonSize.SMALL); + setIcon(IconType.TRASH_O); + setTitle(translationService.getValue(CoreTranslationMessages.DELETE_SELECTION)); + addClickHandler(clickEvent -> command.execute()); + }}); + } + + public MenuItem newUndoItem(final Command command) { + return buildItem(buildUndoItem(command)); + } + + private IsWidget buildUndoItem(final Command command) { + return MenuUtils.buildHasEnabledWidget( + new Button() {{ + setSize(ButtonSize.SMALL); + setIcon(IconType.UNDO); + setTitle(translationService.getValue(CoreTranslationMessages.UNDO)); + addClickHandler(clickEvent -> command.execute()); + }}); + } + + public MenuItem newRedoItem(final Command command) { + return buildItem(buildRedoItem(command)); + } + + private IsWidget buildRedoItem(final Command command) { + return MenuUtils.buildHasEnabledWidget( + new Button() {{ + setSize(ButtonSize.SMALL); + setIcon(IconType.UNDO); + //Let's add the icon "manually" since the required icon is not available as IconType value. But the icon + //class is available. This assignment is ok for now, since this stuff will sooner or later be refactored to + //elemental2. + addStyleName("fa-flip-horizontal"); + setTitle(translationService.getValue(CoreTranslationMessages.REDO)); + addClickHandler(clickEvent -> command.execute()); + }}); + } + + public MenuItem newExportsItem(final Command exportPNGCommand, + final Command exportJPGCommand, + final Command exportSVGCommand, + final Command exportPDFCommand, + final Command exportAsRawCommand) { + final DropDownMenu menu = GWT.create(DropDownMenu.class); + menu.setPull(Pull.RIGHT); + + menu.add(makeExportMenuItemWidget(translationService.getValue(CoreTranslationMessages.EXPORT_PNG), + exportPNGCommand)); + menu.add(makeExportMenuItemWidget(translationService.getValue(CoreTranslationMessages.EXPORT_JPG), + exportJPGCommand)); + menu.add(makeExportMenuItemWidget(translationService.getValue(CoreTranslationMessages.EXPORT_SVG), + exportSVGCommand)); + menu.add(makeExportMenuItemWidget(translationService.getValue(CoreTranslationMessages.EXPORT_PDF), + exportPDFCommand)); + getExportLabelToRawFormatIfSupported().ifPresent(label -> menu.add(makeExportMenuItemWidget(label, + exportAsRawCommand))); + + final Button button = GWT.create(Button.class); + final ButtonGroup buttonGroup = GWT.create(ButtonGroup.class); + buttonGroup.add(button); + buttonGroup.add(menu); + button.setToggleCaret(true); + button.setDataToggle(Toggle.DROPDOWN); + button.setIcon(IconType.DOWNLOAD); + button.setSize(ButtonSize.SMALL); + button.setTitle(translationService.getValue(KogitoClientConstants.DOWNLOAD_DIAGRAM)); + + final IsWidget group = MenuUtils.buildHasEnabledWidget(buttonGroup, + button); + return buildItem(group); + } + + private AnchorListItem makeExportMenuItemWidget(final String caption, + final Command onClickCommand) { + final AnchorListItem exportMenuItemWidget = GWT.create(AnchorListItem.class); + exportMenuItemWidget.setIcon(IconType.FILE_IMAGE_O); + exportMenuItemWidget.setIconPosition(IconPosition.LEFT); + exportMenuItemWidget.setText(caption); + exportMenuItemWidget.setTitle(caption); + exportMenuItemWidget.addClickHandler(event -> onClickCommand.execute()); + return exportMenuItemWidget; + } + + protected Optional getExportLabelToRawFormatIfSupported() { + return Optional.empty(); + } + + public MenuItem newValidateItem(final Command command) { + return buildItem(buildValidateItem(command)); + } + + private IsWidget buildValidateItem(final Command command) { + return MenuUtils.buildHasEnabledWidget( + new Button() {{ + setSize(ButtonSize.SMALL); + setIcon(IconType.CHECK); + setTitle(translationService.getValue(CoreTranslationMessages.VALIDATE)); + addClickHandler(clickEvent -> command.execute()); + }}); + } + + private void executeWithConfirm(final Command command, + final String title, + final String okButtonText, + final String confirmMessage) { + popupUtil.showConfirmPopup(title, + okButtonText, + confirmMessage, + command); + } + + public static MenuItem buildItem(final IsWidget widget) { + return MenuUtils.buildItem(widget); + } + + public ClientTranslationService getTranslationService() { + return translationService; + } + + public PopupUtil getPopupUtil() { + return popupUtil; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditorMenuSessionItems.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditorMenuSessionItems.java new file mode 100644 index 00000000000..2c228cf99ae --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditorMenuSessionItems.java @@ -0,0 +1,287 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.editor; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.function.Consumer; + +import javax.annotation.PreDestroy; + +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.core.client.session.ClientSession; +import org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToJpgSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPdfSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPngSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToRawFormatSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToSvgSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.RedoSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.SwitchGridSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.UndoSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ValidateSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.VisitGraphSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.rule.RuleViolation; +import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; +import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; +import org.uberfire.mvp.Command; +import org.uberfire.workbench.model.menu.MenuItem; + +public abstract class AbstractDiagramEditorMenuSessionItems { + + private final BUILDER itemsBuilder; + private final Map, MenuItem> menuItems; + private final EditorSessionCommands sessionCommands; + + private Command loadingStarts; + private Command loadingCompleted; + private Consumer errorConsumer; + + public AbstractDiagramEditorMenuSessionItems(final BUILDER itemsBuilder, + final EditorSessionCommands sessionCommands) { + this.itemsBuilder = itemsBuilder; + this.sessionCommands = sessionCommands; + this.menuItems = new HashMap<>(20); + this.loadingStarts = () -> { + }; + this.loadingCompleted = () -> { + }; + this.errorConsumer = e -> { + }; + } + + public AbstractDiagramEditorMenuSessionItems setLoadingStarts(final Command loadingStarts) { + this.loadingStarts = loadingStarts; + return this; + } + + public AbstractDiagramEditorMenuSessionItems setLoadingCompleted(final Command loadingCompleted) { + this.loadingCompleted = loadingCompleted; + return this; + } + + public AbstractDiagramEditorMenuSessionItems setErrorConsumer(final Consumer errorConsumer) { + this.errorConsumer = errorConsumer; + return this; + } + + public void populateMenu(final FileMenuBuilder menu) { + // Create the menu items. + final MenuItem clearItem = itemsBuilder.newClearItem(this::menu_clear); + menuItems.put(ClearSessionCommand.class, clearItem); + final MenuItem visitGraphItem = itemsBuilder.newVisitGraphItem(this::menu_visitGraph); + menuItems.put(VisitGraphSessionCommand.class, visitGraphItem); + final MenuItem switchGridItem = itemsBuilder.newSwitchGridItem(this::menu_switchGrid); + menuItems.put(SwitchGridSessionCommand.class, switchGridItem); + final MenuItem deleteSelectionItem = itemsBuilder.newDeleteSelectionItem(this::menu_deleteSelected); + menuItems.put(DeleteSelectionSessionCommand.class, deleteSelectionItem); + final MenuItem undoItem = itemsBuilder.newUndoItem(this::menu_undo); + menuItems.put(UndoSessionCommand.class, undoItem); + final MenuItem redoItem = itemsBuilder.newRedoItem(this::menu_redo); + menuItems.put(RedoSessionCommand.class, redoItem); + final MenuItem validateItem = itemsBuilder.newValidateItem(this::validate); + menuItems.put(ValidateSessionCommand.class, validateItem); + final MenuItem exportsItem = itemsBuilder.newExportsItem(this::export_imagePNG, + this::export_imageJPG, + this::export_imageSVG, + this::export_imagePDF, + this::export_fileRaw); + menuItems.put(ExportToPngSessionCommand.class, exportsItem); + menuItems.put(ExportToJpgSessionCommand.class, exportsItem); + menuItems.put(ExportToSvgSessionCommand.class, exportsItem); + menuItems.put(ExportToPdfSessionCommand.class, exportsItem); + menuItems.put(ExportToRawFormatSessionCommand.class, exportsItem); + final MenuItem pasteItem = itemsBuilder.newPasteItem(this::paste); + menuItems.put(PasteSelectionSessionCommand.class, pasteItem); + final MenuItem copyItem = itemsBuilder.newCopyItem(this::menu_copy); + menuItems.put(CopySelectionSessionCommand.class, copyItem); + final MenuItem cutItem = itemsBuilder.newCutItem(this::menu_cut); + menuItems.put(CutSelectionSessionCommand.class, cutItem); + + // Populate the given editor's menu builder. + menu + .addNewTopLevelMenu(clearItem) + .addNewTopLevelMenu(visitGraphItem) + .addNewTopLevelMenu(switchGridItem) + .addNewTopLevelMenu(deleteSelectionItem) + .addNewTopLevelMenu(undoItem) + .addNewTopLevelMenu(redoItem) + .addNewTopLevelMenu(validateItem) + .addNewTopLevelMenu(exportsItem) + .addNewTopLevelMenu(copyItem) + .addNewTopLevelMenu(cutItem) + .addNewTopLevelMenu(pasteItem); + } + + public void bind(final ClientSession session) { + // Bind commands to the session and set the right listeners. + sessionCommands + .bind(session) + .getCommands() + .visit((type, command) -> { + command.listen(() -> Optional.ofNullable(menuItems.get(type)).ifPresent(item -> item.setEnabled(command.isEnabled()))); + }); + // Default disabled items. + setEnabled(session instanceof EditorSession); + } + + public void setEnabled(final boolean enabled) { + setItemEnabled(ClearSessionCommand.class, enabled); + setItemEnabled(VisitGraphSessionCommand.class, enabled); + setItemEnabled(SwitchGridSessionCommand.class, enabled); + setItemEnabled(ValidateSessionCommand.class, enabled); + setItemEnabled(ExportToJpgSessionCommand.class, enabled); + setItemEnabled(ExportToPngSessionCommand.class, enabled); + setItemEnabled(ExportToSvgSessionCommand.class, enabled); + setItemEnabled(ExportToPdfSessionCommand.class, enabled); + setItemEnabled(ExportToRawFormatSessionCommand.class, enabled); + setItemEnabled(DeleteSelectionSessionCommand.class, false); + setItemEnabled(UndoSessionCommand.class, false); + setItemEnabled(RedoSessionCommand.class, false); + setItemEnabled(CopySelectionSessionCommand.class, false); + setItemEnabled(CutSelectionSessionCommand.class, false); + setItemEnabled(PasteSelectionSessionCommand.class, false); + } + + public EditorSessionCommands getCommands() { + return sessionCommands; + } + + public ClientTranslationService getTranslationService() { + return itemsBuilder.getTranslationService(); + } + + @PreDestroy + public void destroy() { + sessionCommands + .getCommands() + .visit((type, command) -> { + command.listen(null); + }); + menuItems.clear(); + loadingStarts = null; + loadingCompleted = null; + errorConsumer = null; + } + + protected void addMenuItem(final Class clazz, final MenuItem menuItem) { + this.menuItems.put(clazz, menuItem); + } + + private void validate() { + loadingStarts(); + sessionCommands.getValidateSessionCommand().execute(new ClientSessionCommand.Callback>>() { + @Override + public void onSuccess() { + loadingCompleted(); + } + + @Override + public void onError(final Collection> violations) { + AbstractDiagramEditorMenuSessionItems.this.onError(violations.toString()); + } + }); + } + + public void setItemEnabled(final Class type, + final boolean enabled) { + if (menuItems.containsKey(type)) { + menuItems.get(type).setEnabled(enabled); + } + } + + public boolean isItemEnabled(final Class type) { + return menuItems.containsKey(type) && menuItems.get(type).isEnabled(); + } + + private void menu_clear() { + sessionCommands.getClearSessionCommand().execute(); + } + + private void menu_visitGraph() { + sessionCommands.getVisitGraphSessionCommand().execute(); + } + + private void menu_switchGrid() { + sessionCommands.getSwitchGridSessionCommand().execute(); + } + + private void menu_deleteSelected() { + sessionCommands.getDeleteSelectionSessionCommand().execute(); + } + + private void menu_undo() { + sessionCommands.getUndoSessionCommand().execute(); + } + + private void menu_redo() { + sessionCommands.getRedoSessionCommand().execute(); + } + + private void export_imagePNG() { + sessionCommands.getExportToPngSessionCommand().execute(); + } + + private void export_imageJPG() { + sessionCommands.getExportToJpgSessionCommand().execute(); + } + + private void export_imagePDF() { + sessionCommands.getExportToPdfSessionCommand().execute(); + } + + private void paste() { + sessionCommands.getPasteSelectionSessionCommand().execute(); + } + + private void export_imageSVG() { + sessionCommands.getExportToSvgSessionCommand().execute(); + } + + private void export_fileRaw() { + sessionCommands.getExportToRawFormatSessionCommand().execute(); + } + + private void menu_copy() { + sessionCommands.getCopySelectionSessionCommand().execute(); + } + + private void menu_cut() { + sessionCommands.getCutSelectionSessionCommand().execute(); + } + + protected void loadingStarts() { + loadingStarts.execute(); + } + + protected void loadingCompleted() { + loadingCompleted.execute(); + } + + protected void onError(final String error) { + errorConsumer.accept(error); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorCore.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorCore.java new file mode 100644 index 00000000000..fd9df6edf80 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorCore.java @@ -0,0 +1,71 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.editor; + +import java.lang.annotation.Annotation; + +import com.google.gwt.user.client.ui.IsWidget; +import com.google.gwt.user.client.ui.ProvidesResize; +import com.google.gwt.user.client.ui.RequiresResize; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; +import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.session.ClientSession; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.uberfire.client.mvp.UberView; +import org.uberfire.ext.editor.commons.client.BaseEditorView; + +public interface DiagramEditorCore { + + interface View extends UberView, + BaseEditorView, + RequiresResize, + ProvidesResize, + IsWidget { + + void setWidget(final IsWidget widget); + } + + void open(final D diagram); + + Annotation[] getDockQualifiers(); + + void initialiseKieEditorForSession(final D diagram); + + SessionEditorPresenter newSessionEditorPresenter(); + + SessionViewerPresenter newSessionViewerPresenter(); + + String getEditorIdentifier(); + + int getCurrentDiagramHash(); + + CanvasHandler getCanvasHandler(); + + void onSaveError(final ClientRuntimeError error); + + SessionPresenter getSessionPresenter(); + + void doFocus(); + + void doLostFocus(); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorProxy.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorProxy.java new file mode 100644 index 00000000000..6855d0440f7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorProxy.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.editor; + +import java.util.Optional; +import java.util.function.Supplier; + +import org.kie.workbench.common.stunner.kogito.api.editor.KogitoDiagramResource; + +public class DiagramEditorProxy { + + private Optional> hashCodeSupplier; + private Supplier contentSupplier = () -> null; + + public DiagramEditorProxy() { + hashCodeSupplier = Optional.empty(); + } + + public void setHashCodeSupplier(final Supplier hashCodeSupplier) { + this.hashCodeSupplier = Optional.ofNullable(hashCodeSupplier); + } + + public int getEditorHashCode() { + return hashCodeSupplier.orElse(() -> 0).get(); + } + + public Supplier getContentSupplier() { + return contentSupplier; + } + + public void setContentSupplier(final Supplier contentSupplier) { + this.contentSupplier = contentSupplier; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorView.html b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorView.html new file mode 100644 index 00000000000..e8ad8ad67c3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorView.html @@ -0,0 +1,17 @@ + + +
\ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorView.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorView.java new file mode 100644 index 00000000000..4edf50799ed --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorView.java @@ -0,0 +1,80 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.editor; + +import javax.annotation.PreDestroy; +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import com.google.gwt.dom.client.Style; +import com.google.gwt.user.client.ui.IsWidget; +import org.jboss.errai.ui.shared.api.annotations.DataField; +import org.jboss.errai.ui.shared.api.annotations.Templated; +import org.uberfire.client.workbench.widgets.listbar.ResizeFlowPanel; +import org.uberfire.ext.editor.commons.client.BaseEditorViewImpl; + +@Dependent +@Templated +public class DiagramEditorView + extends BaseEditorViewImpl + implements AbstractDiagramEditor.View { + + @DataField + private ResizeFlowPanel editorPanel; + + private DiagramEditorCore presenter; + + protected DiagramEditorView() { + //CDI proxy + } + + @Inject + public DiagramEditorView(final ResizeFlowPanel editorPanel) { + this.editorPanel = editorPanel; + } + + @Override + public void init(final DiagramEditorCore presenter) { + this.presenter = presenter; + } + + @Override + protected void onAttach() { + super.onAttach(); + if (getElement().getParentElement() != null) { + getElement().getParentElement().getStyle().setHeight(100, Style.Unit.PCT); + getElement().getParentElement().getStyle().setWidth(100, Style.Unit.PCT); + getElement().getParentElement().getStyle().setDisplay(Style.Display.TABLE); + } + } + + @Override + public void onResize() { + editorPanel.onResize(); + } + + @Override + public void setWidget(final IsWidget widget) { + editorPanel.clear(); + editorPanel.add(widget); + } + + @PreDestroy + public void destroy() { + editorPanel.clear(); + editorPanel.removeFromParent(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/event/OnDiagramFocusEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/event/OnDiagramFocusEvent.java similarity index 88% rename from kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/event/OnDiagramFocusEvent.java rename to kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/event/OnDiagramFocusEvent.java index 82e548207f0..469fbe6d1a3 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/event/OnDiagramFocusEvent.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/event/OnDiagramFocusEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,8 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -package org.kie.workbench.common.stunner.project.client.editor.event; +package org.kie.workbench.common.stunner.kogito.client.editor.event; import java.lang.annotation.Annotation; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/event/OnDiagramLoseFocusEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/event/OnDiagramLoseFocusEvent.java similarity index 82% rename from kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/event/OnDiagramLoseFocusEvent.java rename to kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/event/OnDiagramLoseFocusEvent.java index 5df2f954329..a7b74c89dd0 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/event/OnDiagramLoseFocusEvent.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/event/OnDiagramLoseFocusEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,8 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -package org.kie.workbench.common.stunner.project.client.editor.event; +package org.kie.workbench.common.stunner.kogito.client.editor.event; public class OnDiagramLoseFocusEvent { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/resources/i18n/KogitoClientConstants.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/resources/i18n/KogitoClientConstants.java new file mode 100644 index 00000000000..5f641039d56 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/resources/i18n/KogitoClientConstants.java @@ -0,0 +1,33 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.resources.i18n; + +public class KogitoClientConstants { + + public static final String DOWNLOAD_DIAGRAM = "org.kie.workbench.common.stunner.kogito.client.editor.DownloadDiagram"; + + public static final String CONFIRM_ACTION = "org.kie.workbench.common.stunner.kogito.client.editor.ConfirmAction"; + + public static final String ON_ERROR_CONFIRM_UNDO_LAST_ACTION = "org.kie.workbench.common.stunner.kogito.client.editor.OnErrorConfirmUndoLastAction"; + + public static final String DIAGRAM_SAVE_SUCCESSFUL = "org.kie.workbench.common.stunner.kogito.client.editor.DiagramSaveSuccessful"; + + public static final String DIAGRAM_EDITOR_DEFAULT_TITLE = "org.kie.workbench.common.stunner.kogito.client.editor.DiagramEditorDefaultTitle"; + + public static final String DIAGRAM_PARSING_ERROR = "org.kie.workbench.common.stunner.kogito.client.editor.DiagramParsingError"; + + public static final String DOCUMENTATION = "org.kie.workbench.common.stunner.kogito.client.editor.Documentation"; +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/resources/i18n/KogitoClientMessages.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/resources/i18n/KogitoClientMessages.java new file mode 100644 index 00000000000..8cfe3c54a07 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/resources/i18n/KogitoClientMessages.java @@ -0,0 +1,30 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.resources.i18n; + +import org.jboss.errai.ui.shared.api.annotations.TranslationKey; + +public class KogitoClientMessages { + + @TranslationKey(defaultValue = "File '{0}' already exists.") + public static final String FILE_ALREADY_EXISTS0 = "KogitoClientDiagramService.fileAlreadyExists0"; + + @TranslationKey(defaultValue = "Properties") + public static final String PROPERTIES_DOCK_TITLE = "DiagramEditorPropertiesDock.title"; + + @TranslationKey(defaultValue = "Explorer") + public static final String EXPLORER_DOCK_TITLE = "DiagramEditorPreviewAndExplorerDock.title"; +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreen.java new file mode 100644 index 00000000000..b9a485c169f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreen.java @@ -0,0 +1,268 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.screens; + +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.enterprise.context.Dependent; +import javax.enterprise.event.Event; +import javax.enterprise.event.Observes; +import javax.enterprise.inject.Any; +import javax.enterprise.inject.Default; +import javax.inject.Inject; + +import com.google.gwt.user.client.ui.IsWidget; +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.kie.workbench.common.stunner.client.widgets.canvas.StunnerBoundsProviderFactory; +import org.kie.workbench.common.stunner.client.widgets.explorer.tree.TreeExplorer; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionDiagramPreview; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionViewer; +import org.kie.workbench.common.stunner.core.client.api.SessionManager; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.session.ClientSession; +import org.kie.workbench.common.stunner.core.client.session.event.SessionDestroyedEvent; +import org.kie.workbench.common.stunner.core.client.session.event.SessionDiagramOpenedEvent; +import org.kie.workbench.common.stunner.core.client.session.event.SessionOpenedEvent; +import org.kie.workbench.common.stunner.core.client.session.impl.AbstractSession; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.uberfire.client.annotations.WorkbenchContextId; +import org.uberfire.client.annotations.WorkbenchPartTitle; +import org.uberfire.client.annotations.WorkbenchPartView; +import org.uberfire.client.annotations.WorkbenchScreen; +import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; +import org.uberfire.lifecycle.OnClose; +import org.uberfire.lifecycle.OnOpen; +import org.uberfire.lifecycle.OnStartup; +import org.uberfire.mvp.PlaceRequest; + +import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; + +/** + * The screen for the project context (includes the kie workbenches) which is included in a docked area + * and displays a preview and and a diagram element's explorer (using a tree visual hierarchy) for the one being edited. + * TODO: I18n. + */ +@Dependent +@WorkbenchScreen(identifier = DiagramEditorExplorerScreen.SCREEN_ID) +public class DiagramEditorExplorerScreen { + + private static Logger LOGGER = Logger.getLogger(DiagramEditorExplorerScreen.class.getName()); + + public static final String SCREEN_ID = "ProjectDiagramExplorerScreen"; + public static final String TITLE = "Explore"; + public static final int PREVIEW_WIDTH = 420; + public static final int PREVIEW_HEIGHT = StunnerBoundsProviderFactory.computeHeight(PREVIEW_WIDTH); + + private final SessionManager clientSessionManager; + private final ManagedInstance treeExplorers; + private final ManagedInstance> sessionPreviews; + private final Event changeTitleNotificationEvent; + private final ErrorPopupPresenter errorPopupPresenter; + private final View view; + + private PlaceRequest placeRequest; + private String title = TITLE; + private TreeExplorer explorerWidget; + private SessionDiagramPreview previewWidget; + + protected DiagramEditorExplorerScreen() { + this(null, + null, + null, + null, + null, + null); + } + + @Inject + public DiagramEditorExplorerScreen(final SessionManager clientSessionManager, + final @Any ManagedInstance treeExplorers, + final Event changeTitleNotificationEvent, + final @Any @Default ManagedInstance> sessionPreviews, + final ErrorPopupPresenter errorPopupPresenter, + final View view) { + this.clientSessionManager = clientSessionManager; + this.treeExplorers = treeExplorers; + this.changeTitleNotificationEvent = changeTitleNotificationEvent; + this.sessionPreviews = sessionPreviews; + this.errorPopupPresenter = errorPopupPresenter; + this.view = view; + } + + @OnStartup + public void onStartup(final PlaceRequest placeRequest) { + this.placeRequest = placeRequest; + } + + @OnOpen + public void onOpen() { + final ClientSession current = clientSessionManager.getCurrentSession(); + if (null != current) { + show(current); + } + } + + @OnClose + public void onClose() { + close(); + } + + @WorkbenchPartTitle + public String getTitle() { + return title; + } + + @WorkbenchPartView + public IsWidget getWidget() { + return view; + } + + @WorkbenchContextId + public String getMyContextRef() { + return "projectDiagramExplorerScreenContext"; + } + + public void show(final ClientSession session) { + // Do not show sessions not already initialized with some diagram instance. + if (null != session.getCanvasHandler().getDiagram()) { + showPreview(session); + showExplorer(session); + updateTitle(session); + } + } + + public void close() { + closeTreeExplorer(); + closePreview(); + } + + private void closeTreeExplorer() { + view.clearExplorerWidget(); + if (null != explorerWidget) { + treeExplorers.destroy(explorerWidget); + explorerWidget = null; + } + } + + private void closePreview() { + view.clearPreviewWidget(); + if (null != previewWidget) { + previewWidget.destroy(); + sessionPreviews.destroy(previewWidget); + previewWidget = null; + } + } + + @SuppressWarnings("unchecked") + void onCanvasSessionOpened(@Observes SessionOpenedEvent sessionOpenedEvent) { + checkNotNull("sessionOpenedEvent", + sessionOpenedEvent); + show(sessionOpenedEvent.getSession()); + } + + void onCanvasSessionDestroyed(@Observes SessionDestroyedEvent sessionDestroyedEvent) { + checkNotNull("sessionDestroyedEvent", + sessionDestroyedEvent); + close(); + } + + void onSessionDiagramOpenedEvent(@Observes SessionDiagramOpenedEvent sessionDiagramOpenedEvent) { + checkNotNull("sessionDiagramOpenedEvent", + sessionDiagramOpenedEvent); + show(sessionDiagramOpenedEvent.getSession()); + } + + private void showExplorer(final ClientSession session) { + if (null != explorerWidget) { + closeTreeExplorer(); + } + explorerWidget = treeExplorers.get(); + explorerWidget.show(session.getCanvasHandler()); + view.setExplorerWidget(explorerWidget); + } + + private void showPreview(final ClientSession session) { + if (null != session && session instanceof AbstractSession) { + if (null != previewWidget) { + closePreview(); + } + previewWidget = sessionPreviews.get(); + previewWidget.open((AbstractSession) session, + PREVIEW_WIDTH, + PREVIEW_HEIGHT, + new SessionViewer.SessionViewerCallback() { + @Override + public void afterCanvasInitialized() { + + } + + @Override + public void onSuccess() { + view.setPreviewWidget(previewWidget.getView()); + updateTitle(); + } + + @Override + public void onError(final ClientRuntimeError error) { + showError(error); + } + }); + } + } + + private void updateTitle() { + final ClientSession session = clientSessionManager.getCurrentSession(); + updateTitle(session); + } + + private void updateTitle(final ClientSession session) { + String title = TITLE; + if (null != session.getCanvasHandler() && null != session.getCanvasHandler().getDiagram()) { + final Diagram diagram = session.getCanvasHandler().getDiagram(); + title = diagram.getMetadata().getTitle(); + } + doUpdateTitle(title); + } + + private void doUpdateTitle(final String title) { + // Change screen title. + DiagramEditorExplorerScreen.this.title = title; + changeTitleNotificationEvent.fire(new ChangeTitleWidgetEvent(placeRequest, + this.title)); + } + + private void showError(final ClientRuntimeError error) { + final String s = error.toString(); + errorPopupPresenter.showMessage(s); + LOGGER.log(Level.SEVERE, + s); + } + + public interface View extends IsWidget { + + View setPreviewWidget(final IsWidget widget); + + View clearPreviewWidget(); + + View setExplorerWidget(final IsWidget widget); + + View clearExplorerWidget(); + + View clear(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreenView.css b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreenView.css new file mode 100644 index 00000000000..b2696b196f2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreenView.css @@ -0,0 +1,23 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +.preview-main { + width: 100%; +} + +.preview-panels { + padding: 5px; +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreenView.html b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreenView.html new file mode 100644 index 00000000000..e8e3ca10b3f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreenView.html @@ -0,0 +1,39 @@ + + + + + + + + +
+
+
+

Preview

+
+
+
+
+
+
+
+

Explorer

+
+
+
+
+
diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreenView.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreenView.java new file mode 100644 index 00000000000..186e4211654 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreenView.java @@ -0,0 +1,79 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.screens; + +import javax.annotation.PreDestroy; +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.IsWidget; +import org.gwtbootstrap3.client.ui.gwt.FlowPanel; +import org.jboss.errai.ui.shared.api.annotations.DataField; +import org.jboss.errai.ui.shared.api.annotations.Templated; + +@Dependent +@Templated +public class DiagramEditorExplorerScreenView extends Composite implements DiagramEditorExplorerScreen.View { + + @Inject + @DataField + private FlowPanel previewPanelBody; + + @Inject + @DataField + private FlowPanel explorerPanelBody; + + @Override + public DiagramEditorExplorerScreen.View setPreviewWidget(final IsWidget widget) { + clearPreviewWidget(); + previewPanelBody.add(widget); + return this; + } + + @Override + public DiagramEditorExplorerScreen.View clearPreviewWidget() { + previewPanelBody.clear(); + return this; + } + + @Override + public DiagramEditorExplorerScreen.View setExplorerWidget(final IsWidget widget) { + clearExplorerWidget(); + explorerPanelBody.add(widget); + return this; + } + + @Override + public DiagramEditorExplorerScreen.View clearExplorerWidget() { + explorerPanelBody.clear(); + return this; + } + + @Override + public DiagramEditorExplorerScreen.View clear() { + clearPreviewWidget(); + clearExplorerWidget(); + return this; + } + + @PreDestroy + public void destroy() { + clear(); + previewPanelBody.removeFromParent(); + explorerPanelBody.removeFromParent(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorPropertiesScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorPropertiesScreen.java new file mode 100644 index 00000000000..54dcc52c30b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorPropertiesScreen.java @@ -0,0 +1,183 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.screens; + +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.Dependent; +import javax.enterprise.event.Event; +import javax.enterprise.event.Observes; +import javax.inject.Inject; + +import com.google.gwt.logging.client.LogConfiguration; +import com.google.gwt.user.client.ui.IsWidget; +import org.jboss.errai.common.client.ui.ElementWrapperWidget; +import org.kie.workbench.common.stunner.core.client.api.SessionManager; +import org.kie.workbench.common.stunner.core.client.session.ClientSession; +import org.kie.workbench.common.stunner.core.client.session.event.SessionDiagramOpenedEvent; +import org.kie.workbench.common.stunner.forms.client.event.FormPropertiesOpened; +import org.kie.workbench.common.stunner.forms.client.widgets.FormPropertiesWidget; +import org.kie.workbench.common.stunner.kogito.client.view.DiagramEditorScreenView; +import org.uberfire.client.annotations.WorkbenchContextId; +import org.uberfire.client.annotations.WorkbenchPartTitle; +import org.uberfire.client.annotations.WorkbenchPartView; +import org.uberfire.client.annotations.WorkbenchScreen; +import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; +import org.uberfire.lifecycle.OnClose; +import org.uberfire.lifecycle.OnOpen; +import org.uberfire.lifecycle.OnStartup; +import org.uberfire.mvp.PlaceRequest; + +/** + * The screen for the project context (includes the kie workbenches) which is included in + * a docked area and displays the properties for the selected element on the canvas. + * TODO: I18n. + */ +@Dependent +@WorkbenchScreen(identifier = DiagramEditorPropertiesScreen.SCREEN_ID) +public class DiagramEditorPropertiesScreen { + + private static Logger LOGGER = Logger.getLogger(DiagramEditorPropertiesScreen.class.getName()); + public static final String SCREEN_ID = "DiagramEditorPropertiesScreen"; + + private final FormPropertiesWidget formPropertiesWidget; + private final SessionManager clientSessionManager; + private final Event changeTitleNotificationEvent; + private final DiagramEditorScreenView view; + + private PlaceRequest placeRequest; + private ClientSession session; + private String title = "Properties"; + private boolean open = false; + + protected DiagramEditorPropertiesScreen() { + this(null, + null, + null, + null); + } + + @Inject + public DiagramEditorPropertiesScreen(final FormPropertiesWidget formPropertiesWidget, + final SessionManager clientSessionManager, + final Event changeTitleNotification, + final DiagramEditorScreenView view) { + this.formPropertiesWidget = formPropertiesWidget; + this.clientSessionManager = clientSessionManager; + this.changeTitleNotificationEvent = changeTitleNotification; + this.view = view; + } + + @PostConstruct + public void init() { + view.setWidget(ElementWrapperWidget.getWidget(formPropertiesWidget.getElement())); + } + + @OnStartup + public void onStartup(final PlaceRequest placeRequest) { + this.placeRequest = placeRequest; + } + + @OnOpen + public void onOpen() { + log(Level.FINE, + "Opening DiagramEditorPropertiesScreen."); + open = true; + final ClientSession current = clientSessionManager.getCurrentSession(); + handleSession(current); + } + + @OnClose + public void onClose() { + log(Level.FINE, + "Closing DiagramEditorPropertiesScreen."); + open = false; + destroy(); + } + + @SuppressWarnings("unchecked") + private void handleSession(final ClientSession session) { + boolean done = false; + view.showLoading(); + if (null != session) { + this.session = session; + // Show the loading view. + view.showLoading(); + // Open the forms properties widget for the current session. + formPropertiesWidget + .bind(session) + .show(view::hideLoading); + done = true; + } + if (!done) { + formPropertiesWidget.unbind(); + view.hideLoading(); + this.session = null; + } + } + + private void destroy() { + formPropertiesWidget.destroy(); + session = null; + } + + @WorkbenchPartTitle + public String getTitle() { + return title; + } + + @WorkbenchPartView + public IsWidget getWidget() { + // TODO: return view.asWidget() - See DiagramEditorScreenViewImpl TODO; + return ElementWrapperWidget.getWidget(formPropertiesWidget.getElement()); + } + + @WorkbenchContextId + public String getMyContextRef() { + return "projectDiagramPropertiesScreenContext"; + } + + void onFormPropertiesOpened(final @Observes FormPropertiesOpened propertiesOpened) { + if (null != session && session.equals(propertiesOpened.getSession())) { + updateTitle(propertiesOpened.getName()); + } + } + + void onSessionOpened(final @Observes SessionDiagramOpenedEvent event) { + if (open && !event.getSession().equals(session)) { + log(Level.FINE, + "DiagramEditorPropertiesScreen -> Current Session Changed."); + handleSession(clientSessionManager.getCurrentSession()); + } + } + + private void updateTitle(final String title) { + // Change screen title. + DiagramEditorPropertiesScreen.this.title = title; + changeTitleNotificationEvent.fire(new ChangeTitleWidgetEvent(placeRequest, + this.title)); + } + + private void log(final Level level, + final String message) { + if (LogConfiguration.loggingIsEnabled()) { + LOGGER.log(level, + message); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/service/KogitoClientDiagramService.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/service/KogitoClientDiagramService.java new file mode 100644 index 00000000000..c97dae9ce85 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/service/KogitoClientDiagramService.java @@ -0,0 +1,29 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.service; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.kogito.api.editor.impl.KogitoDiagramResourceImpl; + +public interface KogitoClientDiagramService { + + void transform(final String xml, + final ServiceCallback callback); + + Promise transform(final KogitoDiagramResourceImpl resource); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/service/KogitoClientService.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/service/KogitoClientService.java new file mode 100644 index 00000000000..8da184c3c8f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/service/KogitoClientService.java @@ -0,0 +1,26 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.service; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.kogito.api.Kogito; + +@Kogito +public interface KogitoClientService { + + Promise call(T input); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/session/EditorSessionCommands.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/session/EditorSessionCommands.java similarity index 78% rename from kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/session/EditorSessionCommands.java rename to kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/session/EditorSessionCommands.java index 89bf6f7c80c..5334288ef0d 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/session/EditorSessionCommands.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/session/EditorSessionCommands.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.project.client.session; +package org.kie.workbench.common.stunner.kogito.client.session; import javax.annotation.PostConstruct; import javax.enterprise.context.Dependent; @@ -27,10 +27,10 @@ import org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToBpmnSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToJpgSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPdfSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPngSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToRawFormatSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToSvgSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.RedoSessionCommand; @@ -67,7 +67,7 @@ protected void registerCommands() { .register(ExportToJpgSessionCommand.class) .register(ExportToPdfSessionCommand.class) .register(ExportToSvgSessionCommand.class) - .register(ExportToBpmnSessionCommand.class) + .register(ExportToRawFormatSessionCommand.class) .register(CopySelectionSessionCommand.class) .register(PasteSelectionSessionCommand.class) .register(CutSelectionSessionCommand.class) @@ -84,70 +84,70 @@ public ManagedClientSessionCommands getCommands() { } public VisitGraphSessionCommand getVisitGraphSessionCommand() { - return commands.get(0); + return commands.get(VisitGraphSessionCommand.class); } public SwitchGridSessionCommand getSwitchGridSessionCommand() { - return commands.get(1); + return commands.get(SwitchGridSessionCommand.class); } public ClearSessionCommand getClearSessionCommand() { - return commands.get(2); + return commands.get(ClearSessionCommand.class); } public DeleteSelectionSessionCommand getDeleteSelectionSessionCommand() { - return commands.get(3); + return commands.get(DeleteSelectionSessionCommand.class); } public UndoSessionCommand getUndoSessionCommand() { - return commands.get(4); + return commands.get(UndoSessionCommand.class); } public RedoSessionCommand getRedoSessionCommand() { - return commands.get(5); + return commands.get(RedoSessionCommand.class); } public ValidateSessionCommand getValidateSessionCommand() { - return commands.get(6); + return commands.get(ValidateSessionCommand.class); } public ExportToPngSessionCommand getExportToPngSessionCommand() { - return commands.get(7); + return commands.get(ExportToPngSessionCommand.class); } public ExportToJpgSessionCommand getExportToJpgSessionCommand() { - return commands.get(8); + return commands.get(ExportToJpgSessionCommand.class); } public ExportToPdfSessionCommand getExportToPdfSessionCommand() { - return commands.get(9); + return commands.get(ExportToPdfSessionCommand.class); } public ExportToSvgSessionCommand getExportToSvgSessionCommand() { - return commands.get(10); + return commands.get(ExportToSvgSessionCommand.class); } - public ExportToBpmnSessionCommand getExportToBpmnSessionCommand() { - return commands.get(11); + public ExportToRawFormatSessionCommand getExportToRawFormatSessionCommand() { + return commands.get(ExportToRawFormatSessionCommand.class); } public CopySelectionSessionCommand getCopySelectionSessionCommand() { - return commands.get(12); + return commands.get(CopySelectionSessionCommand.class); } public PasteSelectionSessionCommand getPasteSelectionSessionCommand() { - return commands.get(13); + return commands.get(PasteSelectionSessionCommand.class); } public CutSelectionSessionCommand getCutSelectionSessionCommand() { - return commands.get(14); + return commands.get(CutSelectionSessionCommand.class); } public SaveDiagramSessionCommand getSaveDiagramSessionCommand() { - return commands.get(15); + return commands.get(SaveDiagramSessionCommand.class); } - public S get(final int index) { - return commands.get(index); + public S get(final Class type) { + return commands.get(type); } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/view/DiagramEditorScreenView.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/view/DiagramEditorScreenView.java new file mode 100644 index 00000000000..d7e36a25217 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/view/DiagramEditorScreenView.java @@ -0,0 +1,29 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.view; + +import com.google.gwt.user.client.ui.IsWidget; + +public interface DiagramEditorScreenView { + + DiagramEditorScreenView setWidget(final IsWidget widget); + + DiagramEditorScreenView showLoading(); + + DiagramEditorScreenView hideLoading(); + + IsWidget asWidget(); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/view/DiagramEditorScreenViewImpl.html b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/view/DiagramEditorScreenViewImpl.html new file mode 100644 index 00000000000..c75df76a8cb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/view/DiagramEditorScreenViewImpl.html @@ -0,0 +1,21 @@ + +
+
+

Loading

+
+
+
+ diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/view/DiagramEditorScreenViewImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/view/DiagramEditorScreenViewImpl.java new file mode 100644 index 00000000000..8867cd6a5b6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/java/org/kie/workbench/common/stunner/kogito/client/view/DiagramEditorScreenViewImpl.java @@ -0,0 +1,75 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.view; + +import javax.annotation.PreDestroy; +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import com.google.gwt.user.client.ui.FlowPanel; +import com.google.gwt.user.client.ui.IsWidget; +import org.jboss.errai.common.client.ui.ElementWrapperWidget; +import org.jboss.errai.ui.client.local.api.IsElement; +import org.jboss.errai.ui.shared.api.annotations.DataField; +import org.jboss.errai.ui.shared.api.annotations.Templated; + +@Dependent +@Templated +public class DiagramEditorScreenViewImpl implements DiagramEditorScreenView, + IsElement { + + private FlowPanel loadingPanel; + private FlowPanel widgetPanel; + + @Inject + public DiagramEditorScreenViewImpl(final @DataField FlowPanel loadingPanel, + final @DataField FlowPanel widgetPanel) { + this.loadingPanel = loadingPanel; + this.widgetPanel = widgetPanel; + } + + @Override + public DiagramEditorScreenView setWidget(final IsWidget widget) { + widgetPanel.clear(); + widgetPanel.add(widget); + return this; + } + + @Override + public DiagramEditorScreenView showLoading() { + widgetPanel.setVisible(false); + loadingPanel.setVisible(true); + return this; + } + + @Override + public DiagramEditorScreenView hideLoading() { + loadingPanel.setVisible(false); + widgetPanel.setVisible(true); + return this; + } + + @Override + public IsWidget asWidget() { + return ElementWrapperWidget.getWidget(this.getElement()); + } + + @PreDestroy + public void destroy() { + loadingPanel.removeFromParent(); + widgetPanel.removeFromParent(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/resources/META-INF/ErraiApp.properties b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/resources/META-INF/ErraiApp.properties new file mode 100644 index 00000000000..c4c6f23872c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/resources/META-INF/ErraiApp.properties @@ -0,0 +1,31 @@ +# +# Copyright 2019 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +# +# ErraiApp.properties +# +# Do not remove, even if empty! +# +# This is a marker file. When it is detected inside a JAR or at the +# top of any classpath, the subdirectories are scanned for deployable +# components. As such, all Errai application modules in a project +# should contain an ErraiApp.properties at the root of all classpaths +# that you wish to be scanned. +# +# There are also some configuration options that can be set in this +# file, although it is rarely necessary. See the documentation at +# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties +# for details. + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/resources/META-INF/beans.xml b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/resources/META-INF/beans.xml new file mode 100644 index 00000000000..1668a2e7d23 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/resources/META-INF/beans.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/resources/org/kie/workbench/common/stunner/kogito/StunnerKogitoClient.gwt.xml b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/resources/org/kie/workbench/common/stunner/kogito/StunnerKogitoClient.gwt.xml new file mode 100644 index 00000000000..a256386bf4a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/resources/org/kie/workbench/common/stunner/kogito/StunnerKogitoClient.gwt.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/resources/org/kie/workbench/common/stunner/kogito/client/resources/i18n/KogitoClientConstants.properties b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/resources/org/kie/workbench/common/stunner/kogito/client/resources/i18n/KogitoClientConstants.properties new file mode 100644 index 00000000000..a13f3b07ec4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/main/resources/org/kie/workbench/common/stunner/kogito/client/resources/i18n/KogitoClientConstants.properties @@ -0,0 +1,27 @@ +# +# Copyright 2019 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +org.kie.workbench.common.stunner.kogito.client.editor.DownloadDiagram=Download diagram +org.kie.workbench.common.stunner.kogito.client.editor.ConfirmAction=Confirm action +org.kie.workbench.common.stunner.kogito.client.editor.OnErrorConfirmUndoLastAction=An error happened [{0}]. Do you want to undo the last action? +org.kie.workbench.common.stunner.kogito.client.editor.DiagramSaveSuccessful=Diagram saved successfully +org.kie.workbench.common.stunner.kogito.client.editor.DiagramEditorDefaultTitle=Project Diagram Editor +org.kie.workbench.common.stunner.kogito.client.editor.DiagramParsingError=An error occurred parsing the diagram. There might be nodes not yet supported by the editor or the XML content can contain errors. You can try to repair it manually. {0} +org.kie.workbench.common.stunner.kogito.client.editor.Documentation=Documentation +org.kie.workbench.common.stunner.kogito.client.editor.Print=Print + +KogitoClientDiagramService.fileAlreadyExists0=File '{0}' already exists +DiagramEditorPropertiesDock.title=Properties +DiagramEditorPreviewAndExplorerDock.title=Explorer diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/PromiseMock.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/PromiseMock.java new file mode 100644 index 00000000000..cda683bf3cc --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/PromiseMock.java @@ -0,0 +1,76 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client; + +import java.util.function.Supplier; + +import elemental2.promise.IThenable; +import elemental2.promise.Promise; + +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + +public class PromiseMock { + + private final Promise promise; + + public static Promise success(final T instance) { + return new PromiseMock() + .then(() -> instance) + .asPromise(); + } + + public static Promise error(final Throwable t) { + return new PromiseMock() + .error(() -> t) + .asPromise(); + } + + @SuppressWarnings("unchecked") + public PromiseMock() { + this.promise = mock(Promise.class); + doReturn(promise).when(promise).then(any(IThenable.ThenOnFulfilledCallbackFn.class)); + doReturn(promise).when(promise).catch_(any(Promise.CatchOnRejectedCallbackFn.class)); + } + + @SuppressWarnings("unchecked") + public PromiseMock then(final Supplier instance) { + doAnswer(invokation -> { + ((IThenable.ThenOnFulfilledCallbackFn) invokation.getArguments()[0]).onInvoke(instance.get()); + return promise; + }) + .when(promise) + .then(any(IThenable.ThenOnFulfilledCallbackFn.class)); + return this; + } + + public PromiseMock error(final Supplier t) { + doAnswer(invokation -> { + ((Promise.CatchOnRejectedCallbackFn) invokation.getArguments()[0]).onInvoke(t.get()); + return promise; + }) + .when(promise) + .catch_(any(Promise.CatchOnRejectedCallbackFn.class)); + return this; + } + + public Promise asPromise() { + return promise; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/PromisesMock.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/PromisesMock.java new file mode 100644 index 00000000000..c32fb942423 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/PromisesMock.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client; + +import java.util.function.Function; + +import elemental2.promise.Promise; +import org.jboss.errai.common.client.api.Caller; +import org.uberfire.client.promise.Promises; + +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.spy; + +public class PromisesMock { + + public static Promises build() { + return promisify(spy(new Promises())); + } + + @SuppressWarnings("unchecked") + public static Promises promisify(final Promises promises) { + doAnswer(invocationOnMock -> { + final Caller caller = (Caller) invocationOnMock.getArguments()[0]; + final Function call = (Function) invocationOnMock.getArguments()[1]; + final Promise[] promise = new Promise[1]; + final Object service = caller.call(response -> promise[0] = PromiseMock.success(response)); + call.apply(service); + return promise[0]; + }) + .when(promises) + .promisify(any(Caller.class), + any(Function.class)); + return promises; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditorCoreMenuItemsBuilderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditorCoreMenuItemsBuilderTest.java new file mode 100644 index 00000000000..f8fe60d7a65 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/editor/AbstractDiagramEditorCoreMenuItemsBuilderTest.java @@ -0,0 +1,156 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.editor; + +import java.util.List; +import java.util.Optional; + +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwtmockito.GwtMockito; +import com.google.gwtmockito.GwtMockitoTestRunner; +import org.gwtbootstrap3.client.ui.AnchorListItem; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.core.i18n.CoreTranslationMessages; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.uberfire.mvp.Command; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(GwtMockitoTestRunner.class) +public class AbstractDiagramEditorCoreMenuItemsBuilderTest { + + private static final String EXPORT_RAW = "export"; + + @Mock + private Command exportPNGCommand; + + @Mock + private Command exportJPGCommand; + + @Mock + private Command exportSVGCommand; + + @Mock + private Command exportPDFCommand; + + @Mock + private Command exportAsRawCommand; + + @Mock + private ClientTranslationService translationService; + + @Mock + private PopupUtil popupUtil; + + @Mock + private AnchorListItem listItem; + + @Mock + private ClickEvent clickEvent; + + @Captor + private ArgumentCaptor listItemTextCaptor; + + @Captor + private ArgumentCaptor listItemTitleCaptor; + + @Captor + private ArgumentCaptor listItemClickHandlerCaptor; + + private AbstractDiagramEditorMenuItemsBuilder menuItemsBuilder; + + @Before + public void setup() { + GwtMockito.useProviderForType(AnchorListItem.class, aClass -> listItem); + + this.menuItemsBuilder = new AbstractDiagramEditorMenuItemsBuilder(translationService, popupUtil) { + @Override + protected Optional getExportLabelToRawFormatIfSupported() { + return Optional.of(EXPORT_RAW); + } + }; + + when(translationService.getValue(anyString())).thenAnswer(i -> i.getArguments()[0].toString()); + } + + @Test + public void testExportsItem() { + menuItemsBuilder.newExportsItem(exportPNGCommand, + exportJPGCommand, + exportSVGCommand, + exportPDFCommand, + exportAsRawCommand); + + verify(listItem, + times(5)).setText(listItemTextCaptor.capture()); + final List listItemText = listItemTextCaptor.getAllValues(); + assertEquals(5, + listItemText.size()); + assertEquals(CoreTranslationMessages.EXPORT_PNG, + listItemText.get(0)); + assertEquals(CoreTranslationMessages.EXPORT_JPG, + listItemText.get(1)); + assertEquals(CoreTranslationMessages.EXPORT_SVG, + listItemText.get(2)); + assertEquals(CoreTranslationMessages.EXPORT_PDF, + listItemText.get(3)); + assertEquals(EXPORT_RAW, + listItemText.get(4)); + + verify(listItem, + times(5)).setTitle(listItemTitleCaptor.capture()); + final List listItemTitle = listItemTitleCaptor.getAllValues(); + assertEquals(5, + listItemTitle.size()); + assertEquals(CoreTranslationMessages.EXPORT_PNG, + listItemTitle.get(0)); + assertEquals(CoreTranslationMessages.EXPORT_JPG, + listItemTitle.get(1)); + assertEquals(CoreTranslationMessages.EXPORT_SVG, + listItemTitle.get(2)); + assertEquals(CoreTranslationMessages.EXPORT_PDF, + listItemTitle.get(3)); + assertEquals(EXPORT_RAW, + listItemTitle.get(4)); + + verify(listItem, + times(5)).addClickHandler(listItemClickHandlerCaptor.capture()); + final List listItemClickHandler = listItemClickHandlerCaptor.getAllValues(); + assertEquals(5, + listItemClickHandler.size()); + listItemClickHandler.get(0).onClick(clickEvent); + verify(exportPNGCommand).execute(); + listItemClickHandler.get(1).onClick(clickEvent); + verify(exportJPGCommand).execute(); + listItemClickHandler.get(2).onClick(clickEvent); + verify(exportSVGCommand).execute(); + listItemClickHandler.get(3).onClick(clickEvent); + verify(exportPDFCommand).execute(); + listItemClickHandler.get(4).onClick(clickEvent); + verify(exportAsRawCommand).execute(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorMenuSessionItemsTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorMenuSessionItemsTest.java new file mode 100644 index 00000000000..c7baf23be35 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorMenuSessionItemsTest.java @@ -0,0 +1,152 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.editor; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; +import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.uberfire.mvp.Command; +import org.uberfire.workbench.model.menu.MenuItem; +import org.uberfire.workbench.model.menu.impl.BaseMenuCustom; + +import static com.ibm.icu.impl.Assert.fail; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class DiagramEditorMenuSessionItemsTest { + + @Mock + private AbstractDiagramEditorMenuItemsBuilder itemsBuilder; + + @Mock + private EditorSessionCommands sessionCommands; + + @Mock + private FileMenuBuilder fileMenuBuilder; + + private AbstractDiagramEditorMenuSessionItems editorMenuSessionItems; + + private static class TestAbstractProjectEditorMenuSessionItems extends AbstractDiagramEditorMenuSessionItems { + + public TestAbstractProjectEditorMenuSessionItems(final AbstractDiagramEditorMenuItemsBuilder itemsBuilder, + final EditorSessionCommands sessionCommands) { + super(itemsBuilder, + sessionCommands); + } + } + + @Before + public void setup() { + editorMenuSessionItems = new TestAbstractProjectEditorMenuSessionItems(itemsBuilder, + sessionCommands); + when(fileMenuBuilder.addNewTopLevelMenu(any(MenuItem.class))).thenReturn(fileMenuBuilder); + } + + @Test + public void testFileMenuBuilder() { + editorMenuSessionItems.populateMenu(fileMenuBuilder); + + verify(itemsBuilder).newClearItem(any(Command.class)); + verify(itemsBuilder).newVisitGraphItem(any(Command.class)); + verify(itemsBuilder).newSwitchGridItem(any(Command.class)); + verify(itemsBuilder).newDeleteSelectionItem(any(Command.class)); + verify(itemsBuilder).newUndoItem(any(Command.class)); + verify(itemsBuilder).newRedoItem(any(Command.class)); + verify(itemsBuilder).newValidateItem(any(Command.class)); + verify(itemsBuilder).newExportsItem(any(Command.class), + any(Command.class), + any(Command.class), + any(Command.class), + any(Command.class)); + verify(itemsBuilder).newPasteItem(any(Command.class)); + verify(itemsBuilder).newCopyItem(any(Command.class)); + verify(itemsBuilder).newCutItem(any(Command.class)); + } + + @Test + public void testEnableItemWithRegisteredMenuItem() { + final MenuItem clearMenuItem = mock(MenuItem.class); + when(itemsBuilder.newClearItem(any(Command.class))).thenReturn(clearMenuItem); + + editorMenuSessionItems.populateMenu(fileMenuBuilder); + + editorMenuSessionItems.setItemEnabled(ClearSessionCommand.class, true); + + verify(clearMenuItem).setEnabled(true); + + editorMenuSessionItems.setItemEnabled(ClearSessionCommand.class, false); + + verify(clearMenuItem).setEnabled(false); + } + + @Test + public void testEnableItemWithUnknownMenuItem() { + editorMenuSessionItems.populateMenu(fileMenuBuilder); + + try { + editorMenuSessionItems.setItemEnabled(ClientSessionCommand.class, true); + } catch (Exception e) { + fail(e); + } + } + + @Test + public void testIsEnabledWithRegisteredMenuItem() { + final MenuItem menuItem = new BaseMenuCustom() { + + @Override + public String build() { + return ""; + } + }; + when(itemsBuilder.newClearItem(any(Command.class))).thenReturn(menuItem); + + editorMenuSessionItems.populateMenu(fileMenuBuilder); + + editorMenuSessionItems.setItemEnabled(ClearSessionCommand.class, true); + + assertTrue(menuItem.isEnabled()); + + editorMenuSessionItems.setItemEnabled(ClearSessionCommand.class, false); + + assertFalse(menuItem.isEnabled()); + } + + @Test + public void testIsEnabledWithUnknownMenuItem() { + final MenuItem menuItem = mock(MenuItem.class); + when(itemsBuilder.newClearItem(any(Command.class))).thenReturn(menuItem); + + editorMenuSessionItems.populateMenu(fileMenuBuilder); + + try { + assertFalse(editorMenuSessionItems.isItemEnabled(ClearSessionCommand.class)); + } catch (Exception e) { + fail(e); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorViewTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorViewTest.java new file mode 100644 index 00000000000..32b4a48d1e0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/editor/DiagramEditorViewTest.java @@ -0,0 +1,100 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.editor; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.dom.client.Style; +import com.google.gwt.user.client.Element; +import com.google.gwt.user.client.ui.IsWidget; +import com.google.gwtmockito.GwtMockitoTestRunner; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.uberfire.client.workbench.widgets.listbar.ResizeFlowPanel; + +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.mockito.internal.verification.VerificationModeFactory.times; + +@RunWith(GwtMockitoTestRunner.class) +public class DiagramEditorViewTest { + + private Element element; + + private Element parentElement; + + private Style parentElementStyle; + + private ResizeFlowPanel editorPanel; + + private DiagramEditorView tested; + + @Before + public void setup() { + this.element = GWT.create(Element.class); + this.parentElement = GWT.create(Element.class); + this.parentElementStyle = GWT.create(Style.class); + this.editorPanel = GWT.create(ResizeFlowPanel.class); + this.tested = Mockito.spy(new DiagramEditorView(editorPanel)); + when(tested.getElement()).thenReturn(element); + when(element.getParentElement()).thenReturn(parentElement); + when(parentElement.getStyle()).thenReturn(parentElementStyle); + } + + @Test + public void testSetWidget() { + final IsWidget editor = mock(IsWidget.class); + tested.setWidget(editor); + + verify(editorPanel).clear(); + verify(editorPanel).add(eq(editor)); + } + + @Test + public void testOnResize() { + tested.onResize(); + verify(editorPanel).onResize(); + } + + @Test + public void testOnAttach() { + testOnAttach(true); + testOnAttach(false); + } + + public void testOnAttach(boolean parentExists) { + tested = spy(new DiagramEditorView(editorPanel)); + final Element element = mock(Element.class); + final Element parentElement = mock(Element.class); + final Style style = mock(Style.class); + + when(tested.getElement()).thenReturn(element); + when(parentElement.getStyle()).thenReturn(style); + when(element.getStyle()).thenReturn(style); + when(element.getParentElement()).thenReturn(parentExists ? parentElement : null); + + tested.onAttach(); + verify(tested).onAttach(); + verify(style, parentExists ? times(1) : never()).setHeight(100, Style.Unit.PCT); + verify(style, parentExists ? times(1) : never()).setWidth(100, Style.Unit.PCT); + verify(style, parentExists ? times(1) : never()).setDisplay(Style.Display.TABLE); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreenTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreenTest.java new file mode 100644 index 00000000000..4939f6092ab --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/screens/DiagramEditorExplorerScreenTest.java @@ -0,0 +1,151 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.screens; + +import com.google.gwt.user.client.ui.IsWidget; +import com.google.gwt.user.client.ui.Widget; +import com.google.gwtmockito.GwtMockitoTestRunner; +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.client.widgets.explorer.tree.TreeExplorer; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionDiagramPreview; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionViewer; +import org.kie.workbench.common.stunner.core.client.ManagedInstanceStub; +import org.kie.workbench.common.stunner.core.client.api.SessionManager; +import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; +import org.kie.workbench.common.stunner.core.client.session.impl.AbstractSession; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.mockito.Mock; +import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; +import org.uberfire.mocks.EventSourceMock; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.anyInt; +import static org.mockito.Mockito.anyString; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(GwtMockitoTestRunner.class) +public class DiagramEditorExplorerScreenTest { + + @Mock + private SessionManager clientSessionManager; + + @Mock + private TreeExplorer treeExplorer; + private ManagedInstance treeExplorers; + + @Mock + private SessionDiagramPreview sessionPreview; + private ManagedInstance> sessionPreviews; + + @Mock + private EventSourceMock changeTitleNotificationEvent; + + @Mock + private Widget treeExplorerWidget; + + @Mock + private IsWidget previewWidget; + + @Mock + private AbstractSession session; + + @Mock + private AbstractCanvasHandler canvasHandler; + + @Mock + private Diagram diagram; + + @Mock + private Metadata metadata; + + @Mock + private ErrorPopupPresenter errorPopupPresenter; + + @Mock + private DiagramEditorExplorerScreen.View view; + + private DiagramEditorExplorerScreen tested; + + @Before + @SuppressWarnings("unchecked") + public void setup() throws Exception { + when(clientSessionManager.getCurrentSession()).thenReturn(session); + when(sessionPreview.getView()).thenReturn(previewWidget); + when(sessionPreview.getInstance()).thenReturn(session); + when(treeExplorer.asWidget()).thenReturn(treeExplorerWidget); + when(session.getCanvasHandler()).thenReturn(canvasHandler); + when(canvasHandler.getDiagram()).thenReturn(diagram); + when(diagram.getMetadata()).thenReturn(metadata); + when(metadata.getTitle()).thenReturn("Diagram title"); + treeExplorers = new ManagedInstanceStub<>(treeExplorer); + sessionPreviews = new ManagedInstanceStub<>(sessionPreview); + this.tested = new DiagramEditorExplorerScreen(clientSessionManager, + treeExplorers, + changeTitleNotificationEvent, + sessionPreviews, + errorPopupPresenter, + view); + } + + @Test + public void testView() { + assertEquals(view, + tested.getWidget()); + } + + @Test + @SuppressWarnings("unchecked") + public void testShow() { + tested.show(session); + verify(sessionPreview, + times(1)).open(eq(session), + anyInt(), + anyInt(), + any(SessionViewer.SessionViewerCallback.class)); + verify(treeExplorer, + times(1)).show(eq(canvasHandler)); + verify(changeTitleNotificationEvent, + times(1)).fire(any(ChangeTitleWidgetEvent.class)); + verify(treeExplorer, + times(0)).clear(); + verify(sessionPreview, + times(0)).clear(); + verify(errorPopupPresenter, + times(0)).showMessage(anyString()); + verify(view, + times(0)).setPreviewWidget(any(IsWidget.class)); + verify(view, + times(1)).setExplorerWidget(any(IsWidget.class)); + } + + @Test + @SuppressWarnings("unchecked") + public void testClose() { + tested.show(session); + tested.close(); + verify(sessionPreview, + times(1)).destroy(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/session/EditorSessionCommandsTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/session/EditorSessionCommandsTest.java similarity index 82% rename from kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/session/EditorSessionCommandsTest.java rename to kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/session/EditorSessionCommandsTest.java index f01cb52dd1f..9c07f9596ec 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/session/EditorSessionCommandsTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/session/EditorSessionCommandsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.workbench.common.stunner.project.client.session; - -import java.util.stream.IntStream; +package org.kie.workbench.common.stunner.kogito.client.session; import org.junit.Before; import org.junit.Test; @@ -26,10 +24,10 @@ import org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToBpmnSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToJpgSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPdfSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPngSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToRawFormatSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToSvgSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.RedoSessionCommand; @@ -44,6 +42,7 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -88,7 +87,7 @@ public void testInit() { inOrder.verify(commands).register(ExportToJpgSessionCommand.class); inOrder.verify(commands).register(ExportToPdfSessionCommand.class); inOrder.verify(commands).register(ExportToSvgSessionCommand.class); - inOrder.verify(commands).register(ExportToBpmnSessionCommand.class); + inOrder.verify(commands).register(ExportToRawFormatSessionCommand.class); inOrder.verify(commands).register(CopySelectionSessionCommand.class); inOrder.verify(commands).register(PasteSelectionSessionCommand.class); inOrder.verify(commands).register(CutSelectionSessionCommand.class); @@ -111,119 +110,111 @@ public void testGetCommands() { public void testGetVisitGraphSessionCommand() { editorSessionCommands.getVisitGraphSessionCommand(); - verify(commands).get(0); + verify(commands).get(eq(VisitGraphSessionCommand.class)); } @Test public void testGetSwitchGridSessionCommand() { editorSessionCommands.getSwitchGridSessionCommand(); - verify(commands).get(1); + verify(commands).get(eq(SwitchGridSessionCommand.class)); } @Test public void testGetClearSessionCommand() { editorSessionCommands.getClearSessionCommand(); - verify(commands).get(2); + verify(commands).get(eq(ClearSessionCommand.class)); } @Test public void testGetDeleteSelectionSessionCommand() { editorSessionCommands.getDeleteSelectionSessionCommand(); - verify(commands).get(3); + verify(commands).get(eq(DeleteSelectionSessionCommand.class)); } @Test public void testGetUndoSessionCommand() { editorSessionCommands.getUndoSessionCommand(); - verify(commands).get(4); + verify(commands).get(eq(UndoSessionCommand.class)); } @Test public void testGetRedoSessionCommand() { editorSessionCommands.getRedoSessionCommand(); - verify(commands).get(5); + verify(commands).get(eq(RedoSessionCommand.class)); } @Test public void testGetValidateSessionCommand() { editorSessionCommands.getValidateSessionCommand(); - verify(commands).get(6); + verify(commands).get(eq(ValidateSessionCommand.class)); } @Test public void testGetExportToPngSessionCommand() { editorSessionCommands.getExportToPngSessionCommand(); - verify(commands).get(7); + verify(commands).get(eq(ExportToPngSessionCommand.class)); } @Test public void testGetExportToJpgSessionCommand() { editorSessionCommands.getExportToJpgSessionCommand(); - verify(commands).get(8); + verify(commands).get(eq(ExportToJpgSessionCommand.class)); } @Test public void testGetExportToPdfSessionCommand() { editorSessionCommands.getExportToPdfSessionCommand(); - verify(commands).get(9); + verify(commands).get(eq(ExportToPdfSessionCommand.class)); } @Test public void testGetExportToSvgSessionCommand() { editorSessionCommands.getExportToSvgSessionCommand(); - verify(commands).get(10); + verify(commands).get(eq(ExportToSvgSessionCommand.class)); } @Test - public void testGetExportToBpmnSessionCommand() { - editorSessionCommands.getExportToBpmnSessionCommand(); + public void testGetExportToRawSessionCommand() { + editorSessionCommands.getExportToRawFormatSessionCommand(); - verify(commands).get(11); + verify(commands).get(eq(ExportToRawFormatSessionCommand.class)); } @Test public void testGetCopySelectionSessionCommand() { editorSessionCommands.getCopySelectionSessionCommand(); - verify(commands).get(12); + verify(commands).get(eq(CopySelectionSessionCommand.class)); } @Test public void testGetPasteSelectionSessionCommand() { editorSessionCommands.getPasteSelectionSessionCommand(); - verify(commands).get(13); + verify(commands).get(eq(PasteSelectionSessionCommand.class)); } @Test public void testGetCutSelectionSessionCommand() { editorSessionCommands.getCutSelectionSessionCommand(); - verify(commands).get(14); + verify(commands).get(eq(CutSelectionSessionCommand.class)); } @Test public void testGetSaveDiagramSessionCommand() { editorSessionCommands.getSaveDiagramSessionCommand(); - verify(commands).get(15); - } - - @Test - public void testGet() { - IntStream.range(0, 15).forEach(i -> { - editorSessionCommands.get(i); - verify(commands).get(i); - }); + verify(commands).get(eq(SaveDiagramSessionCommand.class)); } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/view/DiagramEditorScreenViewImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/view/DiagramEditorScreenViewImplTest.java new file mode 100644 index 00000000000..8274da5b819 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/kie-wb-common-stunner-kogito-client/src/test/java/org/kie/workbench/common/stunner/kogito/client/view/DiagramEditorScreenViewImplTest.java @@ -0,0 +1,77 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.view; + +import com.google.gwt.user.client.ui.FlowPanel; +import com.google.gwt.user.client.ui.IsWidget; +import com.google.gwtmockito.GwtMockitoTestRunner; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; + +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +@RunWith(GwtMockitoTestRunner.class) +public class DiagramEditorScreenViewImplTest { + + @Mock + private FlowPanel widget; + + @Mock + private FlowPanel loadingPanel; + + @Mock + private FlowPanel widgetPanel; + + private DiagramEditorScreenViewImpl tested; + + @Before + public void setup() throws Exception { + this.tested = new DiagramEditorScreenViewImpl(loadingPanel, + widgetPanel); + } + + @Test + public void testSetWidget() { + tested.setWidget(widget); + verify(widgetPanel, + times(1)).clear(); + verify(widgetPanel, + times(1)).add(any(IsWidget.class)); + } + + @Test + public void testShowLoading() { + tested.showLoading(); + verify(widgetPanel, + times(1)).setVisible(eq(false)); + verify(loadingPanel, + times(1)).setVisible(eq(true)); + } + + @Test + public void testHideLoading() { + tested.hideLoading(); + verify(loadingPanel, + times(1)).setVisible(eq(false)); + verify(widgetPanel, + times(1)).setVisible(eq(true)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/pom.xml new file mode 100644 index 00000000000..3975bbfae42 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-kogito/pom.xml @@ -0,0 +1,36 @@ + + + + + kie-wb-common-stunner-extensions + org.kie.workbench.stunner + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-stunner-kogito + pom + Kie Workbench - Common - Stunner - Kogito + Kie Workbench - Common - Stunner - Kogito + + kie-wb-common-stunner-kogito-api + kie-wb-common-stunner-kogito-client + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/pom.xml index 768b502675c..c6c7c623078 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/pom.xml @@ -89,6 +89,11 @@ kie-wb-common-stunner-core-common + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-api + + org.kie.soup kie-soup-commons diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/diagram/ProjectDiagram.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/diagram/ProjectDiagram.java index beb2d585271..b50ccd387ab 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/diagram/ProjectDiagram.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/diagram/ProjectDiagram.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.kie.workbench.common.stunner.project.diagram; import org.kie.workbench.common.stunner.core.diagram.Diagram; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/diagram/editor/ProjectDiagramResource.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/diagram/editor/ProjectDiagramResource.java new file mode 100644 index 00000000000..2592fc1ec52 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/diagram/editor/ProjectDiagramResource.java @@ -0,0 +1,23 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.project.diagram.editor; + +import org.kie.workbench.common.stunner.kogito.api.editor.KogitoDiagramResource; +import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; + +public interface ProjectDiagramResource extends KogitoDiagramResource { + +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/editor/impl/ProjectDiagramResourceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/diagram/editor/impl/ProjectDiagramResourceImpl.java similarity index 81% rename from kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/editor/impl/ProjectDiagramResourceImpl.java rename to kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/diagram/editor/impl/ProjectDiagramResourceImpl.java index ec833da4d6c..7817c1c91af 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/editor/impl/ProjectDiagramResourceImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/diagram/editor/impl/ProjectDiagramResourceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,8 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -package org.kie.workbench.common.stunner.project.editor.impl; +package org.kie.workbench.common.stunner.project.diagram.editor.impl; import java.util.Objects; import java.util.Optional; @@ -22,12 +21,11 @@ import org.jboss.errai.common.client.api.annotations.MapsTo; import org.jboss.errai.common.client.api.annotations.Portable; import org.kie.workbench.common.stunner.core.util.HashUtil; +import org.kie.workbench.common.stunner.kogito.api.editor.DiagramType; import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; -import org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource; +import org.kie.workbench.common.stunner.project.diagram.editor.ProjectDiagramResource; import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; -import static org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource.Type.PROJECT_DIAGRAM; -import static org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource.Type.XML_DIAGRAM; @Portable public class ProjectDiagramResourceImpl implements ProjectDiagramResource { @@ -36,11 +34,11 @@ public class ProjectDiagramResourceImpl implements ProjectDiagramResource { private String xmlDiagram = ""; - private Type type = XML_DIAGRAM; + private DiagramType type = DiagramType.PROJECT_DIAGRAM; public ProjectDiagramResourceImpl(final @MapsTo("projectDiagram") ProjectDiagram projectDiagram, final @MapsTo("xmlDiagram") String xmlDiagram, - final @MapsTo("type") Type type) { + final @MapsTo("type") DiagramType type) { checkNotNull("type", type); this.projectDiagram = projectDiagram; @@ -49,25 +47,22 @@ public ProjectDiagramResourceImpl(final @MapsTo("projectDiagram") ProjectDiagram } public ProjectDiagramResourceImpl(final ProjectDiagram projectDiagram) { - this(projectDiagram, null, PROJECT_DIAGRAM); + this(projectDiagram, null, DiagramType.PROJECT_DIAGRAM); } public ProjectDiagramResourceImpl(final String xmlDiagram) { - this(null, xmlDiagram, XML_DIAGRAM); + this(null, xmlDiagram, DiagramType.XML_DIAGRAM); } @Override public boolean equals(final Object o) { - if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - final ProjectDiagramResourceImpl that = (ProjectDiagramResourceImpl) o; - if (projectDiagram != null ? !projectDiagram.equals(that.projectDiagram) : that.projectDiagram != null) { return false; } @@ -96,7 +91,7 @@ public Optional xmlDiagram() { } @Override - public Type getType() { + public DiagramType getType() { return type; } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/editor/ProjectDiagramResource.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/editor/ProjectDiagramResource.java deleted file mode 100644 index 9955a6e30d4..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/editor/ProjectDiagramResource.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.project.editor; - -import java.util.Optional; - -import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; - -public interface ProjectDiagramResource { - - Optional projectDiagram(); - - Optional xmlDiagram(); - - Type getType(); - - enum Type { - XML_DIAGRAM, - PROJECT_DIAGRAM - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/factory/impl/ProjectDiagramFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/factory/impl/ProjectDiagramFactory.java index 1fca96ddb54..db12ce985d9 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/factory/impl/ProjectDiagramFactory.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/factory/impl/ProjectDiagramFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.kie.workbench.common.stunner.project.factory.impl; import javax.enterprise.context.ApplicationScoped; @@ -22,7 +21,6 @@ import org.kie.workbench.common.stunner.core.factory.diagram.DiagramFactory; import org.kie.workbench.common.stunner.core.graph.Graph; import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; -import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata; import org.kie.workbench.common.stunner.project.diagram.impl.ProjectDiagramImpl; @@ -31,7 +29,7 @@ */ @ApplicationScoped public class ProjectDiagramFactory - implements DiagramFactory { + implements DiagramFactory { @Override public Class getMetadataType() { @@ -39,9 +37,9 @@ public Class getMetadataType() { } @Override - public ProjectDiagram build(final String name, - final ProjectMetadata metadata, - final Graph graph) { + public ProjectDiagramImpl build(final String name, + final ProjectMetadata metadata, + final Graph graph) { return new ProjectDiagramImpl(name, graph, metadata); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/service/ProjectDiagramResourceService.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/service/ProjectDiagramResourceService.java index c7f366c5f3c..4934d4f3f5d 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/service/ProjectDiagramResourceService.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/service/ProjectDiagramResourceService.java @@ -18,7 +18,7 @@ import org.guvnor.common.services.shared.metadata.model.Metadata; import org.jboss.errai.bus.server.annotations.Remote; -import org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource; +import org.kie.workbench.common.stunner.project.diagram.editor.ProjectDiagramResource; import org.uberfire.ext.editor.commons.service.support.SupportsSaveAndRename; @Remote diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/service/ProjectValidationService.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/service/ProjectValidationService.java new file mode 100644 index 00000000000..8c5d5a9e408 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/java/org/kie/workbench/common/stunner/project/service/ProjectValidationService.java @@ -0,0 +1,30 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.project.service; + +import java.util.Collection; + +import org.jboss.errai.bus.server.annotations.Remote; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.rule.RuleViolation; +import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; + +@Remote +public interface ProjectValidationService { + + Collection> validate(Diagram diagram); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/resources/org/kie/workbench/common/stunner/project/StunnerProjectAPI.gwt.xml b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/resources/org/kie/workbench/common/stunner/project/StunnerProjectAPI.gwt.xml index 6c0a1f0161a..849fdc9d63c 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/resources/org/kie/workbench/common/stunner/project/StunnerProjectAPI.gwt.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/main/resources/org/kie/workbench/common/stunner/project/StunnerProjectAPI.gwt.xml @@ -22,11 +22,11 @@ + - diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/test/java/org/kie/workbench/common/stunner/project/diagram/impl/ProjectDiagramImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/test/java/org/kie/workbench/common/stunner/project/diagram/impl/ProjectDiagramImplTest.java deleted file mode 100644 index 8029509ea34..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/test/java/org/kie/workbench/common/stunner/project/diagram/impl/ProjectDiagramImplTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.project.diagram.impl; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.core.graph.impl.GraphImpl; -import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; -import org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; - -@RunWith(MockitoJUnitRunner.class) -public class ProjectDiagramImplTest { - - @Test - public void testProjectDiagramEquals() { - ProjectDiagramImpl a = new ProjectDiagramImpl("Diagram", - new GraphImpl("Graph", - new GraphNodeStoreImpl()), - new ProjectMetadataImpl()); - ProjectDiagramImpl b = new ProjectDiagramImpl("AnotherDiagram", - new GraphImpl("Graph", - new GraphNodeStoreImpl()), - new ProjectMetadataImpl()); - assertNotEquals(a, - b); - b = new ProjectDiagramImpl("Diagram", - new GraphImpl("Graph", - new GraphNodeStoreImpl()), - new ProjectMetadataImpl()); - assertEquals(a, - b); - - a.setGraph(new GraphImpl("Graph", - new GraphNodeStoreImpl())); - b.setGraph(new GraphImpl("Graph", - new GraphNodeStoreImpl())); - assertEquals(a, - b); - - a.getGraph().addNode(new NodeImpl("Node1")); - b.getGraph().addNode(new NodeImpl("Node2")); - assertNotEquals(a, - b); - b.getGraph().removeNode("Node2"); - b.getGraph().addNode(new NodeImpl("Node1")); - assertEquals(a, - b); - assertEquals(a, - a); - } - - @Test - public void testProjectDiagramHashCode() { - ProjectDiagramImpl a = new ProjectDiagramImpl("Diagram", - new GraphImpl("Graph", - new GraphNodeStoreImpl()), - new ProjectMetadataImpl()); - ProjectDiagramImpl b = new ProjectDiagramImpl("AnotherDiagram", - new GraphImpl("Graph", - new GraphNodeStoreImpl()), - new ProjectMetadataImpl()); - assertNotEquals(a.hashCode(), - b.hashCode()); - b = new ProjectDiagramImpl("Diagram", - new GraphImpl("Graph", - new GraphNodeStoreImpl()), - new ProjectMetadataImpl()); - assertEquals(a.hashCode(), - b.hashCode()); - - a.setGraph(new GraphImpl("Graph", - new GraphNodeStoreImpl())); - b.setGraph(new GraphImpl("Graph", - new GraphNodeStoreImpl())); - assertEquals(a.hashCode(), - b.hashCode()); - - a.getGraph().addNode(new NodeImpl("Node1")); - b.getGraph().addNode(new NodeImpl("Node2")); - assertNotEquals(a.hashCode(), - b.hashCode()); - b.getGraph().removeNode("Node2"); - b.getGraph().addNode(new NodeImpl("Node1")); - assertEquals(a.hashCode(), - b.hashCode()); - assertEquals(a.hashCode(), - a.hashCode()); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/test/java/org/kie/workbench/common/stunner/project/editor/impl/ProjectDiagramResourceImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/test/java/org/kie/workbench/common/stunner/project/editor/impl/ProjectDiagramResourceImplTest.java deleted file mode 100644 index 311569b9ed8..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-api/src/test/java/org/kie/workbench/common/stunner/project/editor/impl/ProjectDiagramResourceImplTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.project.editor.impl; - -import org.junit.Test; -import org.kie.workbench.common.stunner.core.graph.impl.GraphImpl; -import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; -import org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl; -import org.kie.workbench.common.stunner.project.diagram.impl.ProjectDiagramImpl; -import org.kie.workbench.common.stunner.project.diagram.impl.ProjectMetadataImpl; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource.Type.PROJECT_DIAGRAM; -import static org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource.Type.XML_DIAGRAM; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.spy; - -public class ProjectDiagramResourceImplTest { - - @Test - public void testEqualsWhenProjectDiagramIsDifferent() { - - final ProjectDiagramImpl projectDiagram1 = new ProjectDiagramImpl("Diagram", makeGraph(), makeMetadata()); - final ProjectDiagramImpl projectDiagram2 = new ProjectDiagramImpl("Diagram_", makeGraph(), makeMetadata()); - final ProjectDiagramResourceImpl projectDiagramResource1 = new ProjectDiagramResourceImpl(projectDiagram1); - final ProjectDiagramResourceImpl projectDiagramResource2 = new ProjectDiagramResourceImpl(projectDiagram2); - - assertNotEquals(projectDiagramResource1, projectDiagramResource2); - assertNotEquals(projectDiagramResource1.hashCode(), projectDiagramResource2.hashCode()); - } - - @Test - public void testEqualsWhenXmlDiagramIsDifferent() { - - final ProjectDiagramResourceImpl projectDiagramResource1 = new ProjectDiagramResourceImpl(""); - final ProjectDiagramResourceImpl projectDiagramResource2 = new ProjectDiagramResourceImpl(""); - - assertNotEquals(projectDiagramResource1, projectDiagramResource2); - assertNotEquals(projectDiagramResource1.hashCode(), projectDiagramResource2.hashCode()); - } - - @Test - public void testEqualsWhenTypeIsDifferent() { - - final ProjectDiagramResourceImpl projectDiagramResource1 = new ProjectDiagramResourceImpl(null, null, PROJECT_DIAGRAM); - final ProjectDiagramResourceImpl projectDiagramResource2 = new ProjectDiagramResourceImpl(null, null, XML_DIAGRAM); - - assertNotEquals(projectDiagramResource1, projectDiagramResource2); - assertNotEquals(projectDiagramResource1.hashCode(), projectDiagramResource2.hashCode()); - } - - @Test - public void testEqualsWhenProjectDiagramIsDifferentGraph() { - - final GraphImpl graphOne = makeGraph(); - final GraphImpl graphTwo = makeGraph(); - - graphTwo.addNode(new NodeImpl("unique id")); - - final ProjectDiagramImpl projectDiagram1 = new ProjectDiagramImpl("Diagram", graphOne, makeMetadata()); - final ProjectDiagramImpl projectDiagram2 = new ProjectDiagramImpl("Diagram", graphTwo, makeMetadata()); - final ProjectDiagramResourceImpl projectDiagramResource1 = new ProjectDiagramResourceImpl(projectDiagram1); - final ProjectDiagramResourceImpl projectDiagramResource2 = new ProjectDiagramResourceImpl(projectDiagram2); - - assertNotEquals(projectDiagramResource1, projectDiagramResource2); - assertNotEquals(projectDiagramResource1.hashCode(), projectDiagramResource2.hashCode()); - } - - @Test - public void testEqualsWhenProjectDiagramIsDifferentMetadata() { - - final ProjectMetadataImpl metadataOne = spy(makeMetadata()); - final ProjectMetadataImpl metadataTwo = spy(makeMetadata()); - - doReturn("moduleOne").when(metadataOne).getModuleName(); - doReturn("moduleTwo").when(metadataTwo).getModuleName(); - - final ProjectDiagramImpl projectDiagram1 = new ProjectDiagramImpl("Diagram", makeGraph(), metadataOne); - final ProjectDiagramImpl projectDiagram2 = new ProjectDiagramImpl("Diagram", makeGraph(), metadataTwo); - final ProjectDiagramResourceImpl projectDiagramResource1 = new ProjectDiagramResourceImpl(projectDiagram1); - final ProjectDiagramResourceImpl projectDiagramResource2 = new ProjectDiagramResourceImpl(projectDiagram2); - - assertNotEquals(projectDiagramResource1, projectDiagramResource2); - assertNotEquals(projectDiagramResource1.hashCode(), projectDiagramResource2.hashCode()); - } - - @Test - public void testEqualsWhenObjectsAreEqual() { - - final ProjectDiagramImpl projectDiagram1 = new ProjectDiagramImpl("Diagram", makeGraph(), makeMetadata()); - final ProjectDiagramImpl projectDiagram2 = new ProjectDiagramImpl("Diagram", makeGraph(), makeMetadata()); - final ProjectDiagramResourceImpl projectDiagramResource1 = new ProjectDiagramResourceImpl(projectDiagram1); - final ProjectDiagramResourceImpl projectDiagramResource2 = new ProjectDiagramResourceImpl(projectDiagram2); - - assertEquals(projectDiagramResource1, projectDiagramResource2); - assertEquals(projectDiagramResource1.hashCode(), projectDiagramResource2.hashCode()); - } - - @Test(expected = IllegalArgumentException.class) - public void testInstanceCreationWhenTypeIsNull() { - new ProjectDiagramResourceImpl(null, null, null); - } - - private GraphImpl makeGraph() { - return new GraphImpl("Graph", new GraphNodeStoreImpl()); - } - - private ProjectMetadataImpl makeMetadata() { - return new ProjectMetadataImpl(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/pom.xml index a4256be670a..ebc29314ca0 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/pom.xml @@ -62,6 +62,11 @@ kie-wb-common-stunner-project-api + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-api + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/DelegateDiagramService.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/DelegateDiagramService.java index 81876408123..ffdf983d7b9 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/DelegateDiagramService.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/DelegateDiagramService.java @@ -42,13 +42,14 @@ public DelegateDiagramService(final ProjectDiagramService projectDiagramService) this.projectDiagramService = projectDiagramService; } - private Diagram convert(ProjectDiagram projectDiagram) { + private Diagram convert(final ProjectDiagram projectDiagram) { final DiagramImpl diagram = new DiagramImpl(projectDiagram.getName(), projectDiagram.getMetadata()); diagram.setGraph(projectDiagram.getGraph()); return diagram; } - private ProjectDiagram convert(Diagram diagram) { + @SuppressWarnings("unchecked") + private ProjectDiagram convert(final Diagram diagram) { if (!ProjectMetadata.class.isInstance(diagram.getMetadata())) { throw new IllegalStateException("The Metadata is supposed to be a ProjectMetadata for diagram " + diagram.getName()); } @@ -56,37 +57,41 @@ private ProjectDiagram convert(Diagram diagram) { } @Override - public Diagram getDiagramByPath(Path path) { + @SuppressWarnings("unchecked") + public Diagram getDiagramByPath(final Path path) { return convert(projectDiagramService.getDiagramByPath(path)); } @Override - public boolean accepts(Path path) { + public boolean accepts(final Path path) { return projectDiagramService.accepts(path); } @Override - public Path create(Path path, String name, String defSetId) { + public Path create(final Path path, + final String name, + final String defSetId) { return projectDiagramService.create(path, name, defSetId); } @Override - public Metadata saveOrUpdate(Diagram diagram) { + public Metadata saveOrUpdate(final Diagram diagram) { return projectDiagramService.saveOrUpdate(convert(diagram)); } @Override - public boolean delete(Diagram diagram) { + public boolean delete(final Diagram diagram) { return projectDiagramService.delete(convert(diagram)); } @Override - public String getRawContent(Diagram diagram) { + public String getRawContent(final Diagram diagram) { return projectDiagramService.getRawContent(convert(diagram)); } @Override - public Path saveOrUpdateSvg(Path diagramPath, String rawDiagramSvg) { + public Path saveOrUpdateSvg(final Path diagramPath, + final String rawDiagramSvg) { return projectDiagramService.saveOrUpdateSvg(diagramPath, rawDiagramSvg); } } \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramLookupServiceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramLookupServiceImpl.java index cee050285f4..fbb2d4ec9f4 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramLookupServiceImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramLookupServiceImpl.java @@ -70,7 +70,8 @@ protected List getItems(final DiagramLookupRequest request) { } @Override - protected boolean matches(String criteria, ProjectDiagram item) { + protected boolean matches(final String criteria, + final ProjectDiagram item) { return true; } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramResourceServiceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramResourceServiceImpl.java index 48c88cfd32a..2ce3346474e 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramResourceServiceImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramResourceServiceImpl.java @@ -26,18 +26,15 @@ import org.guvnor.common.services.shared.metadata.model.Metadata; import org.jboss.errai.bus.server.annotations.Service; +import org.kie.workbench.common.stunner.kogito.api.editor.DiagramType; import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; -import org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource; -import org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource.Type; +import org.kie.workbench.common.stunner.project.diagram.editor.ProjectDiagramResource; import org.kie.workbench.common.stunner.project.service.ProjectDiagramResourceService; import org.kie.workbench.common.stunner.project.service.ProjectDiagramService; import org.uberfire.backend.vfs.Path; import org.uberfire.ext.editor.commons.backend.service.SaveAndRenameServiceImpl; import org.uberfire.ext.editor.commons.service.RenameService; -import static org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource.Type.PROJECT_DIAGRAM; -import static org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource.Type.XML_DIAGRAM; - @Service @ApplicationScoped public class ProjectDiagramResourceServiceImpl implements ProjectDiagramResourceService { @@ -72,11 +69,11 @@ public Path save(final Path path, final Metadata metadata, final String comment) { - final Type type = resource.getType(); - final Map> saveOperations = new HashMap<>(); + final DiagramType type = resource.getType(); + final Map> saveOperations = new HashMap<>(); - saveOperations.put(PROJECT_DIAGRAM, (r) -> projectDiagramService.save(path, getProjectDiagram(r), metadata, comment)); - saveOperations.put(XML_DIAGRAM, (r) -> projectDiagramService.saveAsXml(path, getXmlDiagram(r), metadata, comment)); + saveOperations.put(DiagramType.PROJECT_DIAGRAM, (r) -> projectDiagramService.save(path, getProjectDiagram(r), metadata, comment)); + saveOperations.put(DiagramType.XML_DIAGRAM, (r) -> projectDiagramService.saveAsXml(path, getXmlDiagram(r), metadata, comment)); return saveOperations.get(type).apply(resource); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceController.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceController.java index 7a2bf9769e7..73c702130ed 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceController.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceController.java @@ -163,14 +163,6 @@ private ProjectMetadata buildProjectMetadataInstance(final Path path, .build(); } - @Override - protected ProjectMetadata obtainMetadata(final DefinitionSetService services, - final Path diagramFilePath, - final String defSetId, - final String fileName) { - return null; - } - public Path save(final Path path, final ProjectDiagram diagram, final Map attributes, diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceImpl.java index cfaba05d0d4..81f34d5e9ae 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceImpl.java @@ -112,6 +112,7 @@ public boolean accepts(final Path path) { return controller.accepts(path); } + @Override public Path create(final Path path, final String name, final String defSetId, @@ -180,7 +181,8 @@ public ProjectMetadata saveOrUpdate(final ProjectDiagram diagram) { } @Override - public Path saveOrUpdateSvg(Path diagramPath, String rawDiagramSvg) { + public Path saveOrUpdateSvg(final Path diagramPath, + final String rawDiagramSvg) { return controller.saveOrUpdateSvg(diagramPath, rawDiagramSvg); } @@ -197,7 +199,7 @@ public void delete(final Path path, } @Override - public String getRawContent(ProjectDiagram diagram) { + public String getRawContent(final ProjectDiagram diagram) { return controller.getRawContent(diagram); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectValidationServiceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectValidationServiceImpl.java new file mode 100644 index 00000000000..77d7495761e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/main/java/org/kie/workbench/common/stunner/project/backend/service/ProjectValidationServiceImpl.java @@ -0,0 +1,77 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.project.backend.service; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.inject.Instance; +import javax.inject.Inject; + +import org.jboss.errai.bus.server.annotations.Service; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.rule.RuleViolation; +import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; +import org.kie.workbench.common.stunner.core.validation.DomainValidator; +import org.kie.workbench.common.stunner.core.validation.DomainViolation; +import org.kie.workbench.common.stunner.core.validation.impl.ElementViolationImpl; +import org.kie.workbench.common.stunner.project.service.ProjectValidationService; + +@ApplicationScoped +@Service +public class ProjectValidationServiceImpl implements ProjectValidationService { + + private final Instance validators; + + protected ProjectValidationServiceImpl() { + this(null); + } + + @Inject + public ProjectValidationServiceImpl(Instance validators) { + this.validators = validators; + } + + @Override + public Collection> validate(Diagram diagram) { + return domainViolations(diagram).stream() + .filter(v -> Objects.nonNull(v.getUUID())) + .filter(v -> !"null".equals(v.getUUID())) + .collect(Collectors.groupingBy(DomainViolation::getUUID)) + .entrySet() + .stream() + .map(e -> new ElementViolationImpl.Builder().setUuid(e.getKey()).setDomainViolations(e.getValue()).build()) + .collect(Collectors.toList()); + } + + private Collection domainViolations(Diagram diagram) { + return StreamSupport.stream(validators.spliterator(), false) + .filter(validator -> Objects.equals(validator.getDefinitionSetId(), diagram.getMetadata().getDefinitionSetId())) + .findFirst() + .map(validator -> { + final List domainViolations = new ArrayList<>(); + validator.validate(diagram, domainViolations::addAll); + return domainViolations; + }).orElseGet(Collections::emptyList); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/DelegateDiagramServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/DelegateDiagramServiceTest.java index 5980d366dd8..43805235f6e 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/DelegateDiagramServiceTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/DelegateDiagramServiceTest.java @@ -22,8 +22,8 @@ import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.diagram.Metadata; import org.kie.workbench.common.stunner.core.graph.Graph; -import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata; +import org.kie.workbench.common.stunner.project.diagram.impl.ProjectDiagramImpl; import org.kie.workbench.common.stunner.project.service.ProjectDiagramService; import org.mockito.ArgumentCaptor; import org.mockito.Captor; @@ -61,10 +61,10 @@ public class DelegateDiagramServiceTest { private Graph graph; @Captor - private ArgumentCaptor projectDiagramArgumentCaptor; + private ArgumentCaptor projectDiagramArgumentCaptor; @Mock - private ProjectDiagram projectDiagram; + private ProjectDiagramImpl projectDiagram; @Before public void setUp() throws Exception { @@ -78,9 +78,9 @@ public void setUp() throws Exception { when(projectDiagramService.getDiagramByPath(path)).thenReturn(projectDiagram); when(projectDiagramService.accepts(path)).thenReturn(true); when(projectDiagramService.create(path, NAME, DEF_ID)).thenReturn(path); - when(projectDiagramService.saveOrUpdate(any(ProjectDiagram.class))).thenReturn(projectMetadata); - when(projectDiagramService.delete(any(ProjectDiagram.class))).thenReturn(true); - when(projectDiagramService.getRawContent(any(ProjectDiagram.class))).thenReturn(CONTENT); + when(projectDiagramService.saveOrUpdate(any(ProjectDiagramImpl.class))).thenReturn(projectMetadata); + when(projectDiagramService.delete(any(ProjectDiagramImpl.class))).thenReturn(true); + when(projectDiagramService.getRawContent(any(ProjectDiagramImpl.class))).thenReturn(CONTENT); delegateDiagramService = new DelegateDiagramService(projectDiagramService); } @@ -121,13 +121,13 @@ public void delete() { assertTrue(deleted); } - private void assertEqualDiagram(ProjectDiagram projectDiagram) { + private void assertEqualDiagram(final ProjectDiagramImpl projectDiagram) { assertEquals(projectDiagram.getName(), NAME); assertEquals(projectDiagram.getGraph(), graph); assertEquals(projectDiagram.getMetadata(), projectMetadata); } - private void assertEqualDiagram(Diagram diagram) { + private void assertEqualDiagram(final Diagram diagram) { assertEquals(diagram.getName(), NAME); assertEquals(diagram.getGraph(), graph); assertEquals(diagram.getMetadata(), projectMetadata); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramResourceServiceImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramResourceServiceImplTest.java index e69cb5d0e6d..b5cbc70c0bc 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramResourceServiceImplTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramResourceServiceImplTest.java @@ -20,9 +20,9 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; -import org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource; -import org.kie.workbench.common.stunner.project.editor.impl.ProjectDiagramResourceImpl; +import org.kie.workbench.common.stunner.project.diagram.editor.ProjectDiagramResource; +import org.kie.workbench.common.stunner.project.diagram.editor.impl.ProjectDiagramResourceImpl; +import org.kie.workbench.common.stunner.project.diagram.impl.ProjectDiagramImpl; import org.kie.workbench.common.stunner.project.service.ProjectDiagramService; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; @@ -67,9 +67,9 @@ public void testSaveWhenResourceIsProjectDiagram() { final Path path = mock(Path.class); final Metadata metadata = mock(Metadata.class); - final ProjectDiagram projectDiagram = mock(ProjectDiagram.class); + final ProjectDiagramImpl projectDiagram = mock(ProjectDiagramImpl.class); final Path expectedPath = mock(Path.class); - final ProjectDiagramResource resource = new ProjectDiagramResourceImpl(projectDiagram); + final ProjectDiagramResourceImpl resource = new ProjectDiagramResourceImpl(projectDiagram); final String comment = "comment"; when(projectDiagramService.save(path, projectDiagram, metadata, comment)).thenReturn(expectedPath); @@ -86,7 +86,7 @@ public void testSaveWhenResourceIsXML() { final Metadata metadata = mock(Metadata.class); final Path expectedPath = mock(Path.class); final String diagramXml = ""; - final ProjectDiagramResource resource = new ProjectDiagramResourceImpl(diagramXml); + final ProjectDiagramResourceImpl resource = new ProjectDiagramResourceImpl(diagramXml); final String comment = "comment"; when(projectDiagramService.saveAsXml(path, diagramXml, metadata, comment)).thenReturn(expectedPath); @@ -113,7 +113,7 @@ public void testSaveAndRename() { final Path path = mock(Path.class); final Metadata metadata = mock(Metadata.class); - final ProjectDiagramResource resource = mock(ProjectDiagramResource.class); + final ProjectDiagramResourceImpl resource = mock(ProjectDiagramResourceImpl.class); final String newName = "newName"; final String comment = "comment"; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceControllerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceControllerTest.java index 521c0b4436b..55c24ccd793 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceControllerTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceControllerTest.java @@ -35,6 +35,7 @@ import org.kie.workbench.common.stunner.core.diagram.Metadata; import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata; +import org.kie.workbench.common.stunner.project.diagram.impl.ProjectDiagramImpl; import org.mockito.Mock; import org.uberfire.backend.server.util.Paths; import org.uberfire.backend.vfs.Path; @@ -108,8 +109,8 @@ public Class getMetadataType() { } @Override - public ProjectDiagram mockDiagram() { - return mock(ProjectDiagram.class); + public ProjectDiagramImpl mockDiagram() { + return mock(ProjectDiagramImpl.class); } public ProjectMetadata mockMetadata() { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceImplTest.java index d7ac2075197..f2fa8d0fd74 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceImplTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectDiagramServiceImplTest.java @@ -40,6 +40,7 @@ import org.kie.workbench.common.stunner.core.registry.BackendRegistryFactory; import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata; +import org.kie.workbench.common.stunner.project.diagram.impl.ProjectDiagramImpl; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; @@ -114,7 +115,7 @@ public class ProjectDiagramServiceImplTest { private Path resultPath; @Mock - private ProjectDiagram diagram; + private ProjectDiagramImpl diagram; private ProjectDiagramServiceImpl diagramService; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectValidationServiceImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectValidationServiceImplTest.java new file mode 100644 index 00000000000..2f255bf5be1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-backend/src/test/java/org/kie/workbench/common/stunner/project/backend/service/ProjectValidationServiceImplTest.java @@ -0,0 +1,156 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.project.backend.service; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.function.Consumer; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.rule.RuleViolation; +import org.kie.workbench.common.stunner.core.util.UUID; +import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; +import org.kie.workbench.common.stunner.core.validation.DomainValidator; +import org.kie.workbench.common.stunner.core.validation.DomainViolation; +import org.kie.workbench.common.stunner.core.validation.Violation; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.uberfire.mocks.MockInstanceImpl; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class ProjectValidationServiceImplTest { + + public static final String DEF_SET_ID = "defSetId"; + public static final String UUID_0 = "uuid0"; + public static final String UUID_1 = "uuid1"; + + private ProjectValidationServiceImpl validationService; + + @Mock + private DomainValidator domainValidator; + + @Mock + private Diagram diagram; + + @Mock + private Metadata metadata; + + @Mock + private DomainViolation domainViolation; + + @Mock + private DomainViolation domainViolation2; + + @Mock + private DomainViolation domainViolation3; + + @Mock + private DomainViolation domainViolation4; + + @Mock + private DomainViolation domainViolationNull; + + @Mock + private DomainViolation domainViolationNullStr; + + @Mock + private Graph graph; + + private static final String GRAPH_UUID = UUID.uuid(); + + private List domainViolationList; + + @Before + @SuppressWarnings("unchecked") + public void setUp() { + domainViolationList = Arrays.asList(domainViolation, + domainViolation2, + domainViolation3, + domainViolation4, + domainViolationNull, + domainViolationNullStr); + domainValidator = new DomainValidator() { + @Override + public String getDefinitionSetId() { + return DEF_SET_ID; + } + + @Override + public void validate(Diagram entity, Consumer> resultConsumer) { + resultConsumer.accept(domainViolationList); + } + }; + + when(diagram.getMetadata()).thenReturn(metadata); + when(metadata.getDefinitionSetId()).thenReturn(DEF_SET_ID); + when(diagram.getGraph()).thenReturn(graph); + when(graph.getUUID()).thenReturn(GRAPH_UUID); + mockViolations(domainViolationList); + + validationService = new ProjectValidationServiceImpl(new MockInstanceImpl(domainValidator)); + } + + private void mockViolations(List violations) { + violations.stream().forEach(v -> { + when(v.getViolationType()).thenReturn(Violation.Type.ERROR); + when(v.getUUID()).thenReturn(UUID_1); + }); + + DomainViolation first = violations.get(0); + when(first.getUUID()).thenReturn(UUID_0); + + DomainViolation last1 = violations.get(violations.size() - 2); + when(last1.getUUID()).thenReturn(null); + + DomainViolation last = violations.get(violations.size() - 1); + when(last.getUUID()).thenReturn("null"); + } + + @Test + public void validate() { + final Collection> violations = validationService.validate(diagram); + verify(diagram).getMetadata(); + verify(metadata).getDefinitionSetId(); + assertEquals(violations.size(), 2); + + List violations0 = Arrays.asList(domainViolation); + List violations1 = + Arrays.asList(domainViolation2, domainViolation3, domainViolation4); + + assertEquals(violations.stream() + .filter(v -> UUID_1.equals(v.getUUID())) + .findFirst() + .map(DiagramElementViolation::getDomainViolations) + .get(), violations1); + + assertEquals(violations.stream() + .filter(v -> UUID_0.equals(v.getUUID())) + .findFirst() + .map(DiagramElementViolation::getDomainViolations) + .get(), violations0); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/pom.xml index f1c80340696..9b5d3cbe85c 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/pom.xml @@ -79,6 +79,16 @@ provided + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-api + + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client + + @@ -265,6 +275,13 @@ test + + org.kie.workbench.stunner + kie-wb-common-stunner-core-common + test + test-jar + + org.kie.workbench.stunner kie-wb-common-stunner-client-common diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/docks/DefaultStunnerDockSupplierImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/docks/DefaultStunnerDockSupplierImpl.java index 614011249cd..3bc384d662f 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/docks/DefaultStunnerDockSupplierImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/docks/DefaultStunnerDockSupplierImpl.java @@ -22,8 +22,8 @@ import javax.enterprise.context.Dependent; import javax.enterprise.inject.Default; -import org.kie.workbench.common.stunner.project.client.screens.ProjectDiagramExplorerScreen; -import org.kie.workbench.common.stunner.project.client.screens.ProjectDiagramPropertiesScreen; +import org.kie.workbench.common.stunner.kogito.client.screens.DiagramEditorExplorerScreen; +import org.kie.workbench.common.stunner.kogito.client.screens.DiagramEditorPropertiesScreen; import org.kie.workbench.common.workbench.client.resources.i18n.DefaultWorkbenchConstants; import org.uberfire.client.workbench.docks.UberfireDock; import org.uberfire.client.workbench.docks.UberfireDockPosition; @@ -41,11 +41,11 @@ public Collection getDocks(String perspectiveIdentifier) { result.add(new UberfireDock(UberfireDockPosition.EAST, "PENCIL_SQUARE_O", - new DefaultPlaceRequest(ProjectDiagramPropertiesScreen.SCREEN_ID), + new DefaultPlaceRequest(DiagramEditorPropertiesScreen.SCREEN_ID), perspectiveIdentifier).withSize(450).withLabel(constants.DocksStunnerPropertiesTitle())); result.add(new UberfireDock(UberfireDockPosition.EAST, "EYE", - new DefaultPlaceRequest(ProjectDiagramExplorerScreen.SCREEN_ID), + new DefaultPlaceRequest(DiagramEditorExplorerScreen.SCREEN_ID), perspectiveIdentifier).withSize(450).withLabel(constants.DocksStunnerExplorerTitle())); return result; } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/docks/StunnerDocksHandler.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/docks/StunnerDocksHandler.java index 837ee740a23..2fcd25bf74f 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/docks/StunnerDocksHandler.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/docks/StunnerDocksHandler.java @@ -28,8 +28,8 @@ import org.kie.workbench.common.stunner.core.api.DefinitionManager; import org.kie.workbench.common.stunner.core.client.event.screen.ScreenMaximizedEvent; import org.kie.workbench.common.stunner.core.client.session.impl.InstanceUtils; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramLoseFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramLoseFocusEvent; import org.kie.workbench.common.widgets.client.docks.AbstractWorkbenchDocksHandler; import org.uberfire.client.workbench.docks.UberfireDock; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditor.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditor.java index e6730fa273f..4c149bdd8ea 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditor.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditor.java @@ -17,8 +17,6 @@ package org.kie.workbench.common.stunner.project.client.editor; import java.lang.annotation.Annotation; -import java.util.ArrayList; -import java.util.Collection; import java.util.Objects; import java.util.Optional; import java.util.function.Supplier; @@ -28,22 +26,15 @@ import javax.annotation.PostConstruct; import javax.enterprise.event.Event; import javax.enterprise.event.Observes; -import javax.inject.Inject; import com.google.gwt.core.client.Scheduler; import com.google.gwt.logging.client.LogConfiguration; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.ProvidesResize; -import com.google.gwt.user.client.ui.RequiresResize; import elemental2.promise.Promise; import org.guvnor.common.services.project.model.WorkspaceProject; import org.jboss.errai.common.client.api.Caller; import org.jboss.errai.common.client.api.RemoteCallback; import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.kie.workbench.common.stunner.client.widgets.presenters.Viewer; -import org.kie.workbench.common.stunner.client.widgets.presenters.diagram.DiagramViewer; import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionPresenter; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.AbstractSessionPresenter; import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; import org.kie.workbench.common.stunner.core.api.DefinitionManager; @@ -53,30 +44,26 @@ import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; import org.kie.workbench.common.stunner.core.client.session.ClientSession; -import org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand; import org.kie.workbench.common.stunner.core.client.session.event.OnSessionErrorEvent; import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; -import org.kie.workbench.common.stunner.core.client.shape.Shape; import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.diagram.DiagramParsingException; import org.kie.workbench.common.stunner.core.diagram.Metadata; import org.kie.workbench.common.stunner.core.documentation.DocumentationPage; import org.kie.workbench.common.stunner.core.documentation.DocumentationView; -import org.kie.workbench.common.stunner.core.rule.RuleViolation; -import org.kie.workbench.common.stunner.core.util.HashUtil; -import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; -import org.kie.workbench.common.stunner.core.validation.Violation.Type; -import org.kie.workbench.common.stunner.core.validation.impl.ValidationUtils; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramLoseFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorCore; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; +import org.kie.workbench.common.stunner.kogito.client.editor.DiagramEditorCore; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramLoseFocusEvent; import org.kie.workbench.common.stunner.project.client.resources.i18n.StunnerProjectClientConstants; import org.kie.workbench.common.stunner.project.client.screens.ProjectMessagesListener; import org.kie.workbench.common.stunner.project.client.service.ClientProjectDiagramService; import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata; -import org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource; -import org.kie.workbench.common.stunner.project.editor.impl.ProjectDiagramResourceImpl; +import org.kie.workbench.common.stunner.project.diagram.editor.ProjectDiagramResource; +import org.kie.workbench.common.stunner.project.diagram.editor.impl.ProjectDiagramResourceImpl; import org.kie.workbench.common.stunner.project.service.ProjectDiagramResourceService; import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; import org.kie.workbench.common.widgets.client.resources.i18n.CommonConstants; @@ -84,12 +71,9 @@ import org.kie.workbench.common.widgets.metadata.client.KieEditorView; import org.uberfire.backend.vfs.ObservablePath; import org.uberfire.backend.vfs.Path; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.client.mvp.UberView; import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; import org.uberfire.client.workbench.type.ClientResourceType; import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.ext.editor.commons.client.file.popups.SavePopUpPresenter; import org.uberfire.ext.editor.commons.service.support.SupportsSaveAndRename; import org.uberfire.ext.widgets.common.client.ace.AceEditorMode; import org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup; @@ -102,137 +86,85 @@ import static org.kie.workbench.common.stunner.project.client.resources.i18n.StunnerProjectClientConstants.DIAGRAM_PARSING_ERROR; -public abstract class AbstractProjectDiagramEditor extends KieEditor { +public abstract class AbstractProjectDiagramEditor extends KieEditor implements DiagramEditorCore { private static final Logger LOGGER = Logger.getLogger(AbstractProjectDiagramEditor.class.getName()); + private static final String TITLE_FORMAT_TEMPLATE = "#title.#suffix - #type"; - private final ManagedInstance> editorSessionPresenterInstances; - private final ManagedInstance> viewerSessionPresenterInstances; - private final DiagramClientErrorHandler diagramClientErrorHandler; + + public interface View extends AbstractDiagramEditorCore.View, + KieEditorView { + + } + + private final AbstractDiagramEditorMenuSessionItems menuSessionItems; + private final Event onDiagramFocusEvent; + private final Event onDiagramLostFocusEvent; private final ClientTranslationService translationService; + private final DocumentationView documentationView; + private final R resourceType; + private final ProjectMessagesListener projectMessagesListener; + private final ClientProjectDiagramService projectDiagramServices; private final Caller projectDiagramResourceServiceCaller; - private final TextEditorView xmlEditorView; - protected ClientProjectDiagramService projectDiagramServices; - protected ProjectDiagramEditorProxy editorProxy = ProjectDiagramEditorProxy.NULL_EDITOR; - private ErrorPopupPresenter errorPopupPresenter; - private Event changeTitleNotificationEvent; - private R resourceType; - private AbstractProjectEditorMenuSessionItems menuSessionItems; - private ProjectMessagesListener projectMessagesListener; - private Event onDiagramFocusEvent; - private Event onDiagramLostFocusEvent; - private Optional> editorSessionPresenter = Optional.empty(); - private Optional> viewerSessionPresenter = Optional.empty(); + private String title = "Project Diagram Editor"; + private boolean menuBarInitialzed = false; - private DocumentationView documentationView; - @Inject - public AbstractProjectDiagramEditor(final View view, - final DocumentationView documentationView, - final PlaceManager placeManager, - final ErrorPopupPresenter errorPopupPresenter, - final Event changeTitleNotificationEvent, - final SavePopUpPresenter savePopUpPresenter, - final R resourceType, - final ClientProjectDiagramService projectDiagramServices, + public class ProjectDiagramEditorCore extends AbstractProjectDiagramEditorCore> { + + public ProjectDiagramEditorCore(final AbstractProjectDiagramEditor.View baseEditorView, + final TextEditorView xmlEditorView, + final Event notificationEvent, final ManagedInstance> editorSessionPresenterInstances, final ManagedInstance> viewerSessionPresenterInstances, - final AbstractProjectEditorMenuSessionItems menuSessionItems, - final Event onDiagramFocusEvent, - final Event onDiagramLostFocusEvent, - final ProjectMessagesListener projectMessagesListener, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, final DiagramClientErrorHandler diagramClientErrorHandler, - final ClientTranslationService translationService, - final TextEditorView xmlEditorView, - final Caller projectDiagramResourceServiceCaller) { - super(view); - this.documentationView = documentationView; - this.placeManager = placeManager; - this.errorPopupPresenter = errorPopupPresenter; - this.changeTitleNotificationEvent = changeTitleNotificationEvent; - this.savePopUpPresenter = savePopUpPresenter; - this.resourceType = resourceType; - this.projectDiagramServices = projectDiagramServices; - this.editorSessionPresenterInstances = editorSessionPresenterInstances; - this.viewerSessionPresenterInstances = viewerSessionPresenterInstances; - this.menuSessionItems = menuSessionItems; - this.projectMessagesListener = projectMessagesListener; - this.diagramClientErrorHandler = diagramClientErrorHandler; - this.onDiagramFocusEvent = onDiagramFocusEvent; - this.onDiagramLostFocusEvent = onDiagramLostFocusEvent; - this.translationService = translationService; - this.xmlEditorView = xmlEditorView; - this.projectDiagramResourceServiceCaller = projectDiagramResourceServiceCaller; - } + final ClientTranslationService translationService) { + super(baseEditorView, + xmlEditorView, + notificationEvent, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService); + } - @PostConstruct - @SuppressWarnings("unchecked") - public void init() { - title = translationService.getValue(StunnerProjectClientConstants.DIAGRAM_EDITOR_DEFAULT_TITLE); - getView().init(this); - projectMessagesListener.enable(); - menuSessionItems - .setLoadingStarts(this::showLoadingViews) - .setLoadingCompleted(this::hideLoadingViews) - .setErrorConsumer(this::showError); - } + @Override + protected boolean isReadOnly() { + return AbstractProjectDiagramEditor.this.isReadOnly(); + } - protected void doStartUp(final ObservablePath path, - final PlaceRequest place) { - init(path, - place, - resourceType); - } + @Override + protected ProjectDiagramResourceImpl makeDiagramResourceImpl(final ProjectDiagram diagram) { + return new ProjectDiagramResourceImpl(diagram); + } - @Override - protected void loadContent() { - destroySession(); - projectDiagramServices.getByPath(versionRecordManager.getCurrentPath(), - new ServiceCallback() { - @Override - public void onSuccess(final ProjectDiagram item) { - open(item); - } + @Override + protected ProjectDiagramResourceImpl makeDiagramResourceImpl(final String xml) { + return new ProjectDiagramResourceImpl(xml); + } - @Override - public void onError(final ClientRuntimeError error) { - onLoadError(error); - } - }); - } + @Override + protected ProjectDiagramEditorProxy makeEditorProxy() { + return new ProjectDiagramEditorProxy<>(); + } - @SuppressWarnings("unchecked") - public void open(final ProjectDiagram diagram) { - open(diagram, Optional.empty()); - } + @Override + public Annotation[] getDockQualifiers() { + return AbstractProjectDiagramEditor.this.getDockQualifiers(); + } - @SuppressWarnings("unchecked") - public void open(final ProjectDiagram diagram, - final Optional> callback) { - editorProxy = makeStunnerEditorProxy(); - showLoadingViews(); - - //Open applicable SessionPresenter - if (!isReadOnly()) { - openSession(diagram, callback); - } else { - openReadOnlySession(diagram, callback); + @Override + public void initialiseKieEditorForSession(final ProjectDiagram diagram) { + AbstractProjectDiagramEditor.this.initialiseKieEditorForSession(diagram); } - } - @SuppressWarnings("unchecked") - protected ProjectDiagramEditorProxy makeStunnerEditorProxy() { - final ProjectDiagramEditorProxy proxy = new ProjectDiagramEditorProxy(); - proxy.setContentSupplier(() -> new ProjectDiagramResourceImpl(getDiagram())); - proxy.setSaveAfterValidationConsumer((continueSaveOnceValid) -> { - menuSessionItems - .getCommands() - .getValidateSessionCommand() - .execute(getSaveAfterValidationCallback(continueSaveOnceValid)); - }); - proxy.setSaveAfterUserConfirmationConsumer((commitMessage) -> { - // Perform update operation remote call. + @Override + protected void saveOrUpdate(final String commitMessage) { final ObservablePath diagramPath = versionRecordManager.getCurrentPath(); projectDiagramServices.saveOrUpdate(diagramPath, getDiagram(), @@ -251,68 +183,13 @@ public void onError(final ClientRuntimeError error) { onSaveError(error); } }); - }); - proxy.setShowNoChangesSinceLastSaveMessageConsumer((message) -> getSessionPresenter().getView().showMessage(message)); - proxy.setHashCodeSupplier(() -> { - if (null == getDiagram()) { - return 0; - } - int hash = getDiagram().hashCode(); - if (null == getCanvasHandler() || - null == getCanvasHandler().getCanvas() || - null == getCanvasHandler().getCanvas().getShapes()) { - return hash; - } - Collection collectionOfShapes = getCanvasHandler().getCanvas().getShapes(); - ArrayList shapes = new ArrayList<>(); - shapes.addAll(collectionOfShapes); - shapes.sort((a, b) -> (a.getShapeView().getShapeX() == b.getShapeView().getShapeX()) ? - (int) Math.round(a.getShapeView().getShapeY() - b.getShapeView().getShapeY()) : - (int) Math.round(a.getShapeView().getShapeX() - b.getShapeView().getShapeX())); - for (Shape shape : shapes) { - hash = HashUtil.combineHashCodes(hash, - Double.hashCode(shape.getShapeView().getShapeX()), - Double.hashCode(shape.getShapeView().getShapeY())); - } - return hash; - }); - - return proxy; - } - - /** - * Gets the callback to execute following validation of the diagram before saving. - * The default implementation continues with the save process if {@see Type.WARNING} are found, but - * aborts the save process if any {@see Type.ERROR} is present to guarantee the diagram's consistency. - */ - protected ClientSessionCommand.Callback>> getSaveAfterValidationCallback(final Command continueSaveOnceValid) { - return new ClientSessionCommand.Callback>>() { - @Override - public void onSuccess() { - continueSaveOnceValid.execute(); - } - - @Override - public void onError(final Collection> violations) { - final Type maxSeverity = ValidationUtils.getMaxSeverity(violations); - if (maxSeverity.equals(Type.ERROR)) { - onValidationFailed(violations); - } else { - // Allow saving when only warnings founds. - continueSaveOnceValid.execute(); - } - } - }; - } + } - protected ProjectDiagramEditorProxy makeXmlEditorProxy() { - final ProjectDiagramEditorProxy proxy = new ProjectDiagramEditorProxy(); - proxy.setContentSupplier(() -> new ProjectDiagramResourceImpl(xmlEditorView.getContent())); - proxy.setSaveAfterValidationConsumer(Command::execute); - proxy.setSaveAfterUserConfirmationConsumer((commitMessage) -> { + @Override + protected void saveAsXML(final String commitMessage) { final ObservablePath diagramPath = versionRecordManager.getCurrentPath(); projectDiagramServices.saveAsXml(diagramPath, - xmlEditorView.getContent(), + getXMLEditorView().getContent(), metadata, commitMessage, new ServiceCallback() { @@ -328,109 +205,153 @@ public void onError(final ClientRuntimeError error) { onSaveError(error); } }); - }); - proxy.setShowNoChangesSinceLastSaveMessageConsumer((message) -> notification.fire(new NotificationEvent(message))); - proxy.setHashCodeSupplier(() -> xmlEditorView.getContent().hashCode()); - return proxy; - } - - protected boolean isReadOnly() { - return isReadOnly; - } - - private void openSession(final Optional presenter, - final ProjectDiagram diagram, - final Optional> callback) { - presenter.get() - .open(diagram, - new SessionPresenter.SessionPresenterCallback() { - @Override - public void afterSessionOpened() { - callback.ifPresent(SessionPresenter.SessionPresenterCallback::afterSessionOpened); - } + } - @Override - public void afterCanvasInitialized() { - callback.ifPresent(DiagramViewer.DiagramViewerCallback::afterCanvasInitialized); - } + @Override + public String getEditorIdentifier() { + return AbstractProjectDiagramEditor.this.getEditorIdentifier(); + } - @Override - public void onSuccess() { - initialiseKieEditorForSession(diagram); - menuSessionItems.bind(getSession()); - callback.ifPresent(Viewer.Callback::onSuccess); - } + @Override + public void onLoadError(final ClientRuntimeError error) { + final Throwable e = error.getThrowable(); + if (e instanceof DiagramParsingException) { + final DiagramParsingException dpe = (DiagramParsingException) e; + final Metadata metadata = dpe.getMetadata(); + final String xml = dpe.getXml(); + + setOriginalHash(xml.hashCode()); + updateTitle(metadata.getTitle()); + resetEditorPages(((ProjectMetadata) metadata).getOverview()); + menuSessionItems.setEnabled(false); + + getXMLEditorView().setReadOnly(isReadOnly); + getXMLEditorView().setContent(xml, AceEditorMode.XML); + getView().setWidget(getXMLEditorView().asWidget()); + setEditorProxy(makeXmlEditorProxy()); + hideLoadingViews(); + notification.fire(new NotificationEvent(getDiagramParsingErrorMessage(dpe), + NotificationEvent.NotificationType.ERROR)); + + Scheduler.get().scheduleDeferred(getXMLEditorView()::onResize); + } else { + setEditorProxy(makeEditorProxy()); + showError(error); - @Override - public void onError(final ClientRuntimeError error) { - onLoadError(error); - callback.ifPresent(c -> c.onError(error)); - } - }); + //close editor in case of error when opening the editor + placeManager.forceClosePlace(new PathPlaceRequest(versionRecordManager.getCurrentPath(), + getEditorIdentifier())); + } + } } - protected void openSession(final ProjectDiagram diagram, - final Optional> callback) { - editorSessionPresenter = Optional.of(newSessionEditorPresenter()); - openSession(editorSessionPresenter, diagram, callback); + protected String getDiagramParsingErrorMessage(final DiagramParsingException e) { + return translationService.getValue(DIAGRAM_PARSING_ERROR, Objects.toString(e.getMessage(), "")); } - protected void openReadOnlySession(final ProjectDiagram diagram, - final Optional> callback) { - viewerSessionPresenter = Optional.of(newSessionViewerPresenter()); - openSession(viewerSessionPresenter, diagram, callback); - } + private final AbstractProjectDiagramEditorCore> editor; - protected void initialiseKieEditorForSession(final ProjectDiagram diagram) { - resetEditorPages(diagram.getMetadata().getOverview()); - updateTitle(diagram.getMetadata().getTitle()); - addDocumentationPage(diagram); - setOriginalHash(getCurrentDiagramHash()); - hideLoadingViews(); - onDiagramLoad(); + public AbstractProjectDiagramEditor(final AbstractProjectDiagramEditor.View view, + final TextEditorView xmlEditorView, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final Event onDiagramFocusEvent, + final Event onDiagramLostFocusEvent, + final Event notificationEvent, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final DocumentationView documentationView, + final R resourceType, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ProjectMessagesListener projectMessagesListener, + final ClientTranslationService translationService, + final ClientProjectDiagramService projectDiagramServices, + final Caller projectDiagramResourceServiceCaller) { + super(view); + + this.menuSessionItems = menuSessionItems; + this.onDiagramFocusEvent = onDiagramFocusEvent; + this.onDiagramLostFocusEvent = onDiagramLostFocusEvent; + this.translationService = translationService; + this.documentationView = documentationView; + this.resourceType = resourceType; + this.projectMessagesListener = projectMessagesListener; + this.projectDiagramServices = projectDiagramServices; + this.projectDiagramResourceServiceCaller = projectDiagramResourceServiceCaller; + + this.editor = makeCore(view, + xmlEditorView, + notificationEvent, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService); + } + + protected AbstractProjectDiagramEditorCore> makeCore(final AbstractProjectDiagramEditor.View view, + final TextEditorView xmlEditorView, + final Event notificationEvent, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService) { + return new ProjectDiagramEditorCore(view, + xmlEditorView, + notificationEvent, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService); } - protected void addDocumentationPage(ProjectDiagram diagram) { - Optional.ofNullable(documentationView.isEnabled()) - .filter(Boolean.TRUE::equals) - .ifPresent(enabled -> { - final String label = translationService.getValue(StunnerProjectClientConstants.DOCUMENTATION); - addPage(new DocumentationPage(documentationView.initialize(diagram), - label, - //firing the OnDiagramFocusEvent will force the docks to be minimized - () -> onDiagramFocusEvent.fire(new OnDiagramFocusEvent(getDockQualifiers())), - //check the DocumentationPage is active, the index is 2 - () -> Objects.equals(2, kieView.getSelectedTabIndex()))); - }); + @PostConstruct + @SuppressWarnings("unchecked") + public void init() { + title = translationService.getValue(StunnerProjectClientConstants.DIAGRAM_EDITOR_DEFAULT_TITLE); + projectMessagesListener.enable(); + menuSessionItems + .setLoadingStarts(this::showLoadingViews) + .setLoadingCompleted(this::hideLoadingViews) + .setErrorConsumer(editor::showError); } - protected void onDiagramLoad() { - /* Override this method to trigger some action after a Diagram is loaded. */ + protected void doStartUp(final ObservablePath path, + final PlaceRequest place) { + init(path, + place, + resourceType); } - protected SessionEditorPresenter newSessionEditorPresenter() { - final SessionEditorPresenter presenter = - (SessionEditorPresenter) editorSessionPresenterInstances.get() - .withToolbar(false) - .withPalette(true) - .displayNotifications(type -> true); - getView().setWidget(presenter.getView()); - return presenter; + @Override + protected void loadContent() { + destroySession(); + projectDiagramServices.getByPath(versionRecordManager.getCurrentPath(), + new ServiceCallback() { + @Override + public void onSuccess(final ProjectDiagram item) { + editor.open(item); + } + + @Override + public void onError(final ClientRuntimeError error) { + editor.onLoadError(error); + } + }); } - protected SessionViewerPresenter newSessionViewerPresenter() { - final SessionViewerPresenter presenter = - (SessionViewerPresenter) viewerSessionPresenterInstances.get() - .withToolbar(false) - .withPalette(false) - .displayNotifications(type -> true); - getView().setWidget(presenter.getView()); - return presenter; + protected boolean isReadOnly() { + return isReadOnly; } @Override protected void onValidate(final Command finished) { - onValidationSuccess(); + log(Level.INFO, "Validation SUCCESS."); hideLoadingViews(); finished.execute(); } @@ -439,6 +360,9 @@ protected void onValidate(final Command finished) { * This method is called just once clicking on save. * Before starting the save process, let's perform a diagram validation * to check all it's valid. + * It's allowed to continue with the save process event if warnings found, + * but cannot save if any error is present in order to + * guarantee the diagram's consistency. */ @Override protected void save() { @@ -453,7 +377,7 @@ protected void save() { } protected void doSave(final Command continueSaveOnceValid) { - editorProxy.saveAfterValidation(continueSaveOnceValid); + editor.getEditorProxy().saveAfterValidation(continueSaveOnceValid); } /** @@ -469,7 +393,7 @@ protected void save(final String commitMessage) { } protected void doSave(final String commitMessage) { - editorProxy.saveAfterUserConfirmation(commitMessage); + editor.getEditorProxy().saveAfterUserConfirmation(commitMessage); } @Override @@ -494,9 +418,9 @@ public void showDocks() { super.showDocks(); } - public Annotation[] getDockQualifiers() { - return new Annotation[]{DefinitionManager.DEFAULT_QUALIFIER}; - } + @Override + //Override visibility from KieEditor to allow inner class ProjectDiagramEditorCore access + public abstract String getEditorIdentifier(); @Override protected Promise makeMenuBar() { @@ -546,33 +470,17 @@ protected Caller getContentSupplier() { - return () -> getEditorProxy().getContentSupplier().get(); - } - - protected ProjectDiagramEditorProxy getEditorProxy() { - return editorProxy; + return editor.getEditorProxy().getContentSupplier(); } @Override protected Integer getCurrentContentHash() { - return getCurrentDiagramHash(); + return editor.getCurrentDiagramHash(); } protected void doOpen() { } - protected void doFocus() { - if (null != getSessionPresenter()) { - getSessionPresenter().focus(); - } - } - - protected void doLostFocus() { - if (null != getSessionPresenter()) { - getSessionPresenter().lostFocus(); - } - } - protected void doClose() { menuItems.clear(); menuSessionItems.destroy(); @@ -591,6 +499,7 @@ protected void hideLoadingViews() { getView().hideBusyIndicator(); } + @SuppressWarnings("unused") void onSessionErrorEvent(final @Observes OnSessionErrorEvent errorEvent) { if (isSameSession(errorEvent.getSession())) { executeWithConfirm(translationService.getValue(StunnerProjectClientConstants.ON_ERROR_CONFIRM_UNDO_LAST_ACTION, @@ -603,6 +512,7 @@ protected boolean isSameSession(final ClientSession other) { return null != other && null != getSession() && other.equals(getSession()); } + @Override public String getTitleText() { return title; } @@ -617,33 +527,15 @@ protected void onSave() { } else { final String message = CommonConstants.INSTANCE.NoChangesSinceLastSave(); log(Level.INFO, message); - doShowNoChangesSinceLastSaveMessage(message); + editor.doShowNoChangesSinceLastSaveMessage(message); } } - protected void doShowNoChangesSinceLastSaveMessage(final String message) { - editorProxy.showNoChangesSinceLastSaveMessage(message); - } - - protected void destroySession() { - //Release existing SessionPresenter - editorSessionPresenter.ifPresent(session -> { - session.destroy(); - editorSessionPresenter = Optional.empty(); - }); - viewerSessionPresenter.ifPresent(session -> { - session.destroy(); - viewerSessionPresenter = Optional.empty(); - }); - editorSessionPresenterInstances.destroyAll(); - viewerSessionPresenterInstances.destroyAll(); - } - protected void updateTitle(final String title) { // Change editor's title. this.title = formatTitle(title); - changeTitleNotificationEvent.fire(new ChangeTitleWidgetEvent(this.place, - this.title)); + changeTitleNotification.fire(new ChangeTitleWidgetEvent(this.place, + this.title)); } /** @@ -666,20 +558,7 @@ protected String formatTitle(final String title) { } private ClientSession getSession() { - return null != getSessionPresenter() ? getSessionPresenter().getInstance() : null; - } - - @SuppressWarnings("unchecked") - protected int getCurrentDiagramHash() { - return editorProxy.getEditorHashCode(); - } - - protected CanvasHandler getCanvasHandler() { - return null != getSession() ? getSession().getCanvasHandler() : null; - } - - protected ProjectDiagram getDiagram() { - return null != getCanvasHandler() ? (ProjectDiagram) getCanvasHandler().getDiagram() : null; + return null != editor.getSessionPresenter() ? editor.getSessionPresenter().getInstance() : null; } private void executeWithConfirm(final String message, @@ -696,126 +575,121 @@ private void executeWithConfirm(final String message, popup.show(); } - protected View getView() { - return (View) baseView; + protected AbstractProjectDiagramEditor.View getView() { + return (AbstractProjectDiagramEditor.View) baseView; } protected void onSaveSuccess() { final String message = translationService.getValue(StunnerProjectClientConstants.DIAGRAM_SAVE_SUCCESSFUL); log(Level.INFO, message); - getSessionPresenter().getView().showMessage(message); - setOriginalHash(getCurrentDiagramHash()); + editor.getSessionPresenter().getView().showMessage(message); + setOriginalHash(editor.getCurrentDiagramHash()); } - protected void onSaveError(final ClientRuntimeError error) { - showError(error); + @Override + public void open(final ProjectDiagram diagram) { + editor.open(diagram); } - private void onValidationSuccess() { - log(Level.INFO, - "Validation SUCCESS."); + @Override + public Annotation[] getDockQualifiers() { + return new Annotation[]{DefinitionManager.DEFAULT_QUALIFIER}; } - protected void onValidationFailed(final Collection> violations) { - log(Level.WARNING, - "Validation FAILED [violations=" + violations.toString() + "]"); + @Override + public void initialiseKieEditorForSession(final ProjectDiagram diagram) { + resetEditorPages(diagram.getMetadata().getOverview()); + updateTitle(diagram.getMetadata().getTitle()); + addDocumentationPage(diagram); + setOriginalHash(getCurrentDiagramHash()); hideLoadingViews(); + onDiagramLoad(); } - protected void onLoadError(final ClientRuntimeError error) { - final Throwable e = error.getThrowable(); - if (e instanceof DiagramParsingException) { - final DiagramParsingException dpe = (DiagramParsingException) e; - final Metadata metadata = dpe.getMetadata(); - final String xml = dpe.getXml(); + protected void destroySession() { + editor.destroySession(); + } - setOriginalHash(xml.hashCode()); - updateTitle(metadata.getTitle()); - resetEditorPages(((ProjectMetadata) metadata).getOverview()); - menuSessionItems.setEnabled(false); + @SuppressWarnings("unchecked") + public void addDocumentationPage(final ProjectDiagram diagram) { + Optional.ofNullable(documentationView.isEnabled()) + .filter(Boolean.TRUE::equals) + .ifPresent(enabled -> { + final String label = translationService.getValue(StunnerProjectClientConstants.DOCUMENTATION); + addPage(new DocumentationPage(documentationView.initialize(diagram), + label, + //firing the OnDiagramFocusEvent will force the docks to be minimized + () -> onDiagramFocusEvent.fire(new OnDiagramFocusEvent(getDockQualifiers())), + //check the DocumentationPage is active, the index is 2 + () -> Objects.equals(2, kieView.getSelectedTabIndex()))); + }); + } - xmlEditorView.setReadOnly(isReadOnly); - xmlEditorView.setContent(xml, AceEditorMode.XML); - getView().setWidget(xmlEditorView.asWidget()); - editorProxy = makeXmlEditorProxy(); - hideLoadingViews(); - notification.fire(new NotificationEvent(getDiagramParsingErrorMessage(dpe), - NotificationEvent.NotificationType.ERROR)); + protected void onDiagramLoad() { + /* Override this method to trigger some action after a Diagram is loaded. */ + } - Scheduler.get().scheduleDeferred(xmlEditorView::onResize); - } else { - editorProxy = ProjectDiagramEditorProxy.NULL_EDITOR; - showError(error); + @Override + public SessionEditorPresenter newSessionEditorPresenter() { + return editor.newSessionEditorPresenter(); + } - //close editor in case of error when opening the editor - placeManager.forceClosePlace(new PathPlaceRequest(versionRecordManager.getCurrentPath(), - getEditorIdentifier())); - } + @Override + public SessionViewerPresenter newSessionViewerPresenter() { + return editor.newSessionViewerPresenter(); } - protected String getDiagramParsingErrorMessage(final DiagramParsingException e) { - return translationService.getValue(DIAGRAM_PARSING_ERROR, Objects.toString(e.getMessage(), "")); + @Override + public int getCurrentDiagramHash() { + return editor.getCurrentDiagramHash(); } - protected void showError(final ClientRuntimeError error) { - diagramClientErrorHandler.handleError(error, this::showError); - log(Level.SEVERE, error.toString()); + @Override + public CanvasHandler getCanvasHandler() { + return editor.getCanvasHandler(); } - protected void showError(final String message) { - errorPopupPresenter.showMessage(message); - hideLoadingViews(); + @Override + public void onSaveError(final ClientRuntimeError error) { + editor.onSaveError(error); + } + + @Override + public SessionPresenter getSessionPresenter() { + return editor.getSessionPresenter(); + } + + @Override + public void doFocus() { + editor.doFocus(); + } + + @Override + public void doLostFocus() { + editor.doLostFocus(); } protected void log(final Level level, final String message) { if (LogConfiguration.loggingIsEnabled()) { - LOGGER.log(level, - message); + LOGGER.log(level, message); } } protected boolean hasUnsavedChanges() { - return getCurrentDiagramHash() != originalHash; + return editor.getCurrentDiagramHash() != originalHash; } protected ClientTranslationService getTranslationService() { return translationService; } + @SuppressWarnings("unused") protected void makeAdditionalStunnerMenus(final FileMenuBuilder fileMenuBuilder) { } - public SessionPresenter getSessionPresenter() { - if (editorSessionPresenter.isPresent()) { - return editorSessionPresenter.get(); - } else if (viewerSessionPresenter.isPresent()) { - return viewerSessionPresenter.get(); - } - return null; - } - - public AbstractProjectEditorMenuSessionItems getMenuSessionItems() { + public AbstractDiagramEditorMenuSessionItems getMenuSessionItems() { return menuSessionItems; } - - //For Unit Testing - protected void setEditorSessionPresenter(final SessionEditorPresenter presenter) { - this.editorSessionPresenter = Optional.ofNullable(presenter); - } - - //For Unit Testing - protected void setReadOnlySessionPresenter(final SessionViewerPresenter presenter) { - this.viewerSessionPresenter = Optional.ofNullable(presenter); - } - - public interface View extends UberView, - KieEditorView, - RequiresResize, - ProvidesResize, - IsWidget { - - void setWidget(IsWidget widget); - } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditorCore.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditorCore.java new file mode 100644 index 00000000000..2753e9030e6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditorCore.java @@ -0,0 +1,128 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.project.client.editor; + +import java.util.Collection; +import java.util.logging.Level; + +import javax.enterprise.event.Event; + +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; +import org.kie.workbench.common.stunner.core.client.error.DiagramClientErrorHandler; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.rule.RuleViolation; +import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; +import org.kie.workbench.common.stunner.core.validation.Violation; +import org.kie.workbench.common.stunner.core.validation.impl.ValidationUtils; +import org.kie.workbench.common.stunner.kogito.api.editor.KogitoDiagramResource; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorCore; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; +import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; +import org.uberfire.mvp.Command; +import org.uberfire.workbench.events.NotificationEvent; + +public abstract class AbstractProjectDiagramEditorCore, + C extends KogitoDiagramResource, P extends ProjectDiagramEditorProxy> extends AbstractDiagramEditorCore { + + public AbstractProjectDiagramEditorCore(final View baseEditorView, + final TextEditorView xmlEditorView, + final Event notificationEvent, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService) { + super(baseEditorView, + xmlEditorView, + notificationEvent, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService); + } + + protected abstract void saveOrUpdate(final String commitMessage); + + protected abstract void saveAsXML(final String commitMessage); + + @Override + @SuppressWarnings("unchecked") + public P makeStunnerEditorProxy() { + final P proxy = super.makeStunnerEditorProxy(); + proxy.setSaveAfterValidationConsumer((continueSaveOnceValid) -> { + getMenuSessionItems() + .getCommands() + .getValidateSessionCommand() + .execute(getSaveAfterValidationCallback(continueSaveOnceValid)); + }); + proxy.setSaveAfterUserConfirmationConsumer(AbstractProjectDiagramEditorCore.this::saveOrUpdate); + proxy.setShowNoChangesSinceLastSaveMessageConsumer((message) -> getSessionPresenter().getView().showMessage(message)); + + return proxy; + } + + protected ClientSessionCommand.Callback>> getSaveAfterValidationCallback(final Command continueSaveOnceValid) { + return new ClientSessionCommand.Callback>>() { + @Override + public void onSuccess() { + continueSaveOnceValid.execute(); + } + + @Override + public void onError(final Collection> violations) { + final Violation.Type maxSeverity = ValidationUtils.getMaxSeverity(violations); + if (maxSeverity.equals(Violation.Type.ERROR)) { + onValidationFailed(violations); + } else { + // Allow saving when only warnings founds. + continueSaveOnceValid.execute(); + } + } + }; + } + + @Override + public P makeXmlEditorProxy() { + final P proxy = super.makeXmlEditorProxy(); + proxy.setSaveAfterValidationConsumer(Command::execute); + proxy.setSaveAfterUserConfirmationConsumer(AbstractProjectDiagramEditorCore.this::saveAsXML); + proxy.setShowNoChangesSinceLastSaveMessageConsumer((message) -> getNotificationEvent().fire(new NotificationEvent(message))); + return proxy; + } + + public void doShowNoChangesSinceLastSaveMessage(final String message) { + getEditorProxy().showNoChangesSinceLastSaveMessage(message); + } + + void onValidationFailed(final Collection> violations) { + log(Level.WARNING, "Validation FAILED [violations=" + violations.toString() + "]"); + getBaseEditorView().hideBusyIndicator(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditorMenuItemsBuilder.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditorMenuItemsBuilder.java deleted file mode 100644 index 54a4ba837d1..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditorMenuItemsBuilder.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.project.client.editor; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.user.client.ui.IsWidget; -import org.gwtbootstrap3.client.ui.AnchorListItem; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.ButtonGroup; -import org.gwtbootstrap3.client.ui.DropDownMenu; -import org.gwtbootstrap3.client.ui.constants.ButtonSize; -import org.gwtbootstrap3.client.ui.constants.IconPosition; -import org.gwtbootstrap3.client.ui.constants.IconType; -import org.gwtbootstrap3.client.ui.constants.Pull; -import org.gwtbootstrap3.client.ui.constants.Toggle; -import org.kie.workbench.common.stunner.client.widgets.menu.MenuUtils; -import org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil; -import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; -import org.kie.workbench.common.stunner.core.i18n.CoreTranslationMessages; -import org.kie.workbench.common.stunner.project.client.resources.i18n.StunnerProjectClientConstants; -import org.uberfire.mvp.Command; -import org.uberfire.workbench.model.menu.MenuItem; - -public abstract class AbstractProjectDiagramEditorMenuItemsBuilder { - - protected final ClientTranslationService translationService; - - protected final PopupUtil popupUtil; - - protected AbstractProjectDiagramEditorMenuItemsBuilder() { - this(null, - null); - } - - public AbstractProjectDiagramEditorMenuItemsBuilder(final ClientTranslationService translationService, - final PopupUtil popupUtil) { - this.translationService = translationService; - this.popupUtil = popupUtil; - } - - public MenuItem newVisitGraphItem(final Command command) { - return buildItem(buildVisitGraphItem(command)); - } - - private IsWidget buildVisitGraphItem(final Command command) { - return MenuUtils.buildHasEnabledWidget( - new Button() {{ - setSize(ButtonSize.SMALL); - setIcon(IconType.PLAY); - setTitle(translationService.getValue(CoreTranslationMessages.VISIT_GRAPH)); - addClickHandler(clickEvent -> command.execute()); - }}); - } - - public MenuItem newSwitchGridItem(final Command command) { - return buildItem(buildSwitchGridItem(command)); - } - - private IsWidget buildSwitchGridItem(final Command command) { - return MenuUtils.buildHasEnabledWidget( - new Button() {{ - setSize(ButtonSize.SMALL); - setIcon(IconType.TH); - setTitle(translationService.getValue(CoreTranslationMessages.SWITCH_GRID)); - addClickHandler(clickEvent -> command.execute()); - }}); - } - - /** - * Builds a menu item with a clear icon and executes the given callback. - * Added alert message - the operation cannot be reverted. - * See org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand - */ - public MenuItem newClearItem(final Command command) { - return buildItem(buildClearItem(command)); - } - - private IsWidget buildClearItem(final Command command) { - return MenuUtils.buildHasEnabledWidget( - new Button() {{ - setSize(ButtonSize.SMALL); - setIcon(IconType.ERASER); - setTitle(translationService.getValue(CoreTranslationMessages.CLEAR_DIAGRAM)); - addClickHandler(clickEvent -> - AbstractProjectDiagramEditorMenuItemsBuilder.this.executeWithConfirm(command, - translationService.getValue(CoreTranslationMessages.CLEAR_DIAGRAM), - translationService.getValue(CoreTranslationMessages.CLEAR_DIAGRAM), - translationService.getValue(CoreTranslationMessages.CONFIRM_CLEAR_DIAGRAM))); - }}); - } - - public MenuItem newCopyItem(final Command command) { - return buildItem(buildCopyItem(command)); - } - - private IsWidget buildCopyItem(final Command command) { - return MenuUtils.buildHasEnabledWidget( - new Button() {{ - setSize(ButtonSize.SMALL); - setIcon(IconType.COPY); - setTitle(translationService.getValue(CoreTranslationMessages.COPY_SELECTION)); - addClickHandler(clickEvent -> command.execute()); - }}); - } - - public MenuItem newPasteItem(final Command command) { - return buildItem(buildPasteItem(command)); - } - - private IsWidget buildPasteItem(final Command command) { - return MenuUtils.buildHasEnabledWidget( - new Button() {{ - setSize(ButtonSize.SMALL); - setIcon(IconType.PASTE); - setTitle(translationService.getValue(CoreTranslationMessages.PASTE_SELECTION)); - addClickHandler(clickEvent -> command.execute()); - }}); - } - - public MenuItem newCutItem(final Command command) { - return buildItem(buildCutItem(command)); - } - - private IsWidget buildCutItem(final Command command) { - return MenuUtils.buildHasEnabledWidget( - new Button() {{ - setSize(ButtonSize.SMALL); - setIcon(IconType.CUT); - setTitle(translationService.getValue(CoreTranslationMessages.CUT_SELECTION)); - addClickHandler(clickEvent -> command.execute()); - }}); - } - - public MenuItem newDeleteSelectionItem(final Command command) { - return buildItem(buildDeleteSelectionItem(command)); - } - - private IsWidget buildDeleteSelectionItem(final Command command) { - return MenuUtils.buildHasEnabledWidget( - new Button() {{ - setSize(ButtonSize.SMALL); - setIcon(IconType.TRASH_O); - setTitle(translationService.getValue(CoreTranslationMessages.DELETE_SELECTION)); - addClickHandler(clickEvent -> command.execute()); - }}); - } - - public MenuItem newUndoItem(final Command command) { - return buildItem(buildUndoItem(command)); - } - - private IsWidget buildUndoItem(final Command command) { - return MenuUtils.buildHasEnabledWidget( - new Button() {{ - setSize(ButtonSize.SMALL); - setIcon(IconType.UNDO); - setTitle(translationService.getValue(CoreTranslationMessages.UNDO)); - addClickHandler(clickEvent -> command.execute()); - }}); - } - - public MenuItem newRedoItem(final Command command) { - return buildItem(buildRedoItem(command)); - } - - private IsWidget buildRedoItem(final Command command) { - return MenuUtils.buildHasEnabledWidget( - new Button() {{ - setSize(ButtonSize.SMALL); - setIcon(IconType.UNDO); - //Let's add the icon "manually" since the required icon is not available as IconType value. But the icon - //class is available. This assignment is ok for now, since this stuff will sooner or later be refactored to - //elemental2. - addStyleName("fa-flip-horizontal"); - setTitle(translationService.getValue(CoreTranslationMessages.REDO)); - addClickHandler(clickEvent -> command.execute()); - }}); - } - - public MenuItem newExportsItem(final Command exportPNGCommand, - final Command exportJPGCommand, - final Command exportSVGCommand, - final Command exportPDFCommand, - final Command exportAsRawCommand) { - final DropDownMenu menu = GWT.create(DropDownMenu.class); - menu.setPull(Pull.RIGHT); - - menu.add(makeExportMenuItemWidget(translationService.getValue(CoreTranslationMessages.EXPORT_PNG), - exportPNGCommand)); - menu.add(makeExportMenuItemWidget(translationService.getValue(CoreTranslationMessages.EXPORT_JPG), - exportJPGCommand)); - menu.add(makeExportMenuItemWidget(translationService.getValue(CoreTranslationMessages.EXPORT_SVG), - exportSVGCommand)); - menu.add(makeExportMenuItemWidget(translationService.getValue(CoreTranslationMessages.EXPORT_PDF), - exportPDFCommand)); - menu.add(makeExportMenuItemWidget(getExportAsRawLabel(), - exportAsRawCommand)); - - final Button button = GWT.create(Button.class); - final ButtonGroup buttonGroup = GWT.create(ButtonGroup.class); - buttonGroup.add(button); - buttonGroup.add(menu); - button.setToggleCaret(true); - button.setDataToggle(Toggle.DROPDOWN); - button.setIcon(IconType.DOWNLOAD); - button.setSize(ButtonSize.SMALL); - button.setTitle(translationService.getValue(StunnerProjectClientConstants.DOWNLOAD_DIAGRAM)); - - final IsWidget group = MenuUtils.buildHasEnabledWidget(buttonGroup, - button); - return buildItem(group); - } - - private AnchorListItem makeExportMenuItemWidget(final String caption, - final Command onClickCommand) { - final AnchorListItem exportMenuItemWidget = GWT.create(AnchorListItem.class); - exportMenuItemWidget.setIcon(IconType.FILE_IMAGE_O); - exportMenuItemWidget.setIconPosition(IconPosition.LEFT); - exportMenuItemWidget.setText(caption); - exportMenuItemWidget.setTitle(caption); - exportMenuItemWidget.addClickHandler(event -> onClickCommand.execute()); - return exportMenuItemWidget; - } - - protected abstract String getExportAsRawLabel(); - - public MenuItem newValidateItem(final Command command) { - return buildItem(buildValidateItem(command)); - } - - private IsWidget buildValidateItem(final Command command) { - return MenuUtils.buildHasEnabledWidget( - new Button() {{ - setSize(ButtonSize.SMALL); - setIcon(IconType.CHECK); - setTitle(translationService.getValue(CoreTranslationMessages.VALIDATE)); - addClickHandler(clickEvent -> command.execute()); - }}); - } - - private void executeWithConfirm(final Command command, - final String title, - final String okButtonText, - final String confirmMessage) { - popupUtil.showConfirmPopup(title, - okButtonText, - confirmMessage, - command); - } - - public static MenuItem buildItem(final IsWidget widget) { - return MenuUtils.buildItem(widget); - } - - public ClientTranslationService getTranslationService() { - return translationService; - } - - public PopupUtil getPopupUtil() { - return popupUtil; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectEditorMenuSessionItems.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectEditorMenuSessionItems.java deleted file mode 100644 index c689869215e..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectEditorMenuSessionItems.java +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.project.client.editor; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; -import java.util.function.Consumer; - -import javax.annotation.PreDestroy; - -import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; -import org.kie.workbench.common.stunner.core.client.session.ClientSession; -import org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToBpmnSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToJpgSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPdfSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPngSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToSvgSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.RedoSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.SwitchGridSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.UndoSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.ValidateSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.command.impl.VisitGraphSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; -import org.kie.workbench.common.stunner.core.rule.RuleViolation; -import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; -import org.kie.workbench.common.stunner.project.client.session.EditorSessionCommands; -import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; -import org.uberfire.mvp.Command; -import org.uberfire.workbench.model.menu.MenuItem; - -public abstract class AbstractProjectEditorMenuSessionItems { - - private final BUILDER itemsBuilder; - private final Map, MenuItem> menuItems; - private final EditorSessionCommands sessionCommands; - - private Command loadingStarts; - private Command loadingCompleted; - private Consumer errorConsumer; - - public AbstractProjectEditorMenuSessionItems(final BUILDER itemsBuilder, - final EditorSessionCommands sessionCommands) { - this.itemsBuilder = itemsBuilder; - this.sessionCommands = sessionCommands; - this.menuItems = new HashMap<>(20); - this.loadingStarts = () -> { - }; - this.loadingCompleted = () -> { - }; - this.errorConsumer = e -> { - }; - } - - public AbstractProjectEditorMenuSessionItems setLoadingStarts(final Command loadingStarts) { - this.loadingStarts = loadingStarts; - return this; - } - - public AbstractProjectEditorMenuSessionItems setLoadingCompleted(final Command loadingCompleted) { - this.loadingCompleted = loadingCompleted; - return this; - } - - public AbstractProjectEditorMenuSessionItems setErrorConsumer(final Consumer errorConsumer) { - this.errorConsumer = errorConsumer; - return this; - } - - public void populateMenu(final FileMenuBuilder menu) { - // Create the menu items. - final MenuItem clearItem = itemsBuilder.newClearItem(this::menu_clear); - menuItems.put(ClearSessionCommand.class, clearItem); - final MenuItem visitGraphItem = itemsBuilder.newVisitGraphItem(this::menu_visitGraph); - menuItems.put(VisitGraphSessionCommand.class, visitGraphItem); - final MenuItem switchGridItem = itemsBuilder.newSwitchGridItem(this::menu_switchGrid); - menuItems.put(SwitchGridSessionCommand.class, switchGridItem); - final MenuItem deleteSelectionItem = itemsBuilder.newDeleteSelectionItem(this::menu_deleteSelected); - menuItems.put(DeleteSelectionSessionCommand.class, deleteSelectionItem); - final MenuItem undoItem = itemsBuilder.newUndoItem(this::menu_undo); - menuItems.put(UndoSessionCommand.class, undoItem); - final MenuItem redoItem = itemsBuilder.newRedoItem(this::menu_redo); - menuItems.put(RedoSessionCommand.class, redoItem); - final MenuItem validateItem = itemsBuilder.newValidateItem(this::validate); - menuItems.put(ValidateSessionCommand.class, validateItem); - final MenuItem exportsItem = itemsBuilder.newExportsItem(this::export_imagePNG, - this::export_imageJPG, - this::export_imageSVG, - this::export_imagePDF, - this::export_fileBPMN); - menuItems.put(ExportToPngSessionCommand.class, exportsItem); - menuItems.put(ExportToJpgSessionCommand.class, exportsItem); - menuItems.put(ExportToSvgSessionCommand.class, exportsItem); - menuItems.put(ExportToPdfSessionCommand.class, exportsItem); - menuItems.put(ExportToBpmnSessionCommand.class, exportsItem); - final MenuItem pasteItem = itemsBuilder.newPasteItem(this::paste); - menuItems.put(PasteSelectionSessionCommand.class, pasteItem); - final MenuItem copyItem = itemsBuilder.newCopyItem(this::menu_copy); - menuItems.put(CopySelectionSessionCommand.class, copyItem); - final MenuItem cutItem = itemsBuilder.newCutItem(this::menu_cut); - menuItems.put(CutSelectionSessionCommand.class, cutItem); - - // Populate the given editor's menu builder. - menu - .addNewTopLevelMenu(clearItem) - .addNewTopLevelMenu(visitGraphItem) - .addNewTopLevelMenu(switchGridItem) - .addNewTopLevelMenu(deleteSelectionItem) - .addNewTopLevelMenu(undoItem) - .addNewTopLevelMenu(redoItem) - .addNewTopLevelMenu(validateItem) - .addNewTopLevelMenu(exportsItem) - .addNewTopLevelMenu(copyItem) - .addNewTopLevelMenu(cutItem) - .addNewTopLevelMenu(pasteItem); - } - - public void bind(final ClientSession session) { - // Bind commands to the session and set the right listeners. - sessionCommands - .bind(session) - .getCommands() - .visit((type, command) -> { - command.listen(() -> Optional.ofNullable(menuItems.get(type)).ifPresent(item -> item.setEnabled(command.isEnabled()))); - }); - // Default disabled items. - setEnabled(session instanceof EditorSession); - } - - public void setEnabled(final boolean enabled) { - setItemEnabled(ClearSessionCommand.class, enabled); - setItemEnabled(VisitGraphSessionCommand.class, enabled); - setItemEnabled(SwitchGridSessionCommand.class, enabled); - setItemEnabled(ValidateSessionCommand.class, enabled); - setItemEnabled(ExportToJpgSessionCommand.class, enabled); - setItemEnabled(ExportToPngSessionCommand.class, enabled); - setItemEnabled(ExportToSvgSessionCommand.class, enabled); - setItemEnabled(ExportToPdfSessionCommand.class, enabled); - setItemEnabled(ExportToBpmnSessionCommand.class, enabled); - - setItemEnabled(DeleteSelectionSessionCommand.class, false); - setItemEnabled(UndoSessionCommand.class, false); - setItemEnabled(RedoSessionCommand.class, false); - setItemEnabled(CopySelectionSessionCommand.class, false); - setItemEnabled(CutSelectionSessionCommand.class, false); - setItemEnabled(PasteSelectionSessionCommand.class, false); - } - - public EditorSessionCommands getCommands() { - return sessionCommands; - } - - public ClientTranslationService getTranslationService() { - return itemsBuilder.getTranslationService(); - } - - @PreDestroy - public void destroy() { - sessionCommands - .getCommands() - .visit((type, command) -> { - command.listen(null); - }); - menuItems.clear(); - loadingStarts = null; - loadingCompleted = null; - errorConsumer = null; - } - - protected void addMenuItem(final Class clazz, final MenuItem menuItem) { - this.menuItems.put(clazz, menuItem); - } - - private void validate() { - loadingStarts(); - sessionCommands.getValidateSessionCommand().execute(new ClientSessionCommand.Callback>>() { - @Override - public void onSuccess() { - loadingCompleted(); - } - - @Override - public void onError(final Collection> violations) { - AbstractProjectEditorMenuSessionItems.this.onError(violations.toString()); - } - }); - } - - public void setItemEnabled(final Class type, - final boolean enabled) { - if (menuItems.containsKey(type)) { - menuItems.get(type).setEnabled(enabled); - } - } - - public boolean isItemEnabled(final Class type) { - return menuItems.containsKey(type) && menuItems.get(type).isEnabled(); - } - - private void menu_clear() { - sessionCommands.getClearSessionCommand().execute(); - } - - private void menu_visitGraph() { - sessionCommands.getVisitGraphSessionCommand().execute(); - } - - private void menu_switchGrid() { - sessionCommands.getSwitchGridSessionCommand().execute(); - } - - private void menu_deleteSelected() { - sessionCommands.getDeleteSelectionSessionCommand().execute(); - } - - private void menu_undo() { - sessionCommands.getUndoSessionCommand().execute(); - } - - private void menu_redo() { - sessionCommands.getRedoSessionCommand().execute(); - } - - private void export_imagePNG() { - sessionCommands.getExportToPngSessionCommand().execute(); - } - - private void export_imageJPG() { - sessionCommands.getExportToJpgSessionCommand().execute(); - } - - private void export_imagePDF() { - sessionCommands.getExportToPdfSessionCommand().execute(); - } - - private void paste() { - sessionCommands.getPasteSelectionSessionCommand().execute(); - } - - private void export_imageSVG() { - sessionCommands.getExportToSvgSessionCommand().execute(); - } - - private void export_fileBPMN() { - sessionCommands.getExportToBpmnSessionCommand().execute(); - } - - private void menu_copy() { - sessionCommands.getCopySelectionSessionCommand().execute(); - } - - private void menu_cut() { - sessionCommands.getCutSelectionSessionCommand().execute(); - } - - protected void loadingStarts() { - loadingStarts.execute(); - } - - protected void loadingCompleted() { - loadingCompleted.execute(); - } - - protected void onError(final String error) { - errorConsumer.accept(error); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorProxy.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorProxy.java index 224376eca2e..f52a0fd890c 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorProxy.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,65 +17,45 @@ import java.util.Optional; import java.util.function.Consumer; -import java.util.function.Supplier; -import org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource; +import org.kie.workbench.common.stunner.kogito.api.editor.KogitoDiagramResource; +import org.kie.workbench.common.stunner.kogito.client.editor.DiagramEditorProxy; import org.uberfire.mvp.Command; -public class ProjectDiagramEditorProxy { - - static final ProjectDiagramEditorProxy NULL_EDITOR = new ProjectDiagramEditorProxy(); +public class ProjectDiagramEditorProxy extends DiagramEditorProxy { private Optional> saveAfterValidationConsumer; private Optional> saveAfterUserConfirmationConsumer; private Optional> showNoChangesSinceLastSaveMessageConsumer; - private Optional> hashCodeSupplier; - private Supplier contentSupplier = () -> null; public ProjectDiagramEditorProxy() { + super(); saveAfterValidationConsumer = Optional.empty(); saveAfterUserConfirmationConsumer = Optional.empty(); showNoChangesSinceLastSaveMessageConsumer = Optional.empty(); - hashCodeSupplier = Optional.empty(); } - void setSaveAfterValidationConsumer(final Consumer saveAfterValidationConsumer) { + public void setSaveAfterValidationConsumer(final Consumer saveAfterValidationConsumer) { this.saveAfterValidationConsumer = Optional.ofNullable(saveAfterValidationConsumer); } - void setSaveAfterUserConfirmationConsumer(final Consumer saveAfterUserConfirmationConsumer) { + public void setSaveAfterUserConfirmationConsumer(final Consumer saveAfterUserConfirmationConsumer) { this.saveAfterUserConfirmationConsumer = Optional.ofNullable(saveAfterUserConfirmationConsumer); } - void setShowNoChangesSinceLastSaveMessageConsumer(final Consumer showNoChangesSinceLastSaveMessageConsumer) { + public void setShowNoChangesSinceLastSaveMessageConsumer(final Consumer showNoChangesSinceLastSaveMessageConsumer) { this.showNoChangesSinceLastSaveMessageConsumer = Optional.ofNullable(showNoChangesSinceLastSaveMessageConsumer); } - void setHashCodeSupplier(final Supplier hashCodeSupplier) { - this.hashCodeSupplier = Optional.ofNullable(hashCodeSupplier); - } - - void saveAfterValidation(final Command command) { + public void saveAfterValidation(final Command command) { saveAfterValidationConsumer.orElse((c) -> {/*NOP*/}).accept(command); } - void saveAfterUserConfirmation(final String commitMessage) { + public void saveAfterUserConfirmation(final String commitMessage) { saveAfterUserConfirmationConsumer.orElse((s) -> {/*NOP*/}).accept(commitMessage); } - void showNoChangesSinceLastSaveMessage(final String message) { + public void showNoChangesSinceLastSaveMessage(final String message) { showNoChangesSinceLastSaveMessageConsumer.orElse((s) -> {/*NOP*/}).accept(message); } - - int getEditorHashCode() { - return hashCodeSupplier.orElse(() -> 0).get(); - } - - public Supplier getContentSupplier() { - return contentSupplier; - } - - public void setContentSupplier(final Supplier contentSupplier) { - this.contentSupplier = contentSupplier; - } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorView.html b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorView.html index 6ecffbda051..e8ad8ad67c3 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorView.html +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorView.html @@ -1,5 +1,5 @@ - - - - - - - -
-
-
-

Preview

-
-
-
-
-
-
-
-

Explorer

-
-
-
-
-
diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/screens/ProjectDiagramExplorerScreenView.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/screens/ProjectDiagramExplorerScreenView.java deleted file mode 100644 index f4f0228c846..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/screens/ProjectDiagramExplorerScreenView.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.project.client.screens; - -import javax.annotation.PreDestroy; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.IsWidget; -import org.gwtbootstrap3.client.ui.gwt.FlowPanel; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.Templated; - -@Dependent -@Templated -public class ProjectDiagramExplorerScreenView extends Composite implements ProjectDiagramExplorerScreen.View { - - @Inject - @DataField - private FlowPanel previewPanelBody; - - @Inject - @DataField - private FlowPanel explorerPanelBody; - - @Override - public ProjectDiagramExplorerScreen.View setPreviewWidget(final IsWidget widget) { - clearPreviewWidget(); - previewPanelBody.add(widget); - return this; - } - - @Override - public ProjectDiagramExplorerScreen.View clearPreviewWidget() { - previewPanelBody.clear(); - return this; - } - - @Override - public ProjectDiagramExplorerScreen.View setExplorerWidget(final IsWidget widget) { - clearExplorerWidget(); - explorerPanelBody.add(widget); - return this; - } - - @Override - public ProjectDiagramExplorerScreen.View clearExplorerWidget() { - explorerPanelBody.clear(); - return this; - } - - @Override - public ProjectDiagramExplorerScreen.View clear() { - clearPreviewWidget(); - clearExplorerWidget(); - return this; - } - - @PreDestroy - public void destroy() { - clear(); - previewPanelBody.removeFromParent(); - explorerPanelBody.removeFromParent(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/screens/ProjectDiagramPropertiesScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/screens/ProjectDiagramPropertiesScreen.java deleted file mode 100644 index 0e50125163b..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/screens/ProjectDiagramPropertiesScreen.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.project.client.screens; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.enterprise.event.Event; -import javax.enterprise.event.Observes; -import javax.inject.Inject; - -import com.google.gwt.logging.client.LogConfiguration; -import com.google.gwt.user.client.ui.IsWidget; -import org.jboss.errai.common.client.ui.ElementWrapperWidget; -import org.kie.workbench.common.stunner.core.client.api.SessionManager; -import org.kie.workbench.common.stunner.core.client.session.ClientSession; -import org.kie.workbench.common.stunner.core.client.session.event.SessionDiagramOpenedEvent; -import org.kie.workbench.common.stunner.forms.client.event.FormPropertiesOpened; -import org.kie.workbench.common.stunner.forms.client.widgets.FormPropertiesWidget; -import org.kie.workbench.common.stunner.project.client.view.ProjectScreenView; -import org.uberfire.client.annotations.WorkbenchContextId; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnOpen; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; - -/** - * The screen for the project context (includes the kie workbenches) which is included in a docked area - * and displays the formulary/ies for the selected element on the canvas. - * TODO: I18n. - */ -@Dependent -@WorkbenchScreen(identifier = ProjectDiagramPropertiesScreen.SCREEN_ID) -public class ProjectDiagramPropertiesScreen { - - private static Logger LOGGER = Logger.getLogger(ProjectDiagramPropertiesScreen.class.getName()); - public static final String SCREEN_ID = "ProjectDiagramPropertiesScreen"; - - private final FormPropertiesWidget formPropertiesWidget; - private final SessionManager clientSessionManager; - private final Event changeTitleNotificationEvent; - private final ProjectScreenView view; - - private PlaceRequest placeRequest; - private ClientSession session; - private String title = "Properties"; - private boolean open = false; - - protected ProjectDiagramPropertiesScreen() { - this(null, - null, - null, - null); - } - - @Inject - public ProjectDiagramPropertiesScreen(final FormPropertiesWidget formPropertiesWidget, - final SessionManager clientSessionManager, - final Event changeTitleNotification, - final ProjectScreenView view) { - this.formPropertiesWidget = formPropertiesWidget; - this.clientSessionManager = clientSessionManager; - this.changeTitleNotificationEvent = changeTitleNotification; - this.view = view; - } - - @PostConstruct - public void init() { - view.setWidget(ElementWrapperWidget.getWidget(formPropertiesWidget.getElement())); - } - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.placeRequest = placeRequest; - } - - @OnOpen - public void onOpen() { - log(Level.FINE, - "Opening ProjectDiagramPropertiesScreen."); - open = true; - final ClientSession current = clientSessionManager.getCurrentSession(); - handleSession(current); - } - - @OnClose - public void onClose() { - log(Level.FINE, - "Closing ProjectDiagramPropertiesScreen."); - open = false; - destroy(); - } - - @SuppressWarnings("unchecked") - private void handleSession(final ClientSession session) { - boolean done = false; - view.showLoading(); - if (null != session) { - this.session = session; - // Show the loading view. - view.showLoading(); - // Open the forms properties widget for the current session. - formPropertiesWidget - .bind(session) - .show(view::hideLoading); - done = true; - } - if (!done) { - formPropertiesWidget.unbind(); - view.hideLoading(); - this.session = null; - } - } - - private void destroy() { - formPropertiesWidget.destroy(); - session = null; - } - - @WorkbenchPartTitle - public String getTitle() { - return title; - } - - @WorkbenchPartView - public IsWidget getWidget() { - // TODO: return view.asWidget() - See ProjectScreenViewImpl TODO; - return ElementWrapperWidget.getWidget(formPropertiesWidget.getElement()); - } - - @WorkbenchContextId - public String getMyContextRef() { - return "projectDiagramPropertiesScreenContext"; - } - - void onFormPropertiesOpened(final @Observes FormPropertiesOpened propertiesOpened) { - if (null != session && session.equals(propertiesOpened.getSession())) { - updateTitle(propertiesOpened.getName()); - } - } - - void onSessionOpened(final @Observes SessionDiagramOpenedEvent event) { - if (open && !event.getSession().equals(session)) { - log(Level.FINE, - "ProjectDiagramPropertiesScreen -> Current Session Changed."); - handleSession(clientSessionManager.getCurrentSession()); - } - } - - private void updateTitle(final String title) { - // Change screen title. - ProjectDiagramPropertiesScreen.this.title = title; - changeTitleNotificationEvent.fire(new ChangeTitleWidgetEvent(placeRequest, - this.title)); - } - - private void log(final Level level, - final String message) { - if (LogConfiguration.loggingIsEnabled()) { - LOGGER.log(level, - message); - } - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/service/ClientProjectDiagramService.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/service/ClientProjectDiagramService.java index cb44a4de12a..66912b9fc5e 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/service/ClientProjectDiagramService.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/service/ClientProjectDiagramService.java @@ -79,7 +79,6 @@ public void create(final Path path, final Package projectPkg, final Optional projectType, final ServiceCallback callback) { - diagramServiceCaller.call((RemoteCallback) callback::onSuccess, (message, throwable) -> { callback.onError(createOnErrorHandler(throwable, name, projectPkg)); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/validation/ProjectClientDiagramValidator.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/validation/ProjectClientDiagramValidator.java new file mode 100644 index 00000000000..f7e0eab2932 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/validation/ProjectClientDiagramValidator.java @@ -0,0 +1,89 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.project.client.validation; + +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Objects; +import java.util.function.Consumer; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.inject.Specializes; +import javax.inject.Inject; + +import org.jboss.errai.common.client.api.Caller; +import org.kie.workbench.common.stunner.core.api.DefinitionManager; +import org.kie.workbench.common.stunner.core.client.validation.ClientDiagramValidator; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessor; +import org.kie.workbench.common.stunner.core.rule.RuleManager; +import org.kie.workbench.common.stunner.core.rule.RuleViolation; +import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; +import org.kie.workbench.common.stunner.core.validation.ModelValidator; +import org.kie.workbench.common.stunner.project.service.ProjectValidationService; + +@ApplicationScoped +@Specializes +public class ProjectClientDiagramValidator extends ClientDiagramValidator { + + private final Caller validationService; + + // CDI proxy. + protected ProjectClientDiagramValidator() { + this(null, + null, + null, + null, + null); + } + + @Inject + public ProjectClientDiagramValidator(final DefinitionManager definitionManager, + final RuleManager ruleManager, + final TreeWalkTraverseProcessor treeWalkTraverseProcessor, + final ModelValidator modelValidator, + final Caller validationService) { + super(definitionManager, + ruleManager, + treeWalkTraverseProcessor, + modelValidator); + this.validationService = validationService; + } + + @Override + public void validate(Diagram diagram, Consumer>> resultConsumer) { + super.validate(diagram, diagramElementViolations -> { + final List> violations = + (Objects.nonNull(diagramElementViolations) ? new LinkedList<>(diagramElementViolations) : new LinkedList<>()); + backendValidation(diagram, backendViolations -> { + violations.addAll(backendViolations); + resultConsumer.accept(violations); + }); + }); + } + + @SuppressWarnings("unchecked") + private void backendValidation(Diagram diagram, final Consumer>> callback) { + validationService.call(result -> callback.accept((Collection>) result), + (msg, error) -> { + callback.accept(Collections.emptyList()); + return false; + }).validate(diagram); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/view/ProjectScreenView.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/view/ProjectScreenView.java deleted file mode 100644 index 011e2b0b8fa..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/view/ProjectScreenView.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.project.client.view; - -import com.google.gwt.user.client.ui.IsWidget; - -public interface ProjectScreenView { - - ProjectScreenView setWidget(final IsWidget widget); - - ProjectScreenView showLoading(); - - ProjectScreenView hideLoading(); - - IsWidget asWidget(); -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/view/ProjectScreenViewImpl.html b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/view/ProjectScreenViewImpl.html deleted file mode 100644 index 0d440bc984e..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/view/ProjectScreenViewImpl.html +++ /dev/null @@ -1,22 +0,0 @@ - - -
-
-

Loading

-
-
-
- diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/view/ProjectScreenViewImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/view/ProjectScreenViewImpl.java deleted file mode 100644 index 89eb7c42655..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/java/org/kie/workbench/common/stunner/project/client/view/ProjectScreenViewImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.project.client.view; - -import javax.annotation.PreDestroy; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.IsWidget; -import org.jboss.errai.common.client.ui.ElementWrapperWidget; -import org.jboss.errai.ui.client.local.api.IsElement; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.Templated; - -@Dependent -@Templated -public class ProjectScreenViewImpl implements ProjectScreenView, - IsElement { - - private FlowPanel loadingPanel; - private FlowPanel widgetPanel; - - @Inject - public ProjectScreenViewImpl(final @DataField FlowPanel loadingPanel, - final @DataField FlowPanel widgetPanel) { - this.loadingPanel = loadingPanel; - this.widgetPanel = widgetPanel; - } - - @Override - public ProjectScreenView setWidget(final IsWidget widget) { - widgetPanel.clear(); - widgetPanel.add(widget); - return this; - } - - @Override - public ProjectScreenView showLoading() { - widgetPanel.setVisible(false); - loadingPanel.setVisible(true); - return this; - } - - @Override - public ProjectScreenView hideLoading() { - loadingPanel.setVisible(false); - widgetPanel.setVisible(true); - return this; - } - - @Override - public IsWidget asWidget() { - return ElementWrapperWidget.getWidget(this.getElement()); - } - - @PreDestroy - public void destroy() { - loadingPanel.removeFromParent(); - widgetPanel.removeFromParent(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/resources/org/kie/workbench/common/stunner/project/StunnerProjectClient.gwt.xml b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/resources/org/kie/workbench/common/stunner/project/StunnerProjectClient.gwt.xml index 834bc5ece3d..18cda80de57 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/resources/org/kie/workbench/common/stunner/project/StunnerProjectClient.gwt.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/main/resources/org/kie/workbench/common/stunner/project/StunnerProjectClient.gwt.xml @@ -22,6 +22,8 @@ + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/docks/StunnerDocksHandlerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/docks/StunnerDocksHandlerTest.java index 1aa1af12254..c19cc39263a 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/docks/StunnerDocksHandlerTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/docks/StunnerDocksHandlerTest.java @@ -21,7 +21,6 @@ import java.util.Collections; import java.util.Iterator; -import javax.enterprise.event.Observes; import javax.enterprise.inject.Default; import com.google.gwtmockito.GwtMockitoTestRunner; @@ -31,8 +30,8 @@ import org.junit.runner.RunWith; import org.kie.workbench.common.stunner.core.api.DefinitionManager; import org.kie.workbench.common.stunner.core.client.event.screen.ScreenMaximizedEvent; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramLoseFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramLoseFocusEvent; import org.kie.workbench.common.workbench.client.resources.i18n.DefaultWorkbenchConstants; import org.mockito.Mock; import org.uberfire.client.workbench.docks.UberfireDock; @@ -166,12 +165,4 @@ public void testOnOtherEditorMaximized() { assertFalse(handler.shouldRefreshDocks()); assertFalse(handler.shouldDisableDocks()); } - - public void onDiagramLoseFocusEvent(@Observes OnDiagramLoseFocusEvent event) { - assertTrue(handler.shouldRefreshDocks()); - - assertTrue(handler.shouldDisableDocks()); - - verify(command).execute(); - } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditorMenuItemsBuilderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditorMenuItemsBuilderTest.java deleted file mode 100644 index 37b25ce926b..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditorMenuItemsBuilderTest.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.project.client.editor; - -import java.util.List; - -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwtmockito.GwtMockito; -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.gwtbootstrap3.client.ui.AnchorListItem; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil; -import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; -import org.kie.workbench.common.stunner.core.i18n.CoreTranslationMessages; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.Mock; -import org.uberfire.mvp.Command; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class AbstractProjectDiagramEditorMenuItemsBuilderTest { - - private static final String EXPORT_RAW = "export"; - - @Mock - private Command exportPNGCommand; - - @Mock - private Command exportJPGCommand; - - @Mock - private Command exportSVGCommand; - - @Mock - private Command exportPDFCommand; - - @Mock - private Command exportAsRawCommand; - - @Mock - private ClientTranslationService translationService; - - @Mock - private PopupUtil popupUtil; - - @Mock - private AnchorListItem listItem; - - @Mock - private ClickEvent clickEvent; - - @Captor - private ArgumentCaptor listItemTextCaptor; - - @Captor - private ArgumentCaptor listItemTitleCaptor; - - @Captor - private ArgumentCaptor listItemClickHandlerCaptor; - - private AbstractProjectDiagramEditorMenuItemsBuilder menuItemsBuilder; - - @Before - public void setup() { - GwtMockito.useProviderForType(AnchorListItem.class, aClass -> listItem); - - this.menuItemsBuilder = new AbstractProjectDiagramEditorMenuItemsBuilder(translationService, popupUtil) { - @Override - protected String getExportAsRawLabel() { - return EXPORT_RAW; - } - }; - - when(translationService.getValue(anyString())).thenAnswer(i -> i.getArguments()[0].toString()); - } - - @Test - public void testExportsItem() { - menuItemsBuilder.newExportsItem(exportPNGCommand, - exportJPGCommand, - exportSVGCommand, - exportPDFCommand, - exportAsRawCommand); - - verify(listItem, - times(5)).setText(listItemTextCaptor.capture()); - final List listItemText = listItemTextCaptor.getAllValues(); - assertEquals(5, - listItemText.size()); - assertEquals(CoreTranslationMessages.EXPORT_PNG, - listItemText.get(0)); - assertEquals(CoreTranslationMessages.EXPORT_JPG, - listItemText.get(1)); - assertEquals(CoreTranslationMessages.EXPORT_SVG, - listItemText.get(2)); - assertEquals(CoreTranslationMessages.EXPORT_PDF, - listItemText.get(3)); - assertEquals(EXPORT_RAW, - listItemText.get(4)); - - verify(listItem, - times(5)).setTitle(listItemTitleCaptor.capture()); - final List listItemTitle = listItemTitleCaptor.getAllValues(); - assertEquals(5, - listItemTitle.size()); - assertEquals(CoreTranslationMessages.EXPORT_PNG, - listItemTitle.get(0)); - assertEquals(CoreTranslationMessages.EXPORT_JPG, - listItemTitle.get(1)); - assertEquals(CoreTranslationMessages.EXPORT_SVG, - listItemTitle.get(2)); - assertEquals(CoreTranslationMessages.EXPORT_PDF, - listItemTitle.get(3)); - assertEquals(EXPORT_RAW, - listItemTitle.get(4)); - - verify(listItem, - times(5)).addClickHandler(listItemClickHandlerCaptor.capture()); - final List listItemClickHandler = listItemClickHandlerCaptor.getAllValues(); - assertEquals(5, - listItemClickHandler.size()); - listItemClickHandler.get(0).onClick(clickEvent); - verify(exportPNGCommand).execute(); - listItemClickHandler.get(1).onClick(clickEvent); - verify(exportJPGCommand).execute(); - listItemClickHandler.get(2).onClick(clickEvent); - verify(exportSVGCommand).execute(); - listItemClickHandler.get(3).onClick(clickEvent); - verify(exportPDFCommand).execute(); - listItemClickHandler.get(4).onClick(clickEvent); - verify(exportAsRawCommand).execute(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditorTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditorTest.java index 3ec084ab1be..811ecd8d61a 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditorTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/AbstractProjectDiagramEditorTest.java @@ -24,6 +24,8 @@ import java.util.function.Predicate; import java.util.function.Supplier; +import javax.enterprise.event.Event; + import com.google.gwt.user.client.ui.IsWidget; import com.google.gwtmockito.GwtMockitoTestRunner; import org.guvnor.common.services.project.client.context.WorkspaceProjectContext; @@ -42,6 +44,7 @@ import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; import org.kie.workbench.common.stunner.core.api.DefinitionManager; import org.kie.workbench.common.stunner.core.client.ManagedInstanceStub; +import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; import org.kie.workbench.common.stunner.core.client.error.DiagramClientErrorHandler; import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; @@ -56,22 +59,23 @@ import org.kie.workbench.common.stunner.core.documentation.DocumentationView; import org.kie.workbench.common.stunner.core.graph.Graph; import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; -import org.kie.workbench.common.stunner.core.preferences.StunnerDiagramEditorPreferences; import org.kie.workbench.common.stunner.core.rule.RuleViolation; import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; import org.kie.workbench.common.stunner.core.validation.Violation; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramLoseFocusEvent; +import org.kie.workbench.common.stunner.kogito.api.editor.DiagramType; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramLoseFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; import org.kie.workbench.common.stunner.project.client.resources.i18n.StunnerProjectClientConstants; import org.kie.workbench.common.stunner.project.client.screens.ProjectMessagesListener; import org.kie.workbench.common.stunner.project.client.service.ClientProjectDiagramService; -import org.kie.workbench.common.stunner.project.client.session.EditorSessionCommands; import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata; -import org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource; -import org.kie.workbench.common.stunner.project.editor.impl.ProjectDiagramResourceImpl; +import org.kie.workbench.common.stunner.project.diagram.editor.ProjectDiagramResource; +import org.kie.workbench.common.stunner.project.diagram.editor.impl.ProjectDiagramResourceImpl; +import org.kie.workbench.common.stunner.project.diagram.impl.ProjectDiagramImpl; import org.kie.workbench.common.stunner.project.service.ProjectDiagramResourceService; -import org.kie.workbench.common.stunner.project.service.ProjectDiagramService; import org.kie.workbench.common.widgets.client.docks.DefaultEditorDock; import org.kie.workbench.common.widgets.client.menu.FileMenuBuilderImpl; import org.kie.workbench.common.widgets.metadata.client.KieEditorWrapperView; @@ -109,11 +113,8 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import static org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource.Type.PROJECT_DIAGRAM; -import static org.kie.workbench.common.stunner.project.editor.ProjectDiagramResource.Type.XML_DIAGRAM; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyBoolean; -import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.doAnswer; @@ -130,6 +131,9 @@ public class AbstractProjectDiagramEditorTest { private static final String TITLE = "title"; + + private static final String VIEWER_SESSION_XML = "xml"; + public static final String DOC_LABEL = "doc"; @Mock @@ -153,11 +157,6 @@ public class AbstractProjectDiagramEditorTest { @Mock protected SavePopUpPresenter savePopUpPresenter; - @Mock - protected EventSourceMock notification; - - protected Promises promises; - @Mock protected ClientProjectDiagramService clientProjectDiagramService; @@ -170,7 +169,10 @@ public class AbstractProjectDiagramEditorTest { protected ManagedInstance> sessionViewerPresenters; @Mock - protected AbstractProjectEditorMenuSessionItems projectMenuSessionItems; + protected AbstractCanvasHandler canvasHandler; + + @Mock + protected AbstractDiagramEditorMenuSessionItems projectMenuSessionItems; @Mock protected EventSourceMock onDiagramFocusEvent; @@ -179,11 +181,16 @@ public class AbstractProjectDiagramEditorTest { protected EventSourceMock onDiagramLostFocusEvent; @Mock - protected BasicFileMenuBuilder menuBuilder; + protected EventSourceMock notificationEvent; @Mock protected VersionRecordManager versionRecordManager; + @Mock + @SuppressWarnings("unused") + //This is injected into FileMenuBuilderImpl by the @InjectMocks annotation + protected BasicFileMenuBuilder menuBuilder; + @Spy @InjectMocks protected FileMenuBuilderImpl fileMenuBuilder; @@ -193,47 +200,66 @@ public class AbstractProjectDiagramEditorTest { @Mock protected WorkspaceProjectContext workbenchContext; + @Mock protected ProjectMessagesListener projectMessagesListener; + protected ClientResourceType resourceType; + @Mock protected DiagramClientErrorHandler diagramClientErrorHandler; + @Mock protected ClientTranslationService translationService; + @Mock protected AlertsButtonMenuItemBuilder alertsButtonMenuItemBuilder; + @Mock protected SessionPresenter.View sessionPresenterView; + @Mock protected EditorSession editorSession; + @Mock protected ViewerSession viewerSession; + @Mock protected ObservablePath filePath; + @Mock protected KieEditorWrapperView kieView; + @Mock protected OverviewWidgetPresenter overviewWidget; + @Mock protected TextEditorView xmlEditorView; + @Mock protected Caller projectDiagramResourceServiceCaller; - @Mock - protected StunnerDiagramEditorPreferences diagramEditorPreferences; - @Mock - protected Caller diagramServiceCaller; - protected AbstractProjectDiagramEditor presenter; @Mock protected DefaultEditorDock defaultEditorDock; - @Captor - private ArgumentCaptor> clientSessionConsumerCaptor; + + @Mock + protected DocumentationView documentationView; + @Captor protected ArgumentCaptor documentationPageCaptor; - private ArgumentCaptor clientSessionPresenterCallbackCaptor; @Mock - protected DocumentationView documentationView; + protected AbstractProjectDiagramEditorCore> presenterCore; + + protected boolean isReadOnly = false; + + protected Promises promises = new SyncPromises(); + + abstract class ClientResourceTypeMock implements ClientResourceType { + + } + + protected AbstractProjectDiagramEditor presenter; @Before @SuppressWarnings("unchecked") @@ -245,6 +271,9 @@ public void setUp() { when(sessionEditorPresenter.withPalette(anyBoolean())).thenReturn(sessionEditorPresenter); when(sessionEditorPresenter.displayNotifications(any(Predicate.class))).thenReturn(sessionEditorPresenter); when(sessionEditorPresenter.getView()).thenReturn(sessionPresenterView); + when(sessionEditorPresenter.getSession()).thenReturn(Optional.of(editorSession)); + when(editorSession.getCanvasHandler()).thenReturn(canvasHandler); + when(canvasHandler.getDiagram()).thenReturn(diagram); doAnswer(invocation -> { Diagram diagram1 = (Diagram) invocation.getArguments()[0]; SessionPresenter.SessionPresenterCallback callback = (SessionPresenter.SessionPresenterCallback) invocation.getArguments()[1]; @@ -259,6 +288,10 @@ public void setUp() { when(sessionViewerPresenter.withPalette(anyBoolean())).thenReturn(sessionViewerPresenter); when(sessionViewerPresenter.displayNotifications(any(Predicate.class))).thenReturn(sessionViewerPresenter); when(sessionViewerPresenter.getView()).thenReturn(sessionPresenterView); + when(sessionViewerPresenter.getSession()).thenReturn(Optional.of(viewerSession)); + when(viewerSession.getCanvasHandler()).thenReturn(canvasHandler); + when(canvasHandler.getDiagram()).thenReturn(diagram); + when(xmlEditorView.getContent()).thenReturn(VIEWER_SESSION_XML); doAnswer(invocation -> { Diagram diagram1 = (Diagram) invocation.getArguments()[0]; SessionPresenter.SessionPresenterCallback callback = (SessionPresenter.SessionPresenterCallback) invocation.getArguments()[1]; @@ -272,8 +305,8 @@ public void setUp() { when(getMenuSessionItems().setErrorConsumer(any(Consumer.class))).thenReturn(getMenuSessionItems()); when(getMenuSessionItems().setLoadingCompleted(any(Command.class))).thenReturn(getMenuSessionItems()); when(getMenuSessionItems().setLoadingStarts(any(Command.class))).thenReturn(getMenuSessionItems()); + resourceType = mockResourceType(); - promises = new SyncPromises(); presenter = createDiagramEditor(); presenter.init(); } @@ -289,30 +322,29 @@ protected ClientResourceType getResourceType() { return resourceType; } - protected AbstractProjectEditorMenuSessionItems getMenuSessionItems() { + protected AbstractDiagramEditorMenuSessionItems getMenuSessionItems() { return projectMenuSessionItems; } @SuppressWarnings("unchecked") protected AbstractProjectDiagramEditor createDiagramEditor() { return spy(new AbstractProjectDiagramEditor(view, - documentationView, - placeManager, - errorPopupPresenter, - changeTitleNotificationEvent, - savePopUpPresenter, - (ClientResourceTypeMock) getResourceType(), - clientProjectDiagramService, + xmlEditorView, sessionEditorPresenters, sessionViewerPresenters, - getMenuSessionItems(), onDiagramFocusEvent, onDiagramLostFocusEvent, - projectMessagesListener, + notificationEvent, + errorPopupPresenter, diagramClientErrorHandler, + documentationView, + (ClientResourceTypeMock) getResourceType(), + getMenuSessionItems(), + projectMessagesListener, translationService, - xmlEditorView, + clientProjectDiagramService, projectDiagramResourceServiceCaller) { + { docks = AbstractProjectDiagramEditorTest.this.defaultEditorDock; perspectiveManager = AbstractProjectDiagramEditorTest.this.perspectiveManagerMock; @@ -323,14 +355,43 @@ protected AbstractProjectDiagramEditor createDiagramEditor() { alertsButtonMenuItemBuilder = AbstractProjectDiagramEditorTest.this.alertsButtonMenuItemBuilder; kieView = AbstractProjectDiagramEditorTest.this.kieView; overviewWidget = AbstractProjectDiagramEditorTest.this.overviewWidget; - notification = AbstractProjectDiagramEditorTest.this.notification; - promises = AbstractProjectDiagramEditorTest.this.promises; + notification = AbstractProjectDiagramEditorTest.this.notificationEvent; + placeManager = AbstractProjectDiagramEditorTest.this.placeManager; + changeTitleNotification = AbstractProjectDiagramEditorTest.this.changeTitleNotificationEvent; + savePopUpPresenter = AbstractProjectDiagramEditorTest.this.savePopUpPresenter; } @Override - protected String getEditorIdentifier() { + protected AbstractProjectDiagramEditorCore> makeCore(final AbstractProjectDiagramEditor.View view, + final TextEditorView xmlEditorView, + final Event notificationEvent, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService) { + presenterCore = spy(super.makeCore(view, + xmlEditorView, + notificationEvent, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService)); + return presenterCore; + } + + @Override + public String getEditorIdentifier() { return null; } + + @Override + protected boolean isReadOnly() { + return AbstractProjectDiagramEditorTest.this.isReadOnly; + } }); } @@ -341,7 +402,7 @@ public void testMakeMenuBar() { doNothing().when(presenter).addDownloadMenuItem(any()); doReturn(Optional.of(mock(WorkspaceProject.class))).when(workbenchContext).getActiveWorkspaceProject(); - doReturn(promises.resolve(true)).when(projectController).canUpdateProject(any()); + when(projectController.canUpdateProject(any())).thenReturn(promises.resolve(true)); doReturn(saveAndRenameCommand).when(presenter).getSaveAndRename(); presenter.makeMenuBar(); @@ -360,7 +421,7 @@ public void testMakeMenuBar() { public void testMakeMenuBarWithoutUpdateProjectPermission() { doNothing().when(presenter).addDownloadMenuItem(any()); doReturn(Optional.of(mock(WorkspaceProject.class))).when(workbenchContext).getActiveWorkspaceProject(); - doReturn(promises.resolve(false)).when(projectController).canUpdateProject(any()); + when(projectController.canUpdateProject(any())).thenReturn(promises.resolve(false)); presenter.makeMenuBar(); @@ -399,7 +460,8 @@ public void testOpen() { verify(sessionEditorPresenter).open(eq(diagram), any(SessionPresenter.SessionPresenterCallback.class)); - verify(presenter).setOriginalHash(anyInt()); + assertEquals(diagram.hashCode(), + presenter.getCurrentDiagramHash()); verify(view).hideBusyIndicator(); //Verify Overview widget was setup. It'd be nice to just verify(presenter).resetEditorPages(..) but it is protected @@ -409,16 +471,13 @@ public void testOpen() { verify(kieView).addMainEditorPage(eq(view)); verify(kieView).addOverviewPage(eq(overviewWidget), any(com.google.gwt.user.client.Command.class)); - - verify(presenter).addDocumentationPage(diagram); - verify(presenter).onDiagramLoad(); } @Test @SuppressWarnings("unchecked") public void testCloseEditor() { SessionPresenter sessionPresenter = mock(SessionPresenter.class); - presenter.setEditorSessionPresenter(sessionEditorPresenter); + presenterCore.setEditorSessionPresenter(sessionEditorPresenter); presenter.doClose(); verify(getMenuSessionItems(), times(1)).destroy(); verify(sessionEditorPresenter, times(1)).destroy(); @@ -428,11 +487,13 @@ public void testCloseEditor() { @Test @SuppressWarnings("unchecked") public void testOpenReadOnly() { - when(presenter.isReadOnly()).thenReturn(true); + this.isReadOnly = true; + Overview overview = open(); verify(view).showLoading(); - verify(presenter).setOriginalHash(anyInt()); + assertEquals(diagram.hashCode(), + presenter.getCurrentDiagramHash()); verify(view).setWidget(eq(sessionPresenterView)); verify(sessionViewerPresenter).withToolbar(eq(false)); @@ -447,10 +508,8 @@ public void testOpenReadOnly() { verify(kieView).addOverviewPage(eq(overviewWidget), any(com.google.gwt.user.client.Command.class)); - verify(presenter).onDiagramLoad(); - assertEquals(sessionViewerPresenter, - presenter.getSessionPresenter()); + presenterCore.getSessionPresenter()); } @Test @@ -459,7 +518,8 @@ public void testOpenWithInvalidBPMNFile() { final String xml = "xml"; final Overview overview = openInvalidBPMNFile(xml); - verify(presenter).setOriginalHash(eq(xml.hashCode())); + assertEquals(VIEWER_SESSION_XML.hashCode(), + presenter.getCurrentDiagramHash()); verify(view).setWidget(any(IsWidget.class)); verify(view).hideBusyIndicator(); @@ -474,7 +534,7 @@ public void testOpenWithInvalidBPMNFile() { verify(getMenuSessionItems()).setEnabled(eq(false)); verify(xmlEditorView).setReadOnly(eq(false)); verify(xmlEditorView).setContent(eq(xml), eq(AceEditorMode.XML)); - verify(presenter).makeXmlEditorProxy(); + verify(presenterCore).makeXmlEditorProxy(); } @SuppressWarnings("unchecked") @@ -500,7 +560,7 @@ protected Overview openInvalidBPMNFile(final String xml) { presenter.loadContent(); - verify(presenter).destroySession(); + verify(presenterCore).destroySession(); return overview; } @@ -523,6 +583,7 @@ protected Overview open() { public void testIsDirty() { open(); + presenter.setOriginalHash(presenter.getCurrentDiagramHash()); assertFalse(presenter.isDirty(presenter.getCurrentDiagramHash())); presenter.setOriginalHash(~~(presenter.getCurrentDiagramHash() + 1)); assertTrue(presenter.isDirty(presenter.getCurrentDiagramHash())); @@ -532,6 +593,7 @@ public void testIsDirty() { public void testHasChanges() { open(); + presenter.setOriginalHash(presenter.getCurrentDiagramHash()); assertFalse(presenter.hasUnsavedChanges()); presenter.setOriginalHash(~~(presenter.getCurrentDiagramHash() + 1)); assertTrue(presenter.hasUnsavedChanges()); @@ -549,7 +611,7 @@ public void testStunnerSave_SaveFailed() { serviceCallback.onError(cre); - verify(presenter).onSaveError(eq(cre)); + verify(presenterCore).onSaveError(eq(cre)); final ArgumentCaptor consumerCaptor = ArgumentCaptor.forClass(Consumer.class); verify(diagramClientErrorHandler).handleError(eq(cre), consumerCaptor.capture()); @@ -562,7 +624,7 @@ public void testStunnerSave_SaveFailed() { @SuppressWarnings("unchecked") protected Overview assertBasicStunnerSaveOperation(final boolean validateSuccess) { final Overview overview = open(); - doReturn(diagram).when(presenter).getDiagram(); + doReturn(diagram).when(presenterCore).getDiagram(); EditorSessionCommands editorSessionCommands = mock(EditorSessionCommands.class); when(getMenuSessionItems().getCommands()).thenReturn(editorSessionCommands); ValidateSessionCommand validateSessionCommand = mock(ValidateSessionCommand.class); @@ -611,7 +673,6 @@ public void testStunnerSave_ValidationSuccessful() { when(translationService.getValue(eq(StunnerProjectClientConstants.DIAGRAM_SAVE_SUCCESSFUL))).thenReturn("okk"); final Overview overview = assertBasicStunnerSaveOperation(true); final ServiceCallback serviceCallback = assertSaveOperation(overview); - serviceCallback.onSuccess(diagram); final Path path = versionRecordManager.getCurrentPath(); @@ -624,7 +685,7 @@ public void testStunnerSave_ValidationSuccessful() { @SuppressWarnings("unchecked") public void testStunnerSave_ValidationUnsuccessful() { assertBasicStunnerSaveOperation(false); - verify(presenter).onValidationFailed(any(Collection.class)); + verify(presenterCore).onValidationFailed(any(Collection.class)); verify(view, atLeastOnce()).hideBusyIndicator(); } @@ -639,7 +700,7 @@ public void testXMLSave_ValidationNotRequired() { final Path path = versionRecordManager.getCurrentPath(); verify(versionRecordManager).reloadVersions(eq(path)); ArgumentCaptor notificationEventCaptor = ArgumentCaptor.forClass(NotificationEvent.class); - verify(notification, times(2)).fire(notificationEventCaptor.capture()); + verify(notificationEvent, times(2)).fire(notificationEventCaptor.capture()); final NotificationEvent notificationEvent = notificationEventCaptor.getValue(); assertEquals("ItemSavedSuccessfully", @@ -650,8 +711,7 @@ public void testXMLSave_ValidationNotRequired() { @Test public void testProxyContentSupplierWhenXmlEditorIsMade() { - - final ProjectDiagramEditorProxy editorProxy = presenter.makeXmlEditorProxy(); + final ProjectDiagramEditorProxy editorProxy = presenterCore.makeXmlEditorProxy(); final Supplier contentSupplier = editorProxy.getContentSupplier(); final String content = ""; @@ -661,29 +721,27 @@ public void testProxyContentSupplierWhenXmlEditorIsMade() { assertEquals(Optional.empty(), resource.projectDiagram()); assertEquals(Optional.of(content), resource.xmlDiagram()); - assertEquals(XML_DIAGRAM, resource.getType()); + assertEquals(DiagramType.XML_DIAGRAM, resource.getType()); } @Test public void testProxyContentSupplierWhenStunnerEditorIsMade() { - - final ProjectDiagramEditorProxy editorProxy = presenter.makeStunnerEditorProxy(); + final ProjectDiagramEditorProxy editorProxy = presenterCore.makeStunnerEditorProxy(); final Supplier contentSupplier = editorProxy.getContentSupplier(); - final ProjectDiagram diagram = mock(ProjectDiagram.class); + final ProjectDiagramImpl diagram = mock(ProjectDiagramImpl.class); - doReturn(diagram).when(presenter).getDiagram(); + doReturn(diagram).when(presenterCore).getDiagram(); final ProjectDiagramResource resource = contentSupplier.get(); assertEquals(Optional.of(diagram), resource.projectDiagram()); assertEquals(Optional.empty(), resource.xmlDiagram()); - assertEquals(PROJECT_DIAGRAM, resource.getType()); + assertEquals(DiagramType.PROJECT_DIAGRAM, resource.getType()); } @Test public void testProxyContentSupplierWhenNoEditorIsMade() { - - final Supplier contentSupplier = presenter.editorProxy.getContentSupplier(); + final Supplier contentSupplier = presenterCore.getEditorProxy().getContentSupplier(); final ProjectDiagramResource resource = contentSupplier.get(); assertNotNull(contentSupplier); @@ -692,9 +750,7 @@ public void testProxyContentSupplierWhenNoEditorIsMade() { @Test public void testGetSaveAndRenameServiceCaller() { - final Caller expectedCaller = this.projectDiagramResourceServiceCaller; - final Caller> actualCaller = presenter.getSaveAndRenameServiceCaller(); assertEquals(expectedCaller, actualCaller); @@ -702,12 +758,11 @@ public void testGetSaveAndRenameServiceCaller() { @Test public void testGetContentSupplier() { - - final ProjectDiagram expectedProjectDiagram = mock(ProjectDiagram.class); + final ProjectDiagramImpl expectedProjectDiagram = mock(ProjectDiagramImpl.class); final ProjectDiagramEditorProxy editorProxy = mock(ProjectDiagramEditorProxy.class); - final ProjectDiagramResource expectedResource = new ProjectDiagramResourceImpl(expectedProjectDiagram); + final ProjectDiagramResourceImpl expectedResource = new ProjectDiagramResourceImpl(expectedProjectDiagram); - doReturn(editorProxy).when(presenter).getEditorProxy(); + doReturn(editorProxy).when(presenterCore).getEditorProxy(); when(editorProxy.getContentSupplier()).thenReturn(() -> expectedResource); @@ -718,10 +773,9 @@ public void testGetContentSupplier() { @Test public void testGetCurrentContentHash() { - final Integer expectedContentHash = 42; - doReturn(expectedContentHash).when(presenter).getCurrentDiagramHash(); + doReturn(expectedContentHash).when(presenterCore).getCurrentDiagramHash(); final Integer actualContentHash = presenter.getCurrentContentHash(); @@ -774,7 +828,7 @@ public void testXMLSave_SaveFailed() { serviceCallback.onError(cre); - verify(presenter).onSaveError(eq(cre)); + verify(presenterCore).onSaveError(eq(cre)); final ArgumentCaptor consumerCaptor = ArgumentCaptor.forClass(Consumer.class); verify(diagramClientErrorHandler).handleError(eq(cre), consumerCaptor.capture()); @@ -823,6 +877,7 @@ public void testDocksQualifiers() { } @Test + @SuppressWarnings("unchecked") public void testAddDocumentationPage() { when(documentationView.isEnabled()).thenReturn(Boolean.TRUE); when(translationService.getValue(StunnerProjectClientConstants.DOCUMENTATION)).thenReturn(DOC_LABEL); @@ -831,12 +886,8 @@ public void testAddDocumentationPage() { presenter.addDocumentationPage(diagram); verify(translationService).getValue(StunnerProjectClientConstants.DOCUMENTATION); verify(kieView).addPage(documentationPageCaptor.capture()); - DocumentationPage documentationPage = documentationPageCaptor.getValue(); + final DocumentationPage documentationPage = documentationPageCaptor.getValue(); assertEquals(documentationPage.getDocumentationView(), documentationView); assertEquals(documentationPage.getLabel(), DOC_LABEL); } - - abstract class ClientResourceTypeMock implements ClientResourceType { - - } -} \ No newline at end of file +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorStub.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorStub.java index 3e4058daea4..24c31727e33 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorStub.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorStub.java @@ -27,8 +27,9 @@ import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; import org.kie.workbench.common.stunner.core.documentation.DocumentationView; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramLoseFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramLoseFocusEvent; import org.kie.workbench.common.stunner.project.client.screens.ProjectMessagesListener; import org.kie.workbench.common.stunner.project.client.service.ClientProjectDiagramService; import org.kie.workbench.common.stunner.project.service.ProjectDiagramResourceService; @@ -38,51 +39,54 @@ import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; import org.uberfire.ext.editor.commons.client.file.popups.SavePopUpPresenter; import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; +import org.uberfire.workbench.events.NotificationEvent; class ProjectDiagramEditorStub extends AbstractProjectDiagramEditor { static final String EDITOR_ID = "ProjectDiagramEditorStub"; public ProjectDiagramEditorStub(final View view, - final DocumentationView documentationView, - final PlaceManager placeManager, - final ErrorPopupPresenter errorPopupPresenter, - final Event changeTitleNotificationEvent, - final SavePopUpPresenter savePopUpPresenter, - final ClientResourceType resourceType, - final ClientProjectDiagramService projectDiagramServices, + final TextEditorView xmlEditorView, final ManagedInstance> editorSessionPresenterInstances, final ManagedInstance> viewerSessionPresenterInstances, - final AbstractProjectEditorMenuSessionItems menuSessionItems, final Event onDiagramFocusEvent, final Event onDiagramLostFocusEvent, - final ProjectMessagesListener projectMessagesListener, + final Event notificationEvent, + final ErrorPopupPresenter errorPopupPresenter, final DiagramClientErrorHandler diagramClientErrorHandler, + final DocumentationView documentationView, + final ClientResourceType resourceType, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ProjectMessagesListener projectMessagesListener, final ClientTranslationService translationService, - final TextEditorView xmlEditorView, - final Caller projectDiagramResourceServiceCaller) { + final ClientProjectDiagramService projectDiagramServices, + final Caller projectDiagramResourceServiceCaller, + final PlaceManager placeManager, + final Event changeTitleNotificationEvent, + final SavePopUpPresenter savePopUpPresenter) { super(view, - documentationView, - placeManager, - errorPopupPresenter, - changeTitleNotificationEvent, - savePopUpPresenter, - resourceType, - projectDiagramServices, + xmlEditorView, editorSessionPresenterInstances, viewerSessionPresenterInstances, - menuSessionItems, onDiagramFocusEvent, onDiagramLostFocusEvent, - projectMessagesListener, + notificationEvent, + errorPopupPresenter, diagramClientErrorHandler, + documentationView, + resourceType, + menuSessionItems, + projectMessagesListener, translationService, - xmlEditorView, + projectDiagramServices, projectDiagramResourceServiceCaller); + this.placeManager = placeManager; + this.changeTitleNotification = changeTitleNotificationEvent; + this.savePopUpPresenter = savePopUpPresenter; } @Override - protected String getEditorIdentifier() { + public String getEditorIdentifier() { return EDITOR_ID; } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorTest.java index cfccf764411..2438d4191f5 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorTest.java @@ -18,6 +18,8 @@ import java.util.function.Consumer; +import javax.enterprise.event.Event; + import com.google.gwtmockito.GwtMockitoTestRunner; import com.google.gwtmockito.WithClassesToStub; import org.guvnor.common.services.shared.metadata.model.Metadata; @@ -49,14 +51,17 @@ import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; import org.kie.workbench.common.stunner.core.preferences.StunnerDiagramEditorPreferences; import org.kie.workbench.common.stunner.core.preferences.StunnerPreferences; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramLoseFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramLoseFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; import org.kie.workbench.common.stunner.project.client.resources.i18n.StunnerProjectClientConstants; import org.kie.workbench.common.stunner.project.client.screens.ProjectMessagesListener; import org.kie.workbench.common.stunner.project.client.service.ClientProjectDiagramService; -import org.kie.workbench.common.stunner.project.client.session.EditorSessionCommands; import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata; +import org.kie.workbench.common.stunner.project.diagram.editor.ProjectDiagramResource; +import org.kie.workbench.common.stunner.project.diagram.impl.ProjectDiagramImpl; import org.kie.workbench.common.stunner.project.service.ProjectDiagramResourceService; import org.kie.workbench.common.widgets.client.docks.DefaultEditorDock; import org.kie.workbench.common.widgets.client.resources.i18n.CommonConstants; @@ -68,12 +73,9 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.uberfire.backend.vfs.ObservablePath; -import org.uberfire.client.mvp.PerspectiveActivity; import org.uberfire.client.mvp.PerspectiveManager; import org.uberfire.client.mvp.PlaceManager; import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; -import org.uberfire.client.workbench.events.PlaceGainFocusEvent; -import org.uberfire.client.workbench.events.PlaceHiddenEvent; import org.uberfire.client.workbench.type.ClientResourceType; import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; import org.uberfire.ext.editor.commons.client.file.popups.SavePopUpPresenter; @@ -84,6 +86,7 @@ import org.uberfire.mvp.ParameterizedCommand; import org.uberfire.mvp.PlaceRequest; import org.uberfire.mvp.impl.PathPlaceRequest; +import org.uberfire.workbench.events.NotificationEvent; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -94,7 +97,7 @@ import static org.mockito.Matchers.eq; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -152,7 +155,7 @@ public class ProjectDiagramEditorTest { private SessionPresenter.View presenterView; @Mock - private AbstractProjectEditorMenuSessionItems sessionItems; + private AbstractDiagramEditorMenuSessionItems sessionItems; @Mock private EditorSessionCommands editorSessionCommands; @@ -167,7 +170,7 @@ public class ProjectDiagramEditorTest { private ObservablePath path; @Mock - private ProjectDiagram diagram; + private ProjectDiagramImpl diagram; @Mock private Graph graph; @@ -194,7 +197,10 @@ public class ProjectDiagramEditorTest { private EventSourceMock onDiagramFocusEvent; @Mock - private EventSourceMock onDiagramLostFocusEven; + private EventSourceMock onDiagramLostFocusEvent; + + @Mock + private EventSourceMock notificationEvent; @Mock private ProjectMessagesListener projectMessagesListener; @@ -229,7 +235,9 @@ public class ProjectDiagramEditorTest { @Mock private Caller projectDiagramResourceServiceCaller; - private ProjectDiagramEditorStub tested; + private ProjectDiagramEditorStub presenter; + + private AbstractProjectDiagramEditorCore> presenterCore; @Mock private DocumentationView documentationView; @@ -279,25 +287,25 @@ public Object answer(InvocationOnMock invocationOnMock) throws Throwable { when(stunnerPreferencesRegistr.get(StunnerPreferences.class)).thenReturn(preferences); when(preferences.getDiagramEditorPreferences()).thenReturn(diagramEditorPreferences); - this.tested = new ProjectDiagramEditorStub(view, - documentationView, - placeManager, - errorPopupPresenter, - changeTitleNotificationEvent, - savePopUpPresenter, - resourceType, - projectDiagramServices, - sessionEditorPresenters, - sessionViewerPresenters, - sessionItems, - onDiagramFocusEvent, - onDiagramLostFocusEven, - projectMessagesListener, - diagramClientErrorHandler, - translationService, - xmlEditorView, - projectDiagramResourceServiceCaller - ) { + this.presenter = new ProjectDiagramEditorStub(view, + xmlEditorView, + sessionEditorPresenters, + sessionViewerPresenters, + onDiagramFocusEvent, + onDiagramLostFocusEvent, + notificationEvent, + errorPopupPresenter, + diagramClientErrorHandler, + documentationView, + resourceType, + sessionItems, + projectMessagesListener, + translationService, + projectDiagramServices, + projectDiagramResourceServiceCaller, + placeManager, + changeTitleNotificationEvent, + savePopUpPresenter) { { docks = mock(DefaultEditorDock.class); perspectiveManager = ProjectDiagramEditorTest.this.perspectiveManager; @@ -306,9 +314,31 @@ public Object answer(InvocationOnMock invocationOnMock) throws Throwable { place = placeRequest; kieView = mock(KieEditorWrapperView.class); } + + @Override + protected AbstractProjectDiagramEditorCore> makeCore(final AbstractProjectDiagramEditor.View view, + final TextEditorView xmlEditorView, + final Event notificationEvent, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService) { + presenterCore = spy(super.makeCore(view, + xmlEditorView, + notificationEvent, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService)); + return presenterCore; + } }; - tested.init(); - tested.setEditorSessionPresenter(sessionEditorPresenter); + presenter.init(); + presenterCore.setEditorSessionPresenter(sessionEditorPresenter); when(translationService.getValue(anyString())).thenAnswer(i -> i.getArguments()[0]); } @@ -316,8 +346,6 @@ public Object answer(InvocationOnMock invocationOnMock) throws Throwable { @Test @SuppressWarnings("unchecked") public void testInit() { - verify(view, - times(1)).init(eq(tested)); verify(sessionItems, times(0)).bind(eq(fullSession)); } @@ -325,7 +353,7 @@ public void testInit() { // TODO @Test @SuppressWarnings("unchecked") public void testValidateBeforeSave() { - tested.save(); + presenter.save(); verify(sessionValidateCommand, times(1)).execute(any(ClientSessionCommand.Callback.class)); } @@ -333,7 +361,7 @@ public void testValidateBeforeSave() { // TODO: @Test - versionRecordManager is not being set. @SuppressWarnings("unchecked") public void testLoadContent() { - tested.loadContent(); + presenter.loadContent(); verify(projectDiagramServices, times(1)).getByPath(eq(path), any(ServiceCallback.class)); @@ -344,7 +372,7 @@ public void testLoadContent() { public void testLoadContentError() { ArgumentCaptor callbackArgumentCaptor = forClass(ServiceCallback.class); - tested.loadContent(); + presenter.loadContent(); verify(projectDiagramServices, times(1)).getByPath(eq(path), @@ -366,80 +394,30 @@ public void testLoadContentError() { @Test public void testIsDirty() { - tested.init(); - tested.open(diagram); - assertFalse(tested.isDirty(tested.getCurrentDiagramHash())); - tested.setOriginalHash(~~(tested.getCurrentDiagramHash() + 1)); - assertTrue(tested.isDirty(tested.getCurrentDiagramHash())); + presenter.init(); + presenter.open(diagram); + assertFalse(presenter.isDirty(presenter.getCurrentDiagramHash())); + presenter.setOriginalHash(~~(presenter.getCurrentDiagramHash() + 1)); + assertTrue(presenter.isDirty(presenter.getCurrentDiagramHash())); } @Test public void testHasChanges() { - tested.init(); - tested.open(diagram); - assertFalse(tested.hasUnsavedChanges()); - tested.setOriginalHash(~~(tested.getCurrentDiagramHash() + 1)); - assertTrue(tested.hasUnsavedChanges()); - tested.setOriginalHash(~~(tested.getCurrentDiagramHash())); - assertFalse(tested.hasUnsavedChanges()); - } - - @Test - public void testOnPlaceHiddenEvent() { - PlaceHiddenEvent event = new PlaceHiddenEvent(placeRequest); - - tested.onHideDocks(event); - - verify(onDiagramLostFocusEven).fire(any(OnDiagramLoseFocusEvent.class)); - } - - @Test - public void testNotValidOnPlaceHiddenEvent() { - PlaceRequest anotherRequest = mock(PlaceRequest.class); - - when(anotherRequest.getIdentifier()).thenReturn(""); - - PlaceHiddenEvent event = new PlaceHiddenEvent(anotherRequest); - - tested.onHideDocks(event); - - verify(onDiagramLostFocusEven, - never()).fire(any(OnDiagramLoseFocusEvent.class)); - } - - @Test - public void testOnPlaceGainFocusEvent() { - PerspectiveActivity perspectiveActivity = mock(PerspectiveActivity.class); - when(perspectiveActivity.getIdentifier()).thenReturn("perspectiveId"); - when(perspectiveManager.getCurrentPerspective()).thenReturn(perspectiveActivity); - - PlaceGainFocusEvent event = new PlaceGainFocusEvent(placeRequest); - - tested.onShowDiagramEditorDocks(event); - - verify(onDiagramFocusEvent).fire(any(OnDiagramFocusEvent.class)); - } - - @Test - public void testNotValidOnPlaceGainFocusEvent() { - PlaceRequest anotherRequest = mock(PlaceRequest.class); - - when(anotherRequest.getIdentifier()).thenReturn(""); - - PlaceGainFocusEvent event = new PlaceGainFocusEvent(anotherRequest); - - tested.onShowDiagramEditorDocks(event); - - verify(onDiagramFocusEvent, - never()).fire(any(OnDiagramFocusEvent.class)); + presenter.init(); + presenter.open(diagram); + assertFalse(presenter.hasUnsavedChanges()); + presenter.setOriginalHash(~~(presenter.getCurrentDiagramHash() + 1)); + assertTrue(presenter.hasUnsavedChanges()); + presenter.setOriginalHash(~~(presenter.getCurrentDiagramHash())); + assertFalse(presenter.hasUnsavedChanges()); } @Test public void testOnSaveWithoutChanges() { - tested.open(diagram); + presenter.open(diagram); when(versionRecordManager.isCurrentLatest()).thenReturn(true); - tested.onSave(); + presenter.onSave(); verify(presenterView).showMessage(CommonConstants.INSTANCE.NoChangesSinceLastSave()); } @@ -447,14 +425,14 @@ public void testOnSaveWithoutChanges() { @Test @SuppressWarnings("unchecked") public void testOnSaveWithChanges() { - tested.open(diagram); - tested.setOriginalHash(diagram.hashCode() + 1); + presenter.open(diagram); + presenter.setOriginalHash(diagram.hashCode() + 1); doAnswer(i -> { ((ClientSessionCommand.Callback) i.getArguments()[0]).onSuccess(); return null; }).when(sessionValidateCommand).execute(any(ClientSessionCommand.Callback.class)); - tested.onSave(); + presenter.onSave(); assertOnSaveSavedDiagram(); } @@ -462,13 +440,13 @@ public void testOnSaveWithChanges() { @Test @SuppressWarnings("unchecked") public void testOnSaveRestore() { - tested.open(diagram); + presenter.open(diagram); doAnswer(i -> { ((ClientSessionCommand.Callback) i.getArguments()[0]).onSuccess(); return null; }).when(sessionValidateCommand).execute(any(ClientSessionCommand.Callback.class)); - tested.onSave(); + presenter.onSave(); assertOnSaveSavedDiagram(); } @@ -489,18 +467,18 @@ private void assertOnSaveSavedDiagram() { // TODO @Test public void testSaveWithCommitMessageOnSuccess() { - tested.save(SAVE_MESSAGE); + presenter.save(SAVE_MESSAGE); verify(view).showSaving(); verify(projectDiagramServices).saveOrUpdate(eq(path), - any(ProjectDiagram.class), + any(ProjectDiagramImpl.class), any(Metadata.class), eq(SAVE_MESSAGE), serviceCallbackCaptor.capture()); final ServiceCallback serviceCallback = serviceCallbackCaptor.getValue(); - final ProjectDiagram diagram = mock(ProjectDiagram.class); + final ProjectDiagramImpl diagram = mock(ProjectDiagramImpl.class); serviceCallback.onSuccess(diagram); verify(view).hideBusyIndicator(); @@ -510,12 +488,12 @@ public void testSaveWithCommitMessageOnSuccess() { // TODO @Test public void testSaveWithCommitMessageOnError() { - tested.save(SAVE_MESSAGE); + presenter.save(SAVE_MESSAGE); verify(view).showSaving(); verify(projectDiagramServices).saveOrUpdate(eq(path), - any(ProjectDiagram.class), + any(ProjectDiagramImpl.class), any(Metadata.class), eq(SAVE_MESSAGE), serviceCallbackCaptor.capture()); @@ -535,21 +513,21 @@ public void testSaveWithCommitMessageOnError() { @Test public void testShowLoadingViews() { - tested.showLoadingViews(); + presenter.showLoadingViews(); verify(view).showLoading(); } @Test public void testShowSavingViews() { - tested.showSavingViews(); + presenter.showSavingViews(); verify(view).showSaving(); } @Test public void testHideLoadingViews() { - tested.hideLoadingViews(); + presenter.hideLoadingViews(); verify(view).hideBusyIndicator(); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorViewTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorViewTest.java index d8f2ef0e9ce..14b11c03c01 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorViewTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectDiagramEditorViewTest.java @@ -19,15 +19,14 @@ import com.google.gwt.dom.client.Style; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwtmockito.GwtMockitoTestRunner; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.Mockito; import org.uberfire.client.workbench.widgets.listbar.ResizeFlowPanel; import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.doCallRealMethod; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; @@ -38,26 +37,26 @@ @RunWith(GwtMockitoTestRunner.class) public class ProjectDiagramEditorViewTest { - private static final int WIDTH = 10; + private Element element; - private static final int HEIGHT = 20; + private Element parentElement; + + private Style parentElementStyle; - private SimplePanel parent; private ResizeFlowPanel editorPanel; + private ProjectDiagramEditorView tested; @Before - public void setup() throws Exception { - this.parent = GWT.create(SimplePanel.class); + public void setup() { + this.element = GWT.create(Element.class); + this.parentElement = GWT.create(Element.class); + this.parentElementStyle = GWT.create(Style.class); this.editorPanel = GWT.create(ResizeFlowPanel.class); - this.tested = spy(new ProjectDiagramEditorView(editorPanel)); - when(tested.getParent()).thenReturn(parent); - when(parent.getOffsetWidth()).thenReturn(WIDTH); - when(parent.getOffsetHeight()).thenReturn(HEIGHT); - - doCallRealMethod().when(tested).onAttach(); - - parent.setWidget(tested); + this.tested = Mockito.spy(new ProjectDiagramEditorView(editorPanel)); + when(tested.getElement()).thenReturn(element); + when(element.getParentElement()).thenReturn(parentElement); + when(parentElement.getStyle()).thenReturn(parentElementStyle); } @Test @@ -70,8 +69,7 @@ public void testSetWidget() { } @Test - public void testOnResizeWithEditor() { - //Any Widget implementing RequiresResize will suffice + public void testOnResize() { tested.onResize(); verify(editorPanel).onResize(); } @@ -84,14 +82,14 @@ public void testOnAttach() { public void testOnAttach(boolean parentExists) { tested = spy(new ProjectDiagramEditorView(editorPanel)); - Element elm = mock(Element.class); - Element parentElement = mock(Element.class); - Style style = mock(Style.class); + final Element element = mock(Element.class); + final Element parentElement = mock(Element.class); + final Style style = mock(Style.class); - when(tested.getElement()).thenReturn(elm); + when(tested.getElement()).thenReturn(element); when(parentElement.getStyle()).thenReturn(style); - when(elm.getStyle()).thenReturn(style); - when(elm.getParentElement()).thenReturn(parentExists ? parentElement : null); + when(element.getStyle()).thenReturn(style); + when(element.getParentElement()).thenReturn(parentExists ? parentElement : null); tested.onAttach(); verify(tested).onAttach(); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectEditorMenuSessionItemsTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectEditorMenuSessionItemsTest.java index e30bdef85ea..fabc4d6f968 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectEditorMenuSessionItemsTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/editor/ProjectEditorMenuSessionItemsTest.java @@ -21,7 +21,9 @@ import org.junit.runner.RunWith; import org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand; -import org.kie.workbench.common.stunner.project.client.session.EditorSessionCommands; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuItemsBuilder; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; @@ -41,7 +43,7 @@ public class ProjectEditorMenuSessionItemsTest { @Mock - private AbstractProjectDiagramEditorMenuItemsBuilder itemsBuilder; + private AbstractDiagramEditorMenuItemsBuilder itemsBuilder; @Mock private EditorSessionCommands sessionCommands; @@ -49,11 +51,11 @@ public class ProjectEditorMenuSessionItemsTest { @Mock private FileMenuBuilder fileMenuBuilder; - private AbstractProjectEditorMenuSessionItems editorMenuSessionItems; + private AbstractDiagramEditorMenuSessionItems editorMenuSessionItems; - private static class TestAbstractProjectEditorMenuSessionItems extends AbstractProjectEditorMenuSessionItems { + private static class TestAbstractProjectEditorMenuSessionItems extends AbstractDiagramEditorMenuSessionItems { - public TestAbstractProjectEditorMenuSessionItems(final AbstractProjectDiagramEditorMenuItemsBuilder itemsBuilder, + public TestAbstractProjectEditorMenuSessionItems(final AbstractDiagramEditorMenuItemsBuilder itemsBuilder, final EditorSessionCommands sessionCommands) { super(itemsBuilder, sessionCommands); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/screens/ProjectDiagramExplorerScreenTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/screens/ProjectDiagramExplorerScreenTest.java deleted file mode 100644 index 4e2e618f8e5..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/screens/ProjectDiagramExplorerScreenTest.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.project.client.screens; - -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.Widget; -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.client.widgets.explorer.tree.TreeExplorer; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionDiagramPreview; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionViewer; -import org.kie.workbench.common.stunner.core.client.ManagedInstanceStub; -import org.kie.workbench.common.stunner.core.client.api.SessionManager; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.session.impl.AbstractSession; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.mockito.Mock; -import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; -import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.mocks.EventSourceMock; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.anyInt; -import static org.mockito.Mockito.anyString; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class ProjectDiagramExplorerScreenTest { - - @Mock - private SessionManager clientSessionManager; - @Mock - private TreeExplorer treeExplorer; - private ManagedInstance treeExplorers; - @Mock - private SessionDiagramPreview sessionPreview; - private ManagedInstance> sessionPreviews; - @Mock - private EventSourceMock changeTitleNotificationEvent; - @Mock - private Widget treeExplorerWidget; - @Mock - private IsWidget previewWidget; - @Mock - private AbstractSession session; - @Mock - private AbstractCanvasHandler canvasHandler; - @Mock - private Diagram diagram; - @Mock - private Metadata metadata; - @Mock - private ErrorPopupPresenter errorPopupPresenter; - @Mock - private ProjectDiagramExplorerScreen.View view; - - private ProjectDiagramExplorerScreen tested; - - @Before - @SuppressWarnings("unchecked") - public void setup() throws Exception { - when(clientSessionManager.getCurrentSession()).thenReturn(session); - when(sessionPreview.getView()).thenReturn(previewWidget); - when(sessionPreview.getInstance()).thenReturn(session); - when(treeExplorer.asWidget()).thenReturn(treeExplorerWidget); - when(session.getCanvasHandler()).thenReturn(canvasHandler); - when(canvasHandler.getDiagram()).thenReturn(diagram); - when(diagram.getMetadata()).thenReturn(metadata); - when(metadata.getTitle()).thenReturn("Diagram title"); - treeExplorers = new ManagedInstanceStub<>(treeExplorer); - sessionPreviews = new ManagedInstanceStub<>(sessionPreview); - this.tested = new ProjectDiagramExplorerScreen(clientSessionManager, - treeExplorers, - changeTitleNotificationEvent, - sessionPreviews, - errorPopupPresenter, - view); - } - - @Test - public void testView() { - assertEquals(view, - tested.getWidget()); - } - - @Test - @SuppressWarnings("unchecked") - public void testShow() { - tested.show(session); - verify(sessionPreview, - times(1)).open(eq(session), - anyInt(), - anyInt(), - any(SessionViewer.SessionViewerCallback.class)); - verify(treeExplorer, - times(1)).show(eq(canvasHandler)); - verify(changeTitleNotificationEvent, - times(1)).fire(any(ChangeTitleWidgetEvent.class)); - verify(treeExplorer, - times(0)).clear(); - verify(sessionPreview, - times(0)).clear(); - verify(errorPopupPresenter, - times(0)).showMessage(anyString()); - verify(view, - times(0)).setPreviewWidget(any(IsWidget.class)); - verify(view, - times(1)).setExplorerWidget(any(IsWidget.class)); - } - - @Test - @SuppressWarnings("unchecked") - public void testClose() { - tested.show(session); - tested.close(); - verify(sessionPreview, - times(1)).destroy(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/service/ClientProjectDiagramServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/service/ClientProjectDiagramServiceTest.java index 22aa9fa74ab..d54e7f0a4c2 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/service/ClientProjectDiagramServiceTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/service/ClientProjectDiagramServiceTest.java @@ -31,6 +31,7 @@ import org.kie.workbench.common.stunner.core.service.DiagramLookupService; import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata; +import org.kie.workbench.common.stunner.project.diagram.impl.ProjectDiagramImpl; import org.kie.workbench.common.stunner.project.service.ProjectDiagramService; import org.mockito.runners.MockitoJUnitRunner; import org.uberfire.backend.vfs.Path; @@ -54,8 +55,8 @@ protected ProjectMetadata makeTestMetadata() { } @Override - protected ProjectDiagram makeTestDiagram() { - return mock(ProjectDiagram.class); + protected ProjectDiagramImpl makeTestDiagram() { + return mock(ProjectDiagramImpl.class); } @Override diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/validation/ProjectClientDiagramValidatorTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/validation/ProjectClientDiagramValidatorTest.java new file mode 100644 index 00000000000..3b0a6a6ed63 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/validation/ProjectClientDiagramValidatorTest.java @@ -0,0 +1,93 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.project.client.validation; + +import java.util.Collection; +import java.util.Collections; +import java.util.Objects; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.core.TestingGraphMockHandler; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessor; +import org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessorImpl; +import org.kie.workbench.common.stunner.core.rule.RuleViolation; +import org.kie.workbench.common.stunner.core.util.UUID; +import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; +import org.kie.workbench.common.stunner.core.validation.ModelValidator; +import org.kie.workbench.common.stunner.core.validation.impl.ElementViolationImpl; +import org.kie.workbench.common.stunner.project.service.ProjectValidationService; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.uberfire.mocks.CallerMock; + +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class ProjectClientDiagramValidatorTest { + + private ProjectClientDiagramValidator clientDiagramValidator; + + @Mock + private TreeWalkTraverseProcessor treeWalkTraverseProcessor; + + @Mock + private ModelValidator modelValidator; + + @Mock + private ProjectValidationService validationService; + + @Mock + private Diagram diagram; + + @Mock + private Metadata metadata; + + private TestingGraphMockHandler graphTestHandler; + + private String uuid = UUID.uuid(); + + private ElementViolationImpl backendViolation; + + @Before + public void setUp() throws Exception { + this.graphTestHandler = new TestingGraphMockHandler(); + treeWalkTraverseProcessor = new TreeWalkTraverseProcessorImpl(); + backendViolation = new ElementViolationImpl.Builder().setUuid(uuid).build(); + Collection> violations = Collections.singletonList(backendViolation); + when(diagram.getName()).thenReturn("Test diagram"); + when(diagram.getMetadata()).thenReturn(metadata); + when(validationService.validate(diagram)).thenReturn(violations); + clientDiagramValidator = new ProjectClientDiagramValidator(graphTestHandler.getDefinitionManager(), + graphTestHandler.getRuleManager(), + treeWalkTraverseProcessor, + modelValidator, + new CallerMock<>(validationService)); + } + + @Test + public void validate() { + when(diagram.getGraph()).thenReturn(graphTestHandler.graph); + clientDiagramValidator.validate(diagram, result -> assertTrue(result.stream().anyMatch(v -> Objects.equals(backendViolation, v)))); + verify(validationService).validate(diagram); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/view/ProjectScreenViewImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/view/ProjectScreenViewImplTest.java deleted file mode 100644 index a361babbac1..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-project/kie-wb-common-stunner-project-client/src/test/java/org/kie/workbench/common/stunner/project/client/view/ProjectScreenViewImplTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.project.client.view; - -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; - -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -@RunWith(GwtMockitoTestRunner.class) -public class ProjectScreenViewImplTest { - - @Mock - FlowPanel widget; - @Mock - FlowPanel loadingPanel; - @Mock - FlowPanel widgetPanel; - - private ProjectScreenViewImpl tested; - - @Before - public void setup() throws Exception { - this.tested = new ProjectScreenViewImpl(loadingPanel, - widgetPanel); - } - - @Test - public void testSetWidget() { - tested.setWidget(widget); - verify(widgetPanel, - times(1)).clear(); - verify(widgetPanel, - times(1)).add(any(IsWidget.class)); - } - - @Test - public void testShowLoading() { - tested.showLoading(); - verify(widgetPanel, - times(1)).setVisible(eq(false)); - verify(loadingPanel, - times(1)).setVisible(eq(true)); - } - - @Test - public void testHideLoading() { - tested.hideLoading(); - verify(loadingPanel, - times(1)).setVisible(eq(false)); - verify(widgetPanel, - times(1)).setVisible(eq(true)); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/pom.xml index 4fdead76430..b95d1b85a52 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-extensions/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-extensions/pom.xml @@ -36,6 +36,7 @@ kie-wb-common-stunner-project kie-wb-common-stunner-svg kie-wb-common-stunner-jbpm-designer-integration + kie-wb-common-stunner-kogito \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/pom.xml index fc5aec69f9c..53330e03acd 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/pom.xml @@ -167,6 +167,13 @@ kie-soup-commons
+ + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-api + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/event/message/MessageRef.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/event/message/MessageRef.java index 55959a8cf53..8f5dd590b71 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/event/message/MessageRef.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/event/message/MessageRef.java @@ -15,6 +15,9 @@ */ package org.kie.workbench.common.stunner.bpmn.definition.property.event.message; +import java.util.Objects; + +import org.jboss.errai.common.client.api.annotations.MapsTo; import org.jboss.errai.common.client.api.annotations.Portable; import org.jboss.errai.databinding.client.api.Bindable; import org.kie.workbench.common.forms.adf.definitions.annotations.metaModel.FieldDefinition; @@ -34,12 +37,15 @@ public class MessageRef implements BPMNProperty { @FieldValue private String value; + private String structure; + public MessageRef() { - this(""); + this("", ""); } - public MessageRef(final String value) { + public MessageRef(@MapsTo("value") final String value, @MapsTo("structure") final String structure) { this.value = value; + this.structure = structure; } public String getValue() { @@ -50,17 +56,38 @@ public void setValue(final String value) { this.value = value; } - @Override - public int hashCode() { - return (null != value) ? value.hashCode() : 0; + public String getStructure() { + return structure; + } + + public void setStructure(String structure) { + this.structure = structure; } @Override public boolean equals(Object o) { - if (o instanceof MessageRef) { - MessageRef other = (MessageRef) o; - return (null != value) ? value.equals(other.value) : null == other.value; + if (this == o) { + return true; + } + if (!(o instanceof MessageRef)) { + return false; } - return false; + MessageRef that = (MessageRef) o; + return Objects.equals(getValue(), that.getValue()) && + Objects.equals(getStructure(), that.getStructure()); + } + + @Override + public int hashCode() { + return Objects.hash(getValue(), getStructure()); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("MessageRef{"); + sb.append("value='").append(value).append('\''); + sb.append(", structure='").append(structure).append('\''); + sb.append('}'); + return sb.toString(); } } \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/service/GenericServiceTaskValue.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/service/GenericServiceTaskValue.java index 3383fe50a10..c8876148060 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/service/GenericServiceTaskValue.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/service/GenericServiceTaskValue.java @@ -27,7 +27,7 @@ @Bindable public class GenericServiceTaskValue { - private static final String JAVA = "Java"; // Default value + public static final String JAVA = "Java"; // Default value private String serviceImplementation = JAVA; @@ -35,16 +35,24 @@ public class GenericServiceTaskValue { private String serviceOperation = ""; + private String inMessageStructure = ""; + + private String outMessagetructure = ""; + public GenericServiceTaskValue() { } public GenericServiceTaskValue(@MapsTo("serviceImplementation") final String serviceImplementation, @MapsTo("serviceInterface") final String serviceInterface, - @MapsTo("serviceOperation") final String serviceOperation) { + @MapsTo("serviceOperation") final String serviceOperation, + @MapsTo("inMessageStructure") final String inMessageStructure, + @MapsTo("outMessagetructure") final String outMessagetructure) { this.serviceImplementation = serviceImplementation; this.serviceInterface = serviceInterface; this.serviceOperation = serviceOperation; + this.inMessageStructure = inMessageStructure; + this.outMessagetructure = outMessagetructure; } public String getServiceImplementation() { @@ -71,20 +79,41 @@ public void setServiceOperation(String serviceOperation) { this.serviceOperation = serviceOperation; } + public String getInMessageStructure() { + return inMessageStructure; + } + + public void setInMessageStructure(String inMessageStructure) { + this.inMessageStructure = inMessageStructure; + } + + public String getOutMessagetructure() { + return outMessagetructure; + } + + public void setOutMessagetructure(String outMessagetructure) { + this.outMessagetructure = outMessagetructure; + } + @Override public String toString() { - return "GenericServiceTaskValue{" + - "serviceImplementation='" + serviceImplementation + '\'' + - ", serviceInterface='" + serviceInterface + '\'' + - ", serviceOperation='" + serviceOperation + '\'' + - '}'; + final StringBuilder sb = new StringBuilder("GenericServiceTaskValue{"); + sb.append("serviceImplementation='").append(serviceImplementation).append('\''); + sb.append(", serviceInterface='").append(serviceInterface).append('\''); + sb.append(", serviceOperation='").append(serviceOperation).append('\''); + sb.append(", inMessageStructure='").append(inMessageStructure).append('\''); + sb.append(", outMessagetructure='").append(outMessagetructure).append('\''); + sb.append('}'); + return sb.toString(); } @Override public int hashCode() { return HashUtil.combineHashCodes(Objects.hashCode(serviceImplementation), Objects.hashCode(serviceInterface), - Objects.hashCode(serviceOperation)); + Objects.hashCode(serviceOperation), + Objects.hashCode(inMessageStructure), + Objects.hashCode(outMessagetructure)); } @Override @@ -93,7 +122,9 @@ public boolean equals(Object o) { GenericServiceTaskValue other = (GenericServiceTaskValue) o; return Objects.equals(serviceImplementation, other.serviceImplementation) && Objects.equals(serviceInterface, other.serviceInterface) && - Objects.equals(serviceOperation, other.serviceOperation); + Objects.equals(serviceOperation, other.serviceOperation) && + Objects.equals(inMessageStructure, other.inMessageStructure) && + Objects.equals(outMessagetructure, other.outMessagetructure); } return false; } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/task/BusinessRuleTaskExecutionSet.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/task/BusinessRuleTaskExecutionSet.java index def869b0112..955b3bb361d 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/task/BusinessRuleTaskExecutionSet.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/task/BusinessRuleTaskExecutionSet.java @@ -63,8 +63,8 @@ public class BusinessRuleTaskExecutionSet implements BPMNPropertySet { type = ComboBoxFieldType.class ) @SelectorDataProvider( - type = SelectorDataProvider.ProviderType.REMOTE, - className = "org.kie.workbench.common.stunner.bpmn.backend.dataproviders.RuleFlowGroupFormProvider") + type = SelectorDataProvider.ProviderType.CLIENT, + className = "org.kie.workbench.common.stunner.bpmn.client.dataproviders.RuleFlowGroupFormProvider") @Valid protected RuleFlowGroup ruleFlowGroup; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/task/ReusableSubprocessTaskExecutionSet.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/task/ReusableSubprocessTaskExecutionSet.java index 37a9d4a9822..6ccece5dc11 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/task/ReusableSubprocessTaskExecutionSet.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/definition/property/task/ReusableSubprocessTaskExecutionSet.java @@ -47,10 +47,9 @@ public class ReusableSubprocessTaskExecutionSet extends BaseSubprocessTaskExecut @Property @SelectorDataProvider( - type = SelectorDataProvider.ProviderType.REMOTE, - className = "org.kie.workbench.common.stunner.bpmn.backend.dataproviders.CalledElementFormProvider") - @FormField(type = ComboBoxFieldType.class - ) + type = SelectorDataProvider.ProviderType.CLIENT, + className = "org.kie.workbench.common.stunner.bpmn.client.dataproviders.CalledElementFormProvider") + @FormField(type = ComboBoxFieldType.class) @Valid protected CalledElement calledElement; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/factory/BPMNDiagramFactoryImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/factory/BPMNDiagramFactoryImpl.java index 7f9873a1d1e..3003626da9c 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/factory/BPMNDiagramFactoryImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/factory/BPMNDiagramFactoryImpl.java @@ -20,7 +20,6 @@ import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; -import org.kie.workbench.common.stunner.core.diagram.AbstractDiagram; import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.diagram.DiagramImpl; import org.kie.workbench.common.stunner.core.diagram.Metadata; @@ -47,12 +46,11 @@ public Class getMetadataType() { } @Override - public Diagram doBuild(final String name, - final Metadata metadata, - final Graph graph) { - final AbstractDiagram result = new DiagramImpl(name, - metadata); - result.setGraph(graph); - return result; + protected Diagram doBuild(final String name, + final Metadata metadata, + final Graph graph) { + return new DiagramImpl(name, + graph, + metadata); } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/forms/dataproviders/ProcessDataEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/forms/dataproviders/ProcessDataEvent.java new file mode 100644 index 00000000000..3e28f15e24a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/forms/dataproviders/ProcessDataEvent.java @@ -0,0 +1,34 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.forms.dataproviders; + +import org.jboss.errai.common.client.api.annotations.MapsTo; +import org.jboss.errai.common.client.api.annotations.Portable; + +@Portable +public class ProcessDataEvent { + + private final String[] processIds; + + public ProcessDataEvent(final @MapsTo("processIds") String[] processIds) { + this.processIds = processIds; + } + + public String[] getProcessIds() { + return processIds; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/forms/dataproviders/RequestProcessDataEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/forms/dataproviders/RequestProcessDataEvent.java new file mode 100644 index 00000000000..67462b3ac8a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/forms/dataproviders/RequestProcessDataEvent.java @@ -0,0 +1,24 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.forms.dataproviders; + +import org.jboss.errai.common.client.api.annotations.Portable; + +@Portable +public class RequestProcessDataEvent { + +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/forms/dataproviders/RequestRuleFlowGroupDataEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/forms/dataproviders/RequestRuleFlowGroupDataEvent.java new file mode 100644 index 00000000000..c85229c3704 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/forms/dataproviders/RequestRuleFlowGroupDataEvent.java @@ -0,0 +1,24 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.forms.dataproviders; + +import org.jboss.errai.common.client.api.annotations.Portable; + +@Portable +public class RequestRuleFlowGroupDataEvent { + +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/forms/dataproviders/RuleFlowGroupDataEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/forms/dataproviders/RuleFlowGroupDataEvent.java new file mode 100644 index 00000000000..a5275dea245 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/forms/dataproviders/RuleFlowGroupDataEvent.java @@ -0,0 +1,34 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.forms.dataproviders; + +import org.jboss.errai.common.client.api.annotations.MapsTo; +import org.jboss.errai.common.client.api.annotations.Portable; + +@Portable +public class RuleFlowGroupDataEvent { + + private final String[] groupNames; + + public RuleFlowGroupDataEvent(final @MapsTo("groupNames") String[] groupNames) { + this.groupNames = groupNames; + } + + public String[] getGroupNames() { + return groupNames; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/service/ProjectType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/service/ProjectType.java index e8cb09c8786..691c9c58632 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/service/ProjectType.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/service/ProjectType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/workitem/service/WorkItemDefinitionLookupService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/workitem/service/WorkItemDefinitionLookupService.java index bab095f54e2..a169cec145e 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/workitem/service/WorkItemDefinitionLookupService.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/workitem/service/WorkItemDefinitionLookupService.java @@ -18,7 +18,9 @@ import org.jboss.errai.bus.server.annotations.Remote; import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.kogito.api.Kogito; +@Kogito @Remote public interface WorkItemDefinitionLookupService extends WorkItemDefinitionService { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnApi.gwt.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnApi.gwt.xml index 5368f65939c..53355041f1b 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnApi.gwt.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnApi.gwt.xml @@ -20,7 +20,8 @@ - + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/BPMNTestDefinitionFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/BPMNTestDefinitionFactory.java similarity index 93% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/BPMNTestDefinitionFactory.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/BPMNTestDefinitionFactory.java index be48ca489df..03ae26f0a73 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/BPMNTestDefinitionFactory.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/BPMNTestDefinitionFactory.java @@ -14,9 +14,8 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend; +package org.kie.workbench.common.stunner.bpmn; -import org.kie.workbench.common.stunner.bpmn.backend.service.diagram.WorkItemDefinitionMockRegistry; import org.kie.workbench.common.stunner.bpmn.definition.factory.BPMNDefinitionSetModelFactoryImpl; import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTask; import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTaskFactory; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/WorkItemDefinitionMockRegistry.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/WorkItemDefinitionMockRegistry.java similarity index 97% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/WorkItemDefinitionMockRegistry.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/WorkItemDefinitionMockRegistry.java index ecdd7aae470..18e5d0e9177 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/WorkItemDefinitionMockRegistry.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/WorkItemDefinitionMockRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.service.diagram; +package org.kie.workbench.common.stunner.bpmn; import java.util.Collection; import java.util.HashMap; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/definition/HashCodeAndEqualityTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/definition/HashCodeAndEqualityTest.java index d1a6277539c..44d69360c75 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/definition/HashCodeAndEqualityTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/definition/HashCodeAndEqualityTest.java @@ -311,10 +311,10 @@ public void testEndSignalEventHashCode() { @Test public void testEndMessageEventEquals() { final String MESSAGE_REF = "message ref"; - final MessageEventExecutionSet A_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF)); - final MessageEventExecutionSet B_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF)); - final MessageEventExecutionSet C_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef("Other value")); - final MessageEventExecutionSet D_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF)); + final MessageEventExecutionSet A_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF, "")); + final MessageEventExecutionSet B_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF, "")); + final MessageEventExecutionSet C_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef("Other value", "")); + final MessageEventExecutionSet D_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF, "")); final String ASSIGNMENT_INFO = "some value"; final DataIOSet A_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO)); @@ -427,10 +427,10 @@ public void IntermediateMessageEventThrowingHashCode() { @Test public void IntermediateMessageEventThrowingEquals() { final String MESSAGE_REF = "message ref"; - final MessageEventExecutionSet A_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF)); - final MessageEventExecutionSet B_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF)); - final MessageEventExecutionSet C_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef("Other value")); - final MessageEventExecutionSet D_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF)); + final MessageEventExecutionSet A_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF, "")); + final MessageEventExecutionSet B_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF, "")); + final MessageEventExecutionSet C_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef("Other value", "")); + final MessageEventExecutionSet D_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF, "")); final String ASSIGNMENT_INFO = "some value"; final DataIOSet A_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO)); @@ -513,16 +513,16 @@ public void IntermediateMessageEventCatchingEquals() { final String MESSAGE_REF = "message ref"; final CancellingMessageEventExecutionSet A_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new SLADueDate(), - new MessageRef(MESSAGE_REF)); + new MessageRef(MESSAGE_REF, "")); final CancellingMessageEventExecutionSet B_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new SLADueDate(), - new MessageRef(MESSAGE_REF)); + new MessageRef(MESSAGE_REF, "")); final CancellingMessageEventExecutionSet C_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new SLADueDate(), - new MessageRef("Other value")); + new MessageRef("Other value", "")); final CancellingMessageEventExecutionSet D_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new SLADueDate(), - new MessageRef(MESSAGE_REF)); + new MessageRef(MESSAGE_REF, "")); final String ASSIGNMENT_INFO = "some value"; final DataIOSet A_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO)); @@ -813,16 +813,16 @@ public void testStartMessageEventEquals() { final String MESSAGE_REF = "message ref"; final InterruptingMessageEventExecutionSet A_EXECUTION_SET = new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new SLADueDate(), - new MessageRef(MESSAGE_REF)); + new MessageRef(MESSAGE_REF, "")); final InterruptingMessageEventExecutionSet B_EXECUTION_SET = new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new SLADueDate(), - new MessageRef(MESSAGE_REF)); + new MessageRef(MESSAGE_REF, "")); final InterruptingMessageEventExecutionSet C_EXECUTION_SET = new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new SLADueDate(), - new MessageRef("Other value")); + new MessageRef("Other value", "")); final InterruptingMessageEventExecutionSet D_EXECUTION_SET = new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new SLADueDate(), - new MessageRef(MESSAGE_REF)); + new MessageRef(MESSAGE_REF, "")); final String ASSIGNMENT_INFO = "some value"; final DataIOSet A_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO)); @@ -2013,14 +2013,14 @@ public void testCancellingMessageEventExecutionSetEqualsAndHashCode() { .addTrueCase(new CancellingMessageEventExecutionSet(new CancelActivity(false), new SLADueDate(), new MessageRef()), new CancellingMessageEventExecutionSet(new CancelActivity(false), new SLADueDate(), new MessageRef())) - .addTrueCase(new CancellingMessageEventExecutionSet(new CancelActivity(false), new SLADueDate(), new MessageRef(MESSAGE_REF)), - new CancellingMessageEventExecutionSet(new CancelActivity(false), new SLADueDate(), new MessageRef(MESSAGE_REF))) + .addTrueCase(new CancellingMessageEventExecutionSet(new CancelActivity(false), new SLADueDate(), new MessageRef(MESSAGE_REF, "")), + new CancellingMessageEventExecutionSet(new CancelActivity(false), new SLADueDate(), new MessageRef(MESSAGE_REF, ""))) .addFalseCase(new CancellingMessageEventExecutionSet(), null) - .addFalseCase(new CancellingMessageEventExecutionSet(new CancelActivity(false), new SLADueDate(), new MessageRef(MESSAGE_REF)), - new CancellingMessageEventExecutionSet(new CancelActivity(false), new SLADueDate(), new MessageRef(MESSAGE_REF_1))) + .addFalseCase(new CancellingMessageEventExecutionSet(new CancelActivity(false), new SLADueDate(), new MessageRef(MESSAGE_REF, "")), + new CancellingMessageEventExecutionSet(new CancelActivity(false), new SLADueDate(), new MessageRef(MESSAGE_REF_1, ""))) .test(); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/definition/property/service/GenericServiceTaskValueTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/definition/property/service/GenericServiceTaskValueTest.java index 40e873a52a3..ba49e1318a5 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/definition/property/service/GenericServiceTaskValueTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/definition/property/service/GenericServiceTaskValueTest.java @@ -23,11 +23,12 @@ public class GenericServiceTaskValueTest { @Test public void testConstructor() { - GenericServiceTaskValue a = new GenericServiceTaskValue("aaa", "bbb", "ccc"); + GenericServiceTaskValue a = new GenericServiceTaskValue("aaa", "bbb", "ccc", "ddd", "eee"); Assert.assertEquals("aaa", a.getServiceImplementation()); Assert.assertEquals("bbb", a.getServiceInterface()); Assert.assertEquals("ccc", a.getServiceOperation()); - + Assert.assertEquals("ddd", a.getInMessageStructure()); + Assert.assertEquals("eee", a.getOutMessagetructure()); } @@ -55,7 +56,8 @@ public void setAndGetServiceOperation() { @Test public void testToString() { GenericServiceTaskValue a = new GenericServiceTaskValue(); - Assert.assertEquals("GenericServiceTaskValue{serviceImplementation='Java', serviceInterface='', serviceOperation=''}", a.toString()); + Assert.assertEquals("GenericServiceTaskValue{serviceImplementation='Java', serviceInterface='', " + + "serviceOperation='', inMessageStructure='', outMessagetructure=''}", a.toString()); } @Test diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/factory/BPMNDiagramFactoryImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/factory/BPMNDiagramFactoryImplTest.java index de1b3fd89ca..b36e957b195 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/factory/BPMNDiagramFactoryImplTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/test/java/org/kie/workbench/common/stunner/bpmn/factory/BPMNDiagramFactoryImplTest.java @@ -70,8 +70,8 @@ public void testTypes() { @SuppressWarnings("unchecked") public void testBuild() { final Diagram diagram = tested.build(NAME, - metadata, - graph); + metadata, + graph); assertNotNull(diagram); assertEquals(NAME, diagram.getName()); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/pom.xml index 8f485c48128..302e4d19b3f 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/pom.xml @@ -62,11 +62,6 @@ kie-wb-common-stunner-bpmn-api - - org.kie.soup - kie-soup-project-datamodel-api - - org.kie.workbench.forms kie-wb-common-forms-api @@ -82,46 +77,16 @@ kie-wb-common-dynamic-forms-api - - org.kie.workbench.forms - kie-wb-common-dynamic-forms-backend - - org.kie.workbench.stunner kie-wb-common-stunner-forms-api - - org.kie.workbench.stunner - kie-wb-common-stunner-forms-backend - - - - org.kie.workbench.services - kie-wb-common-refactoring-api - - - - org.kie.workbench.services - kie-wb-common-refactoring-backend - - - - org.kie.workbench.services - kie-wb-common-services-backend - - org.kie.workbench.services kie-wb-common-services-api - - org.kie.workbench.services - kie-wb-common-data-modeller-core - - org.uberfire uberfire-project-api @@ -233,16 +198,6 @@ kie-internal - - - org.kie.workbench.services - kie-wb-common-datamodel-api - - - org.kie.workbench.services - kie-wb-common-datamodel-backend - - org.jbpm @@ -364,10 +319,10 @@ - org.kie.workbench.services - kie-wb-common-refactoring-backend - tests + org.kie.workbench.stunner + kie-wb-common-stunner-bpmn-api test + test-jar diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/BPMNDirectDiagramMarshaller.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/BPMNDirectDiagramMarshaller.java index 545a9d7a894..4b138e847e1 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/BPMNDirectDiagramMarshaller.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/BPMNDirectDiagramMarshaller.java @@ -22,8 +22,8 @@ import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; import org.kie.workbench.common.stunner.bpmn.backend.converters.TypedFactoryManager; import org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.DefinitionResolver; -import org.kie.workbench.common.stunner.bpmn.backend.workitem.service.WorkItemDefinitionBackendService; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; +import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; import org.kie.workbench.common.stunner.core.api.DefinitionManager; import org.kie.workbench.common.stunner.core.api.FactoryManager; import org.kie.workbench.common.stunner.core.backend.service.XMLEncoderDiagramMetadataMarshaller; @@ -39,7 +39,7 @@ public BPMNDirectDiagramMarshaller( final XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller, final DefinitionManager definitionManager, final RuleManager ruleManager, - final WorkItemDefinitionBackendService workItemDefinitionService, + final WorkItemDefinitionLookupService workItemDefinitionService, final FactoryManager factoryManager, final GraphCommandFactory commandFactory, final GraphCommandManager commandManager) { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/BaseDirectDiagramMarshaller.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/BaseDirectDiagramMarshaller.java index f890bcd168c..418e61f3900 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/BaseDirectDiagramMarshaller.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/BaseDirectDiagramMarshaller.java @@ -51,7 +51,7 @@ import org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.GraphBuilder; import org.kie.workbench.common.stunner.bpmn.backend.resource.JBPMBpmn2Resource; import org.kie.workbench.common.stunner.bpmn.backend.resource.JBPMBpmn2ResourceFactory; -import org.kie.workbench.common.stunner.bpmn.backend.workitem.service.WorkItemDefinitionBackendService; +import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; import org.kie.workbench.common.stunner.core.api.DefinitionManager; import org.kie.workbench.common.stunner.core.api.FactoryManager; import org.kie.workbench.common.stunner.core.backend.service.XMLEncoderDiagramMetadataMarshaller; @@ -71,6 +71,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/* + * "Direct" in the name "BaseDirectDiagramMarshaller" means "skipping json encoding". + * The old BPMNDiagramMarshaller went through an additional step converting XML into JSON for legacy reasons. + * The reason for the new version, beside a necessary spring cleaning, was to remove this extra step. + * So the new version is "Direct" as in "it doesn't go through the extra step". + * + */ public abstract class BaseDirectDiagramMarshaller implements DiagramMarshaller> { private static final Logger LOG = LoggerFactory.getLogger(BaseDirectDiagramMarshaller.class); @@ -78,7 +85,7 @@ public abstract class BaseDirectDiagramMarshaller implements DiagramMarshaller, ?> n) { p.setDocumentation(general.getDocumentation().getValue()); p.setAbsoluteBounds(n); p.setSimulationSet(definition.getSimulationSet()); - - p.setServiceInterface(executionSet.getGenericServiceTaskInfo() - .getValue() - .getServiceInterface()); - p.setServiceImplementation(executionSet.getGenericServiceTaskInfo() - .getValue() - .getServiceImplementation()); - p.setServiceOperation(executionSet.getGenericServiceTaskInfo() - .getValue() - .getServiceOperation()); + p.setValue(executionSet.getGenericServiceTaskInfo() + .getValue()); p.setAsync(executionSet.getIsAsync().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/EndEventConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/EndEventConverter.java index c098b93f022..e0f2ba5036a 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/EndEventConverter.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/EndEventConverter.java @@ -115,7 +115,8 @@ private BpmnNode messageEventDefinition(EndEvent event, MessageEventDefinition e )); definition.setExecutionSet(new MessageEventExecutionSet( - new MessageRef(EventDefinitionReader.messageRefOf(e)) + new MessageRef(EventDefinitionReader.messageRefOf(e), + EventDefinitionReader.messageRefStructureOf(e)) )); node.getContent().setBounds(p.getBounds()); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/IntermediateCatchEventConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/IntermediateCatchEventConverter.java index 2523af2bfbb..eac2f9b13eb 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/IntermediateCatchEventConverter.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/IntermediateCatchEventConverter.java @@ -266,7 +266,8 @@ private Result messageEvent(CatchEvent event, MessageEventDefinition e new CancellingMessageEventExecutionSet( new CancelActivity(p.isCancelActivity()), new SLADueDate(p.getSlaDueDate()), - new MessageRef(EventDefinitionReader.messageRefOf(e)) + new MessageRef(EventDefinitionReader.messageRefOf(e), + EventDefinitionReader.messageRefStructureOf(e)) ) ); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/IntermediateThrowEventConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/IntermediateThrowEventConverter.java index 3c4fcac0582..a6d586b1440 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/IntermediateThrowEventConverter.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/IntermediateThrowEventConverter.java @@ -110,7 +110,8 @@ private BpmnNode messageEvent( )); definition.setExecutionSet(new MessageEventExecutionSet( - new MessageRef(EventDefinitionReader.messageRefOf(eventDefinition)) + new MessageRef(EventDefinitionReader.messageRefOf(eventDefinition), + EventDefinitionReader.messageRefStructureOf(eventDefinition)) )); node.getContent().setBounds(p.getBounds()); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/StartEventConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/StartEventConverter.java index 72591060c04..cb8139bb4d6 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/StartEventConverter.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/events/StartEventConverter.java @@ -286,7 +286,8 @@ private BpmnNode messageEvent(StartEvent event, MessageEventDefinition e) { IsInterrupting isInterrupting = new IsInterrupting(event.isIsInterrupting()); SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate()); - MessageRef messageRef = new MessageRef(EventDefinitionReader.messageRefOf(e)); + MessageRef messageRef = new MessageRef(EventDefinitionReader.messageRefOf(e), + EventDefinitionReader.messageRefStructureOf(e)); InterruptingMessageEventExecutionSet executionSet = new InterruptingMessageEventExecutionSet(isInterrupting, slaDueDate, messageRef); definition.setExecutionSet(executionSet); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/AssignmentsInfos.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/AssignmentsInfos.java index 8197058bbd0..f0994c91f53 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/AssignmentsInfos.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/AssignmentsInfos.java @@ -19,6 +19,7 @@ import java.util.HashSet; import java.util.List; import java.util.Objects; +import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -26,6 +27,8 @@ import org.eclipse.bpmn2.DataInputAssociation; import org.eclipse.bpmn2.DataOutput; import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.ItemDefinition; import org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.AssociationDeclaration; import org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.AssociationList; import org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.CustomAttribute; @@ -33,6 +36,7 @@ import org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo; import org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.VariableDeclaration; import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.kie.workbench.common.stunner.core.util.StringUtils; import static java.util.Arrays.asList; @@ -104,7 +108,7 @@ private static DeclarationList dataInputDeclarations(List dataInputs) .filter(o -> !isReservedDeclaration(o)) .map(in -> new VariableDeclaration( in.getName(), - CustomAttribute.dtype.of(in).get())) + getDataType(in))) .collect(Collectors.toList())); } @@ -113,10 +117,24 @@ private static DeclarationList dataOutputDeclarations(List dataOutpu dataOutputs.stream() .map(out -> new VariableDeclaration( out.getName(), - CustomAttribute.dtype.of(out).get())) + getDataType(out))) .collect(Collectors.toList())); } + /** Returns the Data Type based on the CustomAttribute dtype and in case it does not exist use the ItemSubjectRef. + * @param element the Data Input/Output element + * @return the given element type + */ + private static String getDataType(ItemAwareElement element) { + return Optional + .ofNullable(CustomAttribute.dtype.of(element).get()) + .filter(StringUtils::nonEmpty) + .orElseGet(() -> Optional + .ofNullable(element.getItemSubjectRef()) + .map(ItemDefinition::getStructureRef) + .orElse("")); + } + private static List inAssociationDeclarations(List inputAssociations) { return inputAssociations .stream() diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/EventDefinitionReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/EventDefinitionReader.java index 349ef012fbd..ff8b450cf42 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/EventDefinitionReader.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/EventDefinitionReader.java @@ -24,6 +24,7 @@ import org.eclipse.bpmn2.ErrorEventDefinition; import org.eclipse.bpmn2.Escalation; import org.eclipse.bpmn2.EscalationEventDefinition; +import org.eclipse.bpmn2.ItemDefinition; import org.eclipse.bpmn2.Message; import org.eclipse.bpmn2.MessageEventDefinition; @@ -41,6 +42,13 @@ public static String messageRefOf(MessageEventDefinition e) { .orElse(""); } + public static String messageRefStructureOf(MessageEventDefinition e) { + return Optional.ofNullable(e.getMessageRef()) + .map(Message::getItemRef) + .map(ItemDefinition::getStructureRef) + .orElse(""); + } + public static String escalationRefOf(EscalationEventDefinition e) { return Optional.ofNullable(e.getEscalationRef()) .map(Escalation::getEscalationCode) diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/GenericServiceTaskPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/GenericServiceTaskPropertyReader.java index edf3c76cf2e..131c53838af 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/GenericServiceTaskPropertyReader.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/GenericServiceTaskPropertyReader.java @@ -16,15 +16,24 @@ package org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties; +import java.util.Optional; + +import org.eclipse.bpmn2.Interface; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.Operation; import org.eclipse.bpmn2.ServiceTask; import org.eclipse.bpmn2.di.BPMNDiagram; import org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.CustomAttribute; import org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.CustomElement; import org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.DefinitionResolver; import org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue; +import org.kie.workbench.common.stunner.core.util.StringUtils; public class GenericServiceTaskPropertyReader extends MultipleInstanceActivityPropertyReader { + public static final String JAVA = GenericServiceTaskValue.JAVA; + public static final String WEB_SERVICE = "WebService"; private final ServiceTask task; public GenericServiceTaskPropertyReader(ServiceTask task, BPMNDiagram diagram, DefinitionResolver definitionResolver) { @@ -34,22 +43,53 @@ public GenericServiceTaskPropertyReader(ServiceTask task, BPMNDiagram diagram, D public GenericServiceTaskValue getGenericServiceTask() { GenericServiceTaskValue value = new GenericServiceTaskValue(); - if (CustomAttribute.serviceImplementation.of(task).get() != null) { - String candidate = CustomAttribute.serviceImplementation.of(task).get(); - if (!candidate.equals("Java")) { - candidate = "WebService"; - } - value.setServiceImplementation(candidate); - } - if (CustomAttribute.serviceOperation.of(task).get() != null) { - value.setServiceOperation(CustomAttribute.serviceOperation.of(task).get()); - } - if (CustomAttribute.serviceInterface.of(task).get() != null) { - value.setServiceInterface(CustomAttribute.serviceInterface.of(task).get()); - } + final String implementation = Optional.ofNullable(CustomAttribute.serviceImplementation.of(task).get()) + .filter(StringUtils::nonEmpty) + .orElseGet(() -> task.getImplementation()); + value.setServiceImplementation(getServiceImplementation(implementation)); + + final String operation = Optional.ofNullable(CustomAttribute.serviceOperation.of(task).get()) + .filter(StringUtils::nonEmpty) + .orElseGet(() -> Optional + .ofNullable(task.getOperationRef()) + .map(Operation::getName) + .orElse(null)); + value.setServiceOperation(operation); + + value.setInMessageStructure(Optional.ofNullable(task.getOperationRef()) + .map(Operation::getInMessageRef) + .map(Message::getItemRef) + .map(ItemDefinition::getStructureRef) + .orElse(null)); + + value.setOutMessagetructure(Optional.ofNullable(task.getOperationRef()) + .map(Operation::getOutMessageRef) + .map(Message::getItemRef) + .map(ItemDefinition::getStructureRef) + .orElse(null)); + + final String serviceInterface = Optional.ofNullable(CustomAttribute.serviceInterface.of(task).get()) + .filter(StringUtils::nonEmpty) + .orElseGet(() -> Optional + .ofNullable(task.getOperationRef()) + .map(Operation::eContainer) + .filter(container -> container instanceof Interface) + .map(container -> (Interface) container) + .map(Interface::getName) + .orElse(null)); + value.setServiceInterface(serviceInterface); + return value; } + public static String getServiceImplementation(String implementation) { + return Optional.ofNullable(implementation) + .filter(StringUtils::nonEmpty) + .filter(impl -> JAVA.equalsIgnoreCase(impl)) + .map(java -> JAVA)//assert that matches "Java" + .orElse(WEB_SERVICE); + } + public boolean isAsync() { return CustomElement.async.of(element).get(); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/tasks/BaseTaskConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/tasks/BaseTaskConverter.java index de3800f8c16..61300e9cdbd 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/tasks/BaseTaskConverter.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/tasks/BaseTaskConverter.java @@ -317,9 +317,11 @@ private BpmnNode defaultTaskResolver(Task task) { .orElseGet(() -> noneTask(task)); } - private BpmnNode serviceTaskResolver(org.eclipse.bpmn2.Task task) { - if (StringUtils.nonEmpty(CustomAttribute.serviceImplementation.of(task).get())) { - return bpmnServiceTask((org.eclipse.bpmn2.ServiceTask) task); + private BpmnNode serviceTaskResolver(final Task task) { + org.eclipse.bpmn2.ServiceTask serviceTask = (org.eclipse.bpmn2.ServiceTask) task; + if (StringUtils.nonEmpty(CustomAttribute.serviceImplementation.of(task).get()) + || StringUtils.nonEmpty(serviceTask.getImplementation())) { + return bpmnServiceTask(serviceTask); } else { return jbpmServiceTask(task); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/dataproviders/AbstractCalledElementFormProvider.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/dataproviders/AbstractCalledElementFormProvider.java deleted file mode 100644 index b2a6b9d210b..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/dataproviders/AbstractCalledElementFormProvider.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.bpmn.backend.dataproviders; - -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; - -import javax.inject.Inject; - -import org.kie.soup.commons.util.Sets; -import org.kie.workbench.common.forms.dynamic.model.config.SelectorData; -import org.kie.workbench.common.forms.dynamic.model.config.SelectorDataProvider; -import org.kie.workbench.common.forms.dynamic.service.shared.FormRenderingContext; -import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueIndexTerm; -import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueResourceIndexTerm; -import org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow; -import org.kie.workbench.common.services.refactoring.service.RefactoringQueryService; -import org.kie.workbench.common.services.refactoring.service.ResourceType; -import org.uberfire.backend.vfs.Path; - -public abstract class AbstractCalledElementFormProvider implements SelectorDataProvider { - - @Inject - protected RefactoringQueryService queryService; - - @Override - public String getProviderName() { - return getClass().getSimpleName(); - } - - public void setQueryService(RefactoringQueryService queryService) { - this.queryService = queryService; - } - - @Override - public SelectorData getSelectorData(FormRenderingContext context) { - return new SelectorData(getBusinessProcessIDs(), - null); - } - - public Map getBusinessProcessIDs() { - final Set queryTerms = new Sets.Builder() - .add(new ValueResourceIndexTerm("*", - getProcessIdResourceType(), - ValueIndexTerm.TermSearchType.WILDCARD)) - .build(); - - List results = queryService.query( - getQueryName(), - queryTerms); - - Map businessProcessIDs = new TreeMap<>(); - - for (RefactoringPageRow row : results) { - Map mapRow = (Map) row.getValue(); - for (String rKey : mapRow.keySet()) { - businessProcessIDs.put(rKey, - rKey); - } - } - - return businessProcessIDs; - } - - protected abstract ResourceType getProcessIdResourceType(); - - protected abstract String getQueryName(); -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/dataproviders/CalledElementFormProvider.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/dataproviders/CalledElementFormProvider.java deleted file mode 100644 index ddf62911df5..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/dataproviders/CalledElementFormProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.bpmn.backend.dataproviders; - -import org.kie.workbench.common.services.refactoring.service.ResourceType; -import org.kie.workbench.common.stunner.bpmn.backend.query.FindBpmnProcessIdsQuery; - -public class CalledElementFormProvider extends AbstractCalledElementFormProvider { - - @Override - protected ResourceType getProcessIdResourceType() { - return ResourceType.BPMN2; - } - - @Override - protected String getQueryName() { - return FindBpmnProcessIdsQuery.NAME; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/dataproviders/RuleFlowGroupFormProvider.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/dataproviders/RuleFlowGroupFormProvider.java deleted file mode 100644 index defd6e8c48b..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/dataproviders/RuleFlowGroupFormProvider.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.backend.dataproviders; - -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import java.util.function.Function; -import java.util.stream.Collectors; - -import javax.inject.Inject; - -import org.kie.soup.commons.util.Sets; -import org.kie.workbench.common.forms.dynamic.model.config.SelectorData; -import org.kie.workbench.common.forms.dynamic.model.config.SelectorDataProvider; -import org.kie.workbench.common.forms.dynamic.service.shared.FormRenderingContext; -import org.kie.workbench.common.services.refactoring.backend.server.query.standard.FindRuleFlowNamesQuery; -import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueIndexTerm; -import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueSharedPartIndexTerm; -import org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow; -import org.kie.workbench.common.services.refactoring.service.PartType; -import org.kie.workbench.common.services.refactoring.service.RefactoringQueryService; - -public class RuleFlowGroupFormProvider implements SelectorDataProvider { - - private final RefactoringQueryService queryService; - private final Function, TreeMap> resultToSelectorData; - - // CDI Proxy. - protected RuleFlowGroupFormProvider() { - this(null, null); - } - - @Inject - public RuleFlowGroupFormProvider(final RefactoringQueryService queryService) { - this(queryService, - DEFAULT_RESULT_CONVERTER); - } - - RuleFlowGroupFormProvider(final RefactoringQueryService queryService, - final Function, TreeMap> resultToSelectorData) { - this.queryService = queryService; - this.resultToSelectorData = resultToSelectorData; - } - - @Override - public String getProviderName() { - return getClass().getSimpleName(); - } - - @Override - @SuppressWarnings("unchecked") - public SelectorData getSelectorData(final FormRenderingContext context) { - return new SelectorData(getRuleFlowGroupNames(), - null); - } - - @SuppressWarnings("unchecked") - private Map getRuleFlowGroupNames() { - List queryResult = queryService.query( - FindRuleFlowNamesQuery.NAME, - new Sets.Builder() - .add(new ValueSharedPartIndexTerm("*", - PartType.RULEFLOW_GROUP, - ValueIndexTerm.TermSearchType.WILDCARD)).build() - ); - return resultToSelectorData.apply(queryResult); - } - - public static Function, TreeMap> DEFAULT_RESULT_CONVERTER = - rows -> rows.stream() - .map(RuleFlowGroupFormProvider::getValue) - .filter(RuleFlowGroupFormProvider::isNotEmpty) - .collect(Collectors.toMap(name -> name, name -> name, (oldValue, newValue) -> oldValue, TreeMap::new)); - - @SuppressWarnings("unchecked") - private static String getValue(final RefactoringPageRow row) { - return ((Map) row.getValue()).get("name"); - } - - private static boolean isNotEmpty(final String s) { - return null != s && s.trim().length() > 0; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/ConditionEditorServiceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/ConditionEditorServiceImpl.java deleted file mode 100644 index 7948e36eb97..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/ConditionEditorServiceImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions; - -import javax.enterprise.context.ApplicationScoped; - -import org.jboss.errai.bus.server.annotations.Service; -import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; -import org.uberfire.backend.vfs.Path; - -@Service -@ApplicationScoped -public class ConditionEditorServiceImpl - extends BaseConditionEditorServiceImpl - implements ConditionEditorService { - - public ConditionEditorServiceImpl() { - //Empty constructor for proxying - } - - @Override - protected ClassLoader resolveClassLoader(Path path) { - return ClassLoader.getSystemClassLoader(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/service/BPMNDiagramServiceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/service/BPMNDiagramServiceImpl.java deleted file mode 100644 index 3d43153e80b..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/service/BPMNDiagramServiceImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.backend.service; - -import java.util.stream.StreamSupport; - -import javax.inject.Inject; -import javax.inject.Named; - -import org.jboss.errai.bus.server.annotations.Service; -import org.kie.workbench.common.stunner.bpmn.service.BPMNDiagramService; -import org.kie.workbench.common.stunner.bpmn.service.ProjectType; -import org.uberfire.backend.server.util.Paths; -import org.uberfire.backend.vfs.Path; -import org.uberfire.io.IOService; -import org.uberfire.java.nio.file.DirectoryStream; - -@Service -public class BPMNDiagramServiceImpl implements BPMNDiagramService { - - private IOService ioService; - - @Inject - public BPMNDiagramServiceImpl(final @Named("ioStrategy") IOService ioService) { - this.ioService = ioService; - } - - public BPMNDiagramServiceImpl() { - } - - @Override - public ProjectType getProjectType(Path projectRootPath) { - try (DirectoryStream paths = - ioService.newDirectoryStream(Paths.convert(projectRootPath), f -> f.getFileName().toString().startsWith("."))) { - return ProjectType.fromFileName(StreamSupport.stream(paths.spliterator(), false) - .map(Paths::convert) - .map(Path::getFileName) - .findFirst() - ).orElse(null); - } - } -} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/service/FindDataTypesService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/service/FindDataTypesService.java deleted file mode 100644 index 97eeca4b7da..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/service/FindDataTypesService.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.bpmn.backend.service; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import javax.inject.Inject; - -import org.guvnor.common.services.backend.exceptions.ExceptionUtilities; -import org.jboss.errai.bus.server.annotations.Service; -import org.kie.soup.project.datamodel.oracle.PackageDataModelOracle; -import org.kie.workbench.common.services.datamodel.backend.server.DataModelOracleUtilities; -import org.kie.workbench.common.services.datamodel.backend.server.service.DataModelService; -import org.kie.workbench.common.stunner.bpmn.service.DataTypesService; -import org.uberfire.backend.vfs.Path; - -@Service -public class FindDataTypesService implements DataTypesService { - - private DataModelService dataModelService; - - public FindDataTypesService() { - //CDI proxy - } - - @Inject - public FindDataTypesService(final DataModelService dataModelService) { - this.dataModelService = dataModelService; - } - - public List getDataTypeNames(final Path path) { - if (null == path) { - return Collections.emptyList(); - } - final List dataTypeNames = new ArrayList<>(); - - try { - final PackageDataModelOracle oracle = dataModelService.getDataModel(path); - final String[] fullyQualifiedClassNames = DataModelOracleUtilities.getFactTypes(oracle); - - dataTypeNames.addAll(Arrays.asList(fullyQualifiedClassNames)); - Collections.sort(dataTypeNames); - } catch (Exception e) { - throw ExceptionUtilities.handleException(e); - } - - return dataTypeNames; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/workitem/service/WorkItemDefinitionBackendService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/workitem/service/WorkItemDefinitionBackendService.java deleted file mode 100644 index 5313f948320..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/workitem/service/WorkItemDefinitionBackendService.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.backend.workitem.service; - -import java.util.Collection; -import java.util.List; -import java.util.function.BiPredicate; -import java.util.stream.Collectors; - -import javax.annotation.PreDestroy; -import javax.enterprise.context.RequestScoped; -import javax.enterprise.inject.Default; -import javax.enterprise.inject.Produces; -import javax.inject.Inject; - -import org.jboss.errai.bus.server.annotations.Service; -import org.kie.workbench.common.stunner.bpmn.backend.workitem.deploy.WorkItemDefinitionDeployServices; -import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; -import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry; -import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistry; -import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; -import org.kie.workbench.common.stunner.core.diagram.Metadata; - -/** - * - It produces the work item definition registry for the current request - * - It performs look-ups by calling the VFS WorkItemDefinitionService, in order to populate a request's registry - * - If no work item definitions found for the module, it starts the deployment (see DEFAULT_DEPLOY_PREDICATE) - */ -@RequestScoped -@Service -public class WorkItemDefinitionBackendService - implements WorkItemDefinitionLookupService { - - private final WorkItemDefinitionCacheRegistry registry; - private final WorkItemDefinitionVFSLookupService vfsService; - private final WorkItemDefinitionDeployServices deployServices; - private final BiPredicate> deployPredicate; - - /** - * Assuming that at least the default built-in work item definitions provided by the workbench should be - * present, this predicate just checks if any asset has been found for the active module, - * if no assets found, it means the deployment must be performed, otherwise, do not perform any deployment. - */ - private static final BiPredicate> DEFAULT_DEPLOY_PREDICATE = - ((metadata, workItemDefinitions) -> workItemDefinitions.isEmpty()); - - // CDI proxy. - @SuppressWarnings("all") - protected WorkItemDefinitionBackendService() { - this(null, null, null, null); - } - - @Inject - public WorkItemDefinitionBackendService(final WorkItemDefinitionCacheRegistry registry, - final WorkItemDefinitionVFSLookupService vfsService, - final WorkItemDefinitionDeployServices deployServices) { - this(registry, - vfsService, - deployServices, - DEFAULT_DEPLOY_PREDICATE); - } - - WorkItemDefinitionBackendService(final WorkItemDefinitionCacheRegistry registry, - final WorkItemDefinitionVFSLookupService vfsService, - final WorkItemDefinitionDeployServices deployServices, - final BiPredicate> deployPredicate) { - this.registry = registry; - this.vfsService = vfsService; - this.deployServices = deployServices; - this.deployPredicate = deployPredicate; - } - - @Produces - @Default - public WorkItemDefinitionRegistry getRegistry() { - return registry; - } - - @Override - public Collection execute(final Metadata metadata) { - return load(metadata).items(); - } - - @PreDestroy - public void destroy() { - registry.destroy(); - } - - private WorkItemDefinitionCacheRegistry load(final Metadata metadata) { - Collection items = search(metadata); - if (deployPredicate.test(metadata, items)) { - deployServices.deploy(metadata); - items = search(metadata); - } - items.forEach(registry::register); - return registry; - } - - private List search(final Metadata metadata) { - return vfsService - .search(metadata) - .stream() - .collect(Collectors.toList()); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/resources/META-INF/services/org.jbpm.compiler.xml.ProcessDataEventListenerProvider b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/resources/META-INF/services/org.jbpm.compiler.xml.ProcessDataEventListenerProvider deleted file mode 100644 index 4253beef169..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/resources/META-INF/services/org.jbpm.compiler.xml.ProcessDataEventListenerProvider +++ /dev/null @@ -1 +0,0 @@ -org.kie.workbench.common.stunner.bpmn.backend.indexing.BpmnProcessDataEventListenerProvider \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/fromstunner/properties/GenericServiceTaskPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/fromstunner/properties/GenericServiceTaskPropertyWriterTest.java index 31129e9f715..58286aa3afc 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/fromstunner/properties/GenericServiceTaskPropertyWriterTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/fromstunner/properties/GenericServiceTaskPropertyWriterTest.java @@ -17,15 +17,13 @@ package org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties; import org.eclipse.bpmn2.ServiceTask; -import org.eclipse.bpmn2.di.BPMNDiagram; import org.junit.Before; import org.junit.Test; import org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.CustomAttribute; import org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.CustomElement; -import org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.DefinitionResolver; import org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.Scripts; import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; -import org.mockito.Mock; +import org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -40,49 +38,52 @@ public class GenericServiceTaskPropertyWriterTest { private ServiceTask serviceTask = bpmn2.createServiceTask(); - @Mock - private BPMNDiagram diagram; - - @Mock - private DefinitionResolver definitionResolver; + private GenericServiceTaskValue value; @Before public void setUp() { PropertyWriterFactory writerFactory = new PropertyWriterFactory(); w = writerFactory.of(serviceTask); + value = new GenericServiceTaskValue("Java", + "serviceInterface", + "serviceOperation", + "inMessageStructure", + "outMessagetructure"); } @Test public void setAndTestJava() { - w.setServiceImplementation("Java"); - w.setServiceOperation("setServiceOperation"); - w.setServiceInterface("setServiceInterface"); + w.setValue(value); w.setSLADueDate(SLA_DUE_DATE); w.setAsync(false); w.setAdHocAutostart(false); w.setAssignmentsInfo(new AssignmentsInfo()); - assertEquals("Java", CustomAttribute.serviceImplementation.of(serviceTask).get()); - assertEquals("setServiceOperation", CustomAttribute.serviceOperation.of(serviceTask).get()); - assertEquals("setServiceInterface", CustomAttribute.serviceInterface.of(serviceTask).get()); + assertServiceTaskProperties("Java"); assertEquals(SLA_DUE_DATE_CDATA, CustomElement.slaDueDate.of(serviceTask).get()); assertEquals(false, CustomElement.async.of(serviceTask).get()); assertEquals(false, CustomElement.autoStart.of(serviceTask).get()); assertNotNull(Scripts.onEntry(serviceTask)); } + private void assertServiceTaskProperties(String serviceImplementation) { + assertEquals(serviceImplementation, CustomAttribute.serviceImplementation.of(serviceTask).get()); + assertEquals("serviceOperation", CustomAttribute.serviceOperation.of(serviceTask).get()); + assertEquals("serviceInterface", CustomAttribute.serviceInterface.of(serviceTask).get()); + assertEquals("serviceOperation", serviceTask.getOperationRef().getName()); + assertEquals("inMessageStructure", serviceTask.getOperationRef().getInMessageRef().getItemRef().getStructureRef()); + assertEquals("outMessagetructure", serviceTask.getOperationRef().getOutMessageRef().getItemRef().getStructureRef()); + } + @Test public void setAndTestWebService() { - w.setServiceImplementation("WebService"); - w.setServiceOperation("setServiceOperation"); - w.setServiceInterface("setServiceInterface"); + value.setServiceImplementation("WebService"); + w.setValue(value); w.setSLADueDate(SLA_DUE_DATE); w.setAsync(false); w.setAdHocAutostart(false); - assertEquals("##WebService", CustomAttribute.serviceImplementation.of(serviceTask).get()); - assertEquals("setServiceOperation", CustomAttribute.serviceOperation.of(serviceTask).get()); - assertEquals("setServiceInterface", CustomAttribute.serviceInterface.of(serviceTask).get()); + assertServiceTaskProperties("WebService"); assertEquals(SLA_DUE_DATE_CDATA, CustomElement.slaDueDate.of(serviceTask).get()); assertEquals(false, CustomElement.async.of(serviceTask).get()); assertEquals(false, CustomElement.autoStart.of(serviceTask).get()); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/GraphBuilderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/GraphBuilderTest.java index cc7835190da..f02dd3a4a17 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/GraphBuilderTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/GraphBuilderTest.java @@ -28,7 +28,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; -import org.kie.workbench.common.stunner.bpmn.backend.BPMNTestDefinitionFactory; +import org.kie.workbench.common.stunner.bpmn.BPMNTestDefinitionFactory; import org.kie.workbench.common.stunner.bpmn.backend.converters.TypedFactoryManager; import org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.BasePropertyReader; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/processes/ProcessConverterDelegateTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/processes/ProcessConverterDelegateTest.java index ae425b33c69..be83fd14ac8 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/processes/ProcessConverterDelegateTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/processes/ProcessConverterDelegateTest.java @@ -47,7 +47,7 @@ import org.junit.runner.RunWith; import org.kie.soup.commons.util.Maps; import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; -import org.kie.workbench.common.stunner.bpmn.backend.BPMNTestDefinitionFactory; +import org.kie.workbench.common.stunner.bpmn.BPMNTestDefinitionFactory; import org.kie.workbench.common.stunner.bpmn.backend.converters.Result; import org.kie.workbench.common.stunner.bpmn.backend.converters.TypedFactoryManager; import org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.BaseConverterFactory; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/GenericServiceTaskPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/GenericServiceTaskPropertyReaderTest.java index 5234b62de26..4eac4f116b6 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/GenericServiceTaskPropertyReaderTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/converters/tostunner/properties/GenericServiceTaskPropertyReaderTest.java @@ -49,13 +49,19 @@ public class GenericServiceTaskPropertyReaderTest { @Mock private DefinitionResolver definitionResolver; + private GenericServiceTaskValue value; + @Before public void setUp() { ServiceTask serviceTask = bpmn2.createServiceTask(); + value = new GenericServiceTaskValue("java", + "serviceInterface", + "serviceOperation", + "inMessageStructure", + "outMessageStructure"); + GenericServiceTaskPropertyWriter writer = new GenericServiceTaskPropertyWriter(serviceTask, null); - writer.setServiceImplementation("WebService"); - writer.setServiceInterface("setServiceInterface"); - writer.setServiceOperation("setServiceOperation"); + writer.setValue(value); writer.setSLADueDate(SLA_DUE_DATE); writer.setAsync(false); writer.setAdHocAutostart(true); @@ -76,11 +82,12 @@ public void setUp() { @Test public void getGenericServiceTask() { GenericServiceTaskValue task = reader.getGenericServiceTask(); - assertEquals("setServiceOperation", task.getServiceOperation()); - assertEquals("setServiceInterface", task.getServiceInterface()); - assertEquals("WebService", task.getServiceImplementation()); + assertEquals("Java", task.getServiceImplementation()); + assertEquals("serviceOperation", task.getServiceOperation()); + assertEquals("serviceInterface", task.getServiceInterface()); + assertEquals("inMessageStructure", task.getInMessageStructure()); + assertEquals("outMessageStructure", task.getOutMessagetructure()); assertEquals(SLA_DUE_DATE_CDATA, reader.getSLADueDate()); - assertEquals(false, reader.isAsync()); assertEquals(true, reader.isAdHocAutostart()); assertNotNull(reader.getOnEntryAction()); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/dataproviders/CalledElementFormProviderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/dataproviders/CalledElementFormProviderTest.java deleted file mode 100644 index 6538b1df005..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/dataproviders/CalledElementFormProviderTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.backend.dataproviders; - -import org.junit.Test; -import org.kie.workbench.common.services.refactoring.service.ResourceType; -import org.kie.workbench.common.stunner.bpmn.backend.query.FindBpmnProcessIdsQuery; - -import static org.junit.Assert.assertEquals; - -public class CalledElementFormProviderTest { - - private CalledElementFormProvider tested = new CalledElementFormProvider(); - - @Test - public void testGetProcessIdResourceType() throws Exception { - assertEquals(tested.getProcessIdResourceType(), ResourceType.BPMN2); - } - - @Test - public void testGetQueryName() throws Exception { - assertEquals(tested.getQueryName(), FindBpmnProcessIdsQuery.NAME); - } -} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/ConditionEditorServiceImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/ConditionEditorServiceImplTest.java deleted file mode 100644 index 9c634828e38..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/ConditionEditorServiceImplTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions; - -import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; - -public class ConditionEditorServiceImplTest - extends ConditionEditorServiceBaseTest { - - @Override - protected ConditionEditorService createService() { - return new ConditionEditorServiceImpl(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/BpmnProcessDataEventListenerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/BpmnProcessDataEventListenerTest.java deleted file mode 100644 index 19b77b8246a..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/BpmnProcessDataEventListenerTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.backend.indexing; - -import org.junit.Test; -import org.kie.workbench.common.services.refactoring.service.ResourceType; - -import static org.junit.Assert.assertEquals; - -public class BpmnProcessDataEventListenerTest { - - private BpmnProcessDataEventListener tested = new BpmnProcessDataEventListener(); - - @Test - public void testGetProcessIdResourceType() throws Exception { - assertEquals(tested.getProcessIdResourceType(), ResourceType.BPMN2); - } - - @Test - public void testGetProcessNameResourceType() throws Exception { - assertEquals(tested.getProcessNameResourceType(), ResourceType.BPMN2_NAME); - } -} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/query/FindBpmnProcessIdsQueryTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/query/FindBpmnProcessIdsQueryTest.java deleted file mode 100644 index 9e66f6a8512..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/query/FindBpmnProcessIdsQueryTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.backend.query; - -import org.junit.Test; -import org.kie.workbench.common.services.refactoring.service.ResourceType; - -import static org.junit.Assert.assertEquals; - -public class FindBpmnProcessIdsQueryTest { - - private FindBpmnProcessIdsQuery tested = new FindBpmnProcessIdsQuery(); - - @Test - public void testGetProcessIdResourceType() throws Exception { - assertEquals(tested.getProcessIdResourceType(), ResourceType.BPMN2); - } -} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/BPMNDiagramServiceImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/BPMNDiagramServiceImplTest.java deleted file mode 100644 index 47eb18a2870..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/BPMNDiagramServiceImplTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.backend.service; - -import java.net.URI; -import java.util.Arrays; -import java.util.Collections; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.bpmn.service.ProjectType; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; -import org.uberfire.io.IOService; -import org.uberfire.java.nio.file.DirectoryStream; -import org.uberfire.java.nio.file.FileSystem; -import org.uberfire.java.nio.file.Path; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class BPMNDiagramServiceImplTest { - - public static final String DIR_URI = "default://master@diagrams/root"; - - private static final String FILE_NAME = ".caseproject"; - - public static final String FILE_URI = DIR_URI + "/" + FILE_NAME; - - private BPMNDiagramServiceImpl tested; - - @Mock - private IOService ioService; - - @Mock - private DirectoryStream directoryStream; - - @Mock - private org.uberfire.backend.vfs.Path projectPath; - - @Mock - private Path fsPath; - - @Mock - private Path fileName; - - @Mock - private FileSystem fs; - - @Before - public void setUp() throws Exception { - - ArgumentCaptor filter = ArgumentCaptor.forClass(DirectoryStream.Filter.class); - when(ioService.newDirectoryStream(any(), filter.capture())).thenReturn(directoryStream); - when(directoryStream.spliterator()).thenReturn(Arrays.asList(fsPath).spliterator()); - when(projectPath.toURI()).thenReturn(DIR_URI); - when(fsPath.getFileName()).thenReturn(fileName); - when(fsPath.toUri()).thenReturn(new URI(FILE_URI)); - when(fsPath.getFileSystem()).thenReturn(fs); - when(fileName.toString()).thenReturn(FILE_NAME); - - tested = new BPMNDiagramServiceImpl(ioService); - } - - @Test - public void getProjectTypeCase() { - final ProjectType projectType = tested.getProjectType(projectPath); - assertEquals(projectType, ProjectType.CASE); - } - - @Test - public void getProjectTypeNull() { - when(directoryStream.spliterator()).thenReturn(Collections.emptyList().spliterator()); - final ProjectType projectType = tested.getProjectType(projectPath); - assertEquals(projectType, null); - } -} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/FindDataTypesServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/FindDataTypesServiceTest.java deleted file mode 100644 index 3da7d1fc8ef..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/FindDataTypesServiceTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.bpmn.backend.service; - -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.soup.project.datamodel.oracle.DataType; -import org.kie.soup.project.datamodel.oracle.FieldAccessorsAndMutators; -import org.kie.soup.project.datamodel.oracle.ModelField; -import org.kie.soup.project.datamodel.oracle.PackageDataModelOracle; -import org.kie.workbench.common.services.datamodel.backend.server.service.DataModelService; -import org.kie.workbench.common.stunner.bpmn.service.DataTypesService; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; -import org.uberfire.backend.vfs.Path; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class FindDataTypesServiceTest { - - @Mock - private DataModelService dataModelService; - - @Mock - private PackageDataModelOracle oracle; - - @Mock - private Path path; - - private DataTypesService service; - - @Before - public void setup() { - this.service = new FindDataTypesService(dataModelService); - } - - @Test - public void testGetJavaTypeNames() throws Exception { - final Map fields = new java.util.HashMap<>(); - - when(oracle.getModulePackageNames()).thenReturn(Collections.singletonList("org")); - when(dataModelService.getDataModel(path)).thenReturn(oracle); - - //Types in the package - fields.put("org.Zebra", - new ModelField[]{new ModelField("this", - "org.Zebra", - ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, - ModelField.FIELD_ORIGIN.SELF, - FieldAccessorsAndMutators.ACCESSOR, - DataType.TYPE_THIS)}); - - fields.put("org.Antelope", - new ModelField[]{new ModelField("this", - "org.Antelope", - ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, - ModelField.FIELD_ORIGIN.SELF, - FieldAccessorsAndMutators.ACCESSOR, - DataType.TYPE_THIS)}); - - //Type not in the package - fields.put("smurf.Pupa", - new ModelField[]{new ModelField("this", - "smurf.Pupa", - ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, - ModelField.FIELD_ORIGIN.SELF, - FieldAccessorsAndMutators.ACCESSOR, - DataType.TYPE_THIS)}); - - when(oracle.getModuleModelFields()).thenReturn(fields); - - final List dataTypeNames = service.getDataTypeNames(path); - - assertNotNull(dataTypeNames); - assertEquals(2, dataTypeNames.size()); - assertEquals("org.Antelope", dataTypeNames.get(0)); - assertEquals("org.Zebra", dataTypeNames.get(1)); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/dataprovider/CalledElementFormProviderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/dataprovider/CalledElementFormProviderTest.java deleted file mode 100644 index 8fef1ee28a3..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/dataprovider/CalledElementFormProviderTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.backend.service.dataprovider; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.forms.dynamic.model.config.SelectorData; -import org.kie.workbench.common.forms.dynamic.service.shared.FormRenderingContext; -import org.kie.workbench.common.services.refactoring.model.query.RefactoringMapPageRow; -import org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow; -import org.kie.workbench.common.services.refactoring.service.RefactoringQueryService; -import org.kie.workbench.common.stunner.bpmn.backend.dataproviders.CalledElementFormProvider; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; -import org.uberfire.backend.vfs.Path; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class CalledElementFormProviderTest { - - CalledElementFormProvider calledElementFormProvider = new CalledElementFormProvider(); - - @Mock - FormRenderingContext context; - - @Mock - RefactoringQueryService queryService; - - @Mock - Path path1; - - @Mock - Path path2; - - private static final String ID1 = "P1.Process1"; - private static final String ID2 = "P1.Process2"; - - @Before - public void setup() { - calledElementFormProvider.setQueryService(queryService); - List results = new ArrayList(); - RefactoringMapPageRow refactoringMapPageRow = new RefactoringMapPageRow(); - Map map = new HashMap(); - map.put(ID1, - path1); - map.put(ID2, - path2); - refactoringMapPageRow.setValue(map); - results.add(refactoringMapPageRow); - when(queryService.query(anyString(), - anyObject())).thenReturn(results); - } - - @Test - public void getBusinessProcessIDsTest() { - Map results = calledElementFormProvider.getBusinessProcessIDs(); - assertEquals(results.size(), - 2); - assertTrue(results.keySet().contains(ID1)); - assertTrue(results.keySet().contains(ID2)); - assertEquals(results.get(ID1), - ID1); - assertEquals(results.get(ID1), - ID1); - } - - @Test - public void getSelectorDataTest() { - SelectorData selectorData = calledElementFormProvider.getSelectorData(context); - - assertEquals(selectorData.getValues().size(), - 2); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/dataprovider/RuleFlowGroupFormProviderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/dataprovider/RuleFlowGroupFormProviderTest.java deleted file mode 100644 index 18b38d84541..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/dataprovider/RuleFlowGroupFormProviderTest.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.backend.service.dataprovider; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; - -import org.junit.Test; -import org.kie.workbench.common.services.refactoring.backend.server.query.standard.FindRuleFlowNamesQuery; -import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueIndexTerm; -import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueSharedPartIndexTerm; -import org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow; -import org.kie.workbench.common.services.refactoring.service.PartType; -import org.kie.workbench.common.stunner.bpmn.backend.dataproviders.RuleFlowGroupFormProvider; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class RuleFlowGroupFormProviderTest { - - private final static String ERROR_MSG = PartType.ACTIVATION_GROUP.toString() + "' can not be used"; - - @Test - public void findRuleFlowNamesQueryTermsTest() { - FindRuleFlowNamesQuery query = new FindRuleFlowNamesQuery(); - - Set queryTerms = new HashSet<>(); - try { - query.validateTerms(queryTerms); - fail("The required rule-flow term is missing, but no exception was thrown."); - } catch (IllegalArgumentException iae) { - assertTrue("Incorrect error message: " + iae.getMessage(), - iae.getMessage().contains("At least 1 term")); - } - - queryTerms = new HashSet<>(); - queryTerms.add(new ValueSharedPartIndexTerm("not-rule-flow", - PartType.ACTIVATION_GROUP)); - try { - query.validateTerms(queryTerms); - fail("The required rule-flow term is missing, but no exception was thrown."); - } catch (IllegalArgumentException iae) { - assertTrue("Incorrect error message: " + iae.getMessage(), - iae.getMessage().contains(ERROR_MSG)); - } - - queryTerms = new HashSet<>(); - queryTerms.add(new ValueSharedPartIndexTerm("not-rule-flow", - PartType.ACTIVATION_GROUP)); - queryTerms.add(new ValueSharedPartIndexTerm("rule-flow", - PartType.RULEFLOW_GROUP)); - try { - query.validateTerms(queryTerms); - fail("The activation term is not acceptable here, but no exception was thrown."); - } catch (IllegalArgumentException iae) { - assertTrue("Incorrect error message: " + iae.getMessage(), - iae.getMessage().contains(ERROR_MSG)); - } - - queryTerms = new HashSet<>(); - queryTerms.add(new ValueSharedPartIndexTerm("rule-flow", - PartType.RULEFLOW_GROUP)); - query.validateTerms(queryTerms); - } - - @Test - @SuppressWarnings("unchecked") - public void testDefaultResultConverter() { - RefactoringPageRow row1 = mock(RefactoringPageRow.class); - when(row1.getValue()).thenReturn(asMap("row1")); - RefactoringPageRow row2 = mock(RefactoringPageRow.class); - when(row2.getValue()).thenReturn(asMap("row2")); - RefactoringPageRow row3 = mock(RefactoringPageRow.class); - when(row3.getValue()).thenReturn(asMap("row3")); - RefactoringPageRow row4 = mock(RefactoringPageRow.class); - when(row4.getValue()).thenReturn(asMap("row4")); - RefactoringPageRow row4_2 = mock(RefactoringPageRow.class); - when(row4_2.getValue()).thenReturn(asMap("row4")); - RefactoringPageRow emptyRow1 = mock(RefactoringPageRow.class); - when(emptyRow1.getValue()).thenReturn(asMap("")); - RefactoringPageRow emptyRow2 = mock(RefactoringPageRow.class); - when(emptyRow2.getValue()).thenReturn(asMap("")); - List rows = Arrays.asList(row1, row2, row3, row4, row4_2, emptyRow1, emptyRow2); - TreeMap result = RuleFlowGroupFormProvider.DEFAULT_RESULT_CONVERTER.apply(rows); - assertEquals(4, result.size()); - assertTrue(result.containsKey("row1")); - assertTrue(result.containsKey("row2")); - assertTrue(result.containsKey("row3")); - assertTrue(result.containsKey("row4")); - } - - private static Map asMap(String s) { - HashMap map = new HashMap<>(1); - map.put("name", s); - return map; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/BPMNDirectDiagramMarshallerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/BPMNDirectDiagramMarshallerTest.java index 2abeddd085b..f245ee4c70e 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/BPMNDirectDiagramMarshallerTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/BPMNDirectDiagramMarshallerTest.java @@ -21,6 +21,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import java.util.Objects; import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -48,11 +49,14 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; +import org.kie.workbench.common.stunner.bpmn.BPMNTestDefinitionFactory; +import org.kie.workbench.common.stunner.bpmn.WorkItemDefinitionMockRegistry; import org.kie.workbench.common.stunner.bpmn.backend.BPMNDirectDiagramMarshaller; -import org.kie.workbench.common.stunner.bpmn.backend.BPMNTestDefinitionFactory; +import org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.DeclarationList; +import org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.VariableDeclaration; import org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.DefinitionsConverter; import org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BasePropertyWriter; -import org.kie.workbench.common.stunner.bpmn.backend.workitem.service.WorkItemDefinitionBackendService; import org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess; import org.kie.workbench.common.stunner.bpmn.definition.Association; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram; @@ -69,6 +73,7 @@ import org.kie.workbench.common.stunner.bpmn.definition.EventGateway; import org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess; import org.kie.workbench.common.stunner.bpmn.definition.ExclusiveGateway; +import org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask; import org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway; import org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent; import org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing; @@ -111,18 +116,18 @@ import org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationsInfo; import org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue; import org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue; import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet; import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocSubprocessTaskExecutionSet; import org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet; -import org.kie.workbench.common.stunner.bpmn.definition.property.task.BusinessRuleTaskExecutionSet; import org.kie.workbench.common.stunner.bpmn.definition.property.task.ReusableSubprocessTaskExecutionSet; import org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskTypes; import org.kie.workbench.common.stunner.bpmn.definition.property.task.UserTaskExecutionSet; import org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData; import org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables; import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTask; -import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTaskExecutionSet; import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistry; +import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; import org.kie.workbench.common.stunner.core.StunnerTestingGraphAPI; import org.kie.workbench.common.stunner.core.backend.StunnerTestingGraphBackendAPI; import org.kie.workbench.common.stunner.core.backend.service.XMLEncoderDiagramMetadataMarshaller; @@ -242,14 +247,16 @@ public class BPMNDirectDiagramMarshallerTest { private static final String ARIS_COLLAPSED_SUBPROCESS_IN_LANE = PATH_DIAGRAM + "/aris/ARIS_COLLAPSED_SUBPROCESS_IN_LANE.bpmn"; private static final String BPMN_LOG_TASK_JBPM_DESIGNER = PATH_DIAGRAM + "/logtask.bpmn"; private static final String BPMN_SERVICETASKS_JBPM_DESIGNER = PATH_DIAGRAM + "/serviceTasksJBPMDeginer.bpmn"; - private static final String BPMN_EVENT_GATEWAY = "org/kie/workbench/common/stunner/bpmn/backend/service/diagram/eventGateway.bpmn"; + private static final String BPMN_EVENT_GATEWAY = PATH_DIAGRAM + "/eventGateway.bpmn"; + private static final String BPMN_TRAVELS = PATH_DIAGRAM + "/travels.bpmn"; + private static final String BPMN_FLIGHT_BOOKING = PATH_DIAGRAM + "/flightBooking.bpmn"; private static final String NEW_LINE = System.lineSeparator(); private StunnerTestingGraphAPI stunnerAPI; private XMLEncoderDiagramMetadataMarshaller xmlEncoder; private WorkItemDefinitionRegistry widRegistry; - private WorkItemDefinitionBackendService widService; + private WorkItemDefinitionLookupService widService; private BPMNDirectDiagramMarshaller tested; @@ -258,7 +265,7 @@ public class BPMNDirectDiagramMarshallerTest { public void setup() throws Exception { // Setup context. widRegistry = new WorkItemDefinitionMockRegistry(); - widService = mock(WorkItemDefinitionBackendService.class); + widService = mock(WorkItemDefinitionLookupService.class); when(widService.execute(any(Metadata.class))).thenReturn(widRegistry.items()); stunnerAPI = StunnerTestingGraphBackendAPI.build(BPMNDefinitionSet.class, new BPMNTestDefinitionFactory(widRegistry)); @@ -395,10 +402,6 @@ public void testUnmarshallLogTaskJBPMDesigner() throws Exception { Node log = diagram.getGraph().getNode("_AE76ACC9-CCD0-425D-BD40-5E4F3533A1DF"); assertTrue(log.getContent().getDefinition() instanceof ServiceTask); - - ServiceTask serviceTask = (ServiceTask) log.getContent().getDefinition(); - - validateServiceTask(serviceTask.getExecutionSet(), "12/25/1983"); } @Test @@ -416,24 +419,6 @@ public void testUnmarshallServiceTaskJBPMDesigner() throws Exception { assertTrue(rest.getContent().getDefinition() instanceof ServiceTask); assertTrue(ws.getContent().getDefinition() instanceof ServiceTask); assertTrue(log.getContent().getDefinition() instanceof ServiceTask); - - ServiceTask emailTask = (ServiceTask) email.getContent().getDefinition(); - ServiceTask restTask = (ServiceTask) rest.getContent().getDefinition(); - ServiceTask wsTask = (ServiceTask) ws.getContent().getDefinition(); - ServiceTask logTask = (ServiceTask) log.getContent().getDefinition(); - - validateServiceTask(emailTask.getExecutionSet(), "12/25/1983"); - validateServiceTask(restTask.getExecutionSet(), "12/25/1983"); - validateServiceTask(wsTask.getExecutionSet(), "12/25/1983"); - validateServiceTask(logTask.getExecutionSet(), "12/25/1983"); - } - - private void validateServiceTask(ServiceTaskExecutionSet serviceTaskExecutionSet, - String slaDueDateValue) { - assertNotNull(serviceTaskExecutionSet); - - assertNotNull(serviceTaskExecutionSet.getSlaDueDate()); - assertEquals(serviceTaskExecutionSet.getSlaDueDate().getValue(), slaDueDateValue); } @Test @@ -468,6 +453,63 @@ public void testUnmarshallEvaluation() throws Exception { 0); } + @Test + public void testUnmarshallFlightBooking() throws Exception { + final Diagram diagram = unmarshall(BPMN_FLIGHT_BOOKING); + + //User Task 1 + Node serviceTask1Node = diagram.getGraph().getNode("ServiceTask_1"); + GenericServiceTask serviceTask1 = (GenericServiceTask) serviceTask1Node.getContent().getDefinition(); + + //Assert properties from Generic Service Task + GenericServiceTaskValue serviceTaskValue = serviceTask1.getExecutionSet().getGenericServiceTaskInfo().getValue(); + assertEquals("Java", serviceTaskValue.getServiceImplementation()); + assertEquals("org.acme.travels.service.FlightBookingService", serviceTaskValue.getServiceInterface()); + assertEquals("bookFlight", serviceTaskValue.getServiceOperation()); + assertEquals("org.acme.travels.Trip", serviceTaskValue.getInMessageStructure()); + assertEquals("org.acme.travels.Flight", serviceTaskValue.getOutMessagetructure()); + + String marshalled = tested.marshall(diagram); + assertTrue(marshalled.contains("")); + assertTrue(marshalled.contains("")); + } + + @Test + public void testUnmarshallTravels() throws Exception { + final Diagram diagram = unmarshall(BPMN_TRAVELS); + + //User Task 1 + Node userTask1Node = diagram.getGraph().getNode("UserTask_1"); + UserTask userTask1 = (UserTask) userTask1Node.getContent().getDefinition(); + ParsedAssignmentsInfo parsedAssignmentsInfo = ParsedAssignmentsInfo.fromString(userTask1.getExecutionSet().getAssignmentsinfo().getValue()); + assertDataTye("org.acme.travels.Trip", "trip", parsedAssignmentsInfo.getInputs()); + assertDataTye("org.acme.travels.Traveller", "traveller", parsedAssignmentsInfo.getInputs()); + assertDataTye("java.lang.Boolean", "Skippable", parsedAssignmentsInfo.getInputs()); + assertDataTye("java.lang.Integer", "Priority", parsedAssignmentsInfo.getInputs()); + assertDataTye("java.lang.String", "Comment", parsedAssignmentsInfo.getInputs()); + + //Business Rule 1 + Node businessRuleTaskNode = diagram.getGraph().getNode("BusinessRuleTask_1"); + BusinessRuleTask businessRuleTask1 = (BusinessRuleTask) businessRuleTaskNode.getContent().getDefinition(); + ParsedAssignmentsInfo businessRuleParsedAssignmentsInfo = + ParsedAssignmentsInfo.fromString(businessRuleTask1.getDataIOSet().getAssignmentsinfo().getValue()); + + assertDataTye("org.acme.travels.Traveller", "traveller", businessRuleParsedAssignmentsInfo.getInputs()); + assertDataTye("org.acme.travels.Trip", "trip", businessRuleParsedAssignmentsInfo.getInputs()); + assertDataTye("org.acme.travels.Trip", "trip", businessRuleParsedAssignmentsInfo.getOutputs()); + } + + private void assertDataTye(String expectedType, String name, DeclarationList declarationList) { + assertEquals(expectedType, + declarationList + .getDeclarations() + .stream() + .filter(d -> Objects.equals(d.getIdentifier(), name)) + .map(VariableDeclaration::getType) + .findFirst() + .orElse(null)); + } + @Test @SuppressWarnings("unchecked") public void testUnmarshallProcessVariables() throws Exception { @@ -625,11 +667,6 @@ public void testUnmarshallBusinessRuleTaskAssignments() throws Exception { BusinessRuleTask businessRuleTask = (BusinessRuleTask) businessRuleNode.getContent().getDefinition(); assertEquals(businessRuleTask.getTaskType().getValue(), TaskTypes.BUSINESS_RULE); - - BusinessRuleTaskExecutionSet executionSet = businessRuleTask.getExecutionSet(); - assertNotNull(executionSet.getSlaDueDate()); - assertEquals(executionSet.getSlaDueDate().getValue(), "12/25/1983"); - DataIOSet dataIOSet = businessRuleTask.getDataIOSet(); AssignmentsInfo assignmentsinfo = dataIOSet.getAssignmentsinfo(); assertEquals(assignmentsinfo.getValue(), @@ -1691,7 +1728,6 @@ public void testUnmarshallBusinessRuleTask() throws Exception { assertNotNull(businessRuleTask); assertNotNull(businessRuleTask.getExecutionSet()); assertNotNull(businessRuleTask.getExecutionSet().getRuleFlowGroup()); - assertNotNull(businessRuleTask.getExecutionSet().getSlaDueDate()); assertNotNull(businessRuleTask.getGeneral()); assertNotNull(businessRuleTask.getGeneral().getName()); assertEquals(businessRuleTask.getTaskType().getValue(), @@ -1717,7 +1753,6 @@ public void testUnmarshallBusinessRuleTask() throws Exception { assertEquals("java", businessRuleTask.getExecutionSet().getOnExitAction().getValue().getValues().get(0).getLanguage()); - assertEquals("12/25/1983", businessRuleTask.getExecutionSet().getSlaDueDate().getValue()); } @Test @@ -1822,8 +1857,6 @@ public void testUnmarshallReusableSubprocess() throws Exception { executionSet.getCalledElement().getValue()); assertEquals(false, executionSet.getIndependent().getValue()); - assertEquals(false, - executionSet.getAbortParent().getValue()); assertEquals(true, executionSet.getWaitForCompletion().getValue()); @@ -1892,16 +1925,12 @@ public void testUnmarshallAddHocSubprocess() throws Exception { assertEquals("AdHocSubprocess1Documentation", generalSet.getDocumentation().getValue()); - assertNotNull(executionSet.getAdHocActivationCondition()); - assertNotNull(executionSet.getAdHocActivationCondition().getValue()); assertNotNull(executionSet.getAdHocCompletionCondition()); assertNotNull(executionSet.getAdHocCompletionCondition().getValue()); assertNotNull(executionSet.getAdHocOrdering()); assertNotNull(executionSet.getOnEntryAction()); assertNotNull(executionSet.getOnExitAction()); - assertEquals("com.myteam.test.Person(name == \"someName\")", - executionSet.getAdHocActivationCondition().getValue()); assertEquals("autocomplete", executionSet.getAdHocCompletionCondition().getValue().getScript()); assertEquals("drools", @@ -2444,9 +2473,6 @@ public void testMarshallBusinessRuleTaskAssignments() throws Exception { assertTrue(result.contains("_45C2C340-D1D0-4D63-8419-EF38F9E73507_input2InputX")); assertTrue(result.contains("_45C2C340-D1D0-4D63-8419-EF38F9E73507_output1OutputX")); assertTrue(result.contains("_45C2C340-D1D0-4D63-8419-EF38F9E73507_output2OutputX")); - assertTrue(result.contains("")); - assertTrue(result.contains("")); - assertTrue(result.contains("")); } @Test @@ -2916,7 +2942,6 @@ public void testMarshallReusableSubprocess() throws Exception { " "); assertTrue(flatResult.contains(" ")); assertTrue(flatResult.contains(" ")); - assertTrue(flatResult.contains(" ")); } @Test @@ -2984,7 +3009,7 @@ public void testMarshallEmbeddedSubprocess() throws Exception { @Test public void testMarshallEmbeddedSubprocessDuplicateElements() throws Exception { - String f = PATH_DIAGRAM + "/subprocessDuplicateElements.bpmn"; + String f = "org/kie/workbench/common/stunner/bpmn/backend/service/diagram/subprocessDuplicateElements.bpmn"; Diagram diagram = unmarshall(f); String result = tested.marshall(diagram); @@ -2996,7 +3021,7 @@ public void testMarshallEmbeddedSubprocessDuplicateElements() throws Exception { @Test public void testMarshallEmbeddedSubprocessNestedDuplicates() throws Exception { - String f = PATH_DIAGRAM + "/subprocessNested.bpmn"; + String f = "org/kie/workbench/common/stunner/bpmn/backend/service/diagram/subprocessNested.bpmn"; Diagram diagram = unmarshall(f); String result = tested.marshall(diagram); @@ -3090,9 +3115,6 @@ public void testMarshallAdHocSubprocess() throws Exception { assertTrue(result.contains("")); - assertTrue(result.contains("")); - assertTrue(result.contains("")); assertTrue(result.contains("")); assertTrue(result.contains("")); @@ -3277,12 +3299,6 @@ public void testMarshallBusinessRuleTask() throws Exception { assertTrue(flatResult.contains("")); assertTrue(flatResult.contains("")); - - assertTrue(result.contains("")); - - assertTrue(result.contains("")); - - assertTrue(result.contains("")); } @Test @@ -3649,9 +3665,6 @@ public void testUnmarshallWorkItems() throws Exception { log.getGeneral().getName().getValue()); assertEquals(WorkItemDefinitionMockRegistry.LOG.getDocumentation(), log.getGeneral().getDocumentation().getValue()); - - assertNotNull(email.getExecutionSet().getSlaDueDate()); - assertEquals(email.getExecutionSet().getSlaDueDate().getValue(), "12/25/1983"); } @Test @@ -3989,9 +4002,6 @@ public void testMarshallWorkItems() throws Exception { 3); assertTrue(result.contains("drools:taskName=\"Email\"")); assertTrue(result.contains("drools:taskName=\"Log\"")); - assertTrue(result.contains("")); - assertTrue(result.contains("")); - assertTrue(result.contains("")); } @Test diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/marshalling/BPMNDiagramMarshallerBaseTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/marshalling/BPMNDiagramMarshallerBaseTest.java index f2db2a619c2..1ce8d2f4489 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/marshalling/BPMNDiagramMarshallerBaseTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/marshalling/BPMNDiagramMarshallerBaseTest.java @@ -25,17 +25,17 @@ import org.eclipse.bpmn2.Definitions; import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; +import org.kie.workbench.common.stunner.bpmn.BPMNTestDefinitionFactory; +import org.kie.workbench.common.stunner.bpmn.WorkItemDefinitionMockRegistry; import org.kie.workbench.common.stunner.bpmn.backend.BPMNDirectDiagramMarshaller; -import org.kie.workbench.common.stunner.bpmn.backend.BPMNTestDefinitionFactory; import org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.DefinitionsConverter; import org.kie.workbench.common.stunner.bpmn.backend.service.diagram.Unmarshalling; -import org.kie.workbench.common.stunner.bpmn.backend.service.diagram.WorkItemDefinitionMockRegistry; -import org.kie.workbench.common.stunner.bpmn.backend.workitem.service.WorkItemDefinitionBackendService; import org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask; import org.kie.workbench.common.stunner.bpmn.definition.NoneTask; import org.kie.workbench.common.stunner.bpmn.definition.ScriptTask; import org.kie.workbench.common.stunner.bpmn.definition.UserTask; import org.kie.workbench.common.stunner.bpmn.definition.morph.BaseTaskMorphPropertyDefinition; +import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; import org.kie.workbench.common.stunner.core.backend.StunnerTestingGraphBackendAPI; import org.kie.workbench.common.stunner.core.backend.definition.adapter.bind.BackendBindableMorphAdapter; import org.kie.workbench.common.stunner.core.backend.service.XMLEncoderDiagramMetadataMarshaller; @@ -91,7 +91,7 @@ protected void init() { doReturn(morphAdapter).when(api.getAdapterRegistry()).getMorphAdapter(eq(BusinessRuleTask.class)); workItemDefinitionMockRegistry = new WorkItemDefinitionMockRegistry(); - WorkItemDefinitionBackendService widService = mock(WorkItemDefinitionBackendService.class); + WorkItemDefinitionLookupService widService = mock(WorkItemDefinitionLookupService.class); when(widService.execute(any(Metadata.class))).thenReturn(workItemDefinitionMockRegistry.items()); marshaller = new BPMNDirectDiagramMarshaller( @@ -134,5 +134,4 @@ protected Definitions convertToDefinitions(Diagram d) { protected InputStream getStream(String data) { return new ByteArrayInputStream(data.getBytes(StandardCharsets.UTF_8)); } - } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/marshalling/tasks/ServiceTaskTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/marshalling/tasks/ServiceTaskTest.java index d19cab34316..bb1e98a1cab 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/marshalling/tasks/ServiceTaskTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/marshalling/tasks/ServiceTaskTest.java @@ -16,7 +16,9 @@ package org.kie.workbench.common.stunner.bpmn.backend.service.diagram.marshalling.tasks; -import org.apache.tools.ant.filters.StringInputStream; +import java.io.ByteArrayInputStream; +import java.nio.charset.Charset; + import org.eclipse.bpmn2.Definitions; import org.eclipse.bpmn2.Process; import org.junit.Test; @@ -75,7 +77,7 @@ public void testBasicMarshall() throws Exception { public void testBasicBidi() throws Exception { Diagram d = unmarshall(marshaller, BPMN_SERVICE_TASK_PROPERTIES_FILE_PATH); String marshall = marshaller.marshall(d); - Diagram d2 = Unmarshalling.unmarshall(marshaller, new StringInputStream(marshall)); + Diagram d2 = Unmarshalling.unmarshall(marshaller, new ByteArrayInputStream(marshall.getBytes(Charset.forName("UTF-8")))); Node, ?> node = d2.getGraph().getNode(SERVICE_TASK_ID); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/indexing/BpmnProcessDataEventListenerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/indexing/BpmnProcessDataEventListenerTest.java deleted file mode 100644 index 0ba099aecf9..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/indexing/BpmnProcessDataEventListenerTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.bpmn.backend.service.indexing; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import org.jbpm.process.core.context.variable.Variable; -import org.jbpm.process.core.datatype.impl.type.StringDataType; -import org.junit.Test; -import org.kie.workbench.common.services.refactoring.Resource; -import org.kie.workbench.common.services.refactoring.service.ResourceType; -import org.kie.workbench.common.stunner.bpmn.backend.indexing.BpmnProcessDataEventListener; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.fail; - -public class BpmnProcessDataEventListenerTest { - - @Test - public void testAddDistinctProcessVariables() throws Exception { - Resource processResource = new Resource("org.jbpm.test.testProcess.bpmn2", - ResourceType.BPMN2); - BpmnProcessDataEventListener dataEventListener = new BpmnProcessDataEventListener(); - try { - dataEventListener.addDistinctProcessVariables(getProcessVariables(), - processResource); - Set adderVars = dataEventListener.getUniqueVariables(); - assertNotNull(adderVars); - assertEquals(3, - adderVars.size()); - } catch (IllegalArgumentException e) { - fail("Unable to add process variables: " + e.getMessage()); - } - } - - private List getProcessVariables() { - List processVariables = new ArrayList<>(); - Variable firstName = new Variable(); - firstName.setName("firstName"); - firstName.setType(new StringDataType()); - processVariables.add(firstName); - - Variable lastName = new Variable(); - lastName.setName("lastName"); - lastName.setType(new StringDataType()); - processVariables.add(lastName); - - Variable address = new Variable(); - address.setName("address"); - address.setType(new StringDataType()); - processVariables.add(address); - - // add first name again (could be a subprocess variable also called firstName - Variable subprocessFirstName = new Variable(); - subprocessFirstName.setName("firstName"); - subprocessFirstName.setType(new StringDataType()); - processVariables.add(subprocessFirstName); - - return processVariables; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/query/FindBpmnProcessIdsQueryTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/query/FindBpmnProcessIdsQueryTest.java deleted file mode 100644 index 86e1af5ecd2..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/query/FindBpmnProcessIdsQueryTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.backend.service.query; - -import java.util.HashSet; -import java.util.Set; - -import org.junit.Test; -import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueIndexTerm; -import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueResourceIndexTerm; -import org.kie.workbench.common.services.refactoring.service.ResourceType; -import org.kie.workbench.common.stunner.bpmn.backend.query.FindBpmnProcessIdsQuery; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -public class FindBpmnProcessIdsQueryTest { - - private final static String ERROR_MSG = ResourceType.JAVA.toString() + "' can not be used"; - - @Test - public void findBpmnProcessIdsQueryTermsTest() { - FindBpmnProcessIdsQuery query = new FindBpmnProcessIdsQuery(); - - Set queryTerms = new HashSet<>(); - try { - query.validateTerms(queryTerms); - fail("The required resources term is missing, but no exception was thrown."); - } catch (IllegalArgumentException iae) { - assertTrue("Incorrect error message: " + iae.getMessage(), - iae.getMessage().contains("Expected 'ValueResourceIndexTerm' term was not found.")); - } - - queryTerms = new HashSet<>(); - queryTerms.add(new ValueResourceIndexTerm("not-bpmn2-resources", - ResourceType.JAVA)); - try { - query.validateTerms(queryTerms); - fail("The required resources term is missing, but no exception was thrown."); - } catch (IllegalArgumentException iae) { - assertTrue("Incorrect error message: " + iae.getMessage(), - iae.getMessage().contains(ERROR_MSG)); - } - - queryTerms = new HashSet<>(); - queryTerms.add(new ValueResourceIndexTerm("*", - ResourceType.BPMN2, - ValueIndexTerm.TermSearchType.WILDCARD)); - try { - query.validateTerms(queryTerms); - } catch (IllegalArgumentException iae) { - fail("The activation term is acceptable here, but an exception was thrown."); - } - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/workitem/service/WorkItemDefinitionBackendServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/workitem/service/WorkItemDefinitionBackendServiceTest.java deleted file mode 100644 index a23827f5f55..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/workitem/service/WorkItemDefinitionBackendServiceTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.backend.workitem.service; - -import java.util.Arrays; -import java.util.Collection; -import java.util.function.BiPredicate; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.bpmn.backend.workitem.deploy.WorkItemDefinitionDeployServices; -import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; -import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class WorkItemDefinitionBackendServiceTest { - - private static WorkItemDefinition wid1 = new WorkItemDefinition().setName("wid1"); - private static WorkItemDefinition wid2 = new WorkItemDefinition().setName("wid2"); - - @Mock - private WorkItemDefinitionVFSLookupService vfsService; - - @Mock - private WorkItemDefinitionDeployServices deployServices; - - @Mock - private BiPredicate> deployPredicate; - - @Mock - private Metadata metadata; - - private WorkItemDefinitionBackendService tested; - private WorkItemDefinitionCacheRegistry registry; - - @Before - public void init() { - when(vfsService.search(eq(metadata))).thenReturn(Arrays.asList(wid1, - wid2)); - registry = new WorkItemDefinitionCacheRegistry(); - tested = new WorkItemDefinitionBackendService(registry, - vfsService, - deployServices, - deployPredicate); - } - - @Test - public void testGetRegistry() { - assertEquals(registry, tested.getRegistry()); - } - - @Test - public void testExecute() { - Collection result = tested.execute(metadata); - assertFalse(result.isEmpty()); - assertEquals(2, result.size()); - assertTrue(result.contains(wid1)); - assertTrue(result.contains(wid2)); - } - - @Test - public void testDestroy() { - tested.execute(metadata); - assertFalse(registry.isEmpty()); - tested.destroy(); - assertTrue(registry.isEmpty()); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/resources/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/flightBooking.bpmn b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/resources/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/flightBooking.bpmn new file mode 100644 index 00000000000..b324eb47903 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/resources/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/flightBooking.bpmn @@ -0,0 +1,106 @@ + + + + + + + + + + + + Message_1 + Message_2 + + + + + + + + + + + + + + + + + + + SequenceFlow_2 + + + + + + + + SequenceFlow_2 + SequenceFlow_1 + + + + + DataInput_1 + + + DataOutput_1 + + + + trip + DataInput_1 + + + DataOutput_1 + flight + + + + + + + + + SequenceFlow_1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/resources/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/travels.bpmn b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/resources/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/travels.bpmn new file mode 100644 index 00000000000..050b0bdad43 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/resources/org/kie/workbench/common/stunner/bpmn/backend/service/diagram/travels.bpmn @@ -0,0 +1,490 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + SequenceFlow_1 + + + + + + + + SequenceFlow_1 + SequenceFlow_2 + + + + + + DataInput_19 + DataInput_20 + + + DataOutput_1 + + + + traveller + DataInput_19 + + + trip + DataInput_20 + + + DataOutput_1 + trip + + + + SequenceFlow_2 + SequenceFlow_3 + SequenceFlow_4 + + + + + + + + SequenceFlow_3 + SequenceFlow_5 + + + + + + + + + + + + + + DataInput_1 + DataInput_2 + DataInput_3 + DataInput_4 + DataInput_5 + DataInput_6 + DataInput_7 + DataInput_8 + DataInput_9 + DataInput_21 + DataInput_22 + + + + + DataInput_1 + + VisaApplication + DataInput_1 + + + + DataInput_2 + + 1 + DataInput_2 + + + + DataInput_3 + + + DataInput_4 + + + DataInput_5 + + + DataInput_6 + + true + DataInput_6 + + + + DataInput_7 + + + DataInput_8 + + en-UK + DataInput_8 + + + + DataInput_9 + + + trip + DataInput_21 + + + traveller + DataInput_22 + + + + SequenceFlow_4 + SequenceFlow_5 + SequenceFlow_6 + + + + + return trip.isVisaRequired(); + + + return !trip.isVisaRequired(); + + + + SequenceFlow_6 + SequenceFlow_7 + SequenceFlow_8 + + + + + + + + + SequenceFlow_7 + SequenceFlow_10 + + + + + + DataInput_23 + DataInput_24 + + + DataOutput_2 + + + + traveller + DataInput_23 + + + trip + DataInput_24 + + + DataOutput_2 + hotel + + + + + + + + + SequenceFlow_8 + SequenceFlow_9 + + + + + + DataInput_25 + DataInput_26 + + + DataOutput_3 + + + + traveller + DataInput_25 + + + trip + DataInput_26 + + + DataOutput_3 + flight + + + + + + SequenceFlow_9 + SequenceFlow_10 + SequenceFlow_11 + + + + + + + + + + SequenceFlow_11 + SequenceFlow_12 + + + + + + + + + + + + + + DataInput_10 + DataInput_11 + DataInput_12 + DataInput_13 + DataInput_14 + DataInput_15 + DataInput_16 + DataInput_17 + DataInput_18 + DataInput_27 + DataInput_28 + + + + + DataInput_10 + + ConfirmTravel + DataInput_10 + + + + DataInput_11 + + 1 + DataInput_11 + + + + DataInput_12 + + + DataInput_13 + + + DataInput_14 + + + DataInput_15 + + true + DataInput_15 + + + + DataInput_16 + + + DataInput_17 + + en-UK + DataInput_17 + + + + DataInput_18 + + + flight + DataInput_27 + + + hotel + DataInput_28 + + + + + + + + + + SequenceFlow_12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/pom.xml index 104121befc1..4a33e0e31e3 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/pom.xml @@ -49,6 +49,16 @@ kie-wb-common-stunner-client-api + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-api + + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client + + org.kie.workbench.stunner kie-wb-common-stunner-core-common @@ -160,10 +170,16 @@ provided + + com.google.elemental2 elemental2-dom - provided + + + + com.google.elemental2 + elemental2-promise @@ -223,16 +239,6 @@ uberfire-client-api - - org.uberfire - uberfire-security-management-api - - - - org.uberfire - uberfire-security-management-client - - org.jboss.errai errai-data-binding @@ -305,6 +311,13 @@ test-jar + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client + test + test-jar + + org.assertj assertj-core diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/BPMNCommonActionsToolboxFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/BPMNCommonActionsToolboxFactory.java deleted file mode 100644 index c6bde76d133..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/BPMNCommonActionsToolboxFactory.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.canvas.controls; - -import java.util.Collection; - -import javax.annotation.PreDestroy; -import javax.enterprise.context.Dependent; -import javax.enterprise.inject.Any; -import javax.inject.Inject; - -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.kie.workbench.common.stunner.bpmn.client.canvas.controls.util.ActionsToolboxHelper; -import org.kie.workbench.common.stunner.bpmn.qualifiers.BPMN; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.AbstractActionsToolboxFactory; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxView; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.CommonActionsToolbox; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ToolboxAction; -import org.kie.workbench.common.stunner.core.graph.Element; -import org.kie.workbench.common.stunner.forms.client.components.toolbox.FormGenerationToolboxAction; - -/** - * Produces same toolbox content and view as the @CommonActionsToolbox but - * it additionally add the form generation action, if it applies. - */ -@Dependent -@BPMN -public class BPMNCommonActionsToolboxFactory extends AbstractActionsToolboxFactory { - - private final ManagedInstance generateFormsActions; - private final ManagedInstance views; - private final ActionsToolboxHelper actionsToolboxHelper; - - protected BPMNCommonActionsToolboxFactory() { - this.generateFormsActions = null; - this.views = null; - this.actionsToolboxHelper = null; - } - - @Inject - public BPMNCommonActionsToolboxFactory(final @Any ManagedInstance generateFormsActions, - final @Any @CommonActionsToolbox ManagedInstance views, - final ActionsToolboxHelper actionsToolboxHelper) { - this.generateFormsActions = generateFormsActions; - this.views = views; - this.actionsToolboxHelper = actionsToolboxHelper; - } - - @Override - protected ActionsToolboxView newViewInstance() { - return views.get(); - } - - @Override - public Collection> getActions(final AbstractCanvasHandler canvasHandler, - final Element e) { - return actionsToolboxHelper.getActions(canvasHandler, e); - } - - @PreDestroy - public void destroy() { - generateFormsActions.destroyAll(); - views.destroyAll(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/BPMNToolboxControl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/BPMNToolboxControl.java deleted file mode 100644 index c7a0ffdbe34..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/BPMNToolboxControl.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.canvas.controls; - -import java.util.Arrays; -import java.util.List; - -import javax.annotation.PreDestroy; -import javax.enterprise.context.Dependent; -import javax.enterprise.inject.Any; -import javax.inject.Inject; - -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.kie.workbench.common.stunner.bpmn.qualifiers.BPMN; -import org.kie.workbench.common.stunner.core.client.canvas.controls.toolbox.AbstractToolboxControl; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxFactory; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.FlowActionsToolbox; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.MorphActionsToolbox; - -/** - * Custom toolbox control for BPMN, which includes additional items. - */ -@Dependent -@BPMN -public class BPMNToolboxControl extends AbstractToolboxControl { - - private final ManagedInstance flowActionsToolboxFactories; - private final ManagedInstance morphActionsToolboxFactories; - private final ManagedInstance bpmnCommonActionsToolboxFactories; - - @Inject - public BPMNToolboxControl(final @Any @FlowActionsToolbox ManagedInstance flowActionsToolboxFactories, - final @Any @MorphActionsToolbox ManagedInstance morphActionsToolboxFactories, - final @Any @BPMN ManagedInstance bpmnCommonActionsToolboxFactories) { - this.flowActionsToolboxFactories = flowActionsToolboxFactories; - this.morphActionsToolboxFactories = morphActionsToolboxFactories; - this.bpmnCommonActionsToolboxFactories = bpmnCommonActionsToolboxFactories; - } - - @Override - protected List getFactories() { - return Arrays.asList(flowActionsToolboxFactories.get(), - morphActionsToolboxFactories.get(), - bpmnCommonActionsToolboxFactories.get()); - } - - @PreDestroy - @Override - public void destroy() { - super.destroy(); - flowActionsToolboxFactories.destroyAll(); - morphActionsToolboxFactories.destroyAll(); - bpmnCommonActionsToolboxFactories.destroyAll(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/util/ActionsToolboxHelper.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/util/ActionsToolboxHelper.java deleted file mode 100644 index 00aeff7b43e..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/util/ActionsToolboxHelper.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.canvas.controls.util; - -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; - -import javax.enterprise.context.Dependent; -import javax.enterprise.inject.Any; -import javax.inject.Inject; - -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.kie.workbench.common.stunner.bpmn.client.forms.util.ContextUtils; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxFactory; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.CommonActionsToolbox; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ToolboxAction; -import org.kie.workbench.common.stunner.core.graph.Element; -import org.kie.workbench.common.stunner.forms.client.components.toolbox.FormGenerationToolboxAction; - -@Dependent -public class ActionsToolboxHelper { - - private final ActionsToolboxFactory commonActionToolbox; - private final ManagedInstance generateFormsActions; - - @Inject - public ActionsToolboxHelper(final @CommonActionsToolbox ActionsToolboxFactory commonActionToolbox, - final @Any ManagedInstance generateFormsActions) { - this.commonActionToolbox = commonActionToolbox; - this.generateFormsActions = generateFormsActions; - } - - @SuppressWarnings("all") - public Collection> getActions(final AbstractCanvasHandler canvasHandler, - final Element e) { - final List> actions = new LinkedList<>(); - actions.addAll(commonActionToolbox.getActions(canvasHandler, e)); - if (ContextUtils.isFormGenerationSupported(e)) { - actions.add(generateFormsActions.get()); - } - return actions; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/CalledElementFormProvider.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/CalledElementFormProvider.java new file mode 100644 index 00000000000..3de65d0af8f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/CalledElementFormProvider.java @@ -0,0 +1,53 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.bpmn.client.dataproviders; + +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import javax.enterprise.event.Event; +import javax.inject.Inject; + +import org.kie.workbench.common.forms.dynamic.model.config.SelectorData; +import org.kie.workbench.common.forms.dynamic.model.config.SelectorDataProvider; +import org.kie.workbench.common.forms.dynamic.service.shared.FormRenderingContext; +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RequestProcessDataEvent; + +public class CalledElementFormProvider implements SelectorDataProvider { + + @Inject + ProcessesDataProvider dataProvider; + + @Inject + Event requestProcessDataEvent; + + @Override + public String getProviderName() { + return getClass().getSimpleName(); + } + + @Override + @SuppressWarnings("unchecked") + public SelectorData getSelectorData(final FormRenderingContext context) { + requestProcessDataEvent.fire(new RequestProcessDataEvent()); + return new SelectorData(toMap(dataProvider.getProcessIds()), null); + } + + private static Map toMap(final Iterable items) { + return StreamSupport.stream(items.spliterator(), false).collect(Collectors.toMap(s -> s, s -> s)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/ProcessesDataProvider.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/ProcessesDataProvider.java new file mode 100644 index 00000000000..05c0f27d0cd --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/ProcessesDataProvider.java @@ -0,0 +1,69 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.dataproviders; + +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.event.Observes; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.ProcessDataEvent; +import org.kie.workbench.common.stunner.forms.client.session.StunnerFormsHandler; + +import static java.util.Arrays.stream; + +@ApplicationScoped +public class ProcessesDataProvider { + + private final StunnerFormsHandler formsHandler; + final List processIds; + + // CDI proxy. + public ProcessesDataProvider() { + this(null); + } + + @Inject + public ProcessesDataProvider(final StunnerFormsHandler formsHandler) { + this.formsHandler = formsHandler; + this.processIds = new LinkedList<>(); + } + + public List getProcessIds() { + return processIds; + } + + void onProcessesUpdatedEvent(final @Observes ProcessDataEvent event) { + setProcessIds(toList(event.getProcessIds())); + } + + private void setProcessIds(final List ids) { + if (!processIds.equals(ids)) { + processIds.clear(); + processIds.addAll(ids); + formsHandler.refreshCurrentSessionForms(BPMNDefinitionSet.class); + } + } + + private static List toList(final String[] s) { + return stream(s).collect(Collectors.toList()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/RuleFlowGroupDataProvider.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/RuleFlowGroupDataProvider.java new file mode 100644 index 00000000000..e8f997ec773 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/RuleFlowGroupDataProvider.java @@ -0,0 +1,69 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.dataproviders; + +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.event.Observes; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RuleFlowGroupDataEvent; +import org.kie.workbench.common.stunner.forms.client.session.StunnerFormsHandler; + +import static java.util.Arrays.stream; + +@ApplicationScoped +public class RuleFlowGroupDataProvider { + + private final StunnerFormsHandler formsHandler; + final List groupNames; + + // CDI proxy. + public RuleFlowGroupDataProvider() { + this(null); + } + + @Inject + public RuleFlowGroupDataProvider(final StunnerFormsHandler formsHandler) { + this.formsHandler = formsHandler; + this.groupNames = new LinkedList<>(); + } + + public List getRuleFlowGroupNames() { + return groupNames; + } + + void onRuleFlowGroupDataChanged(final @Observes RuleFlowGroupDataEvent event) { + setRuleFlowGroupNames(toList(event.getGroupNames())); + } + + private void setRuleFlowGroupNames(final List names) { + if (!groupNames.equals(names)) { + groupNames.clear(); + groupNames.addAll(names); + formsHandler.refreshCurrentSessionForms(BPMNDefinitionSet.class); + } + } + + private static List toList(final String[] s) { + return stream(s).collect(Collectors.toList()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/RuleFlowGroupFormProvider.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/RuleFlowGroupFormProvider.java new file mode 100644 index 00000000000..d64ef2035ec --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/RuleFlowGroupFormProvider.java @@ -0,0 +1,56 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.dataproviders; + +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import javax.enterprise.context.Dependent; +import javax.enterprise.event.Event; +import javax.inject.Inject; + +import org.kie.workbench.common.forms.dynamic.model.config.SelectorData; +import org.kie.workbench.common.forms.dynamic.model.config.SelectorDataProvider; +import org.kie.workbench.common.forms.dynamic.service.shared.FormRenderingContext; +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RequestRuleFlowGroupDataEvent; + +@Dependent +public class RuleFlowGroupFormProvider implements SelectorDataProvider { + + @Inject + Event requestRuleFlowGroupDataEvent; + + @Inject + RuleFlowGroupDataProvider dataProvider; + + @Override + public String getProviderName() { + return getClass().getSimpleName(); + } + + @Override + @SuppressWarnings("unchecked") + public SelectorData getSelectorData(final FormRenderingContext context) { + requestRuleFlowGroupDataEvent.fire(new RequestRuleFlowGroupDataEvent()); + return new SelectorData(toMap(dataProvider.getRuleFlowGroupNames()), null); + } + + private static Map toMap(final Iterable items) { + return StreamSupport.stream(items.spliterator(), false).collect(Collectors.toMap(s -> s, s -> s)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/diagram/DiagramTypeClientService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/diagram/DiagramTypeClientService.java new file mode 100644 index 00000000000..78af247eb13 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/diagram/DiagramTypeClientService.java @@ -0,0 +1,27 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.diagram; + +import org.kie.workbench.common.stunner.bpmn.service.ProjectType; +import org.kie.workbench.common.stunner.core.diagram.Metadata; + +public interface DiagramTypeClientService { + + void loadDiagramType(Metadata metadata); + + ProjectType getProjectType(Metadata metadata); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/diagram/DiagramTypeService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/diagram/DiagramTypeService.java deleted file mode 100644 index 7e948c89a83..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/diagram/DiagramTypeService.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.diagram; - -import org.kie.workbench.common.stunner.bpmn.service.ProjectType; -import org.kie.workbench.common.stunner.core.diagram.Metadata; - -public interface DiagramTypeService { - - void loadDiagramType(Metadata metadata); - - ProjectType getProjectType(Metadata metadata); -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/diagram/DiagramTypeServiceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/diagram/DiagramTypeServiceImpl.java deleted file mode 100644 index cffde25a7ff..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/diagram/DiagramTypeServiceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.diagram; - -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; - -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.Observes; -import javax.inject.Inject; - -import org.jboss.errai.common.client.api.Caller; -import org.kie.workbench.common.stunner.bpmn.service.BPMNDiagramService; -import org.kie.workbench.common.stunner.bpmn.service.ProjectType; -import org.kie.workbench.common.stunner.core.client.session.event.SessionDestroyedEvent; -import org.kie.workbench.common.stunner.core.diagram.Metadata; - -@ApplicationScoped -public class DiagramTypeServiceImpl implements DiagramTypeService { - - private final Caller bpmnDiagramService; - private static final Map projectTypeRegistry = new HashMap<>(); - - DiagramTypeServiceImpl() { - this(null); - } - - @Inject - public DiagramTypeServiceImpl(Caller bpmnDiagramService) { - this.bpmnDiagramService = bpmnDiagramService; - } - - @Override - public void loadDiagramType(Metadata metadata) { - bpmnDiagramService - .call((r) -> setProjectType(metadata, (ProjectType) r)) - .getProjectType(metadata.getRoot()); - } - - void setProjectType(final Metadata metadata, final ProjectType projectType) { - projectTypeRegistry.put(getDiagramId(metadata), projectType); - } - - private String getDiagramId(Metadata metadata) { - return metadata.getCanvasRootUUID(); - } - - @Override - public ProjectType getProjectType(final Metadata metadata) { - return Optional.ofNullable(projectTypeRegistry.get(getDiagramId(metadata))) - .orElse(ProjectType.BPMN); - } - - protected void onSessionClosed(@Observes final SessionDestroyedEvent event) { - projectTypeRegistry.remove(getDiagramId(event.getMetadata())); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/documentation/ClientBPMNDocumentationService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/documentation/ClientBPMNDocumentationService.java index 43f09d0b3d5..4d2cb3a6f9c 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/documentation/ClientBPMNDocumentationService.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/documentation/ClientBPMNDocumentationService.java @@ -28,18 +28,19 @@ import java.util.stream.StreamSupport; import javax.enterprise.context.Dependent; +import javax.enterprise.inject.Default; import javax.inject.Inject; import com.google.gwt.core.client.GWT; import org.jboss.errai.common.client.api.IsElement; import org.jboss.errai.common.client.dom.HTMLElement; +import org.jboss.errai.ioc.client.api.ManagedInstance; import org.kie.soup.commons.util.Maps; import org.kie.workbench.common.stunner.bpmn.client.components.palette.BPMNCategoryDefinitionProvider; import org.kie.workbench.common.stunner.bpmn.client.documentation.decorator.PropertyDecorator; import org.kie.workbench.common.stunner.bpmn.client.documentation.decorator.PropertyDecorators; import org.kie.workbench.common.stunner.bpmn.client.documentation.template.BPMNDocumentationTemplateSource; import org.kie.workbench.common.stunner.bpmn.client.shape.factory.BPMNShapeFactory; -import org.kie.workbench.common.stunner.bpmn.client.workitem.WorkItemDefinitionClientRegistry; import org.kie.workbench.common.stunner.bpmn.definition.BPMNCategories; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; @@ -93,6 +94,7 @@ import org.kie.workbench.common.stunner.bpmn.workitem.IconDefinition; import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTask; import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistry; import org.kie.workbench.common.stunner.client.widgets.components.glyph.DOMGlyphRenderers; import org.kie.workbench.common.stunner.core.api.DefinitionManager; import org.kie.workbench.common.stunner.core.client.api.SessionManager; @@ -131,7 +133,7 @@ public class ClientBPMNDocumentationService implements BPMNDocumentationService private final BPMNCategoryDefinitionProvider categoryDefinitionProvider; private final DOMGlyphRenderers glyphRenderer; private final ClientTranslationService translationService; - private final WorkItemDefinitionClientRegistry workItemDefinitionClientRegistry; + private final ManagedInstance workItemDefinitionRegistry; private final DefinitionHelper definitionHelper; private final PropertyDecorators propertyDecorators; @@ -145,7 +147,7 @@ public ClientBPMNDocumentationService(final ClientMustacheTemplateRenderer musta final BPMNCategoryDefinitionProvider categoryDefinitionProvider, final DOMGlyphRenderers glyphRenderer, final ClientTranslationService translationService, - final WorkItemDefinitionClientRegistry workItemDefinitionClientRegistry, + final @Default ManagedInstance workItemDefinitionRegistry, final PropertyDecorators propertyDecorators ) { @@ -158,7 +160,7 @@ public ClientBPMNDocumentationService(final ClientMustacheTemplateRenderer musta this.categoryDefinitionProvider = categoryDefinitionProvider; this.glyphRenderer = glyphRenderer; this.translationService = translationService; - this.workItemDefinitionClientRegistry = workItemDefinitionClientRegistry; + this.workItemDefinitionRegistry = workItemDefinitionRegistry; this.propertyDecorators = propertyDecorators; definitionHelper = new DefinitionHelper(); } @@ -464,8 +466,8 @@ private Optional getServiceTaskIcon(Object definition) { .filter(def -> def instanceof ServiceTask) .map(def -> (ServiceTask) def) .map(ServiceTask::getName) - .map(name -> Optional.ofNullable(workItemDefinitionClientRegistry - .getRegistry() + .map(name -> Optional.ofNullable(workItemDefinitionRegistry + .get() .get(name)) .map(WorkItemDefinition::getIconDefinition) .map(IconDefinition::getIconData).orElse(null)) @@ -487,8 +489,8 @@ private Optional getServiceTaskCategory(Object definition) { .filter(def -> def instanceof ServiceTask) .map(def -> (ServiceTask) def) .map(ServiceTask::getName) - .map(name -> Optional.ofNullable(workItemDefinitionClientRegistry - .getRegistry() + .map(name -> Optional.ofNullable(workItemDefinitionRegistry + .get() .get(name)) .map(WorkItemDefinition::getCategory) .orElse(null)); @@ -505,8 +507,8 @@ public String getCategoryIcon(String category) { .map(HTMLElement::getInnerHTML) //try to get the service task icon if category icon is not found .orElseGet(() -> Optional.ofNullable(category) - .map(name -> workItemDefinitionClientRegistry - .getRegistry() + .map(name -> workItemDefinitionRegistry + .get() .items() .stream() .filter(wid -> Objects.equals(wid.getCategory(), category)) diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/DataTypeNamesService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/DataTypeNamesService.java new file mode 100644 index 00000000000..3d3d607ad2a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/DataTypeNamesService.java @@ -0,0 +1,28 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.forms; + +import java.util.List; + +import org.kie.workbench.common.stunner.kogito.api.Kogito; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientService; +import org.uberfire.backend.vfs.Path; + +@Kogito +public interface DataTypeNamesService extends KogitoClientService> { + +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/AssigneeLiveSearchService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/AssigneeLiveSearchService.java new file mode 100644 index 00000000000..9e48074732f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/AssigneeLiveSearchService.java @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor; + +import java.util.function.Consumer; + +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.widget.AssigneeLiveSearchEntryCreationEditor; +import org.kie.workbench.common.stunner.bpmn.forms.model.AssigneeType; +import org.kie.workbench.common.stunner.kogito.api.Kogito; +import org.uberfire.ext.widgets.common.client.dropdown.EntryCreationLiveSearchService; + +@Kogito +public interface AssigneeLiveSearchService + extends EntryCreationLiveSearchService { + + void init(AssigneeType type); + + void addCustomEntry(String customEntry); + + void setSearchErrorHandler(Consumer searchErrorHandler); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/AssigneeLocalSearchService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/AssigneeLocalSearchService.java new file mode 100644 index 00000000000..83baa3f95b1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/AssigneeLocalSearchService.java @@ -0,0 +1,114 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.widget.AssigneeLiveSearchEntryCreationEditor; +import org.uberfire.ext.widgets.common.client.dropdown.EntryCreationLiveSearchService; +import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchCallback; +import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchResults; + +import static org.kie.workbench.common.stunner.core.util.StringUtils.isEmpty; + +public class AssigneeLocalSearchService + implements EntryCreationLiveSearchService { + + private final AssigneeLiveSearchEntryCreationEditor editor; + private final List customEntries; + + public static AssigneeLocalSearchService build(final AssigneeLiveSearchEntryCreationEditor editor) { + return new AssigneeLocalSearchService(editor); + } + + private AssigneeLocalSearchService(final AssigneeLiveSearchEntryCreationEditor editor) { + this.editor = editor; + this.customEntries = new ArrayList<>(); + editor.setCustomEntryCommand(this::addCustomEntry); + } + + public void addCustomEntry(final String customEntry) { + if (!isEmpty(customEntry)) { + customEntries.add(customEntry); + } + } + + public LiveSearchResults search(final String pattern, + final int maxResults) { + final Collection items = search(pattern); + return createSearchResults(items, maxResults); + } + + public List search(final String pattern) { + final List filteredCustomEntries; + if (pattern == null || pattern.isEmpty()) { + filteredCustomEntries = customEntries; + } else { + filteredCustomEntries = customEntries.stream() + .filter(entry -> entry.contains(pattern)) + .collect(Collectors.toList()); + } + return filteredCustomEntries; + } + + @Override + public void search(final String pattern, + final int maxResults, + final LiveSearchCallback callback) { + final LiveSearchResults searchResults = search(pattern, maxResults); + callback.afterSearch(searchResults); + } + + @Override + public void searchEntry(final String key, + final LiveSearchCallback callback) { + LiveSearchResults results = new LiveSearchResults<>(1); + if (key != null) { + if (!customEntries.contains(key)) { + addCustomEntry(key); + } + results.add(key, key); + } + callback.afterSearch(results); + } + + public static LiveSearchResults createSearchResults(final Collection values, + final int maxAllowedResults) { + final int maxResults = values.size() > maxAllowedResults ? maxAllowedResults : values.size(); + final LiveSearchResults results = new LiveSearchResults<>(maxResults); + new ArrayList<>(values) + .subList(0, maxResults) + .forEach(value -> results.add(value, value)); + return results; + } + + @Override + public AssigneeLiveSearchEntryCreationEditor getEditor() { + return editor; + } + + public List getCustomEntries() { + return customEntries; + } + + public void destroy() { + customEntries.clear(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeListItem.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeListItem.java index 8c58f39a71a..00af9e70059 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeListItem.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeListItem.java @@ -19,6 +19,7 @@ import javax.enterprise.context.Dependent; import javax.inject.Inject; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.AssigneeLiveSearchService; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.Assignee; import org.kie.workbench.common.stunner.bpmn.forms.model.AssigneeType; import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchDropDown; @@ -42,12 +43,17 @@ public class AssigneeListItem { private ParameterizedCommand removeCommand; @Inject - public AssigneeListItem(LiveSearchDropDown liveSearchDropDown, AssigneeLiveSearchService liveSearchService) { + public AssigneeListItem(final LiveSearchDropDown liveSearchDropDown, + final AssigneeLiveSearchService liveSearchService) { this.liveSearchDropDown = liveSearchDropDown; this.liveSearchService = liveSearchService; } - public void init(AssigneeType type, Assignee assignee, Command notifyChangeCommand, ParameterizedCommand removeCommand, ParameterizedCommand errorCommand) { + public void init(final AssigneeType type, + final Assignee assignee, + final Command notifyChangeCommand, + final ParameterizedCommand removeCommand, + final ParameterizedCommand errorCommand) { this.assignee = assignee; this.notifyChangeCommand = notifyChangeCommand; this.removeCommand = removeCommand; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeLiveSearchService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeLiveSearchService.java deleted file mode 100644 index 110f99c2262..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeLiveSearchService.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.widget; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.TreeSet; -import java.util.function.Consumer; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.stream.Collectors; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import org.jboss.errai.bus.client.api.messaging.Message; -import org.jboss.errai.common.client.api.ErrorCallback; -import org.jboss.errai.common.client.api.RemoteCallback; -import org.jboss.errai.security.shared.api.Group; -import org.jboss.errai.security.shared.api.identity.User; -import org.kie.workbench.common.stunner.bpmn.forms.model.AssigneeType; -import org.uberfire.ext.security.management.api.AbstractEntityManager; -import org.uberfire.ext.security.management.client.ClientUserSystemManager; -import org.uberfire.ext.security.management.impl.SearchRequestImpl; -import org.uberfire.ext.widgets.common.client.dropdown.EntryCreationLiveSearchService; -import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchCallback; -import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchResults; - -import static org.kie.workbench.common.stunner.core.util.StringUtils.isEmpty; - -@Dependent -public class AssigneeLiveSearchService implements EntryCreationLiveSearchService { - - private static final Logger LOGGER = Logger.getLogger(AssigneeLiveSearchService.class.getName()); - - private AssigneeType type = AssigneeType.USER; - - private ClientUserSystemManager userSystemManager; - - private AssigneeLiveSearchEntryCreationEditor editor; - - private List customEntries = new ArrayList<>(); - - private Consumer searchErrorHandler; - - public AssigneeLiveSearchService() { - /* due to spotbugs error commented out - this(null, null); */ - } - - @Inject - public AssigneeLiveSearchService(ClientUserSystemManager userSystemManager, AssigneeLiveSearchEntryCreationEditor editor) { - this.userSystemManager = userSystemManager; - this.editor = editor; - - editor.setCustomEntryCommand(this::addCustomEntry); - } - - public void init(AssigneeType type) { - this.type = type; - } - - public void addCustomEntry(String customEntry) { - if (!isEmpty(customEntry)) { - customEntries.add(customEntry); - } - } - - public void setSearchErrorHandler(Consumer searchErrorHandler) { - this.searchErrorHandler = searchErrorHandler; - } - - @Override - public void search(final String pattern, final int maxResults, final LiveSearchCallback callback) { - - final List filteredCustomEntries; - - if (pattern == null || pattern.isEmpty()) { - filteredCustomEntries = customEntries; - } else { - filteredCustomEntries = customEntries.stream() - .filter(entry -> entry.contains(pattern)) - .collect(Collectors.toList()); - } - - RemoteCallback> searchResponseRemoteCallback = response -> processFilterResponse(response, filteredCustomEntries, maxResults, callback); - - ErrorCallback searchErrorCallback = (message, throwable) -> processSearchError(filteredCustomEntries, maxResults, callback, throwable); - - SearchRequestImpl request = new SearchRequestImpl(pattern, 1, maxResults); - - if (AssigneeType.USER.equals(type)) { - userSystemManager.users(searchResponseRemoteCallback, searchErrorCallback).search(request); - } else { - userSystemManager.groups(searchResponseRemoteCallback, searchErrorCallback).search(request); - } - } - - @Override - public void searchEntry(String key, LiveSearchCallback callback) { - - SearchRequestImpl request = new SearchRequestImpl(key, 1, 1); - - ErrorCallback searchErrorCallback = (message, throwable) -> processSearchEntryError(key, callback, throwable); - - RemoteCallback> searchResponseRemoteCallback = response -> searchEntry(key, response, callback); - - if (AssigneeType.USER.equals(type)) { - userSystemManager.users(searchResponseRemoteCallback, searchErrorCallback).search(request); - } else { - userSystemManager.groups(searchResponseRemoteCallback, searchErrorCallback).search(request); - } - } - - private boolean processSearchEntryError(String key, LiveSearchCallback callback, Throwable throwable) { - LiveSearchResults results = new LiveSearchResults<>(1); - if (!isEmpty(key)) { - addCustomEntry(key); - results.add(key, key); - } - callback.afterSearch(results); - processError("It was not possible to get user or group: " + key + " from the users system.", throwable); - return false; - } - - private boolean processSearchError(List filteredCustomEntries, int maxResults, LiveSearchCallback callback, Throwable throwable) { - int maxSize = maxResults > filteredCustomEntries.size() ? filteredCustomEntries.size() : maxResults; - maxSize = maxSize < 0 ? 0 : maxSize; - LiveSearchResults result = new LiveSearchResults<>(maxSize); - filteredCustomEntries.subList(0, maxSize).forEach(entry -> result.add(entry, entry)); - callback.afterSearch(result); - processError("It was not possible to execute search on the users system.", throwable); - return false; - } - - private void processError(String errorMessage, Throwable throwable) { - LOGGER.log(Level.SEVERE, errorMessage, throwable); - if (searchErrorHandler != null) { - searchErrorHandler.accept(throwable); - } - } - - private void searchEntry(String key, AbstractEntityManager.SearchResponse response, LiveSearchCallback liveSearchCallback) { - - LiveSearchResults results = new LiveSearchResults<>(1); - - if (key != null) { - if (!customEntries.contains(key)) { - Optional exists = response.getResults().stream().filter(item -> { - - String value = null; - - if (item instanceof User) { - value = ((User) item).getIdentifier(); - } else if (item instanceof Group) { - value = ((Group) item).getName(); - } - - return key.equals(value); - }).findAny(); - - if (!exists.isPresent()) { - addCustomEntry(key); - } - } - results.add(key, key); - } - - liveSearchCallback.afterSearch(results); - } - - protected void processFilterResponse(AbstractEntityManager.SearchResponse response, List filteredCustomEntries, int maxResults, LiveSearchCallback liveSearchCallback) { - - Set values = new TreeSet<>(filteredCustomEntries); - - response.getResults().forEach(item -> { - String value = null; - - if (item instanceof User) { - value = ((User) item).getIdentifier(); - } else if (item instanceof Group) { - value = ((Group) item).getName(); - } - - if (value != null) { - values.add(value); - } - }); - - if (maxResults > values.size()) { - maxResults = values.size(); - } - - LiveSearchResults results = new LiveSearchResults<>(maxResults); - - new ArrayList<>(values) - .subList(0, maxResults) - .forEach(value -> results.add(value, value)); - - liveSearchCallback.afterSearch(results); - } - - @Override - public AssigneeLiveSearchEntryCreationEditor getEditor() { - return editor; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assignmentsEditor/AssignmentsEditorFieldRenderer.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assignmentsEditor/AssignmentsEditorFieldRenderer.java index c0779262ba8..9fe0acb24a4 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assignmentsEditor/AssignmentsEditorFieldRenderer.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assignmentsEditor/AssignmentsEditorFieldRenderer.java @@ -23,7 +23,7 @@ import org.kie.workbench.common.forms.dynamic.client.rendering.formGroups.FormGroup; import org.kie.workbench.common.forms.dynamic.client.rendering.formGroups.impl.def.DefaultFormGroup; import org.kie.workbench.common.forms.dynamic.service.shared.RenderMode; -import org.kie.workbench.common.stunner.bpmn.client.forms.util.ContextUtils; +import org.kie.workbench.common.stunner.bpmn.client.forms.util.BPMNFormsContextUtils; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDefinition; import org.kie.workbench.common.stunner.bpmn.forms.model.AssignmentsEditorFieldDefinition; @@ -47,7 +47,7 @@ protected FormGroup getFormGroup(RenderMode renderMode) { DefaultFormGroup formGroup = formGroupsInstance.get(); assignmentsEditor.setBPMNModel(null); - Object model = ContextUtils.getModel(renderingContext); + Object model = BPMNFormsContextUtils.getModel(renderingContext); if (model instanceof BPMNDefinition) { assignmentsEditor.setBPMNModel((BPMNDefinition) model); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assignmentsEditor/AssignmentsEditorWidget.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assignmentsEditor/AssignmentsEditorWidget.java index 9b011bbbff3..f4e6e86e06d 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assignmentsEditor/AssignmentsEditorWidget.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assignmentsEditor/AssignmentsEditorWidget.java @@ -34,14 +34,11 @@ import com.google.gwt.user.client.ui.HasValue; import org.gwtbootstrap3.client.ui.Button; import org.gwtbootstrap3.client.ui.TextBox; -import org.jboss.errai.bus.client.api.BusErrorCallback; -import org.jboss.errai.bus.client.api.base.MessageBuilder; -import org.jboss.errai.bus.client.api.messaging.Message; -import org.jboss.errai.common.client.api.RemoteCallback; import org.jboss.errai.marshalling.client.Marshalling; import org.jboss.errai.ui.shared.api.annotations.DataField; import org.jboss.errai.ui.shared.api.annotations.EventHandler; import org.jboss.errai.ui.shared.api.annotations.Templated; +import org.kie.workbench.common.stunner.bpmn.client.forms.DataTypeNamesService; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.i18n.StunnerFormsClientFieldsConstants; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentData; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentParser; @@ -52,7 +49,6 @@ import org.kie.workbench.common.stunner.bpmn.definition.BaseTask; import org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask; import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOModel; -import org.kie.workbench.common.stunner.bpmn.service.DataTypesService; import org.kie.workbench.common.stunner.core.client.api.SessionManager; import org.kie.workbench.common.stunner.core.client.canvas.controls.SelectionControl; import org.kie.workbench.common.stunner.core.client.session.ClientSession; @@ -87,6 +83,8 @@ public class AssignmentsEditorWidget extends Composite implements HasValue>() { - public void callback(List dataTypes) { - String formattedDataTypes = formatDataTypes(dataTypes); - String allDataTypes = simpleDataTypes + "," + formattedDataTypes; - showDataIOEditor(allDataTypes.toString()); - } - }, - new BusErrorCallback() { - public boolean error(Message message, - Throwable t) { - notification.fire(new NotificationEvent(StunnerFormsClientFieldsConstants.INSTANCE.Error_retrieving_datatypes(), - NotificationEvent.NotificationType.ERROR)); - showDataIOEditor(simpleDataTypes); - return false; - } - }, - DataTypesService.class).getDataTypeNames(getDiagramPath()); + clientDataTypesService + .call(getDiagramPath()) + .then(dataTypes -> { + String formattedDataTypes = formatDataTypes(dataTypes); + String allDataTypes = simpleDataTypes + "," + formattedDataTypes; + showDataIOEditor(allDataTypes); + return null; + }) + .catch_(exception -> { + notification.fire(new NotificationEvent(StunnerFormsClientFieldsConstants.INSTANCE.Error_retrieving_datatypes(), + NotificationEvent.NotificationType.ERROR)); + showDataIOEditor(simpleDataTypes); + return null; + }); } private Path getDiagramPath() { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorAvailableFunctionsService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorAvailableFunctionsService.java new file mode 100644 index 00000000000..b792fc2cdd1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorAvailableFunctionsService.java @@ -0,0 +1,41 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor; + +import java.util.List; + +import org.kie.workbench.common.stunner.bpmn.forms.conditions.FunctionDef; +import org.kie.workbench.common.stunner.kogito.api.Kogito; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientService; +import org.uberfire.backend.vfs.Path; + +@Kogito +public interface ConditionEditorAvailableFunctionsService + extends KogitoClientService> { + + class Input { + + public final Path path; + public final String clazz; + + public Input(final Path path, + final String clazz) { + this.path = path; + this.clazz = clazz; + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorFieldEditorPresenter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorFieldEditorPresenter.java index 0241cf088ed..0819e775a7c 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorFieldEditorPresenter.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorFieldEditorPresenter.java @@ -19,14 +19,12 @@ import javax.annotation.PostConstruct; import javax.inject.Inject; -import org.jboss.errai.common.client.api.Caller; import org.jboss.errai.common.client.api.IsElement; import org.jboss.errai.common.client.dom.HTMLElement; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.scriptEditor.ScriptTypeFieldEditorPresenter; import org.kie.workbench.common.stunner.bpmn.client.forms.util.FieldEditorPresenter; import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; import org.kie.workbench.common.stunner.bpmn.forms.conditions.Condition; -import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; import org.kie.workbench.common.stunner.bpmn.forms.conditions.GenerateConditionResult; import org.kie.workbench.common.stunner.bpmn.forms.conditions.ParseConditionResult; import org.kie.workbench.common.stunner.bpmn.forms.model.ScriptTypeMode; @@ -71,7 +69,9 @@ public interface View extends UberElement { private final ErrorPopupPresenter errorPopup; - private final Caller editorService; + private final ConditionEditorParsingService conditionEditorParsingService; + + private final ConditionEditorGeneratorService conditionEditorGeneratorService; private final ClientTranslationService translationService; @@ -80,13 +80,15 @@ public ConditionEditorFieldEditorPresenter(final View view, final SimpleConditionEditorPresenter simpleConditionEditor, final ScriptTypeFieldEditorPresenter scriptEditor, final ErrorPopupPresenter errorPopup, - final Caller editorService, + final ConditionEditorParsingService conditionEditorParsingService, + final ConditionEditorGeneratorService conditionEditorGeneratorService, final ClientTranslationService translationService) { this.view = view; this.simpleConditionEditor = simpleConditionEditor; this.scriptEditor = scriptEditor; this.errorPopup = errorPopup; - this.editorService = editorService; + this.conditionEditorParsingService = conditionEditorParsingService; + this.conditionEditorGeneratorService = conditionEditorGeneratorService; this.translationService = translationService; } @@ -123,8 +125,16 @@ public void setValue(ScriptTypeValue value) { if (value != null) { if (isInDefaultLanguage(value)) { if (!isEmpty(value.getScript())) { - editorService.call(result -> onSetValue((ParseConditionResult) result), - (message, throwable) -> onSetValueError(throwable)).parseCondition(value.getScript()); + conditionEditorParsingService + .call(value.getScript()) + .then(result -> { + onSetValue(result); + return null; + }) + .catch_(throwable -> { + onSetValueError((Throwable) throwable); + return null; + }); } else { showSimpleConditionEditor(); } @@ -140,8 +150,16 @@ public void setValue(ScriptTypeValue value) { void onSimpleConditionSelected() { clearError(); if (value != null && !isEmpty(value.getScript())) { - editorService.call(result -> onSimpleConditionSelected((ParseConditionResult) result), - (message, throwable) -> onSimpleConditionSelectedError(throwable)).parseCondition(value.getScript()); + conditionEditorParsingService + .call(value.getScript()) + .then(result -> { + onSimpleConditionSelected(result); + return null; + }) + .catch_(throwable -> { + onSimpleConditionSelectedError((Throwable) throwable); + return null; + }); } else { simpleConditionEditor.setValue(null); showSimpleConditionEditor(); @@ -156,8 +174,16 @@ void onScriptEditorSelected() { void onSimpleConditionChange(Condition oldValue, Condition newValue) { if (simpleConditionEditor.isValid()) { - editorService.call(result -> onSimpleConditionChange((GenerateConditionResult) result), - (message, throwable) -> onSimpleConditionChangeError(throwable)).generateCondition(newValue); + conditionEditorGeneratorService + .call(newValue) + .then(result -> { + onSimpleConditionChange(result); + return null; + }) + .catch_(throwable -> { + onSimpleConditionChangeError((Throwable) throwable); + return null; + }); } else { clearError(); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorGeneratorService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorGeneratorService.java new file mode 100644 index 00000000000..84afd7402da --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorGeneratorService.java @@ -0,0 +1,28 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor; + +import org.kie.workbench.common.stunner.bpmn.forms.conditions.Condition; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.GenerateConditionResult; +import org.kie.workbench.common.stunner.kogito.api.Kogito; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientService; + +@Kogito +public interface ConditionEditorGeneratorService + extends KogitoClientService { + +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorMetadataService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorMetadataService.java new file mode 100644 index 00000000000..f849cf76ffb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorMetadataService.java @@ -0,0 +1,28 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor; + +import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQuery; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQueryResult; +import org.kie.workbench.common.stunner.kogito.api.Kogito; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientService; + +@Kogito +public interface ConditionEditorMetadataService + extends KogitoClientService { + +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorParsingService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorParsingService.java new file mode 100644 index 00000000000..47e6f436a10 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorParsingService.java @@ -0,0 +1,27 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor; + +import org.kie.workbench.common.stunner.bpmn.forms.conditions.ParseConditionResult; +import org.kie.workbench.common.stunner.kogito.api.Kogito; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientService; + +@Kogito +public interface ConditionEditorParsingService + extends KogitoClientService { + +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/FunctionSearchService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/FunctionSearchService.java index c4604d96b1b..731b94b4917 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/FunctionSearchService.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/FunctionSearchService.java @@ -24,8 +24,6 @@ import javax.inject.Inject; -import org.jboss.errai.common.client.api.Caller; -import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; import org.kie.workbench.common.stunner.bpmn.forms.conditions.FunctionDef; import org.kie.workbench.common.stunner.core.client.session.ClientSession; import org.uberfire.backend.vfs.Path; @@ -42,25 +40,30 @@ public class FunctionSearchService implements LiveSearchService { private Map currentFunctions = new HashMap<>(); - private final Caller service; + private final ConditionEditorAvailableFunctionsService availableFunctionsService; private final FunctionNamingService functionNamingService; @Inject - public FunctionSearchService(final Caller service, final FunctionNamingService functionNamingService) { - this.service = service; + public FunctionSearchService(final ConditionEditorAvailableFunctionsService availableFunctionsService, + final FunctionNamingService functionNamingService) { + this.availableFunctionsService = availableFunctionsService; this.functionNamingService = functionNamingService; } - public void init(ClientSession session) { + public void init(final ClientSession session) { this.path = session.getCanvasHandler().getDiagram().getMetadata().getPath(); } - public void reload(String type, Command onSuccess) { - service.call(result -> { - setFunctions((List) result); - onSuccess.execute(); - }).findAvailableFunctions(path, type); + public void reload(final String type, + final Command onSuccess) { + availableFunctionsService + .call(new ConditionEditorAvailableFunctionsService.Input(path, type)) + .then(result -> { + setFunctions(result); + onSuccess.execute(); + return null; + }); } public void clear() { @@ -69,7 +72,9 @@ public void clear() { } @Override - public void search(String pattern, int maxResults, LiveSearchCallback callback) { + public void search(final String pattern, + final int maxResults, + final LiveSearchCallback callback) { LiveSearchResults results = new LiveSearchResults<>(maxResults); options.entrySet().stream() .filter(entry -> entry.getValue().toLowerCase().contains(pattern.toLowerCase())) @@ -78,7 +83,8 @@ public void search(String pattern, int maxResults, LiveSearchCallback ca } @Override - public void searchEntry(String key, LiveSearchCallback callback) { + public void searchEntry(final String key, + final LiveSearchCallback callback) { LiveSearchResults results = new LiveSearchResults<>(); if (options.containsKey(key)) { results.add(key, options.get(key)); @@ -86,11 +92,11 @@ public void searchEntry(String key, LiveSearchCallback callback) { callback.afterSearch(results); } - public FunctionDef getFunction(String function) { + public FunctionDef getFunction(final String function) { return currentFunctions.get(function); } - private void setFunctions(List functions) { + private void setFunctions(final List functions) { currentFunctions = functions.stream().collect(Collectors.toMap(FunctionDef::getName, Function.identity())); options = functions.stream().collect(Collectors.toMap(FunctionDef::getName, functionDef -> functionNamingService.getFunctionName(functionDef.getName()))); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/VariableSearchService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/VariableSearchService.java index bc561ceef01..7a212108f63 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/VariableSearchService.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/VariableSearchService.java @@ -28,14 +28,12 @@ import javax.inject.Inject; -import org.jboss.errai.common.client.api.Caller; import org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; import org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess; import org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess; import org.kie.workbench.common.stunner.bpmn.definition.MultipleInstanceSubprocess; import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseManagementSet; -import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadata; import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQuery; import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQueryResult; @@ -60,7 +58,7 @@ public class VariableSearchService implements LiveSearchService { private static final String CASE_VARIABLE_LABEL_PREFIX = "VariableSearchService.CaseVariableLabelPrefix"; - private final Caller service; + private final ConditionEditorMetadataService metadataService; private final ClientTranslationService translationService; @@ -71,8 +69,9 @@ public class VariableSearchService implements LiveSearchService { private Map optionType = new HashMap<>(); @Inject - public VariableSearchService(final Caller service, final ClientTranslationService translationService) { - this.service = service; + public VariableSearchService(final ConditionEditorMetadataService metadataService, + final ClientTranslationService translationService) { + this.metadataService = metadataService; this.translationService = translationService; } @@ -99,7 +98,13 @@ public void init(ClientSession session) { } Path path = session.getCanvasHandler().getDiagram().getMetadata().getPath(); TypeMetadataQuery query = new TypeMetadataQuery(path, collectedTypes); - service.call(result -> initVariables(collectedVariables.values(), ((TypeMetadataQueryResult) result))).findMetadata(query); + metadataService + .call(query) + .then(result -> { + initVariables(collectedVariables.values(), + result); + return null; + }); } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/notificationsEditor/widget/NotificationEditorWidgetViewImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/notificationsEditor/widget/NotificationEditorWidgetViewImpl.java index b34568e8059..1dfdf9b300a 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/notificationsEditor/widget/NotificationEditorWidgetViewImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/notificationsEditor/widget/NotificationEditorWidgetViewImpl.java @@ -59,7 +59,7 @@ import org.jboss.errai.ui.shared.api.annotations.DataField; import org.jboss.errai.ui.shared.api.annotations.Templated; import org.kie.workbench.common.forms.dynamic.client.rendering.renderers.lov.selector.input.MultipleSelectorInput; -import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.widget.AssigneeLiveSearchService; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.AssigneeLiveSearchService; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.Expiration; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationType; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/reassignmentsEditor/widget/ReassignmentEditorWidgetViewImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/reassignmentsEditor/widget/ReassignmentEditorWidgetViewImpl.java index 803c0ce7d87..e0b438775ca 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/reassignmentsEditor/widget/ReassignmentEditorWidgetViewImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/reassignmentsEditor/widget/ReassignmentEditorWidgetViewImpl.java @@ -40,7 +40,7 @@ import org.jboss.errai.ui.shared.api.annotations.DataField; import org.jboss.errai.ui.shared.api.annotations.Templated; import org.kie.workbench.common.forms.dynamic.client.rendering.renderers.lov.selector.input.MultipleSelectorInput; -import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.widget.AssigneeLiveSearchService; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.AssigneeLiveSearchService; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.ReassignmentRow; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.ReassignmentType; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.reassignmentsEditor.event.ReassignmentEvent; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/variablesEditor/VariablesEditorWidgetViewImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/variablesEditor/VariablesEditorWidgetViewImpl.java index 2bd32f1bc90..8131ee0ba92 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/variablesEditor/VariablesEditorWidgetViewImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/variablesEditor/VariablesEditorWidgetViewImpl.java @@ -38,20 +38,16 @@ import com.google.gwt.user.client.ui.HasValue; import org.gwtbootstrap3.client.ui.Button; import org.gwtbootstrap3.client.ui.constants.IconType; -import org.jboss.errai.bus.client.api.BusErrorCallback; -import org.jboss.errai.bus.client.api.base.MessageBuilder; -import org.jboss.errai.bus.client.api.messaging.Message; -import org.jboss.errai.common.client.api.RemoteCallback; import org.jboss.errai.ui.client.widget.ListWidget; import org.jboss.errai.ui.client.widget.Table; import org.jboss.errai.ui.shared.api.annotations.DataField; import org.jboss.errai.ui.shared.api.annotations.EventHandler; import org.jboss.errai.ui.shared.api.annotations.Templated; +import org.kie.workbench.common.stunner.bpmn.client.forms.DataTypeNamesService; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.i18n.StunnerFormsClientFieldsConstants; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.VariableRow; import org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues; import org.kie.workbench.common.stunner.bpmn.client.forms.util.StringUtils; -import org.kie.workbench.common.stunner.bpmn.service.DataTypesService; import org.uberfire.workbench.events.NotificationEvent; @Dependent @@ -78,6 +74,9 @@ public class VariablesEditorWidgetViewImpl extends Composite implements Variable @DataField protected TableCellElement datatypeth = Document.get().createTHElement(); + @Inject + private DataTypeNamesService clientDataTypesService; + @DataField protected TableCellElement kpith = Document.get().createTHElement(); @@ -158,33 +157,30 @@ protected void getDataTypes(final String value, "Integer", "Object", "String")); - MessageBuilder.createCall( - new RemoteCallback>() { - public void callback(final List serverDataTypes) { - List> mergedDataTypes = mergeDataTypes(simpleDataTypes, - simpleDataTypeDisplayNames, - serverDataTypes); - setDataTypes(mergedDataTypes.get(0), - mergedDataTypes.get(1)); - doSetValue(value, - fireEvents, - true); - } - }, - new BusErrorCallback() { - public boolean error(final Message message, - final Throwable t) { - notification.fire(new NotificationEvent(StunnerFormsClientFieldsConstants.INSTANCE.Error_retrieving_datatypes(), - NotificationEvent.NotificationType.ERROR)); - setDataTypes(simpleDataTypes, - simpleDataTypeDisplayNames); - doSetValue(value, - fireEvents, - true); - return false; - } - }, - DataTypesService.class).getDataTypeNames(presenter.getDiagramPath()); + + clientDataTypesService + .call(presenter.getDiagramPath()) + .then(serverDataTypes -> { + List> mergedDataTypes = mergeDataTypes(simpleDataTypes, + simpleDataTypeDisplayNames, + serverDataTypes); + setDataTypes(mergedDataTypes.get(0), + mergedDataTypes.get(1)); + doSetValue(value, + fireEvents, + true); + return null; + }) + .catch_(exception -> { + notification.fire(new NotificationEvent(StunnerFormsClientFieldsConstants.INSTANCE.Error_retrieving_datatypes(), + NotificationEvent.NotificationType.ERROR)); + setDataTypes(simpleDataTypes, + simpleDataTypeDisplayNames); + doSetValue(value, + fireEvents, + true); + return null; + }); } private List> mergeDataTypes(final List simpleDataTypes, diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/filters/BPMNDiagramFilterProvider.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/filters/BPMNDiagramFilterProvider.java index cb89f60837a..ac422a991b3 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/filters/BPMNDiagramFilterProvider.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/filters/BPMNDiagramFilterProvider.java @@ -27,7 +27,7 @@ import org.kie.workbench.common.forms.adf.engine.shared.FormElementFilter; import org.kie.workbench.common.forms.processing.engine.handling.FieldChangeHandlerManager; -import org.kie.workbench.common.stunner.bpmn.client.diagram.DiagramTypeService; +import org.kie.workbench.common.stunner.bpmn.client.diagram.DiagramTypeClientService; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet; @@ -42,7 +42,7 @@ public class BPMNDiagramFilterProvider implements StunnerFormElementFilterProvider { private final SessionManager sessionManager; - private final DiagramTypeService diagramTypeService; + private final DiagramTypeClientService diagramTypeService; private final FieldChangeHandlerManager fieldChangeHandlerManager; private final Event refreshFormPropertiesEvent; @@ -52,7 +52,7 @@ public class BPMNDiagramFilterProvider implements StunnerFormElementFilterProvid @Inject public BPMNDiagramFilterProvider(final SessionManager sessionManager, - final DiagramTypeService diagramTypeService, + final DiagramTypeClientService diagramTypeService, final FieldChangeHandlerManager fieldChangeHandlerManager, final Event refreshFormPropertiesEvent) { this.sessionManager = sessionManager; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/util/BPMNFormsContextUtils.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/util/BPMNFormsContextUtils.java new file mode 100644 index 00000000000..79244a5895c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/util/BPMNFormsContextUtils.java @@ -0,0 +1,44 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.forms.util; + +import org.kie.workbench.common.forms.dynamic.service.shared.FormRenderingContext; +import org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask; +import org.kie.workbench.common.stunner.core.graph.Element; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class BPMNFormsContextUtils { + + public static Object getModel(final FormRenderingContext context) { + Object model = null; + if (context != null) { + if (context.getModel() != null) { + model = context.getModel(); + } else if (context.getParentContext() != null) { + model = context.getParentContext().getModel(); + } + } + return model; + } + + @SuppressWarnings("unchecked") + public static boolean isFormGenerationSupported(final Element element) { + return null != element.asNode() && + element.getContent() instanceof View && + ((Element>) element).getContent().getDefinition() instanceof BaseUserTask; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/util/ContextUtils.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/util/ContextUtils.java deleted file mode 100644 index b5a750164a1..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/forms/util/ContextUtils.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.forms.util; - -import org.kie.workbench.common.forms.dynamic.service.shared.FormRenderingContext; -import org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask; -import org.kie.workbench.common.stunner.core.graph.Element; -import org.kie.workbench.common.stunner.core.graph.content.view.View; - -public class ContextUtils { - - public static Object getModel(final FormRenderingContext context) { - Object model = null; - if (context != null) { - if (context.getModel() != null) { - model = context.getModel(); - } else if (context.getParentContext() != null) { - model = context.getParentContext().getModel(); - } - } - return model; - } - - @SuppressWarnings("unchecked") - public static boolean isFormGenerationSupported(final Element element) { - return null != element.asNode() && - element.getContent() instanceof View && - ((Element>) element).getContent().getDefinition() instanceof BaseUserTask; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/session/BPMNSessionInitializer.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/session/BPMNSessionInitializer.java index c73a86f7292..c7b1d19f29c 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/session/BPMNSessionInitializer.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/session/BPMNSessionInitializer.java @@ -16,12 +16,17 @@ package org.kie.workbench.common.stunner.bpmn.client.session; +import java.util.Collection; +import java.util.logging.Logger; + import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; -import org.kie.workbench.common.stunner.bpmn.client.diagram.DiagramTypeService; -import org.kie.workbench.common.stunner.bpmn.client.workitem.WorkItemDefinitionClientRegistry; +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.diagram.DiagramTypeClientService; +import org.kie.workbench.common.stunner.bpmn.client.workitem.WorkItemDefinitionClientService; import org.kie.workbench.common.stunner.bpmn.qualifiers.BPMN; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; import org.kie.workbench.common.stunner.core.client.session.impl.SessionInitializer; import org.kie.workbench.common.stunner.core.diagram.Metadata; import org.uberfire.mvp.Command; @@ -30,8 +35,10 @@ @ApplicationScoped public class BPMNSessionInitializer implements SessionInitializer { - private final WorkItemDefinitionClientRegistry workItemDefinitionService; - private final DiagramTypeService diagramTypeService; + private static Logger LOGGER = Logger.getLogger(BPMNSessionInitializer.class.getName()); + + private final WorkItemDefinitionClientService workItemDefinitionService; + private final DiagramTypeClientService diagramTypeService; // CDI proxy. protected BPMNSessionInitializer() { @@ -39,7 +46,8 @@ protected BPMNSessionInitializer() { } @Inject - public BPMNSessionInitializer(final WorkItemDefinitionClientRegistry workItemDefinitionService, final DiagramTypeService diagramTypeService) { + public BPMNSessionInitializer(final WorkItemDefinitionClientService workItemDefinitionService, + final DiagramTypeClientService diagramTypeService) { this.workItemDefinitionService = workItemDefinitionService; this.diagramTypeService = diagramTypeService; } @@ -48,6 +56,16 @@ public BPMNSessionInitializer(final WorkItemDefinitionClientRegistry workItemDef public void init(final Metadata metadata, final Command completeCallback) { diagramTypeService.loadDiagramType(metadata); - workItemDefinitionService.load(metadata, completeCallback); + workItemDefinitionService + .call(metadata) + .then(workItemDefinitions -> { + completeCallback.execute(); + return null; + }) + .catch_((Promise.CatchOnRejectedCallbackFn>) error -> { + LOGGER.severe("Error obtaining the work item definitions [error=" + error + "]"); + completeCallback.execute(); + return null; + }); } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/workitem/WorkItemDefinitionClientRegistry.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/workitem/WorkItemDefinitionClientRegistry.java deleted file mode 100644 index 41d8ebfbf23..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/workitem/WorkItemDefinitionClientRegistry.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.workitem; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Optional; -import java.util.function.Consumer; -import java.util.function.Supplier; - -import javax.annotation.PreDestroy; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.Observes; -import javax.enterprise.inject.Default; -import javax.enterprise.inject.Produces; -import javax.enterprise.inject.Typed; -import javax.inject.Inject; - -import org.jboss.errai.common.client.api.Caller; -import org.jboss.errai.common.client.api.RemoteCallback; -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; -import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry; -import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistries; -import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistry; -import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; -import org.kie.workbench.common.stunner.core.client.api.SessionManager; -import org.kie.workbench.common.stunner.core.client.session.ClientSession; -import org.kie.workbench.common.stunner.core.client.session.event.SessionDestroyedEvent; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.mvp.Command; - -/** - * - It manages the registries relying on the client session lifecycle - * - It produces the @Default WorkItemDefinitionRegistry based on current session - * - It performs calls to server side to populate the current registry - * - It destroy the registry, if any, when a session is being destroyed - */ -@ApplicationScoped -@Typed(WorkItemDefinitionClientRegistry.class) -public class WorkItemDefinitionClientRegistry implements WorkItemDefinitionRegistry { - - private final Caller service; - private final WorkItemDefinitionRegistries index; - private final SessionManager sessionManager; - private final Supplier registryInstanceSupplier; - private final Consumer errorPresenter; - - @Inject - public WorkItemDefinitionClientRegistry(final Caller service, - final SessionManager sessionManager, - final ManagedInstance registryInstances, - final ErrorPopupPresenter errorPopupPresenter) { - this(service, - sessionManager, - registryInstances::get, - exception -> errorPopupPresenter.showMessage(getExceptionMessage(exception)), - new WorkItemDefinitionRegistries<>(metadata -> metadata.getRoot().toURI(), - new HashMap<>(), - registryInstances::destroy)); - } - - WorkItemDefinitionClientRegistry(final Caller service, - final SessionManager sessionManager, - final Supplier registryInstances, - final Consumer errorPresenter, - final WorkItemDefinitionRegistries index) { - this.service = service; - this.sessionManager = sessionManager; - this.registryInstanceSupplier = registryInstances; - this.errorPresenter = errorPresenter; - this.index = index; - } - - @Override - public Collection items() { - return getCurrentSessionRegistry().items(); - } - - @Override - public WorkItemDefinition get(final String name) { - return getCurrentSessionRegistry().get(name); - } - - @Produces - @Default - public WorkItemDefinitionRegistry getRegistry() { - return getCurrentSessionRegistry(); - } - - public void load(final Metadata metadata, - final Command callback) { - service.call((RemoteCallback>) workItemDefinitions -> { - final WorkItemDefinitionCacheRegistry registry = getRegistryForModule(metadata); - workItemDefinitions.forEach(registry::register); - callback.execute(); - }, (message, throwable) -> { - errorPresenter.accept(throwable); - callback.execute(); - return false; - }).execute(metadata); - } - - public void removeRegistry(final Metadata metadata) { - Optional.ofNullable(index.remove(metadata)).ifPresent(WorkItemDefinitionCacheRegistry::clear); - } - - @PreDestroy - public void destroy() { - index.clear(); - } - - void onSessionDestroyed(final @Observes SessionDestroyedEvent sessionDestroyedEvent) { - removeRegistry(sessionDestroyedEvent.getMetadata()); - } - - WorkItemDefinitionCacheRegistry getCurrentSessionRegistry() { - return getRegistryForSession(sessionManager.getCurrentSession()); - } - - WorkItemDefinitionCacheRegistry getRegistryForSession(final ClientSession session) { - return getRegistryForModule(session.getCanvasHandler().getDiagram().getMetadata()); - } - - WorkItemDefinitionCacheRegistry getRegistryForModule(final Metadata metadata) { - return obtainRegistry(metadata); - } - - private WorkItemDefinitionCacheRegistry obtainRegistry(final Metadata metadata) { - if (!index.contains(metadata)) { - index.put(metadata, - registryInstanceSupplier.get()); - } - return index.registries().apply(metadata); - } - - @SuppressWarnings("all") - private static String getExceptionMessage(final Throwable throwable) { - Throwable root = throwable; - while (null != root) { - if (null != root.getCause()) { - root = root.getCause(); - } else { - break; - } - } - return root.getMessage(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/workitem/WorkItemDefinitionClientService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/workitem/WorkItemDefinitionClientService.java new file mode 100644 index 00000000000..f8bb2a593d0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/java/org/kie/workbench/common/stunner/bpmn/client/workitem/WorkItemDefinitionClientService.java @@ -0,0 +1,31 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.workitem; + +import java.util.Collection; + +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistry; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.kogito.api.Kogito; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientService; + +@Kogito +public interface WorkItemDefinitionClientService extends KogitoClientService> { + + WorkItemDefinitionRegistry getRegistry(); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnClient.gwt.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnClient.gwt.xml index 9cc677f750b..01ca7d9f147 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnClient.gwt.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnClient.gwt.xml @@ -31,6 +31,7 @@ + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/BPMNCommonActionsToolboxFactoryTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/BPMNCommonActionsToolboxFactoryTest.java deleted file mode 100644 index ed5e2e334a7..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/BPMNCommonActionsToolboxFactoryTest.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.canvas.controls; - -import java.util.Collection; -import java.util.Collections; - -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.bpmn.client.canvas.controls.util.ActionsToolboxHelper; -import org.kie.workbench.common.stunner.bpmn.definition.ScriptTask; -import org.kie.workbench.common.stunner.bpmn.definition.UserTask; -import org.kie.workbench.common.stunner.core.client.ManagedInstanceStub; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxFactory; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxView; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ToolboxAction; -import org.kie.workbench.common.stunner.core.graph.Node; -import org.kie.workbench.common.stunner.core.graph.content.Bounds; -import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; -import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; -import org.kie.workbench.common.stunner.forms.client.components.toolbox.FormGenerationToolboxAction; -import org.mockito.Mock; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class BPMNCommonActionsToolboxFactoryTest { - - @Mock - private AbstractCanvasHandler canvasHandler; - - @Mock - private ActionsToolboxFactory commonActionToolbox; - - @Mock - private ToolboxAction action1; - - private ManagedInstance generateFormsActions; - - @Mock - private FormGenerationToolboxAction formGenerationToolboxAction; - - private ManagedInstance views; - - @Mock - private ActionsToolboxView view; - - private BPMNCommonActionsToolboxFactory tested; - private Node element; - private ActionsToolboxHelper actionsToolboxHelper; - - @Before - public void init() { - element = new NodeImpl<>("node1"); - when(commonActionToolbox.getActions(eq(canvasHandler), - eq(element))).thenReturn(Collections.singletonList(action1)); - generateFormsActions = spy(new ManagedInstanceStub<>(formGenerationToolboxAction)); - views = spy(new ManagedInstanceStub<>(view)); - actionsToolboxHelper = new ActionsToolboxHelper(commonActionToolbox, generateFormsActions); - tested = new BPMNCommonActionsToolboxFactory(generateFormsActions, - views, - actionsToolboxHelper); - } - - @Test - public void testNewViewInstance() { - assertEquals(view, tested.newViewInstance()); - } - - @Test - @SuppressWarnings("unchecked") - public void testGetActionsForSupportedNode() { - element.setContent(new ViewImpl<>(new UserTask(), - Bounds.create())); - final Collection> actions = tested.getActions(canvasHandler, - element); - assertEquals(2, actions.size()); - assertTrue(actions.contains(action1)); - assertTrue(actions.contains(formGenerationToolboxAction)); - } - - @Test - @SuppressWarnings("unchecked") - public void testGetActionsForNotSupportedNode() { - element.setContent(new ViewImpl<>(new ScriptTask(), - Bounds.create())); - final Collection> actions = tested.getActions(canvasHandler, - element); - assertEquals(1, actions.size()); - assertTrue(actions.contains(action1)); - assertFalse(actions.contains(formGenerationToolboxAction)); - } - - @Test - public void testDestroy() { - tested.destroy(); - verify(generateFormsActions, times(1)).destroyAll(); - verify(views, times(1)).destroyAll(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/util/ActionsToolboxHelperTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/util/ActionsToolboxHelperTest.java deleted file mode 100644 index 4ded795a931..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/canvas/controls/util/ActionsToolboxHelperTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.canvas.controls.util; - -import java.util.Collection; -import java.util.Collections; - -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.bpmn.definition.BaseTask; -import org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxFactory; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ToolboxAction; -import org.kie.workbench.common.stunner.core.graph.Element; -import org.kie.workbench.common.stunner.core.graph.Node; -import org.kie.workbench.common.stunner.core.graph.content.view.View; -import org.kie.workbench.common.stunner.forms.client.components.toolbox.FormGenerationToolboxAction; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class ActionsToolboxHelperTest { - - @Mock - private ActionsToolboxFactory commonActionToolbox; - - @Mock - private FormGenerationToolboxAction generateFormsAction; - - @Mock - private ManagedInstance generationToolboxActions; - - @Mock - private AbstractCanvasHandler canvasHandler; - - @Mock - private Element element; - - @Mock - private ToolboxAction toolboxAction; - - @Mock - private Node node; - - @Mock - private View view; - - private ActionsToolboxHelper tested; - - @Before - @SuppressWarnings("unchecked") - public void setUp() { - when(commonActionToolbox.getActions(eq(canvasHandler), eq(element))).thenReturn(Collections.singletonList(toolboxAction)); - - when(element.asNode()).thenReturn(node); - when(element.getContent()).thenReturn(view); - - when(generationToolboxActions.get()).thenReturn(generateFormsAction); - - tested = new ActionsToolboxHelper(commonActionToolbox, generationToolboxActions); - } - - @Test - @SuppressWarnings("unchecked") - public void testGetActions_supportedElement() throws Exception { - when(view.getDefinition()).thenReturn(mock(BaseUserTask.class)); - - final Collection> results = - tested.getActions(canvasHandler, element); - - assertEquals(2, results.size()); - assertTrue(results.contains(generateFormsAction)); - assertTrue(results.contains(toolboxAction)); - } - - @Test - @SuppressWarnings("unchecked") - public void testGetActions_unsupportedElement() throws Exception { - when(view.getDefinition()).thenReturn(mock(BaseTask.class)); - - final Collection> results = - tested.getActions(canvasHandler, element); - - assertEquals(1, results.size()); - assertFalse(results.contains(generateFormsAction)); - assertTrue(results.contains(toolboxAction)); - } -} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/CalledElementFormProviderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/CalledElementFormProviderTest.java new file mode 100644 index 00000000000..d3e1e90022e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/CalledElementFormProviderTest.java @@ -0,0 +1,79 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.dataproviders; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.forms.dynamic.model.config.SelectorData; +import org.kie.workbench.common.forms.dynamic.service.shared.FormRenderingContext; +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RequestProcessDataEvent; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.uberfire.mocks.EventSourceMock; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class CalledElementFormProviderTest { + + @Mock + private ProcessesDataProvider dataProvider; + + @Mock + private EventSourceMock event; + + private CalledElementFormProvider tested; + + @Before + public void setup() { + tested = new CalledElementFormProvider(); + tested.dataProvider = dataProvider; + tested.requestProcessDataEvent = event; + } + + @Test + public void testGetProviderName() { + assertEquals(tested.getClass().getSimpleName(), tested.getProviderName()); + } + + @Test + public void testGetSelectorData() { + List names = Arrays.asList("p1", "p2", "p3"); + when(dataProvider.getProcessIds()).thenReturn(names); + FormRenderingContext context = mock(FormRenderingContext.class); + SelectorData data = tested.getSelectorData(context); + Map values = data.getValues(); + assertNotNull(values); + assertEquals(3, values.size()); + assertTrue(values.containsKey("p1")); + assertTrue(values.containsKey("p2")); + assertTrue(values.containsKey("p3")); + verify(event, times(1)).fire(any(RequestProcessDataEvent.class)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/ProcessMessageRefProviderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/ProcessMessageRefProviderTest.java index 11bdce1ae62..c274d19e15b 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/ProcessMessageRefProviderTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/ProcessMessageRefProviderTest.java @@ -82,7 +82,7 @@ private Element mockStartMessageEventNode(String messageRefValue) { StartMessageEvent event = new StartMessageEvent(); event.setExecutionSet(new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new SLADueDate(), - new MessageRef(messageRefValue))); + new MessageRef(messageRefValue, ""))); return mockNode(event); } @@ -90,13 +90,13 @@ private Element mockIntermediateMessageEventCatchingNode(String messageRefValue) IntermediateMessageEventCatching event = new IntermediateMessageEventCatching(); event.setExecutionSet(new CancellingMessageEventExecutionSet(new CancelActivity(true), new SLADueDate(), - new MessageRef(messageRefValue))); + new MessageRef(messageRefValue, ""))); return mockNode(event); } private Element mockEndMessageEventNode(String messageRefValue) { EndMessageEvent event = new EndMessageEvent(); - event.setExecutionSet(new MessageEventExecutionSet(new MessageRef(messageRefValue))); + event.setExecutionSet(new MessageEventExecutionSet(new MessageRef(messageRefValue, ""))); return mockNode(event); } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/ProcessesDataProviderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/ProcessesDataProviderTest.java new file mode 100644 index 00000000000..0035d26e5ed --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/ProcessesDataProviderTest.java @@ -0,0 +1,76 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.dataproviders; + +import java.util.List; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.ProcessDataEvent; +import org.kie.workbench.common.stunner.forms.client.session.StunnerFormsHandler; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class ProcessesDataProviderTest { + + @Mock + private StunnerFormsHandler formsHandler; + + private ProcessesDataProvider tested; + + @Before + public void setup() { + tested = new ProcessesDataProvider(formsHandler); + } + + @Test + public void testOnProcessesUpdatedEvent() { + ProcessDataEvent event = mock(ProcessDataEvent.class); + when(event.getProcessIds()).thenReturn(new String[]{"p1", "p2"}); + tested.onProcessesUpdatedEvent(event); + verify(formsHandler, times(1)).refreshCurrentSessionForms(eq(BPMNDefinitionSet.class)); + List values = tested.getProcessIds(); + assertNotNull(values); + assertEquals(2, values.size()); + assertTrue(values.contains("p1")); + assertTrue(values.contains("p2")); + } + + @Test + public void testOnProcessesNOTUpdatedEvent() { + tested.processIds.add("p1"); + tested.processIds.add("p2"); + ProcessDataEvent event = mock(ProcessDataEvent.class); + when(event.getProcessIds()).thenReturn(new String[]{"p1", "p2"}); + tested.onProcessesUpdatedEvent(event); + verify(formsHandler, never()).refreshCurrentSessionForms(any(Class.class)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/RuleFlowGroupDataProviderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/RuleFlowGroupDataProviderTest.java new file mode 100644 index 00000000000..e8fe9715ddb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/RuleFlowGroupDataProviderTest.java @@ -0,0 +1,76 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.dataproviders; + +import java.util.List; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RuleFlowGroupDataEvent; +import org.kie.workbench.common.stunner.forms.client.session.StunnerFormsHandler; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class RuleFlowGroupDataProviderTest { + + @Mock + private StunnerFormsHandler formsHandler; + + private RuleFlowGroupDataProvider tested; + + @Before + public void setup() { + tested = new RuleFlowGroupDataProvider(formsHandler); + } + + @Test + public void testOnRuleFlowGroupDataChanged() { + RuleFlowGroupDataEvent event = mock(RuleFlowGroupDataEvent.class); + when(event.getGroupNames()).thenReturn(new String[]{"g1", "g2"}); + tested.onRuleFlowGroupDataChanged(event); + verify(formsHandler, times(1)).refreshCurrentSessionForms(eq(BPMNDefinitionSet.class)); + List values = tested.getRuleFlowGroupNames(); + assertNotNull(values); + assertEquals(2, values.size()); + assertTrue(values.contains("g1")); + assertTrue(values.contains("g2")); + } + + @Test + public void testOnRuleFlowGroupDataNotChanged() { + tested.groupNames.add("g1"); + tested.groupNames.add("g2"); + RuleFlowGroupDataEvent event = mock(RuleFlowGroupDataEvent.class); + when(event.getGroupNames()).thenReturn(new String[]{"g1", "g2"}); + tested.onRuleFlowGroupDataChanged(event); + verify(formsHandler, never()).refreshCurrentSessionForms(any(Class.class)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/RuleFlowGroupFormProviderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/RuleFlowGroupFormProviderTest.java new file mode 100644 index 00000000000..e5219b9fcbc --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/dataproviders/RuleFlowGroupFormProviderTest.java @@ -0,0 +1,79 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.dataproviders; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.forms.dynamic.model.config.SelectorData; +import org.kie.workbench.common.forms.dynamic.service.shared.FormRenderingContext; +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RequestRuleFlowGroupDataEvent; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.uberfire.mocks.EventSourceMock; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class RuleFlowGroupFormProviderTest { + + @Mock + private RuleFlowGroupDataProvider dataProvider; + + @Mock + private EventSourceMock requestRuleFlowGroupDataEvent; + + private RuleFlowGroupFormProvider tested; + + @Before + public void setup() { + tested = new RuleFlowGroupFormProvider(); + tested.dataProvider = dataProvider; + tested.requestRuleFlowGroupDataEvent = requestRuleFlowGroupDataEvent; + } + + @Test + public void testGetProviderName() { + assertEquals(tested.getClass().getSimpleName(), tested.getProviderName()); + } + + @Test + public void testGetSelectorData() { + List names = Arrays.asList("g1", "g2", "g3"); + when(dataProvider.getRuleFlowGroupNames()).thenReturn(names); + FormRenderingContext context = mock(FormRenderingContext.class); + SelectorData data = tested.getSelectorData(context); + Map values = data.getValues(); + assertNotNull(values); + assertEquals(3, values.size()); + assertTrue(values.containsKey("g1")); + assertTrue(values.containsKey("g2")); + assertTrue(values.containsKey("g3")); + verify(requestRuleFlowGroupDataEvent, times(1)).fire(any(RequestRuleFlowGroupDataEvent.class)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/diagram/DiagramTypeServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/diagram/DiagramTypeServiceTest.java deleted file mode 100644 index 93e1e93716a..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/diagram/DiagramTypeServiceTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.diagram; - -import org.jboss.errai.common.client.api.Caller; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.bpmn.service.BPMNDiagramService; -import org.kie.workbench.common.stunner.bpmn.service.ProjectType; -import org.kie.workbench.common.stunner.core.client.session.event.SessionDestroyedEvent; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; -import org.uberfire.backend.vfs.Path; -import org.uberfire.mocks.CallerMock; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class DiagramTypeServiceTest { - - private static final String ID = "ID"; - private DiagramTypeServiceImpl tested; - - @Mock - private BPMNDiagramService bpmnDiagramService; - - @Mock - private Caller bpmnDiagramServiceCaller; - - @Mock - private Metadata metadata; - - @Mock - private SessionDestroyedEvent sessionDestroyedEvent; - - @Mock - private Path path; - - @Before - public void setUp() throws Exception { - when(sessionDestroyedEvent.getMetadata()).thenReturn(metadata); - when(metadata.getCanvasRootUUID()).thenReturn(ID); - when(metadata.getRoot()).thenReturn(path); - when(bpmnDiagramService.getProjectType(path)).thenReturn(ProjectType.CASE); - - bpmnDiagramServiceCaller = new CallerMock<>(bpmnDiagramService); - tested = new DiagramTypeServiceImpl(bpmnDiagramServiceCaller); - } - - @Test - public void loadDiagramType() { - tested.loadDiagramType(metadata); - final ProjectType projectType = tested.getProjectType(metadata); - assertThat(projectType).isEqualTo(ProjectType.CASE); - } - - @Test - public void getNull() { - ProjectType projectType = tested.getProjectType(metadata); - assertThat(projectType).isEqualTo(ProjectType.BPMN); - } - - @Test - public void onSessionClosed() { - tested.loadDiagramType(metadata); - ProjectType projectType = tested.getProjectType(metadata); - assertThat(projectType).isEqualTo(ProjectType.CASE); - tested.onSessionClosed(sessionDestroyedEvent); - projectType = tested.getProjectType(metadata); - assertThat(projectType).isEqualTo(ProjectType.BPMN); - } -} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/documentation/ClientBPMNDocumentationServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/documentation/ClientBPMNDocumentationServiceTest.java index 1473d66354c..b8c376ecc39 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/documentation/ClientBPMNDocumentationServiceTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/documentation/ClientBPMNDocumentationServiceTest.java @@ -32,7 +32,6 @@ import org.kie.workbench.common.stunner.bpmn.client.components.palette.BPMNCategoryDefinitionProvider; import org.kie.workbench.common.stunner.bpmn.client.documentation.decorator.PropertyDecorators; import org.kie.workbench.common.stunner.bpmn.client.shape.factory.BPMNShapeFactory; -import org.kie.workbench.common.stunner.bpmn.client.workitem.WorkItemDefinitionClientRegistry; import org.kie.workbench.common.stunner.bpmn.definition.BPMNCategories; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; import org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess; @@ -202,9 +201,6 @@ public class ClientBPMNDocumentationServiceTest { @Mock private ClientTranslationService translationService; - @Mock - private WorkItemDefinitionClientRegistry workItemDefinitionClientRegistry; - @Mock private Diagram diagram; @@ -375,7 +371,6 @@ public void setUp() throws Exception { when(graph.nodes()).thenReturn(nodes); when(mustacheTemplateRenderer.render(eq(TEMPLATE), any(BPMNDocumentation.class))).thenReturn(RENDERED_DOC); - when(workItemDefinitionClientRegistry.getRegistry()).thenReturn(workItemDefinitionClientRegistry); when(decorators.getDecorator(anyString())).thenReturn(Optional.empty()); //adapters mock @@ -453,7 +448,7 @@ public void setUp() throws Exception { categoryDefinitionProvider, glyphRenderer, translationService, - workItemDefinitionClientRegistry, + null, decorators); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeEditorWidgetTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeEditorWidgetTest.java index 5090bf47489..6ab33aa12e1 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeEditorWidgetTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeEditorWidgetTest.java @@ -26,6 +26,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.AssigneeLiveSearchService; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.i18n.StunnerBPMNConstants; import org.mockito.ArgumentCaptor; import org.mockito.Captor; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeLiveSearchServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeLiveSearchServiceTest.java deleted file mode 100644 index 194382de1a8..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/assigneeEditor/widget/AssigneeLiveSearchServiceTest.java +++ /dev/null @@ -1,480 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.widget; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.function.Consumer; - -import org.jboss.errai.common.client.api.ErrorCallback; -import org.jboss.errai.common.client.api.RemoteCallback; -import org.jboss.errai.security.shared.api.GroupImpl; -import org.jboss.errai.security.shared.api.identity.UserImpl; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.bpmn.forms.model.AssigneeType; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; -import org.uberfire.ext.security.management.api.AbstractEntityManager; -import org.uberfire.ext.security.management.api.GroupManager; -import org.uberfire.ext.security.management.api.UserManager; -import org.uberfire.ext.security.management.client.ClientUserSystemManager; -import org.uberfire.ext.security.management.impl.SearchRequestImpl; -import org.uberfire.ext.security.management.impl.SearchResponseImpl; -import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchCallback; -import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchEntry; -import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchResults; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class AssigneeLiveSearchServiceTest { - - @Mock - private UserManager userManager; - - @Mock - private GroupManager groupManager; - - @Mock - private ClientUserSystemManager userSystemManager; - - @Mock - private AssigneeLiveSearchEntryCreationEditor editor; - - @Mock - private LiveSearchCallback callback; - - private AssigneeLiveSearchService assigneeLiveSearchService; - - @Before - public void init() { - when(userSystemManager.users(any(), any())).thenReturn(userManager); - when(userSystemManager.groups(any(), any())).thenReturn(groupManager); - - assigneeLiveSearchService = new AssigneeLiveSearchService(userSystemManager, editor); - - verify(editor).setCustomEntryCommand(any()); - } - - @Test - public void testSearchUsers() { - assigneeLiveSearchService.init(AssigneeType.USER); - - assigneeLiveSearchService.search("admin", 10, callback); - - ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); - - verify(userManager).search(requestArgumentCaptor.capture()); - - SearchRequestImpl request = requestArgumentCaptor.getValue(); - - assertEquals("admin", request.getSearchPattern()); - assertEquals(10, request.getPageSize()); - - ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); - - verify(userSystemManager).users(callbackArgumentCaptor.capture(), any()); - - RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); - - successCallback.callback(prepareUsersResponse()); - - ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); - - verify(callback).afterSearch(resultsArgumentCaptor.capture()); - - LiveSearchResults result = resultsArgumentCaptor.getValue(); - - assertEquals(3, result.size()); - } - - @Test - public void testSearchUsersIncludeCustomEntries() { - assigneeLiveSearchService.init(AssigneeType.USER); - - assigneeLiveSearchService.addCustomEntry("custom_admin"); - - assigneeLiveSearchService.search("admin", 10, callback); - - ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); - - verify(userManager).search(requestArgumentCaptor.capture()); - - SearchRequestImpl request = requestArgumentCaptor.getValue(); - - assertEquals("admin", request.getSearchPattern()); - assertEquals(10, request.getPageSize()); - - ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); - - verify(userSystemManager).users(callbackArgumentCaptor.capture(), any()); - - RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); - - successCallback.callback(prepareUsersResponse()); - - ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); - - verify(callback).afterSearch(resultsArgumentCaptor.capture()); - - LiveSearchResults result = resultsArgumentCaptor.getValue(); - - assertEquals(4, result.size()); - } - - @Test - public void testSearchUsersIncludeCustomEntriesNotMatchSearchPattern() { - assigneeLiveSearchService.init(AssigneeType.USER); - - assigneeLiveSearchService.addCustomEntry("custom_entry"); - - assigneeLiveSearchService.search("admin", 10, callback); - - ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); - - verify(userManager).search(requestArgumentCaptor.capture()); - - SearchRequestImpl request = requestArgumentCaptor.getValue(); - - assertEquals("admin", request.getSearchPattern()); - assertEquals(10, request.getPageSize()); - - ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); - - verify(userSystemManager).users(callbackArgumentCaptor.capture(), any()); - - RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); - - successCallback.callback(prepareUsersResponse()); - - ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); - - verify(callback).afterSearch(resultsArgumentCaptor.capture()); - - LiveSearchResults result = resultsArgumentCaptor.getValue(); - - assertEquals(3, result.size()); - } - - @Test - public void testSearchGroups() { - assigneeLiveSearchService.init(AssigneeType.GROUP); - - assigneeLiveSearchService.search("it", 10, callback); - - ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); - - verify(groupManager).search(requestArgumentCaptor.capture()); - - SearchRequestImpl request = requestArgumentCaptor.getValue(); - - assertEquals("it", request.getSearchPattern()); - assertEquals(10, request.getPageSize()); - - ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); - - verify(userSystemManager).groups(callbackArgumentCaptor.capture(), any()); - - RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); - - successCallback.callback(prepareGroupsResponse()); - - ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); - - verify(callback).afterSearch(resultsArgumentCaptor.capture()); - - LiveSearchResults result = resultsArgumentCaptor.getValue(); - - assertEquals(3, result.size()); - } - - @Test - public void testSearchGroupsIncludeCustomEntries() { - assigneeLiveSearchService.init(AssigneeType.GROUP); - - assigneeLiveSearchService.addCustomEntry("custom_it"); - - assigneeLiveSearchService.search("it", 10, callback); - - ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); - - verify(groupManager).search(requestArgumentCaptor.capture()); - - SearchRequestImpl request = requestArgumentCaptor.getValue(); - - assertEquals("it", request.getSearchPattern()); - assertEquals(10, request.getPageSize()); - - ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); - - verify(userSystemManager).groups(callbackArgumentCaptor.capture(), any()); - - RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); - - successCallback.callback(prepareGroupsResponse()); - - ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); - - verify(callback).afterSearch(resultsArgumentCaptor.capture()); - - LiveSearchResults result = resultsArgumentCaptor.getValue(); - - assertEquals(4, result.size()); - } - - @Test - public void testSearchGroupsIncludeCustomEntriesNotMatchSearchPattern() { - assigneeLiveSearchService.init(AssigneeType.GROUP); - - assigneeLiveSearchService.addCustomEntry("custom_entry"); - - assigneeLiveSearchService.search("it", 10, callback); - - ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); - - verify(groupManager).search(requestArgumentCaptor.capture()); - - SearchRequestImpl request = requestArgumentCaptor.getValue(); - - assertEquals("it", request.getSearchPattern()); - assertEquals(10, request.getPageSize()); - - ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); - - verify(userSystemManager).groups(callbackArgumentCaptor.capture(), any()); - - RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); - - successCallback.callback(prepareGroupsResponse()); - - ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); - - verify(callback).afterSearch(resultsArgumentCaptor.capture()); - - LiveSearchResults result = resultsArgumentCaptor.getValue(); - - assertEquals(3, result.size()); - } - - @Test - public void testSearchSingleUser() { - assigneeLiveSearchService.init(AssigneeType.USER); - - assigneeLiveSearchService.searchEntry("user", callback); - - ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); - - verify(userManager).search(requestArgumentCaptor.capture()); - - SearchRequestImpl request = requestArgumentCaptor.getValue(); - - assertEquals("user", request.getSearchPattern()); - assertEquals(1, request.getPageSize()); - - ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); - - verify(userSystemManager).users(callbackArgumentCaptor.capture(), any()); - - RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); - - successCallback.callback(prepareSingleUserResponse()); - - ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); - - verify(callback).afterSearch(resultsArgumentCaptor.capture()); - - LiveSearchResults> result = resultsArgumentCaptor.getValue(); - - assertEquals(1, result.size()); - assertEquals("user", result.get(0).getValue()); - } - - @Test - public void testSearchSingleGroup() { - assigneeLiveSearchService.init(AssigneeType.GROUP); - - assigneeLiveSearchService.searchEntry("it", callback); - - ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); - - verify(groupManager).search(requestArgumentCaptor.capture()); - - SearchRequestImpl request = requestArgumentCaptor.getValue(); - - assertEquals("it", request.getSearchPattern()); - assertEquals(1, request.getPageSize()); - - ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); - - verify(userSystemManager).groups(callbackArgumentCaptor.capture(), any()); - - RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); - - successCallback.callback(prepareSingleGroupResponse()); - - ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); - - verify(callback).afterSearch(resultsArgumentCaptor.capture()); - - LiveSearchResults> result = resultsArgumentCaptor.getValue(); - - assertEquals(1, result.size()); - assertEquals("it", result.get(0).getValue()); - } - - @Test - public void testSearchEntryWithErrorUser() { - testSearchEntryWithError(AssigneeType.USER); - } - - @Test - public void testSearchEntryWithErrorGroup() { - testSearchEntryWithError(AssigneeType.GROUP); - } - - @SuppressWarnings("unchecked") - private void testSearchEntryWithError(AssigneeType assigneeType) { - Consumer errorHandler = mock(Consumer.class); - ArgumentCaptor errorCaptor = ArgumentCaptor.forClass(Throwable.class); - ArgumentCaptor errorCallback = ArgumentCaptor.forClass(ErrorCallback.class); - ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); - assigneeLiveSearchService.init(assigneeType); - assigneeLiveSearchService.setSearchErrorHandler(errorHandler); - assigneeLiveSearchService.searchEntry("key", callback); - if (assigneeType == AssigneeType.USER) { - verify(userSystemManager).users(any(), errorCallback.capture()); - verify(userSystemManager, never()).groups(any(), any()); - } else { - verify(userSystemManager).groups(any(), errorCallback.capture()); - verify(userSystemManager, never()).users(any(), any()); - } - Throwable error = new Throwable(); - errorCallback.getValue().error(null, error); - verify(callback).afterSearch(resultsArgumentCaptor.capture()); - verify(errorHandler).accept(errorCaptor.capture()); - assertEquals(error, errorCaptor.getValue()); - LiveSearchResults result = resultsArgumentCaptor.getValue(); - assertEquals(1, result.size()); - assertEquals("key", result.get(0).getValue()); - } - - @Test - @SuppressWarnings("unchecked") - public void testSearchWithErrorNoCustomEntriesUser() { - testSearchWithError(AssigneeType.USER, "pattern", 1234, Collections.EMPTY_LIST, Collections.EMPTY_LIST); - } - - @Test - public void testSearchWithErrorWithCustomEntriesUser() { - testSearchWithError(AssigneeType.USER, "value", 1234, - Arrays.asList("value1", "value2", "other1", "other2"), - Arrays.asList("value1", "value2")); - } - - @Test - @SuppressWarnings("unchecked") - public void testSearchWithErrorNoCustomEntriesGroup() { - testSearchWithError(AssigneeType.GROUP, "pattern", 1234, Collections.EMPTY_LIST, Collections.EMPTY_LIST); - } - - @Test - public void testSearchWithErrorWithCustomEntriesGroup() { - testSearchWithError(AssigneeType.GROUP, "value", 1234, - Arrays.asList("value1", "value2", "other1", "other2"), - Arrays.asList("value1", "value2")); - } - - @SuppressWarnings("unchecked") - private void testSearchWithError(AssigneeType assigneeType, String pattern, int maxResults, List customEntries, List expectedResults) { - Consumer errorHandler = mock(Consumer.class); - ArgumentCaptor errorCaptor = ArgumentCaptor.forClass(Throwable.class); - ArgumentCaptor errorCallback = ArgumentCaptor.forClass(ErrorCallback.class); - ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); - assigneeLiveSearchService.init(assigneeType); - customEntries.forEach(assigneeLiveSearchService::addCustomEntry); - assigneeLiveSearchService.setSearchErrorHandler(errorHandler); - assigneeLiveSearchService.search(pattern, maxResults, callback); - if (assigneeType == AssigneeType.USER) { - verify(userSystemManager).users(any(), errorCallback.capture()); - verify(userSystemManager, never()).groups(any(), any()); - } else { - verify(userSystemManager).groups(any(), errorCallback.capture()); - verify(userSystemManager, never()).users(any(), any()); - } - Throwable error = new Throwable(); - errorCallback.getValue().error(null, error); - verify(callback).afterSearch(resultsArgumentCaptor.capture()); - verify(errorHandler).accept(errorCaptor.capture()); - assertEquals(error, errorCaptor.getValue()); - - LiveSearchResults result = resultsArgumentCaptor.getValue(); - assertEquals(expectedResults.size(), result.size()); - expectedResults.forEach(expectedValue -> assertTrue(result.stream().anyMatch(entry -> entry.getValue().equals(expectedValue)))); - } - - private AbstractEntityManager.SearchResponse prepareUsersResponse() { - - List result = new ArrayList(); - - result.add(new UserImpl("admin")); - result.add(new UserImpl("user")); - result.add(new UserImpl("developer")); - - return new SearchResponseImpl(result, 1, 1, 1, true); - } - - private AbstractEntityManager.SearchResponse prepareSingleUserResponse() { - - List result = new ArrayList(); - - result.add(new UserImpl("user")); - - return new SearchResponseImpl(result, 1, 1, 1, true); - } - - private AbstractEntityManager.SearchResponse prepareGroupsResponse() { - - List result = new ArrayList(); - - result.add(new GroupImpl("it")); - result.add(new GroupImpl("hr")); - result.add(new GroupImpl("qe")); - - return new SearchResponseImpl(result, 1, 1, 1, true); - } - - private AbstractEntityManager.SearchResponse prepareSingleGroupResponse() { - - List result = new ArrayList(); - - result.add(new GroupImpl("it")); - - return new SearchResponseImpl(result, 1, 1, 1, true); - } -} - diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorFieldEditorPresenterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorFieldEditorPresenterTest.java index ba2b33caeb1..92670e3f950 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorFieldEditorPresenterTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/ConditionEditorFieldEditorPresenterTest.java @@ -24,25 +24,25 @@ import org.kie.workbench.common.stunner.bpmn.client.forms.util.FieldEditorPresenter; import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; import org.kie.workbench.common.stunner.bpmn.forms.conditions.Condition; -import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; import org.kie.workbench.common.stunner.bpmn.forms.conditions.GenerateConditionResult; import org.kie.workbench.common.stunner.bpmn.forms.conditions.ParseConditionResult; import org.kie.workbench.common.stunner.bpmn.forms.model.ScriptTypeMode; import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; import org.kie.workbench.common.stunner.core.client.session.ClientSession; +import org.kie.workbench.common.stunner.kogito.client.PromiseMock; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.mocks.CallerMock; import static org.junit.Assert.assertEquals; import static org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorFieldEditorPresenter.SCRIPT_PARSING_ERROR; import static org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorFieldEditorPresenter.UNEXPECTED_SCRIPT_GENERATION_ERROR; import static org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorFieldEditorPresenter.UNEXPECTED_SCRIPT_PARSING_ERROR; -import static org.kie.workbench.common.stunner.core.client.util.TestUtils.prepareServiceCallerError; import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; @@ -81,9 +81,10 @@ public class ConditionEditorFieldEditorPresenterTest { private ErrorPopupPresenter errorPopup; @Mock - private ConditionEditorService editorService; + private ConditionEditorParsingService conditionEditorParsingService; - private CallerMock editorServiceCaller; + @Mock + private ConditionEditorGeneratorService conditionEditorGeneratorService; @Mock private ClientTranslationService translationService; @@ -101,8 +102,6 @@ public class ConditionEditorFieldEditorPresenterTest { @Before public void setUp() { - editorServiceCaller = spy(new CallerMock<>(editorService)); - when(scriptEditor.getView()).thenReturn(scriptEditorView); when(scriptEditorView.getElement()).thenReturn(scriptEditorElement); when(simpleConditionEditor.getView()).thenReturn(simpleConditionEditorView); @@ -112,7 +111,8 @@ public void setUp() { simpleConditionEditor, scriptEditor, errorPopup, - editorServiceCaller, + conditionEditorParsingService, + conditionEditorGeneratorService, translationService)); presenter.addChangeHandler(changeHandler); } @@ -175,7 +175,9 @@ public void testSetValueWithScriptInJavaParseable() { Condition condition = mock(Condition.class); when(result.hasError()).thenReturn(false); when(result.getCondition()).thenReturn(condition); - when(editorService.parseCondition(SCRIPT_VALUE)).thenReturn(result); + doReturn(PromiseMock.success(result)) + .when(conditionEditorParsingService) + .call(eq(SCRIPT_VALUE)); presenter.setValue(value); verifySetValueCommonActions(value); @@ -188,7 +190,9 @@ public void testSetValueWithScriptInJavaNotParseable() { ScriptTypeValue value = new ScriptTypeValue("java", SCRIPT_VALUE); ParseConditionResult result = mock(ParseConditionResult.class); when(result.hasError()).thenReturn(true); - when(editorService.parseCondition(SCRIPT_VALUE)).thenReturn(result); + doReturn(PromiseMock.success(result)) + .when(conditionEditorParsingService) + .call(eq(SCRIPT_VALUE)); presenter.setValue(value); verifySetValueCommonActions(value); @@ -203,7 +207,9 @@ public void testOnSimpleConditionSelectedWithParseableScript() { Condition condition = mock(Condition.class); when(result.hasError()).thenReturn(false); when(result.getCondition()).thenReturn(condition); - when(editorService.parseCondition(SCRIPT_VALUE)).thenReturn(result); + doReturn(PromiseMock.success(result)) + .when(conditionEditorParsingService) + .call(eq(SCRIPT_VALUE)); //at some point the script has changed presenter.onScriptChange(mock(ScriptTypeValue.class), value); @@ -219,7 +225,9 @@ public void testOnSimpleConditionSelectedWithNonParseableScript() { ScriptTypeValue value = new ScriptTypeValue("java", SCRIPT_VALUE); ParseConditionResult result = mock(ParseConditionResult.class); when(result.hasError()).thenReturn(true); - when(editorService.parseCondition(SCRIPT_VALUE)).thenReturn(result); + doReturn(PromiseMock.success(result)) + .when(conditionEditorParsingService) + .call(eq(SCRIPT_VALUE)); when(translationService.getValue(SCRIPT_PARSING_ERROR)).thenReturn(TRANSLATED_MESSAGE); //at some point the script has changed @@ -239,7 +247,9 @@ public void testOnSimpleConditionSelectedWithServiceError() { presenter.onScriptChange(mock(ScriptTypeValue.class), value); //and the user wants to go to the condition editor. when(translationService.getValue(UNEXPECTED_SCRIPT_PARSING_ERROR, ERROR)).thenReturn(TRANSLATED_MESSAGE); - prepareServiceCallerError(editorService, editorServiceCaller, new Throwable(ERROR)); + doReturn(PromiseMock.error(new Throwable(ERROR))) + .when(conditionEditorParsingService) + .call(any()); presenter.onSimpleConditionSelected(); verify(errorPopup).showMessage(TRANSLATED_MESSAGE); @@ -261,7 +271,9 @@ public void testOnSimpleConditionChangeWithConditionGenerationSuccessful() { GenerateConditionResult result = mock(GenerateConditionResult.class); when(result.hasError()).thenReturn(false); when(result.getExpression()).thenReturn(SCRIPT_VALUE); - when(editorService.generateCondition(newValue)).thenReturn(result); + doReturn(PromiseMock.success(result)) + .when(conditionEditorGeneratorService) + .call(eq(newValue)); when(simpleConditionEditor.isValid()).thenReturn(true); presenter.onSimpleConditionChange(oldValue, newValue); verify(view).clearError(); @@ -278,7 +290,9 @@ public void testOnSimpleConditionChangeWithConditionGenerationErrors() { GenerateConditionResult result = mock(GenerateConditionResult.class); when(result.hasError()).thenReturn(true); when(result.getError()).thenReturn(ERROR); - when(editorService.generateCondition(newValue)).thenReturn(result); + doReturn(PromiseMock.success(result)) + .when(conditionEditorGeneratorService) + .call(eq(newValue)); when(simpleConditionEditor.isValid()).thenReturn(true); presenter.onSimpleConditionChange(oldValue, newValue); verify(view).clearError(); @@ -289,7 +303,9 @@ public void testOnSimpleConditionChangeWithConditionGenerationErrors() { @Test public void testOnSimpleConditionChangeWithServiceError() { when(translationService.getValue(UNEXPECTED_SCRIPT_GENERATION_ERROR, ERROR)).thenReturn(TRANSLATED_MESSAGE); - prepareServiceCallerError(editorService, editorServiceCaller, new Throwable(ERROR)); + doReturn(PromiseMock.error(new Throwable(ERROR))) + .when(conditionEditorGeneratorService) + .call(any()); when(simpleConditionEditor.isValid()).thenReturn(true); presenter.onSimpleConditionChange(mock(Condition.class), mock(Condition.class)); verify(errorPopup).showMessage(TRANSLATED_MESSAGE); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/FunctionSearchServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/FunctionSearchServiceTest.java index 871cf3f9860..63c626627c2 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/FunctionSearchServiceTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/FunctionSearchServiceTest.java @@ -20,16 +20,15 @@ import java.util.Arrays; import java.util.List; -import org.jboss.errai.common.client.api.Caller; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; import org.kie.workbench.common.stunner.bpmn.forms.conditions.FunctionDef; import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; import org.kie.workbench.common.stunner.core.client.session.ClientSession; import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.kogito.client.PromiseMock; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; @@ -38,7 +37,6 @@ import org.uberfire.commons.data.Pair; import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchCallback; import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchResults; -import org.uberfire.mocks.CallerMock; import org.uberfire.mvp.Command; import static org.junit.Assert.assertEquals; @@ -46,6 +44,8 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -60,17 +60,12 @@ public class FunctionSearchServiceTest { private static final String FUNCTION2_NAME = "FUNCTION2_NAME"; private static final String TYPE = "TYPE"; - private Caller editorServiceCaller; - @Mock - private ConditionEditorService editorService; + private ConditionEditorAvailableFunctionsService availableFunctionsService; @Mock private FunctionNamingService functionNamingService; - @Mock - private FunctionSearchService searchService; - @Mock private ClientSession clientSession; @@ -89,22 +84,22 @@ public class FunctionSearchServiceTest { @Mock private Command command; - private List testFunctions; - @Mock private LiveSearchCallback searchCallback; @Captor private ArgumentCaptor> searchResultsCaptor; + private FunctionSearchService searchService; + private List testFunctions; + @Before public void setUp() { when(clientSession.getCanvasHandler()).thenReturn(canvasHandler); when(canvasHandler.getDiagram()).thenReturn(diagram); when(diagram.getMetadata()).thenReturn(metadata); when(metadata.getPath()).thenReturn(path); - editorServiceCaller = new CallerMock<>(editorService); - searchService = new FunctionSearchService(editorServiceCaller, functionNamingService); + searchService = new FunctionSearchService(availableFunctionsService, functionNamingService); } @Test @@ -125,7 +120,11 @@ public void testReload() { prepareForLoad(); searchService.reload(TYPE, command); - verify(editorService).findAvailableFunctions(path, TYPE); + ArgumentCaptor inputArgumentCaptor = + ArgumentCaptor.forClass(ConditionEditorAvailableFunctionsService.Input.class); + verify(availableFunctionsService).call(inputArgumentCaptor.capture()); + assertEquals(path, inputArgumentCaptor.getValue().path); + assertEquals(TYPE, inputArgumentCaptor.getValue().clazz); someFunction = searchService.getFunction(FUNCTION1); assertNotNull(someFunction); assertEquals(testFunctions.get(0), someFunction); @@ -239,7 +238,7 @@ private void prepareForLoad() { testFunctions = new ArrayList<>(); testFunctions.add(mockFunctionDef(FUNCTION1, FUNCTION1_NAME)); testFunctions.add(mockFunctionDef(FUNCTION2, FUNCTION2_NAME)); - when(editorService.findAvailableFunctions(path, TYPE)).thenReturn(testFunctions); + doReturn(PromiseMock.success(testFunctions)).when(availableFunctionsService).call(any(ConditionEditorAvailableFunctionsService.Input.class)); } private void loadTestFunctions() { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/VariableSearchServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/VariableSearchServiceTest.java index 92ff0534153..5440cf2c024 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/VariableSearchServiceTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/fields/conditionEditor/VariableSearchServiceTest.java @@ -25,7 +25,6 @@ import java.util.Set; import java.util.stream.Collectors; -import org.jboss.errai.common.client.api.Caller; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -38,9 +37,9 @@ import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseManagementSet; import org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData; import org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables; -import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; import org.kie.workbench.common.stunner.bpmn.forms.conditions.FieldMetadata; import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadata; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQuery; import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQueryResult; import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; import org.kie.workbench.common.stunner.core.client.canvas.controls.SelectionControl; @@ -54,6 +53,7 @@ import org.kie.workbench.common.stunner.core.graph.content.relationship.Child; import org.kie.workbench.common.stunner.core.graph.content.view.View; import org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl; +import org.kie.workbench.common.stunner.kogito.client.PromiseMock; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; @@ -62,7 +62,6 @@ import org.uberfire.commons.data.Pair; import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchCallback; import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchResults; -import org.uberfire.mocks.CallerMock; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; @@ -72,6 +71,7 @@ import static org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.FunctionSearchServiceTest.verifyNotContains; import static org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.VariableSearchService.unboxDefaultType; import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -98,9 +98,7 @@ public class VariableSearchServiceTest { private static final String CASE_VARIABLE_LABEL_PREFIX = "CASE_VARIABLE_LABEL_PREFIX"; @Mock - protected ConditionEditorService editorService; - - protected Caller editorServiceCaller; + protected ConditionEditorMetadataService metadataService; @Mock protected ClientTranslationService translationService; @@ -146,13 +144,12 @@ public void setUp() { when(diagram.getMetadata()).thenReturn(metadata); when(metadata.getPath()).thenReturn(path); when(metadata.getCanvasRootUUID()).thenReturn(CANVAS_ROOT_ID); - editorServiceCaller = new CallerMock<>(editorService); when(translationService.getValue("VariableSearchService.CaseVariableLabelPrefix")).thenReturn(CASE_VARIABLE_LABEL_PREFIX); searchService = newSearchService(); } protected VariableSearchService newSearchService() { - return new VariableSearchService(editorServiceCaller, translationService); + return new VariableSearchService(metadataService, translationService); } @Test @@ -194,6 +191,7 @@ public void testSearchWithoutResults() { } @Test + @SuppressWarnings("unchecked") public void testSearchEntryWithResults() { prepareAndInitSession(); List> expectedVariables = buildExpectedVariableNames(MULTIPLE_INSTANCE_SUBPROCESS, 17); @@ -205,6 +203,7 @@ public void testSearchEntryWithResults() { } @Test + @SuppressWarnings("unchecked") public void testSearchEntryWithoutResults() { prepareAndInitSession(); List checkedVariables = Arrays.asList("not-existing1", "not-existing2", "not-existing3", "and_so_on"); @@ -255,6 +254,7 @@ public void testUnboxDefaultTypes() { } @Test + @SuppressWarnings("unchecked") public void testClear() { prepareAndInitSession(); List> expectedVariables = buildExpectedVariableNames(MULTIPLE_INSTANCE_SUBPROCESS, 17); @@ -274,6 +274,7 @@ public void testClear() { } } + @SuppressWarnings("unchecked") protected void prepareAndInitSession() { prepareSelectedItem(); List nodes = mockNodes(); @@ -281,8 +282,7 @@ protected void prepareAndInitSession() { Set typeMetadatas = new HashSet<>(); typeMetadatas.add(mockBean1Metadata()); TypeMetadataQueryResult queryResult = new TypeMetadataQueryResult(typeMetadatas, new HashSet<>()); - when(editorService.findMetadata(any())).thenReturn(queryResult); - + doReturn(PromiseMock.success(queryResult)).when(metadataService).call(any(TypeMetadataQuery.class)); searchService.init(clientSession); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/filters/BPMNDiagramFilterProviderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/filters/BPMNDiagramFilterProviderTest.java index 41d7efa754f..ee95866a5fc 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/filters/BPMNDiagramFilterProviderTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/filters/BPMNDiagramFilterProviderTest.java @@ -20,7 +20,7 @@ import org.junit.runner.RunWith; import org.kie.workbench.common.forms.adf.engine.shared.FormElementFilter; import org.kie.workbench.common.forms.processing.engine.handling.FieldChangeHandlerManager; -import org.kie.workbench.common.stunner.bpmn.client.diagram.DiagramTypeService; +import org.kie.workbench.common.stunner.bpmn.client.diagram.DiagramTypeClientService; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc; import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet; @@ -58,7 +58,7 @@ public class BPMNDiagramFilterProviderTest { private SessionManager sessionManager; @Mock - private DiagramTypeService diagramTypeService; + private DiagramTypeClientService diagramTypeService; @Mock private FieldChangeHandlerManager fieldChangeHandlerManager; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/util/BPMNFormsContextUtilsTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/util/BPMNFormsContextUtilsTest.java new file mode 100644 index 00000000000..7111efb1dfc --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/util/BPMNFormsContextUtilsTest.java @@ -0,0 +1,58 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.forms.util; + +import org.junit.Assert; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.definition.BaseTask; +import org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask; +import org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask; +import org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent; +import org.kie.workbench.common.stunner.bpmn.definition.NoneTask; +import org.kie.workbench.common.stunner.bpmn.definition.ParallelGateway; +import org.kie.workbench.common.stunner.bpmn.definition.ScriptTask; +import org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent; +import org.kie.workbench.common.stunner.bpmn.definition.UserTask; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; +import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; + +import static org.mockito.Mockito.mock; + +public class BPMNFormsContextUtilsTest { + + @Test + public void testIsFormGenerationSupported() { + Assert.assertTrue(BPMNFormsContextUtils.isFormGenerationSupported(createNode(new UserTask()))); + Assert.assertTrue(BPMNFormsContextUtils.isFormGenerationSupported(createNode(mock(BaseUserTask.class)))); + Assert.assertFalse(BPMNFormsContextUtils.isFormGenerationSupported(createNode(mock(BaseTask.class)))); + Assert.assertFalse(BPMNFormsContextUtils.isFormGenerationSupported(createNode(new ScriptTask()))); + Assert.assertFalse(BPMNFormsContextUtils.isFormGenerationSupported(createNode(new BusinessRuleTask()))); + Assert.assertFalse(BPMNFormsContextUtils.isFormGenerationSupported(createNode(new NoneTask()))); + Assert.assertFalse(BPMNFormsContextUtils.isFormGenerationSupported(createNode(new StartNoneEvent()))); + Assert.assertFalse(BPMNFormsContextUtils.isFormGenerationSupported(createNode(new EndNoneEvent()))); + Assert.assertFalse(BPMNFormsContextUtils.isFormGenerationSupported(createNode(new ParallelGateway()))); + } + + private static Node createNode(final Object def) { + NodeImpl node = new NodeImpl<>("id1"); + node.setContent(new ViewImpl<>(def, + Bounds.create())); + return node; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/util/ContextUtilsTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/util/ContextUtilsTest.java deleted file mode 100644 index 08ddc9f4a75..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/forms/util/ContextUtilsTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.forms.util; - -import org.junit.Assert; -import org.junit.Test; -import org.kie.workbench.common.stunner.bpmn.definition.BaseTask; -import org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask; -import org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask; -import org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent; -import org.kie.workbench.common.stunner.bpmn.definition.NoneTask; -import org.kie.workbench.common.stunner.bpmn.definition.ParallelGateway; -import org.kie.workbench.common.stunner.bpmn.definition.ScriptTask; -import org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent; -import org.kie.workbench.common.stunner.bpmn.definition.UserTask; -import org.kie.workbench.common.stunner.core.graph.Node; -import org.kie.workbench.common.stunner.core.graph.content.Bounds; -import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; -import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; - -import static org.mockito.Mockito.mock; - -public class ContextUtilsTest { - - @Test - public void testIsFormGenerationSupported() { - Assert.assertTrue(ContextUtils.isFormGenerationSupported(createNode(new UserTask()))); - Assert.assertTrue(ContextUtils.isFormGenerationSupported(createNode(mock(BaseUserTask.class)))); - Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(mock(BaseTask.class)))); - Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new ScriptTask()))); - Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new BusinessRuleTask()))); - Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new NoneTask()))); - Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new StartNoneEvent()))); - Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new EndNoneEvent()))); - Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new ParallelGateway()))); - } - - private static Node createNode(final Object def) { - NodeImpl node = new NodeImpl<>("id1"); - node.setContent(new ViewImpl<>(def, - Bounds.create())); - return node; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/session/BPMNSessionInitializerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/session/BPMNSessionInitializerTest.java index b607daddea3..9dd1ecea9f7 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/session/BPMNSessionInitializerTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/session/BPMNSessionInitializerTest.java @@ -16,17 +16,21 @@ package org.kie.workbench.common.stunner.bpmn.client.session; +import elemental2.promise.IThenable; +import elemental2.promise.Promise; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.bpmn.client.diagram.DiagramTypeService; -import org.kie.workbench.common.stunner.bpmn.client.workitem.WorkItemDefinitionClientRegistry; +import org.kie.workbench.common.stunner.bpmn.client.diagram.DiagramTypeClientService; +import org.kie.workbench.common.stunner.bpmn.client.workitem.WorkItemDefinitionClientService; import org.kie.workbench.common.stunner.core.diagram.Metadata; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.uberfire.mvp.Command; -import static org.mockito.Matchers.eq; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -35,15 +39,22 @@ public class BPMNSessionInitializerTest { @Mock - private WorkItemDefinitionClientRegistry workItemDefinitionService; + private WorkItemDefinitionClientService workItemDefinitionService; - private BPMNSessionInitializer tested; + @Mock + private Promise promise; @Mock - private DiagramTypeService diagramTypeService; + private DiagramTypeClientService diagramTypeService; + + private BPMNSessionInitializer tested; @Before + @SuppressWarnings("unchecked") public void setUp() { + doReturn(promise).when(workItemDefinitionService).call(any(Metadata.class)); + doReturn(promise).when(promise).then(any(IThenable.ThenOnFulfilledCallbackFn.class)); + doReturn(promise).when(promise).catch_(any(Promise.CatchOnRejectedCallbackFn.class)); tested = new BPMNSessionInitializer(workItemDefinitionService, diagramTypeService); } @@ -52,7 +63,7 @@ public void testInit() { Metadata metadata = mock(Metadata.class); Command callback = mock(Command.class); tested.init(metadata, callback); - verify(workItemDefinitionService, times(1)).load(eq(metadata), eq(callback)); verify(diagramTypeService).loadDiagramType(metadata); + verify(workItemDefinitionService, times(1)).call(eq(metadata)); } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/workitem/WorkItemDefinitionClientRegistryTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/workitem/WorkItemDefinitionClientRegistryTest.java deleted file mode 100644 index fec01fe32b9..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/test/java/org/kie/workbench/common/stunner/bpmn/client/workitem/WorkItemDefinitionClientRegistryTest.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.client.workitem; - -import java.util.Collections; -import java.util.function.Consumer; - -import org.jboss.errai.common.client.api.Caller; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; -import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry; -import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistries; -import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; -import org.kie.workbench.common.stunner.core.client.api.SessionManager; -import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; -import org.kie.workbench.common.stunner.core.client.session.ClientSession; -import org.kie.workbench.common.stunner.core.client.session.event.SessionDestroyedEvent; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; -import org.uberfire.mocks.CallerMock; -import org.uberfire.mvp.Command; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class WorkItemDefinitionClientRegistryTest { - - private static final WorkItemDefinition WID = new WorkItemDefinition().setName("testWID"); - - @Mock - private WorkItemDefinitionLookupService service; - - @Mock - private WorkItemDefinitionRegistries index; - - @Mock - private SessionManager sessionManager; - - @Mock - private WorkItemDefinitionCacheRegistry registry; - - @Mock - private Consumer errorPresenter; - - @Mock - private Metadata metadata; - - @Mock - private SessionDestroyedEvent sessionDestroyedEvent; - - private WorkItemDefinitionClientRegistry tested; - private Caller serviceCaller; - - @Before - @SuppressWarnings("unchecked") - public void init() { - when(index.registries()).thenReturn(m -> metadata.equals(m) ? registry : null); - when(service.execute(eq(metadata))).thenReturn(Collections.singleton(WID)); - when(sessionDestroyedEvent.getMetadata()).thenReturn(metadata); - when(index.remove(metadata)).thenReturn(registry); - serviceCaller = new CallerMock<>(service); - tested = new WorkItemDefinitionClientRegistry(serviceCaller, - sessionManager, - () -> registry, - errorPresenter, - index); - } - - @Test - @SuppressWarnings("unchecked") - public void testLoad() { - Command callback = mock(Command.class); - tested.load(metadata, - callback); - verify(index, times(1)).put(eq(metadata), eq(registry)); - verify(registry, times(1)).register(eq(WID)); - verify(callback, times(1)).execute(); - } - - @Test - @SuppressWarnings("unchecked") - public void testGetCurrentSessionRegistry() { - ClientSession session = mock(ClientSession.class); - CanvasHandler canvasHandler = mock(CanvasHandler.class); - Diagram diagram = mock(Diagram.class); - when(session.getCanvasHandler()).thenReturn(canvasHandler); - when(canvasHandler.getDiagram()).thenReturn(diagram); - when(diagram.getMetadata()).thenReturn(metadata); - when(sessionManager.getCurrentSession()).thenReturn(session); - Command callback = mock(Command.class); - tested.load(metadata, - callback); - verify(index, times(1)).put(eq(metadata), eq(registry)); - verify(registry, times(1)).register(eq(WID)); - verify(callback, times(1)).execute(); - WorkItemDefinitionCacheRegistry currentSessionRegistry = tested.getCurrentSessionRegistry(); - assertEquals(registry, currentSessionRegistry); - } - - @Test - @SuppressWarnings("unchecked") - public void testDestroy() { - tested.destroy(); - verify(index, times(1)).clear(); - } - - @Test - public void testOnSessionDestroyed() { - tested.onSessionDestroyed(sessionDestroyedEvent); - verify(index).remove(metadata); - verify(registry).clear(); - } - - @Test - public void testOnSessionDestroyedNullRegistry() { - when(index.remove(metadata)).thenReturn(null); - - tested.onSessionDestroyed(sessionDestroyedEvent); - - verify(index).remove(metadata); - verify(registry, never()).clear(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/.gitignore b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/.gitignore new file mode 100644 index 00000000000..76778936e5f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/.gitignore @@ -0,0 +1,18 @@ +/target +/local + +# Eclipse, Netbeans and IntelliJ files +/.* +/**/.* +!.gitignore +/nbproject +*.ipr +*.iws +*.iml + +# Repository wide ignore mac DS_Store files +.DS_Store +gwt-unitCache/* +war/* + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/README.md b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/README.md new file mode 100644 index 00000000000..7ee7d4cf384 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/README.md @@ -0,0 +1,84 @@ +Stunner - GWT support for BPMN2/EMF/XMI +======================================= + +Introduction +------------ +This module encapsulates the EMF/XMI stuff and the jBPM customized models into a single artifact that can be exposed to the GWT compiler. + +It's goal is to be the base stuff that allows to perform the Stunner's BPMN domain marshalling on pure client side, by re-using as much as possible Stunner's BPMN marshalling code which was already implemented on top Eclise EMF. + +This module provides some basic GWT (client side) support for: +* Eclise EMF +* Eclise XMI +* BPMN2 Eclipse models (customized - jBPM) + +_NOTE_: This module is NOT a generic GWT implementation for Eclipse EMF/XMI stuff. It's just focusing on the specific BPMN2 domain and actual implementations (based on Eclipse EMF) and how to make all those available on client side. + +_NOTE_: This module is decoupled from Stunner - decoupled from both API and the Stunner's BPMN2 domain model as well). So please DO NOT add any dependency that results on unexpected coupling on Errai/UF/Stunner. + +_TIP_: No need to run this module using the whole Stunner (as it's decoupled), so for faster development and bug fixing better using some simple GWT webapp (like [this example one](https://github.com/romartin/gwt-bpmn-marshallers). + + +Implementation details +---------------------- + +**A) Eclipse EMF - GWT support** +This module relies on the Eclipse EMF core GWT support plugins: +* [Ecore GWT plugin](https://github.com/eclipse/emf/tree/master/plugins/org.eclipse.emf.gwt.ecore) - `org.eclipselabs:org.eclipse.emf.gwt.ecore:2.9.0` +* [Ecore Common GWT plugin](https://github.com/eclipse/emf/tree/master/plugins/org.eclipse.emf.gwt.common) - `org.eclipselabs:org.eclipse.emf.gwt.common:2.9.0` + +**B) Eclipse XMI - GWT support** +The existing Eclise XMI library cannot be exposed to client side, so this module includes the necessary classes to achieve our marshalling goals, based on moving/refactoring the existing code from the original library for our custom needs. + +So the XMI - GWT support: +* Is being provided by all classes in the `org.eclipse.emf.ecore.xmi` package root in this module +* Code has been moved and then refactored from the library: `org.eclipse.emf:org.eclipse.emf.ecore.xmi:2.5.0.v20100521-1846` + +**C) Custom BPMN2 Eclipse models** +This module also contains the custom jBPM Eclipse models for BPMN2 (EMF based): + +* Model descriptors +** It contains the model and generator descriptor files inside the [model](./model) folder +** These files have been obtained from the [Tiho's BPMN2 repository fork](https://github.com/tsurdilo/bpmn2) and refactored in order to expose them to the GWT compiler + +* Generated model code +** This module contains the generated code from the models above +** In case any model descriptor is updated, the generated classes must be also updated, see next section + +HowTo update (re-generate) model classes +---------------------------------------- + +**1.- Remove actual model classes** (previously generated) + + mvn clean -Pclean-generated-models + +It removes the existing code previously generated from models + - `org.eclipse.bpmn2.*` (`BPMN20.genmodel`) + - `org.eclipse.dd.*` (`BPMN20.genmodel`) + - `org.jboss.drools.*` (`bpmn2emfextmodel.genmodel`) + - `bpsim.*` (`bpsim.genmodel`) + - `org.omg.spec.bpmn.non.normative.color.*` (`bpmn2color.genmodel`) + +NOTE: Manage properly the GIT changes +NOTE: Do NOT refactor/style generated code + +**2.- (Re)Generate models** + 2.1 - Configure Eclipse workspace + - Install EMF support plugins in Eclipse + - File -> Import -> Projects from Folder or Archive + - Choose directory -> use _kie-wb-common-stunner-bpmn-emf_ as the root folder + 2.2 - Apply the excepted model updates as well, if any (in ecore and genmodel files) + 2.3 - Generate models - Right click -> Generate model code + - `BPMN20.genmodel` + - `bpmn2emfextmodel.genmodel` + - `bpsim.genmodel` + - `bpmn2color.genmodel` + 2.4 - Remove the generated `gwt.xml` module files (a new GWT module is being created for each above `genmodel` file), no need for those. + 2.5 - Reformat code according our KIE styles + 2.6 - Update licenses/copy-rights + +NOTE: Manage properly the GIT changes + +**3.- Build & run & test app** + +**4.- Commit updates** \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/BPMN20.ecore b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/BPMN20.ecore new file mode 100644 index 00000000000..8116a8ad94e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/BPMN20.ecore @@ -0,0 +1,4523 @@ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+
+ + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+ + + + + + + +
+
+ + + + +
+
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + + +
+
+
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + + +
+
+ + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+ + + + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + + +
+
+ + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+ + + + + + +
+
+
+ + + + +
+
+ + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + + + + + + +
+
+ + + + +
+
+
+
+ + + + + + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + + + +
+
+
+ + + + +
+
+
+
+ + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+ + + + + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + + +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + + +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+ + + + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+ + + + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+ + + + + + + + +
+
+ + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + + +
+
+
+ + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+
+
+ + + + + +
+
+ + + +
+
+
+
+ + + + + +
+
+ + + +
+
+
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/BPMN20.genmodel b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/BPMN20.genmodel new file mode 100644 index 00000000000..5eff0320032 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/BPMN20.genmodel @@ -0,0 +1,922 @@ + + + BPMN20.ecore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/BPMNDI.ecore b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/BPMNDI.ecore new file mode 100644 index 00000000000..e0b9654d631 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/BPMNDI.ecore @@ -0,0 +1,268 @@ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/DC.ecore b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/DC.ecore new file mode 100644 index 00000000000..d084dc25e51 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/DC.ecore @@ -0,0 +1,178 @@ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+ + + +
+ + + + +
+ + + + + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/DI.ecore b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/DI.ecore new file mode 100644 index 00000000000..c789bcf639a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/DI.ecore @@ -0,0 +1,302 @@ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + +
+
+ + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+
+ + + + + + + + +
+
+ + + + + +
+
+ + + + + +
+
+
+ + + + + +
+
+ + + +
+
+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + +
+ + + +
+ + + + +
+ + + + + + + + + +
+
+
+
+ + + + + +
+
+ + + +
+
+
+ + + + + +
+
+ + + +
+
+ + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpmn2color.genmodel b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpmn2color.genmodel new file mode 100644 index 00000000000..3526658c399 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpmn2color.genmodel @@ -0,0 +1,20 @@ + + + bpmn2color.xsd + + + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpmn2color.xsd b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpmn2color.xsd new file mode 100644 index 00000000000..8cbd0753e9f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpmn2color.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpmn2emfextmodel.genmodel b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpmn2emfextmodel.genmodel new file mode 100644 index 00000000000..8ef37d7d82d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpmn2emfextmodel.genmodel @@ -0,0 +1,50 @@ + + + bpmn2emfextmodel.xsd + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpmn2emfextmodel.xsd b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpmn2emfextmodel.xsd new file mode 100644 index 00000000000..552f6254faf --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpmn2emfextmodel.xsd @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpsim.ecore b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpsim.ecore new file mode 100644 index 00000000000..bdf73ea4b8f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpsim.ecore @@ -0,0 +1,1385 @@ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + +
+ + +
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + +
+
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + + +
+ + + + + + + + + +
+
+ + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + + +
+ + + + + + + + + + +
+
+ + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+
+ + + + +
+
+ + + + +
+
+
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpsim.genmodel b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpsim.genmodel new file mode 100644 index 00000000000..3c807062f5f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpsim.genmodel @@ -0,0 +1,249 @@ + + + bpsim.ecore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpsim.xsd b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpsim.xsd new file mode 100644 index 00000000000..a50119881e7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/bpsim.xsd @@ -0,0 +1,402 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Even if here we reference a list of Parameter Values, only Constant Parameters are valid here. There is just no real way of expressing it in xsd. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/color.ecore b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/color.ecore new file mode 100644 index 00000000000..c7dc516ac53 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/color.ecore @@ -0,0 +1,62 @@ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+
+ + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/drools.ecore b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/drools.ecore new file mode 100644 index 00000000000..e44559fbd06 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/drools.ecore @@ -0,0 +1,237 @@ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/oursimchanges.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/oursimchanges.xml new file mode 100644 index 00000000000..f44095ccc0f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/model/oursimchanges.xml @@ -0,0 +1,445 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Even if here we reference a list of Parameter + Values, only Constant Parameters are valid here. There is just + no real way of expressing it in xsd. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/pom.xml new file mode 100644 index 00000000000..2bbe4c79ffa --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/pom.xml @@ -0,0 +1,188 @@ + + + + + + kie-wb-common-stunner-bpmn + org.kie.workbench.stunner + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-stunner-bpmn-emf + Kie Workbench - Common - Stunner - BPMN Definition Set - GWT Support for Eclipse EMF/XMI + Kie Workbench - Common - Stunner - BPMN Definition Set - GWT Support for Eclipse EMF/XMI + jar + + + + + org.eclipselabs + org.eclipse.emf.gwt.ecore + + + + org.eclipselabs + org.eclipse.emf.gwt.common + + + + com.google.gwt + gwt-user + provided + + + + + + junit + junit + test + + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-common + test + test-jar + + + + org.uberfire + uberfire-testing-utils + test + + + javax.activation + activation + + + + + + org.slf4j + slf4j-simple + test + + + + org.mockito + mockito-core + test + + + + com.google.gwt.gwtmockito + gwtmockito + test + + + + org.jboss.spec.javax.xml.bind + jboss-jaxb-api_2.3_spec + test + + + + com.google.gwt + gwt-dev + test + + + org.mortbay.jasper + apache-el + + + + + + + + + + maven-checkstyle-plugin + + true + + + + + maven-surefire-plugin + + + ${basedir}/target/classes/ + ${basedir}/src/main/java/ + ${basedir}/src/test/java/ + + false + pertest + -Xmx1500m -Derrai.devel.nocache=true -Derrai.codegen.permissive=false -Derrai.dynamic_validation.enabled=true + + + + errai.hosted_mode_testing + true + + + + + + + + + + + clean-generated-models + + + clean-generated-models + + + + + + maven-clean-plugin + + false + + + ${basedir} + + build.properties + plugin.properties + plugin.xml + META-INF/** + src/main/java/bpsim/** + src/main/java/org/jboss/drools/** + src/main/java/org/omg/** + src/main/java/org/eclipse/bpmn2/** + src/main/java/org/eclipse/dd/** + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BPSimDataType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BPSimDataType.java new file mode 100644 index 00000000000..f0c6e2f5181 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BPSimDataType.java @@ -0,0 +1,55 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'BP Sim Data Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.BPSimDataType#getGroup Group}
  • + *
  • {@link bpsim.BPSimDataType#getScenario Scenario}
  • + *
+ * + * @see bpsim.BpsimPackage#getBPSimDataType() + * @model extendedMetaData="name='BPSimData_._type' kind='elementOnly'" + * @generated + */ +public interface BPSimDataType extends EObject { + /** + * Returns the value of the 'Group' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Group' attribute list. + * @see bpsim.BpsimPackage#getBPSimDataType_Group() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='group' name='group:0'" + * @generated + */ + FeatureMap getGroup(); + + /** + * Returns the value of the 'Scenario' containment reference list. + * The list contents are of type {@link bpsim.Scenario}. + * + * + * @return the value of the 'Scenario' containment reference list. + * @see bpsim.BpsimPackage#getBPSimDataType_Scenario() + * @model containment="true" required="true" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='Scenario' namespace='##targetNamespace' group='#group:0'" + * @generated + */ + EList getScenario(); + +} // BPSimDataType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BetaDistributionType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BetaDistributionType.java new file mode 100644 index 00000000000..7acc7494594 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BetaDistributionType.java @@ -0,0 +1,124 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Beta Distribution Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.BetaDistributionType#getScale Scale}
  • + *
  • {@link bpsim.BetaDistributionType#getShape Shape}
  • + *
+ * + * @see bpsim.BpsimPackage#getBetaDistributionType() + * @model extendedMetaData="name='BetaDistribution_._type' kind='empty'" + * @generated + */ +public interface BetaDistributionType extends DistributionParameter { + /** + * Returns the value of the 'Scale' attribute. + * + * + * @return the value of the 'Scale' attribute. + * @see #isSetScale() + * @see #unsetScale() + * @see #setScale(double) + * @see bpsim.BpsimPackage#getBetaDistributionType_Scale() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='scale'" + * @generated + */ + double getScale(); + + /** + * Sets the value of the '{@link bpsim.BetaDistributionType#getScale Scale}' attribute. + * + * + * @param value the new value of the 'Scale' attribute. + * @see #isSetScale() + * @see #unsetScale() + * @see #getScale() + * @generated + */ + void setScale(double value); + + /** + * Unsets the value of the '{@link bpsim.BetaDistributionType#getScale Scale}' attribute. + * + * + * @see #isSetScale() + * @see #getScale() + * @see #setScale(double) + * @generated + */ + void unsetScale(); + + /** + * Returns whether the value of the '{@link bpsim.BetaDistributionType#getScale Scale}' attribute is set. + * + * + * @return whether the value of the 'Scale' attribute is set. + * @see #unsetScale() + * @see #getScale() + * @see #setScale(double) + * @generated + */ + boolean isSetScale(); + + /** + * Returns the value of the 'Shape' attribute. + * + * + * @return the value of the 'Shape' attribute. + * @see #isSetShape() + * @see #unsetShape() + * @see #setShape(double) + * @see bpsim.BpsimPackage#getBetaDistributionType_Shape() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='shape'" + * @generated + */ + double getShape(); + + /** + * Sets the value of the '{@link bpsim.BetaDistributionType#getShape Shape}' attribute. + * + * + * @param value the new value of the 'Shape' attribute. + * @see #isSetShape() + * @see #unsetShape() + * @see #getShape() + * @generated + */ + void setShape(double value); + + /** + * Unsets the value of the '{@link bpsim.BetaDistributionType#getShape Shape}' attribute. + * + * + * @see #isSetShape() + * @see #getShape() + * @see #setShape(double) + * @generated + */ + void unsetShape(); + + /** + * Returns whether the value of the '{@link bpsim.BetaDistributionType#getShape Shape}' attribute is set. + * + * + * @return whether the value of the 'Shape' attribute is set. + * @see #unsetShape() + * @see #getShape() + * @see #setShape(double) + * @generated + */ + boolean isSetShape(); + +} // BetaDistributionType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BinomialDistributionType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BinomialDistributionType.java new file mode 100644 index 00000000000..c4a5b459924 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BinomialDistributionType.java @@ -0,0 +1,124 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Binomial Distribution Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.BinomialDistributionType#getProbability Probability}
  • + *
  • {@link bpsim.BinomialDistributionType#getTrials Trials}
  • + *
+ * + * @see bpsim.BpsimPackage#getBinomialDistributionType() + * @model extendedMetaData="name='BinomialDistribution_._type' kind='empty'" + * @generated + */ +public interface BinomialDistributionType extends DistributionParameter { + /** + * Returns the value of the 'Probability' attribute. + * + * + * @return the value of the 'Probability' attribute. + * @see #isSetProbability() + * @see #unsetProbability() + * @see #setProbability(double) + * @see bpsim.BpsimPackage#getBinomialDistributionType_Probability() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='probability'" + * @generated + */ + double getProbability(); + + /** + * Sets the value of the '{@link bpsim.BinomialDistributionType#getProbability Probability}' attribute. + * + * + * @param value the new value of the 'Probability' attribute. + * @see #isSetProbability() + * @see #unsetProbability() + * @see #getProbability() + * @generated + */ + void setProbability(double value); + + /** + * Unsets the value of the '{@link bpsim.BinomialDistributionType#getProbability Probability}' attribute. + * + * + * @see #isSetProbability() + * @see #getProbability() + * @see #setProbability(double) + * @generated + */ + void unsetProbability(); + + /** + * Returns whether the value of the '{@link bpsim.BinomialDistributionType#getProbability Probability}' attribute is set. + * + * + * @return whether the value of the 'Probability' attribute is set. + * @see #unsetProbability() + * @see #getProbability() + * @see #setProbability(double) + * @generated + */ + boolean isSetProbability(); + + /** + * Returns the value of the 'Trials' attribute. + * + * + * @return the value of the 'Trials' attribute. + * @see #isSetTrials() + * @see #unsetTrials() + * @see #setTrials(long) + * @see bpsim.BpsimPackage#getBinomialDistributionType_Trials() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Long" + * extendedMetaData="kind='attribute' name='trials'" + * @generated + */ + long getTrials(); + + /** + * Sets the value of the '{@link bpsim.BinomialDistributionType#getTrials Trials}' attribute. + * + * + * @param value the new value of the 'Trials' attribute. + * @see #isSetTrials() + * @see #unsetTrials() + * @see #getTrials() + * @generated + */ + void setTrials(long value); + + /** + * Unsets the value of the '{@link bpsim.BinomialDistributionType#getTrials Trials}' attribute. + * + * + * @see #isSetTrials() + * @see #getTrials() + * @see #setTrials(long) + * @generated + */ + void unsetTrials(); + + /** + * Returns whether the value of the '{@link bpsim.BinomialDistributionType#getTrials Trials}' attribute is set. + * + * + * @return whether the value of the 'Trials' attribute is set. + * @see #unsetTrials() + * @see #getTrials() + * @see #setTrials(long) + * @generated + */ + boolean isSetTrials(); + +} // BinomialDistributionType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BooleanParameterType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BooleanParameterType.java new file mode 100644 index 00000000000..0ad89b0aafd --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BooleanParameterType.java @@ -0,0 +1,73 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Boolean Parameter Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.BooleanParameterType#isValue Value}
  • + *
+ * + * @see bpsim.BpsimPackage#getBooleanParameterType() + * @model extendedMetaData="name='BooleanParameter_._type' kind='empty'" + * @generated + */ +public interface BooleanParameterType extends ConstantParameter { + /** + * Returns the value of the 'Value' attribute. + * + * + * @return the value of the 'Value' attribute. + * @see #isSetValue() + * @see #unsetValue() + * @see #setValue(boolean) + * @see bpsim.BpsimPackage#getBooleanParameterType_Value() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Boolean" + * extendedMetaData="kind='attribute' name='value'" + * @generated + */ + boolean isValue(); + + /** + * Sets the value of the '{@link bpsim.BooleanParameterType#isValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #isSetValue() + * @see #unsetValue() + * @see #isValue() + * @generated + */ + void setValue(boolean value); + + /** + * Unsets the value of the '{@link bpsim.BooleanParameterType#isValue Value}' attribute. + * + * + * @see #isSetValue() + * @see #isValue() + * @see #setValue(boolean) + * @generated + */ + void unsetValue(); + + /** + * Returns whether the value of the '{@link bpsim.BooleanParameterType#isValue Value}' attribute is set. + * + * + * @return whether the value of the 'Value' attribute is set. + * @see #unsetValue() + * @see #isValue() + * @see #setValue(boolean) + * @generated + */ + boolean isSetValue(); + +} // BooleanParameterType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BpsimFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BpsimFactory.java new file mode 100644 index 00000000000..1fea1242211 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BpsimFactory.java @@ -0,0 +1,411 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see bpsim.BpsimPackage + * @generated + */ +public interface BpsimFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + BpsimFactory eINSTANCE = bpsim.impl.BpsimFactoryImpl.init(); + + /** + * Returns a new object of class 'Beta Distribution Type'. + * + * + * @return a new object of class 'Beta Distribution Type'. + * @generated + */ + BetaDistributionType createBetaDistributionType(); + + /** + * Returns a new object of class 'Binomial Distribution Type'. + * + * + * @return a new object of class 'Binomial Distribution Type'. + * @generated + */ + BinomialDistributionType createBinomialDistributionType(); + + /** + * Returns a new object of class 'Boolean Parameter Type'. + * + * + * @return a new object of class 'Boolean Parameter Type'. + * @generated + */ + BooleanParameterType createBooleanParameterType(); + + /** + * Returns a new object of class 'BP Sim Data Type'. + * + * + * @return a new object of class 'BP Sim Data Type'. + * @generated + */ + BPSimDataType createBPSimDataType(); + + /** + * Returns a new object of class 'Calendar'. + * + * + * @return a new object of class 'Calendar'. + * @generated + */ + Calendar createCalendar(); + + /** + * Returns a new object of class 'Constant Parameter'. + * + * + * @return a new object of class 'Constant Parameter'. + * @generated + */ + ConstantParameter createConstantParameter(); + + /** + * Returns a new object of class 'Control Parameters'. + * + * + * @return a new object of class 'Control Parameters'. + * @generated + */ + ControlParameters createControlParameters(); + + /** + * Returns a new object of class 'Cost Parameters'. + * + * + * @return a new object of class 'Cost Parameters'. + * @generated + */ + CostParameters createCostParameters(); + + /** + * Returns a new object of class 'Date Time Parameter Type'. + * + * + * @return a new object of class 'Date Time Parameter Type'. + * @generated + */ + DateTimeParameterType createDateTimeParameterType(); + + /** + * Returns a new object of class 'Distribution Parameter'. + * + * + * @return a new object of class 'Distribution Parameter'. + * @generated + */ + DistributionParameter createDistributionParameter(); + + /** + * Returns a new object of class 'Document Root'. + * + * + * @return a new object of class 'Document Root'. + * @generated + */ + DocumentRoot createDocumentRoot(); + + /** + * Returns a new object of class 'Duration Parameter Type'. + * + * + * @return a new object of class 'Duration Parameter Type'. + * @generated + */ + DurationParameterType createDurationParameterType(); + + /** + * Returns a new object of class 'Element Parameters'. + * + * + * @return a new object of class 'Element Parameters'. + * @generated + */ + ElementParameters createElementParameters(); + + /** + * Returns a new object of class 'Element Parameters Type'. + * + * + * @return a new object of class 'Element Parameters Type'. + * @generated + */ + ElementParametersType createElementParametersType(); + + /** + * Returns a new object of class 'Enum Parameter Type'. + * + * + * @return a new object of class 'Enum Parameter Type'. + * @generated + */ + EnumParameterType createEnumParameterType(); + + /** + * Returns a new object of class 'Erlang Distribution Type'. + * + * + * @return a new object of class 'Erlang Distribution Type'. + * @generated + */ + ErlangDistributionType createErlangDistributionType(); + + /** + * Returns a new object of class 'Expression Parameter Type'. + * + * + * @return a new object of class 'Expression Parameter Type'. + * @generated + */ + ExpressionParameterType createExpressionParameterType(); + + /** + * Returns a new object of class 'Floating Parameter Type'. + * + * + * @return a new object of class 'Floating Parameter Type'. + * @generated + */ + FloatingParameterType createFloatingParameterType(); + + /** + * Returns a new object of class 'Gamma Distribution Type'. + * + * + * @return a new object of class 'Gamma Distribution Type'. + * @generated + */ + GammaDistributionType createGammaDistributionType(); + + /** + * Returns a new object of class 'Log Normal Distribution Type'. + * + * + * @return a new object of class 'Log Normal Distribution Type'. + * @generated + */ + LogNormalDistributionType createLogNormalDistributionType(); + + /** + * Returns a new object of class 'Negative Exponential Distribution Type'. + * + * + * @return a new object of class 'Negative Exponential Distribution Type'. + * @generated + */ + NegativeExponentialDistributionType createNegativeExponentialDistributionType(); + + /** + * Returns a new object of class 'Normal Distribution Type'. + * + * + * @return a new object of class 'Normal Distribution Type'. + * @generated + */ + NormalDistributionType createNormalDistributionType(); + + /** + * Returns a new object of class 'Numeric Parameter Type'. + * + * + * @return a new object of class 'Numeric Parameter Type'. + * @generated + */ + NumericParameterType createNumericParameterType(); + + /** + * Returns a new object of class 'Parameter'. + * + * + * @return a new object of class 'Parameter'. + * @generated + */ + Parameter createParameter(); + + /** + * Returns a new object of class 'Parameter Value'. + * + * + * @return a new object of class 'Parameter Value'. + * @generated + */ + ParameterValue createParameterValue(); + + /** + * Returns a new object of class 'Poisson Distribution Type'. + * + * + * @return a new object of class 'Poisson Distribution Type'. + * @generated + */ + PoissonDistributionType createPoissonDistributionType(); + + /** + * Returns a new object of class 'Priority Parameters'. + * + * + * @return a new object of class 'Priority Parameters'. + * @generated + */ + PriorityParameters createPriorityParameters(); + + /** + * Returns a new object of class 'Property Parameters'. + * + * + * @return a new object of class 'Property Parameters'. + * @generated + */ + PropertyParameters createPropertyParameters(); + + /** + * Returns a new object of class 'Property Type'. + * + * + * @return a new object of class 'Property Type'. + * @generated + */ + PropertyType createPropertyType(); + + /** + * Returns a new object of class 'Resource Parameters'. + * + * + * @return a new object of class 'Resource Parameters'. + * @generated + */ + ResourceParameters createResourceParameters(); + + /** + * Returns a new object of class 'Scenario'. + * + * + * @return a new object of class 'Scenario'. + * @generated + */ + Scenario createScenario(); + + /** + * Returns a new object of class 'Scenario Parameters'. + * + * + * @return a new object of class 'Scenario Parameters'. + * @generated + */ + ScenarioParameters createScenarioParameters(); + + /** + * Returns a new object of class 'Scenario Parameters Type'. + * + * + * @return a new object of class 'Scenario Parameters Type'. + * @generated + */ + ScenarioParametersType createScenarioParametersType(); + + /** + * Returns a new object of class 'String Parameter Type'. + * + * + * @return a new object of class 'String Parameter Type'. + * @generated + */ + StringParameterType createStringParameterType(); + + /** + * Returns a new object of class 'Time Parameters'. + * + * + * @return a new object of class 'Time Parameters'. + * @generated + */ + TimeParameters createTimeParameters(); + + /** + * Returns a new object of class 'Triangular Distribution Type'. + * + * + * @return a new object of class 'Triangular Distribution Type'. + * @generated + */ + TriangularDistributionType createTriangularDistributionType(); + + /** + * Returns a new object of class 'Truncated Normal Distribution Type'. + * + * + * @return a new object of class 'Truncated Normal Distribution Type'. + * @generated + */ + TruncatedNormalDistributionType createTruncatedNormalDistributionType(); + + /** + * Returns a new object of class 'Uniform Distribution Type'. + * + * + * @return a new object of class 'Uniform Distribution Type'. + * @generated + */ + UniformDistributionType createUniformDistributionType(); + + /** + * Returns a new object of class 'User Distribution Data Point Type'. + * + * + * @return a new object of class 'User Distribution Data Point Type'. + * @generated + */ + UserDistributionDataPointType createUserDistributionDataPointType(); + + /** + * Returns a new object of class 'User Distribution Type'. + * + * + * @return a new object of class 'User Distribution Type'. + * @generated + */ + UserDistributionType createUserDistributionType(); + + /** + * Returns a new object of class 'Vendor Extension'. + * + * + * @return a new object of class 'Vendor Extension'. + * @generated + */ + VendorExtension createVendorExtension(); + + /** + * Returns a new object of class 'Weibull Distribution Type'. + * + * + * @return a new object of class 'Weibull Distribution Type'. + * @generated + */ + WeibullDistributionType createWeibullDistributionType(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + BpsimPackage getBpsimPackage(); + +} //BpsimFactory diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BpsimPackage.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BpsimPackage.java new file mode 100644 index 00000000000..6840b360025 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/BpsimPackage.java @@ -0,0 +1,6839 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see bpsim.BpsimFactory + * @model kind="package" + * @generated + */ +public interface BpsimPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "bpsim"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.bpsim.org/schemas/1.0"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "bpsim"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + BpsimPackage eINSTANCE = bpsim.impl.BpsimPackageImpl.init(); + + /** + * The meta object id for the '{@link bpsim.impl.ParameterValueImpl Parameter Value}' class. + * + * + * @see bpsim.impl.ParameterValueImpl + * @see bpsim.impl.BpsimPackageImpl#getParameterValue() + * @generated + */ + int PARAMETER_VALUE = 24; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int PARAMETER_VALUE__INSTANCE = 0; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int PARAMETER_VALUE__RESULT = 1; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int PARAMETER_VALUE__VALID_FOR = 2; + + /** + * The number of structural features of the 'Parameter Value' class. + * + * + * @generated + * @ordered + */ + int PARAMETER_VALUE_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link bpsim.impl.DistributionParameterImpl Distribution Parameter}' class. + * + * + * @see bpsim.impl.DistributionParameterImpl + * @see bpsim.impl.BpsimPackageImpl#getDistributionParameter() + * @generated + */ + int DISTRIBUTION_PARAMETER = 9; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int DISTRIBUTION_PARAMETER__INSTANCE = PARAMETER_VALUE__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int DISTRIBUTION_PARAMETER__RESULT = PARAMETER_VALUE__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int DISTRIBUTION_PARAMETER__VALID_FOR = PARAMETER_VALUE__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int DISTRIBUTION_PARAMETER__CURRENCY_UNIT = PARAMETER_VALUE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int DISTRIBUTION_PARAMETER__TIME_UNIT = PARAMETER_VALUE_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Distribution Parameter' class. + * + * + * @generated + * @ordered + */ + int DISTRIBUTION_PARAMETER_FEATURE_COUNT = PARAMETER_VALUE_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link bpsim.impl.BetaDistributionTypeImpl Beta Distribution Type}' class. + * + * + * @see bpsim.impl.BetaDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getBetaDistributionType() + * @generated + */ + int BETA_DISTRIBUTION_TYPE = 0; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int BETA_DISTRIBUTION_TYPE__INSTANCE = DISTRIBUTION_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int BETA_DISTRIBUTION_TYPE__RESULT = DISTRIBUTION_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int BETA_DISTRIBUTION_TYPE__VALID_FOR = DISTRIBUTION_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int BETA_DISTRIBUTION_TYPE__CURRENCY_UNIT = DISTRIBUTION_PARAMETER__CURRENCY_UNIT; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int BETA_DISTRIBUTION_TYPE__TIME_UNIT = DISTRIBUTION_PARAMETER__TIME_UNIT; + + /** + * The feature id for the 'Scale' attribute. + * + * + * @generated + * @ordered + */ + int BETA_DISTRIBUTION_TYPE__SCALE = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Shape' attribute. + * + * + * @generated + * @ordered + */ + int BETA_DISTRIBUTION_TYPE__SHAPE = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Beta Distribution Type' class. + * + * + * @generated + * @ordered + */ + int BETA_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link bpsim.impl.BinomialDistributionTypeImpl Binomial Distribution Type}' class. + * + * + * @see bpsim.impl.BinomialDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getBinomialDistributionType() + * @generated + */ + int BINOMIAL_DISTRIBUTION_TYPE = 1; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int BINOMIAL_DISTRIBUTION_TYPE__INSTANCE = DISTRIBUTION_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int BINOMIAL_DISTRIBUTION_TYPE__RESULT = DISTRIBUTION_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int BINOMIAL_DISTRIBUTION_TYPE__VALID_FOR = DISTRIBUTION_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int BINOMIAL_DISTRIBUTION_TYPE__CURRENCY_UNIT = DISTRIBUTION_PARAMETER__CURRENCY_UNIT; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int BINOMIAL_DISTRIBUTION_TYPE__TIME_UNIT = DISTRIBUTION_PARAMETER__TIME_UNIT; + + /** + * The feature id for the 'Probability' attribute. + * + * + * @generated + * @ordered + */ + int BINOMIAL_DISTRIBUTION_TYPE__PROBABILITY = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Trials' attribute. + * + * + * @generated + * @ordered + */ + int BINOMIAL_DISTRIBUTION_TYPE__TRIALS = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Binomial Distribution Type' class. + * + * + * @generated + * @ordered + */ + int BINOMIAL_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link bpsim.impl.ConstantParameterImpl Constant Parameter}' class. + * + * + * @see bpsim.impl.ConstantParameterImpl + * @see bpsim.impl.BpsimPackageImpl#getConstantParameter() + * @generated + */ + int CONSTANT_PARAMETER = 5; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int CONSTANT_PARAMETER__INSTANCE = PARAMETER_VALUE__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int CONSTANT_PARAMETER__RESULT = PARAMETER_VALUE__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int CONSTANT_PARAMETER__VALID_FOR = PARAMETER_VALUE__VALID_FOR; + + /** + * The number of structural features of the 'Constant Parameter' class. + * + * + * @generated + * @ordered + */ + int CONSTANT_PARAMETER_FEATURE_COUNT = PARAMETER_VALUE_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link bpsim.impl.BooleanParameterTypeImpl Boolean Parameter Type}' class. + * + * + * @see bpsim.impl.BooleanParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getBooleanParameterType() + * @generated + */ + int BOOLEAN_PARAMETER_TYPE = 2; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int BOOLEAN_PARAMETER_TYPE__INSTANCE = CONSTANT_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int BOOLEAN_PARAMETER_TYPE__RESULT = CONSTANT_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int BOOLEAN_PARAMETER_TYPE__VALID_FOR = CONSTANT_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int BOOLEAN_PARAMETER_TYPE__VALUE = CONSTANT_PARAMETER_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Boolean Parameter Type' class. + * + * + * @generated + * @ordered + */ + int BOOLEAN_PARAMETER_TYPE_FEATURE_COUNT = CONSTANT_PARAMETER_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link bpsim.impl.BPSimDataTypeImpl BP Sim Data Type}' class. + * + * + * @see bpsim.impl.BPSimDataTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getBPSimDataType() + * @generated + */ + int BP_SIM_DATA_TYPE = 3; + + /** + * The feature id for the 'Group' attribute list. + * + * + * @generated + * @ordered + */ + int BP_SIM_DATA_TYPE__GROUP = 0; + + /** + * The feature id for the 'Scenario' containment reference list. + * + * + * @generated + * @ordered + */ + int BP_SIM_DATA_TYPE__SCENARIO = 1; + + /** + * The number of structural features of the 'BP Sim Data Type' class. + * + * + * @generated + * @ordered + */ + int BP_SIM_DATA_TYPE_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link bpsim.impl.CalendarImpl Calendar}' class. + * + * + * @see bpsim.impl.CalendarImpl + * @see bpsim.impl.BpsimPackageImpl#getCalendar() + * @generated + */ + int CALENDAR = 4; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int CALENDAR__VALUE = 0; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CALENDAR__ID = 1; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CALENDAR__NAME = 2; + + /** + * The number of structural features of the 'Calendar' class. + * + * + * @generated + * @ordered + */ + int CALENDAR_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link bpsim.impl.ControlParametersImpl Control Parameters}' class. + * + * + * @see bpsim.impl.ControlParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getControlParameters() + * @generated + */ + int CONTROL_PARAMETERS = 6; + + /** + * The feature id for the 'Probability' containment reference. + * + * + * @generated + * @ordered + */ + int CONTROL_PARAMETERS__PROBABILITY = 0; + + /** + * The feature id for the 'Condition' containment reference. + * + * + * @generated + * @ordered + */ + int CONTROL_PARAMETERS__CONDITION = 1; + + /** + * The feature id for the 'Inter Trigger Timer' containment reference. + * + * + * @generated + * @ordered + */ + int CONTROL_PARAMETERS__INTER_TRIGGER_TIMER = 2; + + /** + * The feature id for the 'Trigger Count' containment reference. + * + * + * @generated + * @ordered + */ + int CONTROL_PARAMETERS__TRIGGER_COUNT = 3; + + /** + * The number of structural features of the 'Control Parameters' class. + * + * + * @generated + * @ordered + */ + int CONTROL_PARAMETERS_FEATURE_COUNT = 4; + + /** + * The meta object id for the '{@link bpsim.impl.CostParametersImpl Cost Parameters}' class. + * + * + * @see bpsim.impl.CostParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getCostParameters() + * @generated + */ + int COST_PARAMETERS = 7; + + /** + * The feature id for the 'Fixed Cost' containment reference. + * + * + * @generated + * @ordered + */ + int COST_PARAMETERS__FIXED_COST = 0; + + /** + * The feature id for the 'Unit Cost' containment reference. + * + * + * @generated + * @ordered + */ + int COST_PARAMETERS__UNIT_COST = 1; + + /** + * The number of structural features of the 'Cost Parameters' class. + * + * + * @generated + * @ordered + */ + int COST_PARAMETERS_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link bpsim.impl.DateTimeParameterTypeImpl Date Time Parameter Type}' class. + * + * + * @see bpsim.impl.DateTimeParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getDateTimeParameterType() + * @generated + */ + int DATE_TIME_PARAMETER_TYPE = 8; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int DATE_TIME_PARAMETER_TYPE__INSTANCE = CONSTANT_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int DATE_TIME_PARAMETER_TYPE__RESULT = CONSTANT_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int DATE_TIME_PARAMETER_TYPE__VALID_FOR = CONSTANT_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int DATE_TIME_PARAMETER_TYPE__VALUE = CONSTANT_PARAMETER_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Date Time Parameter Type' class. + * + * + * @generated + * @ordered + */ + int DATE_TIME_PARAMETER_TYPE_FEATURE_COUNT = CONSTANT_PARAMETER_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link bpsim.impl.DocumentRootImpl Document Root}' class. + * + * + * @see bpsim.impl.DocumentRootImpl + * @see bpsim.impl.BpsimPackageImpl#getDocumentRoot() + * @generated + */ + int DOCUMENT_ROOT = 10; + + /** + * The feature id for the 'Mixed' attribute list. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__MIXED = 0; + + /** + * The feature id for the 'XMLNS Prefix Map' map. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1; + + /** + * The feature id for the 'XSI Schema Location' map. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2; + + /** + * The feature id for the 'Beta Distribution' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BETA_DISTRIBUTION = 3; + + /** + * The feature id for the 'Parameter Value' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__PARAMETER_VALUE = 4; + + /** + * The feature id for the 'Binomial Distribution' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BINOMIAL_DISTRIBUTION = 5; + + /** + * The feature id for the 'Boolean Parameter' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BOOLEAN_PARAMETER = 6; + + /** + * The feature id for the 'BP Sim Data' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BP_SIM_DATA = 7; + + /** + * The feature id for the 'Date Time Parameter' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DATE_TIME_PARAMETER = 8; + + /** + * The feature id for the 'Duration Parameter' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DURATION_PARAMETER = 9; + + /** + * The feature id for the 'Enum Parameter' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__ENUM_PARAMETER = 10; + + /** + * The feature id for the 'Erlang Distribution' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__ERLANG_DISTRIBUTION = 11; + + /** + * The feature id for the 'Expression Parameter' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__EXPRESSION_PARAMETER = 12; + + /** + * The feature id for the 'Floating Parameter' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__FLOATING_PARAMETER = 13; + + /** + * The feature id for the 'Gamma Distribution' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__GAMMA_DISTRIBUTION = 14; + + /** + * The feature id for the 'Log Normal Distribution' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__LOG_NORMAL_DISTRIBUTION = 15; + + /** + * The feature id for the 'Negative Exponential Distribution' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__NEGATIVE_EXPONENTIAL_DISTRIBUTION = 16; + + /** + * The feature id for the 'Normal Distribution' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__NORMAL_DISTRIBUTION = 17; + + /** + * The feature id for the 'Numeric Parameter' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__NUMERIC_PARAMETER = 18; + + /** + * The feature id for the 'Poisson Distribution' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__POISSON_DISTRIBUTION = 19; + + /** + * The feature id for the 'String Parameter' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__STRING_PARAMETER = 20; + + /** + * The feature id for the 'Triangular Distribution' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__TRIANGULAR_DISTRIBUTION = 21; + + /** + * The feature id for the 'Truncated Normal Distribution' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__TRUNCATED_NORMAL_DISTRIBUTION = 22; + + /** + * The feature id for the 'Uniform Distribution' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__UNIFORM_DISTRIBUTION = 23; + + /** + * The feature id for the 'User Distribution' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__USER_DISTRIBUTION = 24; + + /** + * The feature id for the 'User Distribution Data Point' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__USER_DISTRIBUTION_DATA_POINT = 25; + + /** + * The feature id for the 'Weibull Distribution' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__WEIBULL_DISTRIBUTION = 26; + + /** + * The number of structural features of the 'Document Root' class. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT_FEATURE_COUNT = 27; + + /** + * The meta object id for the '{@link bpsim.impl.DurationParameterTypeImpl Duration Parameter Type}' class. + * + * + * @see bpsim.impl.DurationParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getDurationParameterType() + * @generated + */ + int DURATION_PARAMETER_TYPE = 11; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int DURATION_PARAMETER_TYPE__INSTANCE = CONSTANT_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int DURATION_PARAMETER_TYPE__RESULT = CONSTANT_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int DURATION_PARAMETER_TYPE__VALID_FOR = CONSTANT_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int DURATION_PARAMETER_TYPE__VALUE = CONSTANT_PARAMETER_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Duration Parameter Type' class. + * + * + * @generated + * @ordered + */ + int DURATION_PARAMETER_TYPE_FEATURE_COUNT = CONSTANT_PARAMETER_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link bpsim.impl.ElementParametersImpl Element Parameters}' class. + * + * + * @see bpsim.impl.ElementParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getElementParameters() + * @generated + */ + int ELEMENT_PARAMETERS = 12; + + /** + * The feature id for the 'Time Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS__TIME_PARAMETERS = 0; + + /** + * The feature id for the 'Control Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS__CONTROL_PARAMETERS = 1; + + /** + * The feature id for the 'Resource Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS__RESOURCE_PARAMETERS = 2; + + /** + * The feature id for the 'Priority Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS__PRIORITY_PARAMETERS = 3; + + /** + * The feature id for the 'Cost Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS__COST_PARAMETERS = 4; + + /** + * The feature id for the 'Property Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS__PROPERTY_PARAMETERS = 5; + + /** + * The feature id for the 'Vendor Extension' containment reference list. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS__VENDOR_EXTENSION = 6; + + /** + * The feature id for the 'Element Ref' attribute. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS__ELEMENT_REF = 7; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS__ID = 8; + + /** + * The number of structural features of the 'Element Parameters' class. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS_FEATURE_COUNT = 9; + + /** + * The meta object id for the '{@link bpsim.impl.ElementParametersTypeImpl Element Parameters Type}' class. + * + * + * @see bpsim.impl.ElementParametersTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getElementParametersType() + * @generated + */ + int ELEMENT_PARAMETERS_TYPE = 13; + + /** + * The feature id for the 'Time Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS_TYPE__TIME_PARAMETERS = ELEMENT_PARAMETERS__TIME_PARAMETERS; + + /** + * The feature id for the 'Control Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS_TYPE__CONTROL_PARAMETERS = ELEMENT_PARAMETERS__CONTROL_PARAMETERS; + + /** + * The feature id for the 'Resource Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS_TYPE__RESOURCE_PARAMETERS = ELEMENT_PARAMETERS__RESOURCE_PARAMETERS; + + /** + * The feature id for the 'Priority Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS_TYPE__PRIORITY_PARAMETERS = ELEMENT_PARAMETERS__PRIORITY_PARAMETERS; + + /** + * The feature id for the 'Cost Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS_TYPE__COST_PARAMETERS = ELEMENT_PARAMETERS__COST_PARAMETERS; + + /** + * The feature id for the 'Property Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS_TYPE__PROPERTY_PARAMETERS = ELEMENT_PARAMETERS__PROPERTY_PARAMETERS; + + /** + * The feature id for the 'Vendor Extension' containment reference list. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS_TYPE__VENDOR_EXTENSION = ELEMENT_PARAMETERS__VENDOR_EXTENSION; + + /** + * The feature id for the 'Element Ref' attribute. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS_TYPE__ELEMENT_REF = ELEMENT_PARAMETERS__ELEMENT_REF; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS_TYPE__ID = ELEMENT_PARAMETERS__ID; + + /** + * The number of structural features of the 'Element Parameters Type' class. + * + * + * @generated + * @ordered + */ + int ELEMENT_PARAMETERS_TYPE_FEATURE_COUNT = ELEMENT_PARAMETERS_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link bpsim.impl.EnumParameterTypeImpl Enum Parameter Type}' class. + * + * + * @see bpsim.impl.EnumParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getEnumParameterType() + * @generated + */ + int ENUM_PARAMETER_TYPE = 14; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int ENUM_PARAMETER_TYPE__INSTANCE = PARAMETER_VALUE__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int ENUM_PARAMETER_TYPE__RESULT = PARAMETER_VALUE__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int ENUM_PARAMETER_TYPE__VALID_FOR = PARAMETER_VALUE__VALID_FOR; + + /** + * The feature id for the 'Group' attribute list. + * + * + * @generated + * @ordered + */ + int ENUM_PARAMETER_TYPE__GROUP = PARAMETER_VALUE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Parameter Value Group' attribute list. + * + * + * @generated + * @ordered + */ + int ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP = PARAMETER_VALUE_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Parameter Value' containment reference list. + * + * + * @generated + * @ordered + */ + int ENUM_PARAMETER_TYPE__PARAMETER_VALUE = PARAMETER_VALUE_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Enum Parameter Type' class. + * + * + * @generated + * @ordered + */ + int ENUM_PARAMETER_TYPE_FEATURE_COUNT = PARAMETER_VALUE_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link bpsim.impl.ErlangDistributionTypeImpl Erlang Distribution Type}' class. + * + * + * @see bpsim.impl.ErlangDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getErlangDistributionType() + * @generated + */ + int ERLANG_DISTRIBUTION_TYPE = 15; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int ERLANG_DISTRIBUTION_TYPE__INSTANCE = DISTRIBUTION_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int ERLANG_DISTRIBUTION_TYPE__RESULT = DISTRIBUTION_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int ERLANG_DISTRIBUTION_TYPE__VALID_FOR = DISTRIBUTION_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int ERLANG_DISTRIBUTION_TYPE__CURRENCY_UNIT = DISTRIBUTION_PARAMETER__CURRENCY_UNIT; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int ERLANG_DISTRIBUTION_TYPE__TIME_UNIT = DISTRIBUTION_PARAMETER__TIME_UNIT; + + /** + * The feature id for the 'K' attribute. + * + * + * @generated + * @ordered + */ + int ERLANG_DISTRIBUTION_TYPE__K = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Mean' attribute. + * + * + * @generated + * @ordered + */ + int ERLANG_DISTRIBUTION_TYPE__MEAN = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Erlang Distribution Type' class. + * + * + * @generated + * @ordered + */ + int ERLANG_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link bpsim.impl.ExpressionParameterTypeImpl Expression Parameter Type}' class. + * + * + * @see bpsim.impl.ExpressionParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getExpressionParameterType() + * @generated + */ + int EXPRESSION_PARAMETER_TYPE = 16; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int EXPRESSION_PARAMETER_TYPE__INSTANCE = PARAMETER_VALUE__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int EXPRESSION_PARAMETER_TYPE__RESULT = PARAMETER_VALUE__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int EXPRESSION_PARAMETER_TYPE__VALID_FOR = PARAMETER_VALUE__VALID_FOR; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int EXPRESSION_PARAMETER_TYPE__VALUE = PARAMETER_VALUE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Expression Parameter Type' class. + * + * + * @generated + * @ordered + */ + int EXPRESSION_PARAMETER_TYPE_FEATURE_COUNT = PARAMETER_VALUE_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link bpsim.impl.FloatingParameterTypeImpl Floating Parameter Type}' class. + * + * + * @see bpsim.impl.FloatingParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getFloatingParameterType() + * @generated + */ + int FLOATING_PARAMETER_TYPE = 17; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int FLOATING_PARAMETER_TYPE__INSTANCE = CONSTANT_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int FLOATING_PARAMETER_TYPE__RESULT = CONSTANT_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int FLOATING_PARAMETER_TYPE__VALID_FOR = CONSTANT_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int FLOATING_PARAMETER_TYPE__CURRENCY_UNIT = CONSTANT_PARAMETER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int FLOATING_PARAMETER_TYPE__TIME_UNIT = CONSTANT_PARAMETER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int FLOATING_PARAMETER_TYPE__VALUE = CONSTANT_PARAMETER_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Floating Parameter Type' class. + * + * + * @generated + * @ordered + */ + int FLOATING_PARAMETER_TYPE_FEATURE_COUNT = CONSTANT_PARAMETER_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link bpsim.impl.GammaDistributionTypeImpl Gamma Distribution Type}' class. + * + * + * @see bpsim.impl.GammaDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getGammaDistributionType() + * @generated + */ + int GAMMA_DISTRIBUTION_TYPE = 18; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int GAMMA_DISTRIBUTION_TYPE__INSTANCE = DISTRIBUTION_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int GAMMA_DISTRIBUTION_TYPE__RESULT = DISTRIBUTION_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int GAMMA_DISTRIBUTION_TYPE__VALID_FOR = DISTRIBUTION_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int GAMMA_DISTRIBUTION_TYPE__CURRENCY_UNIT = DISTRIBUTION_PARAMETER__CURRENCY_UNIT; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int GAMMA_DISTRIBUTION_TYPE__TIME_UNIT = DISTRIBUTION_PARAMETER__TIME_UNIT; + + /** + * The feature id for the 'Scale' attribute. + * + * + * @generated + * @ordered + */ + int GAMMA_DISTRIBUTION_TYPE__SCALE = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Shape' attribute. + * + * + * @generated + * @ordered + */ + int GAMMA_DISTRIBUTION_TYPE__SHAPE = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Gamma Distribution Type' class. + * + * + * @generated + * @ordered + */ + int GAMMA_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link bpsim.impl.LogNormalDistributionTypeImpl Log Normal Distribution Type}' class. + * + * + * @see bpsim.impl.LogNormalDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getLogNormalDistributionType() + * @generated + */ + int LOG_NORMAL_DISTRIBUTION_TYPE = 19; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int LOG_NORMAL_DISTRIBUTION_TYPE__INSTANCE = DISTRIBUTION_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int LOG_NORMAL_DISTRIBUTION_TYPE__RESULT = DISTRIBUTION_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int LOG_NORMAL_DISTRIBUTION_TYPE__VALID_FOR = DISTRIBUTION_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int LOG_NORMAL_DISTRIBUTION_TYPE__CURRENCY_UNIT = DISTRIBUTION_PARAMETER__CURRENCY_UNIT; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int LOG_NORMAL_DISTRIBUTION_TYPE__TIME_UNIT = DISTRIBUTION_PARAMETER__TIME_UNIT; + + /** + * The feature id for the 'Mean' attribute. + * + * + * @generated + * @ordered + */ + int LOG_NORMAL_DISTRIBUTION_TYPE__MEAN = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Standard Deviation' attribute. + * + * + * @generated + * @ordered + */ + int LOG_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Log Normal Distribution Type' class. + * + * + * @generated + * @ordered + */ + int LOG_NORMAL_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link bpsim.impl.NegativeExponentialDistributionTypeImpl Negative Exponential Distribution Type}' class. + * + * + * @see bpsim.impl.NegativeExponentialDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getNegativeExponentialDistributionType() + * @generated + */ + int NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE = 20; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__INSTANCE = DISTRIBUTION_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__RESULT = DISTRIBUTION_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__VALID_FOR = DISTRIBUTION_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__CURRENCY_UNIT = DISTRIBUTION_PARAMETER__CURRENCY_UNIT; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__TIME_UNIT = DISTRIBUTION_PARAMETER__TIME_UNIT; + + /** + * The feature id for the 'Mean' attribute. + * + * + * @generated + * @ordered + */ + int NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__MEAN = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Negative Exponential Distribution Type' class. + * + * + * @generated + * @ordered + */ + int NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link bpsim.impl.NormalDistributionTypeImpl Normal Distribution Type}' class. + * + * + * @see bpsim.impl.NormalDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getNormalDistributionType() + * @generated + */ + int NORMAL_DISTRIBUTION_TYPE = 21; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int NORMAL_DISTRIBUTION_TYPE__INSTANCE = DISTRIBUTION_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int NORMAL_DISTRIBUTION_TYPE__RESULT = DISTRIBUTION_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int NORMAL_DISTRIBUTION_TYPE__VALID_FOR = DISTRIBUTION_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int NORMAL_DISTRIBUTION_TYPE__CURRENCY_UNIT = DISTRIBUTION_PARAMETER__CURRENCY_UNIT; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int NORMAL_DISTRIBUTION_TYPE__TIME_UNIT = DISTRIBUTION_PARAMETER__TIME_UNIT; + + /** + * The feature id for the 'Mean' attribute. + * + * + * @generated + * @ordered + */ + int NORMAL_DISTRIBUTION_TYPE__MEAN = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Standard Deviation' attribute. + * + * + * @generated + * @ordered + */ + int NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Normal Distribution Type' class. + * + * + * @generated + * @ordered + */ + int NORMAL_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link bpsim.impl.NumericParameterTypeImpl Numeric Parameter Type}' class. + * + * + * @see bpsim.impl.NumericParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getNumericParameterType() + * @generated + */ + int NUMERIC_PARAMETER_TYPE = 22; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int NUMERIC_PARAMETER_TYPE__INSTANCE = CONSTANT_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int NUMERIC_PARAMETER_TYPE__RESULT = CONSTANT_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int NUMERIC_PARAMETER_TYPE__VALID_FOR = CONSTANT_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT = CONSTANT_PARAMETER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int NUMERIC_PARAMETER_TYPE__TIME_UNIT = CONSTANT_PARAMETER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int NUMERIC_PARAMETER_TYPE__VALUE = CONSTANT_PARAMETER_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Numeric Parameter Type' class. + * + * + * @generated + * @ordered + */ + int NUMERIC_PARAMETER_TYPE_FEATURE_COUNT = CONSTANT_PARAMETER_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link bpsim.impl.ParameterImpl Parameter}' class. + * + * + * @see bpsim.impl.ParameterImpl + * @see bpsim.impl.BpsimPackageImpl#getParameter() + * @generated + */ + int PARAMETER = 23; + + /** + * The feature id for the 'Result Request' attribute list. + * + * + * @generated + * @ordered + */ + int PARAMETER__RESULT_REQUEST = 0; + + /** + * The feature id for the 'Parameter Value Group' attribute list. + * + * + * @generated + * @ordered + */ + int PARAMETER__PARAMETER_VALUE_GROUP = 1; + + /** + * The feature id for the 'Parameter Value' containment reference list. + * + * + * @generated + * @ordered + */ + int PARAMETER__PARAMETER_VALUE = 2; + + /** + * The feature id for the 'Kpi' attribute. + * + * + * @generated + * @ordered + */ + int PARAMETER__KPI = 3; + + /** + * The feature id for the 'Sla' attribute. + * + * + * @generated + * @ordered + */ + int PARAMETER__SLA = 4; + + /** + * The number of structural features of the 'Parameter' class. + * + * + * @generated + * @ordered + */ + int PARAMETER_FEATURE_COUNT = 5; + + /** + * The meta object id for the '{@link bpsim.impl.PoissonDistributionTypeImpl Poisson Distribution Type}' class. + * + * + * @see bpsim.impl.PoissonDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getPoissonDistributionType() + * @generated + */ + int POISSON_DISTRIBUTION_TYPE = 25; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int POISSON_DISTRIBUTION_TYPE__INSTANCE = DISTRIBUTION_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int POISSON_DISTRIBUTION_TYPE__RESULT = DISTRIBUTION_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int POISSON_DISTRIBUTION_TYPE__VALID_FOR = DISTRIBUTION_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int POISSON_DISTRIBUTION_TYPE__CURRENCY_UNIT = DISTRIBUTION_PARAMETER__CURRENCY_UNIT; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int POISSON_DISTRIBUTION_TYPE__TIME_UNIT = DISTRIBUTION_PARAMETER__TIME_UNIT; + + /** + * The feature id for the 'Mean' attribute. + * + * + * @generated + * @ordered + */ + int POISSON_DISTRIBUTION_TYPE__MEAN = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Poisson Distribution Type' class. + * + * + * @generated + * @ordered + */ + int POISSON_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link bpsim.impl.PriorityParametersImpl Priority Parameters}' class. + * + * + * @see bpsim.impl.PriorityParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getPriorityParameters() + * @generated + */ + int PRIORITY_PARAMETERS = 26; + + /** + * The feature id for the 'Interruptible' containment reference. + * + * + * @generated + * @ordered + */ + int PRIORITY_PARAMETERS__INTERRUPTIBLE = 0; + + /** + * The feature id for the 'Priority' containment reference. + * + * + * @generated + * @ordered + */ + int PRIORITY_PARAMETERS__PRIORITY = 1; + + /** + * The number of structural features of the 'Priority Parameters' class. + * + * + * @generated + * @ordered + */ + int PRIORITY_PARAMETERS_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link bpsim.impl.PropertyParametersImpl Property Parameters}' class. + * + * + * @see bpsim.impl.PropertyParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getPropertyParameters() + * @generated + */ + int PROPERTY_PARAMETERS = 27; + + /** + * The feature id for the 'Property' containment reference list. + * + * + * @generated + * @ordered + */ + int PROPERTY_PARAMETERS__PROPERTY = 0; + + /** + * The number of structural features of the 'Property Parameters' class. + * + * + * @generated + * @ordered + */ + int PROPERTY_PARAMETERS_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link bpsim.impl.PropertyTypeImpl Property Type}' class. + * + * + * @see bpsim.impl.PropertyTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getPropertyType() + * @generated + */ + int PROPERTY_TYPE = 28; + + /** + * The feature id for the 'Result Request' attribute list. + * + * + * @generated + * @ordered + */ + int PROPERTY_TYPE__RESULT_REQUEST = PARAMETER__RESULT_REQUEST; + + /** + * The feature id for the 'Parameter Value Group' attribute list. + * + * + * @generated + * @ordered + */ + int PROPERTY_TYPE__PARAMETER_VALUE_GROUP = PARAMETER__PARAMETER_VALUE_GROUP; + + /** + * The feature id for the 'Parameter Value' containment reference list. + * + * + * @generated + * @ordered + */ + int PROPERTY_TYPE__PARAMETER_VALUE = PARAMETER__PARAMETER_VALUE; + + /** + * The feature id for the 'Kpi' attribute. + * + * + * @generated + * @ordered + */ + int PROPERTY_TYPE__KPI = PARAMETER__KPI; + + /** + * The feature id for the 'Sla' attribute. + * + * + * @generated + * @ordered + */ + int PROPERTY_TYPE__SLA = PARAMETER__SLA; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PROPERTY_TYPE__NAME = PARAMETER_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Property Type' class. + * + * + * @generated + * @ordered + */ + int PROPERTY_TYPE_FEATURE_COUNT = PARAMETER_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link bpsim.impl.ResourceParametersImpl Resource Parameters}' class. + * + * + * @see bpsim.impl.ResourceParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getResourceParameters() + * @generated + */ + int RESOURCE_PARAMETERS = 29; + + /** + * The feature id for the 'Selection' containment reference. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETERS__SELECTION = 0; + + /** + * The feature id for the 'Availability' containment reference. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETERS__AVAILABILITY = 1; + + /** + * The feature id for the 'Quantity' containment reference. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETERS__QUANTITY = 2; + + /** + * The feature id for the 'Role' containment reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETERS__ROLE = 3; + + /** + * The number of structural features of the 'Resource Parameters' class. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETERS_FEATURE_COUNT = 4; + + /** + * The meta object id for the '{@link bpsim.impl.ScenarioImpl Scenario}' class. + * + * + * @see bpsim.impl.ScenarioImpl + * @see bpsim.impl.BpsimPackageImpl#getScenario() + * @generated + */ + int SCENARIO = 30; + + /** + * The feature id for the 'Scenario Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int SCENARIO__SCENARIO_PARAMETERS = 0; + + /** + * The feature id for the 'Element Parameters' containment reference list. + * + * + * @generated + * @ordered + */ + int SCENARIO__ELEMENT_PARAMETERS = 1; + + /** + * The feature id for the 'Calendar' containment reference list. + * + * + * @generated + * @ordered + */ + int SCENARIO__CALENDAR = 2; + + /** + * The feature id for the 'Vendor Extension' containment reference list. + * + * + * @generated + * @ordered + */ + int SCENARIO__VENDOR_EXTENSION = 3; + + /** + * The feature id for the 'Author' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO__AUTHOR = 4; + + /** + * The feature id for the 'Created' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO__CREATED = 5; + + /** + * The feature id for the 'Description' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO__DESCRIPTION = 6; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO__ID = 7; + + /** + * The feature id for the 'Inherits' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO__INHERITS = 8; + + /** + * The feature id for the 'Modified' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO__MODIFIED = 9; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO__NAME = 10; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO__RESULT = 11; + + /** + * The feature id for the 'Vendor' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO__VENDOR = 12; + + /** + * The feature id for the 'Version' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO__VERSION = 13; + + /** + * The number of structural features of the 'Scenario' class. + * + * + * @generated + * @ordered + */ + int SCENARIO_FEATURE_COUNT = 14; + + /** + * The meta object id for the '{@link bpsim.impl.ScenarioParametersImpl Scenario Parameters}' class. + * + * + * @see bpsim.impl.ScenarioParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getScenarioParameters() + * @generated + */ + int SCENARIO_PARAMETERS = 31; + + /** + * The feature id for the 'Start' containment reference. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS__START = 0; + + /** + * The feature id for the 'Duration' containment reference. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS__DURATION = 1; + + /** + * The feature id for the 'Property Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS__PROPERTY_PARAMETERS = 2; + + /** + * The feature id for the 'Base Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS__BASE_CURRENCY_UNIT = 3; + + /** + * The feature id for the 'Base Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS__BASE_TIME_UNIT = 4; + + /** + * The feature id for the 'Replication' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS__REPLICATION = 5; + + /** + * The feature id for the 'Seed' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS__SEED = 6; + + /** + * The number of structural features of the 'Scenario Parameters' class. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS_FEATURE_COUNT = 7; + + /** + * The meta object id for the '{@link bpsim.impl.ScenarioParametersTypeImpl Scenario Parameters Type}' class. + * + * + * @see bpsim.impl.ScenarioParametersTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getScenarioParametersType() + * @generated + */ + int SCENARIO_PARAMETERS_TYPE = 32; + + /** + * The feature id for the 'Start' containment reference. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS_TYPE__START = SCENARIO_PARAMETERS__START; + + /** + * The feature id for the 'Duration' containment reference. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS_TYPE__DURATION = SCENARIO_PARAMETERS__DURATION; + + /** + * The feature id for the 'Property Parameters' containment reference. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS_TYPE__PROPERTY_PARAMETERS = SCENARIO_PARAMETERS__PROPERTY_PARAMETERS; + + /** + * The feature id for the 'Base Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS_TYPE__BASE_CURRENCY_UNIT = SCENARIO_PARAMETERS__BASE_CURRENCY_UNIT; + + /** + * The feature id for the 'Base Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS_TYPE__BASE_TIME_UNIT = SCENARIO_PARAMETERS__BASE_TIME_UNIT; + + /** + * The feature id for the 'Replication' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS_TYPE__REPLICATION = SCENARIO_PARAMETERS__REPLICATION; + + /** + * The feature id for the 'Seed' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS_TYPE__SEED = SCENARIO_PARAMETERS__SEED; + + /** + * The number of structural features of the 'Scenario Parameters Type' class. + * + * + * @generated + * @ordered + */ + int SCENARIO_PARAMETERS_TYPE_FEATURE_COUNT = SCENARIO_PARAMETERS_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link bpsim.impl.StringParameterTypeImpl String Parameter Type}' class. + * + * + * @see bpsim.impl.StringParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getStringParameterType() + * @generated + */ + int STRING_PARAMETER_TYPE = 33; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int STRING_PARAMETER_TYPE__INSTANCE = CONSTANT_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int STRING_PARAMETER_TYPE__RESULT = CONSTANT_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int STRING_PARAMETER_TYPE__VALID_FOR = CONSTANT_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int STRING_PARAMETER_TYPE__VALUE = CONSTANT_PARAMETER_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'String Parameter Type' class. + * + * + * @generated + * @ordered + */ + int STRING_PARAMETER_TYPE_FEATURE_COUNT = CONSTANT_PARAMETER_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link bpsim.impl.TimeParametersImpl Time Parameters}' class. + * + * + * @see bpsim.impl.TimeParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getTimeParameters() + * @generated + */ + int TIME_PARAMETERS = 34; + + /** + * The feature id for the 'Transfer Time' containment reference. + * + * + * @generated + * @ordered + */ + int TIME_PARAMETERS__TRANSFER_TIME = 0; + + /** + * The feature id for the 'Queue Time' containment reference. + * + * + * @generated + * @ordered + */ + int TIME_PARAMETERS__QUEUE_TIME = 1; + + /** + * The feature id for the 'Wait Time' containment reference. + * + * + * @generated + * @ordered + */ + int TIME_PARAMETERS__WAIT_TIME = 2; + + /** + * The feature id for the 'Set Up Time' containment reference. + * + * + * @generated + * @ordered + */ + int TIME_PARAMETERS__SET_UP_TIME = 3; + + /** + * The feature id for the 'Processing Time' containment reference. + * + * + * @generated + * @ordered + */ + int TIME_PARAMETERS__PROCESSING_TIME = 4; + + /** + * The feature id for the 'Validation Time' containment reference. + * + * + * @generated + * @ordered + */ + int TIME_PARAMETERS__VALIDATION_TIME = 5; + + /** + * The feature id for the 'Rework Time' containment reference. + * + * + * @generated + * @ordered + */ + int TIME_PARAMETERS__REWORK_TIME = 6; + + /** + * The number of structural features of the 'Time Parameters' class. + * + * + * @generated + * @ordered + */ + int TIME_PARAMETERS_FEATURE_COUNT = 7; + + /** + * The meta object id for the '{@link bpsim.impl.TriangularDistributionTypeImpl Triangular Distribution Type}' class. + * + * + * @see bpsim.impl.TriangularDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getTriangularDistributionType() + * @generated + */ + int TRIANGULAR_DISTRIBUTION_TYPE = 35; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int TRIANGULAR_DISTRIBUTION_TYPE__INSTANCE = DISTRIBUTION_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int TRIANGULAR_DISTRIBUTION_TYPE__RESULT = DISTRIBUTION_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int TRIANGULAR_DISTRIBUTION_TYPE__VALID_FOR = DISTRIBUTION_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int TRIANGULAR_DISTRIBUTION_TYPE__CURRENCY_UNIT = DISTRIBUTION_PARAMETER__CURRENCY_UNIT; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int TRIANGULAR_DISTRIBUTION_TYPE__TIME_UNIT = DISTRIBUTION_PARAMETER__TIME_UNIT; + + /** + * The feature id for the 'Max' attribute. + * + * + * @generated + * @ordered + */ + int TRIANGULAR_DISTRIBUTION_TYPE__MAX = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Min' attribute. + * + * + * @generated + * @ordered + */ + int TRIANGULAR_DISTRIBUTION_TYPE__MIN = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Mode' attribute. + * + * + * @generated + * @ordered + */ + int TRIANGULAR_DISTRIBUTION_TYPE__MODE = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Triangular Distribution Type' class. + * + * + * @generated + * @ordered + */ + int TRIANGULAR_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link bpsim.impl.TruncatedNormalDistributionTypeImpl Truncated Normal Distribution Type}' class. + * + * + * @see bpsim.impl.TruncatedNormalDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getTruncatedNormalDistributionType() + * @generated + */ + int TRUNCATED_NORMAL_DISTRIBUTION_TYPE = 36; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int TRUNCATED_NORMAL_DISTRIBUTION_TYPE__INSTANCE = DISTRIBUTION_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int TRUNCATED_NORMAL_DISTRIBUTION_TYPE__RESULT = DISTRIBUTION_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int TRUNCATED_NORMAL_DISTRIBUTION_TYPE__VALID_FOR = DISTRIBUTION_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int TRUNCATED_NORMAL_DISTRIBUTION_TYPE__CURRENCY_UNIT = DISTRIBUTION_PARAMETER__CURRENCY_UNIT; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int TRUNCATED_NORMAL_DISTRIBUTION_TYPE__TIME_UNIT = DISTRIBUTION_PARAMETER__TIME_UNIT; + + /** + * The feature id for the 'Max' attribute. + * + * + * @generated + * @ordered + */ + int TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MAX = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Mean' attribute. + * + * + * @generated + * @ordered + */ + int TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MEAN = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Min' attribute. + * + * + * @generated + * @ordered + */ + int TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MIN = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Standard Deviation' attribute. + * + * + * @generated + * @ordered + */ + int TRUNCATED_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Truncated Normal Distribution Type' class. + * + * + * @generated + * @ordered + */ + int TRUNCATED_NORMAL_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link bpsim.impl.UniformDistributionTypeImpl Uniform Distribution Type}' class. + * + * + * @see bpsim.impl.UniformDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getUniformDistributionType() + * @generated + */ + int UNIFORM_DISTRIBUTION_TYPE = 37; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int UNIFORM_DISTRIBUTION_TYPE__INSTANCE = DISTRIBUTION_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int UNIFORM_DISTRIBUTION_TYPE__RESULT = DISTRIBUTION_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int UNIFORM_DISTRIBUTION_TYPE__VALID_FOR = DISTRIBUTION_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int UNIFORM_DISTRIBUTION_TYPE__CURRENCY_UNIT = DISTRIBUTION_PARAMETER__CURRENCY_UNIT; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int UNIFORM_DISTRIBUTION_TYPE__TIME_UNIT = DISTRIBUTION_PARAMETER__TIME_UNIT; + + /** + * The feature id for the 'Max' attribute. + * + * + * @generated + * @ordered + */ + int UNIFORM_DISTRIBUTION_TYPE__MAX = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Min' attribute. + * + * + * @generated + * @ordered + */ + int UNIFORM_DISTRIBUTION_TYPE__MIN = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Uniform Distribution Type' class. + * + * + * @generated + * @ordered + */ + int UNIFORM_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link bpsim.impl.UserDistributionDataPointTypeImpl User Distribution Data Point Type}' class. + * + * + * @see bpsim.impl.UserDistributionDataPointTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getUserDistributionDataPointType() + * @generated + */ + int USER_DISTRIBUTION_DATA_POINT_TYPE = 38; + + /** + * The feature id for the 'Parameter Value Group' attribute list. + * + * + * @generated + * @ordered + */ + int USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE_GROUP = 0; + + /** + * The feature id for the 'Parameter Value' containment reference. + * + * + * @generated + * @ordered + */ + int USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE = 1; + + /** + * The feature id for the 'Probability' attribute. + * + * + * @generated + * @ordered + */ + int USER_DISTRIBUTION_DATA_POINT_TYPE__PROBABILITY = 2; + + /** + * The number of structural features of the 'User Distribution Data Point Type' class. + * + * + * @generated + * @ordered + */ + int USER_DISTRIBUTION_DATA_POINT_TYPE_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link bpsim.impl.UserDistributionTypeImpl User Distribution Type}' class. + * + * + * @see bpsim.impl.UserDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getUserDistributionType() + * @generated + */ + int USER_DISTRIBUTION_TYPE = 39; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int USER_DISTRIBUTION_TYPE__INSTANCE = DISTRIBUTION_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int USER_DISTRIBUTION_TYPE__RESULT = DISTRIBUTION_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int USER_DISTRIBUTION_TYPE__VALID_FOR = DISTRIBUTION_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int USER_DISTRIBUTION_TYPE__CURRENCY_UNIT = DISTRIBUTION_PARAMETER__CURRENCY_UNIT; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int USER_DISTRIBUTION_TYPE__TIME_UNIT = DISTRIBUTION_PARAMETER__TIME_UNIT; + + /** + * The feature id for the 'Group' attribute list. + * + * + * @generated + * @ordered + */ + int USER_DISTRIBUTION_TYPE__GROUP = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'User Distribution Data Point' containment reference list. + * + * + * @generated + * @ordered + */ + int USER_DISTRIBUTION_TYPE__USER_DISTRIBUTION_DATA_POINT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Discrete' attribute. + * + * + * @generated + * @ordered + */ + int USER_DISTRIBUTION_TYPE__DISCRETE = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'User Distribution Type' class. + * + * + * @generated + * @ordered + */ + int USER_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link bpsim.impl.VendorExtensionImpl Vendor Extension}' class. + * + * + * @see bpsim.impl.VendorExtensionImpl + * @see bpsim.impl.BpsimPackageImpl#getVendorExtension() + * @generated + */ + int VENDOR_EXTENSION = 40; + + /** + * The feature id for the 'Any' attribute list. + * + * + * @generated + * @ordered + */ + int VENDOR_EXTENSION__ANY = 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int VENDOR_EXTENSION__NAME = 1; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int VENDOR_EXTENSION__ANY_ATTRIBUTE = 2; + + /** + * The number of structural features of the 'Vendor Extension' class. + * + * + * @generated + * @ordered + */ + int VENDOR_EXTENSION_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link bpsim.impl.WeibullDistributionTypeImpl Weibull Distribution Type}' class. + * + * + * @see bpsim.impl.WeibullDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getWeibullDistributionType() + * @generated + */ + int WEIBULL_DISTRIBUTION_TYPE = 41; + + /** + * The feature id for the 'Instance' attribute. + * + * + * @generated + * @ordered + */ + int WEIBULL_DISTRIBUTION_TYPE__INSTANCE = DISTRIBUTION_PARAMETER__INSTANCE; + + /** + * The feature id for the 'Result' attribute. + * + * + * @generated + * @ordered + */ + int WEIBULL_DISTRIBUTION_TYPE__RESULT = DISTRIBUTION_PARAMETER__RESULT; + + /** + * The feature id for the 'Valid For' attribute. + * + * + * @generated + * @ordered + */ + int WEIBULL_DISTRIBUTION_TYPE__VALID_FOR = DISTRIBUTION_PARAMETER__VALID_FOR; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int WEIBULL_DISTRIBUTION_TYPE__CURRENCY_UNIT = DISTRIBUTION_PARAMETER__CURRENCY_UNIT; + + /** + * The feature id for the 'Time Unit' attribute. + * + * + * @generated + * @ordered + */ + int WEIBULL_DISTRIBUTION_TYPE__TIME_UNIT = DISTRIBUTION_PARAMETER__TIME_UNIT; + + /** + * The feature id for the 'Scale' attribute. + * + * + * @generated + * @ordered + */ + int WEIBULL_DISTRIBUTION_TYPE__SCALE = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Shape' attribute. + * + * + * @generated + * @ordered + */ + int WEIBULL_DISTRIBUTION_TYPE__SHAPE = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Weibull Distribution Type' class. + * + * + * @generated + * @ordered + */ + int WEIBULL_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link bpsim.ResultType Result Type}' enum. + * + * + * @see bpsim.ResultType + * @see bpsim.impl.BpsimPackageImpl#getResultType() + * @generated + */ + int RESULT_TYPE = 42; + + /** + * The meta object id for the '{@link bpsim.TimeUnit Time Unit}' enum. + * + * + * @see bpsim.TimeUnit + * @see bpsim.impl.BpsimPackageImpl#getTimeUnit() + * @generated + */ + int TIME_UNIT = 43; + + /** + * The meta object id for the 'Result Type Object' data type. + * + * + * @see bpsim.ResultType + * @see bpsim.impl.BpsimPackageImpl#getResultTypeObject() + * @generated + */ + int RESULT_TYPE_OBJECT = 44; + + /** + * The meta object id for the 'Time Unit Object' data type. + * + * + * @see bpsim.TimeUnit + * @see bpsim.impl.BpsimPackageImpl#getTimeUnitObject() + * @generated + */ + int TIME_UNIT_OBJECT = 45; + + + /** + * Returns the meta object for class '{@link bpsim.BetaDistributionType Beta Distribution Type}'. + * + * + * @return the meta object for class 'Beta Distribution Type'. + * @see bpsim.BetaDistributionType + * @generated + */ + EClass getBetaDistributionType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.BetaDistributionType#getScale Scale}'. + * + * + * @return the meta object for the attribute 'Scale'. + * @see bpsim.BetaDistributionType#getScale() + * @see #getBetaDistributionType() + * @generated + */ + EAttribute getBetaDistributionType_Scale(); + + /** + * Returns the meta object for the attribute '{@link bpsim.BetaDistributionType#getShape Shape}'. + * + * + * @return the meta object for the attribute 'Shape'. + * @see bpsim.BetaDistributionType#getShape() + * @see #getBetaDistributionType() + * @generated + */ + EAttribute getBetaDistributionType_Shape(); + + /** + * Returns the meta object for class '{@link bpsim.BinomialDistributionType Binomial Distribution Type}'. + * + * + * @return the meta object for class 'Binomial Distribution Type'. + * @see bpsim.BinomialDistributionType + * @generated + */ + EClass getBinomialDistributionType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.BinomialDistributionType#getProbability Probability}'. + * + * + * @return the meta object for the attribute 'Probability'. + * @see bpsim.BinomialDistributionType#getProbability() + * @see #getBinomialDistributionType() + * @generated + */ + EAttribute getBinomialDistributionType_Probability(); + + /** + * Returns the meta object for the attribute '{@link bpsim.BinomialDistributionType#getTrials Trials}'. + * + * + * @return the meta object for the attribute 'Trials'. + * @see bpsim.BinomialDistributionType#getTrials() + * @see #getBinomialDistributionType() + * @generated + */ + EAttribute getBinomialDistributionType_Trials(); + + /** + * Returns the meta object for class '{@link bpsim.BooleanParameterType Boolean Parameter Type}'. + * + * + * @return the meta object for class 'Boolean Parameter Type'. + * @see bpsim.BooleanParameterType + * @generated + */ + EClass getBooleanParameterType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.BooleanParameterType#isValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see bpsim.BooleanParameterType#isValue() + * @see #getBooleanParameterType() + * @generated + */ + EAttribute getBooleanParameterType_Value(); + + /** + * Returns the meta object for class '{@link bpsim.BPSimDataType BP Sim Data Type}'. + * + * + * @return the meta object for class 'BP Sim Data Type'. + * @see bpsim.BPSimDataType + * @generated + */ + EClass getBPSimDataType(); + + /** + * Returns the meta object for the attribute list '{@link bpsim.BPSimDataType#getGroup Group}'. + * + * + * @return the meta object for the attribute list 'Group'. + * @see bpsim.BPSimDataType#getGroup() + * @see #getBPSimDataType() + * @generated + */ + EAttribute getBPSimDataType_Group(); + + /** + * Returns the meta object for the containment reference list '{@link bpsim.BPSimDataType#getScenario Scenario}'. + * + * + * @return the meta object for the containment reference list 'Scenario'. + * @see bpsim.BPSimDataType#getScenario() + * @see #getBPSimDataType() + * @generated + */ + EReference getBPSimDataType_Scenario(); + + /** + * Returns the meta object for class '{@link bpsim.Calendar Calendar}'. + * + * + * @return the meta object for class 'Calendar'. + * @see bpsim.Calendar + * @generated + */ + EClass getCalendar(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Calendar#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see bpsim.Calendar#getValue() + * @see #getCalendar() + * @generated + */ + EAttribute getCalendar_Value(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Calendar#getId Id}'. + * + * + * @return the meta object for the attribute 'Id'. + * @see bpsim.Calendar#getId() + * @see #getCalendar() + * @generated + */ + EAttribute getCalendar_Id(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Calendar#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see bpsim.Calendar#getName() + * @see #getCalendar() + * @generated + */ + EAttribute getCalendar_Name(); + + /** + * Returns the meta object for class '{@link bpsim.ConstantParameter Constant Parameter}'. + * + * + * @return the meta object for class 'Constant Parameter'. + * @see bpsim.ConstantParameter + * @generated + */ + EClass getConstantParameter(); + + /** + * Returns the meta object for class '{@link bpsim.ControlParameters Control Parameters}'. + * + * + * @return the meta object for class 'Control Parameters'. + * @see bpsim.ControlParameters + * @generated + */ + EClass getControlParameters(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ControlParameters#getProbability Probability}'. + * + * + * @return the meta object for the containment reference 'Probability'. + * @see bpsim.ControlParameters#getProbability() + * @see #getControlParameters() + * @generated + */ + EReference getControlParameters_Probability(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ControlParameters#getCondition Condition}'. + * + * + * @return the meta object for the containment reference 'Condition'. + * @see bpsim.ControlParameters#getCondition() + * @see #getControlParameters() + * @generated + */ + EReference getControlParameters_Condition(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ControlParameters#getInterTriggerTimer Inter Trigger Timer}'. + * + * + * @return the meta object for the containment reference 'Inter Trigger Timer'. + * @see bpsim.ControlParameters#getInterTriggerTimer() + * @see #getControlParameters() + * @generated + */ + EReference getControlParameters_InterTriggerTimer(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ControlParameters#getTriggerCount Trigger Count}'. + * + * + * @return the meta object for the containment reference 'Trigger Count'. + * @see bpsim.ControlParameters#getTriggerCount() + * @see #getControlParameters() + * @generated + */ + EReference getControlParameters_TriggerCount(); + + /** + * Returns the meta object for class '{@link bpsim.CostParameters Cost Parameters}'. + * + * + * @return the meta object for class 'Cost Parameters'. + * @see bpsim.CostParameters + * @generated + */ + EClass getCostParameters(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.CostParameters#getFixedCost Fixed Cost}'. + * + * + * @return the meta object for the containment reference 'Fixed Cost'. + * @see bpsim.CostParameters#getFixedCost() + * @see #getCostParameters() + * @generated + */ + EReference getCostParameters_FixedCost(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.CostParameters#getUnitCost Unit Cost}'. + * + * + * @return the meta object for the containment reference 'Unit Cost'. + * @see bpsim.CostParameters#getUnitCost() + * @see #getCostParameters() + * @generated + */ + EReference getCostParameters_UnitCost(); + + /** + * Returns the meta object for class '{@link bpsim.DateTimeParameterType Date Time Parameter Type}'. + * + * + * @return the meta object for class 'Date Time Parameter Type'. + * @see bpsim.DateTimeParameterType + * @generated + */ + EClass getDateTimeParameterType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.DateTimeParameterType#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see bpsim.DateTimeParameterType#getValue() + * @see #getDateTimeParameterType() + * @generated + */ + EAttribute getDateTimeParameterType_Value(); + + /** + * Returns the meta object for class '{@link bpsim.DistributionParameter Distribution Parameter}'. + * + * + * @return the meta object for class 'Distribution Parameter'. + * @see bpsim.DistributionParameter + * @generated + */ + EClass getDistributionParameter(); + + /** + * Returns the meta object for the attribute '{@link bpsim.DistributionParameter#getCurrencyUnit Currency Unit}'. + * + * + * @return the meta object for the attribute 'Currency Unit'. + * @see bpsim.DistributionParameter#getCurrencyUnit() + * @see #getDistributionParameter() + * @generated + */ + EAttribute getDistributionParameter_CurrencyUnit(); + + /** + * Returns the meta object for the attribute '{@link bpsim.DistributionParameter#getTimeUnit Time Unit}'. + * + * + * @return the meta object for the attribute 'Time Unit'. + * @see bpsim.DistributionParameter#getTimeUnit() + * @see #getDistributionParameter() + * @generated + */ + EAttribute getDistributionParameter_TimeUnit(); + + /** + * Returns the meta object for class '{@link bpsim.DocumentRoot Document Root}'. + * + * + * @return the meta object for class 'Document Root'. + * @see bpsim.DocumentRoot + * @generated + */ + EClass getDocumentRoot(); + + /** + * Returns the meta object for the attribute list '{@link bpsim.DocumentRoot#getMixed Mixed}'. + * + * + * @return the meta object for the attribute list 'Mixed'. + * @see bpsim.DocumentRoot#getMixed() + * @see #getDocumentRoot() + * @generated + */ + EAttribute getDocumentRoot_Mixed(); + + /** + * Returns the meta object for the map '{@link bpsim.DocumentRoot#getXMLNSPrefixMap XMLNS Prefix Map}'. + * + * + * @return the meta object for the map 'XMLNS Prefix Map'. + * @see bpsim.DocumentRoot#getXMLNSPrefixMap() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_XMLNSPrefixMap(); + + /** + * Returns the meta object for the map '{@link bpsim.DocumentRoot#getXSISchemaLocation XSI Schema Location}'. + * + * + * @return the meta object for the map 'XSI Schema Location'. + * @see bpsim.DocumentRoot#getXSISchemaLocation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_XSISchemaLocation(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getBetaDistribution Beta Distribution}'. + * + * + * @return the meta object for the containment reference 'Beta Distribution'. + * @see bpsim.DocumentRoot#getBetaDistribution() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BetaDistribution(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getParameterValue Parameter Value}'. + * + * + * @return the meta object for the containment reference 'Parameter Value'. + * @see bpsim.DocumentRoot#getParameterValue() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ParameterValue(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getBinomialDistribution Binomial Distribution}'. + * + * + * @return the meta object for the containment reference 'Binomial Distribution'. + * @see bpsim.DocumentRoot#getBinomialDistribution() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BinomialDistribution(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getBooleanParameter Boolean Parameter}'. + * + * + * @return the meta object for the containment reference 'Boolean Parameter'. + * @see bpsim.DocumentRoot#getBooleanParameter() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BooleanParameter(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getBPSimData BP Sim Data}'. + * + * + * @return the meta object for the containment reference 'BP Sim Data'. + * @see bpsim.DocumentRoot#getBPSimData() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BPSimData(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getDateTimeParameter Date Time Parameter}'. + * + * + * @return the meta object for the containment reference 'Date Time Parameter'. + * @see bpsim.DocumentRoot#getDateTimeParameter() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_DateTimeParameter(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getDurationParameter Duration Parameter}'. + * + * + * @return the meta object for the containment reference 'Duration Parameter'. + * @see bpsim.DocumentRoot#getDurationParameter() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_DurationParameter(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getEnumParameter Enum Parameter}'. + * + * + * @return the meta object for the containment reference 'Enum Parameter'. + * @see bpsim.DocumentRoot#getEnumParameter() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_EnumParameter(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getErlangDistribution Erlang Distribution}'. + * + * + * @return the meta object for the containment reference 'Erlang Distribution'. + * @see bpsim.DocumentRoot#getErlangDistribution() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ErlangDistribution(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getExpressionParameter Expression Parameter}'. + * + * + * @return the meta object for the containment reference 'Expression Parameter'. + * @see bpsim.DocumentRoot#getExpressionParameter() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ExpressionParameter(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getFloatingParameter Floating Parameter}'. + * + * + * @return the meta object for the containment reference 'Floating Parameter'. + * @see bpsim.DocumentRoot#getFloatingParameter() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_FloatingParameter(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getGammaDistribution Gamma Distribution}'. + * + * + * @return the meta object for the containment reference 'Gamma Distribution'. + * @see bpsim.DocumentRoot#getGammaDistribution() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_GammaDistribution(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getLogNormalDistribution Log Normal Distribution}'. + * + * + * @return the meta object for the containment reference 'Log Normal Distribution'. + * @see bpsim.DocumentRoot#getLogNormalDistribution() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_LogNormalDistribution(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getNegativeExponentialDistribution Negative Exponential Distribution}'. + * + * + * @return the meta object for the containment reference 'Negative Exponential Distribution'. + * @see bpsim.DocumentRoot#getNegativeExponentialDistribution() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_NegativeExponentialDistribution(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getNormalDistribution Normal Distribution}'. + * + * + * @return the meta object for the containment reference 'Normal Distribution'. + * @see bpsim.DocumentRoot#getNormalDistribution() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_NormalDistribution(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getNumericParameter Numeric Parameter}'. + * + * + * @return the meta object for the containment reference 'Numeric Parameter'. + * @see bpsim.DocumentRoot#getNumericParameter() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_NumericParameter(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getPoissonDistribution Poisson Distribution}'. + * + * + * @return the meta object for the containment reference 'Poisson Distribution'. + * @see bpsim.DocumentRoot#getPoissonDistribution() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_PoissonDistribution(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getStringParameter String Parameter}'. + * + * + * @return the meta object for the containment reference 'String Parameter'. + * @see bpsim.DocumentRoot#getStringParameter() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_StringParameter(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getTriangularDistribution Triangular Distribution}'. + * + * + * @return the meta object for the containment reference 'Triangular Distribution'. + * @see bpsim.DocumentRoot#getTriangularDistribution() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_TriangularDistribution(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getTruncatedNormalDistribution Truncated Normal Distribution}'. + * + * + * @return the meta object for the containment reference 'Truncated Normal Distribution'. + * @see bpsim.DocumentRoot#getTruncatedNormalDistribution() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_TruncatedNormalDistribution(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getUniformDistribution Uniform Distribution}'. + * + * + * @return the meta object for the containment reference 'Uniform Distribution'. + * @see bpsim.DocumentRoot#getUniformDistribution() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_UniformDistribution(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getUserDistribution User Distribution}'. + * + * + * @return the meta object for the containment reference 'User Distribution'. + * @see bpsim.DocumentRoot#getUserDistribution() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_UserDistribution(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getUserDistributionDataPoint User Distribution Data Point}'. + * + * + * @return the meta object for the containment reference 'User Distribution Data Point'. + * @see bpsim.DocumentRoot#getUserDistributionDataPoint() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_UserDistributionDataPoint(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.DocumentRoot#getWeibullDistribution Weibull Distribution}'. + * + * + * @return the meta object for the containment reference 'Weibull Distribution'. + * @see bpsim.DocumentRoot#getWeibullDistribution() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_WeibullDistribution(); + + /** + * Returns the meta object for class '{@link bpsim.DurationParameterType Duration Parameter Type}'. + * + * + * @return the meta object for class 'Duration Parameter Type'. + * @see bpsim.DurationParameterType + * @generated + */ + EClass getDurationParameterType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.DurationParameterType#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see bpsim.DurationParameterType#getValue() + * @see #getDurationParameterType() + * @generated + */ + EAttribute getDurationParameterType_Value(); + + /** + * Returns the meta object for class '{@link bpsim.ElementParameters Element Parameters}'. + * + * + * @return the meta object for class 'Element Parameters'. + * @see bpsim.ElementParameters + * @generated + */ + EClass getElementParameters(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ElementParameters#getTimeParameters Time Parameters}'. + * + * + * @return the meta object for the containment reference 'Time Parameters'. + * @see bpsim.ElementParameters#getTimeParameters() + * @see #getElementParameters() + * @generated + */ + EReference getElementParameters_TimeParameters(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ElementParameters#getControlParameters Control Parameters}'. + * + * + * @return the meta object for the containment reference 'Control Parameters'. + * @see bpsim.ElementParameters#getControlParameters() + * @see #getElementParameters() + * @generated + */ + EReference getElementParameters_ControlParameters(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ElementParameters#getResourceParameters Resource Parameters}'. + * + * + * @return the meta object for the containment reference 'Resource Parameters'. + * @see bpsim.ElementParameters#getResourceParameters() + * @see #getElementParameters() + * @generated + */ + EReference getElementParameters_ResourceParameters(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ElementParameters#getPriorityParameters Priority Parameters}'. + * + * + * @return the meta object for the containment reference 'Priority Parameters'. + * @see bpsim.ElementParameters#getPriorityParameters() + * @see #getElementParameters() + * @generated + */ + EReference getElementParameters_PriorityParameters(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ElementParameters#getCostParameters Cost Parameters}'. + * + * + * @return the meta object for the containment reference 'Cost Parameters'. + * @see bpsim.ElementParameters#getCostParameters() + * @see #getElementParameters() + * @generated + */ + EReference getElementParameters_CostParameters(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ElementParameters#getPropertyParameters Property Parameters}'. + * + * + * @return the meta object for the containment reference 'Property Parameters'. + * @see bpsim.ElementParameters#getPropertyParameters() + * @see #getElementParameters() + * @generated + */ + EReference getElementParameters_PropertyParameters(); + + /** + * Returns the meta object for the containment reference list '{@link bpsim.ElementParameters#getVendorExtension Vendor Extension}'. + * + * + * @return the meta object for the containment reference list 'Vendor Extension'. + * @see bpsim.ElementParameters#getVendorExtension() + * @see #getElementParameters() + * @generated + */ + EReference getElementParameters_VendorExtension(); + + /** + * Returns the meta object for the attribute '{@link bpsim.ElementParameters#getElementRef Element Ref}'. + * + * + * @return the meta object for the attribute 'Element Ref'. + * @see bpsim.ElementParameters#getElementRef() + * @see #getElementParameters() + * @generated + */ + EAttribute getElementParameters_ElementRef(); + + /** + * Returns the meta object for the attribute '{@link bpsim.ElementParameters#getId Id}'. + * + * + * @return the meta object for the attribute 'Id'. + * @see bpsim.ElementParameters#getId() + * @see #getElementParameters() + * @generated + */ + EAttribute getElementParameters_Id(); + + /** + * Returns the meta object for class '{@link bpsim.ElementParametersType Element Parameters Type}'. + * + * + * @return the meta object for class 'Element Parameters Type'. + * @see bpsim.ElementParametersType + * @generated + */ + EClass getElementParametersType(); + + /** + * Returns the meta object for class '{@link bpsim.EnumParameterType Enum Parameter Type}'. + * + * + * @return the meta object for class 'Enum Parameter Type'. + * @see bpsim.EnumParameterType + * @generated + */ + EClass getEnumParameterType(); + + /** + * Returns the meta object for the attribute list '{@link bpsim.EnumParameterType#getGroup Group}'. + * + * + * @return the meta object for the attribute list 'Group'. + * @see bpsim.EnumParameterType#getGroup() + * @see #getEnumParameterType() + * @generated + */ + EAttribute getEnumParameterType_Group(); + + /** + * Returns the meta object for the attribute list '{@link bpsim.EnumParameterType#getParameterValueGroup Parameter Value Group}'. + * + * + * @return the meta object for the attribute list 'Parameter Value Group'. + * @see bpsim.EnumParameterType#getParameterValueGroup() + * @see #getEnumParameterType() + * @generated + */ + EAttribute getEnumParameterType_ParameterValueGroup(); + + /** + * Returns the meta object for the containment reference list '{@link bpsim.EnumParameterType#getParameterValue Parameter Value}'. + * + * + * @return the meta object for the containment reference list 'Parameter Value'. + * @see bpsim.EnumParameterType#getParameterValue() + * @see #getEnumParameterType() + * @generated + */ + EReference getEnumParameterType_ParameterValue(); + + /** + * Returns the meta object for class '{@link bpsim.ErlangDistributionType Erlang Distribution Type}'. + * + * + * @return the meta object for class 'Erlang Distribution Type'. + * @see bpsim.ErlangDistributionType + * @generated + */ + EClass getErlangDistributionType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.ErlangDistributionType#getK K}'. + * + * + * @return the meta object for the attribute 'K'. + * @see bpsim.ErlangDistributionType#getK() + * @see #getErlangDistributionType() + * @generated + */ + EAttribute getErlangDistributionType_K(); + + /** + * Returns the meta object for the attribute '{@link bpsim.ErlangDistributionType#getMean Mean}'. + * + * + * @return the meta object for the attribute 'Mean'. + * @see bpsim.ErlangDistributionType#getMean() + * @see #getErlangDistributionType() + * @generated + */ + EAttribute getErlangDistributionType_Mean(); + + /** + * Returns the meta object for class '{@link bpsim.ExpressionParameterType Expression Parameter Type}'. + * + * + * @return the meta object for class 'Expression Parameter Type'. + * @see bpsim.ExpressionParameterType + * @generated + */ + EClass getExpressionParameterType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.ExpressionParameterType#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see bpsim.ExpressionParameterType#getValue() + * @see #getExpressionParameterType() + * @generated + */ + EAttribute getExpressionParameterType_Value(); + + /** + * Returns the meta object for class '{@link bpsim.FloatingParameterType Floating Parameter Type}'. + * + * + * @return the meta object for class 'Floating Parameter Type'. + * @see bpsim.FloatingParameterType + * @generated + */ + EClass getFloatingParameterType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.FloatingParameterType#getCurrencyUnit Currency Unit}'. + * + * + * @return the meta object for the attribute 'Currency Unit'. + * @see bpsim.FloatingParameterType#getCurrencyUnit() + * @see #getFloatingParameterType() + * @generated + */ + EAttribute getFloatingParameterType_CurrencyUnit(); + + /** + * Returns the meta object for the attribute '{@link bpsim.FloatingParameterType#getTimeUnit Time Unit}'. + * + * + * @return the meta object for the attribute 'Time Unit'. + * @see bpsim.FloatingParameterType#getTimeUnit() + * @see #getFloatingParameterType() + * @generated + */ + EAttribute getFloatingParameterType_TimeUnit(); + + /** + * Returns the meta object for the attribute '{@link bpsim.FloatingParameterType#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see bpsim.FloatingParameterType#getValue() + * @see #getFloatingParameterType() + * @generated + */ + EAttribute getFloatingParameterType_Value(); + + /** + * Returns the meta object for class '{@link bpsim.GammaDistributionType Gamma Distribution Type}'. + * + * + * @return the meta object for class 'Gamma Distribution Type'. + * @see bpsim.GammaDistributionType + * @generated + */ + EClass getGammaDistributionType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.GammaDistributionType#getScale Scale}'. + * + * + * @return the meta object for the attribute 'Scale'. + * @see bpsim.GammaDistributionType#getScale() + * @see #getGammaDistributionType() + * @generated + */ + EAttribute getGammaDistributionType_Scale(); + + /** + * Returns the meta object for the attribute '{@link bpsim.GammaDistributionType#getShape Shape}'. + * + * + * @return the meta object for the attribute 'Shape'. + * @see bpsim.GammaDistributionType#getShape() + * @see #getGammaDistributionType() + * @generated + */ + EAttribute getGammaDistributionType_Shape(); + + /** + * Returns the meta object for class '{@link bpsim.LogNormalDistributionType Log Normal Distribution Type}'. + * + * + * @return the meta object for class 'Log Normal Distribution Type'. + * @see bpsim.LogNormalDistributionType + * @generated + */ + EClass getLogNormalDistributionType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.LogNormalDistributionType#getMean Mean}'. + * + * + * @return the meta object for the attribute 'Mean'. + * @see bpsim.LogNormalDistributionType#getMean() + * @see #getLogNormalDistributionType() + * @generated + */ + EAttribute getLogNormalDistributionType_Mean(); + + /** + * Returns the meta object for the attribute '{@link bpsim.LogNormalDistributionType#getStandardDeviation Standard Deviation}'. + * + * + * @return the meta object for the attribute 'Standard Deviation'. + * @see bpsim.LogNormalDistributionType#getStandardDeviation() + * @see #getLogNormalDistributionType() + * @generated + */ + EAttribute getLogNormalDistributionType_StandardDeviation(); + + /** + * Returns the meta object for class '{@link bpsim.NegativeExponentialDistributionType Negative Exponential Distribution Type}'. + * + * + * @return the meta object for class 'Negative Exponential Distribution Type'. + * @see bpsim.NegativeExponentialDistributionType + * @generated + */ + EClass getNegativeExponentialDistributionType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.NegativeExponentialDistributionType#getMean Mean}'. + * + * + * @return the meta object for the attribute 'Mean'. + * @see bpsim.NegativeExponentialDistributionType#getMean() + * @see #getNegativeExponentialDistributionType() + * @generated + */ + EAttribute getNegativeExponentialDistributionType_Mean(); + + /** + * Returns the meta object for class '{@link bpsim.NormalDistributionType Normal Distribution Type}'. + * + * + * @return the meta object for class 'Normal Distribution Type'. + * @see bpsim.NormalDistributionType + * @generated + */ + EClass getNormalDistributionType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.NormalDistributionType#getMean Mean}'. + * + * + * @return the meta object for the attribute 'Mean'. + * @see bpsim.NormalDistributionType#getMean() + * @see #getNormalDistributionType() + * @generated + */ + EAttribute getNormalDistributionType_Mean(); + + /** + * Returns the meta object for the attribute '{@link bpsim.NormalDistributionType#getStandardDeviation Standard Deviation}'. + * + * + * @return the meta object for the attribute 'Standard Deviation'. + * @see bpsim.NormalDistributionType#getStandardDeviation() + * @see #getNormalDistributionType() + * @generated + */ + EAttribute getNormalDistributionType_StandardDeviation(); + + /** + * Returns the meta object for class '{@link bpsim.NumericParameterType Numeric Parameter Type}'. + * + * + * @return the meta object for class 'Numeric Parameter Type'. + * @see bpsim.NumericParameterType + * @generated + */ + EClass getNumericParameterType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.NumericParameterType#getCurrencyUnit Currency Unit}'. + * + * + * @return the meta object for the attribute 'Currency Unit'. + * @see bpsim.NumericParameterType#getCurrencyUnit() + * @see #getNumericParameterType() + * @generated + */ + EAttribute getNumericParameterType_CurrencyUnit(); + + /** + * Returns the meta object for the attribute '{@link bpsim.NumericParameterType#getTimeUnit Time Unit}'. + * + * + * @return the meta object for the attribute 'Time Unit'. + * @see bpsim.NumericParameterType#getTimeUnit() + * @see #getNumericParameterType() + * @generated + */ + EAttribute getNumericParameterType_TimeUnit(); + + /** + * Returns the meta object for the attribute '{@link bpsim.NumericParameterType#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see bpsim.NumericParameterType#getValue() + * @see #getNumericParameterType() + * @generated + */ + EAttribute getNumericParameterType_Value(); + + /** + * Returns the meta object for class '{@link bpsim.Parameter Parameter}'. + * + * + * @return the meta object for class 'Parameter'. + * @see bpsim.Parameter + * @generated + */ + EClass getParameter(); + + /** + * Returns the meta object for the attribute list '{@link bpsim.Parameter#getResultRequest Result Request}'. + * + * + * @return the meta object for the attribute list 'Result Request'. + * @see bpsim.Parameter#getResultRequest() + * @see #getParameter() + * @generated + */ + EAttribute getParameter_ResultRequest(); + + /** + * Returns the meta object for the attribute list '{@link bpsim.Parameter#getParameterValueGroup Parameter Value Group}'. + * + * + * @return the meta object for the attribute list 'Parameter Value Group'. + * @see bpsim.Parameter#getParameterValueGroup() + * @see #getParameter() + * @generated + */ + EAttribute getParameter_ParameterValueGroup(); + + /** + * Returns the meta object for the containment reference list '{@link bpsim.Parameter#getParameterValue Parameter Value}'. + * + * + * @return the meta object for the containment reference list 'Parameter Value'. + * @see bpsim.Parameter#getParameterValue() + * @see #getParameter() + * @generated + */ + EReference getParameter_ParameterValue(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Parameter#isKpi Kpi}'. + * + * + * @return the meta object for the attribute 'Kpi'. + * @see bpsim.Parameter#isKpi() + * @see #getParameter() + * @generated + */ + EAttribute getParameter_Kpi(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Parameter#isSla Sla}'. + * + * + * @return the meta object for the attribute 'Sla'. + * @see bpsim.Parameter#isSla() + * @see #getParameter() + * @generated + */ + EAttribute getParameter_Sla(); + + /** + * Returns the meta object for class '{@link bpsim.ParameterValue Parameter Value}'. + * + * + * @return the meta object for class 'Parameter Value'. + * @see bpsim.ParameterValue + * @generated + */ + EClass getParameterValue(); + + /** + * Returns the meta object for the attribute '{@link bpsim.ParameterValue#getInstance Instance}'. + * + * + * @return the meta object for the attribute 'Instance'. + * @see bpsim.ParameterValue#getInstance() + * @see #getParameterValue() + * @generated + */ + EAttribute getParameterValue_Instance(); + + /** + * Returns the meta object for the attribute '{@link bpsim.ParameterValue#getResult Result}'. + * + * + * @return the meta object for the attribute 'Result'. + * @see bpsim.ParameterValue#getResult() + * @see #getParameterValue() + * @generated + */ + EAttribute getParameterValue_Result(); + + /** + * Returns the meta object for the attribute '{@link bpsim.ParameterValue#getValidFor Valid For}'. + * + * + * @return the meta object for the attribute 'Valid For'. + * @see bpsim.ParameterValue#getValidFor() + * @see #getParameterValue() + * @generated + */ + EAttribute getParameterValue_ValidFor(); + + /** + * Returns the meta object for class '{@link bpsim.PoissonDistributionType Poisson Distribution Type}'. + * + * + * @return the meta object for class 'Poisson Distribution Type'. + * @see bpsim.PoissonDistributionType + * @generated + */ + EClass getPoissonDistributionType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.PoissonDistributionType#getMean Mean}'. + * + * + * @return the meta object for the attribute 'Mean'. + * @see bpsim.PoissonDistributionType#getMean() + * @see #getPoissonDistributionType() + * @generated + */ + EAttribute getPoissonDistributionType_Mean(); + + /** + * Returns the meta object for class '{@link bpsim.PriorityParameters Priority Parameters}'. + * + * + * @return the meta object for class 'Priority Parameters'. + * @see bpsim.PriorityParameters + * @generated + */ + EClass getPriorityParameters(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.PriorityParameters#getInterruptible Interruptible}'. + * + * + * @return the meta object for the containment reference 'Interruptible'. + * @see bpsim.PriorityParameters#getInterruptible() + * @see #getPriorityParameters() + * @generated + */ + EReference getPriorityParameters_Interruptible(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.PriorityParameters#getPriority Priority}'. + * + * + * @return the meta object for the containment reference 'Priority'. + * @see bpsim.PriorityParameters#getPriority() + * @see #getPriorityParameters() + * @generated + */ + EReference getPriorityParameters_Priority(); + + /** + * Returns the meta object for class '{@link bpsim.PropertyParameters Property Parameters}'. + * + * + * @return the meta object for class 'Property Parameters'. + * @see bpsim.PropertyParameters + * @generated + */ + EClass getPropertyParameters(); + + /** + * Returns the meta object for the containment reference list '{@link bpsim.PropertyParameters#getProperty Property}'. + * + * + * @return the meta object for the containment reference list 'Property'. + * @see bpsim.PropertyParameters#getProperty() + * @see #getPropertyParameters() + * @generated + */ + EReference getPropertyParameters_Property(); + + /** + * Returns the meta object for class '{@link bpsim.PropertyType Property Type}'. + * + * + * @return the meta object for class 'Property Type'. + * @see bpsim.PropertyType + * @generated + */ + EClass getPropertyType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.PropertyType#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see bpsim.PropertyType#getName() + * @see #getPropertyType() + * @generated + */ + EAttribute getPropertyType_Name(); + + /** + * Returns the meta object for class '{@link bpsim.ResourceParameters Resource Parameters}'. + * + * + * @return the meta object for class 'Resource Parameters'. + * @see bpsim.ResourceParameters + * @generated + */ + EClass getResourceParameters(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ResourceParameters#getSelection Selection}'. + * + * + * @return the meta object for the containment reference 'Selection'. + * @see bpsim.ResourceParameters#getSelection() + * @see #getResourceParameters() + * @generated + */ + EReference getResourceParameters_Selection(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ResourceParameters#getAvailability Availability}'. + * + * + * @return the meta object for the containment reference 'Availability'. + * @see bpsim.ResourceParameters#getAvailability() + * @see #getResourceParameters() + * @generated + */ + EReference getResourceParameters_Availability(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ResourceParameters#getQuantity Quantity}'. + * + * + * @return the meta object for the containment reference 'Quantity'. + * @see bpsim.ResourceParameters#getQuantity() + * @see #getResourceParameters() + * @generated + */ + EReference getResourceParameters_Quantity(); + + /** + * Returns the meta object for the containment reference list '{@link bpsim.ResourceParameters#getRole Role}'. + * + * + * @return the meta object for the containment reference list 'Role'. + * @see bpsim.ResourceParameters#getRole() + * @see #getResourceParameters() + * @generated + */ + EReference getResourceParameters_Role(); + + /** + * Returns the meta object for class '{@link bpsim.Scenario Scenario}'. + * + * + * @return the meta object for class 'Scenario'. + * @see bpsim.Scenario + * @generated + */ + EClass getScenario(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.Scenario#getScenarioParameters Scenario Parameters}'. + * + * + * @return the meta object for the containment reference 'Scenario Parameters'. + * @see bpsim.Scenario#getScenarioParameters() + * @see #getScenario() + * @generated + */ + EReference getScenario_ScenarioParameters(); + + /** + * Returns the meta object for the containment reference list '{@link bpsim.Scenario#getElementParameters Element Parameters}'. + * + * + * @return the meta object for the containment reference list 'Element Parameters'. + * @see bpsim.Scenario#getElementParameters() + * @see #getScenario() + * @generated + */ + EReference getScenario_ElementParameters(); + + /** + * Returns the meta object for the containment reference list '{@link bpsim.Scenario#getCalendar Calendar}'. + * + * + * @return the meta object for the containment reference list 'Calendar'. + * @see bpsim.Scenario#getCalendar() + * @see #getScenario() + * @generated + */ + EReference getScenario_Calendar(); + + /** + * Returns the meta object for the containment reference list '{@link bpsim.Scenario#getVendorExtension Vendor Extension}'. + * + * + * @return the meta object for the containment reference list 'Vendor Extension'. + * @see bpsim.Scenario#getVendorExtension() + * @see #getScenario() + * @generated + */ + EReference getScenario_VendorExtension(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Scenario#getAuthor Author}'. + * + * + * @return the meta object for the attribute 'Author'. + * @see bpsim.Scenario#getAuthor() + * @see #getScenario() + * @generated + */ + EAttribute getScenario_Author(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Scenario#getCreated Created}'. + * + * + * @return the meta object for the attribute 'Created'. + * @see bpsim.Scenario#getCreated() + * @see #getScenario() + * @generated + */ + EAttribute getScenario_Created(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Scenario#getDescription Description}'. + * + * + * @return the meta object for the attribute 'Description'. + * @see bpsim.Scenario#getDescription() + * @see #getScenario() + * @generated + */ + EAttribute getScenario_Description(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Scenario#getId Id}'. + * + * + * @return the meta object for the attribute 'Id'. + * @see bpsim.Scenario#getId() + * @see #getScenario() + * @generated + */ + EAttribute getScenario_Id(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Scenario#getInherits Inherits}'. + * + * + * @return the meta object for the attribute 'Inherits'. + * @see bpsim.Scenario#getInherits() + * @see #getScenario() + * @generated + */ + EAttribute getScenario_Inherits(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Scenario#getModified Modified}'. + * + * + * @return the meta object for the attribute 'Modified'. + * @see bpsim.Scenario#getModified() + * @see #getScenario() + * @generated + */ + EAttribute getScenario_Modified(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Scenario#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see bpsim.Scenario#getName() + * @see #getScenario() + * @generated + */ + EAttribute getScenario_Name(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Scenario#getResult Result}'. + * + * + * @return the meta object for the attribute 'Result'. + * @see bpsim.Scenario#getResult() + * @see #getScenario() + * @generated + */ + EAttribute getScenario_Result(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Scenario#getVendor Vendor}'. + * + * + * @return the meta object for the attribute 'Vendor'. + * @see bpsim.Scenario#getVendor() + * @see #getScenario() + * @generated + */ + EAttribute getScenario_Vendor(); + + /** + * Returns the meta object for the attribute '{@link bpsim.Scenario#getVersion Version}'. + * + * + * @return the meta object for the attribute 'Version'. + * @see bpsim.Scenario#getVersion() + * @see #getScenario() + * @generated + */ + EAttribute getScenario_Version(); + + /** + * Returns the meta object for class '{@link bpsim.ScenarioParameters Scenario Parameters}'. + * + * + * @return the meta object for class 'Scenario Parameters'. + * @see bpsim.ScenarioParameters + * @generated + */ + EClass getScenarioParameters(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ScenarioParameters#getStart Start}'. + * + * + * @return the meta object for the containment reference 'Start'. + * @see bpsim.ScenarioParameters#getStart() + * @see #getScenarioParameters() + * @generated + */ + EReference getScenarioParameters_Start(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ScenarioParameters#getDuration Duration}'. + * + * + * @return the meta object for the containment reference 'Duration'. + * @see bpsim.ScenarioParameters#getDuration() + * @see #getScenarioParameters() + * @generated + */ + EReference getScenarioParameters_Duration(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.ScenarioParameters#getPropertyParameters Property Parameters}'. + * + * + * @return the meta object for the containment reference 'Property Parameters'. + * @see bpsim.ScenarioParameters#getPropertyParameters() + * @see #getScenarioParameters() + * @generated + */ + EReference getScenarioParameters_PropertyParameters(); + + /** + * Returns the meta object for the attribute '{@link bpsim.ScenarioParameters#getBaseCurrencyUnit Base Currency Unit}'. + * + * + * @return the meta object for the attribute 'Base Currency Unit'. + * @see bpsim.ScenarioParameters#getBaseCurrencyUnit() + * @see #getScenarioParameters() + * @generated + */ + EAttribute getScenarioParameters_BaseCurrencyUnit(); + + /** + * Returns the meta object for the attribute '{@link bpsim.ScenarioParameters#getBaseTimeUnit Base Time Unit}'. + * + * + * @return the meta object for the attribute 'Base Time Unit'. + * @see bpsim.ScenarioParameters#getBaseTimeUnit() + * @see #getScenarioParameters() + * @generated + */ + EAttribute getScenarioParameters_BaseTimeUnit(); + + /** + * Returns the meta object for the attribute '{@link bpsim.ScenarioParameters#getReplication Replication}'. + * + * + * @return the meta object for the attribute 'Replication'. + * @see bpsim.ScenarioParameters#getReplication() + * @see #getScenarioParameters() + * @generated + */ + EAttribute getScenarioParameters_Replication(); + + /** + * Returns the meta object for the attribute '{@link bpsim.ScenarioParameters#getSeed Seed}'. + * + * + * @return the meta object for the attribute 'Seed'. + * @see bpsim.ScenarioParameters#getSeed() + * @see #getScenarioParameters() + * @generated + */ + EAttribute getScenarioParameters_Seed(); + + /** + * Returns the meta object for class '{@link bpsim.ScenarioParametersType Scenario Parameters Type}'. + * + * + * @return the meta object for class 'Scenario Parameters Type'. + * @see bpsim.ScenarioParametersType + * @generated + */ + EClass getScenarioParametersType(); + + /** + * Returns the meta object for class '{@link bpsim.StringParameterType String Parameter Type}'. + * + * + * @return the meta object for class 'String Parameter Type'. + * @see bpsim.StringParameterType + * @generated + */ + EClass getStringParameterType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.StringParameterType#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see bpsim.StringParameterType#getValue() + * @see #getStringParameterType() + * @generated + */ + EAttribute getStringParameterType_Value(); + + /** + * Returns the meta object for class '{@link bpsim.TimeParameters Time Parameters}'. + * + * + * @return the meta object for class 'Time Parameters'. + * @see bpsim.TimeParameters + * @generated + */ + EClass getTimeParameters(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.TimeParameters#getTransferTime Transfer Time}'. + * + * + * @return the meta object for the containment reference 'Transfer Time'. + * @see bpsim.TimeParameters#getTransferTime() + * @see #getTimeParameters() + * @generated + */ + EReference getTimeParameters_TransferTime(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.TimeParameters#getQueueTime Queue Time}'. + * + * + * @return the meta object for the containment reference 'Queue Time'. + * @see bpsim.TimeParameters#getQueueTime() + * @see #getTimeParameters() + * @generated + */ + EReference getTimeParameters_QueueTime(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.TimeParameters#getWaitTime Wait Time}'. + * + * + * @return the meta object for the containment reference 'Wait Time'. + * @see bpsim.TimeParameters#getWaitTime() + * @see #getTimeParameters() + * @generated + */ + EReference getTimeParameters_WaitTime(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.TimeParameters#getSetUpTime Set Up Time}'. + * + * + * @return the meta object for the containment reference 'Set Up Time'. + * @see bpsim.TimeParameters#getSetUpTime() + * @see #getTimeParameters() + * @generated + */ + EReference getTimeParameters_SetUpTime(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.TimeParameters#getProcessingTime Processing Time}'. + * + * + * @return the meta object for the containment reference 'Processing Time'. + * @see bpsim.TimeParameters#getProcessingTime() + * @see #getTimeParameters() + * @generated + */ + EReference getTimeParameters_ProcessingTime(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.TimeParameters#getValidationTime Validation Time}'. + * + * + * @return the meta object for the containment reference 'Validation Time'. + * @see bpsim.TimeParameters#getValidationTime() + * @see #getTimeParameters() + * @generated + */ + EReference getTimeParameters_ValidationTime(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.TimeParameters#getReworkTime Rework Time}'. + * + * + * @return the meta object for the containment reference 'Rework Time'. + * @see bpsim.TimeParameters#getReworkTime() + * @see #getTimeParameters() + * @generated + */ + EReference getTimeParameters_ReworkTime(); + + /** + * Returns the meta object for class '{@link bpsim.TriangularDistributionType Triangular Distribution Type}'. + * + * + * @return the meta object for class 'Triangular Distribution Type'. + * @see bpsim.TriangularDistributionType + * @generated + */ + EClass getTriangularDistributionType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.TriangularDistributionType#getMax Max}'. + * + * + * @return the meta object for the attribute 'Max'. + * @see bpsim.TriangularDistributionType#getMax() + * @see #getTriangularDistributionType() + * @generated + */ + EAttribute getTriangularDistributionType_Max(); + + /** + * Returns the meta object for the attribute '{@link bpsim.TriangularDistributionType#getMin Min}'. + * + * + * @return the meta object for the attribute 'Min'. + * @see bpsim.TriangularDistributionType#getMin() + * @see #getTriangularDistributionType() + * @generated + */ + EAttribute getTriangularDistributionType_Min(); + + /** + * Returns the meta object for the attribute '{@link bpsim.TriangularDistributionType#getMode Mode}'. + * + * + * @return the meta object for the attribute 'Mode'. + * @see bpsim.TriangularDistributionType#getMode() + * @see #getTriangularDistributionType() + * @generated + */ + EAttribute getTriangularDistributionType_Mode(); + + /** + * Returns the meta object for class '{@link bpsim.TruncatedNormalDistributionType Truncated Normal Distribution Type}'. + * + * + * @return the meta object for class 'Truncated Normal Distribution Type'. + * @see bpsim.TruncatedNormalDistributionType + * @generated + */ + EClass getTruncatedNormalDistributionType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.TruncatedNormalDistributionType#getMax Max}'. + * + * + * @return the meta object for the attribute 'Max'. + * @see bpsim.TruncatedNormalDistributionType#getMax() + * @see #getTruncatedNormalDistributionType() + * @generated + */ + EAttribute getTruncatedNormalDistributionType_Max(); + + /** + * Returns the meta object for the attribute '{@link bpsim.TruncatedNormalDistributionType#getMean Mean}'. + * + * + * @return the meta object for the attribute 'Mean'. + * @see bpsim.TruncatedNormalDistributionType#getMean() + * @see #getTruncatedNormalDistributionType() + * @generated + */ + EAttribute getTruncatedNormalDistributionType_Mean(); + + /** + * Returns the meta object for the attribute '{@link bpsim.TruncatedNormalDistributionType#getMin Min}'. + * + * + * @return the meta object for the attribute 'Min'. + * @see bpsim.TruncatedNormalDistributionType#getMin() + * @see #getTruncatedNormalDistributionType() + * @generated + */ + EAttribute getTruncatedNormalDistributionType_Min(); + + /** + * Returns the meta object for the attribute '{@link bpsim.TruncatedNormalDistributionType#getStandardDeviation Standard Deviation}'. + * + * + * @return the meta object for the attribute 'Standard Deviation'. + * @see bpsim.TruncatedNormalDistributionType#getStandardDeviation() + * @see #getTruncatedNormalDistributionType() + * @generated + */ + EAttribute getTruncatedNormalDistributionType_StandardDeviation(); + + /** + * Returns the meta object for class '{@link bpsim.UniformDistributionType Uniform Distribution Type}'. + * + * + * @return the meta object for class 'Uniform Distribution Type'. + * @see bpsim.UniformDistributionType + * @generated + */ + EClass getUniformDistributionType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.UniformDistributionType#getMax Max}'. + * + * + * @return the meta object for the attribute 'Max'. + * @see bpsim.UniformDistributionType#getMax() + * @see #getUniformDistributionType() + * @generated + */ + EAttribute getUniformDistributionType_Max(); + + /** + * Returns the meta object for the attribute '{@link bpsim.UniformDistributionType#getMin Min}'. + * + * + * @return the meta object for the attribute 'Min'. + * @see bpsim.UniformDistributionType#getMin() + * @see #getUniformDistributionType() + * @generated + */ + EAttribute getUniformDistributionType_Min(); + + /** + * Returns the meta object for class '{@link bpsim.UserDistributionDataPointType User Distribution Data Point Type}'. + * + * + * @return the meta object for class 'User Distribution Data Point Type'. + * @see bpsim.UserDistributionDataPointType + * @generated + */ + EClass getUserDistributionDataPointType(); + + /** + * Returns the meta object for the attribute list '{@link bpsim.UserDistributionDataPointType#getParameterValueGroup Parameter Value Group}'. + * + * + * @return the meta object for the attribute list 'Parameter Value Group'. + * @see bpsim.UserDistributionDataPointType#getParameterValueGroup() + * @see #getUserDistributionDataPointType() + * @generated + */ + EAttribute getUserDistributionDataPointType_ParameterValueGroup(); + + /** + * Returns the meta object for the containment reference '{@link bpsim.UserDistributionDataPointType#getParameterValue Parameter Value}'. + * + * + * @return the meta object for the containment reference 'Parameter Value'. + * @see bpsim.UserDistributionDataPointType#getParameterValue() + * @see #getUserDistributionDataPointType() + * @generated + */ + EReference getUserDistributionDataPointType_ParameterValue(); + + /** + * Returns the meta object for the attribute '{@link bpsim.UserDistributionDataPointType#getProbability Probability}'. + * + * + * @return the meta object for the attribute 'Probability'. + * @see bpsim.UserDistributionDataPointType#getProbability() + * @see #getUserDistributionDataPointType() + * @generated + */ + EAttribute getUserDistributionDataPointType_Probability(); + + /** + * Returns the meta object for class '{@link bpsim.UserDistributionType User Distribution Type}'. + * + * + * @return the meta object for class 'User Distribution Type'. + * @see bpsim.UserDistributionType + * @generated + */ + EClass getUserDistributionType(); + + /** + * Returns the meta object for the attribute list '{@link bpsim.UserDistributionType#getGroup Group}'. + * + * + * @return the meta object for the attribute list 'Group'. + * @see bpsim.UserDistributionType#getGroup() + * @see #getUserDistributionType() + * @generated + */ + EAttribute getUserDistributionType_Group(); + + /** + * Returns the meta object for the containment reference list '{@link bpsim.UserDistributionType#getUserDistributionDataPoint User Distribution Data Point}'. + * + * + * @return the meta object for the containment reference list 'User Distribution Data Point'. + * @see bpsim.UserDistributionType#getUserDistributionDataPoint() + * @see #getUserDistributionType() + * @generated + */ + EReference getUserDistributionType_UserDistributionDataPoint(); + + /** + * Returns the meta object for the attribute '{@link bpsim.UserDistributionType#isDiscrete Discrete}'. + * + * + * @return the meta object for the attribute 'Discrete'. + * @see bpsim.UserDistributionType#isDiscrete() + * @see #getUserDistributionType() + * @generated + */ + EAttribute getUserDistributionType_Discrete(); + + /** + * Returns the meta object for class '{@link bpsim.VendorExtension Vendor Extension}'. + * + * + * @return the meta object for class 'Vendor Extension'. + * @see bpsim.VendorExtension + * @generated + */ + EClass getVendorExtension(); + + /** + * Returns the meta object for the attribute list '{@link bpsim.VendorExtension#getAny Any}'. + * + * + * @return the meta object for the attribute list 'Any'. + * @see bpsim.VendorExtension#getAny() + * @see #getVendorExtension() + * @generated + */ + EAttribute getVendorExtension_Any(); + + /** + * Returns the meta object for the attribute '{@link bpsim.VendorExtension#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see bpsim.VendorExtension#getName() + * @see #getVendorExtension() + * @generated + */ + EAttribute getVendorExtension_Name(); + + /** + * Returns the meta object for the attribute list '{@link bpsim.VendorExtension#getAnyAttribute Any Attribute}'. + * + * + * @return the meta object for the attribute list 'Any Attribute'. + * @see bpsim.VendorExtension#getAnyAttribute() + * @see #getVendorExtension() + * @generated + */ + EAttribute getVendorExtension_AnyAttribute(); + + /** + * Returns the meta object for class '{@link bpsim.WeibullDistributionType Weibull Distribution Type}'. + * + * + * @return the meta object for class 'Weibull Distribution Type'. + * @see bpsim.WeibullDistributionType + * @generated + */ + EClass getWeibullDistributionType(); + + /** + * Returns the meta object for the attribute '{@link bpsim.WeibullDistributionType#getScale Scale}'. + * + * + * @return the meta object for the attribute 'Scale'. + * @see bpsim.WeibullDistributionType#getScale() + * @see #getWeibullDistributionType() + * @generated + */ + EAttribute getWeibullDistributionType_Scale(); + + /** + * Returns the meta object for the attribute '{@link bpsim.WeibullDistributionType#getShape Shape}'. + * + * + * @return the meta object for the attribute 'Shape'. + * @see bpsim.WeibullDistributionType#getShape() + * @see #getWeibullDistributionType() + * @generated + */ + EAttribute getWeibullDistributionType_Shape(); + + /** + * Returns the meta object for enum '{@link bpsim.ResultType Result Type}'. + * + * + * @return the meta object for enum 'Result Type'. + * @see bpsim.ResultType + * @generated + */ + EEnum getResultType(); + + /** + * Returns the meta object for enum '{@link bpsim.TimeUnit Time Unit}'. + * + * + * @return the meta object for enum 'Time Unit'. + * @see bpsim.TimeUnit + * @generated + */ + EEnum getTimeUnit(); + + /** + * Returns the meta object for data type '{@link bpsim.ResultType Result Type Object}'. + * + * + * @return the meta object for data type 'Result Type Object'. + * @see bpsim.ResultType + * @model instanceClass="bpsim.ResultType" + * extendedMetaData="name='ResultType:Object' baseType='ResultType'" + * @generated + */ + EDataType getResultTypeObject(); + + /** + * Returns the meta object for data type '{@link bpsim.TimeUnit Time Unit Object}'. + * + * + * @return the meta object for data type 'Time Unit Object'. + * @see bpsim.TimeUnit + * @model instanceClass="bpsim.TimeUnit" + * extendedMetaData="name='TimeUnit:Object' baseType='TimeUnit'" + * @generated + */ + EDataType getTimeUnitObject(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + BpsimFactory getBpsimFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link bpsim.impl.BetaDistributionTypeImpl Beta Distribution Type}' class. + * + * + * @see bpsim.impl.BetaDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getBetaDistributionType() + * @generated + */ + EClass BETA_DISTRIBUTION_TYPE = eINSTANCE.getBetaDistributionType(); + + /** + * The meta object literal for the 'Scale' attribute feature. + * + * + * @generated + */ + EAttribute BETA_DISTRIBUTION_TYPE__SCALE = eINSTANCE.getBetaDistributionType_Scale(); + + /** + * The meta object literal for the 'Shape' attribute feature. + * + * + * @generated + */ + EAttribute BETA_DISTRIBUTION_TYPE__SHAPE = eINSTANCE.getBetaDistributionType_Shape(); + + /** + * The meta object literal for the '{@link bpsim.impl.BinomialDistributionTypeImpl Binomial Distribution Type}' class. + * + * + * @see bpsim.impl.BinomialDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getBinomialDistributionType() + * @generated + */ + EClass BINOMIAL_DISTRIBUTION_TYPE = eINSTANCE.getBinomialDistributionType(); + + /** + * The meta object literal for the 'Probability' attribute feature. + * + * + * @generated + */ + EAttribute BINOMIAL_DISTRIBUTION_TYPE__PROBABILITY = eINSTANCE.getBinomialDistributionType_Probability(); + + /** + * The meta object literal for the 'Trials' attribute feature. + * + * + * @generated + */ + EAttribute BINOMIAL_DISTRIBUTION_TYPE__TRIALS = eINSTANCE.getBinomialDistributionType_Trials(); + + /** + * The meta object literal for the '{@link bpsim.impl.BooleanParameterTypeImpl Boolean Parameter Type}' class. + * + * + * @see bpsim.impl.BooleanParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getBooleanParameterType() + * @generated + */ + EClass BOOLEAN_PARAMETER_TYPE = eINSTANCE.getBooleanParameterType(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute BOOLEAN_PARAMETER_TYPE__VALUE = eINSTANCE.getBooleanParameterType_Value(); + + /** + * The meta object literal for the '{@link bpsim.impl.BPSimDataTypeImpl BP Sim Data Type}' class. + * + * + * @see bpsim.impl.BPSimDataTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getBPSimDataType() + * @generated + */ + EClass BP_SIM_DATA_TYPE = eINSTANCE.getBPSimDataType(); + + /** + * The meta object literal for the 'Group' attribute list feature. + * + * + * @generated + */ + EAttribute BP_SIM_DATA_TYPE__GROUP = eINSTANCE.getBPSimDataType_Group(); + + /** + * The meta object literal for the 'Scenario' containment reference list feature. + * + * + * @generated + */ + EReference BP_SIM_DATA_TYPE__SCENARIO = eINSTANCE.getBPSimDataType_Scenario(); + + /** + * The meta object literal for the '{@link bpsim.impl.CalendarImpl Calendar}' class. + * + * + * @see bpsim.impl.CalendarImpl + * @see bpsim.impl.BpsimPackageImpl#getCalendar() + * @generated + */ + EClass CALENDAR = eINSTANCE.getCalendar(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute CALENDAR__VALUE = eINSTANCE.getCalendar_Value(); + + /** + * The meta object literal for the 'Id' attribute feature. + * + * + * @generated + */ + EAttribute CALENDAR__ID = eINSTANCE.getCalendar_Id(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute CALENDAR__NAME = eINSTANCE.getCalendar_Name(); + + /** + * The meta object literal for the '{@link bpsim.impl.ConstantParameterImpl Constant Parameter}' class. + * + * + * @see bpsim.impl.ConstantParameterImpl + * @see bpsim.impl.BpsimPackageImpl#getConstantParameter() + * @generated + */ + EClass CONSTANT_PARAMETER = eINSTANCE.getConstantParameter(); + + /** + * The meta object literal for the '{@link bpsim.impl.ControlParametersImpl Control Parameters}' class. + * + * + * @see bpsim.impl.ControlParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getControlParameters() + * @generated + */ + EClass CONTROL_PARAMETERS = eINSTANCE.getControlParameters(); + + /** + * The meta object literal for the 'Probability' containment reference feature. + * + * + * @generated + */ + EReference CONTROL_PARAMETERS__PROBABILITY = eINSTANCE.getControlParameters_Probability(); + + /** + * The meta object literal for the 'Condition' containment reference feature. + * + * + * @generated + */ + EReference CONTROL_PARAMETERS__CONDITION = eINSTANCE.getControlParameters_Condition(); + + /** + * The meta object literal for the 'Inter Trigger Timer' containment reference feature. + * + * + * @generated + */ + EReference CONTROL_PARAMETERS__INTER_TRIGGER_TIMER = eINSTANCE.getControlParameters_InterTriggerTimer(); + + /** + * The meta object literal for the 'Trigger Count' containment reference feature. + * + * + * @generated + */ + EReference CONTROL_PARAMETERS__TRIGGER_COUNT = eINSTANCE.getControlParameters_TriggerCount(); + + /** + * The meta object literal for the '{@link bpsim.impl.CostParametersImpl Cost Parameters}' class. + * + * + * @see bpsim.impl.CostParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getCostParameters() + * @generated + */ + EClass COST_PARAMETERS = eINSTANCE.getCostParameters(); + + /** + * The meta object literal for the 'Fixed Cost' containment reference feature. + * + * + * @generated + */ + EReference COST_PARAMETERS__FIXED_COST = eINSTANCE.getCostParameters_FixedCost(); + + /** + * The meta object literal for the 'Unit Cost' containment reference feature. + * + * + * @generated + */ + EReference COST_PARAMETERS__UNIT_COST = eINSTANCE.getCostParameters_UnitCost(); + + /** + * The meta object literal for the '{@link bpsim.impl.DateTimeParameterTypeImpl Date Time Parameter Type}' class. + * + * + * @see bpsim.impl.DateTimeParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getDateTimeParameterType() + * @generated + */ + EClass DATE_TIME_PARAMETER_TYPE = eINSTANCE.getDateTimeParameterType(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute DATE_TIME_PARAMETER_TYPE__VALUE = eINSTANCE.getDateTimeParameterType_Value(); + + /** + * The meta object literal for the '{@link bpsim.impl.DistributionParameterImpl Distribution Parameter}' class. + * + * + * @see bpsim.impl.DistributionParameterImpl + * @see bpsim.impl.BpsimPackageImpl#getDistributionParameter() + * @generated + */ + EClass DISTRIBUTION_PARAMETER = eINSTANCE.getDistributionParameter(); + + /** + * The meta object literal for the 'Currency Unit' attribute feature. + * + * + * @generated + */ + EAttribute DISTRIBUTION_PARAMETER__CURRENCY_UNIT = eINSTANCE.getDistributionParameter_CurrencyUnit(); + + /** + * The meta object literal for the 'Time Unit' attribute feature. + * + * + * @generated + */ + EAttribute DISTRIBUTION_PARAMETER__TIME_UNIT = eINSTANCE.getDistributionParameter_TimeUnit(); + + /** + * The meta object literal for the '{@link bpsim.impl.DocumentRootImpl Document Root}' class. + * + * + * @see bpsim.impl.DocumentRootImpl + * @see bpsim.impl.BpsimPackageImpl#getDocumentRoot() + * @generated + */ + EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot(); + + /** + * The meta object literal for the 'Mixed' attribute list feature. + * + * + * @generated + */ + EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed(); + + /** + * The meta object literal for the 'XMLNS Prefix Map' map feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap(); + + /** + * The meta object literal for the 'XSI Schema Location' map feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation(); + + /** + * The meta object literal for the 'Beta Distribution' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BETA_DISTRIBUTION = eINSTANCE.getDocumentRoot_BetaDistribution(); + + /** + * The meta object literal for the 'Parameter Value' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__PARAMETER_VALUE = eINSTANCE.getDocumentRoot_ParameterValue(); + + /** + * The meta object literal for the 'Binomial Distribution' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BINOMIAL_DISTRIBUTION = eINSTANCE.getDocumentRoot_BinomialDistribution(); + + /** + * The meta object literal for the 'Boolean Parameter' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BOOLEAN_PARAMETER = eINSTANCE.getDocumentRoot_BooleanParameter(); + + /** + * The meta object literal for the 'BP Sim Data' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BP_SIM_DATA = eINSTANCE.getDocumentRoot_BPSimData(); + + /** + * The meta object literal for the 'Date Time Parameter' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DATE_TIME_PARAMETER = eINSTANCE.getDocumentRoot_DateTimeParameter(); + + /** + * The meta object literal for the 'Duration Parameter' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DURATION_PARAMETER = eINSTANCE.getDocumentRoot_DurationParameter(); + + /** + * The meta object literal for the 'Enum Parameter' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__ENUM_PARAMETER = eINSTANCE.getDocumentRoot_EnumParameter(); + + /** + * The meta object literal for the 'Erlang Distribution' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__ERLANG_DISTRIBUTION = eINSTANCE.getDocumentRoot_ErlangDistribution(); + + /** + * The meta object literal for the 'Expression Parameter' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__EXPRESSION_PARAMETER = eINSTANCE.getDocumentRoot_ExpressionParameter(); + + /** + * The meta object literal for the 'Floating Parameter' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__FLOATING_PARAMETER = eINSTANCE.getDocumentRoot_FloatingParameter(); + + /** + * The meta object literal for the 'Gamma Distribution' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__GAMMA_DISTRIBUTION = eINSTANCE.getDocumentRoot_GammaDistribution(); + + /** + * The meta object literal for the 'Log Normal Distribution' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__LOG_NORMAL_DISTRIBUTION = eINSTANCE.getDocumentRoot_LogNormalDistribution(); + + /** + * The meta object literal for the 'Negative Exponential Distribution' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__NEGATIVE_EXPONENTIAL_DISTRIBUTION = eINSTANCE.getDocumentRoot_NegativeExponentialDistribution(); + + /** + * The meta object literal for the 'Normal Distribution' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__NORMAL_DISTRIBUTION = eINSTANCE.getDocumentRoot_NormalDistribution(); + + /** + * The meta object literal for the 'Numeric Parameter' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__NUMERIC_PARAMETER = eINSTANCE.getDocumentRoot_NumericParameter(); + + /** + * The meta object literal for the 'Poisson Distribution' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__POISSON_DISTRIBUTION = eINSTANCE.getDocumentRoot_PoissonDistribution(); + + /** + * The meta object literal for the 'String Parameter' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__STRING_PARAMETER = eINSTANCE.getDocumentRoot_StringParameter(); + + /** + * The meta object literal for the 'Triangular Distribution' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__TRIANGULAR_DISTRIBUTION = eINSTANCE.getDocumentRoot_TriangularDistribution(); + + /** + * The meta object literal for the 'Truncated Normal Distribution' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__TRUNCATED_NORMAL_DISTRIBUTION = eINSTANCE.getDocumentRoot_TruncatedNormalDistribution(); + + /** + * The meta object literal for the 'Uniform Distribution' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__UNIFORM_DISTRIBUTION = eINSTANCE.getDocumentRoot_UniformDistribution(); + + /** + * The meta object literal for the 'User Distribution' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__USER_DISTRIBUTION = eINSTANCE.getDocumentRoot_UserDistribution(); + + /** + * The meta object literal for the 'User Distribution Data Point' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__USER_DISTRIBUTION_DATA_POINT = eINSTANCE.getDocumentRoot_UserDistributionDataPoint(); + + /** + * The meta object literal for the 'Weibull Distribution' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__WEIBULL_DISTRIBUTION = eINSTANCE.getDocumentRoot_WeibullDistribution(); + + /** + * The meta object literal for the '{@link bpsim.impl.DurationParameterTypeImpl Duration Parameter Type}' class. + * + * + * @see bpsim.impl.DurationParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getDurationParameterType() + * @generated + */ + EClass DURATION_PARAMETER_TYPE = eINSTANCE.getDurationParameterType(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute DURATION_PARAMETER_TYPE__VALUE = eINSTANCE.getDurationParameterType_Value(); + + /** + * The meta object literal for the '{@link bpsim.impl.ElementParametersImpl Element Parameters}' class. + * + * + * @see bpsim.impl.ElementParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getElementParameters() + * @generated + */ + EClass ELEMENT_PARAMETERS = eINSTANCE.getElementParameters(); + + /** + * The meta object literal for the 'Time Parameters' containment reference feature. + * + * + * @generated + */ + EReference ELEMENT_PARAMETERS__TIME_PARAMETERS = eINSTANCE.getElementParameters_TimeParameters(); + + /** + * The meta object literal for the 'Control Parameters' containment reference feature. + * + * + * @generated + */ + EReference ELEMENT_PARAMETERS__CONTROL_PARAMETERS = eINSTANCE.getElementParameters_ControlParameters(); + + /** + * The meta object literal for the 'Resource Parameters' containment reference feature. + * + * + * @generated + */ + EReference ELEMENT_PARAMETERS__RESOURCE_PARAMETERS = eINSTANCE.getElementParameters_ResourceParameters(); + + /** + * The meta object literal for the 'Priority Parameters' containment reference feature. + * + * + * @generated + */ + EReference ELEMENT_PARAMETERS__PRIORITY_PARAMETERS = eINSTANCE.getElementParameters_PriorityParameters(); + + /** + * The meta object literal for the 'Cost Parameters' containment reference feature. + * + * + * @generated + */ + EReference ELEMENT_PARAMETERS__COST_PARAMETERS = eINSTANCE.getElementParameters_CostParameters(); + + /** + * The meta object literal for the 'Property Parameters' containment reference feature. + * + * + * @generated + */ + EReference ELEMENT_PARAMETERS__PROPERTY_PARAMETERS = eINSTANCE.getElementParameters_PropertyParameters(); + + /** + * The meta object literal for the 'Vendor Extension' containment reference list feature. + * + * + * @generated + */ + EReference ELEMENT_PARAMETERS__VENDOR_EXTENSION = eINSTANCE.getElementParameters_VendorExtension(); + + /** + * The meta object literal for the 'Element Ref' attribute feature. + * + * + * @generated + */ + EAttribute ELEMENT_PARAMETERS__ELEMENT_REF = eINSTANCE.getElementParameters_ElementRef(); + + /** + * The meta object literal for the 'Id' attribute feature. + * + * + * @generated + */ + EAttribute ELEMENT_PARAMETERS__ID = eINSTANCE.getElementParameters_Id(); + + /** + * The meta object literal for the '{@link bpsim.impl.ElementParametersTypeImpl Element Parameters Type}' class. + * + * + * @see bpsim.impl.ElementParametersTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getElementParametersType() + * @generated + */ + EClass ELEMENT_PARAMETERS_TYPE = eINSTANCE.getElementParametersType(); + + /** + * The meta object literal for the '{@link bpsim.impl.EnumParameterTypeImpl Enum Parameter Type}' class. + * + * + * @see bpsim.impl.EnumParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getEnumParameterType() + * @generated + */ + EClass ENUM_PARAMETER_TYPE = eINSTANCE.getEnumParameterType(); + + /** + * The meta object literal for the 'Group' attribute list feature. + * + * + * @generated + */ + EAttribute ENUM_PARAMETER_TYPE__GROUP = eINSTANCE.getEnumParameterType_Group(); + + /** + * The meta object literal for the 'Parameter Value Group' attribute list feature. + * + * + * @generated + */ + EAttribute ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP = eINSTANCE.getEnumParameterType_ParameterValueGroup(); + + /** + * The meta object literal for the 'Parameter Value' containment reference list feature. + * + * + * @generated + */ + EReference ENUM_PARAMETER_TYPE__PARAMETER_VALUE = eINSTANCE.getEnumParameterType_ParameterValue(); + + /** + * The meta object literal for the '{@link bpsim.impl.ErlangDistributionTypeImpl Erlang Distribution Type}' class. + * + * + * @see bpsim.impl.ErlangDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getErlangDistributionType() + * @generated + */ + EClass ERLANG_DISTRIBUTION_TYPE = eINSTANCE.getErlangDistributionType(); + + /** + * The meta object literal for the 'K' attribute feature. + * + * + * @generated + */ + EAttribute ERLANG_DISTRIBUTION_TYPE__K = eINSTANCE.getErlangDistributionType_K(); + + /** + * The meta object literal for the 'Mean' attribute feature. + * + * + * @generated + */ + EAttribute ERLANG_DISTRIBUTION_TYPE__MEAN = eINSTANCE.getErlangDistributionType_Mean(); + + /** + * The meta object literal for the '{@link bpsim.impl.ExpressionParameterTypeImpl Expression Parameter Type}' class. + * + * + * @see bpsim.impl.ExpressionParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getExpressionParameterType() + * @generated + */ + EClass EXPRESSION_PARAMETER_TYPE = eINSTANCE.getExpressionParameterType(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute EXPRESSION_PARAMETER_TYPE__VALUE = eINSTANCE.getExpressionParameterType_Value(); + + /** + * The meta object literal for the '{@link bpsim.impl.FloatingParameterTypeImpl Floating Parameter Type}' class. + * + * + * @see bpsim.impl.FloatingParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getFloatingParameterType() + * @generated + */ + EClass FLOATING_PARAMETER_TYPE = eINSTANCE.getFloatingParameterType(); + + /** + * The meta object literal for the 'Currency Unit' attribute feature. + * + * + * @generated + */ + EAttribute FLOATING_PARAMETER_TYPE__CURRENCY_UNIT = eINSTANCE.getFloatingParameterType_CurrencyUnit(); + + /** + * The meta object literal for the 'Time Unit' attribute feature. + * + * + * @generated + */ + EAttribute FLOATING_PARAMETER_TYPE__TIME_UNIT = eINSTANCE.getFloatingParameterType_TimeUnit(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute FLOATING_PARAMETER_TYPE__VALUE = eINSTANCE.getFloatingParameterType_Value(); + + /** + * The meta object literal for the '{@link bpsim.impl.GammaDistributionTypeImpl Gamma Distribution Type}' class. + * + * + * @see bpsim.impl.GammaDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getGammaDistributionType() + * @generated + */ + EClass GAMMA_DISTRIBUTION_TYPE = eINSTANCE.getGammaDistributionType(); + + /** + * The meta object literal for the 'Scale' attribute feature. + * + * + * @generated + */ + EAttribute GAMMA_DISTRIBUTION_TYPE__SCALE = eINSTANCE.getGammaDistributionType_Scale(); + + /** + * The meta object literal for the 'Shape' attribute feature. + * + * + * @generated + */ + EAttribute GAMMA_DISTRIBUTION_TYPE__SHAPE = eINSTANCE.getGammaDistributionType_Shape(); + + /** + * The meta object literal for the '{@link bpsim.impl.LogNormalDistributionTypeImpl Log Normal Distribution Type}' class. + * + * + * @see bpsim.impl.LogNormalDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getLogNormalDistributionType() + * @generated + */ + EClass LOG_NORMAL_DISTRIBUTION_TYPE = eINSTANCE.getLogNormalDistributionType(); + + /** + * The meta object literal for the 'Mean' attribute feature. + * + * + * @generated + */ + EAttribute LOG_NORMAL_DISTRIBUTION_TYPE__MEAN = eINSTANCE.getLogNormalDistributionType_Mean(); + + /** + * The meta object literal for the 'Standard Deviation' attribute feature. + * + * + * @generated + */ + EAttribute LOG_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION = eINSTANCE.getLogNormalDistributionType_StandardDeviation(); + + /** + * The meta object literal for the '{@link bpsim.impl.NegativeExponentialDistributionTypeImpl Negative Exponential Distribution Type}' class. + * + * + * @see bpsim.impl.NegativeExponentialDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getNegativeExponentialDistributionType() + * @generated + */ + EClass NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE = eINSTANCE.getNegativeExponentialDistributionType(); + + /** + * The meta object literal for the 'Mean' attribute feature. + * + * + * @generated + */ + EAttribute NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__MEAN = eINSTANCE.getNegativeExponentialDistributionType_Mean(); + + /** + * The meta object literal for the '{@link bpsim.impl.NormalDistributionTypeImpl Normal Distribution Type}' class. + * + * + * @see bpsim.impl.NormalDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getNormalDistributionType() + * @generated + */ + EClass NORMAL_DISTRIBUTION_TYPE = eINSTANCE.getNormalDistributionType(); + + /** + * The meta object literal for the 'Mean' attribute feature. + * + * + * @generated + */ + EAttribute NORMAL_DISTRIBUTION_TYPE__MEAN = eINSTANCE.getNormalDistributionType_Mean(); + + /** + * The meta object literal for the 'Standard Deviation' attribute feature. + * + * + * @generated + */ + EAttribute NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION = eINSTANCE.getNormalDistributionType_StandardDeviation(); + + /** + * The meta object literal for the '{@link bpsim.impl.NumericParameterTypeImpl Numeric Parameter Type}' class. + * + * + * @see bpsim.impl.NumericParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getNumericParameterType() + * @generated + */ + EClass NUMERIC_PARAMETER_TYPE = eINSTANCE.getNumericParameterType(); + + /** + * The meta object literal for the 'Currency Unit' attribute feature. + * + * + * @generated + */ + EAttribute NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT = eINSTANCE.getNumericParameterType_CurrencyUnit(); + + /** + * The meta object literal for the 'Time Unit' attribute feature. + * + * + * @generated + */ + EAttribute NUMERIC_PARAMETER_TYPE__TIME_UNIT = eINSTANCE.getNumericParameterType_TimeUnit(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute NUMERIC_PARAMETER_TYPE__VALUE = eINSTANCE.getNumericParameterType_Value(); + + /** + * The meta object literal for the '{@link bpsim.impl.ParameterImpl Parameter}' class. + * + * + * @see bpsim.impl.ParameterImpl + * @see bpsim.impl.BpsimPackageImpl#getParameter() + * @generated + */ + EClass PARAMETER = eINSTANCE.getParameter(); + + /** + * The meta object literal for the 'Result Request' attribute list feature. + * + * + * @generated + */ + EAttribute PARAMETER__RESULT_REQUEST = eINSTANCE.getParameter_ResultRequest(); + + /** + * The meta object literal for the 'Parameter Value Group' attribute list feature. + * + * + * @generated + */ + EAttribute PARAMETER__PARAMETER_VALUE_GROUP = eINSTANCE.getParameter_ParameterValueGroup(); + + /** + * The meta object literal for the 'Parameter Value' containment reference list feature. + * + * + * @generated + */ + EReference PARAMETER__PARAMETER_VALUE = eINSTANCE.getParameter_ParameterValue(); + + /** + * The meta object literal for the 'Kpi' attribute feature. + * + * + * @generated + */ + EAttribute PARAMETER__KPI = eINSTANCE.getParameter_Kpi(); + + /** + * The meta object literal for the 'Sla' attribute feature. + * + * + * @generated + */ + EAttribute PARAMETER__SLA = eINSTANCE.getParameter_Sla(); + + /** + * The meta object literal for the '{@link bpsim.impl.ParameterValueImpl Parameter Value}' class. + * + * + * @see bpsim.impl.ParameterValueImpl + * @see bpsim.impl.BpsimPackageImpl#getParameterValue() + * @generated + */ + EClass PARAMETER_VALUE = eINSTANCE.getParameterValue(); + + /** + * The meta object literal for the 'Instance' attribute feature. + * + * + * @generated + */ + EAttribute PARAMETER_VALUE__INSTANCE = eINSTANCE.getParameterValue_Instance(); + + /** + * The meta object literal for the 'Result' attribute feature. + * + * + * @generated + */ + EAttribute PARAMETER_VALUE__RESULT = eINSTANCE.getParameterValue_Result(); + + /** + * The meta object literal for the 'Valid For' attribute feature. + * + * + * @generated + */ + EAttribute PARAMETER_VALUE__VALID_FOR = eINSTANCE.getParameterValue_ValidFor(); + + /** + * The meta object literal for the '{@link bpsim.impl.PoissonDistributionTypeImpl Poisson Distribution Type}' class. + * + * + * @see bpsim.impl.PoissonDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getPoissonDistributionType() + * @generated + */ + EClass POISSON_DISTRIBUTION_TYPE = eINSTANCE.getPoissonDistributionType(); + + /** + * The meta object literal for the 'Mean' attribute feature. + * + * + * @generated + */ + EAttribute POISSON_DISTRIBUTION_TYPE__MEAN = eINSTANCE.getPoissonDistributionType_Mean(); + + /** + * The meta object literal for the '{@link bpsim.impl.PriorityParametersImpl Priority Parameters}' class. + * + * + * @see bpsim.impl.PriorityParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getPriorityParameters() + * @generated + */ + EClass PRIORITY_PARAMETERS = eINSTANCE.getPriorityParameters(); + + /** + * The meta object literal for the 'Interruptible' containment reference feature. + * + * + * @generated + */ + EReference PRIORITY_PARAMETERS__INTERRUPTIBLE = eINSTANCE.getPriorityParameters_Interruptible(); + + /** + * The meta object literal for the 'Priority' containment reference feature. + * + * + * @generated + */ + EReference PRIORITY_PARAMETERS__PRIORITY = eINSTANCE.getPriorityParameters_Priority(); + + /** + * The meta object literal for the '{@link bpsim.impl.PropertyParametersImpl Property Parameters}' class. + * + * + * @see bpsim.impl.PropertyParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getPropertyParameters() + * @generated + */ + EClass PROPERTY_PARAMETERS = eINSTANCE.getPropertyParameters(); + + /** + * The meta object literal for the 'Property' containment reference list feature. + * + * + * @generated + */ + EReference PROPERTY_PARAMETERS__PROPERTY = eINSTANCE.getPropertyParameters_Property(); + + /** + * The meta object literal for the '{@link bpsim.impl.PropertyTypeImpl Property Type}' class. + * + * + * @see bpsim.impl.PropertyTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getPropertyType() + * @generated + */ + EClass PROPERTY_TYPE = eINSTANCE.getPropertyType(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute PROPERTY_TYPE__NAME = eINSTANCE.getPropertyType_Name(); + + /** + * The meta object literal for the '{@link bpsim.impl.ResourceParametersImpl Resource Parameters}' class. + * + * + * @see bpsim.impl.ResourceParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getResourceParameters() + * @generated + */ + EClass RESOURCE_PARAMETERS = eINSTANCE.getResourceParameters(); + + /** + * The meta object literal for the 'Selection' containment reference feature. + * + * + * @generated + */ + EReference RESOURCE_PARAMETERS__SELECTION = eINSTANCE.getResourceParameters_Selection(); + + /** + * The meta object literal for the 'Availability' containment reference feature. + * + * + * @generated + */ + EReference RESOURCE_PARAMETERS__AVAILABILITY = eINSTANCE.getResourceParameters_Availability(); + + /** + * The meta object literal for the 'Quantity' containment reference feature. + * + * + * @generated + */ + EReference RESOURCE_PARAMETERS__QUANTITY = eINSTANCE.getResourceParameters_Quantity(); + + /** + * The meta object literal for the 'Role' containment reference list feature. + * + * + * @generated + */ + EReference RESOURCE_PARAMETERS__ROLE = eINSTANCE.getResourceParameters_Role(); + + /** + * The meta object literal for the '{@link bpsim.impl.ScenarioImpl Scenario}' class. + * + * + * @see bpsim.impl.ScenarioImpl + * @see bpsim.impl.BpsimPackageImpl#getScenario() + * @generated + */ + EClass SCENARIO = eINSTANCE.getScenario(); + + /** + * The meta object literal for the 'Scenario Parameters' containment reference feature. + * + * + * @generated + */ + EReference SCENARIO__SCENARIO_PARAMETERS = eINSTANCE.getScenario_ScenarioParameters(); + + /** + * The meta object literal for the 'Element Parameters' containment reference list feature. + * + * + * @generated + */ + EReference SCENARIO__ELEMENT_PARAMETERS = eINSTANCE.getScenario_ElementParameters(); + + /** + * The meta object literal for the 'Calendar' containment reference list feature. + * + * + * @generated + */ + EReference SCENARIO__CALENDAR = eINSTANCE.getScenario_Calendar(); + + /** + * The meta object literal for the 'Vendor Extension' containment reference list feature. + * + * + * @generated + */ + EReference SCENARIO__VENDOR_EXTENSION = eINSTANCE.getScenario_VendorExtension(); + + /** + * The meta object literal for the 'Author' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO__AUTHOR = eINSTANCE.getScenario_Author(); + + /** + * The meta object literal for the 'Created' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO__CREATED = eINSTANCE.getScenario_Created(); + + /** + * The meta object literal for the 'Description' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO__DESCRIPTION = eINSTANCE.getScenario_Description(); + + /** + * The meta object literal for the 'Id' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO__ID = eINSTANCE.getScenario_Id(); + + /** + * The meta object literal for the 'Inherits' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO__INHERITS = eINSTANCE.getScenario_Inherits(); + + /** + * The meta object literal for the 'Modified' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO__MODIFIED = eINSTANCE.getScenario_Modified(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO__NAME = eINSTANCE.getScenario_Name(); + + /** + * The meta object literal for the 'Result' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO__RESULT = eINSTANCE.getScenario_Result(); + + /** + * The meta object literal for the 'Vendor' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO__VENDOR = eINSTANCE.getScenario_Vendor(); + + /** + * The meta object literal for the 'Version' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO__VERSION = eINSTANCE.getScenario_Version(); + + /** + * The meta object literal for the '{@link bpsim.impl.ScenarioParametersImpl Scenario Parameters}' class. + * + * + * @see bpsim.impl.ScenarioParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getScenarioParameters() + * @generated + */ + EClass SCENARIO_PARAMETERS = eINSTANCE.getScenarioParameters(); + + /** + * The meta object literal for the 'Start' containment reference feature. + * + * + * @generated + */ + EReference SCENARIO_PARAMETERS__START = eINSTANCE.getScenarioParameters_Start(); + + /** + * The meta object literal for the 'Duration' containment reference feature. + * + * + * @generated + */ + EReference SCENARIO_PARAMETERS__DURATION = eINSTANCE.getScenarioParameters_Duration(); + + /** + * The meta object literal for the 'Property Parameters' containment reference feature. + * + * + * @generated + */ + EReference SCENARIO_PARAMETERS__PROPERTY_PARAMETERS = eINSTANCE.getScenarioParameters_PropertyParameters(); + + /** + * The meta object literal for the 'Base Currency Unit' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO_PARAMETERS__BASE_CURRENCY_UNIT = eINSTANCE.getScenarioParameters_BaseCurrencyUnit(); + + /** + * The meta object literal for the 'Base Time Unit' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO_PARAMETERS__BASE_TIME_UNIT = eINSTANCE.getScenarioParameters_BaseTimeUnit(); + + /** + * The meta object literal for the 'Replication' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO_PARAMETERS__REPLICATION = eINSTANCE.getScenarioParameters_Replication(); + + /** + * The meta object literal for the 'Seed' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO_PARAMETERS__SEED = eINSTANCE.getScenarioParameters_Seed(); + + /** + * The meta object literal for the '{@link bpsim.impl.ScenarioParametersTypeImpl Scenario Parameters Type}' class. + * + * + * @see bpsim.impl.ScenarioParametersTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getScenarioParametersType() + * @generated + */ + EClass SCENARIO_PARAMETERS_TYPE = eINSTANCE.getScenarioParametersType(); + + /** + * The meta object literal for the '{@link bpsim.impl.StringParameterTypeImpl String Parameter Type}' class. + * + * + * @see bpsim.impl.StringParameterTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getStringParameterType() + * @generated + */ + EClass STRING_PARAMETER_TYPE = eINSTANCE.getStringParameterType(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute STRING_PARAMETER_TYPE__VALUE = eINSTANCE.getStringParameterType_Value(); + + /** + * The meta object literal for the '{@link bpsim.impl.TimeParametersImpl Time Parameters}' class. + * + * + * @see bpsim.impl.TimeParametersImpl + * @see bpsim.impl.BpsimPackageImpl#getTimeParameters() + * @generated + */ + EClass TIME_PARAMETERS = eINSTANCE.getTimeParameters(); + + /** + * The meta object literal for the 'Transfer Time' containment reference feature. + * + * + * @generated + */ + EReference TIME_PARAMETERS__TRANSFER_TIME = eINSTANCE.getTimeParameters_TransferTime(); + + /** + * The meta object literal for the 'Queue Time' containment reference feature. + * + * + * @generated + */ + EReference TIME_PARAMETERS__QUEUE_TIME = eINSTANCE.getTimeParameters_QueueTime(); + + /** + * The meta object literal for the 'Wait Time' containment reference feature. + * + * + * @generated + */ + EReference TIME_PARAMETERS__WAIT_TIME = eINSTANCE.getTimeParameters_WaitTime(); + + /** + * The meta object literal for the 'Set Up Time' containment reference feature. + * + * + * @generated + */ + EReference TIME_PARAMETERS__SET_UP_TIME = eINSTANCE.getTimeParameters_SetUpTime(); + + /** + * The meta object literal for the 'Processing Time' containment reference feature. + * + * + * @generated + */ + EReference TIME_PARAMETERS__PROCESSING_TIME = eINSTANCE.getTimeParameters_ProcessingTime(); + + /** + * The meta object literal for the 'Validation Time' containment reference feature. + * + * + * @generated + */ + EReference TIME_PARAMETERS__VALIDATION_TIME = eINSTANCE.getTimeParameters_ValidationTime(); + + /** + * The meta object literal for the 'Rework Time' containment reference feature. + * + * + * @generated + */ + EReference TIME_PARAMETERS__REWORK_TIME = eINSTANCE.getTimeParameters_ReworkTime(); + + /** + * The meta object literal for the '{@link bpsim.impl.TriangularDistributionTypeImpl Triangular Distribution Type}' class. + * + * + * @see bpsim.impl.TriangularDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getTriangularDistributionType() + * @generated + */ + EClass TRIANGULAR_DISTRIBUTION_TYPE = eINSTANCE.getTriangularDistributionType(); + + /** + * The meta object literal for the 'Max' attribute feature. + * + * + * @generated + */ + EAttribute TRIANGULAR_DISTRIBUTION_TYPE__MAX = eINSTANCE.getTriangularDistributionType_Max(); + + /** + * The meta object literal for the 'Min' attribute feature. + * + * + * @generated + */ + EAttribute TRIANGULAR_DISTRIBUTION_TYPE__MIN = eINSTANCE.getTriangularDistributionType_Min(); + + /** + * The meta object literal for the 'Mode' attribute feature. + * + * + * @generated + */ + EAttribute TRIANGULAR_DISTRIBUTION_TYPE__MODE = eINSTANCE.getTriangularDistributionType_Mode(); + + /** + * The meta object literal for the '{@link bpsim.impl.TruncatedNormalDistributionTypeImpl Truncated Normal Distribution Type}' class. + * + * + * @see bpsim.impl.TruncatedNormalDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getTruncatedNormalDistributionType() + * @generated + */ + EClass TRUNCATED_NORMAL_DISTRIBUTION_TYPE = eINSTANCE.getTruncatedNormalDistributionType(); + + /** + * The meta object literal for the 'Max' attribute feature. + * + * + * @generated + */ + EAttribute TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MAX = eINSTANCE.getTruncatedNormalDistributionType_Max(); + + /** + * The meta object literal for the 'Mean' attribute feature. + * + * + * @generated + */ + EAttribute TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MEAN = eINSTANCE.getTruncatedNormalDistributionType_Mean(); + + /** + * The meta object literal for the 'Min' attribute feature. + * + * + * @generated + */ + EAttribute TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MIN = eINSTANCE.getTruncatedNormalDistributionType_Min(); + + /** + * The meta object literal for the 'Standard Deviation' attribute feature. + * + * + * @generated + */ + EAttribute TRUNCATED_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION = eINSTANCE.getTruncatedNormalDistributionType_StandardDeviation(); + + /** + * The meta object literal for the '{@link bpsim.impl.UniformDistributionTypeImpl Uniform Distribution Type}' class. + * + * + * @see bpsim.impl.UniformDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getUniformDistributionType() + * @generated + */ + EClass UNIFORM_DISTRIBUTION_TYPE = eINSTANCE.getUniformDistributionType(); + + /** + * The meta object literal for the 'Max' attribute feature. + * + * + * @generated + */ + EAttribute UNIFORM_DISTRIBUTION_TYPE__MAX = eINSTANCE.getUniformDistributionType_Max(); + + /** + * The meta object literal for the 'Min' attribute feature. + * + * + * @generated + */ + EAttribute UNIFORM_DISTRIBUTION_TYPE__MIN = eINSTANCE.getUniformDistributionType_Min(); + + /** + * The meta object literal for the '{@link bpsim.impl.UserDistributionDataPointTypeImpl User Distribution Data Point Type}' class. + * + * + * @see bpsim.impl.UserDistributionDataPointTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getUserDistributionDataPointType() + * @generated + */ + EClass USER_DISTRIBUTION_DATA_POINT_TYPE = eINSTANCE.getUserDistributionDataPointType(); + + /** + * The meta object literal for the 'Parameter Value Group' attribute list feature. + * + * + * @generated + */ + EAttribute USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE_GROUP = eINSTANCE.getUserDistributionDataPointType_ParameterValueGroup(); + + /** + * The meta object literal for the 'Parameter Value' containment reference feature. + * + * + * @generated + */ + EReference USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE = eINSTANCE.getUserDistributionDataPointType_ParameterValue(); + + /** + * The meta object literal for the 'Probability' attribute feature. + * + * + * @generated + */ + EAttribute USER_DISTRIBUTION_DATA_POINT_TYPE__PROBABILITY = eINSTANCE.getUserDistributionDataPointType_Probability(); + + /** + * The meta object literal for the '{@link bpsim.impl.UserDistributionTypeImpl User Distribution Type}' class. + * + * + * @see bpsim.impl.UserDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getUserDistributionType() + * @generated + */ + EClass USER_DISTRIBUTION_TYPE = eINSTANCE.getUserDistributionType(); + + /** + * The meta object literal for the 'Group' attribute list feature. + * + * + * @generated + */ + EAttribute USER_DISTRIBUTION_TYPE__GROUP = eINSTANCE.getUserDistributionType_Group(); + + /** + * The meta object literal for the 'User Distribution Data Point' containment reference list feature. + * + * + * @generated + */ + EReference USER_DISTRIBUTION_TYPE__USER_DISTRIBUTION_DATA_POINT = eINSTANCE.getUserDistributionType_UserDistributionDataPoint(); + + /** + * The meta object literal for the 'Discrete' attribute feature. + * + * + * @generated + */ + EAttribute USER_DISTRIBUTION_TYPE__DISCRETE = eINSTANCE.getUserDistributionType_Discrete(); + + /** + * The meta object literal for the '{@link bpsim.impl.VendorExtensionImpl Vendor Extension}' class. + * + * + * @see bpsim.impl.VendorExtensionImpl + * @see bpsim.impl.BpsimPackageImpl#getVendorExtension() + * @generated + */ + EClass VENDOR_EXTENSION = eINSTANCE.getVendorExtension(); + + /** + * The meta object literal for the 'Any' attribute list feature. + * + * + * @generated + */ + EAttribute VENDOR_EXTENSION__ANY = eINSTANCE.getVendorExtension_Any(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute VENDOR_EXTENSION__NAME = eINSTANCE.getVendorExtension_Name(); + + /** + * The meta object literal for the 'Any Attribute' attribute list feature. + * + * + * @generated + */ + EAttribute VENDOR_EXTENSION__ANY_ATTRIBUTE = eINSTANCE.getVendorExtension_AnyAttribute(); + + /** + * The meta object literal for the '{@link bpsim.impl.WeibullDistributionTypeImpl Weibull Distribution Type}' class. + * + * + * @see bpsim.impl.WeibullDistributionTypeImpl + * @see bpsim.impl.BpsimPackageImpl#getWeibullDistributionType() + * @generated + */ + EClass WEIBULL_DISTRIBUTION_TYPE = eINSTANCE.getWeibullDistributionType(); + + /** + * The meta object literal for the 'Scale' attribute feature. + * + * + * @generated + */ + EAttribute WEIBULL_DISTRIBUTION_TYPE__SCALE = eINSTANCE.getWeibullDistributionType_Scale(); + + /** + * The meta object literal for the 'Shape' attribute feature. + * + * + * @generated + */ + EAttribute WEIBULL_DISTRIBUTION_TYPE__SHAPE = eINSTANCE.getWeibullDistributionType_Shape(); + + /** + * The meta object literal for the '{@link bpsim.ResultType Result Type}' enum. + * + * + * @see bpsim.ResultType + * @see bpsim.impl.BpsimPackageImpl#getResultType() + * @generated + */ + EEnum RESULT_TYPE = eINSTANCE.getResultType(); + + /** + * The meta object literal for the '{@link bpsim.TimeUnit Time Unit}' enum. + * + * + * @see bpsim.TimeUnit + * @see bpsim.impl.BpsimPackageImpl#getTimeUnit() + * @generated + */ + EEnum TIME_UNIT = eINSTANCE.getTimeUnit(); + + /** + * The meta object literal for the 'Result Type Object' data type. + * + * + * @see bpsim.ResultType + * @see bpsim.impl.BpsimPackageImpl#getResultTypeObject() + * @generated + */ + EDataType RESULT_TYPE_OBJECT = eINSTANCE.getResultTypeObject(); + + /** + * The meta object literal for the 'Time Unit Object' data type. + * + * + * @see bpsim.TimeUnit + * @see bpsim.impl.BpsimPackageImpl#getTimeUnitObject() + * @generated + */ + EDataType TIME_UNIT_OBJECT = eINSTANCE.getTimeUnitObject(); + + } + +} //BpsimPackage diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/Calendar.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/Calendar.java new file mode 100644 index 00000000000..415cbf5d148 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/Calendar.java @@ -0,0 +1,95 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Calendar'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.Calendar#getValue Value}
  • + *
  • {@link bpsim.Calendar#getId Id}
  • + *
  • {@link bpsim.Calendar#getName Name}
  • + *
+ * + * @see bpsim.BpsimPackage#getCalendar() + * @model extendedMetaData="name='Calendar' kind='simple'" + * @generated + */ +public interface Calendar extends EObject { + /** + * Returns the value of the 'Value' attribute. + * + * + * @return the value of the 'Value' attribute. + * @see #setValue(String) + * @see bpsim.BpsimPackage#getCalendar_Value() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="name=':0' kind='simple'" + * @generated + */ + String getValue(); + + /** + * Sets the value of the '{@link bpsim.Calendar#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(String value); + + /** + * Returns the value of the 'Id' attribute. + * + * + * @return the value of the 'Id' attribute. + * @see #setId(String) + * @see bpsim.BpsimPackage#getCalendar_Id() + * @model id="true" dataType="org.eclipse.emf.ecore.xml.type.ID" + * extendedMetaData="kind='attribute' name='id'" + * @generated + */ + String getId(); + + /** + * Sets the value of the '{@link bpsim.Calendar#getId Id}' attribute. + * + * + * @param value the new value of the 'Id' attribute. + * @see #getId() + * @generated + */ + void setId(String value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see bpsim.BpsimPackage#getCalendar_Name() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link bpsim.Calendar#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // Calendar diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ConstantParameter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ConstantParameter.java new file mode 100644 index 00000000000..afb942019b9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ConstantParameter.java @@ -0,0 +1,17 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Constant Parameter'. + * + * + * + * @see bpsim.BpsimPackage#getConstantParameter() + * @model extendedMetaData="name='ConstantParameter' kind='empty'" + * @generated + */ +public interface ConstantParameter extends ParameterValue { +} // ConstantParameter diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ControlParameters.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ControlParameters.java new file mode 100644 index 00000000000..fe45acdb902 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ControlParameters.java @@ -0,0 +1,119 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Control Parameters'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.ControlParameters#getProbability Probability}
  • + *
  • {@link bpsim.ControlParameters#getCondition Condition}
  • + *
  • {@link bpsim.ControlParameters#getInterTriggerTimer Inter Trigger Timer}
  • + *
  • {@link bpsim.ControlParameters#getTriggerCount Trigger Count}
  • + *
+ * + * @see bpsim.BpsimPackage#getControlParameters() + * @model extendedMetaData="name='ControlParameters' kind='elementOnly'" + * @generated + */ +public interface ControlParameters extends EObject { + /** + * Returns the value of the 'Probability' containment reference. + * + * + * @return the value of the 'Probability' containment reference. + * @see #setProbability(Parameter) + * @see bpsim.BpsimPackage#getControlParameters_Probability() + * @model containment="true" + * extendedMetaData="kind='element' name='Probability' namespace='##targetNamespace'" + * @generated + */ + Parameter getProbability(); + + /** + * Sets the value of the '{@link bpsim.ControlParameters#getProbability Probability}' containment reference. + * + * + * @param value the new value of the 'Probability' containment reference. + * @see #getProbability() + * @generated + */ + void setProbability(Parameter value); + + /** + * Returns the value of the 'Condition' containment reference. + * + * + * @return the value of the 'Condition' containment reference. + * @see #setCondition(Parameter) + * @see bpsim.BpsimPackage#getControlParameters_Condition() + * @model containment="true" + * extendedMetaData="kind='element' name='Condition' namespace='##targetNamespace'" + * @generated + */ + Parameter getCondition(); + + /** + * Sets the value of the '{@link bpsim.ControlParameters#getCondition Condition}' containment reference. + * + * + * @param value the new value of the 'Condition' containment reference. + * @see #getCondition() + * @generated + */ + void setCondition(Parameter value); + + /** + * Returns the value of the 'Inter Trigger Timer' containment reference. + * + * + * @return the value of the 'Inter Trigger Timer' containment reference. + * @see #setInterTriggerTimer(Parameter) + * @see bpsim.BpsimPackage#getControlParameters_InterTriggerTimer() + * @model containment="true" + * extendedMetaData="kind='element' name='InterTriggerTimer' namespace='##targetNamespace'" + * @generated + */ + Parameter getInterTriggerTimer(); + + /** + * Sets the value of the '{@link bpsim.ControlParameters#getInterTriggerTimer Inter Trigger Timer}' containment reference. + * + * + * @param value the new value of the 'Inter Trigger Timer' containment reference. + * @see #getInterTriggerTimer() + * @generated + */ + void setInterTriggerTimer(Parameter value); + + /** + * Returns the value of the 'Trigger Count' containment reference. + * + * + * @return the value of the 'Trigger Count' containment reference. + * @see #setTriggerCount(Parameter) + * @see bpsim.BpsimPackage#getControlParameters_TriggerCount() + * @model containment="true" + * extendedMetaData="kind='element' name='TriggerCount' namespace='##targetNamespace'" + * @generated + */ + Parameter getTriggerCount(); + + /** + * Sets the value of the '{@link bpsim.ControlParameters#getTriggerCount Trigger Count}' containment reference. + * + * + * @param value the new value of the 'Trigger Count' containment reference. + * @see #getTriggerCount() + * @generated + */ + void setTriggerCount(Parameter value); + +} // ControlParameters diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/CostParameters.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/CostParameters.java new file mode 100644 index 00000000000..3c5b1c19a1a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/CostParameters.java @@ -0,0 +1,71 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Cost Parameters'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.CostParameters#getFixedCost Fixed Cost}
  • + *
  • {@link bpsim.CostParameters#getUnitCost Unit Cost}
  • + *
+ * + * @see bpsim.BpsimPackage#getCostParameters() + * @model extendedMetaData="name='CostParameters' kind='elementOnly'" + * @generated + */ +public interface CostParameters extends EObject { + /** + * Returns the value of the 'Fixed Cost' containment reference. + * + * + * @return the value of the 'Fixed Cost' containment reference. + * @see #setFixedCost(Parameter) + * @see bpsim.BpsimPackage#getCostParameters_FixedCost() + * @model containment="true" + * extendedMetaData="kind='element' name='FixedCost' namespace='##targetNamespace'" + * @generated + */ + Parameter getFixedCost(); + + /** + * Sets the value of the '{@link bpsim.CostParameters#getFixedCost Fixed Cost}' containment reference. + * + * + * @param value the new value of the 'Fixed Cost' containment reference. + * @see #getFixedCost() + * @generated + */ + void setFixedCost(Parameter value); + + /** + * Returns the value of the 'Unit Cost' containment reference. + * + * + * @return the value of the 'Unit Cost' containment reference. + * @see #setUnitCost(Parameter) + * @see bpsim.BpsimPackage#getCostParameters_UnitCost() + * @model containment="true" + * extendedMetaData="kind='element' name='UnitCost' namespace='##targetNamespace'" + * @generated + */ + Parameter getUnitCost(); + + /** + * Sets the value of the '{@link bpsim.CostParameters#getUnitCost Unit Cost}' containment reference. + * + * + * @param value the new value of the 'Unit Cost' containment reference. + * @see #getUnitCost() + * @generated + */ + void setUnitCost(Parameter value); + +} // CostParameters diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/DateTimeParameterType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/DateTimeParameterType.java new file mode 100644 index 00000000000..b276f61f946 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/DateTimeParameterType.java @@ -0,0 +1,47 @@ +/** + */ +package bpsim; + +import javax.xml.datatype.XMLGregorianCalendar; + +/** + * + * A representation of the model object 'Date Time Parameter Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.DateTimeParameterType#getValue Value}
  • + *
+ * + * @see bpsim.BpsimPackage#getDateTimeParameterType() + * @model extendedMetaData="name='DateTimeParameter_._type' kind='empty'" + * @generated + */ +public interface DateTimeParameterType extends ConstantParameter { + /** + * Returns the value of the 'Value' attribute. + * + * + * @return the value of the 'Value' attribute. + * @see #setValue(XMLGregorianCalendar) + * @see bpsim.BpsimPackage#getDateTimeParameterType_Value() + * @model dataType="org.eclipse.emf.ecore.xml.type.DateTime" + * extendedMetaData="kind='attribute' name='value'" + * @generated + */ + XMLGregorianCalendar getValue(); + + /** + * Sets the value of the '{@link bpsim.DateTimeParameterType#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(XMLGregorianCalendar value); + +} // DateTimeParameterType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/DistributionParameter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/DistributionParameter.java new file mode 100644 index 00000000000..cc7b682369c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/DistributionParameter.java @@ -0,0 +1,100 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Distribution Parameter'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.DistributionParameter#getCurrencyUnit Currency Unit}
  • + *
  • {@link bpsim.DistributionParameter#getTimeUnit Time Unit}
  • + *
+ * + * @see bpsim.BpsimPackage#getDistributionParameter() + * @model extendedMetaData="name='DistributionParameter' kind='empty'" + * @generated + */ +public interface DistributionParameter extends ParameterValue { + /** + * Returns the value of the 'Currency Unit' attribute. + * + * + * @return the value of the 'Currency Unit' attribute. + * @see #setCurrencyUnit(String) + * @see bpsim.BpsimPackage#getDistributionParameter_CurrencyUnit() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='attribute' name='currencyUnit'" + * @generated + */ + String getCurrencyUnit(); + + /** + * Sets the value of the '{@link bpsim.DistributionParameter#getCurrencyUnit Currency Unit}' attribute. + * + * + * @param value the new value of the 'Currency Unit' attribute. + * @see #getCurrencyUnit() + * @generated + */ + void setCurrencyUnit(String value); + + /** + * Returns the value of the 'Time Unit' attribute. + * The literals are from the enumeration {@link bpsim.TimeUnit}. + * + * + * @return the value of the 'Time Unit' attribute. + * @see bpsim.TimeUnit + * @see #isSetTimeUnit() + * @see #unsetTimeUnit() + * @see #setTimeUnit(TimeUnit) + * @see bpsim.BpsimPackage#getDistributionParameter_TimeUnit() + * @model unsettable="true" + * extendedMetaData="kind='attribute' name='timeUnit'" + * @generated + */ + TimeUnit getTimeUnit(); + + /** + * Sets the value of the '{@link bpsim.DistributionParameter#getTimeUnit Time Unit}' attribute. + * + * + * @param value the new value of the 'Time Unit' attribute. + * @see bpsim.TimeUnit + * @see #isSetTimeUnit() + * @see #unsetTimeUnit() + * @see #getTimeUnit() + * @generated + */ + void setTimeUnit(TimeUnit value); + + /** + * Unsets the value of the '{@link bpsim.DistributionParameter#getTimeUnit Time Unit}' attribute. + * + * + * @see #isSetTimeUnit() + * @see #getTimeUnit() + * @see #setTimeUnit(TimeUnit) + * @generated + */ + void unsetTimeUnit(); + + /** + * Returns whether the value of the '{@link bpsim.DistributionParameter#getTimeUnit Time Unit}' attribute is set. + * + * + * @return whether the value of the 'Time Unit' attribute is set. + * @see #unsetTimeUnit() + * @see #getTimeUnit() + * @see #setTimeUnit(TimeUnit) + * @generated + */ + boolean isSetTimeUnit(); + +} // DistributionParameter diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/DocumentRoot.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/DocumentRoot.java new file mode 100644 index 00000000000..6677a01c75a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/DocumentRoot.java @@ -0,0 +1,647 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.common.util.EMap; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'Document Root'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.DocumentRoot#getMixed Mixed}
  • + *
  • {@link bpsim.DocumentRoot#getXMLNSPrefixMap XMLNS Prefix Map}
  • + *
  • {@link bpsim.DocumentRoot#getXSISchemaLocation XSI Schema Location}
  • + *
  • {@link bpsim.DocumentRoot#getBetaDistribution Beta Distribution}
  • + *
  • {@link bpsim.DocumentRoot#getParameterValue Parameter Value}
  • + *
  • {@link bpsim.DocumentRoot#getBinomialDistribution Binomial Distribution}
  • + *
  • {@link bpsim.DocumentRoot#getBooleanParameter Boolean Parameter}
  • + *
  • {@link bpsim.DocumentRoot#getBPSimData BP Sim Data}
  • + *
  • {@link bpsim.DocumentRoot#getDateTimeParameter Date Time Parameter}
  • + *
  • {@link bpsim.DocumentRoot#getDurationParameter Duration Parameter}
  • + *
  • {@link bpsim.DocumentRoot#getEnumParameter Enum Parameter}
  • + *
  • {@link bpsim.DocumentRoot#getErlangDistribution Erlang Distribution}
  • + *
  • {@link bpsim.DocumentRoot#getExpressionParameter Expression Parameter}
  • + *
  • {@link bpsim.DocumentRoot#getFloatingParameter Floating Parameter}
  • + *
  • {@link bpsim.DocumentRoot#getGammaDistribution Gamma Distribution}
  • + *
  • {@link bpsim.DocumentRoot#getLogNormalDistribution Log Normal Distribution}
  • + *
  • {@link bpsim.DocumentRoot#getNegativeExponentialDistribution Negative Exponential Distribution}
  • + *
  • {@link bpsim.DocumentRoot#getNormalDistribution Normal Distribution}
  • + *
  • {@link bpsim.DocumentRoot#getNumericParameter Numeric Parameter}
  • + *
  • {@link bpsim.DocumentRoot#getPoissonDistribution Poisson Distribution}
  • + *
  • {@link bpsim.DocumentRoot#getStringParameter String Parameter}
  • + *
  • {@link bpsim.DocumentRoot#getTriangularDistribution Triangular Distribution}
  • + *
  • {@link bpsim.DocumentRoot#getTruncatedNormalDistribution Truncated Normal Distribution}
  • + *
  • {@link bpsim.DocumentRoot#getUniformDistribution Uniform Distribution}
  • + *
  • {@link bpsim.DocumentRoot#getUserDistribution User Distribution}
  • + *
  • {@link bpsim.DocumentRoot#getUserDistributionDataPoint User Distribution Data Point}
  • + *
  • {@link bpsim.DocumentRoot#getWeibullDistribution Weibull Distribution}
  • + *
+ * + * @see bpsim.BpsimPackage#getDocumentRoot() + * @model extendedMetaData="name='' kind='mixed'" + * @generated + */ +public interface DocumentRoot extends EObject { + /** + * Returns the value of the 'Mixed' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Mixed' attribute list. + * @see bpsim.BpsimPackage#getDocumentRoot_Mixed() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='elementWildcard' name=':mixed'" + * @generated + */ + FeatureMap getMixed(); + + /** + * Returns the value of the 'XMLNS Prefix Map' map. + * The key is of type {@link java.lang.String}, + * and the value is of type {@link java.lang.String}, + * + * + * @return the value of the 'XMLNS Prefix Map' map. + * @see bpsim.BpsimPackage#getDocumentRoot_XMLNSPrefixMap() + * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>" transient="true" + * extendedMetaData="kind='attribute' name='xmlns:prefix'" + * @generated + */ + EMap getXMLNSPrefixMap(); + + /** + * Returns the value of the 'XSI Schema Location' map. + * The key is of type {@link java.lang.String}, + * and the value is of type {@link java.lang.String}, + * + * + * @return the value of the 'XSI Schema Location' map. + * @see bpsim.BpsimPackage#getDocumentRoot_XSISchemaLocation() + * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>" transient="true" + * extendedMetaData="kind='attribute' name='xsi:schemaLocation'" + * @generated + */ + EMap getXSISchemaLocation(); + + /** + * Returns the value of the 'Beta Distribution' containment reference. + * + * + * @return the value of the 'Beta Distribution' containment reference. + * @see #setBetaDistribution(BetaDistributionType) + * @see bpsim.BpsimPackage#getDocumentRoot_BetaDistribution() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='BetaDistribution' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + BetaDistributionType getBetaDistribution(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getBetaDistribution Beta Distribution}' containment reference. + * + * + * @param value the new value of the 'Beta Distribution' containment reference. + * @see #getBetaDistribution() + * @generated + */ + void setBetaDistribution(BetaDistributionType value); + + /** + * Returns the value of the 'Parameter Value' containment reference. + * + * + * @return the value of the 'Parameter Value' containment reference. + * @see #setParameterValue(ParameterValue) + * @see bpsim.BpsimPackage#getDocumentRoot_ParameterValue() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='ParameterValue' namespace='##targetNamespace'" + * @generated + */ + ParameterValue getParameterValue(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getParameterValue Parameter Value}' containment reference. + * + * + * @param value the new value of the 'Parameter Value' containment reference. + * @see #getParameterValue() + * @generated + */ + void setParameterValue(ParameterValue value); + + /** + * Returns the value of the 'Binomial Distribution' containment reference. + * + * + * @return the value of the 'Binomial Distribution' containment reference. + * @see #setBinomialDistribution(BinomialDistributionType) + * @see bpsim.BpsimPackage#getDocumentRoot_BinomialDistribution() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='BinomialDistribution' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + BinomialDistributionType getBinomialDistribution(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getBinomialDistribution Binomial Distribution}' containment reference. + * + * + * @param value the new value of the 'Binomial Distribution' containment reference. + * @see #getBinomialDistribution() + * @generated + */ + void setBinomialDistribution(BinomialDistributionType value); + + /** + * Returns the value of the 'Boolean Parameter' containment reference. + * + * + * @return the value of the 'Boolean Parameter' containment reference. + * @see #setBooleanParameter(BooleanParameterType) + * @see bpsim.BpsimPackage#getDocumentRoot_BooleanParameter() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='BooleanParameter' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + BooleanParameterType getBooleanParameter(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getBooleanParameter Boolean Parameter}' containment reference. + * + * + * @param value the new value of the 'Boolean Parameter' containment reference. + * @see #getBooleanParameter() + * @generated + */ + void setBooleanParameter(BooleanParameterType value); + + /** + * Returns the value of the 'BP Sim Data' containment reference. + * + * + * @return the value of the 'BP Sim Data' containment reference. + * @see #setBPSimData(BPSimDataType) + * @see bpsim.BpsimPackage#getDocumentRoot_BPSimData() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='BPSimData' namespace='##targetNamespace'" + * @generated + */ + BPSimDataType getBPSimData(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getBPSimData BP Sim Data}' containment reference. + * + * + * @param value the new value of the 'BP Sim Data' containment reference. + * @see #getBPSimData() + * @generated + */ + void setBPSimData(BPSimDataType value); + + /** + * Returns the value of the 'Date Time Parameter' containment reference. + * + * + * @return the value of the 'Date Time Parameter' containment reference. + * @see #setDateTimeParameter(DateTimeParameterType) + * @see bpsim.BpsimPackage#getDocumentRoot_DateTimeParameter() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='DateTimeParameter' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + DateTimeParameterType getDateTimeParameter(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getDateTimeParameter Date Time Parameter}' containment reference. + * + * + * @param value the new value of the 'Date Time Parameter' containment reference. + * @see #getDateTimeParameter() + * @generated + */ + void setDateTimeParameter(DateTimeParameterType value); + + /** + * Returns the value of the 'Duration Parameter' containment reference. + * + * + * @return the value of the 'Duration Parameter' containment reference. + * @see #setDurationParameter(DurationParameterType) + * @see bpsim.BpsimPackage#getDocumentRoot_DurationParameter() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='DurationParameter' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + DurationParameterType getDurationParameter(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getDurationParameter Duration Parameter}' containment reference. + * + * + * @param value the new value of the 'Duration Parameter' containment reference. + * @see #getDurationParameter() + * @generated + */ + void setDurationParameter(DurationParameterType value); + + /** + * Returns the value of the 'Enum Parameter' containment reference. + * + * + * @return the value of the 'Enum Parameter' containment reference. + * @see #setEnumParameter(EnumParameterType) + * @see bpsim.BpsimPackage#getDocumentRoot_EnumParameter() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='EnumParameter' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + EnumParameterType getEnumParameter(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getEnumParameter Enum Parameter}' containment reference. + * + * + * @param value the new value of the 'Enum Parameter' containment reference. + * @see #getEnumParameter() + * @generated + */ + void setEnumParameter(EnumParameterType value); + + /** + * Returns the value of the 'Erlang Distribution' containment reference. + * + * + * @return the value of the 'Erlang Distribution' containment reference. + * @see #setErlangDistribution(ErlangDistributionType) + * @see bpsim.BpsimPackage#getDocumentRoot_ErlangDistribution() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='ErlangDistribution' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + ErlangDistributionType getErlangDistribution(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getErlangDistribution Erlang Distribution}' containment reference. + * + * + * @param value the new value of the 'Erlang Distribution' containment reference. + * @see #getErlangDistribution() + * @generated + */ + void setErlangDistribution(ErlangDistributionType value); + + /** + * Returns the value of the 'Expression Parameter' containment reference. + * + * + * @return the value of the 'Expression Parameter' containment reference. + * @see #setExpressionParameter(ExpressionParameterType) + * @see bpsim.BpsimPackage#getDocumentRoot_ExpressionParameter() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='ExpressionParameter' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + ExpressionParameterType getExpressionParameter(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getExpressionParameter Expression Parameter}' containment reference. + * + * + * @param value the new value of the 'Expression Parameter' containment reference. + * @see #getExpressionParameter() + * @generated + */ + void setExpressionParameter(ExpressionParameterType value); + + /** + * Returns the value of the 'Floating Parameter' containment reference. + * + * + * @return the value of the 'Floating Parameter' containment reference. + * @see #setFloatingParameter(FloatingParameterType) + * @see bpsim.BpsimPackage#getDocumentRoot_FloatingParameter() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='FloatingParameter' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + FloatingParameterType getFloatingParameter(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getFloatingParameter Floating Parameter}' containment reference. + * + * + * @param value the new value of the 'Floating Parameter' containment reference. + * @see #getFloatingParameter() + * @generated + */ + void setFloatingParameter(FloatingParameterType value); + + /** + * Returns the value of the 'Gamma Distribution' containment reference. + * + * + * @return the value of the 'Gamma Distribution' containment reference. + * @see #setGammaDistribution(GammaDistributionType) + * @see bpsim.BpsimPackage#getDocumentRoot_GammaDistribution() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='GammaDistribution' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + GammaDistributionType getGammaDistribution(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getGammaDistribution Gamma Distribution}' containment reference. + * + * + * @param value the new value of the 'Gamma Distribution' containment reference. + * @see #getGammaDistribution() + * @generated + */ + void setGammaDistribution(GammaDistributionType value); + + /** + * Returns the value of the 'Log Normal Distribution' containment reference. + * + * + * @return the value of the 'Log Normal Distribution' containment reference. + * @see #setLogNormalDistribution(LogNormalDistributionType) + * @see bpsim.BpsimPackage#getDocumentRoot_LogNormalDistribution() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='LogNormalDistribution' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + LogNormalDistributionType getLogNormalDistribution(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getLogNormalDistribution Log Normal Distribution}' containment reference. + * + * + * @param value the new value of the 'Log Normal Distribution' containment reference. + * @see #getLogNormalDistribution() + * @generated + */ + void setLogNormalDistribution(LogNormalDistributionType value); + + /** + * Returns the value of the 'Negative Exponential Distribution' containment reference. + * + * + * @return the value of the 'Negative Exponential Distribution' containment reference. + * @see #setNegativeExponentialDistribution(NegativeExponentialDistributionType) + * @see bpsim.BpsimPackage#getDocumentRoot_NegativeExponentialDistribution() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='NegativeExponentialDistribution' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + NegativeExponentialDistributionType getNegativeExponentialDistribution(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getNegativeExponentialDistribution Negative Exponential Distribution}' containment reference. + * + * + * @param value the new value of the 'Negative Exponential Distribution' containment reference. + * @see #getNegativeExponentialDistribution() + * @generated + */ + void setNegativeExponentialDistribution(NegativeExponentialDistributionType value); + + /** + * Returns the value of the 'Normal Distribution' containment reference. + * + * + * @return the value of the 'Normal Distribution' containment reference. + * @see #setNormalDistribution(NormalDistributionType) + * @see bpsim.BpsimPackage#getDocumentRoot_NormalDistribution() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='NormalDistribution' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + NormalDistributionType getNormalDistribution(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getNormalDistribution Normal Distribution}' containment reference. + * + * + * @param value the new value of the 'Normal Distribution' containment reference. + * @see #getNormalDistribution() + * @generated + */ + void setNormalDistribution(NormalDistributionType value); + + /** + * Returns the value of the 'Numeric Parameter' containment reference. + * + * + * @return the value of the 'Numeric Parameter' containment reference. + * @see #setNumericParameter(NumericParameterType) + * @see bpsim.BpsimPackage#getDocumentRoot_NumericParameter() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='NumericParameter' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + NumericParameterType getNumericParameter(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getNumericParameter Numeric Parameter}' containment reference. + * + * + * @param value the new value of the 'Numeric Parameter' containment reference. + * @see #getNumericParameter() + * @generated + */ + void setNumericParameter(NumericParameterType value); + + /** + * Returns the value of the 'Poisson Distribution' containment reference. + * + * + * @return the value of the 'Poisson Distribution' containment reference. + * @see #setPoissonDistribution(PoissonDistributionType) + * @see bpsim.BpsimPackage#getDocumentRoot_PoissonDistribution() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='PoissonDistribution' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + PoissonDistributionType getPoissonDistribution(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getPoissonDistribution Poisson Distribution}' containment reference. + * + * + * @param value the new value of the 'Poisson Distribution' containment reference. + * @see #getPoissonDistribution() + * @generated + */ + void setPoissonDistribution(PoissonDistributionType value); + + /** + * Returns the value of the 'String Parameter' containment reference. + * + * + * @return the value of the 'String Parameter' containment reference. + * @see #setStringParameter(StringParameterType) + * @see bpsim.BpsimPackage#getDocumentRoot_StringParameter() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='StringParameter' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + StringParameterType getStringParameter(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getStringParameter String Parameter}' containment reference. + * + * + * @param value the new value of the 'String Parameter' containment reference. + * @see #getStringParameter() + * @generated + */ + void setStringParameter(StringParameterType value); + + /** + * Returns the value of the 'Triangular Distribution' containment reference. + * + * + * @return the value of the 'Triangular Distribution' containment reference. + * @see #setTriangularDistribution(TriangularDistributionType) + * @see bpsim.BpsimPackage#getDocumentRoot_TriangularDistribution() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='TriangularDistribution' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + TriangularDistributionType getTriangularDistribution(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getTriangularDistribution Triangular Distribution}' containment reference. + * + * + * @param value the new value of the 'Triangular Distribution' containment reference. + * @see #getTriangularDistribution() + * @generated + */ + void setTriangularDistribution(TriangularDistributionType value); + + /** + * Returns the value of the 'Truncated Normal Distribution' containment reference. + * + * + * @return the value of the 'Truncated Normal Distribution' containment reference. + * @see #setTruncatedNormalDistribution(TruncatedNormalDistributionType) + * @see bpsim.BpsimPackage#getDocumentRoot_TruncatedNormalDistribution() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='TruncatedNormalDistribution' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + TruncatedNormalDistributionType getTruncatedNormalDistribution(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getTruncatedNormalDistribution Truncated Normal Distribution}' containment reference. + * + * + * @param value the new value of the 'Truncated Normal Distribution' containment reference. + * @see #getTruncatedNormalDistribution() + * @generated + */ + void setTruncatedNormalDistribution(TruncatedNormalDistributionType value); + + /** + * Returns the value of the 'Uniform Distribution' containment reference. + * + * + * @return the value of the 'Uniform Distribution' containment reference. + * @see #setUniformDistribution(UniformDistributionType) + * @see bpsim.BpsimPackage#getDocumentRoot_UniformDistribution() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='UniformDistribution' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + UniformDistributionType getUniformDistribution(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getUniformDistribution Uniform Distribution}' containment reference. + * + * + * @param value the new value of the 'Uniform Distribution' containment reference. + * @see #getUniformDistribution() + * @generated + */ + void setUniformDistribution(UniformDistributionType value); + + /** + * Returns the value of the 'User Distribution' containment reference. + * + * + * @return the value of the 'User Distribution' containment reference. + * @see #setUserDistribution(UserDistributionType) + * @see bpsim.BpsimPackage#getDocumentRoot_UserDistribution() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='UserDistribution' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + UserDistributionType getUserDistribution(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getUserDistribution User Distribution}' containment reference. + * + * + * @param value the new value of the 'User Distribution' containment reference. + * @see #getUserDistribution() + * @generated + */ + void setUserDistribution(UserDistributionType value); + + /** + * Returns the value of the 'User Distribution Data Point' containment reference. + * + * + * @return the value of the 'User Distribution Data Point' containment reference. + * @see #setUserDistributionDataPoint(UserDistributionDataPointType) + * @see bpsim.BpsimPackage#getDocumentRoot_UserDistributionDataPoint() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='UserDistributionDataPoint' namespace='##targetNamespace'" + * @generated + */ + UserDistributionDataPointType getUserDistributionDataPoint(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getUserDistributionDataPoint User Distribution Data Point}' containment reference. + * + * + * @param value the new value of the 'User Distribution Data Point' containment reference. + * @see #getUserDistributionDataPoint() + * @generated + */ + void setUserDistributionDataPoint(UserDistributionDataPointType value); + + /** + * Returns the value of the 'Weibull Distribution' containment reference. + * + * + * @return the value of the 'Weibull Distribution' containment reference. + * @see #setWeibullDistribution(WeibullDistributionType) + * @see bpsim.BpsimPackage#getDocumentRoot_WeibullDistribution() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='WeibullDistribution' namespace='##targetNamespace' affiliation='ParameterValue'" + * @generated + */ + WeibullDistributionType getWeibullDistribution(); + + /** + * Sets the value of the '{@link bpsim.DocumentRoot#getWeibullDistribution Weibull Distribution}' containment reference. + * + * + * @param value the new value of the 'Weibull Distribution' containment reference. + * @see #getWeibullDistribution() + * @generated + */ + void setWeibullDistribution(WeibullDistributionType value); + +} // DocumentRoot diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/DurationParameterType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/DurationParameterType.java new file mode 100644 index 00000000000..6f598999abc --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/DurationParameterType.java @@ -0,0 +1,47 @@ +/** + */ +package bpsim; + +import javax.xml.datatype.Duration; + +/** + * + * A representation of the model object 'Duration Parameter Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.DurationParameterType#getValue Value}
  • + *
+ * + * @see bpsim.BpsimPackage#getDurationParameterType() + * @model extendedMetaData="name='DurationParameter_._type' kind='empty'" + * @generated + */ +public interface DurationParameterType extends ConstantParameter { + /** + * Returns the value of the 'Value' attribute. + * + * + * @return the value of the 'Value' attribute. + * @see #setValue(Duration) + * @see bpsim.BpsimPackage#getDurationParameterType_Value() + * @model dataType="org.eclipse.emf.ecore.xml.type.Duration" + * extendedMetaData="kind='attribute' name='value'" + * @generated + */ + Duration getValue(); + + /** + * Sets the value of the '{@link bpsim.DurationParameterType#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(Duration value); + +} // DurationParameterType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ElementParameters.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ElementParameters.java new file mode 100644 index 00000000000..ab2084d1ca9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ElementParameters.java @@ -0,0 +1,231 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Element Parameters'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.ElementParameters#getTimeParameters Time Parameters}
  • + *
  • {@link bpsim.ElementParameters#getControlParameters Control Parameters}
  • + *
  • {@link bpsim.ElementParameters#getResourceParameters Resource Parameters}
  • + *
  • {@link bpsim.ElementParameters#getPriorityParameters Priority Parameters}
  • + *
  • {@link bpsim.ElementParameters#getCostParameters Cost Parameters}
  • + *
  • {@link bpsim.ElementParameters#getPropertyParameters Property Parameters}
  • + *
  • {@link bpsim.ElementParameters#getVendorExtension Vendor Extension}
  • + *
  • {@link bpsim.ElementParameters#getElementRef Element Ref}
  • + *
  • {@link bpsim.ElementParameters#getId Id}
  • + *
+ * + * @see bpsim.BpsimPackage#getElementParameters() + * @model extendedMetaData="name='ElementParameters' kind='elementOnly'" + * @generated + */ +public interface ElementParameters extends EObject { + /** + * Returns the value of the 'Time Parameters' containment reference. + * + * + * @return the value of the 'Time Parameters' containment reference. + * @see #setTimeParameters(TimeParameters) + * @see bpsim.BpsimPackage#getElementParameters_TimeParameters() + * @model containment="true" + * extendedMetaData="kind='element' name='TimeParameters' namespace='##targetNamespace'" + * @generated + */ + TimeParameters getTimeParameters(); + + /** + * Sets the value of the '{@link bpsim.ElementParameters#getTimeParameters Time Parameters}' containment reference. + * + * + * @param value the new value of the 'Time Parameters' containment reference. + * @see #getTimeParameters() + * @generated + */ + void setTimeParameters(TimeParameters value); + + /** + * Returns the value of the 'Control Parameters' containment reference. + * + * + * @return the value of the 'Control Parameters' containment reference. + * @see #setControlParameters(ControlParameters) + * @see bpsim.BpsimPackage#getElementParameters_ControlParameters() + * @model containment="true" + * extendedMetaData="kind='element' name='ControlParameters' namespace='##targetNamespace'" + * @generated + */ + ControlParameters getControlParameters(); + + /** + * Sets the value of the '{@link bpsim.ElementParameters#getControlParameters Control Parameters}' containment reference. + * + * + * @param value the new value of the 'Control Parameters' containment reference. + * @see #getControlParameters() + * @generated + */ + void setControlParameters(ControlParameters value); + + /** + * Returns the value of the 'Resource Parameters' containment reference. + * + * + * @return the value of the 'Resource Parameters' containment reference. + * @see #setResourceParameters(ResourceParameters) + * @see bpsim.BpsimPackage#getElementParameters_ResourceParameters() + * @model containment="true" + * extendedMetaData="kind='element' name='ResourceParameters' namespace='##targetNamespace'" + * @generated + */ + ResourceParameters getResourceParameters(); + + /** + * Sets the value of the '{@link bpsim.ElementParameters#getResourceParameters Resource Parameters}' containment reference. + * + * + * @param value the new value of the 'Resource Parameters' containment reference. + * @see #getResourceParameters() + * @generated + */ + void setResourceParameters(ResourceParameters value); + + /** + * Returns the value of the 'Priority Parameters' containment reference. + * + * + * @return the value of the 'Priority Parameters' containment reference. + * @see #setPriorityParameters(PriorityParameters) + * @see bpsim.BpsimPackage#getElementParameters_PriorityParameters() + * @model containment="true" + * extendedMetaData="kind='element' name='PriorityParameters' namespace='##targetNamespace'" + * @generated + */ + PriorityParameters getPriorityParameters(); + + /** + * Sets the value of the '{@link bpsim.ElementParameters#getPriorityParameters Priority Parameters}' containment reference. + * + * + * @param value the new value of the 'Priority Parameters' containment reference. + * @see #getPriorityParameters() + * @generated + */ + void setPriorityParameters(PriorityParameters value); + + /** + * Returns the value of the 'Cost Parameters' containment reference. + * + * + * @return the value of the 'Cost Parameters' containment reference. + * @see #setCostParameters(CostParameters) + * @see bpsim.BpsimPackage#getElementParameters_CostParameters() + * @model containment="true" + * extendedMetaData="kind='element' name='CostParameters' namespace='##targetNamespace'" + * @generated + */ + CostParameters getCostParameters(); + + /** + * Sets the value of the '{@link bpsim.ElementParameters#getCostParameters Cost Parameters}' containment reference. + * + * + * @param value the new value of the 'Cost Parameters' containment reference. + * @see #getCostParameters() + * @generated + */ + void setCostParameters(CostParameters value); + + /** + * Returns the value of the 'Property Parameters' containment reference. + * + * + * @return the value of the 'Property Parameters' containment reference. + * @see #setPropertyParameters(PropertyParameters) + * @see bpsim.BpsimPackage#getElementParameters_PropertyParameters() + * @model containment="true" + * extendedMetaData="kind='element' name='PropertyParameters' namespace='##targetNamespace'" + * @generated + */ + PropertyParameters getPropertyParameters(); + + /** + * Sets the value of the '{@link bpsim.ElementParameters#getPropertyParameters Property Parameters}' containment reference. + * + * + * @param value the new value of the 'Property Parameters' containment reference. + * @see #getPropertyParameters() + * @generated + */ + void setPropertyParameters(PropertyParameters value); + + /** + * Returns the value of the 'Vendor Extension' containment reference list. + * The list contents are of type {@link bpsim.VendorExtension}. + * + * + * @return the value of the 'Vendor Extension' containment reference list. + * @see bpsim.BpsimPackage#getElementParameters_VendorExtension() + * @model containment="true" + * extendedMetaData="kind='element' name='VendorExtension' namespace='##targetNamespace'" + * @generated + */ + EList getVendorExtension(); + + /** + * Returns the value of the 'Element Ref' attribute. + * + * + * @return the value of the 'Element Ref' attribute. + * @see #setElementRef(String) + * @see bpsim.BpsimPackage#getElementParameters_ElementRef() + * @model dataType="org.eclipse.emf.ecore.xml.type.ID" + * extendedMetaData="kind='attribute' name='elementRef'" + * @generated + */ + String getElementRef(); + + /** + * Sets the value of the '{@link bpsim.ElementParameters#getElementRef Element Ref}' attribute. + * + * + * @param value the new value of the 'Element Ref' attribute. + * @see #getElementRef() + * @generated + */ + void setElementRef(String value); + + /** + * Returns the value of the 'Id' attribute. + * + * + * @return the value of the 'Id' attribute. + * @see #setId(String) + * @see bpsim.BpsimPackage#getElementParameters_Id() + * @model id="true" dataType="org.eclipse.emf.ecore.xml.type.ID" + * extendedMetaData="kind='attribute' name='id'" + * @generated + */ + String getId(); + + /** + * Sets the value of the '{@link bpsim.ElementParameters#getId Id}' attribute. + * + * + * @param value the new value of the 'Id' attribute. + * @see #getId() + * @generated + */ + void setId(String value); + +} // ElementParameters diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ElementParametersType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ElementParametersType.java new file mode 100644 index 00000000000..2cd894d83c4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ElementParametersType.java @@ -0,0 +1,17 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Element Parameters Type'. + * + * + * + * @see bpsim.BpsimPackage#getElementParametersType() + * @model extendedMetaData="name='ElementParametersType' kind='elementOnly'" + * @generated + */ +public interface ElementParametersType extends ElementParameters { +} // ElementParametersType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/EnumParameterType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/EnumParameterType.java new file mode 100644 index 00000000000..42bd0dc6e4e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/EnumParameterType.java @@ -0,0 +1,70 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'Enum Parameter Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.EnumParameterType#getGroup Group}
  • + *
  • {@link bpsim.EnumParameterType#getParameterValueGroup Parameter Value Group}
  • + *
  • {@link bpsim.EnumParameterType#getParameterValue Parameter Value}
  • + *
+ * + * @see bpsim.BpsimPackage#getEnumParameterType() + * @model extendedMetaData="name='EnumParameter_._type' kind='elementOnly'" + * @generated + */ +public interface EnumParameterType extends ParameterValue { + /** + * Returns the value of the 'Group' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * + * Even if here we reference a list of Parameter Values, only Constant Parameters are valid here. There is just no real way of expressing it in xsd. + * + * @return the value of the 'Group' attribute list. + * @see bpsim.BpsimPackage#getEnumParameterType_Group() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='group' name='group:3'" + * @generated + */ + FeatureMap getGroup(); + + /** + * Returns the value of the 'Parameter Value Group' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Parameter Value Group' attribute list. + * @see bpsim.BpsimPackage#getEnumParameterType_ParameterValueGroup() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" required="true" many="true" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='group' name='ParameterValue:group' namespace='##targetNamespace' group='#group:3'" + * @generated + */ + FeatureMap getParameterValueGroup(); + + /** + * Returns the value of the 'Parameter Value' containment reference list. + * The list contents are of type {@link bpsim.ParameterValue}. + * + * + * @return the value of the 'Parameter Value' containment reference list. + * @see bpsim.BpsimPackage#getEnumParameterType_ParameterValue() + * @model containment="true" required="true" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='ParameterValue' namespace='##targetNamespace' group='ParameterValue:group'" + * @generated + */ + EList getParameterValue(); + +} // EnumParameterType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ErlangDistributionType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ErlangDistributionType.java new file mode 100644 index 00000000000..6e4b5279ca3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ErlangDistributionType.java @@ -0,0 +1,124 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Erlang Distribution Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.ErlangDistributionType#getK K}
  • + *
  • {@link bpsim.ErlangDistributionType#getMean Mean}
  • + *
+ * + * @see bpsim.BpsimPackage#getErlangDistributionType() + * @model extendedMetaData="name='ErlangDistribution_._type' kind='empty'" + * @generated + */ +public interface ErlangDistributionType extends DistributionParameter { + /** + * Returns the value of the 'K' attribute. + * + * + * @return the value of the 'K' attribute. + * @see #isSetK() + * @see #unsetK() + * @see #setK(double) + * @see bpsim.BpsimPackage#getErlangDistributionType_K() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='k'" + * @generated + */ + double getK(); + + /** + * Sets the value of the '{@link bpsim.ErlangDistributionType#getK K}' attribute. + * + * + * @param value the new value of the 'K' attribute. + * @see #isSetK() + * @see #unsetK() + * @see #getK() + * @generated + */ + void setK(double value); + + /** + * Unsets the value of the '{@link bpsim.ErlangDistributionType#getK K}' attribute. + * + * + * @see #isSetK() + * @see #getK() + * @see #setK(double) + * @generated + */ + void unsetK(); + + /** + * Returns whether the value of the '{@link bpsim.ErlangDistributionType#getK K}' attribute is set. + * + * + * @return whether the value of the 'K' attribute is set. + * @see #unsetK() + * @see #getK() + * @see #setK(double) + * @generated + */ + boolean isSetK(); + + /** + * Returns the value of the 'Mean' attribute. + * + * + * @return the value of the 'Mean' attribute. + * @see #isSetMean() + * @see #unsetMean() + * @see #setMean(double) + * @see bpsim.BpsimPackage#getErlangDistributionType_Mean() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='mean'" + * @generated + */ + double getMean(); + + /** + * Sets the value of the '{@link bpsim.ErlangDistributionType#getMean Mean}' attribute. + * + * + * @param value the new value of the 'Mean' attribute. + * @see #isSetMean() + * @see #unsetMean() + * @see #getMean() + * @generated + */ + void setMean(double value); + + /** + * Unsets the value of the '{@link bpsim.ErlangDistributionType#getMean Mean}' attribute. + * + * + * @see #isSetMean() + * @see #getMean() + * @see #setMean(double) + * @generated + */ + void unsetMean(); + + /** + * Returns whether the value of the '{@link bpsim.ErlangDistributionType#getMean Mean}' attribute is set. + * + * + * @return whether the value of the 'Mean' attribute is set. + * @see #unsetMean() + * @see #getMean() + * @see #setMean(double) + * @generated + */ + boolean isSetMean(); + +} // ErlangDistributionType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ExpressionParameterType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ExpressionParameterType.java new file mode 100644 index 00000000000..61c5e243748 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ExpressionParameterType.java @@ -0,0 +1,46 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Expression Parameter Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.ExpressionParameterType#getValue Value}
  • + *
+ * + * @see bpsim.BpsimPackage#getExpressionParameterType() + * @model extendedMetaData="name='ExpressionParameter_._type' kind='empty'" + * @generated + */ +public interface ExpressionParameterType extends ParameterValue { + /** + * Returns the value of the 'Value' attribute. + * + * + * @return the value of the 'Value' attribute. + * @see #setValue(String) + * @see bpsim.BpsimPackage#getExpressionParameterType_Value() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='attribute' name='value'" + * @generated + */ + String getValue(); + + /** + * Sets the value of the '{@link bpsim.ExpressionParameterType#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(String value); + +} // ExpressionParameterType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/FloatingParameterType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/FloatingParameterType.java new file mode 100644 index 00000000000..b93926c4cf6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/FloatingParameterType.java @@ -0,0 +1,151 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Floating Parameter Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.FloatingParameterType#getCurrencyUnit Currency Unit}
  • + *
  • {@link bpsim.FloatingParameterType#getTimeUnit Time Unit}
  • + *
  • {@link bpsim.FloatingParameterType#getValue Value}
  • + *
+ * + * @see bpsim.BpsimPackage#getFloatingParameterType() + * @model extendedMetaData="name='FloatingParameter_._type' kind='empty'" + * @generated + */ +public interface FloatingParameterType extends ConstantParameter { + /** + * Returns the value of the 'Currency Unit' attribute. + * + * + * @return the value of the 'Currency Unit' attribute. + * @see #setCurrencyUnit(String) + * @see bpsim.BpsimPackage#getFloatingParameterType_CurrencyUnit() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='attribute' name='currencyUnit'" + * @generated + */ + String getCurrencyUnit(); + + /** + * Sets the value of the '{@link bpsim.FloatingParameterType#getCurrencyUnit Currency Unit}' attribute. + * + * + * @param value the new value of the 'Currency Unit' attribute. + * @see #getCurrencyUnit() + * @generated + */ + void setCurrencyUnit(String value); + + /** + * Returns the value of the 'Time Unit' attribute. + * The literals are from the enumeration {@link bpsim.TimeUnit}. + * + * + * @return the value of the 'Time Unit' attribute. + * @see bpsim.TimeUnit + * @see #isSetTimeUnit() + * @see #unsetTimeUnit() + * @see #setTimeUnit(TimeUnit) + * @see bpsim.BpsimPackage#getFloatingParameterType_TimeUnit() + * @model unsettable="true" + * extendedMetaData="kind='attribute' name='timeUnit'" + * @generated + */ + TimeUnit getTimeUnit(); + + /** + * Sets the value of the '{@link bpsim.FloatingParameterType#getTimeUnit Time Unit}' attribute. + * + * + * @param value the new value of the 'Time Unit' attribute. + * @see bpsim.TimeUnit + * @see #isSetTimeUnit() + * @see #unsetTimeUnit() + * @see #getTimeUnit() + * @generated + */ + void setTimeUnit(TimeUnit value); + + /** + * Unsets the value of the '{@link bpsim.FloatingParameterType#getTimeUnit Time Unit}' attribute. + * + * + * @see #isSetTimeUnit() + * @see #getTimeUnit() + * @see #setTimeUnit(TimeUnit) + * @generated + */ + void unsetTimeUnit(); + + /** + * Returns whether the value of the '{@link bpsim.FloatingParameterType#getTimeUnit Time Unit}' attribute is set. + * + * + * @return whether the value of the 'Time Unit' attribute is set. + * @see #unsetTimeUnit() + * @see #getTimeUnit() + * @see #setTimeUnit(TimeUnit) + * @generated + */ + boolean isSetTimeUnit(); + + /** + * Returns the value of the 'Value' attribute. + * + * + * @return the value of the 'Value' attribute. + * @see #isSetValue() + * @see #unsetValue() + * @see #setValue(double) + * @see bpsim.BpsimPackage#getFloatingParameterType_Value() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='value'" + * @generated + */ + double getValue(); + + /** + * Sets the value of the '{@link bpsim.FloatingParameterType#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #isSetValue() + * @see #unsetValue() + * @see #getValue() + * @generated + */ + void setValue(double value); + + /** + * Unsets the value of the '{@link bpsim.FloatingParameterType#getValue Value}' attribute. + * + * + * @see #isSetValue() + * @see #getValue() + * @see #setValue(double) + * @generated + */ + void unsetValue(); + + /** + * Returns whether the value of the '{@link bpsim.FloatingParameterType#getValue Value}' attribute is set. + * + * + * @return whether the value of the 'Value' attribute is set. + * @see #unsetValue() + * @see #getValue() + * @see #setValue(double) + * @generated + */ + boolean isSetValue(); + +} // FloatingParameterType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/GammaDistributionType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/GammaDistributionType.java new file mode 100644 index 00000000000..c57e797060d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/GammaDistributionType.java @@ -0,0 +1,124 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Gamma Distribution Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.GammaDistributionType#getScale Scale}
  • + *
  • {@link bpsim.GammaDistributionType#getShape Shape}
  • + *
+ * + * @see bpsim.BpsimPackage#getGammaDistributionType() + * @model extendedMetaData="name='GammaDistribution_._type' kind='empty'" + * @generated + */ +public interface GammaDistributionType extends DistributionParameter { + /** + * Returns the value of the 'Scale' attribute. + * + * + * @return the value of the 'Scale' attribute. + * @see #isSetScale() + * @see #unsetScale() + * @see #setScale(double) + * @see bpsim.BpsimPackage#getGammaDistributionType_Scale() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='scale'" + * @generated + */ + double getScale(); + + /** + * Sets the value of the '{@link bpsim.GammaDistributionType#getScale Scale}' attribute. + * + * + * @param value the new value of the 'Scale' attribute. + * @see #isSetScale() + * @see #unsetScale() + * @see #getScale() + * @generated + */ + void setScale(double value); + + /** + * Unsets the value of the '{@link bpsim.GammaDistributionType#getScale Scale}' attribute. + * + * + * @see #isSetScale() + * @see #getScale() + * @see #setScale(double) + * @generated + */ + void unsetScale(); + + /** + * Returns whether the value of the '{@link bpsim.GammaDistributionType#getScale Scale}' attribute is set. + * + * + * @return whether the value of the 'Scale' attribute is set. + * @see #unsetScale() + * @see #getScale() + * @see #setScale(double) + * @generated + */ + boolean isSetScale(); + + /** + * Returns the value of the 'Shape' attribute. + * + * + * @return the value of the 'Shape' attribute. + * @see #isSetShape() + * @see #unsetShape() + * @see #setShape(double) + * @see bpsim.BpsimPackage#getGammaDistributionType_Shape() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='shape'" + * @generated + */ + double getShape(); + + /** + * Sets the value of the '{@link bpsim.GammaDistributionType#getShape Shape}' attribute. + * + * + * @param value the new value of the 'Shape' attribute. + * @see #isSetShape() + * @see #unsetShape() + * @see #getShape() + * @generated + */ + void setShape(double value); + + /** + * Unsets the value of the '{@link bpsim.GammaDistributionType#getShape Shape}' attribute. + * + * + * @see #isSetShape() + * @see #getShape() + * @see #setShape(double) + * @generated + */ + void unsetShape(); + + /** + * Returns whether the value of the '{@link bpsim.GammaDistributionType#getShape Shape}' attribute is set. + * + * + * @return whether the value of the 'Shape' attribute is set. + * @see #unsetShape() + * @see #getShape() + * @see #setShape(double) + * @generated + */ + boolean isSetShape(); + +} // GammaDistributionType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/LogNormalDistributionType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/LogNormalDistributionType.java new file mode 100644 index 00000000000..58f9c974899 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/LogNormalDistributionType.java @@ -0,0 +1,124 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Log Normal Distribution Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.LogNormalDistributionType#getMean Mean}
  • + *
  • {@link bpsim.LogNormalDistributionType#getStandardDeviation Standard Deviation}
  • + *
+ * + * @see bpsim.BpsimPackage#getLogNormalDistributionType() + * @model extendedMetaData="name='LogNormalDistribution_._type' kind='empty'" + * @generated + */ +public interface LogNormalDistributionType extends DistributionParameter { + /** + * Returns the value of the 'Mean' attribute. + * + * + * @return the value of the 'Mean' attribute. + * @see #isSetMean() + * @see #unsetMean() + * @see #setMean(double) + * @see bpsim.BpsimPackage#getLogNormalDistributionType_Mean() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='mean'" + * @generated + */ + double getMean(); + + /** + * Sets the value of the '{@link bpsim.LogNormalDistributionType#getMean Mean}' attribute. + * + * + * @param value the new value of the 'Mean' attribute. + * @see #isSetMean() + * @see #unsetMean() + * @see #getMean() + * @generated + */ + void setMean(double value); + + /** + * Unsets the value of the '{@link bpsim.LogNormalDistributionType#getMean Mean}' attribute. + * + * + * @see #isSetMean() + * @see #getMean() + * @see #setMean(double) + * @generated + */ + void unsetMean(); + + /** + * Returns whether the value of the '{@link bpsim.LogNormalDistributionType#getMean Mean}' attribute is set. + * + * + * @return whether the value of the 'Mean' attribute is set. + * @see #unsetMean() + * @see #getMean() + * @see #setMean(double) + * @generated + */ + boolean isSetMean(); + + /** + * Returns the value of the 'Standard Deviation' attribute. + * + * + * @return the value of the 'Standard Deviation' attribute. + * @see #isSetStandardDeviation() + * @see #unsetStandardDeviation() + * @see #setStandardDeviation(double) + * @see bpsim.BpsimPackage#getLogNormalDistributionType_StandardDeviation() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='standardDeviation'" + * @generated + */ + double getStandardDeviation(); + + /** + * Sets the value of the '{@link bpsim.LogNormalDistributionType#getStandardDeviation Standard Deviation}' attribute. + * + * + * @param value the new value of the 'Standard Deviation' attribute. + * @see #isSetStandardDeviation() + * @see #unsetStandardDeviation() + * @see #getStandardDeviation() + * @generated + */ + void setStandardDeviation(double value); + + /** + * Unsets the value of the '{@link bpsim.LogNormalDistributionType#getStandardDeviation Standard Deviation}' attribute. + * + * + * @see #isSetStandardDeviation() + * @see #getStandardDeviation() + * @see #setStandardDeviation(double) + * @generated + */ + void unsetStandardDeviation(); + + /** + * Returns whether the value of the '{@link bpsim.LogNormalDistributionType#getStandardDeviation Standard Deviation}' attribute is set. + * + * + * @return whether the value of the 'Standard Deviation' attribute is set. + * @see #unsetStandardDeviation() + * @see #getStandardDeviation() + * @see #setStandardDeviation(double) + * @generated + */ + boolean isSetStandardDeviation(); + +} // LogNormalDistributionType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/NegativeExponentialDistributionType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/NegativeExponentialDistributionType.java new file mode 100644 index 00000000000..4f60da794fd --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/NegativeExponentialDistributionType.java @@ -0,0 +1,73 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Negative Exponential Distribution Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.NegativeExponentialDistributionType#getMean Mean}
  • + *
+ * + * @see bpsim.BpsimPackage#getNegativeExponentialDistributionType() + * @model extendedMetaData="name='NegativeExponentialDistribution_._type' kind='empty'" + * @generated + */ +public interface NegativeExponentialDistributionType extends DistributionParameter { + /** + * Returns the value of the 'Mean' attribute. + * + * + * @return the value of the 'Mean' attribute. + * @see #isSetMean() + * @see #unsetMean() + * @see #setMean(double) + * @see bpsim.BpsimPackage#getNegativeExponentialDistributionType_Mean() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='mean'" + * @generated + */ + double getMean(); + + /** + * Sets the value of the '{@link bpsim.NegativeExponentialDistributionType#getMean Mean}' attribute. + * + * + * @param value the new value of the 'Mean' attribute. + * @see #isSetMean() + * @see #unsetMean() + * @see #getMean() + * @generated + */ + void setMean(double value); + + /** + * Unsets the value of the '{@link bpsim.NegativeExponentialDistributionType#getMean Mean}' attribute. + * + * + * @see #isSetMean() + * @see #getMean() + * @see #setMean(double) + * @generated + */ + void unsetMean(); + + /** + * Returns whether the value of the '{@link bpsim.NegativeExponentialDistributionType#getMean Mean}' attribute is set. + * + * + * @return whether the value of the 'Mean' attribute is set. + * @see #unsetMean() + * @see #getMean() + * @see #setMean(double) + * @generated + */ + boolean isSetMean(); + +} // NegativeExponentialDistributionType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/NormalDistributionType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/NormalDistributionType.java new file mode 100644 index 00000000000..cc6571d04ff --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/NormalDistributionType.java @@ -0,0 +1,124 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Normal Distribution Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.NormalDistributionType#getMean Mean}
  • + *
  • {@link bpsim.NormalDistributionType#getStandardDeviation Standard Deviation}
  • + *
+ * + * @see bpsim.BpsimPackage#getNormalDistributionType() + * @model extendedMetaData="name='NormalDistribution_._type' kind='empty'" + * @generated + */ +public interface NormalDistributionType extends DistributionParameter { + /** + * Returns the value of the 'Mean' attribute. + * + * + * @return the value of the 'Mean' attribute. + * @see #isSetMean() + * @see #unsetMean() + * @see #setMean(double) + * @see bpsim.BpsimPackage#getNormalDistributionType_Mean() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='mean'" + * @generated + */ + double getMean(); + + /** + * Sets the value of the '{@link bpsim.NormalDistributionType#getMean Mean}' attribute. + * + * + * @param value the new value of the 'Mean' attribute. + * @see #isSetMean() + * @see #unsetMean() + * @see #getMean() + * @generated + */ + void setMean(double value); + + /** + * Unsets the value of the '{@link bpsim.NormalDistributionType#getMean Mean}' attribute. + * + * + * @see #isSetMean() + * @see #getMean() + * @see #setMean(double) + * @generated + */ + void unsetMean(); + + /** + * Returns whether the value of the '{@link bpsim.NormalDistributionType#getMean Mean}' attribute is set. + * + * + * @return whether the value of the 'Mean' attribute is set. + * @see #unsetMean() + * @see #getMean() + * @see #setMean(double) + * @generated + */ + boolean isSetMean(); + + /** + * Returns the value of the 'Standard Deviation' attribute. + * + * + * @return the value of the 'Standard Deviation' attribute. + * @see #isSetStandardDeviation() + * @see #unsetStandardDeviation() + * @see #setStandardDeviation(double) + * @see bpsim.BpsimPackage#getNormalDistributionType_StandardDeviation() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='standardDeviation'" + * @generated + */ + double getStandardDeviation(); + + /** + * Sets the value of the '{@link bpsim.NormalDistributionType#getStandardDeviation Standard Deviation}' attribute. + * + * + * @param value the new value of the 'Standard Deviation' attribute. + * @see #isSetStandardDeviation() + * @see #unsetStandardDeviation() + * @see #getStandardDeviation() + * @generated + */ + void setStandardDeviation(double value); + + /** + * Unsets the value of the '{@link bpsim.NormalDistributionType#getStandardDeviation Standard Deviation}' attribute. + * + * + * @see #isSetStandardDeviation() + * @see #getStandardDeviation() + * @see #setStandardDeviation(double) + * @generated + */ + void unsetStandardDeviation(); + + /** + * Returns whether the value of the '{@link bpsim.NormalDistributionType#getStandardDeviation Standard Deviation}' attribute is set. + * + * + * @return whether the value of the 'Standard Deviation' attribute is set. + * @see #unsetStandardDeviation() + * @see #getStandardDeviation() + * @see #setStandardDeviation(double) + * @generated + */ + boolean isSetStandardDeviation(); + +} // NormalDistributionType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/NumericParameterType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/NumericParameterType.java new file mode 100644 index 00000000000..0c24aeab397 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/NumericParameterType.java @@ -0,0 +1,151 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Numeric Parameter Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.NumericParameterType#getCurrencyUnit Currency Unit}
  • + *
  • {@link bpsim.NumericParameterType#getTimeUnit Time Unit}
  • + *
  • {@link bpsim.NumericParameterType#getValue Value}
  • + *
+ * + * @see bpsim.BpsimPackage#getNumericParameterType() + * @model extendedMetaData="name='NumericParameter_._type' kind='empty'" + * @generated + */ +public interface NumericParameterType extends ConstantParameter { + /** + * Returns the value of the 'Currency Unit' attribute. + * + * + * @return the value of the 'Currency Unit' attribute. + * @see #setCurrencyUnit(String) + * @see bpsim.BpsimPackage#getNumericParameterType_CurrencyUnit() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='attribute' name='currencyUnit'" + * @generated + */ + String getCurrencyUnit(); + + /** + * Sets the value of the '{@link bpsim.NumericParameterType#getCurrencyUnit Currency Unit}' attribute. + * + * + * @param value the new value of the 'Currency Unit' attribute. + * @see #getCurrencyUnit() + * @generated + */ + void setCurrencyUnit(String value); + + /** + * Returns the value of the 'Time Unit' attribute. + * The literals are from the enumeration {@link bpsim.TimeUnit}. + * + * + * @return the value of the 'Time Unit' attribute. + * @see bpsim.TimeUnit + * @see #isSetTimeUnit() + * @see #unsetTimeUnit() + * @see #setTimeUnit(TimeUnit) + * @see bpsim.BpsimPackage#getNumericParameterType_TimeUnit() + * @model unsettable="true" + * extendedMetaData="kind='attribute' name='timeUnit'" + * @generated + */ + TimeUnit getTimeUnit(); + + /** + * Sets the value of the '{@link bpsim.NumericParameterType#getTimeUnit Time Unit}' attribute. + * + * + * @param value the new value of the 'Time Unit' attribute. + * @see bpsim.TimeUnit + * @see #isSetTimeUnit() + * @see #unsetTimeUnit() + * @see #getTimeUnit() + * @generated + */ + void setTimeUnit(TimeUnit value); + + /** + * Unsets the value of the '{@link bpsim.NumericParameterType#getTimeUnit Time Unit}' attribute. + * + * + * @see #isSetTimeUnit() + * @see #getTimeUnit() + * @see #setTimeUnit(TimeUnit) + * @generated + */ + void unsetTimeUnit(); + + /** + * Returns whether the value of the '{@link bpsim.NumericParameterType#getTimeUnit Time Unit}' attribute is set. + * + * + * @return whether the value of the 'Time Unit' attribute is set. + * @see #unsetTimeUnit() + * @see #getTimeUnit() + * @see #setTimeUnit(TimeUnit) + * @generated + */ + boolean isSetTimeUnit(); + + /** + * Returns the value of the 'Value' attribute. + * + * + * @return the value of the 'Value' attribute. + * @see #isSetValue() + * @see #unsetValue() + * @see #setValue(long) + * @see bpsim.BpsimPackage#getNumericParameterType_Value() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Long" + * extendedMetaData="kind='attribute' name='value'" + * @generated + */ + long getValue(); + + /** + * Sets the value of the '{@link bpsim.NumericParameterType#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #isSetValue() + * @see #unsetValue() + * @see #getValue() + * @generated + */ + void setValue(long value); + + /** + * Unsets the value of the '{@link bpsim.NumericParameterType#getValue Value}' attribute. + * + * + * @see #isSetValue() + * @see #getValue() + * @see #setValue(long) + * @generated + */ + void unsetValue(); + + /** + * Returns whether the value of the '{@link bpsim.NumericParameterType#getValue Value}' attribute is set. + * + * + * @return whether the value of the 'Value' attribute is set. + * @see #unsetValue() + * @see #getValue() + * @see #setValue(long) + * @generated + */ + boolean isSetValue(); + +} // NumericParameterType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/Parameter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/Parameter.java new file mode 100644 index 00000000000..ca8b03d7cc9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/Parameter.java @@ -0,0 +1,175 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'Parameter'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.Parameter#getResultRequest Result Request}
  • + *
  • {@link bpsim.Parameter#getParameterValueGroup Parameter Value Group}
  • + *
  • {@link bpsim.Parameter#getParameterValue Parameter Value}
  • + *
  • {@link bpsim.Parameter#isKpi Kpi}
  • + *
  • {@link bpsim.Parameter#isSla Sla}
  • + *
+ * + * @see bpsim.BpsimPackage#getParameter() + * @model extendedMetaData="name='Parameter' kind='elementOnly'" + * @generated + */ +public interface Parameter extends EObject { + /** + * Returns the value of the 'Result Request' attribute list. + * The list contents are of type {@link bpsim.ResultType}. + * The literals are from the enumeration {@link bpsim.ResultType}. + * + * + * @return the value of the 'Result Request' attribute list. + * @see bpsim.ResultType + * @see bpsim.BpsimPackage#getParameter_ResultRequest() + * @model unique="false" + * extendedMetaData="kind='element' name='ResultRequest' namespace='##targetNamespace'" + * @generated + */ + EList getResultRequest(); + + /** + * Returns the value of the 'Parameter Value Group' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Parameter Value Group' attribute list. + * @see bpsim.BpsimPackage#getParameter_ParameterValueGroup() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='group' name='ParameterValue:group' namespace='##targetNamespace'" + * @generated + */ + FeatureMap getParameterValueGroup(); + + /** + * Returns the value of the 'Parameter Value' containment reference list. + * The list contents are of type {@link bpsim.ParameterValue}. + * + * + * @return the value of the 'Parameter Value' containment reference list. + * @see bpsim.BpsimPackage#getParameter_ParameterValue() + * @model containment="true" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='ParameterValue' namespace='##targetNamespace' group='ParameterValue:group'" + * @generated + */ + EList getParameterValue(); + + /** + * Returns the value of the 'Kpi' attribute. + * The default value is "false". + * + * + * @return the value of the 'Kpi' attribute. + * @see #isSetKpi() + * @see #unsetKpi() + * @see #setKpi(boolean) + * @see bpsim.BpsimPackage#getParameter_Kpi() + * @model default="false" unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Boolean" + * extendedMetaData="kind='attribute' name='kpi'" + * @generated + */ + boolean isKpi(); + + /** + * Sets the value of the '{@link bpsim.Parameter#isKpi Kpi}' attribute. + * + * + * @param value the new value of the 'Kpi' attribute. + * @see #isSetKpi() + * @see #unsetKpi() + * @see #isKpi() + * @generated + */ + void setKpi(boolean value); + + /** + * Unsets the value of the '{@link bpsim.Parameter#isKpi Kpi}' attribute. + * + * + * @see #isSetKpi() + * @see #isKpi() + * @see #setKpi(boolean) + * @generated + */ + void unsetKpi(); + + /** + * Returns whether the value of the '{@link bpsim.Parameter#isKpi Kpi}' attribute is set. + * + * + * @return whether the value of the 'Kpi' attribute is set. + * @see #unsetKpi() + * @see #isKpi() + * @see #setKpi(boolean) + * @generated + */ + boolean isSetKpi(); + + /** + * Returns the value of the 'Sla' attribute. + * The default value is "false". + * + * + * @return the value of the 'Sla' attribute. + * @see #isSetSla() + * @see #unsetSla() + * @see #setSla(boolean) + * @see bpsim.BpsimPackage#getParameter_Sla() + * @model default="false" unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Boolean" + * extendedMetaData="kind='attribute' name='sla'" + * @generated + */ + boolean isSla(); + + /** + * Sets the value of the '{@link bpsim.Parameter#isSla Sla}' attribute. + * + * + * @param value the new value of the 'Sla' attribute. + * @see #isSetSla() + * @see #unsetSla() + * @see #isSla() + * @generated + */ + void setSla(boolean value); + + /** + * Unsets the value of the '{@link bpsim.Parameter#isSla Sla}' attribute. + * + * + * @see #isSetSla() + * @see #isSla() + * @see #setSla(boolean) + * @generated + */ + void unsetSla(); + + /** + * Returns whether the value of the '{@link bpsim.Parameter#isSla Sla}' attribute is set. + * + * + * @return whether the value of the 'Sla' attribute is set. + * @see #unsetSla() + * @see #isSla() + * @see #setSla(boolean) + * @generated + */ + boolean isSetSla(); + +} // Parameter diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ParameterValue.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ParameterValue.java new file mode 100644 index 00000000000..ee90d440418 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ParameterValue.java @@ -0,0 +1,125 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Parameter Value'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.ParameterValue#getInstance Instance}
  • + *
  • {@link bpsim.ParameterValue#getResult Result}
  • + *
  • {@link bpsim.ParameterValue#getValidFor Valid For}
  • + *
+ * + * @see bpsim.BpsimPackage#getParameterValue() + * @model extendedMetaData="name='ParameterValue' kind='empty'" + * @generated + */ +public interface ParameterValue extends EObject { + /** + * Returns the value of the 'Instance' attribute. + * + * + * @return the value of the 'Instance' attribute. + * @see #setInstance(String) + * @see bpsim.BpsimPackage#getParameterValue_Instance() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='attribute' name='instance'" + * @generated + */ + String getInstance(); + + /** + * Sets the value of the '{@link bpsim.ParameterValue#getInstance Instance}' attribute. + * + * + * @param value the new value of the 'Instance' attribute. + * @see #getInstance() + * @generated + */ + void setInstance(String value); + + /** + * Returns the value of the 'Result' attribute. + * The literals are from the enumeration {@link bpsim.ResultType}. + * + * + * @return the value of the 'Result' attribute. + * @see bpsim.ResultType + * @see #isSetResult() + * @see #unsetResult() + * @see #setResult(ResultType) + * @see bpsim.BpsimPackage#getParameterValue_Result() + * @model unsettable="true" + * extendedMetaData="kind='attribute' name='result'" + * @generated + */ + ResultType getResult(); + + /** + * Sets the value of the '{@link bpsim.ParameterValue#getResult Result}' attribute. + * + * + * @param value the new value of the 'Result' attribute. + * @see bpsim.ResultType + * @see #isSetResult() + * @see #unsetResult() + * @see #getResult() + * @generated + */ + void setResult(ResultType value); + + /** + * Unsets the value of the '{@link bpsim.ParameterValue#getResult Result}' attribute. + * + * + * @see #isSetResult() + * @see #getResult() + * @see #setResult(ResultType) + * @generated + */ + void unsetResult(); + + /** + * Returns whether the value of the '{@link bpsim.ParameterValue#getResult Result}' attribute is set. + * + * + * @return whether the value of the 'Result' attribute is set. + * @see #unsetResult() + * @see #getResult() + * @see #setResult(ResultType) + * @generated + */ + boolean isSetResult(); + + /** + * Returns the value of the 'Valid For' attribute. + * + * + * @return the value of the 'Valid For' attribute. + * @see #setValidFor(String) + * @see bpsim.BpsimPackage#getParameterValue_ValidFor() + * @model dataType="org.eclipse.emf.ecore.xml.type.IDREF" + * extendedMetaData="kind='attribute' name='validFor'" + * @generated + */ + String getValidFor(); + + /** + * Sets the value of the '{@link bpsim.ParameterValue#getValidFor Valid For}' attribute. + * + * + * @param value the new value of the 'Valid For' attribute. + * @see #getValidFor() + * @generated + */ + void setValidFor(String value); + +} // ParameterValue diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/PoissonDistributionType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/PoissonDistributionType.java new file mode 100644 index 00000000000..d155e078f39 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/PoissonDistributionType.java @@ -0,0 +1,73 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Poisson Distribution Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.PoissonDistributionType#getMean Mean}
  • + *
+ * + * @see bpsim.BpsimPackage#getPoissonDistributionType() + * @model extendedMetaData="name='PoissonDistribution_._type' kind='empty'" + * @generated + */ +public interface PoissonDistributionType extends DistributionParameter { + /** + * Returns the value of the 'Mean' attribute. + * + * + * @return the value of the 'Mean' attribute. + * @see #isSetMean() + * @see #unsetMean() + * @see #setMean(double) + * @see bpsim.BpsimPackage#getPoissonDistributionType_Mean() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='mean'" + * @generated + */ + double getMean(); + + /** + * Sets the value of the '{@link bpsim.PoissonDistributionType#getMean Mean}' attribute. + * + * + * @param value the new value of the 'Mean' attribute. + * @see #isSetMean() + * @see #unsetMean() + * @see #getMean() + * @generated + */ + void setMean(double value); + + /** + * Unsets the value of the '{@link bpsim.PoissonDistributionType#getMean Mean}' attribute. + * + * + * @see #isSetMean() + * @see #getMean() + * @see #setMean(double) + * @generated + */ + void unsetMean(); + + /** + * Returns whether the value of the '{@link bpsim.PoissonDistributionType#getMean Mean}' attribute is set. + * + * + * @return whether the value of the 'Mean' attribute is set. + * @see #unsetMean() + * @see #getMean() + * @see #setMean(double) + * @generated + */ + boolean isSetMean(); + +} // PoissonDistributionType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/PriorityParameters.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/PriorityParameters.java new file mode 100644 index 00000000000..e3ef5b0353e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/PriorityParameters.java @@ -0,0 +1,71 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Priority Parameters'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.PriorityParameters#getInterruptible Interruptible}
  • + *
  • {@link bpsim.PriorityParameters#getPriority Priority}
  • + *
+ * + * @see bpsim.BpsimPackage#getPriorityParameters() + * @model extendedMetaData="name='PriorityParameters' kind='elementOnly'" + * @generated + */ +public interface PriorityParameters extends EObject { + /** + * Returns the value of the 'Interruptible' containment reference. + * + * + * @return the value of the 'Interruptible' containment reference. + * @see #setInterruptible(Parameter) + * @see bpsim.BpsimPackage#getPriorityParameters_Interruptible() + * @model containment="true" + * extendedMetaData="kind='element' name='Interruptible' namespace='##targetNamespace'" + * @generated + */ + Parameter getInterruptible(); + + /** + * Sets the value of the '{@link bpsim.PriorityParameters#getInterruptible Interruptible}' containment reference. + * + * + * @param value the new value of the 'Interruptible' containment reference. + * @see #getInterruptible() + * @generated + */ + void setInterruptible(Parameter value); + + /** + * Returns the value of the 'Priority' containment reference. + * + * + * @return the value of the 'Priority' containment reference. + * @see #setPriority(Parameter) + * @see bpsim.BpsimPackage#getPriorityParameters_Priority() + * @model containment="true" + * extendedMetaData="kind='element' name='Priority' namespace='##targetNamespace'" + * @generated + */ + Parameter getPriority(); + + /** + * Sets the value of the '{@link bpsim.PriorityParameters#getPriority Priority}' containment reference. + * + * + * @param value the new value of the 'Priority' containment reference. + * @see #getPriority() + * @generated + */ + void setPriority(Parameter value); + +} // PriorityParameters diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/PropertyParameters.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/PropertyParameters.java new file mode 100644 index 00000000000..5f77609302b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/PropertyParameters.java @@ -0,0 +1,39 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Property Parameters'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.PropertyParameters#getProperty Property}
  • + *
+ * + * @see bpsim.BpsimPackage#getPropertyParameters() + * @model extendedMetaData="name='PropertyParameters' kind='elementOnly'" + * @generated + */ +public interface PropertyParameters extends EObject { + /** + * Returns the value of the 'Property' containment reference list. + * The list contents are of type {@link bpsim.PropertyType}. + * + * + * @return the value of the 'Property' containment reference list. + * @see bpsim.BpsimPackage#getPropertyParameters_Property() + * @model containment="true" + * extendedMetaData="kind='element' name='Property' namespace='##targetNamespace'" + * @generated + */ + EList getProperty(); + +} // PropertyParameters diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/PropertyType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/PropertyType.java new file mode 100644 index 00000000000..9a491192600 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/PropertyType.java @@ -0,0 +1,46 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Property Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.PropertyType#getName Name}
  • + *
+ * + * @see bpsim.BpsimPackage#getPropertyType() + * @model extendedMetaData="name='Property_._type' kind='elementOnly'" + * @generated + */ +public interface PropertyType extends Parameter { + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see bpsim.BpsimPackage#getPropertyType_Name() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link bpsim.PropertyType#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // PropertyType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ResourceParameters.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ResourceParameters.java new file mode 100644 index 00000000000..45986d0e2d2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ResourceParameters.java @@ -0,0 +1,111 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Resource Parameters'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.ResourceParameters#getSelection Selection}
  • + *
  • {@link bpsim.ResourceParameters#getAvailability Availability}
  • + *
  • {@link bpsim.ResourceParameters#getQuantity Quantity}
  • + *
  • {@link bpsim.ResourceParameters#getRole Role}
  • + *
+ * + * @see bpsim.BpsimPackage#getResourceParameters() + * @model extendedMetaData="name='ResourceParameters' kind='elementOnly'" + * @generated + */ +public interface ResourceParameters extends EObject { + /** + * Returns the value of the 'Selection' containment reference. + * + * + * @return the value of the 'Selection' containment reference. + * @see #setSelection(Parameter) + * @see bpsim.BpsimPackage#getResourceParameters_Selection() + * @model containment="true" + * extendedMetaData="kind='element' name='Selection' namespace='##targetNamespace'" + * @generated + */ + Parameter getSelection(); + + /** + * Sets the value of the '{@link bpsim.ResourceParameters#getSelection Selection}' containment reference. + * + * + * @param value the new value of the 'Selection' containment reference. + * @see #getSelection() + * @generated + */ + void setSelection(Parameter value); + + /** + * Returns the value of the 'Availability' containment reference. + * + * + * @return the value of the 'Availability' containment reference. + * @see #setAvailability(Parameter) + * @see bpsim.BpsimPackage#getResourceParameters_Availability() + * @model containment="true" + * extendedMetaData="kind='element' name='Availability' namespace='##targetNamespace'" + * @generated + */ + Parameter getAvailability(); + + /** + * Sets the value of the '{@link bpsim.ResourceParameters#getAvailability Availability}' containment reference. + * + * + * @param value the new value of the 'Availability' containment reference. + * @see #getAvailability() + * @generated + */ + void setAvailability(Parameter value); + + /** + * Returns the value of the 'Quantity' containment reference. + * + * + * @return the value of the 'Quantity' containment reference. + * @see #setQuantity(Parameter) + * @see bpsim.BpsimPackage#getResourceParameters_Quantity() + * @model containment="true" + * extendedMetaData="kind='element' name='Quantity' namespace='##targetNamespace'" + * @generated + */ + Parameter getQuantity(); + + /** + * Sets the value of the '{@link bpsim.ResourceParameters#getQuantity Quantity}' containment reference. + * + * + * @param value the new value of the 'Quantity' containment reference. + * @see #getQuantity() + * @generated + */ + void setQuantity(Parameter value); + + /** + * Returns the value of the 'Role' containment reference list. + * The list contents are of type {@link bpsim.Parameter}. + * + * + * @return the value of the 'Role' containment reference list. + * @see bpsim.BpsimPackage#getResourceParameters_Role() + * @model containment="true" + * extendedMetaData="kind='element' name='Role' namespace='##targetNamespace'" + * @generated + */ + EList getRole(); + +} // ResourceParameters diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ResultType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ResultType.java new file mode 100644 index 00000000000..8bb1cc2663b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ResultType.java @@ -0,0 +1,278 @@ +/** + */ +package bpsim; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Result Type', + * and utility methods for working with them. + * + * @see bpsim.BpsimPackage#getResultType() + * @model extendedMetaData="name='ResultType'" + * @generated + */ +public enum ResultType implements Enumerator { + /** + * The 'Min' literal object. + * + * + * @see #MIN_VALUE + * @generated + * @ordered + */ + MIN(0, "min", "min"), + + /** + * The 'Max' literal object. + * + * + * @see #MAX_VALUE + * @generated + * @ordered + */ + MAX(1, "max", "max"), + + /** + * The 'Mean' literal object. + * + * + * @see #MEAN_VALUE + * @generated + * @ordered + */ + MEAN(2, "mean", "mean"), + + /** + * The 'Count' literal object. + * + * + * @see #COUNT_VALUE + * @generated + * @ordered + */ + COUNT(3, "count", "count"), + + /** + * The 'Sum' literal object. + * + * + * @see #SUM_VALUE + * @generated + * @ordered + */ + SUM(4, "sum", "sum"); + + /** + * The 'Min' literal value. + * + * + * @see #MIN + * @model name="min" + * @generated + * @ordered + */ + public static final int MIN_VALUE = 0; + + /** + * The 'Max' literal value. + * + * + * @see #MAX + * @model name="max" + * @generated + * @ordered + */ + public static final int MAX_VALUE = 1; + + /** + * The 'Mean' literal value. + * + * + * @see #MEAN + * @model name="mean" + * @generated + * @ordered + */ + public static final int MEAN_VALUE = 2; + + /** + * The 'Count' literal value. + * + * + * @see #COUNT + * @model name="count" + * @generated + * @ordered + */ + public static final int COUNT_VALUE = 3; + + /** + * The 'Sum' literal value. + * + * + * @see #SUM + * @model name="sum" + * @generated + * @ordered + */ + public static final int SUM_VALUE = 4; + + /** + * An array of all the 'Result Type' enumerators. + * + * + * @generated + */ + private static final ResultType[] VALUES_ARRAY = + new ResultType[] { + MIN, + MAX, + MEAN, + COUNT, + SUM, + }; + + /** + * A public read-only list of all the 'Result Type' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Result Type' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static ResultType get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ResultType result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Result Type' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static ResultType getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ResultType result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Result Type' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static ResultType get(int value) { + switch (value) { + case MIN_VALUE: return MIN; + case MAX_VALUE: return MAX; + case MEAN_VALUE: return MEAN; + case COUNT_VALUE: return COUNT; + case SUM_VALUE: return SUM; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private ResultType(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //ResultType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/Scenario.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/Scenario.java new file mode 100644 index 00000000000..47c8b143c44 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/Scenario.java @@ -0,0 +1,333 @@ +/** + */ +package bpsim; + +import javax.xml.datatype.XMLGregorianCalendar; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Scenario'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.Scenario#getScenarioParameters Scenario Parameters}
  • + *
  • {@link bpsim.Scenario#getElementParameters Element Parameters}
  • + *
  • {@link bpsim.Scenario#getCalendar Calendar}
  • + *
  • {@link bpsim.Scenario#getVendorExtension Vendor Extension}
  • + *
  • {@link bpsim.Scenario#getAuthor Author}
  • + *
  • {@link bpsim.Scenario#getCreated Created}
  • + *
  • {@link bpsim.Scenario#getDescription Description}
  • + *
  • {@link bpsim.Scenario#getId Id}
  • + *
  • {@link bpsim.Scenario#getInherits Inherits}
  • + *
  • {@link bpsim.Scenario#getModified Modified}
  • + *
  • {@link bpsim.Scenario#getName Name}
  • + *
  • {@link bpsim.Scenario#getResult Result}
  • + *
  • {@link bpsim.Scenario#getVendor Vendor}
  • + *
  • {@link bpsim.Scenario#getVersion Version}
  • + *
+ * + * @see bpsim.BpsimPackage#getScenario() + * @model extendedMetaData="name='Scenario' kind='elementOnly'" + * @generated + */ +public interface Scenario extends EObject { + /** + * Returns the value of the 'Scenario Parameters' containment reference. + * + * + * @return the value of the 'Scenario Parameters' containment reference. + * @see #setScenarioParameters(ScenarioParameters) + * @see bpsim.BpsimPackage#getScenario_ScenarioParameters() + * @model containment="true" + * extendedMetaData="kind='element' name='ScenarioParameters' namespace='##targetNamespace'" + * @generated + */ + ScenarioParameters getScenarioParameters(); + + /** + * Sets the value of the '{@link bpsim.Scenario#getScenarioParameters Scenario Parameters}' containment reference. + * + * + * @param value the new value of the 'Scenario Parameters' containment reference. + * @see #getScenarioParameters() + * @generated + */ + void setScenarioParameters(ScenarioParameters value); + + /** + * Returns the value of the 'Element Parameters' containment reference list. + * The list contents are of type {@link bpsim.ElementParameters}. + * + * + * @return the value of the 'Element Parameters' containment reference list. + * @see bpsim.BpsimPackage#getScenario_ElementParameters() + * @model containment="true" + * extendedMetaData="kind='element' name='ElementParameters' namespace='##targetNamespace'" + * @generated + */ + EList getElementParameters(); + + /** + * Returns the value of the 'Calendar' containment reference list. + * The list contents are of type {@link bpsim.Calendar}. + * + * + * @return the value of the 'Calendar' containment reference list. + * @see bpsim.BpsimPackage#getScenario_Calendar() + * @model containment="true" + * extendedMetaData="kind='element' name='Calendar' namespace='##targetNamespace'" + * @generated + */ + EList getCalendar(); + + /** + * Returns the value of the 'Vendor Extension' containment reference list. + * The list contents are of type {@link bpsim.VendorExtension}. + * + * + * @return the value of the 'Vendor Extension' containment reference list. + * @see bpsim.BpsimPackage#getScenario_VendorExtension() + * @model containment="true" + * extendedMetaData="kind='element' name='VendorExtension' namespace='##targetNamespace'" + * @generated + */ + EList getVendorExtension(); + + /** + * Returns the value of the 'Author' attribute. + * + * + * @return the value of the 'Author' attribute. + * @see #setAuthor(String) + * @see bpsim.BpsimPackage#getScenario_Author() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='attribute' name='author'" + * @generated + */ + String getAuthor(); + + /** + * Sets the value of the '{@link bpsim.Scenario#getAuthor Author}' attribute. + * + * + * @param value the new value of the 'Author' attribute. + * @see #getAuthor() + * @generated + */ + void setAuthor(String value); + + /** + * Returns the value of the 'Created' attribute. + * + * + * @return the value of the 'Created' attribute. + * @see #setCreated(XMLGregorianCalendar) + * @see bpsim.BpsimPackage#getScenario_Created() + * @model dataType="org.eclipse.emf.ecore.xml.type.DateTime" + * extendedMetaData="kind='attribute' name='created'" + * @generated + */ + XMLGregorianCalendar getCreated(); + + /** + * Sets the value of the '{@link bpsim.Scenario#getCreated Created}' attribute. + * + * + * @param value the new value of the 'Created' attribute. + * @see #getCreated() + * @generated + */ + void setCreated(XMLGregorianCalendar value); + + /** + * Returns the value of the 'Description' attribute. + * + * + * @return the value of the 'Description' attribute. + * @see #setDescription(String) + * @see bpsim.BpsimPackage#getScenario_Description() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='attribute' name='description'" + * @generated + */ + String getDescription(); + + /** + * Sets the value of the '{@link bpsim.Scenario#getDescription Description}' attribute. + * + * + * @param value the new value of the 'Description' attribute. + * @see #getDescription() + * @generated + */ + void setDescription(String value); + + /** + * Returns the value of the 'Id' attribute. + * + * + * @return the value of the 'Id' attribute. + * @see #setId(String) + * @see bpsim.BpsimPackage#getScenario_Id() + * @model id="true" dataType="org.eclipse.emf.ecore.xml.type.ID" required="true" + * extendedMetaData="kind='attribute' name='id'" + * @generated + */ + String getId(); + + /** + * Sets the value of the '{@link bpsim.Scenario#getId Id}' attribute. + * + * + * @param value the new value of the 'Id' attribute. + * @see #getId() + * @generated + */ + void setId(String value); + + /** + * Returns the value of the 'Inherits' attribute. + * + * + * @return the value of the 'Inherits' attribute. + * @see #setInherits(String) + * @see bpsim.BpsimPackage#getScenario_Inherits() + * @model dataType="org.eclipse.emf.ecore.xml.type.IDREF" + * extendedMetaData="kind='attribute' name='inherits'" + * @generated + */ + String getInherits(); + + /** + * Sets the value of the '{@link bpsim.Scenario#getInherits Inherits}' attribute. + * + * + * @param value the new value of the 'Inherits' attribute. + * @see #getInherits() + * @generated + */ + void setInherits(String value); + + /** + * Returns the value of the 'Modified' attribute. + * + * + * @return the value of the 'Modified' attribute. + * @see #setModified(XMLGregorianCalendar) + * @see bpsim.BpsimPackage#getScenario_Modified() + * @model dataType="org.eclipse.emf.ecore.xml.type.DateTime" + * extendedMetaData="kind='attribute' name='modified'" + * @generated + */ + XMLGregorianCalendar getModified(); + + /** + * Sets the value of the '{@link bpsim.Scenario#getModified Modified}' attribute. + * + * + * @param value the new value of the 'Modified' attribute. + * @see #getModified() + * @generated + */ + void setModified(XMLGregorianCalendar value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see bpsim.BpsimPackage#getScenario_Name() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link bpsim.Scenario#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Result' attribute. + * + * + * @return the value of the 'Result' attribute. + * @see #setResult(String) + * @see bpsim.BpsimPackage#getScenario_Result() + * @model dataType="org.eclipse.emf.ecore.xml.type.IDREF" + * extendedMetaData="kind='attribute' name='result'" + * @generated + */ + String getResult(); + + /** + * Sets the value of the '{@link bpsim.Scenario#getResult Result}' attribute. + * + * + * @param value the new value of the 'Result' attribute. + * @see #getResult() + * @generated + */ + void setResult(String value); + + /** + * Returns the value of the 'Vendor' attribute. + * + * + * @return the value of the 'Vendor' attribute. + * @see #setVendor(String) + * @see bpsim.BpsimPackage#getScenario_Vendor() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='attribute' name='vendor'" + * @generated + */ + String getVendor(); + + /** + * Sets the value of the '{@link bpsim.Scenario#getVendor Vendor}' attribute. + * + * + * @param value the new value of the 'Vendor' attribute. + * @see #getVendor() + * @generated + */ + void setVendor(String value); + + /** + * Returns the value of the 'Version' attribute. + * + * + * @return the value of the 'Version' attribute. + * @see #setVersion(String) + * @see bpsim.BpsimPackage#getScenario_Version() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='attribute' name='version'" + * @generated + */ + String getVersion(); + + /** + * Sets the value of the '{@link bpsim.Scenario#getVersion Version}' attribute. + * + * + * @param value the new value of the 'Version' attribute. + * @see #getVersion() + * @generated + */ + void setVersion(String value); + +} // Scenario diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ScenarioParameters.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ScenarioParameters.java new file mode 100644 index 00000000000..2d28dabe370 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ScenarioParameters.java @@ -0,0 +1,275 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Scenario Parameters'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.ScenarioParameters#getStart Start}
  • + *
  • {@link bpsim.ScenarioParameters#getDuration Duration}
  • + *
  • {@link bpsim.ScenarioParameters#getPropertyParameters Property Parameters}
  • + *
  • {@link bpsim.ScenarioParameters#getBaseCurrencyUnit Base Currency Unit}
  • + *
  • {@link bpsim.ScenarioParameters#getBaseTimeUnit Base Time Unit}
  • + *
  • {@link bpsim.ScenarioParameters#getReplication Replication}
  • + *
  • {@link bpsim.ScenarioParameters#getSeed Seed}
  • + *
+ * + * @see bpsim.BpsimPackage#getScenarioParameters() + * @model extendedMetaData="name='ScenarioParameters' kind='elementOnly'" + * @generated + */ +public interface ScenarioParameters extends EObject { + /** + * Returns the value of the 'Start' containment reference. + * + * + * @return the value of the 'Start' containment reference. + * @see #setStart(Parameter) + * @see bpsim.BpsimPackage#getScenarioParameters_Start() + * @model containment="true" + * extendedMetaData="kind='element' name='Start' namespace='##targetNamespace'" + * @generated + */ + Parameter getStart(); + + /** + * Sets the value of the '{@link bpsim.ScenarioParameters#getStart Start}' containment reference. + * + * + * @param value the new value of the 'Start' containment reference. + * @see #getStart() + * @generated + */ + void setStart(Parameter value); + + /** + * Returns the value of the 'Duration' containment reference. + * + * + * @return the value of the 'Duration' containment reference. + * @see #setDuration(Parameter) + * @see bpsim.BpsimPackage#getScenarioParameters_Duration() + * @model containment="true" + * extendedMetaData="kind='element' name='Duration' namespace='##targetNamespace'" + * @generated + */ + Parameter getDuration(); + + /** + * Sets the value of the '{@link bpsim.ScenarioParameters#getDuration Duration}' containment reference. + * + * + * @param value the new value of the 'Duration' containment reference. + * @see #getDuration() + * @generated + */ + void setDuration(Parameter value); + + /** + * Returns the value of the 'Property Parameters' containment reference. + * + * + * @return the value of the 'Property Parameters' containment reference. + * @see #setPropertyParameters(PropertyParameters) + * @see bpsim.BpsimPackage#getScenarioParameters_PropertyParameters() + * @model containment="true" + * extendedMetaData="kind='element' name='PropertyParameters' namespace='##targetNamespace'" + * @generated + */ + PropertyParameters getPropertyParameters(); + + /** + * Sets the value of the '{@link bpsim.ScenarioParameters#getPropertyParameters Property Parameters}' containment reference. + * + * + * @param value the new value of the 'Property Parameters' containment reference. + * @see #getPropertyParameters() + * @generated + */ + void setPropertyParameters(PropertyParameters value); + + /** + * Returns the value of the 'Base Currency Unit' attribute. + * + * + * @return the value of the 'Base Currency Unit' attribute. + * @see #setBaseCurrencyUnit(String) + * @see bpsim.BpsimPackage#getScenarioParameters_BaseCurrencyUnit() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='attribute' name='baseCurrencyUnit'" + * @generated + */ + String getBaseCurrencyUnit(); + + /** + * Sets the value of the '{@link bpsim.ScenarioParameters#getBaseCurrencyUnit Base Currency Unit}' attribute. + * + * + * @param value the new value of the 'Base Currency Unit' attribute. + * @see #getBaseCurrencyUnit() + * @generated + */ + void setBaseCurrencyUnit(String value); + + /** + * Returns the value of the 'Base Time Unit' attribute. + * The literals are from the enumeration {@link bpsim.TimeUnit}. + * + * + * @return the value of the 'Base Time Unit' attribute. + * @see bpsim.TimeUnit + * @see #isSetBaseTimeUnit() + * @see #unsetBaseTimeUnit() + * @see #setBaseTimeUnit(TimeUnit) + * @see bpsim.BpsimPackage#getScenarioParameters_BaseTimeUnit() + * @model unsettable="true" + * extendedMetaData="kind='attribute' name='baseTimeUnit'" + * @generated + */ + TimeUnit getBaseTimeUnit(); + + /** + * Sets the value of the '{@link bpsim.ScenarioParameters#getBaseTimeUnit Base Time Unit}' attribute. + * + * + * @param value the new value of the 'Base Time Unit' attribute. + * @see bpsim.TimeUnit + * @see #isSetBaseTimeUnit() + * @see #unsetBaseTimeUnit() + * @see #getBaseTimeUnit() + * @generated + */ + void setBaseTimeUnit(TimeUnit value); + + /** + * Unsets the value of the '{@link bpsim.ScenarioParameters#getBaseTimeUnit Base Time Unit}' attribute. + * + * + * @see #isSetBaseTimeUnit() + * @see #getBaseTimeUnit() + * @see #setBaseTimeUnit(TimeUnit) + * @generated + */ + void unsetBaseTimeUnit(); + + /** + * Returns whether the value of the '{@link bpsim.ScenarioParameters#getBaseTimeUnit Base Time Unit}' attribute is set. + * + * + * @return whether the value of the 'Base Time Unit' attribute is set. + * @see #unsetBaseTimeUnit() + * @see #getBaseTimeUnit() + * @see #setBaseTimeUnit(TimeUnit) + * @generated + */ + boolean isSetBaseTimeUnit(); + + /** + * Returns the value of the 'Replication' attribute. + * + * + * @return the value of the 'Replication' attribute. + * @see #isSetReplication() + * @see #unsetReplication() + * @see #setReplication(int) + * @see bpsim.BpsimPackage#getScenarioParameters_Replication() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Int" + * extendedMetaData="kind='attribute' name='replication'" + * @generated + */ + int getReplication(); + + /** + * Sets the value of the '{@link bpsim.ScenarioParameters#getReplication Replication}' attribute. + * + * + * @param value the new value of the 'Replication' attribute. + * @see #isSetReplication() + * @see #unsetReplication() + * @see #getReplication() + * @generated + */ + void setReplication(int value); + + /** + * Unsets the value of the '{@link bpsim.ScenarioParameters#getReplication Replication}' attribute. + * + * + * @see #isSetReplication() + * @see #getReplication() + * @see #setReplication(int) + * @generated + */ + void unsetReplication(); + + /** + * Returns whether the value of the '{@link bpsim.ScenarioParameters#getReplication Replication}' attribute is set. + * + * + * @return whether the value of the 'Replication' attribute is set. + * @see #unsetReplication() + * @see #getReplication() + * @see #setReplication(int) + * @generated + */ + boolean isSetReplication(); + + /** + * Returns the value of the 'Seed' attribute. + * + * + * @return the value of the 'Seed' attribute. + * @see #isSetSeed() + * @see #unsetSeed() + * @see #setSeed(long) + * @see bpsim.BpsimPackage#getScenarioParameters_Seed() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Long" + * extendedMetaData="kind='attribute' name='seed'" + * @generated + */ + long getSeed(); + + /** + * Sets the value of the '{@link bpsim.ScenarioParameters#getSeed Seed}' attribute. + * + * + * @param value the new value of the 'Seed' attribute. + * @see #isSetSeed() + * @see #unsetSeed() + * @see #getSeed() + * @generated + */ + void setSeed(long value); + + /** + * Unsets the value of the '{@link bpsim.ScenarioParameters#getSeed Seed}' attribute. + * + * + * @see #isSetSeed() + * @see #getSeed() + * @see #setSeed(long) + * @generated + */ + void unsetSeed(); + + /** + * Returns whether the value of the '{@link bpsim.ScenarioParameters#getSeed Seed}' attribute is set. + * + * + * @return whether the value of the 'Seed' attribute is set. + * @see #unsetSeed() + * @see #getSeed() + * @see #setSeed(long) + * @generated + */ + boolean isSetSeed(); + +} // ScenarioParameters diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ScenarioParametersType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ScenarioParametersType.java new file mode 100644 index 00000000000..22ae34388c9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/ScenarioParametersType.java @@ -0,0 +1,17 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Scenario Parameters Type'. + * + * + * + * @see bpsim.BpsimPackage#getScenarioParametersType() + * @model extendedMetaData="name='ScenarioParameters_._type' kind='elementOnly'" + * @generated + */ +public interface ScenarioParametersType extends ScenarioParameters { +} // ScenarioParametersType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/StringParameterType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/StringParameterType.java new file mode 100644 index 00000000000..e783e7f9337 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/StringParameterType.java @@ -0,0 +1,46 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'String Parameter Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.StringParameterType#getValue Value}
  • + *
+ * + * @see bpsim.BpsimPackage#getStringParameterType() + * @model extendedMetaData="name='StringParameter_._type' kind='empty'" + * @generated + */ +public interface StringParameterType extends ConstantParameter { + /** + * Returns the value of the 'Value' attribute. + * + * + * @return the value of the 'Value' attribute. + * @see #setValue(String) + * @see bpsim.BpsimPackage#getStringParameterType_Value() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='attribute' name='value'" + * @generated + */ + String getValue(); + + /** + * Sets the value of the '{@link bpsim.StringParameterType#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(String value); + +} // StringParameterType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/TimeParameters.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/TimeParameters.java new file mode 100644 index 00000000000..837dd2d0564 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/TimeParameters.java @@ -0,0 +1,191 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Time Parameters'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.TimeParameters#getTransferTime Transfer Time}
  • + *
  • {@link bpsim.TimeParameters#getQueueTime Queue Time}
  • + *
  • {@link bpsim.TimeParameters#getWaitTime Wait Time}
  • + *
  • {@link bpsim.TimeParameters#getSetUpTime Set Up Time}
  • + *
  • {@link bpsim.TimeParameters#getProcessingTime Processing Time}
  • + *
  • {@link bpsim.TimeParameters#getValidationTime Validation Time}
  • + *
  • {@link bpsim.TimeParameters#getReworkTime Rework Time}
  • + *
+ * + * @see bpsim.BpsimPackage#getTimeParameters() + * @model extendedMetaData="name='TimeParameters' kind='elementOnly'" + * @generated + */ +public interface TimeParameters extends EObject { + /** + * Returns the value of the 'Transfer Time' containment reference. + * + * + * @return the value of the 'Transfer Time' containment reference. + * @see #setTransferTime(Parameter) + * @see bpsim.BpsimPackage#getTimeParameters_TransferTime() + * @model containment="true" + * extendedMetaData="kind='element' name='TransferTime' namespace='##targetNamespace'" + * @generated + */ + Parameter getTransferTime(); + + /** + * Sets the value of the '{@link bpsim.TimeParameters#getTransferTime Transfer Time}' containment reference. + * + * + * @param value the new value of the 'Transfer Time' containment reference. + * @see #getTransferTime() + * @generated + */ + void setTransferTime(Parameter value); + + /** + * Returns the value of the 'Queue Time' containment reference. + * + * + * @return the value of the 'Queue Time' containment reference. + * @see #setQueueTime(Parameter) + * @see bpsim.BpsimPackage#getTimeParameters_QueueTime() + * @model containment="true" + * extendedMetaData="kind='element' name='QueueTime' namespace='##targetNamespace'" + * @generated + */ + Parameter getQueueTime(); + + /** + * Sets the value of the '{@link bpsim.TimeParameters#getQueueTime Queue Time}' containment reference. + * + * + * @param value the new value of the 'Queue Time' containment reference. + * @see #getQueueTime() + * @generated + */ + void setQueueTime(Parameter value); + + /** + * Returns the value of the 'Wait Time' containment reference. + * + * + * @return the value of the 'Wait Time' containment reference. + * @see #setWaitTime(Parameter) + * @see bpsim.BpsimPackage#getTimeParameters_WaitTime() + * @model containment="true" + * extendedMetaData="kind='element' name='WaitTime' namespace='##targetNamespace'" + * @generated + */ + Parameter getWaitTime(); + + /** + * Sets the value of the '{@link bpsim.TimeParameters#getWaitTime Wait Time}' containment reference. + * + * + * @param value the new value of the 'Wait Time' containment reference. + * @see #getWaitTime() + * @generated + */ + void setWaitTime(Parameter value); + + /** + * Returns the value of the 'Set Up Time' containment reference. + * + * + * @return the value of the 'Set Up Time' containment reference. + * @see #setSetUpTime(Parameter) + * @see bpsim.BpsimPackage#getTimeParameters_SetUpTime() + * @model containment="true" + * extendedMetaData="kind='element' name='SetUpTime' namespace='##targetNamespace'" + * @generated + */ + Parameter getSetUpTime(); + + /** + * Sets the value of the '{@link bpsim.TimeParameters#getSetUpTime Set Up Time}' containment reference. + * + * + * @param value the new value of the 'Set Up Time' containment reference. + * @see #getSetUpTime() + * @generated + */ + void setSetUpTime(Parameter value); + + /** + * Returns the value of the 'Processing Time' containment reference. + * + * + * @return the value of the 'Processing Time' containment reference. + * @see #setProcessingTime(Parameter) + * @see bpsim.BpsimPackage#getTimeParameters_ProcessingTime() + * @model containment="true" + * extendedMetaData="kind='element' name='ProcessingTime' namespace='##targetNamespace'" + * @generated + */ + Parameter getProcessingTime(); + + /** + * Sets the value of the '{@link bpsim.TimeParameters#getProcessingTime Processing Time}' containment reference. + * + * + * @param value the new value of the 'Processing Time' containment reference. + * @see #getProcessingTime() + * @generated + */ + void setProcessingTime(Parameter value); + + /** + * Returns the value of the 'Validation Time' containment reference. + * + * + * @return the value of the 'Validation Time' containment reference. + * @see #setValidationTime(Parameter) + * @see bpsim.BpsimPackage#getTimeParameters_ValidationTime() + * @model containment="true" + * extendedMetaData="kind='element' name='ValidationTime' namespace='##targetNamespace'" + * @generated + */ + Parameter getValidationTime(); + + /** + * Sets the value of the '{@link bpsim.TimeParameters#getValidationTime Validation Time}' containment reference. + * + * + * @param value the new value of the 'Validation Time' containment reference. + * @see #getValidationTime() + * @generated + */ + void setValidationTime(Parameter value); + + /** + * Returns the value of the 'Rework Time' containment reference. + * + * + * @return the value of the 'Rework Time' containment reference. + * @see #setReworkTime(Parameter) + * @see bpsim.BpsimPackage#getTimeParameters_ReworkTime() + * @model containment="true" + * extendedMetaData="kind='element' name='ReworkTime' namespace='##targetNamespace'" + * @generated + */ + Parameter getReworkTime(); + + /** + * Sets the value of the '{@link bpsim.TimeParameters#getReworkTime Rework Time}' containment reference. + * + * + * @param value the new value of the 'Rework Time' containment reference. + * @see #getReworkTime() + * @generated + */ + void setReworkTime(Parameter value); + +} // TimeParameters diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/TimeUnit.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/TimeUnit.java new file mode 100644 index 00000000000..b1c89429e1b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/TimeUnit.java @@ -0,0 +1,301 @@ +/** + */ +package bpsim; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Time Unit', + * and utility methods for working with them. + * + * @see bpsim.BpsimPackage#getTimeUnit() + * @model extendedMetaData="name='TimeUnit'" + * @generated + */ +public enum TimeUnit implements Enumerator { + /** + * The 'Ms' literal object. + * + * + * @see #MS_VALUE + * @generated + * @ordered + */ + MS(0, "ms", "ms"), + + /** + * The 'S' literal object. + * + * + * @see #S_VALUE + * @generated + * @ordered + */ + S(1, "s", "s"), + + /** + * The 'Min' literal object. + * + * + * @see #MIN_VALUE + * @generated + * @ordered + */ + MIN(2, "min", "min"), + + /** + * The 'Hour' literal object. + * + * + * @see #HOUR_VALUE + * @generated + * @ordered + */ + HOUR(3, "hour", "hour"), + + /** + * The 'Day' literal object. + * + * + * @see #DAY_VALUE + * @generated + * @ordered + */ + DAY(4, "day", "day"), + + /** + * The 'Year' literal object. + * + * + * @see #YEAR_VALUE + * @generated + * @ordered + */ + YEAR(5, "year", "year"); + + /** + * The 'Ms' literal value. + * + * + * @see #MS + * @model name="ms" + * @generated + * @ordered + */ + public static final int MS_VALUE = 0; + + /** + * The 'S' literal value. + * + * + * @see #S + * @model name="s" + * @generated + * @ordered + */ + public static final int S_VALUE = 1; + + /** + * The 'Min' literal value. + * + * + * @see #MIN + * @model name="min" + * @generated + * @ordered + */ + public static final int MIN_VALUE = 2; + + /** + * The 'Hour' literal value. + * + * + * @see #HOUR + * @model name="hour" + * @generated + * @ordered + */ + public static final int HOUR_VALUE = 3; + + /** + * The 'Day' literal value. + * + * + * @see #DAY + * @model name="day" + * @generated + * @ordered + */ + public static final int DAY_VALUE = 4; + + /** + * The 'Year' literal value. + * + * + * @see #YEAR + * @model name="year" + * @generated + * @ordered + */ + public static final int YEAR_VALUE = 5; + + /** + * An array of all the 'Time Unit' enumerators. + * + * + * @generated + */ + private static final TimeUnit[] VALUES_ARRAY = + new TimeUnit[] { + MS, + S, + MIN, + HOUR, + DAY, + YEAR, + }; + + /** + * A public read-only list of all the 'Time Unit' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Time Unit' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static TimeUnit get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + TimeUnit result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Time Unit' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static TimeUnit getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + TimeUnit result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Time Unit' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static TimeUnit get(int value) { + switch (value) { + case MS_VALUE: return MS; + case S_VALUE: return S; + case MIN_VALUE: return MIN; + case HOUR_VALUE: return HOUR; + case DAY_VALUE: return DAY; + case YEAR_VALUE: return YEAR; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private TimeUnit(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //TimeUnit diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/TriangularDistributionType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/TriangularDistributionType.java new file mode 100644 index 00000000000..26fc4e4e1fd --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/TriangularDistributionType.java @@ -0,0 +1,175 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Triangular Distribution Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.TriangularDistributionType#getMax Max}
  • + *
  • {@link bpsim.TriangularDistributionType#getMin Min}
  • + *
  • {@link bpsim.TriangularDistributionType#getMode Mode}
  • + *
+ * + * @see bpsim.BpsimPackage#getTriangularDistributionType() + * @model extendedMetaData="name='TriangularDistribution_._type' kind='empty'" + * @generated + */ +public interface TriangularDistributionType extends DistributionParameter { + /** + * Returns the value of the 'Max' attribute. + * + * + * @return the value of the 'Max' attribute. + * @see #isSetMax() + * @see #unsetMax() + * @see #setMax(double) + * @see bpsim.BpsimPackage#getTriangularDistributionType_Max() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='max'" + * @generated + */ + double getMax(); + + /** + * Sets the value of the '{@link bpsim.TriangularDistributionType#getMax Max}' attribute. + * + * + * @param value the new value of the 'Max' attribute. + * @see #isSetMax() + * @see #unsetMax() + * @see #getMax() + * @generated + */ + void setMax(double value); + + /** + * Unsets the value of the '{@link bpsim.TriangularDistributionType#getMax Max}' attribute. + * + * + * @see #isSetMax() + * @see #getMax() + * @see #setMax(double) + * @generated + */ + void unsetMax(); + + /** + * Returns whether the value of the '{@link bpsim.TriangularDistributionType#getMax Max}' attribute is set. + * + * + * @return whether the value of the 'Max' attribute is set. + * @see #unsetMax() + * @see #getMax() + * @see #setMax(double) + * @generated + */ + boolean isSetMax(); + + /** + * Returns the value of the 'Min' attribute. + * + * + * @return the value of the 'Min' attribute. + * @see #isSetMin() + * @see #unsetMin() + * @see #setMin(double) + * @see bpsim.BpsimPackage#getTriangularDistributionType_Min() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='min'" + * @generated + */ + double getMin(); + + /** + * Sets the value of the '{@link bpsim.TriangularDistributionType#getMin Min}' attribute. + * + * + * @param value the new value of the 'Min' attribute. + * @see #isSetMin() + * @see #unsetMin() + * @see #getMin() + * @generated + */ + void setMin(double value); + + /** + * Unsets the value of the '{@link bpsim.TriangularDistributionType#getMin Min}' attribute. + * + * + * @see #isSetMin() + * @see #getMin() + * @see #setMin(double) + * @generated + */ + void unsetMin(); + + /** + * Returns whether the value of the '{@link bpsim.TriangularDistributionType#getMin Min}' attribute is set. + * + * + * @return whether the value of the 'Min' attribute is set. + * @see #unsetMin() + * @see #getMin() + * @see #setMin(double) + * @generated + */ + boolean isSetMin(); + + /** + * Returns the value of the 'Mode' attribute. + * + * + * @return the value of the 'Mode' attribute. + * @see #isSetMode() + * @see #unsetMode() + * @see #setMode(double) + * @see bpsim.BpsimPackage#getTriangularDistributionType_Mode() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='mode'" + * @generated + */ + double getMode(); + + /** + * Sets the value of the '{@link bpsim.TriangularDistributionType#getMode Mode}' attribute. + * + * + * @param value the new value of the 'Mode' attribute. + * @see #isSetMode() + * @see #unsetMode() + * @see #getMode() + * @generated + */ + void setMode(double value); + + /** + * Unsets the value of the '{@link bpsim.TriangularDistributionType#getMode Mode}' attribute. + * + * + * @see #isSetMode() + * @see #getMode() + * @see #setMode(double) + * @generated + */ + void unsetMode(); + + /** + * Returns whether the value of the '{@link bpsim.TriangularDistributionType#getMode Mode}' attribute is set. + * + * + * @return whether the value of the 'Mode' attribute is set. + * @see #unsetMode() + * @see #getMode() + * @see #setMode(double) + * @generated + */ + boolean isSetMode(); + +} // TriangularDistributionType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/TruncatedNormalDistributionType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/TruncatedNormalDistributionType.java new file mode 100644 index 00000000000..b6f3292ef42 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/TruncatedNormalDistributionType.java @@ -0,0 +1,226 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Truncated Normal Distribution Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.TruncatedNormalDistributionType#getMax Max}
  • + *
  • {@link bpsim.TruncatedNormalDistributionType#getMean Mean}
  • + *
  • {@link bpsim.TruncatedNormalDistributionType#getMin Min}
  • + *
  • {@link bpsim.TruncatedNormalDistributionType#getStandardDeviation Standard Deviation}
  • + *
+ * + * @see bpsim.BpsimPackage#getTruncatedNormalDistributionType() + * @model extendedMetaData="name='TruncatedNormalDistribution_._type' kind='empty'" + * @generated + */ +public interface TruncatedNormalDistributionType extends DistributionParameter { + /** + * Returns the value of the 'Max' attribute. + * + * + * @return the value of the 'Max' attribute. + * @see #isSetMax() + * @see #unsetMax() + * @see #setMax(double) + * @see bpsim.BpsimPackage#getTruncatedNormalDistributionType_Max() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='max'" + * @generated + */ + double getMax(); + + /** + * Sets the value of the '{@link bpsim.TruncatedNormalDistributionType#getMax Max}' attribute. + * + * + * @param value the new value of the 'Max' attribute. + * @see #isSetMax() + * @see #unsetMax() + * @see #getMax() + * @generated + */ + void setMax(double value); + + /** + * Unsets the value of the '{@link bpsim.TruncatedNormalDistributionType#getMax Max}' attribute. + * + * + * @see #isSetMax() + * @see #getMax() + * @see #setMax(double) + * @generated + */ + void unsetMax(); + + /** + * Returns whether the value of the '{@link bpsim.TruncatedNormalDistributionType#getMax Max}' attribute is set. + * + * + * @return whether the value of the 'Max' attribute is set. + * @see #unsetMax() + * @see #getMax() + * @see #setMax(double) + * @generated + */ + boolean isSetMax(); + + /** + * Returns the value of the 'Mean' attribute. + * + * + * @return the value of the 'Mean' attribute. + * @see #isSetMean() + * @see #unsetMean() + * @see #setMean(double) + * @see bpsim.BpsimPackage#getTruncatedNormalDistributionType_Mean() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='mean'" + * @generated + */ + double getMean(); + + /** + * Sets the value of the '{@link bpsim.TruncatedNormalDistributionType#getMean Mean}' attribute. + * + * + * @param value the new value of the 'Mean' attribute. + * @see #isSetMean() + * @see #unsetMean() + * @see #getMean() + * @generated + */ + void setMean(double value); + + /** + * Unsets the value of the '{@link bpsim.TruncatedNormalDistributionType#getMean Mean}' attribute. + * + * + * @see #isSetMean() + * @see #getMean() + * @see #setMean(double) + * @generated + */ + void unsetMean(); + + /** + * Returns whether the value of the '{@link bpsim.TruncatedNormalDistributionType#getMean Mean}' attribute is set. + * + * + * @return whether the value of the 'Mean' attribute is set. + * @see #unsetMean() + * @see #getMean() + * @see #setMean(double) + * @generated + */ + boolean isSetMean(); + + /** + * Returns the value of the 'Min' attribute. + * + * + * @return the value of the 'Min' attribute. + * @see #isSetMin() + * @see #unsetMin() + * @see #setMin(double) + * @see bpsim.BpsimPackage#getTruncatedNormalDistributionType_Min() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='min'" + * @generated + */ + double getMin(); + + /** + * Sets the value of the '{@link bpsim.TruncatedNormalDistributionType#getMin Min}' attribute. + * + * + * @param value the new value of the 'Min' attribute. + * @see #isSetMin() + * @see #unsetMin() + * @see #getMin() + * @generated + */ + void setMin(double value); + + /** + * Unsets the value of the '{@link bpsim.TruncatedNormalDistributionType#getMin Min}' attribute. + * + * + * @see #isSetMin() + * @see #getMin() + * @see #setMin(double) + * @generated + */ + void unsetMin(); + + /** + * Returns whether the value of the '{@link bpsim.TruncatedNormalDistributionType#getMin Min}' attribute is set. + * + * + * @return whether the value of the 'Min' attribute is set. + * @see #unsetMin() + * @see #getMin() + * @see #setMin(double) + * @generated + */ + boolean isSetMin(); + + /** + * Returns the value of the 'Standard Deviation' attribute. + * + * + * @return the value of the 'Standard Deviation' attribute. + * @see #isSetStandardDeviation() + * @see #unsetStandardDeviation() + * @see #setStandardDeviation(double) + * @see bpsim.BpsimPackage#getTruncatedNormalDistributionType_StandardDeviation() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='standardDeviation'" + * @generated + */ + double getStandardDeviation(); + + /** + * Sets the value of the '{@link bpsim.TruncatedNormalDistributionType#getStandardDeviation Standard Deviation}' attribute. + * + * + * @param value the new value of the 'Standard Deviation' attribute. + * @see #isSetStandardDeviation() + * @see #unsetStandardDeviation() + * @see #getStandardDeviation() + * @generated + */ + void setStandardDeviation(double value); + + /** + * Unsets the value of the '{@link bpsim.TruncatedNormalDistributionType#getStandardDeviation Standard Deviation}' attribute. + * + * + * @see #isSetStandardDeviation() + * @see #getStandardDeviation() + * @see #setStandardDeviation(double) + * @generated + */ + void unsetStandardDeviation(); + + /** + * Returns whether the value of the '{@link bpsim.TruncatedNormalDistributionType#getStandardDeviation Standard Deviation}' attribute is set. + * + * + * @return whether the value of the 'Standard Deviation' attribute is set. + * @see #unsetStandardDeviation() + * @see #getStandardDeviation() + * @see #setStandardDeviation(double) + * @generated + */ + boolean isSetStandardDeviation(); + +} // TruncatedNormalDistributionType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/UniformDistributionType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/UniformDistributionType.java new file mode 100644 index 00000000000..b82bca0a320 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/UniformDistributionType.java @@ -0,0 +1,124 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Uniform Distribution Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.UniformDistributionType#getMax Max}
  • + *
  • {@link bpsim.UniformDistributionType#getMin Min}
  • + *
+ * + * @see bpsim.BpsimPackage#getUniformDistributionType() + * @model extendedMetaData="name='UniformDistribution_._type' kind='empty'" + * @generated + */ +public interface UniformDistributionType extends DistributionParameter { + /** + * Returns the value of the 'Max' attribute. + * + * + * @return the value of the 'Max' attribute. + * @see #isSetMax() + * @see #unsetMax() + * @see #setMax(double) + * @see bpsim.BpsimPackage#getUniformDistributionType_Max() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='max'" + * @generated + */ + double getMax(); + + /** + * Sets the value of the '{@link bpsim.UniformDistributionType#getMax Max}' attribute. + * + * + * @param value the new value of the 'Max' attribute. + * @see #isSetMax() + * @see #unsetMax() + * @see #getMax() + * @generated + */ + void setMax(double value); + + /** + * Unsets the value of the '{@link bpsim.UniformDistributionType#getMax Max}' attribute. + * + * + * @see #isSetMax() + * @see #getMax() + * @see #setMax(double) + * @generated + */ + void unsetMax(); + + /** + * Returns whether the value of the '{@link bpsim.UniformDistributionType#getMax Max}' attribute is set. + * + * + * @return whether the value of the 'Max' attribute is set. + * @see #unsetMax() + * @see #getMax() + * @see #setMax(double) + * @generated + */ + boolean isSetMax(); + + /** + * Returns the value of the 'Min' attribute. + * + * + * @return the value of the 'Min' attribute. + * @see #isSetMin() + * @see #unsetMin() + * @see #setMin(double) + * @see bpsim.BpsimPackage#getUniformDistributionType_Min() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='min'" + * @generated + */ + double getMin(); + + /** + * Sets the value of the '{@link bpsim.UniformDistributionType#getMin Min}' attribute. + * + * + * @param value the new value of the 'Min' attribute. + * @see #isSetMin() + * @see #unsetMin() + * @see #getMin() + * @generated + */ + void setMin(double value); + + /** + * Unsets the value of the '{@link bpsim.UniformDistributionType#getMin Min}' attribute. + * + * + * @see #isSetMin() + * @see #getMin() + * @see #setMin(double) + * @generated + */ + void unsetMin(); + + /** + * Returns whether the value of the '{@link bpsim.UniformDistributionType#getMin Min}' attribute is set. + * + * + * @return whether the value of the 'Min' attribute is set. + * @see #unsetMin() + * @see #getMin() + * @see #setMin(double) + * @generated + */ + boolean isSetMin(); + +} // UniformDistributionType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/UserDistributionDataPointType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/UserDistributionDataPointType.java new file mode 100644 index 00000000000..c88df3d8877 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/UserDistributionDataPointType.java @@ -0,0 +1,114 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'User Distribution Data Point Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.UserDistributionDataPointType#getParameterValueGroup Parameter Value Group}
  • + *
  • {@link bpsim.UserDistributionDataPointType#getParameterValue Parameter Value}
  • + *
  • {@link bpsim.UserDistributionDataPointType#getProbability Probability}
  • + *
+ * + * @see bpsim.BpsimPackage#getUserDistributionDataPointType() + * @model extendedMetaData="name='UserDistributionDataPoint_._type' kind='elementOnly'" + * @generated + */ +public interface UserDistributionDataPointType extends EObject { + /** + * Returns the value of the 'Parameter Value Group' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Parameter Value Group' attribute list. + * @see bpsim.BpsimPackage#getUserDistributionDataPointType_ParameterValueGroup() + * @model dataType="org.eclipse.emf.ecore.EFeatureMapEntry" required="true" many="false" + * extendedMetaData="kind='group' name='ParameterValue:group' namespace='##targetNamespace'" + * @generated + */ + FeatureMap getParameterValueGroup(); + + /** + * Returns the value of the 'Parameter Value' containment reference. + * + * + * @return the value of the 'Parameter Value' containment reference. + * @see #setParameterValue(ParameterValue) + * @see bpsim.BpsimPackage#getUserDistributionDataPointType_ParameterValue() + * @model containment="true" required="true" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='ParameterValue' namespace='##targetNamespace' group='ParameterValue:group'" + * @generated + */ + ParameterValue getParameterValue(); + + /** + * Sets the value of the '{@link bpsim.UserDistributionDataPointType#getParameterValue Parameter Value}' containment reference. + * + * + * @param value the new value of the 'Parameter Value' containment reference. + * @see #getParameterValue() + * @generated + */ + void setParameterValue(ParameterValue value); + + /** + * Returns the value of the 'Probability' attribute. + * + * + * @return the value of the 'Probability' attribute. + * @see #isSetProbability() + * @see #unsetProbability() + * @see #setProbability(float) + * @see bpsim.BpsimPackage#getUserDistributionDataPointType_Probability() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Float" + * extendedMetaData="kind='attribute' name='probability'" + * @generated + */ + float getProbability(); + + /** + * Sets the value of the '{@link bpsim.UserDistributionDataPointType#getProbability Probability}' attribute. + * + * + * @param value the new value of the 'Probability' attribute. + * @see #isSetProbability() + * @see #unsetProbability() + * @see #getProbability() + * @generated + */ + void setProbability(float value); + + /** + * Unsets the value of the '{@link bpsim.UserDistributionDataPointType#getProbability Probability}' attribute. + * + * + * @see #isSetProbability() + * @see #getProbability() + * @see #setProbability(float) + * @generated + */ + void unsetProbability(); + + /** + * Returns whether the value of the '{@link bpsim.UserDistributionDataPointType#getProbability Probability}' attribute is set. + * + * + * @return whether the value of the 'Probability' attribute is set. + * @see #unsetProbability() + * @see #getProbability() + * @see #setProbability(float) + * @generated + */ + boolean isSetProbability(); + +} // UserDistributionDataPointType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/UserDistributionType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/UserDistributionType.java new file mode 100644 index 00000000000..66f114d4b69 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/UserDistributionType.java @@ -0,0 +1,105 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'User Distribution Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.UserDistributionType#getGroup Group}
  • + *
  • {@link bpsim.UserDistributionType#getUserDistributionDataPoint User Distribution Data Point}
  • + *
  • {@link bpsim.UserDistributionType#isDiscrete Discrete}
  • + *
+ * + * @see bpsim.BpsimPackage#getUserDistributionType() + * @model extendedMetaData="name='UserDistribution_._type' kind='elementOnly'" + * @generated + */ +public interface UserDistributionType extends DistributionParameter { + /** + * Returns the value of the 'Group' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Group' attribute list. + * @see bpsim.BpsimPackage#getUserDistributionType_Group() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='group' name='group:5'" + * @generated + */ + FeatureMap getGroup(); + + /** + * Returns the value of the 'User Distribution Data Point' containment reference list. + * The list contents are of type {@link bpsim.UserDistributionDataPointType}. + * + * + * @return the value of the 'User Distribution Data Point' containment reference list. + * @see bpsim.BpsimPackage#getUserDistributionType_UserDistributionDataPoint() + * @model containment="true" required="true" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='UserDistributionDataPoint' namespace='##targetNamespace' group='#group:5'" + * @generated + */ + EList getUserDistributionDataPoint(); + + /** + * Returns the value of the 'Discrete' attribute. + * The default value is "false". + * + * + * @return the value of the 'Discrete' attribute. + * @see #isSetDiscrete() + * @see #unsetDiscrete() + * @see #setDiscrete(boolean) + * @see bpsim.BpsimPackage#getUserDistributionType_Discrete() + * @model default="false" unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Boolean" + * extendedMetaData="kind='attribute' name='discrete'" + * @generated + */ + boolean isDiscrete(); + + /** + * Sets the value of the '{@link bpsim.UserDistributionType#isDiscrete Discrete}' attribute. + * + * + * @param value the new value of the 'Discrete' attribute. + * @see #isSetDiscrete() + * @see #unsetDiscrete() + * @see #isDiscrete() + * @generated + */ + void setDiscrete(boolean value); + + /** + * Unsets the value of the '{@link bpsim.UserDistributionType#isDiscrete Discrete}' attribute. + * + * + * @see #isSetDiscrete() + * @see #isDiscrete() + * @see #setDiscrete(boolean) + * @generated + */ + void unsetDiscrete(); + + /** + * Returns whether the value of the '{@link bpsim.UserDistributionType#isDiscrete Discrete}' attribute is set. + * + * + * @return whether the value of the 'Discrete' attribute is set. + * @see #unsetDiscrete() + * @see #isDiscrete() + * @see #setDiscrete(boolean) + * @generated + */ + boolean isSetDiscrete(); + +} // UserDistributionType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/VendorExtension.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/VendorExtension.java new file mode 100644 index 00000000000..a5e4cbeb74a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/VendorExtension.java @@ -0,0 +1,77 @@ +/** + */ +package bpsim; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'Vendor Extension'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.VendorExtension#getAny Any}
  • + *
  • {@link bpsim.VendorExtension#getName Name}
  • + *
  • {@link bpsim.VendorExtension#getAnyAttribute Any Attribute}
  • + *
+ * + * @see bpsim.BpsimPackage#getVendorExtension() + * @model extendedMetaData="name='VendorExtension' kind='elementOnly'" + * @generated + */ +public interface VendorExtension extends EObject { + /** + * Returns the value of the 'Any' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Any' attribute list. + * @see bpsim.BpsimPackage#getVendorExtension_Any() + * @model dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="false" + * extendedMetaData="kind='elementWildcard' wildcards='##other' name=':0' processing='strict'" + * @generated + */ + FeatureMap getAny(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see bpsim.BpsimPackage#getVendorExtension_Name() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link bpsim.VendorExtension#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Any Attribute' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Any Attribute' attribute list. + * @see bpsim.BpsimPackage#getVendorExtension_AnyAttribute() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='attributeWildcard' wildcards='##other' name=':2' processing='strict'" + * @generated + */ + FeatureMap getAnyAttribute(); + +} // VendorExtension diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/WeibullDistributionType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/WeibullDistributionType.java new file mode 100644 index 00000000000..f90df36a480 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/WeibullDistributionType.java @@ -0,0 +1,124 @@ +/** + */ +package bpsim; + + +/** + * + * A representation of the model object 'Weibull Distribution Type'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link bpsim.WeibullDistributionType#getScale Scale}
  • + *
  • {@link bpsim.WeibullDistributionType#getShape Shape}
  • + *
+ * + * @see bpsim.BpsimPackage#getWeibullDistributionType() + * @model extendedMetaData="name='WeibullDistribution_._type' kind='empty'" + * @generated + */ +public interface WeibullDistributionType extends DistributionParameter { + /** + * Returns the value of the 'Scale' attribute. + * + * + * @return the value of the 'Scale' attribute. + * @see #isSetScale() + * @see #unsetScale() + * @see #setScale(double) + * @see bpsim.BpsimPackage#getWeibullDistributionType_Scale() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='scale'" + * @generated + */ + double getScale(); + + /** + * Sets the value of the '{@link bpsim.WeibullDistributionType#getScale Scale}' attribute. + * + * + * @param value the new value of the 'Scale' attribute. + * @see #isSetScale() + * @see #unsetScale() + * @see #getScale() + * @generated + */ + void setScale(double value); + + /** + * Unsets the value of the '{@link bpsim.WeibullDistributionType#getScale Scale}' attribute. + * + * + * @see #isSetScale() + * @see #getScale() + * @see #setScale(double) + * @generated + */ + void unsetScale(); + + /** + * Returns whether the value of the '{@link bpsim.WeibullDistributionType#getScale Scale}' attribute is set. + * + * + * @return whether the value of the 'Scale' attribute is set. + * @see #unsetScale() + * @see #getScale() + * @see #setScale(double) + * @generated + */ + boolean isSetScale(); + + /** + * Returns the value of the 'Shape' attribute. + * + * + * @return the value of the 'Shape' attribute. + * @see #isSetShape() + * @see #unsetShape() + * @see #setShape(double) + * @see bpsim.BpsimPackage#getWeibullDistributionType_Shape() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Double" + * extendedMetaData="kind='attribute' name='shape'" + * @generated + */ + double getShape(); + + /** + * Sets the value of the '{@link bpsim.WeibullDistributionType#getShape Shape}' attribute. + * + * + * @param value the new value of the 'Shape' attribute. + * @see #isSetShape() + * @see #unsetShape() + * @see #getShape() + * @generated + */ + void setShape(double value); + + /** + * Unsets the value of the '{@link bpsim.WeibullDistributionType#getShape Shape}' attribute. + * + * + * @see #isSetShape() + * @see #getShape() + * @see #setShape(double) + * @generated + */ + void unsetShape(); + + /** + * Returns whether the value of the '{@link bpsim.WeibullDistributionType#getShape Shape}' attribute is set. + * + * + * @return whether the value of the 'Shape' attribute is set. + * @see #unsetShape() + * @see #getShape() + * @see #setShape(double) + * @generated + */ + boolean isSetShape(); + +} // WeibullDistributionType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BPSimDataTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BPSimDataTypeImpl.java new file mode 100644 index 00000000000..35359268897 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BPSimDataTypeImpl.java @@ -0,0 +1,197 @@ +/** + */ +package bpsim.impl; + +import bpsim.BPSimDataType; +import bpsim.BpsimPackage; +import bpsim.Scenario; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'BP Sim Data Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.BPSimDataTypeImpl#getGroup Group}
  • + *
  • {@link bpsim.impl.BPSimDataTypeImpl#getScenario Scenario}
  • + *
+ * + * @generated + */ +public class BPSimDataTypeImpl extends EObjectImpl implements BPSimDataType { + /** + * The cached value of the '{@link #getGroup() Group}' attribute list. + * + * + * @see #getGroup() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap group; + + /** + * + * + * @generated + */ + protected BPSimDataTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.BP_SIM_DATA_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getGroup() { + if (group == null) { + group = new BasicFeatureMap(this, BpsimPackage.BP_SIM_DATA_TYPE__GROUP); + } + return group; + } + + /** + * + * + * @generated + */ + @Override + public EList getScenario() { + return getGroup().list(BpsimPackage.Literals.BP_SIM_DATA_TYPE__SCENARIO); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.BP_SIM_DATA_TYPE__GROUP: + return ((InternalEList)getGroup()).basicRemove(otherEnd, msgs); + case BpsimPackage.BP_SIM_DATA_TYPE__SCENARIO: + return ((InternalEList)getScenario()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.BP_SIM_DATA_TYPE__GROUP: + if (coreType) return getGroup(); + return ((FeatureMap.Internal)getGroup()).getWrapper(); + case BpsimPackage.BP_SIM_DATA_TYPE__SCENARIO: + return getScenario(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.BP_SIM_DATA_TYPE__GROUP: + ((FeatureMap.Internal)getGroup()).set(newValue); + return; + case BpsimPackage.BP_SIM_DATA_TYPE__SCENARIO: + getScenario().clear(); + getScenario().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.BP_SIM_DATA_TYPE__GROUP: + getGroup().clear(); + return; + case BpsimPackage.BP_SIM_DATA_TYPE__SCENARIO: + getScenario().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.BP_SIM_DATA_TYPE__GROUP: + return group != null && !group.isEmpty(); + case BpsimPackage.BP_SIM_DATA_TYPE__SCENARIO: + return !getScenario().isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (group: "); + result.append(group); + result.append(')'); + return result.toString(); + } + +} //BPSimDataTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BetaDistributionTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BetaDistributionTypeImpl.java new file mode 100644 index 00000000000..731829dd874 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BetaDistributionTypeImpl.java @@ -0,0 +1,298 @@ +/** + */ +package bpsim.impl; + +import bpsim.BetaDistributionType; +import bpsim.BpsimPackage; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Beta Distribution Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.BetaDistributionTypeImpl#getScale Scale}
  • + *
  • {@link bpsim.impl.BetaDistributionTypeImpl#getShape Shape}
  • + *
+ * + * @generated + */ +public class BetaDistributionTypeImpl extends DistributionParameterImpl implements BetaDistributionType { + /** + * The default value of the '{@link #getScale() Scale}' attribute. + * + * + * @see #getScale() + * @generated + * @ordered + */ + protected static final double SCALE_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getScale() Scale}' attribute. + * + * + * @see #getScale() + * @generated + * @ordered + */ + @GwtTransient + protected double scale = SCALE_EDEFAULT; + + /** + * This is true if the Scale attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean scaleESet; + + /** + * The default value of the '{@link #getShape() Shape}' attribute. + * + * + * @see #getShape() + * @generated + * @ordered + */ + protected static final double SHAPE_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getShape() Shape}' attribute. + * + * + * @see #getShape() + * @generated + * @ordered + */ + @GwtTransient + protected double shape = SHAPE_EDEFAULT; + + /** + * This is true if the Shape attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean shapeESet; + + /** + * + * + * @generated + */ + protected BetaDistributionTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.BETA_DISTRIBUTION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public double getScale() { + return scale; + } + + /** + * + * + * @generated + */ + @Override + public void setScale(double newScale) { + double oldScale = scale; + scale = newScale; + boolean oldScaleESet = scaleESet; + scaleESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.BETA_DISTRIBUTION_TYPE__SCALE, oldScale, scale, !oldScaleESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetScale() { + double oldScale = scale; + boolean oldScaleESet = scaleESet; + scale = SCALE_EDEFAULT; + scaleESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.BETA_DISTRIBUTION_TYPE__SCALE, oldScale, SCALE_EDEFAULT, oldScaleESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetScale() { + return scaleESet; + } + + /** + * + * + * @generated + */ + @Override + public double getShape() { + return shape; + } + + /** + * + * + * @generated + */ + @Override + public void setShape(double newShape) { + double oldShape = shape; + shape = newShape; + boolean oldShapeESet = shapeESet; + shapeESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.BETA_DISTRIBUTION_TYPE__SHAPE, oldShape, shape, !oldShapeESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetShape() { + double oldShape = shape; + boolean oldShapeESet = shapeESet; + shape = SHAPE_EDEFAULT; + shapeESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.BETA_DISTRIBUTION_TYPE__SHAPE, oldShape, SHAPE_EDEFAULT, oldShapeESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetShape() { + return shapeESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.BETA_DISTRIBUTION_TYPE__SCALE: + return getScale(); + case BpsimPackage.BETA_DISTRIBUTION_TYPE__SHAPE: + return getShape(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.BETA_DISTRIBUTION_TYPE__SCALE: + setScale((Double)newValue); + return; + case BpsimPackage.BETA_DISTRIBUTION_TYPE__SHAPE: + setShape((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.BETA_DISTRIBUTION_TYPE__SCALE: + unsetScale(); + return; + case BpsimPackage.BETA_DISTRIBUTION_TYPE__SHAPE: + unsetShape(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.BETA_DISTRIBUTION_TYPE__SCALE: + return isSetScale(); + case BpsimPackage.BETA_DISTRIBUTION_TYPE__SHAPE: + return isSetShape(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (scale: "); + if (scaleESet) result.append(scale); else result.append(""); + result.append(", shape: "); + if (shapeESet) result.append(shape); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //BetaDistributionTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BinomialDistributionTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BinomialDistributionTypeImpl.java new file mode 100644 index 00000000000..c942d35373b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BinomialDistributionTypeImpl.java @@ -0,0 +1,298 @@ +/** + */ +package bpsim.impl; + +import bpsim.BinomialDistributionType; +import bpsim.BpsimPackage; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Binomial Distribution Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.BinomialDistributionTypeImpl#getProbability Probability}
  • + *
  • {@link bpsim.impl.BinomialDistributionTypeImpl#getTrials Trials}
  • + *
+ * + * @generated + */ +public class BinomialDistributionTypeImpl extends DistributionParameterImpl implements BinomialDistributionType { + /** + * The default value of the '{@link #getProbability() Probability}' attribute. + * + * + * @see #getProbability() + * @generated + * @ordered + */ + protected static final double PROBABILITY_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getProbability() Probability}' attribute. + * + * + * @see #getProbability() + * @generated + * @ordered + */ + @GwtTransient + protected double probability = PROBABILITY_EDEFAULT; + + /** + * This is true if the Probability attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean probabilityESet; + + /** + * The default value of the '{@link #getTrials() Trials}' attribute. + * + * + * @see #getTrials() + * @generated + * @ordered + */ + protected static final long TRIALS_EDEFAULT = 0L; + + /** + * The cached value of the '{@link #getTrials() Trials}' attribute. + * + * + * @see #getTrials() + * @generated + * @ordered + */ + @GwtTransient + protected long trials = TRIALS_EDEFAULT; + + /** + * This is true if the Trials attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean trialsESet; + + /** + * + * + * @generated + */ + protected BinomialDistributionTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.BINOMIAL_DISTRIBUTION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public double getProbability() { + return probability; + } + + /** + * + * + * @generated + */ + @Override + public void setProbability(double newProbability) { + double oldProbability = probability; + probability = newProbability; + boolean oldProbabilityESet = probabilityESet; + probabilityESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__PROBABILITY, oldProbability, probability, !oldProbabilityESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetProbability() { + double oldProbability = probability; + boolean oldProbabilityESet = probabilityESet; + probability = PROBABILITY_EDEFAULT; + probabilityESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__PROBABILITY, oldProbability, PROBABILITY_EDEFAULT, oldProbabilityESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetProbability() { + return probabilityESet; + } + + /** + * + * + * @generated + */ + @Override + public long getTrials() { + return trials; + } + + /** + * + * + * @generated + */ + @Override + public void setTrials(long newTrials) { + long oldTrials = trials; + trials = newTrials; + boolean oldTrialsESet = trialsESet; + trialsESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__TRIALS, oldTrials, trials, !oldTrialsESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetTrials() { + long oldTrials = trials; + boolean oldTrialsESet = trialsESet; + trials = TRIALS_EDEFAULT; + trialsESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__TRIALS, oldTrials, TRIALS_EDEFAULT, oldTrialsESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetTrials() { + return trialsESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__PROBABILITY: + return getProbability(); + case BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__TRIALS: + return getTrials(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__PROBABILITY: + setProbability((Double)newValue); + return; + case BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__TRIALS: + setTrials((Long)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__PROBABILITY: + unsetProbability(); + return; + case BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__TRIALS: + unsetTrials(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__PROBABILITY: + return isSetProbability(); + case BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__TRIALS: + return isSetTrials(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (probability: "); + if (probabilityESet) result.append(probability); else result.append(""); + result.append(", trials: "); + if (trialsESet) result.append(trials); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //BinomialDistributionTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BooleanParameterTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BooleanParameterTypeImpl.java new file mode 100644 index 00000000000..ad9adbd55b8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BooleanParameterTypeImpl.java @@ -0,0 +1,204 @@ +/** + */ +package bpsim.impl; + +import bpsim.BooleanParameterType; +import bpsim.BpsimPackage; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Boolean Parameter Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.BooleanParameterTypeImpl#isValue Value}
  • + *
+ * + * @generated + */ +public class BooleanParameterTypeImpl extends ConstantParameterImpl implements BooleanParameterType { + /** + * The default value of the '{@link #isValue() Value}' attribute. + * + * + * @see #isValue() + * @generated + * @ordered + */ + protected static final boolean VALUE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isValue() Value}' attribute. + * + * + * @see #isValue() + * @generated + * @ordered + */ + @GwtTransient + protected boolean value = VALUE_EDEFAULT; + + /** + * This is true if the Value attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean valueESet; + + /** + * + * + * @generated + */ + protected BooleanParameterTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.BOOLEAN_PARAMETER_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public boolean isValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public void setValue(boolean newValue) { + boolean oldValue = value; + value = newValue; + boolean oldValueESet = valueESet; + valueESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.BOOLEAN_PARAMETER_TYPE__VALUE, oldValue, value, !oldValueESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetValue() { + boolean oldValue = value; + boolean oldValueESet = valueESet; + value = VALUE_EDEFAULT; + valueESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.BOOLEAN_PARAMETER_TYPE__VALUE, oldValue, VALUE_EDEFAULT, oldValueESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetValue() { + return valueESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.BOOLEAN_PARAMETER_TYPE__VALUE: + return isValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.BOOLEAN_PARAMETER_TYPE__VALUE: + setValue((Boolean)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.BOOLEAN_PARAMETER_TYPE__VALUE: + unsetValue(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.BOOLEAN_PARAMETER_TYPE__VALUE: + return isSetValue(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (value: "); + if (valueESet) result.append(value); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //BooleanParameterTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BpsimFactoryImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BpsimFactoryImpl.java new file mode 100644 index 00000000000..9f7d34cfc33 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BpsimFactoryImpl.java @@ -0,0 +1,708 @@ +/** + */ +package bpsim.impl; + +import bpsim.*; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class BpsimFactoryImpl extends EFactoryImpl implements BpsimFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static BpsimFactory init() { + try { + BpsimFactory theBpsimFactory = (BpsimFactory)EPackage.Registry.INSTANCE.getEFactory(BpsimPackage.eNS_URI); + if (theBpsimFactory != null) { + return theBpsimFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new BpsimFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public BpsimFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case BpsimPackage.BETA_DISTRIBUTION_TYPE: return createBetaDistributionType(); + case BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE: return createBinomialDistributionType(); + case BpsimPackage.BOOLEAN_PARAMETER_TYPE: return createBooleanParameterType(); + case BpsimPackage.BP_SIM_DATA_TYPE: return createBPSimDataType(); + case BpsimPackage.CALENDAR: return createCalendar(); + case BpsimPackage.CONSTANT_PARAMETER: return createConstantParameter(); + case BpsimPackage.CONTROL_PARAMETERS: return createControlParameters(); + case BpsimPackage.COST_PARAMETERS: return createCostParameters(); + case BpsimPackage.DATE_TIME_PARAMETER_TYPE: return createDateTimeParameterType(); + case BpsimPackage.DISTRIBUTION_PARAMETER: return createDistributionParameter(); + case BpsimPackage.DOCUMENT_ROOT: return createDocumentRoot(); + case BpsimPackage.DURATION_PARAMETER_TYPE: return createDurationParameterType(); + case BpsimPackage.ELEMENT_PARAMETERS: return createElementParameters(); + case BpsimPackage.ELEMENT_PARAMETERS_TYPE: return createElementParametersType(); + case BpsimPackage.ENUM_PARAMETER_TYPE: return createEnumParameterType(); + case BpsimPackage.ERLANG_DISTRIBUTION_TYPE: return createErlangDistributionType(); + case BpsimPackage.EXPRESSION_PARAMETER_TYPE: return createExpressionParameterType(); + case BpsimPackage.FLOATING_PARAMETER_TYPE: return createFloatingParameterType(); + case BpsimPackage.GAMMA_DISTRIBUTION_TYPE: return createGammaDistributionType(); + case BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE: return createLogNormalDistributionType(); + case BpsimPackage.NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE: return createNegativeExponentialDistributionType(); + case BpsimPackage.NORMAL_DISTRIBUTION_TYPE: return createNormalDistributionType(); + case BpsimPackage.NUMERIC_PARAMETER_TYPE: return createNumericParameterType(); + case BpsimPackage.PARAMETER: return createParameter(); + case BpsimPackage.PARAMETER_VALUE: return createParameterValue(); + case BpsimPackage.POISSON_DISTRIBUTION_TYPE: return createPoissonDistributionType(); + case BpsimPackage.PRIORITY_PARAMETERS: return createPriorityParameters(); + case BpsimPackage.PROPERTY_PARAMETERS: return createPropertyParameters(); + case BpsimPackage.PROPERTY_TYPE: return createPropertyType(); + case BpsimPackage.RESOURCE_PARAMETERS: return createResourceParameters(); + case BpsimPackage.SCENARIO: return createScenario(); + case BpsimPackage.SCENARIO_PARAMETERS: return createScenarioParameters(); + case BpsimPackage.SCENARIO_PARAMETERS_TYPE: return createScenarioParametersType(); + case BpsimPackage.STRING_PARAMETER_TYPE: return createStringParameterType(); + case BpsimPackage.TIME_PARAMETERS: return createTimeParameters(); + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE: return createTriangularDistributionType(); + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE: return createTruncatedNormalDistributionType(); + case BpsimPackage.UNIFORM_DISTRIBUTION_TYPE: return createUniformDistributionType(); + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE: return createUserDistributionDataPointType(); + case BpsimPackage.USER_DISTRIBUTION_TYPE: return createUserDistributionType(); + case BpsimPackage.VENDOR_EXTENSION: return createVendorExtension(); + case BpsimPackage.WEIBULL_DISTRIBUTION_TYPE: return createWeibullDistributionType(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public Object createFromString(EDataType eDataType, String initialValue) { + switch (eDataType.getClassifierID()) { + case BpsimPackage.RESULT_TYPE: + return createResultTypeFromString(eDataType, initialValue); + case BpsimPackage.TIME_UNIT: + return createTimeUnitFromString(eDataType, initialValue); + case BpsimPackage.RESULT_TYPE_OBJECT: + return createResultTypeObjectFromString(eDataType, initialValue); + case BpsimPackage.TIME_UNIT_OBJECT: + return createTimeUnitObjectFromString(eDataType, initialValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public String convertToString(EDataType eDataType, Object instanceValue) { + switch (eDataType.getClassifierID()) { + case BpsimPackage.RESULT_TYPE: + return convertResultTypeToString(eDataType, instanceValue); + case BpsimPackage.TIME_UNIT: + return convertTimeUnitToString(eDataType, instanceValue); + case BpsimPackage.RESULT_TYPE_OBJECT: + return convertResultTypeObjectToString(eDataType, instanceValue); + case BpsimPackage.TIME_UNIT_OBJECT: + return convertTimeUnitObjectToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public BetaDistributionType createBetaDistributionType() { + BetaDistributionTypeImpl betaDistributionType = new BetaDistributionTypeImpl(); + return betaDistributionType; + } + + /** + * + * + * @generated + */ + @Override + public BinomialDistributionType createBinomialDistributionType() { + BinomialDistributionTypeImpl binomialDistributionType = new BinomialDistributionTypeImpl(); + return binomialDistributionType; + } + + /** + * + * + * @generated + */ + @Override + public BooleanParameterType createBooleanParameterType() { + BooleanParameterTypeImpl booleanParameterType = new BooleanParameterTypeImpl(); + return booleanParameterType; + } + + /** + * + * + * @generated + */ + @Override + public BPSimDataType createBPSimDataType() { + BPSimDataTypeImpl bpSimDataType = new BPSimDataTypeImpl(); + return bpSimDataType; + } + + /** + * + * + * @generated + */ + @Override + public Calendar createCalendar() { + CalendarImpl calendar = new CalendarImpl(); + return calendar; + } + + /** + * + * + * @generated + */ + @Override + public ConstantParameter createConstantParameter() { + ConstantParameterImpl constantParameter = new ConstantParameterImpl(); + return constantParameter; + } + + /** + * + * + * @generated + */ + @Override + public ControlParameters createControlParameters() { + ControlParametersImpl controlParameters = new ControlParametersImpl(); + return controlParameters; + } + + /** + * + * + * @generated + */ + @Override + public CostParameters createCostParameters() { + CostParametersImpl costParameters = new CostParametersImpl(); + return costParameters; + } + + /** + * + * + * @generated + */ + @Override + public DateTimeParameterType createDateTimeParameterType() { + DateTimeParameterTypeImpl dateTimeParameterType = new DateTimeParameterTypeImpl(); + return dateTimeParameterType; + } + + /** + * + * + * @generated + */ + @Override + public DistributionParameter createDistributionParameter() { + DistributionParameterImpl distributionParameter = new DistributionParameterImpl(); + return distributionParameter; + } + + /** + * + * + * @generated + */ + @Override + public DocumentRoot createDocumentRoot() { + DocumentRootImpl documentRoot = new DocumentRootImpl(); + return documentRoot; + } + + /** + * + * + * @generated + */ + @Override + public DurationParameterType createDurationParameterType() { + DurationParameterTypeImpl durationParameterType = new DurationParameterTypeImpl(); + return durationParameterType; + } + + /** + * + * + * @generated + */ + @Override + public ElementParameters createElementParameters() { + ElementParametersImpl elementParameters = new ElementParametersImpl(); + return elementParameters; + } + + /** + * + * + * @generated + */ + @Override + public ElementParametersType createElementParametersType() { + ElementParametersTypeImpl elementParametersType = new ElementParametersTypeImpl(); + return elementParametersType; + } + + /** + * + * + * @generated + */ + @Override + public EnumParameterType createEnumParameterType() { + EnumParameterTypeImpl enumParameterType = new EnumParameterTypeImpl(); + return enumParameterType; + } + + /** + * + * + * @generated + */ + @Override + public ErlangDistributionType createErlangDistributionType() { + ErlangDistributionTypeImpl erlangDistributionType = new ErlangDistributionTypeImpl(); + return erlangDistributionType; + } + + /** + * + * + * @generated + */ + @Override + public ExpressionParameterType createExpressionParameterType() { + ExpressionParameterTypeImpl expressionParameterType = new ExpressionParameterTypeImpl(); + return expressionParameterType; + } + + /** + * + * + * @generated + */ + @Override + public FloatingParameterType createFloatingParameterType() { + FloatingParameterTypeImpl floatingParameterType = new FloatingParameterTypeImpl(); + return floatingParameterType; + } + + /** + * + * + * @generated + */ + @Override + public GammaDistributionType createGammaDistributionType() { + GammaDistributionTypeImpl gammaDistributionType = new GammaDistributionTypeImpl(); + return gammaDistributionType; + } + + /** + * + * + * @generated + */ + @Override + public LogNormalDistributionType createLogNormalDistributionType() { + LogNormalDistributionTypeImpl logNormalDistributionType = new LogNormalDistributionTypeImpl(); + return logNormalDistributionType; + } + + /** + * + * + * @generated + */ + @Override + public NegativeExponentialDistributionType createNegativeExponentialDistributionType() { + NegativeExponentialDistributionTypeImpl negativeExponentialDistributionType = new NegativeExponentialDistributionTypeImpl(); + return negativeExponentialDistributionType; + } + + /** + * + * + * @generated + */ + @Override + public NormalDistributionType createNormalDistributionType() { + NormalDistributionTypeImpl normalDistributionType = new NormalDistributionTypeImpl(); + return normalDistributionType; + } + + /** + * + * + * @generated + */ + @Override + public NumericParameterType createNumericParameterType() { + NumericParameterTypeImpl numericParameterType = new NumericParameterTypeImpl(); + return numericParameterType; + } + + /** + * + * + * @generated + */ + @Override + public Parameter createParameter() { + ParameterImpl parameter = new ParameterImpl(); + return parameter; + } + + /** + * + * + * @generated + */ + @Override + public ParameterValue createParameterValue() { + ParameterValueImpl parameterValue = new ParameterValueImpl(); + return parameterValue; + } + + /** + * + * + * @generated + */ + @Override + public PoissonDistributionType createPoissonDistributionType() { + PoissonDistributionTypeImpl poissonDistributionType = new PoissonDistributionTypeImpl(); + return poissonDistributionType; + } + + /** + * + * + * @generated + */ + @Override + public PriorityParameters createPriorityParameters() { + PriorityParametersImpl priorityParameters = new PriorityParametersImpl(); + return priorityParameters; + } + + /** + * + * + * @generated + */ + @Override + public PropertyParameters createPropertyParameters() { + PropertyParametersImpl propertyParameters = new PropertyParametersImpl(); + return propertyParameters; + } + + /** + * + * + * @generated + */ + @Override + public PropertyType createPropertyType() { + PropertyTypeImpl propertyType = new PropertyTypeImpl(); + return propertyType; + } + + /** + * + * + * @generated + */ + @Override + public ResourceParameters createResourceParameters() { + ResourceParametersImpl resourceParameters = new ResourceParametersImpl(); + return resourceParameters; + } + + /** + * + * + * @generated + */ + @Override + public Scenario createScenario() { + ScenarioImpl scenario = new ScenarioImpl(); + return scenario; + } + + /** + * + * + * @generated + */ + @Override + public ScenarioParameters createScenarioParameters() { + ScenarioParametersImpl scenarioParameters = new ScenarioParametersImpl(); + return scenarioParameters; + } + + /** + * + * + * @generated + */ + @Override + public ScenarioParametersType createScenarioParametersType() { + ScenarioParametersTypeImpl scenarioParametersType = new ScenarioParametersTypeImpl(); + return scenarioParametersType; + } + + /** + * + * + * @generated + */ + @Override + public StringParameterType createStringParameterType() { + StringParameterTypeImpl stringParameterType = new StringParameterTypeImpl(); + return stringParameterType; + } + + /** + * + * + * @generated + */ + @Override + public TimeParameters createTimeParameters() { + TimeParametersImpl timeParameters = new TimeParametersImpl(); + return timeParameters; + } + + /** + * + * + * @generated + */ + @Override + public TriangularDistributionType createTriangularDistributionType() { + TriangularDistributionTypeImpl triangularDistributionType = new TriangularDistributionTypeImpl(); + return triangularDistributionType; + } + + /** + * + * + * @generated + */ + @Override + public TruncatedNormalDistributionType createTruncatedNormalDistributionType() { + TruncatedNormalDistributionTypeImpl truncatedNormalDistributionType = new TruncatedNormalDistributionTypeImpl(); + return truncatedNormalDistributionType; + } + + /** + * + * + * @generated + */ + @Override + public UniformDistributionType createUniformDistributionType() { + UniformDistributionTypeImpl uniformDistributionType = new UniformDistributionTypeImpl(); + return uniformDistributionType; + } + + /** + * + * + * @generated + */ + @Override + public UserDistributionDataPointType createUserDistributionDataPointType() { + UserDistributionDataPointTypeImpl userDistributionDataPointType = new UserDistributionDataPointTypeImpl(); + return userDistributionDataPointType; + } + + /** + * + * + * @generated + */ + @Override + public UserDistributionType createUserDistributionType() { + UserDistributionTypeImpl userDistributionType = new UserDistributionTypeImpl(); + return userDistributionType; + } + + /** + * + * + * @generated + */ + @Override + public VendorExtension createVendorExtension() { + VendorExtensionImpl vendorExtension = new VendorExtensionImpl(); + return vendorExtension; + } + + /** + * + * + * @generated + */ + @Override + public WeibullDistributionType createWeibullDistributionType() { + WeibullDistributionTypeImpl weibullDistributionType = new WeibullDistributionTypeImpl(); + return weibullDistributionType; + } + + /** + * + * + * @generated + */ + public ResultType createResultTypeFromString(EDataType eDataType, String initialValue) { + ResultType result = ResultType.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertResultTypeToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public TimeUnit createTimeUnitFromString(EDataType eDataType, String initialValue) { + TimeUnit result = TimeUnit.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertTimeUnitToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public ResultType createResultTypeObjectFromString(EDataType eDataType, String initialValue) { + return createResultTypeFromString(BpsimPackage.Literals.RESULT_TYPE, initialValue); + } + + /** + * + * + * @generated + */ + public String convertResultTypeObjectToString(EDataType eDataType, Object instanceValue) { + return convertResultTypeToString(BpsimPackage.Literals.RESULT_TYPE, instanceValue); + } + + /** + * + * + * @generated + */ + public TimeUnit createTimeUnitObjectFromString(EDataType eDataType, String initialValue) { + return createTimeUnitFromString(BpsimPackage.Literals.TIME_UNIT, initialValue); + } + + /** + * + * + * @generated + */ + public String convertTimeUnitObjectToString(EDataType eDataType, Object instanceValue) { + return convertTimeUnitToString(BpsimPackage.Literals.TIME_UNIT, instanceValue); + } + + /** + * + * + * @generated + */ + @Override + public BpsimPackage getBpsimPackage() { + return (BpsimPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static BpsimPackage getPackage() { + return BpsimPackage.eINSTANCE; + } + +} //BpsimFactoryImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BpsimPackageImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BpsimPackageImpl.java new file mode 100644 index 00000000000..87d6fbf4ed8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/BpsimPackageImpl.java @@ -0,0 +1,5145 @@ +/** + */ +package bpsim.impl; + +import bpsim.BPSimDataType; +import bpsim.BetaDistributionType; +import bpsim.BinomialDistributionType; +import bpsim.BooleanParameterType; +import bpsim.BpsimFactory; +import bpsim.BpsimPackage; +import bpsim.Calendar; +import bpsim.ConstantParameter; +import bpsim.ControlParameters; +import bpsim.CostParameters; +import bpsim.DateTimeParameterType; +import bpsim.DistributionParameter; +import bpsim.DocumentRoot; +import bpsim.DurationParameterType; +import bpsim.ElementParameters; +import bpsim.ElementParametersType; +import bpsim.EnumParameterType; +import bpsim.ErlangDistributionType; +import bpsim.ExpressionParameterType; +import bpsim.FloatingParameterType; +import bpsim.GammaDistributionType; +import bpsim.LogNormalDistributionType; +import bpsim.NegativeExponentialDistributionType; +import bpsim.NormalDistributionType; +import bpsim.NumericParameterType; +import bpsim.Parameter; +import bpsim.ParameterValue; +import bpsim.PoissonDistributionType; +import bpsim.PriorityParameters; +import bpsim.PropertyParameters; +import bpsim.PropertyType; +import bpsim.ResourceParameters; +import bpsim.ResultType; +import bpsim.Scenario; +import bpsim.ScenarioParameters; +import bpsim.ScenarioParametersType; +import bpsim.StringParameterType; +import bpsim.TimeParameters; +import bpsim.TimeUnit; +import bpsim.TriangularDistributionType; +import bpsim.TruncatedNormalDistributionType; +import bpsim.UniformDistributionType; +import bpsim.UserDistributionDataPointType; +import bpsim.UserDistributionType; +import bpsim.VendorExtension; +import bpsim.WeibullDistributionType; + +import com.google.gwt.user.client.rpc.IsSerializable; + +import org.eclipse.emf.common.util.Reflect; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +import org.eclipse.emf.ecore.xml.type.XMLTypePackage; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class BpsimPackageImpl extends EPackageImpl implements BpsimPackage { + /** + * + * + * @generated + */ + private EClass betaDistributionTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass binomialDistributionTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass booleanParameterTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass bpSimDataTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass calendarEClass = null; + + /** + * + * + * @generated + */ + private EClass constantParameterEClass = null; + + /** + * + * + * @generated + */ + private EClass controlParametersEClass = null; + + /** + * + * + * @generated + */ + private EClass costParametersEClass = null; + + /** + * + * + * @generated + */ + private EClass dateTimeParameterTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass distributionParameterEClass = null; + + /** + * + * + * @generated + */ + private EClass documentRootEClass = null; + + /** + * + * + * @generated + */ + private EClass durationParameterTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass elementParametersEClass = null; + + /** + * + * + * @generated + */ + private EClass elementParametersTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass enumParameterTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass erlangDistributionTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass expressionParameterTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass floatingParameterTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass gammaDistributionTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass logNormalDistributionTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass negativeExponentialDistributionTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass normalDistributionTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass numericParameterTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass parameterEClass = null; + + /** + * + * + * @generated + */ + private EClass parameterValueEClass = null; + + /** + * + * + * @generated + */ + private EClass poissonDistributionTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass priorityParametersEClass = null; + + /** + * + * + * @generated + */ + private EClass propertyParametersEClass = null; + + /** + * + * + * @generated + */ + private EClass propertyTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass resourceParametersEClass = null; + + /** + * + * + * @generated + */ + private EClass scenarioEClass = null; + + /** + * + * + * @generated + */ + private EClass scenarioParametersEClass = null; + + /** + * + * + * @generated + */ + private EClass scenarioParametersTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass stringParameterTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass timeParametersEClass = null; + + /** + * + * + * @generated + */ + private EClass triangularDistributionTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass truncatedNormalDistributionTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass uniformDistributionTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass userDistributionDataPointTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass userDistributionTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass vendorExtensionEClass = null; + + /** + * + * + * @generated + */ + private EClass weibullDistributionTypeEClass = null; + + /** + * + * + * @generated + */ + private EEnum resultTypeEEnum = null; + + /** + * + * + * @generated + */ + private EEnum timeUnitEEnum = null; + + /** + * + * + * @generated + */ + private EDataType resultTypeObjectEDataType = null; + + /** + * + * + * @generated + */ + private EDataType timeUnitObjectEDataType = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see bpsim.BpsimPackage#eNS_URI + * @see #init() + * @generated + */ + private BpsimPackageImpl() { + super(eNS_URI, BpsimFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link BpsimPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static BpsimPackage init() { + if (isInited) return (BpsimPackage)EPackage.Registry.INSTANCE.getEPackage(BpsimPackage.eNS_URI); + + initializeRegistryHelpers(); + + // Obtain or create and register package + Object registeredBpsimPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + BpsimPackageImpl theBpsimPackage = registeredBpsimPackage instanceof BpsimPackageImpl ? (BpsimPackageImpl)registeredBpsimPackage : new BpsimPackageImpl(); + + isInited = true; + + // Initialize simple dependencies + XMLTypePackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theBpsimPackage.createPackageContents(); + + // Initialize created meta-data + theBpsimPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theBpsimPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(BpsimPackage.eNS_URI, theBpsimPackage); + return theBpsimPackage; + } + + /** + * + * + * @generated + */ + public static void initializeRegistryHelpers() { + Reflect.register + (BetaDistributionType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof BetaDistributionType; + } + + public Object newArrayInstance(int size) { + return new BetaDistributionType[size]; + } + }); + Reflect.register + (BinomialDistributionType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof BinomialDistributionType; + } + + public Object newArrayInstance(int size) { + return new BinomialDistributionType[size]; + } + }); + Reflect.register + (BooleanParameterType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof BooleanParameterType; + } + + public Object newArrayInstance(int size) { + return new BooleanParameterType[size]; + } + }); + Reflect.register + (BPSimDataType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof BPSimDataType; + } + + public Object newArrayInstance(int size) { + return new BPSimDataType[size]; + } + }); + Reflect.register + (Calendar.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Calendar; + } + + public Object newArrayInstance(int size) { + return new Calendar[size]; + } + }); + Reflect.register + (ConstantParameter.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ConstantParameter; + } + + public Object newArrayInstance(int size) { + return new ConstantParameter[size]; + } + }); + Reflect.register + (ControlParameters.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ControlParameters; + } + + public Object newArrayInstance(int size) { + return new ControlParameters[size]; + } + }); + Reflect.register + (CostParameters.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CostParameters; + } + + public Object newArrayInstance(int size) { + return new CostParameters[size]; + } + }); + Reflect.register + (DateTimeParameterType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DateTimeParameterType; + } + + public Object newArrayInstance(int size) { + return new DateTimeParameterType[size]; + } + }); + Reflect.register + (DistributionParameter.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DistributionParameter; + } + + public Object newArrayInstance(int size) { + return new DistributionParameter[size]; + } + }); + Reflect.register + (DocumentRoot.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DocumentRoot; + } + + public Object newArrayInstance(int size) { + return new DocumentRoot[size]; + } + }); + Reflect.register + (DurationParameterType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DurationParameterType; + } + + public Object newArrayInstance(int size) { + return new DurationParameterType[size]; + } + }); + Reflect.register + (ElementParameters.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ElementParameters; + } + + public Object newArrayInstance(int size) { + return new ElementParameters[size]; + } + }); + Reflect.register + (ElementParametersType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ElementParametersType; + } + + public Object newArrayInstance(int size) { + return new ElementParametersType[size]; + } + }); + Reflect.register + (EnumParameterType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof EnumParameterType; + } + + public Object newArrayInstance(int size) { + return new EnumParameterType[size]; + } + }); + Reflect.register + (ErlangDistributionType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ErlangDistributionType; + } + + public Object newArrayInstance(int size) { + return new ErlangDistributionType[size]; + } + }); + Reflect.register + (ExpressionParameterType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ExpressionParameterType; + } + + public Object newArrayInstance(int size) { + return new ExpressionParameterType[size]; + } + }); + Reflect.register + (FloatingParameterType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof FloatingParameterType; + } + + public Object newArrayInstance(int size) { + return new FloatingParameterType[size]; + } + }); + Reflect.register + (GammaDistributionType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof GammaDistributionType; + } + + public Object newArrayInstance(int size) { + return new GammaDistributionType[size]; + } + }); + Reflect.register + (LogNormalDistributionType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof LogNormalDistributionType; + } + + public Object newArrayInstance(int size) { + return new LogNormalDistributionType[size]; + } + }); + Reflect.register + (NegativeExponentialDistributionType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof NegativeExponentialDistributionType; + } + + public Object newArrayInstance(int size) { + return new NegativeExponentialDistributionType[size]; + } + }); + Reflect.register + (NormalDistributionType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof NormalDistributionType; + } + + public Object newArrayInstance(int size) { + return new NormalDistributionType[size]; + } + }); + Reflect.register + (NumericParameterType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof NumericParameterType; + } + + public Object newArrayInstance(int size) { + return new NumericParameterType[size]; + } + }); + Reflect.register + (Parameter.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Parameter; + } + + public Object newArrayInstance(int size) { + return new Parameter[size]; + } + }); + Reflect.register + (ParameterValue.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ParameterValue; + } + + public Object newArrayInstance(int size) { + return new ParameterValue[size]; + } + }); + Reflect.register + (PoissonDistributionType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof PoissonDistributionType; + } + + public Object newArrayInstance(int size) { + return new PoissonDistributionType[size]; + } + }); + Reflect.register + (PriorityParameters.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof PriorityParameters; + } + + public Object newArrayInstance(int size) { + return new PriorityParameters[size]; + } + }); + Reflect.register + (PropertyParameters.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof PropertyParameters; + } + + public Object newArrayInstance(int size) { + return new PropertyParameters[size]; + } + }); + Reflect.register + (PropertyType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof PropertyType; + } + + public Object newArrayInstance(int size) { + return new PropertyType[size]; + } + }); + Reflect.register + (ResourceParameters.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ResourceParameters; + } + + public Object newArrayInstance(int size) { + return new ResourceParameters[size]; + } + }); + Reflect.register + (Scenario.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Scenario; + } + + public Object newArrayInstance(int size) { + return new Scenario[size]; + } + }); + Reflect.register + (ScenarioParameters.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ScenarioParameters; + } + + public Object newArrayInstance(int size) { + return new ScenarioParameters[size]; + } + }); + Reflect.register + (ScenarioParametersType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ScenarioParametersType; + } + + public Object newArrayInstance(int size) { + return new ScenarioParametersType[size]; + } + }); + Reflect.register + (StringParameterType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof StringParameterType; + } + + public Object newArrayInstance(int size) { + return new StringParameterType[size]; + } + }); + Reflect.register + (TimeParameters.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof TimeParameters; + } + + public Object newArrayInstance(int size) { + return new TimeParameters[size]; + } + }); + Reflect.register + (TriangularDistributionType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof TriangularDistributionType; + } + + public Object newArrayInstance(int size) { + return new TriangularDistributionType[size]; + } + }); + Reflect.register + (TruncatedNormalDistributionType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof TruncatedNormalDistributionType; + } + + public Object newArrayInstance(int size) { + return new TruncatedNormalDistributionType[size]; + } + }); + Reflect.register + (UniformDistributionType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof UniformDistributionType; + } + + public Object newArrayInstance(int size) { + return new UniformDistributionType[size]; + } + }); + Reflect.register + (UserDistributionDataPointType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof UserDistributionDataPointType; + } + + public Object newArrayInstance(int size) { + return new UserDistributionDataPointType[size]; + } + }); + Reflect.register + (UserDistributionType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof UserDistributionType; + } + + public Object newArrayInstance(int size) { + return new UserDistributionType[size]; + } + }); + Reflect.register + (VendorExtension.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof VendorExtension; + } + + public Object newArrayInstance(int size) { + return new VendorExtension[size]; + } + }); + Reflect.register + (WeibullDistributionType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof WeibullDistributionType; + } + + public Object newArrayInstance(int size) { + return new WeibullDistributionType[size]; + } + }); + Reflect.register + (ResultType.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ResultType; + } + + public Object newArrayInstance(int size) { + return new ResultType[size]; + } + }); + Reflect.register + (TimeUnit.class, + new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof TimeUnit; + } + + public Object newArrayInstance(int size) { + return new TimeUnit[size]; + } + }); + } + + + /** + * + * + * @generated + */ + public static class WhiteList implements IsSerializable, EBasicWhiteList { + /** + * + * + * @generated + */ + protected BetaDistributionType betaDistributionType; + + /** + * + * + * @generated + */ + protected BinomialDistributionType binomialDistributionType; + + /** + * + * + * @generated + */ + protected BooleanParameterType booleanParameterType; + + /** + * + * + * @generated + */ + protected BPSimDataType bpSimDataType; + + /** + * + * + * @generated + */ + protected Calendar calendar; + + /** + * + * + * @generated + */ + protected ConstantParameter constantParameter; + + /** + * + * + * @generated + */ + protected ControlParameters controlParameters; + + /** + * + * + * @generated + */ + protected CostParameters costParameters; + + /** + * + * + * @generated + */ + protected DateTimeParameterType dateTimeParameterType; + + /** + * + * + * @generated + */ + protected DistributionParameter distributionParameter; + + /** + * + * + * @generated + */ + protected DocumentRoot documentRoot; + + /** + * + * + * @generated + */ + protected DurationParameterType durationParameterType; + + /** + * + * + * @generated + */ + protected ElementParameters elementParameters; + + /** + * + * + * @generated + */ + protected ElementParametersType elementParametersType; + + /** + * + * + * @generated + */ + protected EnumParameterType enumParameterType; + + /** + * + * + * @generated + */ + protected ErlangDistributionType erlangDistributionType; + + /** + * + * + * @generated + */ + protected ExpressionParameterType expressionParameterType; + + /** + * + * + * @generated + */ + protected FloatingParameterType floatingParameterType; + + /** + * + * + * @generated + */ + protected GammaDistributionType gammaDistributionType; + + /** + * + * + * @generated + */ + protected LogNormalDistributionType logNormalDistributionType; + + /** + * + * + * @generated + */ + protected NegativeExponentialDistributionType negativeExponentialDistributionType; + + /** + * + * + * @generated + */ + protected NormalDistributionType normalDistributionType; + + /** + * + * + * @generated + */ + protected NumericParameterType numericParameterType; + + /** + * + * + * @generated + */ + protected Parameter parameter; + + /** + * + * + * @generated + */ + protected ParameterValue parameterValue; + + /** + * + * + * @generated + */ + protected PoissonDistributionType poissonDistributionType; + + /** + * + * + * @generated + */ + protected PriorityParameters priorityParameters; + + /** + * + * + * @generated + */ + protected PropertyParameters propertyParameters; + + /** + * + * + * @generated + */ + protected PropertyType propertyType; + + /** + * + * + * @generated + */ + protected ResourceParameters resourceParameters; + + /** + * + * + * @generated + */ + protected Scenario scenario; + + /** + * + * + * @generated + */ + protected ScenarioParameters scenarioParameters; + + /** + * + * + * @generated + */ + protected ScenarioParametersType scenarioParametersType; + + /** + * + * + * @generated + */ + protected StringParameterType stringParameterType; + + /** + * + * + * @generated + */ + protected TimeParameters timeParameters; + + /** + * + * + * @generated + */ + protected TriangularDistributionType triangularDistributionType; + + /** + * + * + * @generated + */ + protected TruncatedNormalDistributionType truncatedNormalDistributionType; + + /** + * + * + * @generated + */ + protected UniformDistributionType uniformDistributionType; + + /** + * + * + * @generated + */ + protected UserDistributionDataPointType userDistributionDataPointType; + + /** + * + * + * @generated + */ + protected UserDistributionType userDistributionType; + + /** + * + * + * @generated + */ + protected VendorExtension vendorExtension; + + /** + * + * + * @generated + */ + protected WeibullDistributionType weibullDistributionType; + + /** + * + * + * @generated + */ + protected ResultType resultType; + + /** + * + * + * @generated + */ + protected TimeUnit timeUnit; + + /** + * + * + * @generated + */ + protected ResultType resultTypeObject; + + /** + * + * + * @generated + */ + protected TimeUnit timeUnitObject; + + } + + /** + * + * + * @generated + */ + @Override + public EClass getBetaDistributionType() { + return betaDistributionTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBetaDistributionType_Scale() { + return (EAttribute)betaDistributionTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBetaDistributionType_Shape() { + return (EAttribute)betaDistributionTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBinomialDistributionType() { + return binomialDistributionTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBinomialDistributionType_Probability() { + return (EAttribute)binomialDistributionTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBinomialDistributionType_Trials() { + return (EAttribute)binomialDistributionTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBooleanParameterType() { + return booleanParameterTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBooleanParameterType_Value() { + return (EAttribute)booleanParameterTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBPSimDataType() { + return bpSimDataTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBPSimDataType_Group() { + return (EAttribute)bpSimDataTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getBPSimDataType_Scenario() { + return (EReference)bpSimDataTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCalendar() { + return calendarEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCalendar_Value() { + return (EAttribute)calendarEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCalendar_Id() { + return (EAttribute)calendarEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCalendar_Name() { + return (EAttribute)calendarEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getConstantParameter() { + return constantParameterEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getControlParameters() { + return controlParametersEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getControlParameters_Probability() { + return (EReference)controlParametersEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getControlParameters_Condition() { + return (EReference)controlParametersEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getControlParameters_InterTriggerTimer() { + return (EReference)controlParametersEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getControlParameters_TriggerCount() { + return (EReference)controlParametersEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCostParameters() { + return costParametersEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCostParameters_FixedCost() { + return (EReference)costParametersEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCostParameters_UnitCost() { + return (EReference)costParametersEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDateTimeParameterType() { + return dateTimeParameterTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDateTimeParameterType_Value() { + return (EAttribute)dateTimeParameterTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDistributionParameter() { + return distributionParameterEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDistributionParameter_CurrencyUnit() { + return (EAttribute)distributionParameterEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDistributionParameter_TimeUnit() { + return (EAttribute)distributionParameterEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDocumentRoot() { + return documentRootEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDocumentRoot_Mixed() { + return (EAttribute)documentRootEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_XMLNSPrefixMap() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_XSISchemaLocation() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BetaDistribution() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ParameterValue() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BinomialDistribution() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BooleanParameter() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BPSimData() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_DateTimeParameter() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_DurationParameter() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(9); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_EnumParameter() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(10); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ErlangDistribution() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(11); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ExpressionParameter() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(12); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_FloatingParameter() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(13); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_GammaDistribution() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(14); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_LogNormalDistribution() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(15); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_NegativeExponentialDistribution() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(16); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_NormalDistribution() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(17); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_NumericParameter() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(18); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_PoissonDistribution() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(19); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_StringParameter() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(20); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_TriangularDistribution() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(21); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_TruncatedNormalDistribution() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(22); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_UniformDistribution() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(23); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_UserDistribution() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(24); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_UserDistributionDataPoint() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(25); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_WeibullDistribution() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(26); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDurationParameterType() { + return durationParameterTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDurationParameterType_Value() { + return (EAttribute)durationParameterTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getElementParameters() { + return elementParametersEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getElementParameters_TimeParameters() { + return (EReference)elementParametersEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getElementParameters_ControlParameters() { + return (EReference)elementParametersEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getElementParameters_ResourceParameters() { + return (EReference)elementParametersEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getElementParameters_PriorityParameters() { + return (EReference)elementParametersEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getElementParameters_CostParameters() { + return (EReference)elementParametersEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getElementParameters_PropertyParameters() { + return (EReference)elementParametersEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EReference getElementParameters_VendorExtension() { + return (EReference)elementParametersEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getElementParameters_ElementRef() { + return (EAttribute)elementParametersEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getElementParameters_Id() { + return (EAttribute)elementParametersEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * @generated + */ + @Override + public EClass getElementParametersType() { + return elementParametersTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getEnumParameterType() { + return enumParameterTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getEnumParameterType_Group() { + return (EAttribute)enumParameterTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getEnumParameterType_ParameterValueGroup() { + return (EAttribute)enumParameterTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getEnumParameterType_ParameterValue() { + return (EReference)enumParameterTypeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getErlangDistributionType() { + return erlangDistributionTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getErlangDistributionType_K() { + return (EAttribute)erlangDistributionTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getErlangDistributionType_Mean() { + return (EAttribute)erlangDistributionTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getExpressionParameterType() { + return expressionParameterTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExpressionParameterType_Value() { + return (EAttribute)expressionParameterTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getFloatingParameterType() { + return floatingParameterTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFloatingParameterType_CurrencyUnit() { + return (EAttribute)floatingParameterTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFloatingParameterType_TimeUnit() { + return (EAttribute)floatingParameterTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFloatingParameterType_Value() { + return (EAttribute)floatingParameterTypeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getGammaDistributionType() { + return gammaDistributionTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getGammaDistributionType_Scale() { + return (EAttribute)gammaDistributionTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getGammaDistributionType_Shape() { + return (EAttribute)gammaDistributionTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getLogNormalDistributionType() { + return logNormalDistributionTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getLogNormalDistributionType_Mean() { + return (EAttribute)logNormalDistributionTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getLogNormalDistributionType_StandardDeviation() { + return (EAttribute)logNormalDistributionTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getNegativeExponentialDistributionType() { + return negativeExponentialDistributionTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getNegativeExponentialDistributionType_Mean() { + return (EAttribute)negativeExponentialDistributionTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getNormalDistributionType() { + return normalDistributionTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getNormalDistributionType_Mean() { + return (EAttribute)normalDistributionTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getNormalDistributionType_StandardDeviation() { + return (EAttribute)normalDistributionTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getNumericParameterType() { + return numericParameterTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getNumericParameterType_CurrencyUnit() { + return (EAttribute)numericParameterTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getNumericParameterType_TimeUnit() { + return (EAttribute)numericParameterTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getNumericParameterType_Value() { + return (EAttribute)numericParameterTypeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getParameter() { + return parameterEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getParameter_ResultRequest() { + return (EAttribute)parameterEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getParameter_ParameterValueGroup() { + return (EAttribute)parameterEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getParameter_ParameterValue() { + return (EReference)parameterEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getParameter_Kpi() { + return (EAttribute)parameterEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getParameter_Sla() { + return (EAttribute)parameterEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EClass getParameterValue() { + return parameterValueEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getParameterValue_Instance() { + return (EAttribute)parameterValueEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getParameterValue_Result() { + return (EAttribute)parameterValueEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getParameterValue_ValidFor() { + return (EAttribute)parameterValueEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPoissonDistributionType() { + return poissonDistributionTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getPoissonDistributionType_Mean() { + return (EAttribute)poissonDistributionTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPriorityParameters() { + return priorityParametersEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getPriorityParameters_Interruptible() { + return (EReference)priorityParametersEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getPriorityParameters_Priority() { + return (EReference)priorityParametersEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPropertyParameters() { + return propertyParametersEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getPropertyParameters_Property() { + return (EReference)propertyParametersEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPropertyType() { + return propertyTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getPropertyType_Name() { + return (EAttribute)propertyTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getResourceParameters() { + return resourceParametersEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getResourceParameters_Selection() { + return (EReference)resourceParametersEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getResourceParameters_Availability() { + return (EReference)resourceParametersEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getResourceParameters_Quantity() { + return (EReference)resourceParametersEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getResourceParameters_Role() { + return (EReference)resourceParametersEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getScenario() { + return scenarioEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getScenario_ScenarioParameters() { + return (EReference)scenarioEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getScenario_ElementParameters() { + return (EReference)scenarioEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getScenario_Calendar() { + return (EReference)scenarioEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getScenario_VendorExtension() { + return (EReference)scenarioEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenario_Author() { + return (EAttribute)scenarioEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenario_Created() { + return (EAttribute)scenarioEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenario_Description() { + return (EAttribute)scenarioEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenario_Id() { + return (EAttribute)scenarioEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenario_Inherits() { + return (EAttribute)scenarioEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenario_Modified() { + return (EAttribute)scenarioEClass.getEStructuralFeatures().get(9); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenario_Name() { + return (EAttribute)scenarioEClass.getEStructuralFeatures().get(10); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenario_Result() { + return (EAttribute)scenarioEClass.getEStructuralFeatures().get(11); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenario_Vendor() { + return (EAttribute)scenarioEClass.getEStructuralFeatures().get(12); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenario_Version() { + return (EAttribute)scenarioEClass.getEStructuralFeatures().get(13); + } + + /** + * + * + * @generated + */ + @Override + public EClass getScenarioParameters() { + return scenarioParametersEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getScenarioParameters_Start() { + return (EReference)scenarioParametersEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getScenarioParameters_Duration() { + return (EReference)scenarioParametersEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getScenarioParameters_PropertyParameters() { + return (EReference)scenarioParametersEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenarioParameters_BaseCurrencyUnit() { + return (EAttribute)scenarioParametersEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenarioParameters_BaseTimeUnit() { + return (EAttribute)scenarioParametersEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenarioParameters_Replication() { + return (EAttribute)scenarioParametersEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScenarioParameters_Seed() { + return (EAttribute)scenarioParametersEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EClass getScenarioParametersType() { + return scenarioParametersTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getStringParameterType() { + return stringParameterTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getStringParameterType_Value() { + return (EAttribute)stringParameterTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTimeParameters() { + return timeParametersEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getTimeParameters_TransferTime() { + return (EReference)timeParametersEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTimeParameters_QueueTime() { + return (EReference)timeParametersEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTimeParameters_WaitTime() { + return (EReference)timeParametersEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTimeParameters_SetUpTime() { + return (EReference)timeParametersEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTimeParameters_ProcessingTime() { + return (EReference)timeParametersEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTimeParameters_ValidationTime() { + return (EReference)timeParametersEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTimeParameters_ReworkTime() { + return (EReference)timeParametersEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTriangularDistributionType() { + return triangularDistributionTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTriangularDistributionType_Max() { + return (EAttribute)triangularDistributionTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTriangularDistributionType_Min() { + return (EAttribute)triangularDistributionTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTriangularDistributionType_Mode() { + return (EAttribute)triangularDistributionTypeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTruncatedNormalDistributionType() { + return truncatedNormalDistributionTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTruncatedNormalDistributionType_Max() { + return (EAttribute)truncatedNormalDistributionTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTruncatedNormalDistributionType_Mean() { + return (EAttribute)truncatedNormalDistributionTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTruncatedNormalDistributionType_Min() { + return (EAttribute)truncatedNormalDistributionTypeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTruncatedNormalDistributionType_StandardDeviation() { + return (EAttribute)truncatedNormalDistributionTypeEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getUniformDistributionType() { + return uniformDistributionTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getUniformDistributionType_Max() { + return (EAttribute)uniformDistributionTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getUniformDistributionType_Min() { + return (EAttribute)uniformDistributionTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getUserDistributionDataPointType() { + return userDistributionDataPointTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getUserDistributionDataPointType_ParameterValueGroup() { + return (EAttribute)userDistributionDataPointTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getUserDistributionDataPointType_ParameterValue() { + return (EReference)userDistributionDataPointTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getUserDistributionDataPointType_Probability() { + return (EAttribute)userDistributionDataPointTypeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getUserDistributionType() { + return userDistributionTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getUserDistributionType_Group() { + return (EAttribute)userDistributionTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getUserDistributionType_UserDistributionDataPoint() { + return (EReference)userDistributionTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getUserDistributionType_Discrete() { + return (EAttribute)userDistributionTypeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getVendorExtension() { + return vendorExtensionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getVendorExtension_Any() { + return (EAttribute)vendorExtensionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getVendorExtension_Name() { + return (EAttribute)vendorExtensionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getVendorExtension_AnyAttribute() { + return (EAttribute)vendorExtensionEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getWeibullDistributionType() { + return weibullDistributionTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getWeibullDistributionType_Scale() { + return (EAttribute)weibullDistributionTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getWeibullDistributionType_Shape() { + return (EAttribute)weibullDistributionTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EEnum getResultType() { + return resultTypeEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getTimeUnit() { + return timeUnitEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EDataType getResultTypeObject() { + return resultTypeObjectEDataType; + } + + /** + * + * + * @generated + */ + @Override + public EDataType getTimeUnitObject() { + return timeUnitObjectEDataType; + } + + /** + * + * + * @generated + */ + @Override + public BpsimFactory getBpsimFactory() { + return (BpsimFactory)getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + betaDistributionTypeEClass = createEClass(BETA_DISTRIBUTION_TYPE); + createEAttribute(betaDistributionTypeEClass, BETA_DISTRIBUTION_TYPE__SCALE); + createEAttribute(betaDistributionTypeEClass, BETA_DISTRIBUTION_TYPE__SHAPE); + + binomialDistributionTypeEClass = createEClass(BINOMIAL_DISTRIBUTION_TYPE); + createEAttribute(binomialDistributionTypeEClass, BINOMIAL_DISTRIBUTION_TYPE__PROBABILITY); + createEAttribute(binomialDistributionTypeEClass, BINOMIAL_DISTRIBUTION_TYPE__TRIALS); + + booleanParameterTypeEClass = createEClass(BOOLEAN_PARAMETER_TYPE); + createEAttribute(booleanParameterTypeEClass, BOOLEAN_PARAMETER_TYPE__VALUE); + + bpSimDataTypeEClass = createEClass(BP_SIM_DATA_TYPE); + createEAttribute(bpSimDataTypeEClass, BP_SIM_DATA_TYPE__GROUP); + createEReference(bpSimDataTypeEClass, BP_SIM_DATA_TYPE__SCENARIO); + + calendarEClass = createEClass(CALENDAR); + createEAttribute(calendarEClass, CALENDAR__VALUE); + createEAttribute(calendarEClass, CALENDAR__ID); + createEAttribute(calendarEClass, CALENDAR__NAME); + + constantParameterEClass = createEClass(CONSTANT_PARAMETER); + + controlParametersEClass = createEClass(CONTROL_PARAMETERS); + createEReference(controlParametersEClass, CONTROL_PARAMETERS__PROBABILITY); + createEReference(controlParametersEClass, CONTROL_PARAMETERS__CONDITION); + createEReference(controlParametersEClass, CONTROL_PARAMETERS__INTER_TRIGGER_TIMER); + createEReference(controlParametersEClass, CONTROL_PARAMETERS__TRIGGER_COUNT); + + costParametersEClass = createEClass(COST_PARAMETERS); + createEReference(costParametersEClass, COST_PARAMETERS__FIXED_COST); + createEReference(costParametersEClass, COST_PARAMETERS__UNIT_COST); + + dateTimeParameterTypeEClass = createEClass(DATE_TIME_PARAMETER_TYPE); + createEAttribute(dateTimeParameterTypeEClass, DATE_TIME_PARAMETER_TYPE__VALUE); + + distributionParameterEClass = createEClass(DISTRIBUTION_PARAMETER); + createEAttribute(distributionParameterEClass, DISTRIBUTION_PARAMETER__CURRENCY_UNIT); + createEAttribute(distributionParameterEClass, DISTRIBUTION_PARAMETER__TIME_UNIT); + + documentRootEClass = createEClass(DOCUMENT_ROOT); + createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED); + createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP); + createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__BETA_DISTRIBUTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__PARAMETER_VALUE); + createEReference(documentRootEClass, DOCUMENT_ROOT__BINOMIAL_DISTRIBUTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__BOOLEAN_PARAMETER); + createEReference(documentRootEClass, DOCUMENT_ROOT__BP_SIM_DATA); + createEReference(documentRootEClass, DOCUMENT_ROOT__DATE_TIME_PARAMETER); + createEReference(documentRootEClass, DOCUMENT_ROOT__DURATION_PARAMETER); + createEReference(documentRootEClass, DOCUMENT_ROOT__ENUM_PARAMETER); + createEReference(documentRootEClass, DOCUMENT_ROOT__ERLANG_DISTRIBUTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__EXPRESSION_PARAMETER); + createEReference(documentRootEClass, DOCUMENT_ROOT__FLOATING_PARAMETER); + createEReference(documentRootEClass, DOCUMENT_ROOT__GAMMA_DISTRIBUTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__LOG_NORMAL_DISTRIBUTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__NEGATIVE_EXPONENTIAL_DISTRIBUTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__NORMAL_DISTRIBUTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__NUMERIC_PARAMETER); + createEReference(documentRootEClass, DOCUMENT_ROOT__POISSON_DISTRIBUTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__STRING_PARAMETER); + createEReference(documentRootEClass, DOCUMENT_ROOT__TRIANGULAR_DISTRIBUTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__TRUNCATED_NORMAL_DISTRIBUTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__UNIFORM_DISTRIBUTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__USER_DISTRIBUTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__USER_DISTRIBUTION_DATA_POINT); + createEReference(documentRootEClass, DOCUMENT_ROOT__WEIBULL_DISTRIBUTION); + + durationParameterTypeEClass = createEClass(DURATION_PARAMETER_TYPE); + createEAttribute(durationParameterTypeEClass, DURATION_PARAMETER_TYPE__VALUE); + + elementParametersEClass = createEClass(ELEMENT_PARAMETERS); + createEReference(elementParametersEClass, ELEMENT_PARAMETERS__TIME_PARAMETERS); + createEReference(elementParametersEClass, ELEMENT_PARAMETERS__CONTROL_PARAMETERS); + createEReference(elementParametersEClass, ELEMENT_PARAMETERS__RESOURCE_PARAMETERS); + createEReference(elementParametersEClass, ELEMENT_PARAMETERS__PRIORITY_PARAMETERS); + createEReference(elementParametersEClass, ELEMENT_PARAMETERS__COST_PARAMETERS); + createEReference(elementParametersEClass, ELEMENT_PARAMETERS__PROPERTY_PARAMETERS); + createEReference(elementParametersEClass, ELEMENT_PARAMETERS__VENDOR_EXTENSION); + createEAttribute(elementParametersEClass, ELEMENT_PARAMETERS__ELEMENT_REF); + createEAttribute(elementParametersEClass, ELEMENT_PARAMETERS__ID); + + elementParametersTypeEClass = createEClass(ELEMENT_PARAMETERS_TYPE); + + enumParameterTypeEClass = createEClass(ENUM_PARAMETER_TYPE); + createEAttribute(enumParameterTypeEClass, ENUM_PARAMETER_TYPE__GROUP); + createEAttribute(enumParameterTypeEClass, ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP); + createEReference(enumParameterTypeEClass, ENUM_PARAMETER_TYPE__PARAMETER_VALUE); + + erlangDistributionTypeEClass = createEClass(ERLANG_DISTRIBUTION_TYPE); + createEAttribute(erlangDistributionTypeEClass, ERLANG_DISTRIBUTION_TYPE__K); + createEAttribute(erlangDistributionTypeEClass, ERLANG_DISTRIBUTION_TYPE__MEAN); + + expressionParameterTypeEClass = createEClass(EXPRESSION_PARAMETER_TYPE); + createEAttribute(expressionParameterTypeEClass, EXPRESSION_PARAMETER_TYPE__VALUE); + + floatingParameterTypeEClass = createEClass(FLOATING_PARAMETER_TYPE); + createEAttribute(floatingParameterTypeEClass, FLOATING_PARAMETER_TYPE__CURRENCY_UNIT); + createEAttribute(floatingParameterTypeEClass, FLOATING_PARAMETER_TYPE__TIME_UNIT); + createEAttribute(floatingParameterTypeEClass, FLOATING_PARAMETER_TYPE__VALUE); + + gammaDistributionTypeEClass = createEClass(GAMMA_DISTRIBUTION_TYPE); + createEAttribute(gammaDistributionTypeEClass, GAMMA_DISTRIBUTION_TYPE__SCALE); + createEAttribute(gammaDistributionTypeEClass, GAMMA_DISTRIBUTION_TYPE__SHAPE); + + logNormalDistributionTypeEClass = createEClass(LOG_NORMAL_DISTRIBUTION_TYPE); + createEAttribute(logNormalDistributionTypeEClass, LOG_NORMAL_DISTRIBUTION_TYPE__MEAN); + createEAttribute(logNormalDistributionTypeEClass, LOG_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION); + + negativeExponentialDistributionTypeEClass = createEClass(NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE); + createEAttribute(negativeExponentialDistributionTypeEClass, NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__MEAN); + + normalDistributionTypeEClass = createEClass(NORMAL_DISTRIBUTION_TYPE); + createEAttribute(normalDistributionTypeEClass, NORMAL_DISTRIBUTION_TYPE__MEAN); + createEAttribute(normalDistributionTypeEClass, NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION); + + numericParameterTypeEClass = createEClass(NUMERIC_PARAMETER_TYPE); + createEAttribute(numericParameterTypeEClass, NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT); + createEAttribute(numericParameterTypeEClass, NUMERIC_PARAMETER_TYPE__TIME_UNIT); + createEAttribute(numericParameterTypeEClass, NUMERIC_PARAMETER_TYPE__VALUE); + + parameterEClass = createEClass(PARAMETER); + createEAttribute(parameterEClass, PARAMETER__RESULT_REQUEST); + createEAttribute(parameterEClass, PARAMETER__PARAMETER_VALUE_GROUP); + createEReference(parameterEClass, PARAMETER__PARAMETER_VALUE); + createEAttribute(parameterEClass, PARAMETER__KPI); + createEAttribute(parameterEClass, PARAMETER__SLA); + + parameterValueEClass = createEClass(PARAMETER_VALUE); + createEAttribute(parameterValueEClass, PARAMETER_VALUE__INSTANCE); + createEAttribute(parameterValueEClass, PARAMETER_VALUE__RESULT); + createEAttribute(parameterValueEClass, PARAMETER_VALUE__VALID_FOR); + + poissonDistributionTypeEClass = createEClass(POISSON_DISTRIBUTION_TYPE); + createEAttribute(poissonDistributionTypeEClass, POISSON_DISTRIBUTION_TYPE__MEAN); + + priorityParametersEClass = createEClass(PRIORITY_PARAMETERS); + createEReference(priorityParametersEClass, PRIORITY_PARAMETERS__INTERRUPTIBLE); + createEReference(priorityParametersEClass, PRIORITY_PARAMETERS__PRIORITY); + + propertyParametersEClass = createEClass(PROPERTY_PARAMETERS); + createEReference(propertyParametersEClass, PROPERTY_PARAMETERS__PROPERTY); + + propertyTypeEClass = createEClass(PROPERTY_TYPE); + createEAttribute(propertyTypeEClass, PROPERTY_TYPE__NAME); + + resourceParametersEClass = createEClass(RESOURCE_PARAMETERS); + createEReference(resourceParametersEClass, RESOURCE_PARAMETERS__SELECTION); + createEReference(resourceParametersEClass, RESOURCE_PARAMETERS__AVAILABILITY); + createEReference(resourceParametersEClass, RESOURCE_PARAMETERS__QUANTITY); + createEReference(resourceParametersEClass, RESOURCE_PARAMETERS__ROLE); + + scenarioEClass = createEClass(SCENARIO); + createEReference(scenarioEClass, SCENARIO__SCENARIO_PARAMETERS); + createEReference(scenarioEClass, SCENARIO__ELEMENT_PARAMETERS); + createEReference(scenarioEClass, SCENARIO__CALENDAR); + createEReference(scenarioEClass, SCENARIO__VENDOR_EXTENSION); + createEAttribute(scenarioEClass, SCENARIO__AUTHOR); + createEAttribute(scenarioEClass, SCENARIO__CREATED); + createEAttribute(scenarioEClass, SCENARIO__DESCRIPTION); + createEAttribute(scenarioEClass, SCENARIO__ID); + createEAttribute(scenarioEClass, SCENARIO__INHERITS); + createEAttribute(scenarioEClass, SCENARIO__MODIFIED); + createEAttribute(scenarioEClass, SCENARIO__NAME); + createEAttribute(scenarioEClass, SCENARIO__RESULT); + createEAttribute(scenarioEClass, SCENARIO__VENDOR); + createEAttribute(scenarioEClass, SCENARIO__VERSION); + + scenarioParametersEClass = createEClass(SCENARIO_PARAMETERS); + createEReference(scenarioParametersEClass, SCENARIO_PARAMETERS__START); + createEReference(scenarioParametersEClass, SCENARIO_PARAMETERS__DURATION); + createEReference(scenarioParametersEClass, SCENARIO_PARAMETERS__PROPERTY_PARAMETERS); + createEAttribute(scenarioParametersEClass, SCENARIO_PARAMETERS__BASE_CURRENCY_UNIT); + createEAttribute(scenarioParametersEClass, SCENARIO_PARAMETERS__BASE_TIME_UNIT); + createEAttribute(scenarioParametersEClass, SCENARIO_PARAMETERS__REPLICATION); + createEAttribute(scenarioParametersEClass, SCENARIO_PARAMETERS__SEED); + + scenarioParametersTypeEClass = createEClass(SCENARIO_PARAMETERS_TYPE); + + stringParameterTypeEClass = createEClass(STRING_PARAMETER_TYPE); + createEAttribute(stringParameterTypeEClass, STRING_PARAMETER_TYPE__VALUE); + + timeParametersEClass = createEClass(TIME_PARAMETERS); + createEReference(timeParametersEClass, TIME_PARAMETERS__TRANSFER_TIME); + createEReference(timeParametersEClass, TIME_PARAMETERS__QUEUE_TIME); + createEReference(timeParametersEClass, TIME_PARAMETERS__WAIT_TIME); + createEReference(timeParametersEClass, TIME_PARAMETERS__SET_UP_TIME); + createEReference(timeParametersEClass, TIME_PARAMETERS__PROCESSING_TIME); + createEReference(timeParametersEClass, TIME_PARAMETERS__VALIDATION_TIME); + createEReference(timeParametersEClass, TIME_PARAMETERS__REWORK_TIME); + + triangularDistributionTypeEClass = createEClass(TRIANGULAR_DISTRIBUTION_TYPE); + createEAttribute(triangularDistributionTypeEClass, TRIANGULAR_DISTRIBUTION_TYPE__MAX); + createEAttribute(triangularDistributionTypeEClass, TRIANGULAR_DISTRIBUTION_TYPE__MIN); + createEAttribute(triangularDistributionTypeEClass, TRIANGULAR_DISTRIBUTION_TYPE__MODE); + + truncatedNormalDistributionTypeEClass = createEClass(TRUNCATED_NORMAL_DISTRIBUTION_TYPE); + createEAttribute(truncatedNormalDistributionTypeEClass, TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MAX); + createEAttribute(truncatedNormalDistributionTypeEClass, TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MEAN); + createEAttribute(truncatedNormalDistributionTypeEClass, TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MIN); + createEAttribute(truncatedNormalDistributionTypeEClass, TRUNCATED_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION); + + uniformDistributionTypeEClass = createEClass(UNIFORM_DISTRIBUTION_TYPE); + createEAttribute(uniformDistributionTypeEClass, UNIFORM_DISTRIBUTION_TYPE__MAX); + createEAttribute(uniformDistributionTypeEClass, UNIFORM_DISTRIBUTION_TYPE__MIN); + + userDistributionDataPointTypeEClass = createEClass(USER_DISTRIBUTION_DATA_POINT_TYPE); + createEAttribute(userDistributionDataPointTypeEClass, USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE_GROUP); + createEReference(userDistributionDataPointTypeEClass, USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE); + createEAttribute(userDistributionDataPointTypeEClass, USER_DISTRIBUTION_DATA_POINT_TYPE__PROBABILITY); + + userDistributionTypeEClass = createEClass(USER_DISTRIBUTION_TYPE); + createEAttribute(userDistributionTypeEClass, USER_DISTRIBUTION_TYPE__GROUP); + createEReference(userDistributionTypeEClass, USER_DISTRIBUTION_TYPE__USER_DISTRIBUTION_DATA_POINT); + createEAttribute(userDistributionTypeEClass, USER_DISTRIBUTION_TYPE__DISCRETE); + + vendorExtensionEClass = createEClass(VENDOR_EXTENSION); + createEAttribute(vendorExtensionEClass, VENDOR_EXTENSION__ANY); + createEAttribute(vendorExtensionEClass, VENDOR_EXTENSION__NAME); + createEAttribute(vendorExtensionEClass, VENDOR_EXTENSION__ANY_ATTRIBUTE); + + weibullDistributionTypeEClass = createEClass(WEIBULL_DISTRIBUTION_TYPE); + createEAttribute(weibullDistributionTypeEClass, WEIBULL_DISTRIBUTION_TYPE__SCALE); + createEAttribute(weibullDistributionTypeEClass, WEIBULL_DISTRIBUTION_TYPE__SHAPE); + + // Create enums + resultTypeEEnum = createEEnum(RESULT_TYPE); + timeUnitEEnum = createEEnum(TIME_UNIT); + + // Create data types + resultTypeObjectEDataType = createEDataType(RESULT_TYPE_OBJECT); + timeUnitObjectEDataType = createEDataType(TIME_UNIT_OBJECT); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + betaDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); + binomialDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); + booleanParameterTypeEClass.getESuperTypes().add(this.getConstantParameter()); + constantParameterEClass.getESuperTypes().add(this.getParameterValue()); + dateTimeParameterTypeEClass.getESuperTypes().add(this.getConstantParameter()); + distributionParameterEClass.getESuperTypes().add(this.getParameterValue()); + durationParameterTypeEClass.getESuperTypes().add(this.getConstantParameter()); + elementParametersTypeEClass.getESuperTypes().add(this.getElementParameters()); + enumParameterTypeEClass.getESuperTypes().add(this.getParameterValue()); + erlangDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); + expressionParameterTypeEClass.getESuperTypes().add(this.getParameterValue()); + floatingParameterTypeEClass.getESuperTypes().add(this.getConstantParameter()); + gammaDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); + logNormalDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); + negativeExponentialDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); + normalDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); + numericParameterTypeEClass.getESuperTypes().add(this.getConstantParameter()); + poissonDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); + propertyTypeEClass.getESuperTypes().add(this.getParameter()); + scenarioParametersTypeEClass.getESuperTypes().add(this.getScenarioParameters()); + stringParameterTypeEClass.getESuperTypes().add(this.getConstantParameter()); + triangularDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); + truncatedNormalDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); + uniformDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); + userDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); + weibullDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); + + // Initialize classes and features; add operations and parameters + initEClass(betaDistributionTypeEClass, BetaDistributionType.class, "BetaDistributionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getBetaDistributionType_Scale(), theXMLTypePackage.getDouble(), "scale", null, 0, 1, BetaDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getBetaDistributionType_Shape(), theXMLTypePackage.getDouble(), "shape", null, 0, 1, BetaDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(binomialDistributionTypeEClass, BinomialDistributionType.class, "BinomialDistributionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getBinomialDistributionType_Probability(), theXMLTypePackage.getDouble(), "probability", null, 0, 1, BinomialDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getBinomialDistributionType_Trials(), theXMLTypePackage.getLong(), "trials", null, 0, 1, BinomialDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(booleanParameterTypeEClass, BooleanParameterType.class, "BooleanParameterType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getBooleanParameterType_Value(), theXMLTypePackage.getBoolean(), "value", null, 0, 1, BooleanParameterType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(bpSimDataTypeEClass, BPSimDataType.class, "BPSimDataType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getBPSimDataType_Group(), ecorePackage.getEFeatureMapEntry(), "group", null, 0, -1, BPSimDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getBPSimDataType_Scenario(), this.getScenario(), null, "scenario", null, 1, -1, BPSimDataType.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + initEClass(calendarEClass, Calendar.class, "Calendar", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getCalendar_Value(), theXMLTypePackage.getString(), "value", null, 0, 1, Calendar.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getCalendar_Id(), theXMLTypePackage.getID(), "id", null, 0, 1, Calendar.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getCalendar_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Calendar.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(constantParameterEClass, ConstantParameter.class, "ConstantParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(controlParametersEClass, ControlParameters.class, "ControlParameters", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getControlParameters_Probability(), this.getParameter(), null, "probability", null, 0, 1, ControlParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getControlParameters_Condition(), this.getParameter(), null, "condition", null, 0, 1, ControlParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getControlParameters_InterTriggerTimer(), this.getParameter(), null, "interTriggerTimer", null, 0, 1, ControlParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getControlParameters_TriggerCount(), this.getParameter(), null, "triggerCount", null, 0, 1, ControlParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(costParametersEClass, CostParameters.class, "CostParameters", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCostParameters_FixedCost(), this.getParameter(), null, "fixedCost", null, 0, 1, CostParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCostParameters_UnitCost(), this.getParameter(), null, "unitCost", null, 0, 1, CostParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(dateTimeParameterTypeEClass, DateTimeParameterType.class, "DateTimeParameterType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDateTimeParameterType_Value(), theXMLTypePackage.getDateTime(), "value", null, 0, 1, DateTimeParameterType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(distributionParameterEClass, DistributionParameter.class, "DistributionParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDistributionParameter_CurrencyUnit(), theXMLTypePackage.getString(), "currencyUnit", null, 0, 1, DistributionParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getDistributionParameter_TimeUnit(), this.getTimeUnit(), "timeUnit", null, 0, 1, DistributionParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(documentRootEClass, DocumentRoot.class, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BetaDistribution(), this.getBetaDistributionType(), null, "betaDistribution", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ParameterValue(), this.getParameterValue(), null, "parameterValue", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BinomialDistribution(), this.getBinomialDistributionType(), null, "binomialDistribution", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BooleanParameter(), this.getBooleanParameterType(), null, "booleanParameter", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BPSimData(), this.getBPSimDataType(), null, "bPSimData", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_DateTimeParameter(), this.getDateTimeParameterType(), null, "dateTimeParameter", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_DurationParameter(), this.getDurationParameterType(), null, "durationParameter", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_EnumParameter(), this.getEnumParameterType(), null, "enumParameter", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ErlangDistribution(), this.getErlangDistributionType(), null, "erlangDistribution", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ExpressionParameter(), this.getExpressionParameterType(), null, "expressionParameter", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_FloatingParameter(), this.getFloatingParameterType(), null, "floatingParameter", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_GammaDistribution(), this.getGammaDistributionType(), null, "gammaDistribution", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_LogNormalDistribution(), this.getLogNormalDistributionType(), null, "logNormalDistribution", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_NegativeExponentialDistribution(), this.getNegativeExponentialDistributionType(), null, "negativeExponentialDistribution", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_NormalDistribution(), this.getNormalDistributionType(), null, "normalDistribution", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_NumericParameter(), this.getNumericParameterType(), null, "numericParameter", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_PoissonDistribution(), this.getPoissonDistributionType(), null, "poissonDistribution", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_StringParameter(), this.getStringParameterType(), null, "stringParameter", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_TriangularDistribution(), this.getTriangularDistributionType(), null, "triangularDistribution", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_TruncatedNormalDistribution(), this.getTruncatedNormalDistributionType(), null, "truncatedNormalDistribution", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_UniformDistribution(), this.getUniformDistributionType(), null, "uniformDistribution", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_UserDistribution(), this.getUserDistributionType(), null, "userDistribution", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_UserDistributionDataPoint(), this.getUserDistributionDataPointType(), null, "userDistributionDataPoint", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_WeibullDistribution(), this.getWeibullDistributionType(), null, "weibullDistribution", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + initEClass(durationParameterTypeEClass, DurationParameterType.class, "DurationParameterType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDurationParameterType_Value(), theXMLTypePackage.getDuration(), "value", null, 0, 1, DurationParameterType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(elementParametersEClass, ElementParameters.class, "ElementParameters", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getElementParameters_TimeParameters(), this.getTimeParameters(), null, "timeParameters", null, 0, 1, ElementParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getElementParameters_ControlParameters(), this.getControlParameters(), null, "controlParameters", null, 0, 1, ElementParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getElementParameters_ResourceParameters(), this.getResourceParameters(), null, "resourceParameters", null, 0, 1, ElementParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getElementParameters_PriorityParameters(), this.getPriorityParameters(), null, "priorityParameters", null, 0, 1, ElementParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getElementParameters_CostParameters(), this.getCostParameters(), null, "costParameters", null, 0, 1, ElementParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getElementParameters_PropertyParameters(), this.getPropertyParameters(), null, "propertyParameters", null, 0, 1, ElementParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getElementParameters_VendorExtension(), this.getVendorExtension(), null, "vendorExtension", null, 0, -1, ElementParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getElementParameters_ElementRef(), theXMLTypePackage.getID(), "elementRef", null, 0, 1, ElementParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getElementParameters_Id(), theXMLTypePackage.getID(), "id", null, 0, 1, ElementParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(elementParametersTypeEClass, ElementParametersType.class, "ElementParametersType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(enumParameterTypeEClass, EnumParameterType.class, "EnumParameterType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getEnumParameterType_Group(), ecorePackage.getEFeatureMapEntry(), "group", null, 0, -1, EnumParameterType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getEnumParameterType_ParameterValueGroup(), ecorePackage.getEFeatureMapEntry(), "parameterValueGroup", null, 1, -1, EnumParameterType.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getEnumParameterType_ParameterValue(), this.getParameterValue(), null, "parameterValue", null, 1, -1, EnumParameterType.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + initEClass(erlangDistributionTypeEClass, ErlangDistributionType.class, "ErlangDistributionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getErlangDistributionType_K(), theXMLTypePackage.getDouble(), "k", null, 0, 1, ErlangDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getErlangDistributionType_Mean(), theXMLTypePackage.getDouble(), "mean", null, 0, 1, ErlangDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(expressionParameterTypeEClass, ExpressionParameterType.class, "ExpressionParameterType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getExpressionParameterType_Value(), theXMLTypePackage.getString(), "value", null, 0, 1, ExpressionParameterType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(floatingParameterTypeEClass, FloatingParameterType.class, "FloatingParameterType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getFloatingParameterType_CurrencyUnit(), theXMLTypePackage.getString(), "currencyUnit", null, 0, 1, FloatingParameterType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getFloatingParameterType_TimeUnit(), this.getTimeUnit(), "timeUnit", null, 0, 1, FloatingParameterType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getFloatingParameterType_Value(), theXMLTypePackage.getDouble(), "value", null, 0, 1, FloatingParameterType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(gammaDistributionTypeEClass, GammaDistributionType.class, "GammaDistributionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getGammaDistributionType_Scale(), theXMLTypePackage.getDouble(), "scale", null, 0, 1, GammaDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getGammaDistributionType_Shape(), theXMLTypePackage.getDouble(), "shape", null, 0, 1, GammaDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(logNormalDistributionTypeEClass, LogNormalDistributionType.class, "LogNormalDistributionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getLogNormalDistributionType_Mean(), theXMLTypePackage.getDouble(), "mean", null, 0, 1, LogNormalDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getLogNormalDistributionType_StandardDeviation(), theXMLTypePackage.getDouble(), "standardDeviation", null, 0, 1, LogNormalDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(negativeExponentialDistributionTypeEClass, NegativeExponentialDistributionType.class, "NegativeExponentialDistributionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getNegativeExponentialDistributionType_Mean(), theXMLTypePackage.getDouble(), "mean", null, 0, 1, NegativeExponentialDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(normalDistributionTypeEClass, NormalDistributionType.class, "NormalDistributionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getNormalDistributionType_Mean(), theXMLTypePackage.getDouble(), "mean", null, 0, 1, NormalDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getNormalDistributionType_StandardDeviation(), theXMLTypePackage.getDouble(), "standardDeviation", null, 0, 1, NormalDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(numericParameterTypeEClass, NumericParameterType.class, "NumericParameterType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getNumericParameterType_CurrencyUnit(), theXMLTypePackage.getString(), "currencyUnit", null, 0, 1, NumericParameterType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getNumericParameterType_TimeUnit(), this.getTimeUnit(), "timeUnit", null, 0, 1, NumericParameterType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getNumericParameterType_Value(), theXMLTypePackage.getLong(), "value", null, 0, 1, NumericParameterType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(parameterEClass, Parameter.class, "Parameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getParameter_ResultRequest(), this.getResultType(), "resultRequest", null, 0, -1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getParameter_ParameterValueGroup(), ecorePackage.getEFeatureMapEntry(), "parameterValueGroup", null, 0, -1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getParameter_ParameterValue(), this.getParameterValue(), null, "parameterValue", null, 0, -1, Parameter.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEAttribute(getParameter_Kpi(), theXMLTypePackage.getBoolean(), "kpi", "false", 0, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getParameter_Sla(), theXMLTypePackage.getBoolean(), "sla", "false", 0, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(parameterValueEClass, ParameterValue.class, "ParameterValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getParameterValue_Instance(), theXMLTypePackage.getString(), "instance", null, 0, 1, ParameterValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getParameterValue_Result(), this.getResultType(), "result", null, 0, 1, ParameterValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getParameterValue_ValidFor(), theXMLTypePackage.getIDREF(), "validFor", null, 0, 1, ParameterValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(poissonDistributionTypeEClass, PoissonDistributionType.class, "PoissonDistributionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getPoissonDistributionType_Mean(), theXMLTypePackage.getDouble(), "mean", null, 0, 1, PoissonDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(priorityParametersEClass, PriorityParameters.class, "PriorityParameters", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getPriorityParameters_Interruptible(), this.getParameter(), null, "interruptible", null, 0, 1, PriorityParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getPriorityParameters_Priority(), this.getParameter(), null, "priority", null, 0, 1, PriorityParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(propertyParametersEClass, PropertyParameters.class, "PropertyParameters", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getPropertyParameters_Property(), this.getPropertyType(), null, "property", null, 0, -1, PropertyParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(propertyTypeEClass, PropertyType.class, "PropertyType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getPropertyType_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, PropertyType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(resourceParametersEClass, ResourceParameters.class, "ResourceParameters", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getResourceParameters_Selection(), this.getParameter(), null, "selection", null, 0, 1, ResourceParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getResourceParameters_Availability(), this.getParameter(), null, "availability", null, 0, 1, ResourceParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getResourceParameters_Quantity(), this.getParameter(), null, "quantity", null, 0, 1, ResourceParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getResourceParameters_Role(), this.getParameter(), null, "role", null, 0, -1, ResourceParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(scenarioEClass, Scenario.class, "Scenario", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getScenario_ScenarioParameters(), this.getScenarioParameters(), null, "scenarioParameters", null, 0, 1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getScenario_ElementParameters(), this.getElementParameters(), null, "elementParameters", null, 0, -1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getScenario_Calendar(), this.getCalendar(), null, "calendar", null, 0, -1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getScenario_VendorExtension(), this.getVendorExtension(), null, "vendorExtension", null, 0, -1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenario_Author(), theXMLTypePackage.getString(), "author", null, 0, 1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenario_Created(), theXMLTypePackage.getDateTime(), "created", null, 0, 1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenario_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenario_Id(), theXMLTypePackage.getID(), "id", null, 1, 1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenario_Inherits(), theXMLTypePackage.getIDREF(), "inherits", null, 0, 1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenario_Modified(), theXMLTypePackage.getDateTime(), "modified", null, 0, 1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenario_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenario_Result(), theXMLTypePackage.getIDREF(), "result", null, 0, 1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenario_Vendor(), theXMLTypePackage.getString(), "vendor", null, 0, 1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenario_Version(), theXMLTypePackage.getString(), "version", null, 0, 1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(scenarioParametersEClass, ScenarioParameters.class, "ScenarioParameters", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getScenarioParameters_Start(), this.getParameter(), null, "start", null, 0, 1, ScenarioParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getScenarioParameters_Duration(), this.getParameter(), null, "duration", null, 0, 1, ScenarioParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getScenarioParameters_PropertyParameters(), this.getPropertyParameters(), null, "propertyParameters", null, 0, 1, ScenarioParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenarioParameters_BaseCurrencyUnit(), theXMLTypePackage.getString(), "baseCurrencyUnit", null, 0, 1, ScenarioParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenarioParameters_BaseTimeUnit(), this.getTimeUnit(), "baseTimeUnit", null, 0, 1, ScenarioParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenarioParameters_Replication(), theXMLTypePackage.getInt(), "replication", null, 0, 1, ScenarioParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenarioParameters_Seed(), theXMLTypePackage.getLong(), "seed", null, 0, 1, ScenarioParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(scenarioParametersTypeEClass, ScenarioParametersType.class, "ScenarioParametersType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(stringParameterTypeEClass, StringParameterType.class, "StringParameterType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getStringParameterType_Value(), theXMLTypePackage.getString(), "value", null, 0, 1, StringParameterType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(timeParametersEClass, TimeParameters.class, "TimeParameters", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getTimeParameters_TransferTime(), this.getParameter(), null, "transferTime", null, 0, 1, TimeParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTimeParameters_QueueTime(), this.getParameter(), null, "queueTime", null, 0, 1, TimeParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTimeParameters_WaitTime(), this.getParameter(), null, "waitTime", null, 0, 1, TimeParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTimeParameters_SetUpTime(), this.getParameter(), null, "setUpTime", null, 0, 1, TimeParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTimeParameters_ProcessingTime(), this.getParameter(), null, "processingTime", null, 0, 1, TimeParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTimeParameters_ValidationTime(), this.getParameter(), null, "validationTime", null, 0, 1, TimeParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTimeParameters_ReworkTime(), this.getParameter(), null, "reworkTime", null, 0, 1, TimeParameters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(triangularDistributionTypeEClass, TriangularDistributionType.class, "TriangularDistributionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getTriangularDistributionType_Max(), theXMLTypePackage.getDouble(), "max", null, 0, 1, TriangularDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTriangularDistributionType_Min(), theXMLTypePackage.getDouble(), "min", null, 0, 1, TriangularDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTriangularDistributionType_Mode(), theXMLTypePackage.getDouble(), "mode", null, 0, 1, TriangularDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(truncatedNormalDistributionTypeEClass, TruncatedNormalDistributionType.class, "TruncatedNormalDistributionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getTruncatedNormalDistributionType_Max(), theXMLTypePackage.getDouble(), "max", null, 0, 1, TruncatedNormalDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTruncatedNormalDistributionType_Mean(), theXMLTypePackage.getDouble(), "mean", null, 0, 1, TruncatedNormalDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTruncatedNormalDistributionType_Min(), theXMLTypePackage.getDouble(), "min", null, 0, 1, TruncatedNormalDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTruncatedNormalDistributionType_StandardDeviation(), theXMLTypePackage.getDouble(), "standardDeviation", null, 0, 1, TruncatedNormalDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(uniformDistributionTypeEClass, UniformDistributionType.class, "UniformDistributionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getUniformDistributionType_Max(), theXMLTypePackage.getDouble(), "max", null, 0, 1, UniformDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getUniformDistributionType_Min(), theXMLTypePackage.getDouble(), "min", null, 0, 1, UniformDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(userDistributionDataPointTypeEClass, UserDistributionDataPointType.class, "UserDistributionDataPointType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getUserDistributionDataPointType_ParameterValueGroup(), ecorePackage.getEFeatureMapEntry(), "parameterValueGroup", null, 1, 1, UserDistributionDataPointType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getUserDistributionDataPointType_ParameterValue(), this.getParameterValue(), null, "parameterValue", null, 1, 1, UserDistributionDataPointType.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEAttribute(getUserDistributionDataPointType_Probability(), theXMLTypePackage.getFloat(), "probability", null, 0, 1, UserDistributionDataPointType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(userDistributionTypeEClass, UserDistributionType.class, "UserDistributionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getUserDistributionType_Group(), ecorePackage.getEFeatureMapEntry(), "group", null, 0, -1, UserDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getUserDistributionType_UserDistributionDataPoint(), this.getUserDistributionDataPointType(), null, "userDistributionDataPoint", null, 1, -1, UserDistributionType.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEAttribute(getUserDistributionType_Discrete(), theXMLTypePackage.getBoolean(), "discrete", "false", 0, 1, UserDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(vendorExtensionEClass, VendorExtension.class, "VendorExtension", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getVendorExtension_Any(), ecorePackage.getEFeatureMapEntry(), "any", null, 0, 1, VendorExtension.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getVendorExtension_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, VendorExtension.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getVendorExtension_AnyAttribute(), ecorePackage.getEFeatureMapEntry(), "anyAttribute", null, 0, -1, VendorExtension.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(weibullDistributionTypeEClass, WeibullDistributionType.class, "WeibullDistributionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getWeibullDistributionType_Scale(), theXMLTypePackage.getDouble(), "scale", null, 0, 1, WeibullDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getWeibullDistributionType_Shape(), theXMLTypePackage.getDouble(), "shape", null, 0, 1, WeibullDistributionType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Initialize enums and add enum literals + initEEnum(resultTypeEEnum, ResultType.class, "ResultType"); + addEEnumLiteral(resultTypeEEnum, ResultType.MIN); + addEEnumLiteral(resultTypeEEnum, ResultType.MAX); + addEEnumLiteral(resultTypeEEnum, ResultType.MEAN); + addEEnumLiteral(resultTypeEEnum, ResultType.COUNT); + addEEnumLiteral(resultTypeEEnum, ResultType.SUM); + + initEEnum(timeUnitEEnum, TimeUnit.class, "TimeUnit"); + addEEnumLiteral(timeUnitEEnum, TimeUnit.MS); + addEEnumLiteral(timeUnitEEnum, TimeUnit.S); + addEEnumLiteral(timeUnitEEnum, TimeUnit.MIN); + addEEnumLiteral(timeUnitEEnum, TimeUnit.HOUR); + addEEnumLiteral(timeUnitEEnum, TimeUnit.DAY); + addEEnumLiteral(timeUnitEEnum, TimeUnit.YEAR); + + // Initialize data types + initEDataType(resultTypeObjectEDataType, ResultType.class, "ResultTypeObject", IS_SERIALIZABLE, IS_GENERATED_INSTANCE_CLASS); + initEDataType(timeUnitObjectEDataType, TimeUnit.class, "TimeUnitObject", IS_SERIALIZABLE, IS_GENERATED_INSTANCE_CLASS); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http:///org/eclipse/emf/ecore/util/ExtendedMetaData + createExtendedMetaDataAnnotations(); + } + + /** + * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. + * + * + * @generated + */ + protected void createExtendedMetaDataAnnotations() { + String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; + addAnnotation + (betaDistributionTypeEClass, + source, + new String[] { + "name", "BetaDistribution_._type", + "kind", "empty" + }); + addAnnotation + (getBetaDistributionType_Scale(), + source, + new String[] { + "kind", "attribute", + "name", "scale" + }); + addAnnotation + (getBetaDistributionType_Shape(), + source, + new String[] { + "kind", "attribute", + "name", "shape" + }); + addAnnotation + (binomialDistributionTypeEClass, + source, + new String[] { + "name", "BinomialDistribution_._type", + "kind", "empty" + }); + addAnnotation + (getBinomialDistributionType_Probability(), + source, + new String[] { + "kind", "attribute", + "name", "probability" + }); + addAnnotation + (getBinomialDistributionType_Trials(), + source, + new String[] { + "kind", "attribute", + "name", "trials" + }); + addAnnotation + (booleanParameterTypeEClass, + source, + new String[] { + "name", "BooleanParameter_._type", + "kind", "empty" + }); + addAnnotation + (getBooleanParameterType_Value(), + source, + new String[] { + "kind", "attribute", + "name", "value" + }); + addAnnotation + (bpSimDataTypeEClass, + source, + new String[] { + "name", "BPSimData_._type", + "kind", "elementOnly" + }); + addAnnotation + (getBPSimDataType_Group(), + source, + new String[] { + "kind", "group", + "name", "group:0" + }); + addAnnotation + (getBPSimDataType_Scenario(), + source, + new String[] { + "kind", "element", + "name", "Scenario", + "namespace", "##targetNamespace", + "group", "#group:0" + }); + addAnnotation + (calendarEClass, + source, + new String[] { + "name", "Calendar", + "kind", "simple" + }); + addAnnotation + (getCalendar_Value(), + source, + new String[] { + "name", ":0", + "kind", "simple" + }); + addAnnotation + (getCalendar_Id(), + source, + new String[] { + "kind", "attribute", + "name", "id" + }); + addAnnotation + (getCalendar_Name(), + source, + new String[] { + "kind", "attribute", + "name", "name" + }); + addAnnotation + (constantParameterEClass, + source, + new String[] { + "name", "ConstantParameter", + "kind", "empty" + }); + addAnnotation + (controlParametersEClass, + source, + new String[] { + "name", "ControlParameters", + "kind", "elementOnly" + }); + addAnnotation + (getControlParameters_Probability(), + source, + new String[] { + "kind", "element", + "name", "Probability", + "namespace", "##targetNamespace" + }); + addAnnotation + (getControlParameters_Condition(), + source, + new String[] { + "kind", "element", + "name", "Condition", + "namespace", "##targetNamespace" + }); + addAnnotation + (getControlParameters_InterTriggerTimer(), + source, + new String[] { + "kind", "element", + "name", "InterTriggerTimer", + "namespace", "##targetNamespace" + }); + addAnnotation + (getControlParameters_TriggerCount(), + source, + new String[] { + "kind", "element", + "name", "TriggerCount", + "namespace", "##targetNamespace" + }); + addAnnotation + (costParametersEClass, + source, + new String[] { + "name", "CostParameters", + "kind", "elementOnly" + }); + addAnnotation + (getCostParameters_FixedCost(), + source, + new String[] { + "kind", "element", + "name", "FixedCost", + "namespace", "##targetNamespace" + }); + addAnnotation + (getCostParameters_UnitCost(), + source, + new String[] { + "kind", "element", + "name", "UnitCost", + "namespace", "##targetNamespace" + }); + addAnnotation + (dateTimeParameterTypeEClass, + source, + new String[] { + "name", "DateTimeParameter_._type", + "kind", "empty" + }); + addAnnotation + (getDateTimeParameterType_Value(), + source, + new String[] { + "kind", "attribute", + "name", "value" + }); + addAnnotation + (distributionParameterEClass, + source, + new String[] { + "name", "DistributionParameter", + "kind", "empty" + }); + addAnnotation + (getDistributionParameter_CurrencyUnit(), + source, + new String[] { + "kind", "attribute", + "name", "currencyUnit" + }); + addAnnotation + (getDistributionParameter_TimeUnit(), + source, + new String[] { + "kind", "attribute", + "name", "timeUnit" + }); + addAnnotation + (documentRootEClass, + source, + new String[] { + "name", "", + "kind", "mixed" + }); + addAnnotation + (getDocumentRoot_Mixed(), + source, + new String[] { + "kind", "elementWildcard", + "name", ":mixed" + }); + addAnnotation + (getDocumentRoot_XMLNSPrefixMap(), + source, + new String[] { + "kind", "attribute", + "name", "xmlns:prefix" + }); + addAnnotation + (getDocumentRoot_XSISchemaLocation(), + source, + new String[] { + "kind", "attribute", + "name", "xsi:schemaLocation" + }); + addAnnotation + (getDocumentRoot_BetaDistribution(), + source, + new String[] { + "kind", "element", + "name", "BetaDistribution", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_ParameterValue(), + source, + new String[] { + "kind", "element", + "name", "ParameterValue", + "namespace", "##targetNamespace" + }); + addAnnotation + (getDocumentRoot_BinomialDistribution(), + source, + new String[] { + "kind", "element", + "name", "BinomialDistribution", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_BooleanParameter(), + source, + new String[] { + "kind", "element", + "name", "BooleanParameter", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_BPSimData(), + source, + new String[] { + "kind", "element", + "name", "BPSimData", + "namespace", "##targetNamespace" + }); + addAnnotation + (getDocumentRoot_DateTimeParameter(), + source, + new String[] { + "kind", "element", + "name", "DateTimeParameter", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_DurationParameter(), + source, + new String[] { + "kind", "element", + "name", "DurationParameter", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_EnumParameter(), + source, + new String[] { + "kind", "element", + "name", "EnumParameter", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_ErlangDistribution(), + source, + new String[] { + "kind", "element", + "name", "ErlangDistribution", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_ExpressionParameter(), + source, + new String[] { + "kind", "element", + "name", "ExpressionParameter", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_FloatingParameter(), + source, + new String[] { + "kind", "element", + "name", "FloatingParameter", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_GammaDistribution(), + source, + new String[] { + "kind", "element", + "name", "GammaDistribution", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_LogNormalDistribution(), + source, + new String[] { + "kind", "element", + "name", "LogNormalDistribution", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_NegativeExponentialDistribution(), + source, + new String[] { + "kind", "element", + "name", "NegativeExponentialDistribution", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_NormalDistribution(), + source, + new String[] { + "kind", "element", + "name", "NormalDistribution", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_NumericParameter(), + source, + new String[] { + "kind", "element", + "name", "NumericParameter", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_PoissonDistribution(), + source, + new String[] { + "kind", "element", + "name", "PoissonDistribution", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_StringParameter(), + source, + new String[] { + "kind", "element", + "name", "StringParameter", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_TriangularDistribution(), + source, + new String[] { + "kind", "element", + "name", "TriangularDistribution", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_TruncatedNormalDistribution(), + source, + new String[] { + "kind", "element", + "name", "TruncatedNormalDistribution", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_UniformDistribution(), + source, + new String[] { + "kind", "element", + "name", "UniformDistribution", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_UserDistribution(), + source, + new String[] { + "kind", "element", + "name", "UserDistribution", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (getDocumentRoot_UserDistributionDataPoint(), + source, + new String[] { + "kind", "element", + "name", "UserDistributionDataPoint", + "namespace", "##targetNamespace" + }); + addAnnotation + (getDocumentRoot_WeibullDistribution(), + source, + new String[] { + "kind", "element", + "name", "WeibullDistribution", + "namespace", "##targetNamespace", + "affiliation", "ParameterValue" + }); + addAnnotation + (durationParameterTypeEClass, + source, + new String[] { + "name", "DurationParameter_._type", + "kind", "empty" + }); + addAnnotation + (getDurationParameterType_Value(), + source, + new String[] { + "kind", "attribute", + "name", "value" + }); + addAnnotation + (elementParametersEClass, + source, + new String[] { + "name", "ElementParameters", + "kind", "elementOnly" + }); + addAnnotation + (getElementParameters_TimeParameters(), + source, + new String[] { + "kind", "element", + "name", "TimeParameters", + "namespace", "##targetNamespace" + }); + addAnnotation + (getElementParameters_ControlParameters(), + source, + new String[] { + "kind", "element", + "name", "ControlParameters", + "namespace", "##targetNamespace" + }); + addAnnotation + (getElementParameters_ResourceParameters(), + source, + new String[] { + "kind", "element", + "name", "ResourceParameters", + "namespace", "##targetNamespace" + }); + addAnnotation + (getElementParameters_PriorityParameters(), + source, + new String[] { + "kind", "element", + "name", "PriorityParameters", + "namespace", "##targetNamespace" + }); + addAnnotation + (getElementParameters_CostParameters(), + source, + new String[] { + "kind", "element", + "name", "CostParameters", + "namespace", "##targetNamespace" + }); + addAnnotation + (getElementParameters_PropertyParameters(), + source, + new String[] { + "kind", "element", + "name", "PropertyParameters", + "namespace", "##targetNamespace" + }); + addAnnotation + (getElementParameters_VendorExtension(), + source, + new String[] { + "kind", "element", + "name", "VendorExtension", + "namespace", "##targetNamespace" + }); + addAnnotation + (getElementParameters_ElementRef(), + source, + new String[] { + "kind", "attribute", + "name", "elementRef" + }); + addAnnotation + (getElementParameters_Id(), + source, + new String[] { + "kind", "attribute", + "name", "id" + }); + addAnnotation + (elementParametersTypeEClass, + source, + new String[] { + "name", "ElementParametersType", + "kind", "elementOnly" + }); + addAnnotation + (enumParameterTypeEClass, + source, + new String[] { + "name", "EnumParameter_._type", + "kind", "elementOnly" + }); + addAnnotation + (getEnumParameterType_Group(), + source, + new String[] { + "kind", "group", + "name", "group:3" + }); + addAnnotation + (getEnumParameterType_ParameterValueGroup(), + source, + new String[] { + "kind", "group", + "name", "ParameterValue:group", + "namespace", "##targetNamespace", + "group", "#group:3" + }); + addAnnotation + (getEnumParameterType_ParameterValue(), + source, + new String[] { + "kind", "element", + "name", "ParameterValue", + "namespace", "##targetNamespace", + "group", "ParameterValue:group" + }); + addAnnotation + (erlangDistributionTypeEClass, + source, + new String[] { + "name", "ErlangDistribution_._type", + "kind", "empty" + }); + addAnnotation + (getErlangDistributionType_K(), + source, + new String[] { + "kind", "attribute", + "name", "k" + }); + addAnnotation + (getErlangDistributionType_Mean(), + source, + new String[] { + "kind", "attribute", + "name", "mean" + }); + addAnnotation + (expressionParameterTypeEClass, + source, + new String[] { + "name", "ExpressionParameter_._type", + "kind", "empty" + }); + addAnnotation + (getExpressionParameterType_Value(), + source, + new String[] { + "kind", "attribute", + "name", "value" + }); + addAnnotation + (floatingParameterTypeEClass, + source, + new String[] { + "name", "FloatingParameter_._type", + "kind", "empty" + }); + addAnnotation + (getFloatingParameterType_CurrencyUnit(), + source, + new String[] { + "kind", "attribute", + "name", "currencyUnit" + }); + addAnnotation + (getFloatingParameterType_TimeUnit(), + source, + new String[] { + "kind", "attribute", + "name", "timeUnit" + }); + addAnnotation + (getFloatingParameterType_Value(), + source, + new String[] { + "kind", "attribute", + "name", "value" + }); + addAnnotation + (gammaDistributionTypeEClass, + source, + new String[] { + "name", "GammaDistribution_._type", + "kind", "empty" + }); + addAnnotation + (getGammaDistributionType_Scale(), + source, + new String[] { + "kind", "attribute", + "name", "scale" + }); + addAnnotation + (getGammaDistributionType_Shape(), + source, + new String[] { + "kind", "attribute", + "name", "shape" + }); + addAnnotation + (logNormalDistributionTypeEClass, + source, + new String[] { + "name", "LogNormalDistribution_._type", + "kind", "empty" + }); + addAnnotation + (getLogNormalDistributionType_Mean(), + source, + new String[] { + "kind", "attribute", + "name", "mean" + }); + addAnnotation + (getLogNormalDistributionType_StandardDeviation(), + source, + new String[] { + "kind", "attribute", + "name", "standardDeviation" + }); + addAnnotation + (negativeExponentialDistributionTypeEClass, + source, + new String[] { + "name", "NegativeExponentialDistribution_._type", + "kind", "empty" + }); + addAnnotation + (getNegativeExponentialDistributionType_Mean(), + source, + new String[] { + "kind", "attribute", + "name", "mean" + }); + addAnnotation + (normalDistributionTypeEClass, + source, + new String[] { + "name", "NormalDistribution_._type", + "kind", "empty" + }); + addAnnotation + (getNormalDistributionType_Mean(), + source, + new String[] { + "kind", "attribute", + "name", "mean" + }); + addAnnotation + (getNormalDistributionType_StandardDeviation(), + source, + new String[] { + "kind", "attribute", + "name", "standardDeviation" + }); + addAnnotation + (numericParameterTypeEClass, + source, + new String[] { + "name", "NumericParameter_._type", + "kind", "empty" + }); + addAnnotation + (getNumericParameterType_CurrencyUnit(), + source, + new String[] { + "kind", "attribute", + "name", "currencyUnit" + }); + addAnnotation + (getNumericParameterType_TimeUnit(), + source, + new String[] { + "kind", "attribute", + "name", "timeUnit" + }); + addAnnotation + (getNumericParameterType_Value(), + source, + new String[] { + "kind", "attribute", + "name", "value" + }); + addAnnotation + (parameterEClass, + source, + new String[] { + "name", "Parameter", + "kind", "elementOnly" + }); + addAnnotation + (getParameter_ResultRequest(), + source, + new String[] { + "kind", "element", + "name", "ResultRequest", + "namespace", "##targetNamespace" + }); + addAnnotation + (getParameter_ParameterValueGroup(), + source, + new String[] { + "kind", "group", + "name", "ParameterValue:group", + "namespace", "##targetNamespace" + }); + addAnnotation + (getParameter_ParameterValue(), + source, + new String[] { + "kind", "element", + "name", "ParameterValue", + "namespace", "##targetNamespace", + "group", "ParameterValue:group" + }); + addAnnotation + (getParameter_Kpi(), + source, + new String[] { + "kind", "attribute", + "name", "kpi" + }); + addAnnotation + (getParameter_Sla(), + source, + new String[] { + "kind", "attribute", + "name", "sla" + }); + addAnnotation + (parameterValueEClass, + source, + new String[] { + "name", "ParameterValue", + "kind", "empty" + }); + addAnnotation + (getParameterValue_Instance(), + source, + new String[] { + "kind", "attribute", + "name", "instance" + }); + addAnnotation + (getParameterValue_Result(), + source, + new String[] { + "kind", "attribute", + "name", "result" + }); + addAnnotation + (getParameterValue_ValidFor(), + source, + new String[] { + "kind", "attribute", + "name", "validFor" + }); + addAnnotation + (poissonDistributionTypeEClass, + source, + new String[] { + "name", "PoissonDistribution_._type", + "kind", "empty" + }); + addAnnotation + (getPoissonDistributionType_Mean(), + source, + new String[] { + "kind", "attribute", + "name", "mean" + }); + addAnnotation + (priorityParametersEClass, + source, + new String[] { + "name", "PriorityParameters", + "kind", "elementOnly" + }); + addAnnotation + (getPriorityParameters_Interruptible(), + source, + new String[] { + "kind", "element", + "name", "Interruptible", + "namespace", "##targetNamespace" + }); + addAnnotation + (getPriorityParameters_Priority(), + source, + new String[] { + "kind", "element", + "name", "Priority", + "namespace", "##targetNamespace" + }); + addAnnotation + (propertyParametersEClass, + source, + new String[] { + "name", "PropertyParameters", + "kind", "elementOnly" + }); + addAnnotation + (getPropertyParameters_Property(), + source, + new String[] { + "kind", "element", + "name", "Property", + "namespace", "##targetNamespace" + }); + addAnnotation + (propertyTypeEClass, + source, + new String[] { + "name", "Property_._type", + "kind", "elementOnly" + }); + addAnnotation + (getPropertyType_Name(), + source, + new String[] { + "kind", "attribute", + "name", "name" + }); + addAnnotation + (resourceParametersEClass, + source, + new String[] { + "name", "ResourceParameters", + "kind", "elementOnly" + }); + addAnnotation + (getResourceParameters_Selection(), + source, + new String[] { + "kind", "element", + "name", "Selection", + "namespace", "##targetNamespace" + }); + addAnnotation + (getResourceParameters_Availability(), + source, + new String[] { + "kind", "element", + "name", "Availability", + "namespace", "##targetNamespace" + }); + addAnnotation + (getResourceParameters_Quantity(), + source, + new String[] { + "kind", "element", + "name", "Quantity", + "namespace", "##targetNamespace" + }); + addAnnotation + (getResourceParameters_Role(), + source, + new String[] { + "kind", "element", + "name", "Role", + "namespace", "##targetNamespace" + }); + addAnnotation + (resultTypeEEnum, + source, + new String[] { + "name", "ResultType" + }); + addAnnotation + (resultTypeObjectEDataType, + source, + new String[] { + "name", "ResultType:Object", + "baseType", "ResultType" + }); + addAnnotation + (scenarioEClass, + source, + new String[] { + "name", "Scenario", + "kind", "elementOnly" + }); + addAnnotation + (getScenario_ScenarioParameters(), + source, + new String[] { + "kind", "element", + "name", "ScenarioParameters", + "namespace", "##targetNamespace" + }); + addAnnotation + (getScenario_ElementParameters(), + source, + new String[] { + "kind", "element", + "name", "ElementParameters", + "namespace", "##targetNamespace" + }); + addAnnotation + (getScenario_Calendar(), + source, + new String[] { + "kind", "element", + "name", "Calendar", + "namespace", "##targetNamespace" + }); + addAnnotation + (getScenario_VendorExtension(), + source, + new String[] { + "kind", "element", + "name", "VendorExtension", + "namespace", "##targetNamespace" + }); + addAnnotation + (getScenario_Author(), + source, + new String[] { + "kind", "attribute", + "name", "author" + }); + addAnnotation + (getScenario_Created(), + source, + new String[] { + "kind", "attribute", + "name", "created" + }); + addAnnotation + (getScenario_Description(), + source, + new String[] { + "kind", "attribute", + "name", "description" + }); + addAnnotation + (getScenario_Id(), + source, + new String[] { + "kind", "attribute", + "name", "id" + }); + addAnnotation + (getScenario_Inherits(), + source, + new String[] { + "kind", "attribute", + "name", "inherits" + }); + addAnnotation + (getScenario_Modified(), + source, + new String[] { + "kind", "attribute", + "name", "modified" + }); + addAnnotation + (getScenario_Name(), + source, + new String[] { + "kind", "attribute", + "name", "name" + }); + addAnnotation + (getScenario_Result(), + source, + new String[] { + "kind", "attribute", + "name", "result" + }); + addAnnotation + (getScenario_Vendor(), + source, + new String[] { + "kind", "attribute", + "name", "vendor" + }); + addAnnotation + (getScenario_Version(), + source, + new String[] { + "kind", "attribute", + "name", "version" + }); + addAnnotation + (scenarioParametersEClass, + source, + new String[] { + "name", "ScenarioParameters", + "kind", "elementOnly" + }); + addAnnotation + (getScenarioParameters_Start(), + source, + new String[] { + "kind", "element", + "name", "Start", + "namespace", "##targetNamespace" + }); + addAnnotation + (getScenarioParameters_Duration(), + source, + new String[] { + "kind", "element", + "name", "Duration", + "namespace", "##targetNamespace" + }); + addAnnotation + (getScenarioParameters_PropertyParameters(), + source, + new String[] { + "kind", "element", + "name", "PropertyParameters", + "namespace", "##targetNamespace" + }); + addAnnotation + (getScenarioParameters_BaseCurrencyUnit(), + source, + new String[] { + "kind", "attribute", + "name", "baseCurrencyUnit" + }); + addAnnotation + (getScenarioParameters_BaseTimeUnit(), + source, + new String[] { + "kind", "attribute", + "name", "baseTimeUnit" + }); + addAnnotation + (getScenarioParameters_Replication(), + source, + new String[] { + "kind", "attribute", + "name", "replication" + }); + addAnnotation + (getScenarioParameters_Seed(), + source, + new String[] { + "kind", "attribute", + "name", "seed" + }); + addAnnotation + (scenarioParametersTypeEClass, + source, + new String[] { + "name", "ScenarioParameters_._type", + "kind", "elementOnly" + }); + addAnnotation + (stringParameterTypeEClass, + source, + new String[] { + "name", "StringParameter_._type", + "kind", "empty" + }); + addAnnotation + (getStringParameterType_Value(), + source, + new String[] { + "kind", "attribute", + "name", "value" + }); + addAnnotation + (timeParametersEClass, + source, + new String[] { + "name", "TimeParameters", + "kind", "elementOnly" + }); + addAnnotation + (getTimeParameters_TransferTime(), + source, + new String[] { + "kind", "element", + "name", "TransferTime", + "namespace", "##targetNamespace" + }); + addAnnotation + (getTimeParameters_QueueTime(), + source, + new String[] { + "kind", "element", + "name", "QueueTime", + "namespace", "##targetNamespace" + }); + addAnnotation + (getTimeParameters_WaitTime(), + source, + new String[] { + "kind", "element", + "name", "WaitTime", + "namespace", "##targetNamespace" + }); + addAnnotation + (getTimeParameters_SetUpTime(), + source, + new String[] { + "kind", "element", + "name", "SetUpTime", + "namespace", "##targetNamespace" + }); + addAnnotation + (getTimeParameters_ProcessingTime(), + source, + new String[] { + "kind", "element", + "name", "ProcessingTime", + "namespace", "##targetNamespace" + }); + addAnnotation + (getTimeParameters_ValidationTime(), + source, + new String[] { + "kind", "element", + "name", "ValidationTime", + "namespace", "##targetNamespace" + }); + addAnnotation + (getTimeParameters_ReworkTime(), + source, + new String[] { + "kind", "element", + "name", "ReworkTime", + "namespace", "##targetNamespace" + }); + addAnnotation + (timeUnitEEnum, + source, + new String[] { + "name", "TimeUnit" + }); + addAnnotation + (timeUnitObjectEDataType, + source, + new String[] { + "name", "TimeUnit:Object", + "baseType", "TimeUnit" + }); + addAnnotation + (triangularDistributionTypeEClass, + source, + new String[] { + "name", "TriangularDistribution_._type", + "kind", "empty" + }); + addAnnotation + (getTriangularDistributionType_Max(), + source, + new String[] { + "kind", "attribute", + "name", "max" + }); + addAnnotation + (getTriangularDistributionType_Min(), + source, + new String[] { + "kind", "attribute", + "name", "min" + }); + addAnnotation + (getTriangularDistributionType_Mode(), + source, + new String[] { + "kind", "attribute", + "name", "mode" + }); + addAnnotation + (truncatedNormalDistributionTypeEClass, + source, + new String[] { + "name", "TruncatedNormalDistribution_._type", + "kind", "empty" + }); + addAnnotation + (getTruncatedNormalDistributionType_Max(), + source, + new String[] { + "kind", "attribute", + "name", "max" + }); + addAnnotation + (getTruncatedNormalDistributionType_Mean(), + source, + new String[] { + "kind", "attribute", + "name", "mean" + }); + addAnnotation + (getTruncatedNormalDistributionType_Min(), + source, + new String[] { + "kind", "attribute", + "name", "min" + }); + addAnnotation + (getTruncatedNormalDistributionType_StandardDeviation(), + source, + new String[] { + "kind", "attribute", + "name", "standardDeviation" + }); + addAnnotation + (uniformDistributionTypeEClass, + source, + new String[] { + "name", "UniformDistribution_._type", + "kind", "empty" + }); + addAnnotation + (getUniformDistributionType_Max(), + source, + new String[] { + "kind", "attribute", + "name", "max" + }); + addAnnotation + (getUniformDistributionType_Min(), + source, + new String[] { + "kind", "attribute", + "name", "min" + }); + addAnnotation + (userDistributionDataPointTypeEClass, + source, + new String[] { + "name", "UserDistributionDataPoint_._type", + "kind", "elementOnly" + }); + addAnnotation + (getUserDistributionDataPointType_ParameterValueGroup(), + source, + new String[] { + "kind", "group", + "name", "ParameterValue:group", + "namespace", "##targetNamespace" + }); + addAnnotation + (getUserDistributionDataPointType_ParameterValue(), + source, + new String[] { + "kind", "element", + "name", "ParameterValue", + "namespace", "##targetNamespace", + "group", "ParameterValue:group" + }); + addAnnotation + (getUserDistributionDataPointType_Probability(), + source, + new String[] { + "kind", "attribute", + "name", "probability" + }); + addAnnotation + (userDistributionTypeEClass, + source, + new String[] { + "name", "UserDistribution_._type", + "kind", "elementOnly" + }); + addAnnotation + (getUserDistributionType_Group(), + source, + new String[] { + "kind", "group", + "name", "group:5" + }); + addAnnotation + (getUserDistributionType_UserDistributionDataPoint(), + source, + new String[] { + "kind", "element", + "name", "UserDistributionDataPoint", + "namespace", "##targetNamespace", + "group", "#group:5" + }); + addAnnotation + (getUserDistributionType_Discrete(), + source, + new String[] { + "kind", "attribute", + "name", "discrete" + }); + addAnnotation + (vendorExtensionEClass, + source, + new String[] { + "name", "VendorExtension", + "kind", "elementOnly" + }); + addAnnotation + (getVendorExtension_Any(), + source, + new String[] { + "kind", "elementWildcard", + "wildcards", "##other", + "name", ":0", + "processing", "strict" + }); + addAnnotation + (getVendorExtension_Name(), + source, + new String[] { + "kind", "attribute", + "name", "name" + }); + addAnnotation + (getVendorExtension_AnyAttribute(), + source, + new String[] { + "kind", "attributeWildcard", + "wildcards", "##other", + "name", ":2", + "processing", "strict" + }); + addAnnotation + (weibullDistributionTypeEClass, + source, + new String[] { + "name", "WeibullDistribution_._type", + "kind", "empty" + }); + addAnnotation + (getWeibullDistributionType_Scale(), + source, + new String[] { + "kind", "attribute", + "name", "scale" + }); + addAnnotation + (getWeibullDistributionType_Shape(), + source, + new String[] { + "kind", "attribute", + "name", "shape" + }); + } + +} //BpsimPackageImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/CalendarImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/CalendarImpl.java new file mode 100644 index 00000000000..41e8e4ea84d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/CalendarImpl.java @@ -0,0 +1,282 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.Calendar; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Calendar'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.CalendarImpl#getValue Value}
  • + *
  • {@link bpsim.impl.CalendarImpl#getId Id}
  • + *
  • {@link bpsim.impl.CalendarImpl#getName Name}
  • + *
+ * + * @generated + */ +public class CalendarImpl extends EObjectImpl implements Calendar { + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final String VALUE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + @GwtTransient + protected String value = VALUE_EDEFAULT; + + /** + * The default value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + protected static final String ID_EDEFAULT = null; + + /** + * The cached value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + @GwtTransient + protected String id = ID_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected CalendarImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.CALENDAR; + } + + /** + * + * + * @generated + */ + @Override + public String getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public void setValue(String newValue) { + String oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.CALENDAR__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + @Override + public String getId() { + return id; + } + + /** + * + * + * @generated + */ + @Override + public void setId(String newId) { + String oldId = id; + id = newId; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.CALENDAR__ID, oldId, id)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.CALENDAR__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.CALENDAR__VALUE: + return getValue(); + case BpsimPackage.CALENDAR__ID: + return getId(); + case BpsimPackage.CALENDAR__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.CALENDAR__VALUE: + setValue((String)newValue); + return; + case BpsimPackage.CALENDAR__ID: + setId((String)newValue); + return; + case BpsimPackage.CALENDAR__NAME: + setName((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.CALENDAR__VALUE: + setValue(VALUE_EDEFAULT); + return; + case BpsimPackage.CALENDAR__ID: + setId(ID_EDEFAULT); + return; + case BpsimPackage.CALENDAR__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.CALENDAR__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + case BpsimPackage.CALENDAR__ID: + return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); + case BpsimPackage.CALENDAR__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (value: "); + result.append(value); + result.append(", id: "); + result.append(id); + result.append(", name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //CalendarImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ConstantParameterImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ConstantParameterImpl.java new file mode 100644 index 00000000000..c23c8937f55 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ConstantParameterImpl.java @@ -0,0 +1,37 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.ConstantParameter; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Constant Parameter'. + * + * + * @generated + */ +public class ConstantParameterImpl extends ParameterValueImpl implements ConstantParameter { + /** + * + * + * @generated + */ + protected ConstantParameterImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.CONSTANT_PARAMETER; + } + +} //ConstantParameterImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ControlParametersImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ControlParametersImpl.java new file mode 100644 index 00000000000..3b630f95aeb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ControlParametersImpl.java @@ -0,0 +1,388 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.ControlParameters; +import bpsim.Parameter; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Control Parameters'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.ControlParametersImpl#getProbability Probability}
  • + *
  • {@link bpsim.impl.ControlParametersImpl#getCondition Condition}
  • + *
  • {@link bpsim.impl.ControlParametersImpl#getInterTriggerTimer Inter Trigger Timer}
  • + *
  • {@link bpsim.impl.ControlParametersImpl#getTriggerCount Trigger Count}
  • + *
+ * + * @generated + */ +public class ControlParametersImpl extends EObjectImpl implements ControlParameters { + /** + * The cached value of the '{@link #getProbability() Probability}' containment reference. + * + * + * @see #getProbability() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter probability; + + /** + * The cached value of the '{@link #getCondition() Condition}' containment reference. + * + * + * @see #getCondition() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter condition; + + /** + * The cached value of the '{@link #getInterTriggerTimer() Inter Trigger Timer}' containment reference. + * + * + * @see #getInterTriggerTimer() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter interTriggerTimer; + + /** + * The cached value of the '{@link #getTriggerCount() Trigger Count}' containment reference. + * + * + * @see #getTriggerCount() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter triggerCount; + + /** + * + * + * @generated + */ + protected ControlParametersImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.CONTROL_PARAMETERS; + } + + /** + * + * + * @generated + */ + @Override + public Parameter getProbability() { + return probability; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetProbability(Parameter newProbability, NotificationChain msgs) { + Parameter oldProbability = probability; + probability = newProbability; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.CONTROL_PARAMETERS__PROBABILITY, oldProbability, newProbability); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setProbability(Parameter newProbability) { + if (newProbability != probability) { + NotificationChain msgs = null; + if (probability != null) + msgs = ((InternalEObject)probability).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.CONTROL_PARAMETERS__PROBABILITY, null, msgs); + if (newProbability != null) + msgs = ((InternalEObject)newProbability).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.CONTROL_PARAMETERS__PROBABILITY, null, msgs); + msgs = basicSetProbability(newProbability, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.CONTROL_PARAMETERS__PROBABILITY, newProbability, newProbability)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getCondition() { + return condition; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCondition(Parameter newCondition, NotificationChain msgs) { + Parameter oldCondition = condition; + condition = newCondition; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.CONTROL_PARAMETERS__CONDITION, oldCondition, newCondition); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setCondition(Parameter newCondition) { + if (newCondition != condition) { + NotificationChain msgs = null; + if (condition != null) + msgs = ((InternalEObject)condition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.CONTROL_PARAMETERS__CONDITION, null, msgs); + if (newCondition != null) + msgs = ((InternalEObject)newCondition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.CONTROL_PARAMETERS__CONDITION, null, msgs); + msgs = basicSetCondition(newCondition, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.CONTROL_PARAMETERS__CONDITION, newCondition, newCondition)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getInterTriggerTimer() { + return interTriggerTimer; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetInterTriggerTimer(Parameter newInterTriggerTimer, NotificationChain msgs) { + Parameter oldInterTriggerTimer = interTriggerTimer; + interTriggerTimer = newInterTriggerTimer; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.CONTROL_PARAMETERS__INTER_TRIGGER_TIMER, oldInterTriggerTimer, newInterTriggerTimer); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setInterTriggerTimer(Parameter newInterTriggerTimer) { + if (newInterTriggerTimer != interTriggerTimer) { + NotificationChain msgs = null; + if (interTriggerTimer != null) + msgs = ((InternalEObject)interTriggerTimer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.CONTROL_PARAMETERS__INTER_TRIGGER_TIMER, null, msgs); + if (newInterTriggerTimer != null) + msgs = ((InternalEObject)newInterTriggerTimer).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.CONTROL_PARAMETERS__INTER_TRIGGER_TIMER, null, msgs); + msgs = basicSetInterTriggerTimer(newInterTriggerTimer, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.CONTROL_PARAMETERS__INTER_TRIGGER_TIMER, newInterTriggerTimer, newInterTriggerTimer)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getTriggerCount() { + return triggerCount; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTriggerCount(Parameter newTriggerCount, NotificationChain msgs) { + Parameter oldTriggerCount = triggerCount; + triggerCount = newTriggerCount; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.CONTROL_PARAMETERS__TRIGGER_COUNT, oldTriggerCount, newTriggerCount); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setTriggerCount(Parameter newTriggerCount) { + if (newTriggerCount != triggerCount) { + NotificationChain msgs = null; + if (triggerCount != null) + msgs = ((InternalEObject)triggerCount).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.CONTROL_PARAMETERS__TRIGGER_COUNT, null, msgs); + if (newTriggerCount != null) + msgs = ((InternalEObject)newTriggerCount).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.CONTROL_PARAMETERS__TRIGGER_COUNT, null, msgs); + msgs = basicSetTriggerCount(newTriggerCount, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.CONTROL_PARAMETERS__TRIGGER_COUNT, newTriggerCount, newTriggerCount)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.CONTROL_PARAMETERS__PROBABILITY: + return basicSetProbability(null, msgs); + case BpsimPackage.CONTROL_PARAMETERS__CONDITION: + return basicSetCondition(null, msgs); + case BpsimPackage.CONTROL_PARAMETERS__INTER_TRIGGER_TIMER: + return basicSetInterTriggerTimer(null, msgs); + case BpsimPackage.CONTROL_PARAMETERS__TRIGGER_COUNT: + return basicSetTriggerCount(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.CONTROL_PARAMETERS__PROBABILITY: + return getProbability(); + case BpsimPackage.CONTROL_PARAMETERS__CONDITION: + return getCondition(); + case BpsimPackage.CONTROL_PARAMETERS__INTER_TRIGGER_TIMER: + return getInterTriggerTimer(); + case BpsimPackage.CONTROL_PARAMETERS__TRIGGER_COUNT: + return getTriggerCount(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.CONTROL_PARAMETERS__PROBABILITY: + setProbability((Parameter)newValue); + return; + case BpsimPackage.CONTROL_PARAMETERS__CONDITION: + setCondition((Parameter)newValue); + return; + case BpsimPackage.CONTROL_PARAMETERS__INTER_TRIGGER_TIMER: + setInterTriggerTimer((Parameter)newValue); + return; + case BpsimPackage.CONTROL_PARAMETERS__TRIGGER_COUNT: + setTriggerCount((Parameter)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.CONTROL_PARAMETERS__PROBABILITY: + setProbability((Parameter)null); + return; + case BpsimPackage.CONTROL_PARAMETERS__CONDITION: + setCondition((Parameter)null); + return; + case BpsimPackage.CONTROL_PARAMETERS__INTER_TRIGGER_TIMER: + setInterTriggerTimer((Parameter)null); + return; + case BpsimPackage.CONTROL_PARAMETERS__TRIGGER_COUNT: + setTriggerCount((Parameter)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.CONTROL_PARAMETERS__PROBABILITY: + return probability != null; + case BpsimPackage.CONTROL_PARAMETERS__CONDITION: + return condition != null; + case BpsimPackage.CONTROL_PARAMETERS__INTER_TRIGGER_TIMER: + return interTriggerTimer != null; + case BpsimPackage.CONTROL_PARAMETERS__TRIGGER_COUNT: + return triggerCount != null; + } + return super.eIsSet(featureID); + } + +} //ControlParametersImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/CostParametersImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/CostParametersImpl.java new file mode 100644 index 00000000000..0d2b963226b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/CostParametersImpl.java @@ -0,0 +1,250 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.CostParameters; +import bpsim.Parameter; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Cost Parameters'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.CostParametersImpl#getFixedCost Fixed Cost}
  • + *
  • {@link bpsim.impl.CostParametersImpl#getUnitCost Unit Cost}
  • + *
+ * + * @generated + */ +public class CostParametersImpl extends EObjectImpl implements CostParameters { + /** + * The cached value of the '{@link #getFixedCost() Fixed Cost}' containment reference. + * + * + * @see #getFixedCost() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter fixedCost; + + /** + * The cached value of the '{@link #getUnitCost() Unit Cost}' containment reference. + * + * + * @see #getUnitCost() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter unitCost; + + /** + * + * + * @generated + */ + protected CostParametersImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.COST_PARAMETERS; + } + + /** + * + * + * @generated + */ + @Override + public Parameter getFixedCost() { + return fixedCost; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFixedCost(Parameter newFixedCost, NotificationChain msgs) { + Parameter oldFixedCost = fixedCost; + fixedCost = newFixedCost; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.COST_PARAMETERS__FIXED_COST, oldFixedCost, newFixedCost); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setFixedCost(Parameter newFixedCost) { + if (newFixedCost != fixedCost) { + NotificationChain msgs = null; + if (fixedCost != null) + msgs = ((InternalEObject)fixedCost).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.COST_PARAMETERS__FIXED_COST, null, msgs); + if (newFixedCost != null) + msgs = ((InternalEObject)newFixedCost).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.COST_PARAMETERS__FIXED_COST, null, msgs); + msgs = basicSetFixedCost(newFixedCost, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.COST_PARAMETERS__FIXED_COST, newFixedCost, newFixedCost)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getUnitCost() { + return unitCost; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetUnitCost(Parameter newUnitCost, NotificationChain msgs) { + Parameter oldUnitCost = unitCost; + unitCost = newUnitCost; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.COST_PARAMETERS__UNIT_COST, oldUnitCost, newUnitCost); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setUnitCost(Parameter newUnitCost) { + if (newUnitCost != unitCost) { + NotificationChain msgs = null; + if (unitCost != null) + msgs = ((InternalEObject)unitCost).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.COST_PARAMETERS__UNIT_COST, null, msgs); + if (newUnitCost != null) + msgs = ((InternalEObject)newUnitCost).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.COST_PARAMETERS__UNIT_COST, null, msgs); + msgs = basicSetUnitCost(newUnitCost, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.COST_PARAMETERS__UNIT_COST, newUnitCost, newUnitCost)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.COST_PARAMETERS__FIXED_COST: + return basicSetFixedCost(null, msgs); + case BpsimPackage.COST_PARAMETERS__UNIT_COST: + return basicSetUnitCost(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.COST_PARAMETERS__FIXED_COST: + return getFixedCost(); + case BpsimPackage.COST_PARAMETERS__UNIT_COST: + return getUnitCost(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.COST_PARAMETERS__FIXED_COST: + setFixedCost((Parameter)newValue); + return; + case BpsimPackage.COST_PARAMETERS__UNIT_COST: + setUnitCost((Parameter)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.COST_PARAMETERS__FIXED_COST: + setFixedCost((Parameter)null); + return; + case BpsimPackage.COST_PARAMETERS__UNIT_COST: + setUnitCost((Parameter)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.COST_PARAMETERS__FIXED_COST: + return fixedCost != null; + case BpsimPackage.COST_PARAMETERS__UNIT_COST: + return unitCost != null; + } + return super.eIsSet(featureID); + } + +} //CostParametersImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/DateTimeParameterTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/DateTimeParameterTypeImpl.java new file mode 100644 index 00000000000..488eed52452 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/DateTimeParameterTypeImpl.java @@ -0,0 +1,169 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.DateTimeParameterType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import javax.xml.datatype.XMLGregorianCalendar; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Date Time Parameter Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.DateTimeParameterTypeImpl#getValue Value}
  • + *
+ * + * @generated + */ +public class DateTimeParameterTypeImpl extends ConstantParameterImpl implements DateTimeParameterType { + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final XMLGregorianCalendar VALUE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + @GwtTransient + protected XMLGregorianCalendar value = VALUE_EDEFAULT; + + /** + * + * + * @generated + */ + protected DateTimeParameterTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.DATE_TIME_PARAMETER_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public XMLGregorianCalendar getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public void setValue(XMLGregorianCalendar newValue) { + XMLGregorianCalendar oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.DATE_TIME_PARAMETER_TYPE__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.DATE_TIME_PARAMETER_TYPE__VALUE: + return getValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.DATE_TIME_PARAMETER_TYPE__VALUE: + setValue((XMLGregorianCalendar)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.DATE_TIME_PARAMETER_TYPE__VALUE: + setValue(VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.DATE_TIME_PARAMETER_TYPE__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (value: "); + result.append(value); + result.append(')'); + return result.toString(); + } + +} //DateTimeParameterTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/DistributionParameterImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/DistributionParameterImpl.java new file mode 100644 index 00000000000..ba11950b4f1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/DistributionParameterImpl.java @@ -0,0 +1,262 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.DistributionParameter; +import bpsim.TimeUnit; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Distribution Parameter'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.DistributionParameterImpl#getCurrencyUnit Currency Unit}
  • + *
  • {@link bpsim.impl.DistributionParameterImpl#getTimeUnit Time Unit}
  • + *
+ * + * @generated + */ +public class DistributionParameterImpl extends ParameterValueImpl implements DistributionParameter { + /** + * The default value of the '{@link #getCurrencyUnit() Currency Unit}' attribute. + * + * + * @see #getCurrencyUnit() + * @generated + * @ordered + */ + protected static final String CURRENCY_UNIT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getCurrencyUnit() Currency Unit}' attribute. + * + * + * @see #getCurrencyUnit() + * @generated + * @ordered + */ + @GwtTransient + protected String currencyUnit = CURRENCY_UNIT_EDEFAULT; + + /** + * The default value of the '{@link #getTimeUnit() Time Unit}' attribute. + * + * + * @see #getTimeUnit() + * @generated + * @ordered + */ + protected static final TimeUnit TIME_UNIT_EDEFAULT = TimeUnit.MS; + + /** + * The cached value of the '{@link #getTimeUnit() Time Unit}' attribute. + * + * + * @see #getTimeUnit() + * @generated + * @ordered + */ + @GwtTransient + protected TimeUnit timeUnit = TIME_UNIT_EDEFAULT; + + /** + * This is true if the Time Unit attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean timeUnitESet; + + /** + * + * + * @generated + */ + protected DistributionParameterImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.DISTRIBUTION_PARAMETER; + } + + /** + * + * + * @generated + */ + @Override + public String getCurrencyUnit() { + return currencyUnit; + } + + /** + * + * + * @generated + */ + @Override + public void setCurrencyUnit(String newCurrencyUnit) { + String oldCurrencyUnit = currencyUnit; + currencyUnit = newCurrencyUnit; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.DISTRIBUTION_PARAMETER__CURRENCY_UNIT, oldCurrencyUnit, currencyUnit)); + } + + /** + * + * + * @generated + */ + @Override + public TimeUnit getTimeUnit() { + return timeUnit; + } + + /** + * + * + * @generated + */ + @Override + public void setTimeUnit(TimeUnit newTimeUnit) { + TimeUnit oldTimeUnit = timeUnit; + timeUnit = newTimeUnit == null ? TIME_UNIT_EDEFAULT : newTimeUnit; + boolean oldTimeUnitESet = timeUnitESet; + timeUnitESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.DISTRIBUTION_PARAMETER__TIME_UNIT, oldTimeUnit, timeUnit, !oldTimeUnitESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetTimeUnit() { + TimeUnit oldTimeUnit = timeUnit; + boolean oldTimeUnitESet = timeUnitESet; + timeUnit = TIME_UNIT_EDEFAULT; + timeUnitESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.DISTRIBUTION_PARAMETER__TIME_UNIT, oldTimeUnit, TIME_UNIT_EDEFAULT, oldTimeUnitESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetTimeUnit() { + return timeUnitESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.DISTRIBUTION_PARAMETER__CURRENCY_UNIT: + return getCurrencyUnit(); + case BpsimPackage.DISTRIBUTION_PARAMETER__TIME_UNIT: + return getTimeUnit(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.DISTRIBUTION_PARAMETER__CURRENCY_UNIT: + setCurrencyUnit((String)newValue); + return; + case BpsimPackage.DISTRIBUTION_PARAMETER__TIME_UNIT: + setTimeUnit((TimeUnit)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.DISTRIBUTION_PARAMETER__CURRENCY_UNIT: + setCurrencyUnit(CURRENCY_UNIT_EDEFAULT); + return; + case BpsimPackage.DISTRIBUTION_PARAMETER__TIME_UNIT: + unsetTimeUnit(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.DISTRIBUTION_PARAMETER__CURRENCY_UNIT: + return CURRENCY_UNIT_EDEFAULT == null ? currencyUnit != null : !CURRENCY_UNIT_EDEFAULT.equals(currencyUnit); + case BpsimPackage.DISTRIBUTION_PARAMETER__TIME_UNIT: + return isSetTimeUnit(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (currencyUnit: "); + result.append(currencyUnit); + result.append(", timeUnit: "); + if (timeUnitESet) result.append(timeUnit); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //DistributionParameterImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/DocumentRootImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/DocumentRootImpl.java new file mode 100644 index 00000000000..03338b1e34e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/DocumentRootImpl.java @@ -0,0 +1,1281 @@ +/** + */ +package bpsim.impl; + +import bpsim.BPSimDataType; +import bpsim.BetaDistributionType; +import bpsim.BinomialDistributionType; +import bpsim.BooleanParameterType; +import bpsim.BpsimPackage; +import bpsim.DateTimeParameterType; +import bpsim.DocumentRoot; +import bpsim.DurationParameterType; +import bpsim.EnumParameterType; +import bpsim.ErlangDistributionType; +import bpsim.ExpressionParameterType; +import bpsim.FloatingParameterType; +import bpsim.GammaDistributionType; +import bpsim.LogNormalDistributionType; +import bpsim.NegativeExponentialDistributionType; +import bpsim.NormalDistributionType; +import bpsim.NumericParameterType; +import bpsim.ParameterValue; +import bpsim.PoissonDistributionType; +import bpsim.StringParameterType; +import bpsim.TriangularDistributionType; +import bpsim.TruncatedNormalDistributionType; +import bpsim.UniformDistributionType; +import bpsim.UserDistributionDataPointType; +import bpsim.UserDistributionType; +import bpsim.WeibullDistributionType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EMap; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.EcoreEMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Document Root'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.DocumentRootImpl#getMixed Mixed}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getXMLNSPrefixMap XMLNS Prefix Map}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getXSISchemaLocation XSI Schema Location}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getBetaDistribution Beta Distribution}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getParameterValue Parameter Value}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getBinomialDistribution Binomial Distribution}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getBooleanParameter Boolean Parameter}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getBPSimData BP Sim Data}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getDateTimeParameter Date Time Parameter}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getDurationParameter Duration Parameter}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getEnumParameter Enum Parameter}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getErlangDistribution Erlang Distribution}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getExpressionParameter Expression Parameter}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getFloatingParameter Floating Parameter}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getGammaDistribution Gamma Distribution}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getLogNormalDistribution Log Normal Distribution}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getNegativeExponentialDistribution Negative Exponential Distribution}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getNormalDistribution Normal Distribution}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getNumericParameter Numeric Parameter}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getPoissonDistribution Poisson Distribution}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getStringParameter String Parameter}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getTriangularDistribution Triangular Distribution}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getTruncatedNormalDistribution Truncated Normal Distribution}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getUniformDistribution Uniform Distribution}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getUserDistribution User Distribution}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getUserDistributionDataPoint User Distribution Data Point}
  • + *
  • {@link bpsim.impl.DocumentRootImpl#getWeibullDistribution Weibull Distribution}
  • + *
+ * + * @generated + */ +public class DocumentRootImpl extends EObjectImpl implements DocumentRoot { + /** + * The cached value of the '{@link #getMixed() Mixed}' attribute list. + * + * + * @see #getMixed() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap mixed; + + /** + * The cached value of the '{@link #getXMLNSPrefixMap() XMLNS Prefix Map}' map. + * + * + * @see #getXMLNSPrefixMap() + * @generated + * @ordered + */ + @GwtTransient + protected EMap xMLNSPrefixMap; + + /** + * The cached value of the '{@link #getXSISchemaLocation() XSI Schema Location}' map. + * + * + * @see #getXSISchemaLocation() + * @generated + * @ordered + */ + @GwtTransient + protected EMap xSISchemaLocation; + + /** + * + * + * @generated + */ + protected DocumentRootImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.DOCUMENT_ROOT; + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getMixed() { + if (mixed == null) { + mixed = new BasicFeatureMap(this, BpsimPackage.DOCUMENT_ROOT__MIXED); + } + return mixed; + } + + /** + * + * + * @generated + */ + @Override + public EMap getXMLNSPrefixMap() { + if (xMLNSPrefixMap == null) { + xMLNSPrefixMap = new EcoreEMap(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, BpsimPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP); + } + return xMLNSPrefixMap; + } + + /** + * + * + * @generated + */ + @Override + public EMap getXSISchemaLocation() { + if (xSISchemaLocation == null) { + xSISchemaLocation = new EcoreEMap(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, BpsimPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); + } + return xSISchemaLocation; + } + + /** + * + * + * @generated + */ + @Override + public BetaDistributionType getBetaDistribution() { + return (BetaDistributionType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__BETA_DISTRIBUTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBetaDistribution(BetaDistributionType newBetaDistribution, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__BETA_DISTRIBUTION, newBetaDistribution, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBetaDistribution(BetaDistributionType newBetaDistribution) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__BETA_DISTRIBUTION, newBetaDistribution); + } + + /** + * + * + * @generated + */ + @Override + public ParameterValue getParameterValue() { + return (ParameterValue)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__PARAMETER_VALUE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetParameterValue(ParameterValue newParameterValue, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__PARAMETER_VALUE, newParameterValue, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setParameterValue(ParameterValue newParameterValue) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__PARAMETER_VALUE, newParameterValue); + } + + /** + * + * + * @generated + */ + @Override + public BinomialDistributionType getBinomialDistribution() { + return (BinomialDistributionType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__BINOMIAL_DISTRIBUTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBinomialDistribution(BinomialDistributionType newBinomialDistribution, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__BINOMIAL_DISTRIBUTION, newBinomialDistribution, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBinomialDistribution(BinomialDistributionType newBinomialDistribution) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__BINOMIAL_DISTRIBUTION, newBinomialDistribution); + } + + /** + * + * + * @generated + */ + @Override + public BooleanParameterType getBooleanParameter() { + return (BooleanParameterType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__BOOLEAN_PARAMETER, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBooleanParameter(BooleanParameterType newBooleanParameter, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__BOOLEAN_PARAMETER, newBooleanParameter, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBooleanParameter(BooleanParameterType newBooleanParameter) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__BOOLEAN_PARAMETER, newBooleanParameter); + } + + /** + * + * + * @generated + */ + @Override + public BPSimDataType getBPSimData() { + return (BPSimDataType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__BP_SIM_DATA, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBPSimData(BPSimDataType newBPSimData, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__BP_SIM_DATA, newBPSimData, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBPSimData(BPSimDataType newBPSimData) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__BP_SIM_DATA, newBPSimData); + } + + /** + * + * + * @generated + */ + @Override + public DateTimeParameterType getDateTimeParameter() { + return (DateTimeParameterType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__DATE_TIME_PARAMETER, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDateTimeParameter(DateTimeParameterType newDateTimeParameter, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__DATE_TIME_PARAMETER, newDateTimeParameter, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDateTimeParameter(DateTimeParameterType newDateTimeParameter) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__DATE_TIME_PARAMETER, newDateTimeParameter); + } + + /** + * + * + * @generated + */ + @Override + public DurationParameterType getDurationParameter() { + return (DurationParameterType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__DURATION_PARAMETER, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDurationParameter(DurationParameterType newDurationParameter, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__DURATION_PARAMETER, newDurationParameter, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDurationParameter(DurationParameterType newDurationParameter) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__DURATION_PARAMETER, newDurationParameter); + } + + /** + * + * + * @generated + */ + @Override + public EnumParameterType getEnumParameter() { + return (EnumParameterType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__ENUM_PARAMETER, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEnumParameter(EnumParameterType newEnumParameter, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__ENUM_PARAMETER, newEnumParameter, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setEnumParameter(EnumParameterType newEnumParameter) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__ENUM_PARAMETER, newEnumParameter); + } + + /** + * + * + * @generated + */ + @Override + public ErlangDistributionType getErlangDistribution() { + return (ErlangDistributionType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__ERLANG_DISTRIBUTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetErlangDistribution(ErlangDistributionType newErlangDistribution, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__ERLANG_DISTRIBUTION, newErlangDistribution, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setErlangDistribution(ErlangDistributionType newErlangDistribution) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__ERLANG_DISTRIBUTION, newErlangDistribution); + } + + /** + * + * + * @generated + */ + @Override + public ExpressionParameterType getExpressionParameter() { + return (ExpressionParameterType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__EXPRESSION_PARAMETER, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetExpressionParameter(ExpressionParameterType newExpressionParameter, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__EXPRESSION_PARAMETER, newExpressionParameter, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setExpressionParameter(ExpressionParameterType newExpressionParameter) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__EXPRESSION_PARAMETER, newExpressionParameter); + } + + /** + * + * + * @generated + */ + @Override + public FloatingParameterType getFloatingParameter() { + return (FloatingParameterType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__FLOATING_PARAMETER, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFloatingParameter(FloatingParameterType newFloatingParameter, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__FLOATING_PARAMETER, newFloatingParameter, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setFloatingParameter(FloatingParameterType newFloatingParameter) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__FLOATING_PARAMETER, newFloatingParameter); + } + + /** + * + * + * @generated + */ + @Override + public GammaDistributionType getGammaDistribution() { + return (GammaDistributionType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__GAMMA_DISTRIBUTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGammaDistribution(GammaDistributionType newGammaDistribution, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__GAMMA_DISTRIBUTION, newGammaDistribution, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setGammaDistribution(GammaDistributionType newGammaDistribution) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__GAMMA_DISTRIBUTION, newGammaDistribution); + } + + /** + * + * + * @generated + */ + @Override + public LogNormalDistributionType getLogNormalDistribution() { + return (LogNormalDistributionType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__LOG_NORMAL_DISTRIBUTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLogNormalDistribution(LogNormalDistributionType newLogNormalDistribution, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__LOG_NORMAL_DISTRIBUTION, newLogNormalDistribution, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setLogNormalDistribution(LogNormalDistributionType newLogNormalDistribution) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__LOG_NORMAL_DISTRIBUTION, newLogNormalDistribution); + } + + /** + * + * + * @generated + */ + @Override + public NegativeExponentialDistributionType getNegativeExponentialDistribution() { + return (NegativeExponentialDistributionType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__NEGATIVE_EXPONENTIAL_DISTRIBUTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetNegativeExponentialDistribution(NegativeExponentialDistributionType newNegativeExponentialDistribution, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__NEGATIVE_EXPONENTIAL_DISTRIBUTION, newNegativeExponentialDistribution, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setNegativeExponentialDistribution(NegativeExponentialDistributionType newNegativeExponentialDistribution) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__NEGATIVE_EXPONENTIAL_DISTRIBUTION, newNegativeExponentialDistribution); + } + + /** + * + * + * @generated + */ + @Override + public NormalDistributionType getNormalDistribution() { + return (NormalDistributionType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__NORMAL_DISTRIBUTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetNormalDistribution(NormalDistributionType newNormalDistribution, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__NORMAL_DISTRIBUTION, newNormalDistribution, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setNormalDistribution(NormalDistributionType newNormalDistribution) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__NORMAL_DISTRIBUTION, newNormalDistribution); + } + + /** + * + * + * @generated + */ + @Override + public NumericParameterType getNumericParameter() { + return (NumericParameterType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__NUMERIC_PARAMETER, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetNumericParameter(NumericParameterType newNumericParameter, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__NUMERIC_PARAMETER, newNumericParameter, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setNumericParameter(NumericParameterType newNumericParameter) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__NUMERIC_PARAMETER, newNumericParameter); + } + + /** + * + * + * @generated + */ + @Override + public PoissonDistributionType getPoissonDistribution() { + return (PoissonDistributionType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__POISSON_DISTRIBUTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetPoissonDistribution(PoissonDistributionType newPoissonDistribution, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__POISSON_DISTRIBUTION, newPoissonDistribution, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setPoissonDistribution(PoissonDistributionType newPoissonDistribution) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__POISSON_DISTRIBUTION, newPoissonDistribution); + } + + /** + * + * + * @generated + */ + @Override + public StringParameterType getStringParameter() { + return (StringParameterType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__STRING_PARAMETER, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetStringParameter(StringParameterType newStringParameter, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__STRING_PARAMETER, newStringParameter, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setStringParameter(StringParameterType newStringParameter) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__STRING_PARAMETER, newStringParameter); + } + + /** + * + * + * @generated + */ + @Override + public TriangularDistributionType getTriangularDistribution() { + return (TriangularDistributionType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__TRIANGULAR_DISTRIBUTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTriangularDistribution(TriangularDistributionType newTriangularDistribution, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__TRIANGULAR_DISTRIBUTION, newTriangularDistribution, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setTriangularDistribution(TriangularDistributionType newTriangularDistribution) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__TRIANGULAR_DISTRIBUTION, newTriangularDistribution); + } + + /** + * + * + * @generated + */ + @Override + public TruncatedNormalDistributionType getTruncatedNormalDistribution() { + return (TruncatedNormalDistributionType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__TRUNCATED_NORMAL_DISTRIBUTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTruncatedNormalDistribution(TruncatedNormalDistributionType newTruncatedNormalDistribution, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__TRUNCATED_NORMAL_DISTRIBUTION, newTruncatedNormalDistribution, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setTruncatedNormalDistribution(TruncatedNormalDistributionType newTruncatedNormalDistribution) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__TRUNCATED_NORMAL_DISTRIBUTION, newTruncatedNormalDistribution); + } + + /** + * + * + * @generated + */ + @Override + public UniformDistributionType getUniformDistribution() { + return (UniformDistributionType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__UNIFORM_DISTRIBUTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetUniformDistribution(UniformDistributionType newUniformDistribution, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__UNIFORM_DISTRIBUTION, newUniformDistribution, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setUniformDistribution(UniformDistributionType newUniformDistribution) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__UNIFORM_DISTRIBUTION, newUniformDistribution); + } + + /** + * + * + * @generated + */ + @Override + public UserDistributionType getUserDistribution() { + return (UserDistributionType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__USER_DISTRIBUTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetUserDistribution(UserDistributionType newUserDistribution, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__USER_DISTRIBUTION, newUserDistribution, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setUserDistribution(UserDistributionType newUserDistribution) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__USER_DISTRIBUTION, newUserDistribution); + } + + /** + * + * + * @generated + */ + @Override + public UserDistributionDataPointType getUserDistributionDataPoint() { + return (UserDistributionDataPointType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__USER_DISTRIBUTION_DATA_POINT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetUserDistributionDataPoint(UserDistributionDataPointType newUserDistributionDataPoint, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__USER_DISTRIBUTION_DATA_POINT, newUserDistributionDataPoint, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setUserDistributionDataPoint(UserDistributionDataPointType newUserDistributionDataPoint) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__USER_DISTRIBUTION_DATA_POINT, newUserDistributionDataPoint); + } + + /** + * + * + * @generated + */ + @Override + public WeibullDistributionType getWeibullDistribution() { + return (WeibullDistributionType)getMixed().get(BpsimPackage.Literals.DOCUMENT_ROOT__WEIBULL_DISTRIBUTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetWeibullDistribution(WeibullDistributionType newWeibullDistribution, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__WEIBULL_DISTRIBUTION, newWeibullDistribution, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setWeibullDistribution(WeibullDistributionType newWeibullDistribution) { + ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__WEIBULL_DISTRIBUTION, newWeibullDistribution); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.DOCUMENT_ROOT__MIXED: + return ((InternalEList)getMixed()).basicRemove(otherEnd, msgs); + case BpsimPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + return ((InternalEList)getXMLNSPrefixMap()).basicRemove(otherEnd, msgs); + case BpsimPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + return ((InternalEList)getXSISchemaLocation()).basicRemove(otherEnd, msgs); + case BpsimPackage.DOCUMENT_ROOT__BETA_DISTRIBUTION: + return basicSetBetaDistribution(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__PARAMETER_VALUE: + return basicSetParameterValue(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__BINOMIAL_DISTRIBUTION: + return basicSetBinomialDistribution(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__BOOLEAN_PARAMETER: + return basicSetBooleanParameter(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__BP_SIM_DATA: + return basicSetBPSimData(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__DATE_TIME_PARAMETER: + return basicSetDateTimeParameter(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__DURATION_PARAMETER: + return basicSetDurationParameter(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__ENUM_PARAMETER: + return basicSetEnumParameter(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__ERLANG_DISTRIBUTION: + return basicSetErlangDistribution(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__EXPRESSION_PARAMETER: + return basicSetExpressionParameter(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__FLOATING_PARAMETER: + return basicSetFloatingParameter(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__GAMMA_DISTRIBUTION: + return basicSetGammaDistribution(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__LOG_NORMAL_DISTRIBUTION: + return basicSetLogNormalDistribution(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__NEGATIVE_EXPONENTIAL_DISTRIBUTION: + return basicSetNegativeExponentialDistribution(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__NORMAL_DISTRIBUTION: + return basicSetNormalDistribution(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__NUMERIC_PARAMETER: + return basicSetNumericParameter(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__POISSON_DISTRIBUTION: + return basicSetPoissonDistribution(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__STRING_PARAMETER: + return basicSetStringParameter(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__TRIANGULAR_DISTRIBUTION: + return basicSetTriangularDistribution(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__TRUNCATED_NORMAL_DISTRIBUTION: + return basicSetTruncatedNormalDistribution(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__UNIFORM_DISTRIBUTION: + return basicSetUniformDistribution(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__USER_DISTRIBUTION: + return basicSetUserDistribution(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__USER_DISTRIBUTION_DATA_POINT: + return basicSetUserDistributionDataPoint(null, msgs); + case BpsimPackage.DOCUMENT_ROOT__WEIBULL_DISTRIBUTION: + return basicSetWeibullDistribution(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.DOCUMENT_ROOT__MIXED: + if (coreType) return getMixed(); + return ((FeatureMap.Internal)getMixed()).getWrapper(); + case BpsimPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + if (coreType) return getXMLNSPrefixMap(); + else return getXMLNSPrefixMap().map(); + case BpsimPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + if (coreType) return getXSISchemaLocation(); + else return getXSISchemaLocation().map(); + case BpsimPackage.DOCUMENT_ROOT__BETA_DISTRIBUTION: + return getBetaDistribution(); + case BpsimPackage.DOCUMENT_ROOT__PARAMETER_VALUE: + return getParameterValue(); + case BpsimPackage.DOCUMENT_ROOT__BINOMIAL_DISTRIBUTION: + return getBinomialDistribution(); + case BpsimPackage.DOCUMENT_ROOT__BOOLEAN_PARAMETER: + return getBooleanParameter(); + case BpsimPackage.DOCUMENT_ROOT__BP_SIM_DATA: + return getBPSimData(); + case BpsimPackage.DOCUMENT_ROOT__DATE_TIME_PARAMETER: + return getDateTimeParameter(); + case BpsimPackage.DOCUMENT_ROOT__DURATION_PARAMETER: + return getDurationParameter(); + case BpsimPackage.DOCUMENT_ROOT__ENUM_PARAMETER: + return getEnumParameter(); + case BpsimPackage.DOCUMENT_ROOT__ERLANG_DISTRIBUTION: + return getErlangDistribution(); + case BpsimPackage.DOCUMENT_ROOT__EXPRESSION_PARAMETER: + return getExpressionParameter(); + case BpsimPackage.DOCUMENT_ROOT__FLOATING_PARAMETER: + return getFloatingParameter(); + case BpsimPackage.DOCUMENT_ROOT__GAMMA_DISTRIBUTION: + return getGammaDistribution(); + case BpsimPackage.DOCUMENT_ROOT__LOG_NORMAL_DISTRIBUTION: + return getLogNormalDistribution(); + case BpsimPackage.DOCUMENT_ROOT__NEGATIVE_EXPONENTIAL_DISTRIBUTION: + return getNegativeExponentialDistribution(); + case BpsimPackage.DOCUMENT_ROOT__NORMAL_DISTRIBUTION: + return getNormalDistribution(); + case BpsimPackage.DOCUMENT_ROOT__NUMERIC_PARAMETER: + return getNumericParameter(); + case BpsimPackage.DOCUMENT_ROOT__POISSON_DISTRIBUTION: + return getPoissonDistribution(); + case BpsimPackage.DOCUMENT_ROOT__STRING_PARAMETER: + return getStringParameter(); + case BpsimPackage.DOCUMENT_ROOT__TRIANGULAR_DISTRIBUTION: + return getTriangularDistribution(); + case BpsimPackage.DOCUMENT_ROOT__TRUNCATED_NORMAL_DISTRIBUTION: + return getTruncatedNormalDistribution(); + case BpsimPackage.DOCUMENT_ROOT__UNIFORM_DISTRIBUTION: + return getUniformDistribution(); + case BpsimPackage.DOCUMENT_ROOT__USER_DISTRIBUTION: + return getUserDistribution(); + case BpsimPackage.DOCUMENT_ROOT__USER_DISTRIBUTION_DATA_POINT: + return getUserDistributionDataPoint(); + case BpsimPackage.DOCUMENT_ROOT__WEIBULL_DISTRIBUTION: + return getWeibullDistribution(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.DOCUMENT_ROOT__MIXED: + ((FeatureMap.Internal)getMixed()).set(newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + ((EStructuralFeature.Setting)getXMLNSPrefixMap()).set(newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + ((EStructuralFeature.Setting)getXSISchemaLocation()).set(newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__BETA_DISTRIBUTION: + setBetaDistribution((BetaDistributionType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__PARAMETER_VALUE: + setParameterValue((ParameterValue)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__BINOMIAL_DISTRIBUTION: + setBinomialDistribution((BinomialDistributionType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__BOOLEAN_PARAMETER: + setBooleanParameter((BooleanParameterType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__BP_SIM_DATA: + setBPSimData((BPSimDataType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__DATE_TIME_PARAMETER: + setDateTimeParameter((DateTimeParameterType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__DURATION_PARAMETER: + setDurationParameter((DurationParameterType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__ENUM_PARAMETER: + setEnumParameter((EnumParameterType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__ERLANG_DISTRIBUTION: + setErlangDistribution((ErlangDistributionType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__EXPRESSION_PARAMETER: + setExpressionParameter((ExpressionParameterType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__FLOATING_PARAMETER: + setFloatingParameter((FloatingParameterType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__GAMMA_DISTRIBUTION: + setGammaDistribution((GammaDistributionType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__LOG_NORMAL_DISTRIBUTION: + setLogNormalDistribution((LogNormalDistributionType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__NEGATIVE_EXPONENTIAL_DISTRIBUTION: + setNegativeExponentialDistribution((NegativeExponentialDistributionType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__NORMAL_DISTRIBUTION: + setNormalDistribution((NormalDistributionType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__NUMERIC_PARAMETER: + setNumericParameter((NumericParameterType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__POISSON_DISTRIBUTION: + setPoissonDistribution((PoissonDistributionType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__STRING_PARAMETER: + setStringParameter((StringParameterType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__TRIANGULAR_DISTRIBUTION: + setTriangularDistribution((TriangularDistributionType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__TRUNCATED_NORMAL_DISTRIBUTION: + setTruncatedNormalDistribution((TruncatedNormalDistributionType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__UNIFORM_DISTRIBUTION: + setUniformDistribution((UniformDistributionType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__USER_DISTRIBUTION: + setUserDistribution((UserDistributionType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__USER_DISTRIBUTION_DATA_POINT: + setUserDistributionDataPoint((UserDistributionDataPointType)newValue); + return; + case BpsimPackage.DOCUMENT_ROOT__WEIBULL_DISTRIBUTION: + setWeibullDistribution((WeibullDistributionType)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.DOCUMENT_ROOT__MIXED: + getMixed().clear(); + return; + case BpsimPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + getXMLNSPrefixMap().clear(); + return; + case BpsimPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + getXSISchemaLocation().clear(); + return; + case BpsimPackage.DOCUMENT_ROOT__BETA_DISTRIBUTION: + setBetaDistribution((BetaDistributionType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__PARAMETER_VALUE: + setParameterValue((ParameterValue)null); + return; + case BpsimPackage.DOCUMENT_ROOT__BINOMIAL_DISTRIBUTION: + setBinomialDistribution((BinomialDistributionType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__BOOLEAN_PARAMETER: + setBooleanParameter((BooleanParameterType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__BP_SIM_DATA: + setBPSimData((BPSimDataType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__DATE_TIME_PARAMETER: + setDateTimeParameter((DateTimeParameterType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__DURATION_PARAMETER: + setDurationParameter((DurationParameterType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__ENUM_PARAMETER: + setEnumParameter((EnumParameterType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__ERLANG_DISTRIBUTION: + setErlangDistribution((ErlangDistributionType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__EXPRESSION_PARAMETER: + setExpressionParameter((ExpressionParameterType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__FLOATING_PARAMETER: + setFloatingParameter((FloatingParameterType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__GAMMA_DISTRIBUTION: + setGammaDistribution((GammaDistributionType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__LOG_NORMAL_DISTRIBUTION: + setLogNormalDistribution((LogNormalDistributionType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__NEGATIVE_EXPONENTIAL_DISTRIBUTION: + setNegativeExponentialDistribution((NegativeExponentialDistributionType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__NORMAL_DISTRIBUTION: + setNormalDistribution((NormalDistributionType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__NUMERIC_PARAMETER: + setNumericParameter((NumericParameterType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__POISSON_DISTRIBUTION: + setPoissonDistribution((PoissonDistributionType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__STRING_PARAMETER: + setStringParameter((StringParameterType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__TRIANGULAR_DISTRIBUTION: + setTriangularDistribution((TriangularDistributionType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__TRUNCATED_NORMAL_DISTRIBUTION: + setTruncatedNormalDistribution((TruncatedNormalDistributionType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__UNIFORM_DISTRIBUTION: + setUniformDistribution((UniformDistributionType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__USER_DISTRIBUTION: + setUserDistribution((UserDistributionType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__USER_DISTRIBUTION_DATA_POINT: + setUserDistributionDataPoint((UserDistributionDataPointType)null); + return; + case BpsimPackage.DOCUMENT_ROOT__WEIBULL_DISTRIBUTION: + setWeibullDistribution((WeibullDistributionType)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.DOCUMENT_ROOT__MIXED: + return mixed != null && !mixed.isEmpty(); + case BpsimPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty(); + case BpsimPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + return xSISchemaLocation != null && !xSISchemaLocation.isEmpty(); + case BpsimPackage.DOCUMENT_ROOT__BETA_DISTRIBUTION: + return getBetaDistribution() != null; + case BpsimPackage.DOCUMENT_ROOT__PARAMETER_VALUE: + return getParameterValue() != null; + case BpsimPackage.DOCUMENT_ROOT__BINOMIAL_DISTRIBUTION: + return getBinomialDistribution() != null; + case BpsimPackage.DOCUMENT_ROOT__BOOLEAN_PARAMETER: + return getBooleanParameter() != null; + case BpsimPackage.DOCUMENT_ROOT__BP_SIM_DATA: + return getBPSimData() != null; + case BpsimPackage.DOCUMENT_ROOT__DATE_TIME_PARAMETER: + return getDateTimeParameter() != null; + case BpsimPackage.DOCUMENT_ROOT__DURATION_PARAMETER: + return getDurationParameter() != null; + case BpsimPackage.DOCUMENT_ROOT__ENUM_PARAMETER: + return getEnumParameter() != null; + case BpsimPackage.DOCUMENT_ROOT__ERLANG_DISTRIBUTION: + return getErlangDistribution() != null; + case BpsimPackage.DOCUMENT_ROOT__EXPRESSION_PARAMETER: + return getExpressionParameter() != null; + case BpsimPackage.DOCUMENT_ROOT__FLOATING_PARAMETER: + return getFloatingParameter() != null; + case BpsimPackage.DOCUMENT_ROOT__GAMMA_DISTRIBUTION: + return getGammaDistribution() != null; + case BpsimPackage.DOCUMENT_ROOT__LOG_NORMAL_DISTRIBUTION: + return getLogNormalDistribution() != null; + case BpsimPackage.DOCUMENT_ROOT__NEGATIVE_EXPONENTIAL_DISTRIBUTION: + return getNegativeExponentialDistribution() != null; + case BpsimPackage.DOCUMENT_ROOT__NORMAL_DISTRIBUTION: + return getNormalDistribution() != null; + case BpsimPackage.DOCUMENT_ROOT__NUMERIC_PARAMETER: + return getNumericParameter() != null; + case BpsimPackage.DOCUMENT_ROOT__POISSON_DISTRIBUTION: + return getPoissonDistribution() != null; + case BpsimPackage.DOCUMENT_ROOT__STRING_PARAMETER: + return getStringParameter() != null; + case BpsimPackage.DOCUMENT_ROOT__TRIANGULAR_DISTRIBUTION: + return getTriangularDistribution() != null; + case BpsimPackage.DOCUMENT_ROOT__TRUNCATED_NORMAL_DISTRIBUTION: + return getTruncatedNormalDistribution() != null; + case BpsimPackage.DOCUMENT_ROOT__UNIFORM_DISTRIBUTION: + return getUniformDistribution() != null; + case BpsimPackage.DOCUMENT_ROOT__USER_DISTRIBUTION: + return getUserDistribution() != null; + case BpsimPackage.DOCUMENT_ROOT__USER_DISTRIBUTION_DATA_POINT: + return getUserDistributionDataPoint() != null; + case BpsimPackage.DOCUMENT_ROOT__WEIBULL_DISTRIBUTION: + return getWeibullDistribution() != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (mixed: "); + result.append(mixed); + result.append(')'); + return result.toString(); + } + +} //DocumentRootImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/DurationParameterTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/DurationParameterTypeImpl.java new file mode 100644 index 00000000000..52b906cf876 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/DurationParameterTypeImpl.java @@ -0,0 +1,169 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.DurationParameterType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import javax.xml.datatype.Duration; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Duration Parameter Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.DurationParameterTypeImpl#getValue Value}
  • + *
+ * + * @generated + */ +public class DurationParameterTypeImpl extends ConstantParameterImpl implements DurationParameterType { + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final Duration VALUE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + @GwtTransient + protected Duration value = VALUE_EDEFAULT; + + /** + * + * + * @generated + */ + protected DurationParameterTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.DURATION_PARAMETER_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public Duration getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public void setValue(Duration newValue) { + Duration oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.DURATION_PARAMETER_TYPE__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.DURATION_PARAMETER_TYPE__VALUE: + return getValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.DURATION_PARAMETER_TYPE__VALUE: + setValue((Duration)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.DURATION_PARAMETER_TYPE__VALUE: + setValue(VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.DURATION_PARAMETER_TYPE__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (value: "); + result.append(value); + result.append(')'); + return result.toString(); + } + +} //DurationParameterTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ElementParametersImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ElementParametersImpl.java new file mode 100644 index 00000000000..b127ef1b7e3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ElementParametersImpl.java @@ -0,0 +1,706 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.ControlParameters; +import bpsim.CostParameters; +import bpsim.ElementParameters; +import bpsim.PriorityParameters; +import bpsim.PropertyParameters; +import bpsim.ResourceParameters; +import bpsim.TimeParameters; +import bpsim.VendorExtension; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Element Parameters'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.ElementParametersImpl#getTimeParameters Time Parameters}
  • + *
  • {@link bpsim.impl.ElementParametersImpl#getControlParameters Control Parameters}
  • + *
  • {@link bpsim.impl.ElementParametersImpl#getResourceParameters Resource Parameters}
  • + *
  • {@link bpsim.impl.ElementParametersImpl#getPriorityParameters Priority Parameters}
  • + *
  • {@link bpsim.impl.ElementParametersImpl#getCostParameters Cost Parameters}
  • + *
  • {@link bpsim.impl.ElementParametersImpl#getPropertyParameters Property Parameters}
  • + *
  • {@link bpsim.impl.ElementParametersImpl#getVendorExtension Vendor Extension}
  • + *
  • {@link bpsim.impl.ElementParametersImpl#getElementRef Element Ref}
  • + *
  • {@link bpsim.impl.ElementParametersImpl#getId Id}
  • + *
+ * + * @generated + */ +public class ElementParametersImpl extends EObjectImpl implements ElementParameters { + /** + * The cached value of the '{@link #getTimeParameters() Time Parameters}' containment reference. + * + * + * @see #getTimeParameters() + * @generated + * @ordered + */ + @GwtTransient + protected TimeParameters timeParameters; + + /** + * The cached value of the '{@link #getControlParameters() Control Parameters}' containment reference. + * + * + * @see #getControlParameters() + * @generated + * @ordered + */ + @GwtTransient + protected ControlParameters controlParameters; + + /** + * The cached value of the '{@link #getResourceParameters() Resource Parameters}' containment reference. + * + * + * @see #getResourceParameters() + * @generated + * @ordered + */ + @GwtTransient + protected ResourceParameters resourceParameters; + + /** + * The cached value of the '{@link #getPriorityParameters() Priority Parameters}' containment reference. + * + * + * @see #getPriorityParameters() + * @generated + * @ordered + */ + @GwtTransient + protected PriorityParameters priorityParameters; + + /** + * The cached value of the '{@link #getCostParameters() Cost Parameters}' containment reference. + * + * + * @see #getCostParameters() + * @generated + * @ordered + */ + @GwtTransient + protected CostParameters costParameters; + + /** + * The cached value of the '{@link #getPropertyParameters() Property Parameters}' containment reference. + * + * + * @see #getPropertyParameters() + * @generated + * @ordered + */ + @GwtTransient + protected PropertyParameters propertyParameters; + + /** + * The cached value of the '{@link #getVendorExtension() Vendor Extension}' containment reference list. + * + * + * @see #getVendorExtension() + * @generated + * @ordered + */ + @GwtTransient + protected EList vendorExtension; + + /** + * The default value of the '{@link #getElementRef() Element Ref}' attribute. + * + * + * @see #getElementRef() + * @generated + * @ordered + */ + protected static final String ELEMENT_REF_EDEFAULT = null; + + /** + * The cached value of the '{@link #getElementRef() Element Ref}' attribute. + * + * + * @see #getElementRef() + * @generated + * @ordered + */ + @GwtTransient + protected String elementRef = ELEMENT_REF_EDEFAULT; + + /** + * The default value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + protected static final String ID_EDEFAULT = null; + + /** + * The cached value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + @GwtTransient + protected String id = ID_EDEFAULT; + + /** + * + * + * @generated + */ + protected ElementParametersImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.ELEMENT_PARAMETERS; + } + + /** + * + * + * @generated + */ + @Override + public TimeParameters getTimeParameters() { + return timeParameters; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTimeParameters(TimeParameters newTimeParameters, NotificationChain msgs) { + TimeParameters oldTimeParameters = timeParameters; + timeParameters = newTimeParameters; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__TIME_PARAMETERS, oldTimeParameters, newTimeParameters); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setTimeParameters(TimeParameters newTimeParameters) { + if (newTimeParameters != timeParameters) { + NotificationChain msgs = null; + if (timeParameters != null) + msgs = ((InternalEObject)timeParameters).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.ELEMENT_PARAMETERS__TIME_PARAMETERS, null, msgs); + if (newTimeParameters != null) + msgs = ((InternalEObject)newTimeParameters).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.ELEMENT_PARAMETERS__TIME_PARAMETERS, null, msgs); + msgs = basicSetTimeParameters(newTimeParameters, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__TIME_PARAMETERS, newTimeParameters, newTimeParameters)); + } + + /** + * + * + * @generated + */ + @Override + public ControlParameters getControlParameters() { + return controlParameters; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetControlParameters(ControlParameters newControlParameters, NotificationChain msgs) { + ControlParameters oldControlParameters = controlParameters; + controlParameters = newControlParameters; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__CONTROL_PARAMETERS, oldControlParameters, newControlParameters); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setControlParameters(ControlParameters newControlParameters) { + if (newControlParameters != controlParameters) { + NotificationChain msgs = null; + if (controlParameters != null) + msgs = ((InternalEObject)controlParameters).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.ELEMENT_PARAMETERS__CONTROL_PARAMETERS, null, msgs); + if (newControlParameters != null) + msgs = ((InternalEObject)newControlParameters).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.ELEMENT_PARAMETERS__CONTROL_PARAMETERS, null, msgs); + msgs = basicSetControlParameters(newControlParameters, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__CONTROL_PARAMETERS, newControlParameters, newControlParameters)); + } + + /** + * + * + * @generated + */ + @Override + public ResourceParameters getResourceParameters() { + return resourceParameters; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetResourceParameters(ResourceParameters newResourceParameters, NotificationChain msgs) { + ResourceParameters oldResourceParameters = resourceParameters; + resourceParameters = newResourceParameters; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__RESOURCE_PARAMETERS, oldResourceParameters, newResourceParameters); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setResourceParameters(ResourceParameters newResourceParameters) { + if (newResourceParameters != resourceParameters) { + NotificationChain msgs = null; + if (resourceParameters != null) + msgs = ((InternalEObject)resourceParameters).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.ELEMENT_PARAMETERS__RESOURCE_PARAMETERS, null, msgs); + if (newResourceParameters != null) + msgs = ((InternalEObject)newResourceParameters).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.ELEMENT_PARAMETERS__RESOURCE_PARAMETERS, null, msgs); + msgs = basicSetResourceParameters(newResourceParameters, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__RESOURCE_PARAMETERS, newResourceParameters, newResourceParameters)); + } + + /** + * + * + * @generated + */ + @Override + public PriorityParameters getPriorityParameters() { + return priorityParameters; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetPriorityParameters(PriorityParameters newPriorityParameters, NotificationChain msgs) { + PriorityParameters oldPriorityParameters = priorityParameters; + priorityParameters = newPriorityParameters; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__PRIORITY_PARAMETERS, oldPriorityParameters, newPriorityParameters); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setPriorityParameters(PriorityParameters newPriorityParameters) { + if (newPriorityParameters != priorityParameters) { + NotificationChain msgs = null; + if (priorityParameters != null) + msgs = ((InternalEObject)priorityParameters).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.ELEMENT_PARAMETERS__PRIORITY_PARAMETERS, null, msgs); + if (newPriorityParameters != null) + msgs = ((InternalEObject)newPriorityParameters).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.ELEMENT_PARAMETERS__PRIORITY_PARAMETERS, null, msgs); + msgs = basicSetPriorityParameters(newPriorityParameters, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__PRIORITY_PARAMETERS, newPriorityParameters, newPriorityParameters)); + } + + /** + * + * + * @generated + */ + @Override + public CostParameters getCostParameters() { + return costParameters; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCostParameters(CostParameters newCostParameters, NotificationChain msgs) { + CostParameters oldCostParameters = costParameters; + costParameters = newCostParameters; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__COST_PARAMETERS, oldCostParameters, newCostParameters); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setCostParameters(CostParameters newCostParameters) { + if (newCostParameters != costParameters) { + NotificationChain msgs = null; + if (costParameters != null) + msgs = ((InternalEObject)costParameters).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.ELEMENT_PARAMETERS__COST_PARAMETERS, null, msgs); + if (newCostParameters != null) + msgs = ((InternalEObject)newCostParameters).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.ELEMENT_PARAMETERS__COST_PARAMETERS, null, msgs); + msgs = basicSetCostParameters(newCostParameters, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__COST_PARAMETERS, newCostParameters, newCostParameters)); + } + + /** + * + * + * @generated + */ + @Override + public PropertyParameters getPropertyParameters() { + return propertyParameters; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetPropertyParameters(PropertyParameters newPropertyParameters, NotificationChain msgs) { + PropertyParameters oldPropertyParameters = propertyParameters; + propertyParameters = newPropertyParameters; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__PROPERTY_PARAMETERS, oldPropertyParameters, newPropertyParameters); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setPropertyParameters(PropertyParameters newPropertyParameters) { + if (newPropertyParameters != propertyParameters) { + NotificationChain msgs = null; + if (propertyParameters != null) + msgs = ((InternalEObject)propertyParameters).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.ELEMENT_PARAMETERS__PROPERTY_PARAMETERS, null, msgs); + if (newPropertyParameters != null) + msgs = ((InternalEObject)newPropertyParameters).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.ELEMENT_PARAMETERS__PROPERTY_PARAMETERS, null, msgs); + msgs = basicSetPropertyParameters(newPropertyParameters, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__PROPERTY_PARAMETERS, newPropertyParameters, newPropertyParameters)); + } + + /** + * + * + * @generated + */ + @Override + public EList getVendorExtension() { + if (vendorExtension == null) { + vendorExtension = new EObjectContainmentEList(VendorExtension.class, this, BpsimPackage.ELEMENT_PARAMETERS__VENDOR_EXTENSION); + } + return vendorExtension; + } + + /** + * + * + * @generated + */ + @Override + public String getElementRef() { + return elementRef; + } + + /** + * + * + * @generated + */ + @Override + public void setElementRef(String newElementRef) { + String oldElementRef = elementRef; + elementRef = newElementRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__ELEMENT_REF, oldElementRef, elementRef)); + } + + /** + * + * + * @generated + */ + @Override + public String getId() { + return id; + } + + /** + * + * + * @generated + */ + @Override + public void setId(String newId) { + String oldId = id; + id = newId; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__ID, oldId, id)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.ELEMENT_PARAMETERS__TIME_PARAMETERS: + return basicSetTimeParameters(null, msgs); + case BpsimPackage.ELEMENT_PARAMETERS__CONTROL_PARAMETERS: + return basicSetControlParameters(null, msgs); + case BpsimPackage.ELEMENT_PARAMETERS__RESOURCE_PARAMETERS: + return basicSetResourceParameters(null, msgs); + case BpsimPackage.ELEMENT_PARAMETERS__PRIORITY_PARAMETERS: + return basicSetPriorityParameters(null, msgs); + case BpsimPackage.ELEMENT_PARAMETERS__COST_PARAMETERS: + return basicSetCostParameters(null, msgs); + case BpsimPackage.ELEMENT_PARAMETERS__PROPERTY_PARAMETERS: + return basicSetPropertyParameters(null, msgs); + case BpsimPackage.ELEMENT_PARAMETERS__VENDOR_EXTENSION: + return ((InternalEList)getVendorExtension()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.ELEMENT_PARAMETERS__TIME_PARAMETERS: + return getTimeParameters(); + case BpsimPackage.ELEMENT_PARAMETERS__CONTROL_PARAMETERS: + return getControlParameters(); + case BpsimPackage.ELEMENT_PARAMETERS__RESOURCE_PARAMETERS: + return getResourceParameters(); + case BpsimPackage.ELEMENT_PARAMETERS__PRIORITY_PARAMETERS: + return getPriorityParameters(); + case BpsimPackage.ELEMENT_PARAMETERS__COST_PARAMETERS: + return getCostParameters(); + case BpsimPackage.ELEMENT_PARAMETERS__PROPERTY_PARAMETERS: + return getPropertyParameters(); + case BpsimPackage.ELEMENT_PARAMETERS__VENDOR_EXTENSION: + return getVendorExtension(); + case BpsimPackage.ELEMENT_PARAMETERS__ELEMENT_REF: + return getElementRef(); + case BpsimPackage.ELEMENT_PARAMETERS__ID: + return getId(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.ELEMENT_PARAMETERS__TIME_PARAMETERS: + setTimeParameters((TimeParameters)newValue); + return; + case BpsimPackage.ELEMENT_PARAMETERS__CONTROL_PARAMETERS: + setControlParameters((ControlParameters)newValue); + return; + case BpsimPackage.ELEMENT_PARAMETERS__RESOURCE_PARAMETERS: + setResourceParameters((ResourceParameters)newValue); + return; + case BpsimPackage.ELEMENT_PARAMETERS__PRIORITY_PARAMETERS: + setPriorityParameters((PriorityParameters)newValue); + return; + case BpsimPackage.ELEMENT_PARAMETERS__COST_PARAMETERS: + setCostParameters((CostParameters)newValue); + return; + case BpsimPackage.ELEMENT_PARAMETERS__PROPERTY_PARAMETERS: + setPropertyParameters((PropertyParameters)newValue); + return; + case BpsimPackage.ELEMENT_PARAMETERS__VENDOR_EXTENSION: + getVendorExtension().clear(); + getVendorExtension().addAll((Collection)newValue); + return; + case BpsimPackage.ELEMENT_PARAMETERS__ELEMENT_REF: + setElementRef((String)newValue); + return; + case BpsimPackage.ELEMENT_PARAMETERS__ID: + setId((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.ELEMENT_PARAMETERS__TIME_PARAMETERS: + setTimeParameters((TimeParameters)null); + return; + case BpsimPackage.ELEMENT_PARAMETERS__CONTROL_PARAMETERS: + setControlParameters((ControlParameters)null); + return; + case BpsimPackage.ELEMENT_PARAMETERS__RESOURCE_PARAMETERS: + setResourceParameters((ResourceParameters)null); + return; + case BpsimPackage.ELEMENT_PARAMETERS__PRIORITY_PARAMETERS: + setPriorityParameters((PriorityParameters)null); + return; + case BpsimPackage.ELEMENT_PARAMETERS__COST_PARAMETERS: + setCostParameters((CostParameters)null); + return; + case BpsimPackage.ELEMENT_PARAMETERS__PROPERTY_PARAMETERS: + setPropertyParameters((PropertyParameters)null); + return; + case BpsimPackage.ELEMENT_PARAMETERS__VENDOR_EXTENSION: + getVendorExtension().clear(); + return; + case BpsimPackage.ELEMENT_PARAMETERS__ELEMENT_REF: + setElementRef(ELEMENT_REF_EDEFAULT); + return; + case BpsimPackage.ELEMENT_PARAMETERS__ID: + setId(ID_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.ELEMENT_PARAMETERS__TIME_PARAMETERS: + return timeParameters != null; + case BpsimPackage.ELEMENT_PARAMETERS__CONTROL_PARAMETERS: + return controlParameters != null; + case BpsimPackage.ELEMENT_PARAMETERS__RESOURCE_PARAMETERS: + return resourceParameters != null; + case BpsimPackage.ELEMENT_PARAMETERS__PRIORITY_PARAMETERS: + return priorityParameters != null; + case BpsimPackage.ELEMENT_PARAMETERS__COST_PARAMETERS: + return costParameters != null; + case BpsimPackage.ELEMENT_PARAMETERS__PROPERTY_PARAMETERS: + return propertyParameters != null; + case BpsimPackage.ELEMENT_PARAMETERS__VENDOR_EXTENSION: + return vendorExtension != null && !vendorExtension.isEmpty(); + case BpsimPackage.ELEMENT_PARAMETERS__ELEMENT_REF: + return ELEMENT_REF_EDEFAULT == null ? elementRef != null : !ELEMENT_REF_EDEFAULT.equals(elementRef); + case BpsimPackage.ELEMENT_PARAMETERS__ID: + return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (elementRef: "); + result.append(elementRef); + result.append(", id: "); + result.append(id); + result.append(')'); + return result.toString(); + } + +} //ElementParametersImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ElementParametersTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ElementParametersTypeImpl.java new file mode 100644 index 00000000000..2b4ab97338e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ElementParametersTypeImpl.java @@ -0,0 +1,37 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.ElementParametersType; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Element Parameters Type'. + * + * + * @generated + */ +public class ElementParametersTypeImpl extends ElementParametersImpl implements ElementParametersType { + /** + * + * + * @generated + */ + protected ElementParametersTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.ELEMENT_PARAMETERS_TYPE; + } + +} //ElementParametersTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/EnumParameterTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/EnumParameterTypeImpl.java new file mode 100644 index 00000000000..1f479ae40ed --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/EnumParameterTypeImpl.java @@ -0,0 +1,219 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.EnumParameterType; +import bpsim.ParameterValue; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Enum Parameter Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.EnumParameterTypeImpl#getGroup Group}
  • + *
  • {@link bpsim.impl.EnumParameterTypeImpl#getParameterValueGroup Parameter Value Group}
  • + *
  • {@link bpsim.impl.EnumParameterTypeImpl#getParameterValue Parameter Value}
  • + *
+ * + * @generated + */ +public class EnumParameterTypeImpl extends ParameterValueImpl implements EnumParameterType { + /** + * The cached value of the '{@link #getGroup() Group}' attribute list. + * + * + * @see #getGroup() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap group; + + /** + * + * + * @generated + */ + protected EnumParameterTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.ENUM_PARAMETER_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getGroup() { + if (group == null) { + group = new BasicFeatureMap(this, BpsimPackage.ENUM_PARAMETER_TYPE__GROUP); + } + return group; + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getParameterValueGroup() { + return (FeatureMap)getGroup().list(BpsimPackage.Literals.ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP); + } + + /** + * + * + * @generated + */ + @Override + public EList getParameterValue() { + return getParameterValueGroup().list(BpsimPackage.Literals.ENUM_PARAMETER_TYPE__PARAMETER_VALUE); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.ENUM_PARAMETER_TYPE__GROUP: + return ((InternalEList)getGroup()).basicRemove(otherEnd, msgs); + case BpsimPackage.ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP: + return ((InternalEList)getParameterValueGroup()).basicRemove(otherEnd, msgs); + case BpsimPackage.ENUM_PARAMETER_TYPE__PARAMETER_VALUE: + return ((InternalEList)getParameterValue()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.ENUM_PARAMETER_TYPE__GROUP: + if (coreType) return getGroup(); + return ((FeatureMap.Internal)getGroup()).getWrapper(); + case BpsimPackage.ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP: + if (coreType) return getParameterValueGroup(); + return ((FeatureMap.Internal)getParameterValueGroup()).getWrapper(); + case BpsimPackage.ENUM_PARAMETER_TYPE__PARAMETER_VALUE: + return getParameterValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.ENUM_PARAMETER_TYPE__GROUP: + ((FeatureMap.Internal)getGroup()).set(newValue); + return; + case BpsimPackage.ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP: + ((FeatureMap.Internal)getParameterValueGroup()).set(newValue); + return; + case BpsimPackage.ENUM_PARAMETER_TYPE__PARAMETER_VALUE: + getParameterValue().clear(); + getParameterValue().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.ENUM_PARAMETER_TYPE__GROUP: + getGroup().clear(); + return; + case BpsimPackage.ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP: + getParameterValueGroup().clear(); + return; + case BpsimPackage.ENUM_PARAMETER_TYPE__PARAMETER_VALUE: + getParameterValue().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.ENUM_PARAMETER_TYPE__GROUP: + return group != null && !group.isEmpty(); + case BpsimPackage.ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP: + return !getParameterValueGroup().isEmpty(); + case BpsimPackage.ENUM_PARAMETER_TYPE__PARAMETER_VALUE: + return !getParameterValue().isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (group: "); + result.append(group); + result.append(')'); + return result.toString(); + } + +} //EnumParameterTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ErlangDistributionTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ErlangDistributionTypeImpl.java new file mode 100644 index 00000000000..4d00551aee1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ErlangDistributionTypeImpl.java @@ -0,0 +1,298 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.ErlangDistributionType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Erlang Distribution Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.ErlangDistributionTypeImpl#getK K}
  • + *
  • {@link bpsim.impl.ErlangDistributionTypeImpl#getMean Mean}
  • + *
+ * + * @generated + */ +public class ErlangDistributionTypeImpl extends DistributionParameterImpl implements ErlangDistributionType { + /** + * The default value of the '{@link #getK() K}' attribute. + * + * + * @see #getK() + * @generated + * @ordered + */ + protected static final double K_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getK() K}' attribute. + * + * + * @see #getK() + * @generated + * @ordered + */ + @GwtTransient + protected double k = K_EDEFAULT; + + /** + * This is true if the K attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean kESet; + + /** + * The default value of the '{@link #getMean() Mean}' attribute. + * + * + * @see #getMean() + * @generated + * @ordered + */ + protected static final double MEAN_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getMean() Mean}' attribute. + * + * + * @see #getMean() + * @generated + * @ordered + */ + @GwtTransient + protected double mean = MEAN_EDEFAULT; + + /** + * This is true if the Mean attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean meanESet; + + /** + * + * + * @generated + */ + protected ErlangDistributionTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.ERLANG_DISTRIBUTION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public double getK() { + return k; + } + + /** + * + * + * @generated + */ + @Override + public void setK(double newK) { + double oldK = k; + k = newK; + boolean oldKESet = kESet; + kESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.ERLANG_DISTRIBUTION_TYPE__K, oldK, k, !oldKESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetK() { + double oldK = k; + boolean oldKESet = kESet; + k = K_EDEFAULT; + kESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.ERLANG_DISTRIBUTION_TYPE__K, oldK, K_EDEFAULT, oldKESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetK() { + return kESet; + } + + /** + * + * + * @generated + */ + @Override + public double getMean() { + return mean; + } + + /** + * + * + * @generated + */ + @Override + public void setMean(double newMean) { + double oldMean = mean; + mean = newMean; + boolean oldMeanESet = meanESet; + meanESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.ERLANG_DISTRIBUTION_TYPE__MEAN, oldMean, mean, !oldMeanESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetMean() { + double oldMean = mean; + boolean oldMeanESet = meanESet; + mean = MEAN_EDEFAULT; + meanESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.ERLANG_DISTRIBUTION_TYPE__MEAN, oldMean, MEAN_EDEFAULT, oldMeanESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetMean() { + return meanESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.ERLANG_DISTRIBUTION_TYPE__K: + return getK(); + case BpsimPackage.ERLANG_DISTRIBUTION_TYPE__MEAN: + return getMean(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.ERLANG_DISTRIBUTION_TYPE__K: + setK((Double)newValue); + return; + case BpsimPackage.ERLANG_DISTRIBUTION_TYPE__MEAN: + setMean((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.ERLANG_DISTRIBUTION_TYPE__K: + unsetK(); + return; + case BpsimPackage.ERLANG_DISTRIBUTION_TYPE__MEAN: + unsetMean(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.ERLANG_DISTRIBUTION_TYPE__K: + return isSetK(); + case BpsimPackage.ERLANG_DISTRIBUTION_TYPE__MEAN: + return isSetMean(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (k: "); + if (kESet) result.append(k); else result.append(""); + result.append(", mean: "); + if (meanESet) result.append(mean); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //ErlangDistributionTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ExpressionParameterTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ExpressionParameterTypeImpl.java new file mode 100644 index 00000000000..c672ead9206 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ExpressionParameterTypeImpl.java @@ -0,0 +1,167 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.ExpressionParameterType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Expression Parameter Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.ExpressionParameterTypeImpl#getValue Value}
  • + *
+ * + * @generated + */ +public class ExpressionParameterTypeImpl extends ParameterValueImpl implements ExpressionParameterType { + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final String VALUE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + @GwtTransient + protected String value = VALUE_EDEFAULT; + + /** + * + * + * @generated + */ + protected ExpressionParameterTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.EXPRESSION_PARAMETER_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public String getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public void setValue(String newValue) { + String oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.EXPRESSION_PARAMETER_TYPE__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.EXPRESSION_PARAMETER_TYPE__VALUE: + return getValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.EXPRESSION_PARAMETER_TYPE__VALUE: + setValue((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.EXPRESSION_PARAMETER_TYPE__VALUE: + setValue(VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.EXPRESSION_PARAMETER_TYPE__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (value: "); + result.append(value); + result.append(')'); + return result.toString(); + } + +} //ExpressionParameterTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/FloatingParameterTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/FloatingParameterTypeImpl.java new file mode 100644 index 00000000000..729e916edf9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/FloatingParameterTypeImpl.java @@ -0,0 +1,356 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.FloatingParameterType; +import bpsim.TimeUnit; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Floating Parameter Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.FloatingParameterTypeImpl#getCurrencyUnit Currency Unit}
  • + *
  • {@link bpsim.impl.FloatingParameterTypeImpl#getTimeUnit Time Unit}
  • + *
  • {@link bpsim.impl.FloatingParameterTypeImpl#getValue Value}
  • + *
+ * + * @generated + */ +public class FloatingParameterTypeImpl extends ConstantParameterImpl implements FloatingParameterType { + /** + * The default value of the '{@link #getCurrencyUnit() Currency Unit}' attribute. + * + * + * @see #getCurrencyUnit() + * @generated + * @ordered + */ + protected static final String CURRENCY_UNIT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getCurrencyUnit() Currency Unit}' attribute. + * + * + * @see #getCurrencyUnit() + * @generated + * @ordered + */ + @GwtTransient + protected String currencyUnit = CURRENCY_UNIT_EDEFAULT; + + /** + * The default value of the '{@link #getTimeUnit() Time Unit}' attribute. + * + * + * @see #getTimeUnit() + * @generated + * @ordered + */ + protected static final TimeUnit TIME_UNIT_EDEFAULT = TimeUnit.MS; + + /** + * The cached value of the '{@link #getTimeUnit() Time Unit}' attribute. + * + * + * @see #getTimeUnit() + * @generated + * @ordered + */ + @GwtTransient + protected TimeUnit timeUnit = TIME_UNIT_EDEFAULT; + + /** + * This is true if the Time Unit attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean timeUnitESet; + + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final double VALUE_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + @GwtTransient + protected double value = VALUE_EDEFAULT; + + /** + * This is true if the Value attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean valueESet; + + /** + * + * + * @generated + */ + protected FloatingParameterTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.FLOATING_PARAMETER_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public String getCurrencyUnit() { + return currencyUnit; + } + + /** + * + * + * @generated + */ + @Override + public void setCurrencyUnit(String newCurrencyUnit) { + String oldCurrencyUnit = currencyUnit; + currencyUnit = newCurrencyUnit; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.FLOATING_PARAMETER_TYPE__CURRENCY_UNIT, oldCurrencyUnit, currencyUnit)); + } + + /** + * + * + * @generated + */ + @Override + public TimeUnit getTimeUnit() { + return timeUnit; + } + + /** + * + * + * @generated + */ + @Override + public void setTimeUnit(TimeUnit newTimeUnit) { + TimeUnit oldTimeUnit = timeUnit; + timeUnit = newTimeUnit == null ? TIME_UNIT_EDEFAULT : newTimeUnit; + boolean oldTimeUnitESet = timeUnitESet; + timeUnitESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.FLOATING_PARAMETER_TYPE__TIME_UNIT, oldTimeUnit, timeUnit, !oldTimeUnitESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetTimeUnit() { + TimeUnit oldTimeUnit = timeUnit; + boolean oldTimeUnitESet = timeUnitESet; + timeUnit = TIME_UNIT_EDEFAULT; + timeUnitESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.FLOATING_PARAMETER_TYPE__TIME_UNIT, oldTimeUnit, TIME_UNIT_EDEFAULT, oldTimeUnitESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetTimeUnit() { + return timeUnitESet; + } + + /** + * + * + * @generated + */ + @Override + public double getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public void setValue(double newValue) { + double oldValue = value; + value = newValue; + boolean oldValueESet = valueESet; + valueESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.FLOATING_PARAMETER_TYPE__VALUE, oldValue, value, !oldValueESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetValue() { + double oldValue = value; + boolean oldValueESet = valueESet; + value = VALUE_EDEFAULT; + valueESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.FLOATING_PARAMETER_TYPE__VALUE, oldValue, VALUE_EDEFAULT, oldValueESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetValue() { + return valueESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.FLOATING_PARAMETER_TYPE__CURRENCY_UNIT: + return getCurrencyUnit(); + case BpsimPackage.FLOATING_PARAMETER_TYPE__TIME_UNIT: + return getTimeUnit(); + case BpsimPackage.FLOATING_PARAMETER_TYPE__VALUE: + return getValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.FLOATING_PARAMETER_TYPE__CURRENCY_UNIT: + setCurrencyUnit((String)newValue); + return; + case BpsimPackage.FLOATING_PARAMETER_TYPE__TIME_UNIT: + setTimeUnit((TimeUnit)newValue); + return; + case BpsimPackage.FLOATING_PARAMETER_TYPE__VALUE: + setValue((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.FLOATING_PARAMETER_TYPE__CURRENCY_UNIT: + setCurrencyUnit(CURRENCY_UNIT_EDEFAULT); + return; + case BpsimPackage.FLOATING_PARAMETER_TYPE__TIME_UNIT: + unsetTimeUnit(); + return; + case BpsimPackage.FLOATING_PARAMETER_TYPE__VALUE: + unsetValue(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.FLOATING_PARAMETER_TYPE__CURRENCY_UNIT: + return CURRENCY_UNIT_EDEFAULT == null ? currencyUnit != null : !CURRENCY_UNIT_EDEFAULT.equals(currencyUnit); + case BpsimPackage.FLOATING_PARAMETER_TYPE__TIME_UNIT: + return isSetTimeUnit(); + case BpsimPackage.FLOATING_PARAMETER_TYPE__VALUE: + return isSetValue(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (currencyUnit: "); + result.append(currencyUnit); + result.append(", timeUnit: "); + if (timeUnitESet) result.append(timeUnit); else result.append(""); + result.append(", value: "); + if (valueESet) result.append(value); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //FloatingParameterTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/GammaDistributionTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/GammaDistributionTypeImpl.java new file mode 100644 index 00000000000..36828a6efdc --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/GammaDistributionTypeImpl.java @@ -0,0 +1,298 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.GammaDistributionType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Gamma Distribution Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.GammaDistributionTypeImpl#getScale Scale}
  • + *
  • {@link bpsim.impl.GammaDistributionTypeImpl#getShape Shape}
  • + *
+ * + * @generated + */ +public class GammaDistributionTypeImpl extends DistributionParameterImpl implements GammaDistributionType { + /** + * The default value of the '{@link #getScale() Scale}' attribute. + * + * + * @see #getScale() + * @generated + * @ordered + */ + protected static final double SCALE_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getScale() Scale}' attribute. + * + * + * @see #getScale() + * @generated + * @ordered + */ + @GwtTransient + protected double scale = SCALE_EDEFAULT; + + /** + * This is true if the Scale attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean scaleESet; + + /** + * The default value of the '{@link #getShape() Shape}' attribute. + * + * + * @see #getShape() + * @generated + * @ordered + */ + protected static final double SHAPE_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getShape() Shape}' attribute. + * + * + * @see #getShape() + * @generated + * @ordered + */ + @GwtTransient + protected double shape = SHAPE_EDEFAULT; + + /** + * This is true if the Shape attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean shapeESet; + + /** + * + * + * @generated + */ + protected GammaDistributionTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.GAMMA_DISTRIBUTION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public double getScale() { + return scale; + } + + /** + * + * + * @generated + */ + @Override + public void setScale(double newScale) { + double oldScale = scale; + scale = newScale; + boolean oldScaleESet = scaleESet; + scaleESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.GAMMA_DISTRIBUTION_TYPE__SCALE, oldScale, scale, !oldScaleESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetScale() { + double oldScale = scale; + boolean oldScaleESet = scaleESet; + scale = SCALE_EDEFAULT; + scaleESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.GAMMA_DISTRIBUTION_TYPE__SCALE, oldScale, SCALE_EDEFAULT, oldScaleESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetScale() { + return scaleESet; + } + + /** + * + * + * @generated + */ + @Override + public double getShape() { + return shape; + } + + /** + * + * + * @generated + */ + @Override + public void setShape(double newShape) { + double oldShape = shape; + shape = newShape; + boolean oldShapeESet = shapeESet; + shapeESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.GAMMA_DISTRIBUTION_TYPE__SHAPE, oldShape, shape, !oldShapeESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetShape() { + double oldShape = shape; + boolean oldShapeESet = shapeESet; + shape = SHAPE_EDEFAULT; + shapeESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.GAMMA_DISTRIBUTION_TYPE__SHAPE, oldShape, SHAPE_EDEFAULT, oldShapeESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetShape() { + return shapeESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.GAMMA_DISTRIBUTION_TYPE__SCALE: + return getScale(); + case BpsimPackage.GAMMA_DISTRIBUTION_TYPE__SHAPE: + return getShape(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.GAMMA_DISTRIBUTION_TYPE__SCALE: + setScale((Double)newValue); + return; + case BpsimPackage.GAMMA_DISTRIBUTION_TYPE__SHAPE: + setShape((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.GAMMA_DISTRIBUTION_TYPE__SCALE: + unsetScale(); + return; + case BpsimPackage.GAMMA_DISTRIBUTION_TYPE__SHAPE: + unsetShape(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.GAMMA_DISTRIBUTION_TYPE__SCALE: + return isSetScale(); + case BpsimPackage.GAMMA_DISTRIBUTION_TYPE__SHAPE: + return isSetShape(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (scale: "); + if (scaleESet) result.append(scale); else result.append(""); + result.append(", shape: "); + if (shapeESet) result.append(shape); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //GammaDistributionTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/LogNormalDistributionTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/LogNormalDistributionTypeImpl.java new file mode 100644 index 00000000000..ed7db8b36d2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/LogNormalDistributionTypeImpl.java @@ -0,0 +1,298 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.LogNormalDistributionType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Log Normal Distribution Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.LogNormalDistributionTypeImpl#getMean Mean}
  • + *
  • {@link bpsim.impl.LogNormalDistributionTypeImpl#getStandardDeviation Standard Deviation}
  • + *
+ * + * @generated + */ +public class LogNormalDistributionTypeImpl extends DistributionParameterImpl implements LogNormalDistributionType { + /** + * The default value of the '{@link #getMean() Mean}' attribute. + * + * + * @see #getMean() + * @generated + * @ordered + */ + protected static final double MEAN_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getMean() Mean}' attribute. + * + * + * @see #getMean() + * @generated + * @ordered + */ + @GwtTransient + protected double mean = MEAN_EDEFAULT; + + /** + * This is true if the Mean attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean meanESet; + + /** + * The default value of the '{@link #getStandardDeviation() Standard Deviation}' attribute. + * + * + * @see #getStandardDeviation() + * @generated + * @ordered + */ + protected static final double STANDARD_DEVIATION_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getStandardDeviation() Standard Deviation}' attribute. + * + * + * @see #getStandardDeviation() + * @generated + * @ordered + */ + @GwtTransient + protected double standardDeviation = STANDARD_DEVIATION_EDEFAULT; + + /** + * This is true if the Standard Deviation attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean standardDeviationESet; + + /** + * + * + * @generated + */ + protected LogNormalDistributionTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.LOG_NORMAL_DISTRIBUTION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public double getMean() { + return mean; + } + + /** + * + * + * @generated + */ + @Override + public void setMean(double newMean) { + double oldMean = mean; + mean = newMean; + boolean oldMeanESet = meanESet; + meanESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE__MEAN, oldMean, mean, !oldMeanESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetMean() { + double oldMean = mean; + boolean oldMeanESet = meanESet; + mean = MEAN_EDEFAULT; + meanESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE__MEAN, oldMean, MEAN_EDEFAULT, oldMeanESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetMean() { + return meanESet; + } + + /** + * + * + * @generated + */ + @Override + public double getStandardDeviation() { + return standardDeviation; + } + + /** + * + * + * @generated + */ + @Override + public void setStandardDeviation(double newStandardDeviation) { + double oldStandardDeviation = standardDeviation; + standardDeviation = newStandardDeviation; + boolean oldStandardDeviationESet = standardDeviationESet; + standardDeviationESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION, oldStandardDeviation, standardDeviation, !oldStandardDeviationESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetStandardDeviation() { + double oldStandardDeviation = standardDeviation; + boolean oldStandardDeviationESet = standardDeviationESet; + standardDeviation = STANDARD_DEVIATION_EDEFAULT; + standardDeviationESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION, oldStandardDeviation, STANDARD_DEVIATION_EDEFAULT, oldStandardDeviationESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetStandardDeviation() { + return standardDeviationESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE__MEAN: + return getMean(); + case BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION: + return getStandardDeviation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE__MEAN: + setMean((Double)newValue); + return; + case BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION: + setStandardDeviation((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE__MEAN: + unsetMean(); + return; + case BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION: + unsetStandardDeviation(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE__MEAN: + return isSetMean(); + case BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION: + return isSetStandardDeviation(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (mean: "); + if (meanESet) result.append(mean); else result.append(""); + result.append(", standardDeviation: "); + if (standardDeviationESet) result.append(standardDeviation); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //LogNormalDistributionTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/NegativeExponentialDistributionTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/NegativeExponentialDistributionTypeImpl.java new file mode 100644 index 00000000000..060cd44f664 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/NegativeExponentialDistributionTypeImpl.java @@ -0,0 +1,204 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.NegativeExponentialDistributionType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Negative Exponential Distribution Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.NegativeExponentialDistributionTypeImpl#getMean Mean}
  • + *
+ * + * @generated + */ +public class NegativeExponentialDistributionTypeImpl extends DistributionParameterImpl implements NegativeExponentialDistributionType { + /** + * The default value of the '{@link #getMean() Mean}' attribute. + * + * + * @see #getMean() + * @generated + * @ordered + */ + protected static final double MEAN_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getMean() Mean}' attribute. + * + * + * @see #getMean() + * @generated + * @ordered + */ + @GwtTransient + protected double mean = MEAN_EDEFAULT; + + /** + * This is true if the Mean attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean meanESet; + + /** + * + * + * @generated + */ + protected NegativeExponentialDistributionTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public double getMean() { + return mean; + } + + /** + * + * + * @generated + */ + @Override + public void setMean(double newMean) { + double oldMean = mean; + mean = newMean; + boolean oldMeanESet = meanESet; + meanESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__MEAN, oldMean, mean, !oldMeanESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetMean() { + double oldMean = mean; + boolean oldMeanESet = meanESet; + mean = MEAN_EDEFAULT; + meanESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__MEAN, oldMean, MEAN_EDEFAULT, oldMeanESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetMean() { + return meanESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__MEAN: + return getMean(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__MEAN: + setMean((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__MEAN: + unsetMean(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE__MEAN: + return isSetMean(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (mean: "); + if (meanESet) result.append(mean); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //NegativeExponentialDistributionTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/NormalDistributionTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/NormalDistributionTypeImpl.java new file mode 100644 index 00000000000..906a2acd0cd --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/NormalDistributionTypeImpl.java @@ -0,0 +1,298 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.NormalDistributionType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Normal Distribution Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.NormalDistributionTypeImpl#getMean Mean}
  • + *
  • {@link bpsim.impl.NormalDistributionTypeImpl#getStandardDeviation Standard Deviation}
  • + *
+ * + * @generated + */ +public class NormalDistributionTypeImpl extends DistributionParameterImpl implements NormalDistributionType { + /** + * The default value of the '{@link #getMean() Mean}' attribute. + * + * + * @see #getMean() + * @generated + * @ordered + */ + protected static final double MEAN_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getMean() Mean}' attribute. + * + * + * @see #getMean() + * @generated + * @ordered + */ + @GwtTransient + protected double mean = MEAN_EDEFAULT; + + /** + * This is true if the Mean attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean meanESet; + + /** + * The default value of the '{@link #getStandardDeviation() Standard Deviation}' attribute. + * + * + * @see #getStandardDeviation() + * @generated + * @ordered + */ + protected static final double STANDARD_DEVIATION_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getStandardDeviation() Standard Deviation}' attribute. + * + * + * @see #getStandardDeviation() + * @generated + * @ordered + */ + @GwtTransient + protected double standardDeviation = STANDARD_DEVIATION_EDEFAULT; + + /** + * This is true if the Standard Deviation attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean standardDeviationESet; + + /** + * + * + * @generated + */ + protected NormalDistributionTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.NORMAL_DISTRIBUTION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public double getMean() { + return mean; + } + + /** + * + * + * @generated + */ + @Override + public void setMean(double newMean) { + double oldMean = mean; + mean = newMean; + boolean oldMeanESet = meanESet; + meanESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.NORMAL_DISTRIBUTION_TYPE__MEAN, oldMean, mean, !oldMeanESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetMean() { + double oldMean = mean; + boolean oldMeanESet = meanESet; + mean = MEAN_EDEFAULT; + meanESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.NORMAL_DISTRIBUTION_TYPE__MEAN, oldMean, MEAN_EDEFAULT, oldMeanESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetMean() { + return meanESet; + } + + /** + * + * + * @generated + */ + @Override + public double getStandardDeviation() { + return standardDeviation; + } + + /** + * + * + * @generated + */ + @Override + public void setStandardDeviation(double newStandardDeviation) { + double oldStandardDeviation = standardDeviation; + standardDeviation = newStandardDeviation; + boolean oldStandardDeviationESet = standardDeviationESet; + standardDeviationESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION, oldStandardDeviation, standardDeviation, !oldStandardDeviationESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetStandardDeviation() { + double oldStandardDeviation = standardDeviation; + boolean oldStandardDeviationESet = standardDeviationESet; + standardDeviation = STANDARD_DEVIATION_EDEFAULT; + standardDeviationESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION, oldStandardDeviation, STANDARD_DEVIATION_EDEFAULT, oldStandardDeviationESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetStandardDeviation() { + return standardDeviationESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.NORMAL_DISTRIBUTION_TYPE__MEAN: + return getMean(); + case BpsimPackage.NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION: + return getStandardDeviation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.NORMAL_DISTRIBUTION_TYPE__MEAN: + setMean((Double)newValue); + return; + case BpsimPackage.NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION: + setStandardDeviation((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.NORMAL_DISTRIBUTION_TYPE__MEAN: + unsetMean(); + return; + case BpsimPackage.NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION: + unsetStandardDeviation(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.NORMAL_DISTRIBUTION_TYPE__MEAN: + return isSetMean(); + case BpsimPackage.NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION: + return isSetStandardDeviation(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (mean: "); + if (meanESet) result.append(mean); else result.append(""); + result.append(", standardDeviation: "); + if (standardDeviationESet) result.append(standardDeviation); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //NormalDistributionTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/NumericParameterTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/NumericParameterTypeImpl.java new file mode 100644 index 00000000000..84f4ca2d92b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/NumericParameterTypeImpl.java @@ -0,0 +1,356 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.NumericParameterType; +import bpsim.TimeUnit; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Numeric Parameter Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.NumericParameterTypeImpl#getCurrencyUnit Currency Unit}
  • + *
  • {@link bpsim.impl.NumericParameterTypeImpl#getTimeUnit Time Unit}
  • + *
  • {@link bpsim.impl.NumericParameterTypeImpl#getValue Value}
  • + *
+ * + * @generated + */ +public class NumericParameterTypeImpl extends ConstantParameterImpl implements NumericParameterType { + /** + * The default value of the '{@link #getCurrencyUnit() Currency Unit}' attribute. + * + * + * @see #getCurrencyUnit() + * @generated + * @ordered + */ + protected static final String CURRENCY_UNIT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getCurrencyUnit() Currency Unit}' attribute. + * + * + * @see #getCurrencyUnit() + * @generated + * @ordered + */ + @GwtTransient + protected String currencyUnit = CURRENCY_UNIT_EDEFAULT; + + /** + * The default value of the '{@link #getTimeUnit() Time Unit}' attribute. + * + * + * @see #getTimeUnit() + * @generated + * @ordered + */ + protected static final TimeUnit TIME_UNIT_EDEFAULT = TimeUnit.MS; + + /** + * The cached value of the '{@link #getTimeUnit() Time Unit}' attribute. + * + * + * @see #getTimeUnit() + * @generated + * @ordered + */ + @GwtTransient + protected TimeUnit timeUnit = TIME_UNIT_EDEFAULT; + + /** + * This is true if the Time Unit attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean timeUnitESet; + + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final long VALUE_EDEFAULT = 0L; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + @GwtTransient + protected long value = VALUE_EDEFAULT; + + /** + * This is true if the Value attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean valueESet; + + /** + * + * + * @generated + */ + protected NumericParameterTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.NUMERIC_PARAMETER_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public String getCurrencyUnit() { + return currencyUnit; + } + + /** + * + * + * @generated + */ + @Override + public void setCurrencyUnit(String newCurrencyUnit) { + String oldCurrencyUnit = currencyUnit; + currencyUnit = newCurrencyUnit; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT, oldCurrencyUnit, currencyUnit)); + } + + /** + * + * + * @generated + */ + @Override + public TimeUnit getTimeUnit() { + return timeUnit; + } + + /** + * + * + * @generated + */ + @Override + public void setTimeUnit(TimeUnit newTimeUnit) { + TimeUnit oldTimeUnit = timeUnit; + timeUnit = newTimeUnit == null ? TIME_UNIT_EDEFAULT : newTimeUnit; + boolean oldTimeUnitESet = timeUnitESet; + timeUnitESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.NUMERIC_PARAMETER_TYPE__TIME_UNIT, oldTimeUnit, timeUnit, !oldTimeUnitESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetTimeUnit() { + TimeUnit oldTimeUnit = timeUnit; + boolean oldTimeUnitESet = timeUnitESet; + timeUnit = TIME_UNIT_EDEFAULT; + timeUnitESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.NUMERIC_PARAMETER_TYPE__TIME_UNIT, oldTimeUnit, TIME_UNIT_EDEFAULT, oldTimeUnitESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetTimeUnit() { + return timeUnitESet; + } + + /** + * + * + * @generated + */ + @Override + public long getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public void setValue(long newValue) { + long oldValue = value; + value = newValue; + boolean oldValueESet = valueESet; + valueESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.NUMERIC_PARAMETER_TYPE__VALUE, oldValue, value, !oldValueESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetValue() { + long oldValue = value; + boolean oldValueESet = valueESet; + value = VALUE_EDEFAULT; + valueESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.NUMERIC_PARAMETER_TYPE__VALUE, oldValue, VALUE_EDEFAULT, oldValueESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetValue() { + return valueESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT: + return getCurrencyUnit(); + case BpsimPackage.NUMERIC_PARAMETER_TYPE__TIME_UNIT: + return getTimeUnit(); + case BpsimPackage.NUMERIC_PARAMETER_TYPE__VALUE: + return getValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT: + setCurrencyUnit((String)newValue); + return; + case BpsimPackage.NUMERIC_PARAMETER_TYPE__TIME_UNIT: + setTimeUnit((TimeUnit)newValue); + return; + case BpsimPackage.NUMERIC_PARAMETER_TYPE__VALUE: + setValue((Long)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT: + setCurrencyUnit(CURRENCY_UNIT_EDEFAULT); + return; + case BpsimPackage.NUMERIC_PARAMETER_TYPE__TIME_UNIT: + unsetTimeUnit(); + return; + case BpsimPackage.NUMERIC_PARAMETER_TYPE__VALUE: + unsetValue(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT: + return CURRENCY_UNIT_EDEFAULT == null ? currencyUnit != null : !CURRENCY_UNIT_EDEFAULT.equals(currencyUnit); + case BpsimPackage.NUMERIC_PARAMETER_TYPE__TIME_UNIT: + return isSetTimeUnit(); + case BpsimPackage.NUMERIC_PARAMETER_TYPE__VALUE: + return isSetValue(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (currencyUnit: "); + result.append(currencyUnit); + result.append(", timeUnit: "); + if (timeUnitESet) result.append(timeUnit); else result.append(""); + result.append(", value: "); + if (valueESet) result.append(value); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //NumericParameterTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ParameterImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ParameterImpl.java new file mode 100644 index 00000000000..5113e06bf57 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ParameterImpl.java @@ -0,0 +1,427 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.Parameter; +import bpsim.ParameterValue; +import bpsim.ResultType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.EDataTypeEList; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Parameter'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.ParameterImpl#getResultRequest Result Request}
  • + *
  • {@link bpsim.impl.ParameterImpl#getParameterValueGroup Parameter Value Group}
  • + *
  • {@link bpsim.impl.ParameterImpl#getParameterValue Parameter Value}
  • + *
  • {@link bpsim.impl.ParameterImpl#isKpi Kpi}
  • + *
  • {@link bpsim.impl.ParameterImpl#isSla Sla}
  • + *
+ * + * @generated + */ +public class ParameterImpl extends EObjectImpl implements Parameter { + /** + * The cached value of the '{@link #getResultRequest() Result Request}' attribute list. + * + * + * @see #getResultRequest() + * @generated + * @ordered + */ + @GwtTransient + protected EList resultRequest; + + /** + * The cached value of the '{@link #getParameterValueGroup() Parameter Value Group}' attribute list. + * + * + * @see #getParameterValueGroup() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap parameterValueGroup; + + /** + * The default value of the '{@link #isKpi() Kpi}' attribute. + * + * + * @see #isKpi() + * @generated + * @ordered + */ + protected static final boolean KPI_EDEFAULT = false; + + /** + * The cached value of the '{@link #isKpi() Kpi}' attribute. + * + * + * @see #isKpi() + * @generated + * @ordered + */ + @GwtTransient + protected boolean kpi = KPI_EDEFAULT; + + /** + * This is true if the Kpi attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean kpiESet; + + /** + * The default value of the '{@link #isSla() Sla}' attribute. + * + * + * @see #isSla() + * @generated + * @ordered + */ + protected static final boolean SLA_EDEFAULT = false; + + /** + * The cached value of the '{@link #isSla() Sla}' attribute. + * + * + * @see #isSla() + * @generated + * @ordered + */ + @GwtTransient + protected boolean sla = SLA_EDEFAULT; + + /** + * This is true if the Sla attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean slaESet; + + /** + * + * + * @generated + */ + protected ParameterImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.PARAMETER; + } + + /** + * + * + * @generated + */ + @Override + public EList getResultRequest() { + if (resultRequest == null) { + resultRequest = new EDataTypeEList(ResultType.class, this, BpsimPackage.PARAMETER__RESULT_REQUEST); + } + return resultRequest; + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getParameterValueGroup() { + if (parameterValueGroup == null) { + parameterValueGroup = new BasicFeatureMap(this, BpsimPackage.PARAMETER__PARAMETER_VALUE_GROUP); + } + return parameterValueGroup; + } + + /** + * + * + * @generated + */ + @Override + public EList getParameterValue() { + return getParameterValueGroup().list(BpsimPackage.Literals.PARAMETER__PARAMETER_VALUE); + } + + /** + * + * + * @generated + */ + @Override + public boolean isKpi() { + return kpi; + } + + /** + * + * + * @generated + */ + @Override + public void setKpi(boolean newKpi) { + boolean oldKpi = kpi; + kpi = newKpi; + boolean oldKpiESet = kpiESet; + kpiESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.PARAMETER__KPI, oldKpi, kpi, !oldKpiESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetKpi() { + boolean oldKpi = kpi; + boolean oldKpiESet = kpiESet; + kpi = KPI_EDEFAULT; + kpiESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.PARAMETER__KPI, oldKpi, KPI_EDEFAULT, oldKpiESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetKpi() { + return kpiESet; + } + + /** + * + * + * @generated + */ + @Override + public boolean isSla() { + return sla; + } + + /** + * + * + * @generated + */ + @Override + public void setSla(boolean newSla) { + boolean oldSla = sla; + sla = newSla; + boolean oldSlaESet = slaESet; + slaESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.PARAMETER__SLA, oldSla, sla, !oldSlaESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetSla() { + boolean oldSla = sla; + boolean oldSlaESet = slaESet; + sla = SLA_EDEFAULT; + slaESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.PARAMETER__SLA, oldSla, SLA_EDEFAULT, oldSlaESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetSla() { + return slaESet; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.PARAMETER__PARAMETER_VALUE_GROUP: + return ((InternalEList)getParameterValueGroup()).basicRemove(otherEnd, msgs); + case BpsimPackage.PARAMETER__PARAMETER_VALUE: + return ((InternalEList)getParameterValue()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.PARAMETER__RESULT_REQUEST: + return getResultRequest(); + case BpsimPackage.PARAMETER__PARAMETER_VALUE_GROUP: + if (coreType) return getParameterValueGroup(); + return ((FeatureMap.Internal)getParameterValueGroup()).getWrapper(); + case BpsimPackage.PARAMETER__PARAMETER_VALUE: + return getParameterValue(); + case BpsimPackage.PARAMETER__KPI: + return isKpi(); + case BpsimPackage.PARAMETER__SLA: + return isSla(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.PARAMETER__RESULT_REQUEST: + getResultRequest().clear(); + getResultRequest().addAll((Collection)newValue); + return; + case BpsimPackage.PARAMETER__PARAMETER_VALUE_GROUP: + ((FeatureMap.Internal)getParameterValueGroup()).set(newValue); + return; + case BpsimPackage.PARAMETER__PARAMETER_VALUE: + getParameterValue().clear(); + getParameterValue().addAll((Collection)newValue); + return; + case BpsimPackage.PARAMETER__KPI: + setKpi((Boolean)newValue); + return; + case BpsimPackage.PARAMETER__SLA: + setSla((Boolean)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.PARAMETER__RESULT_REQUEST: + getResultRequest().clear(); + return; + case BpsimPackage.PARAMETER__PARAMETER_VALUE_GROUP: + getParameterValueGroup().clear(); + return; + case BpsimPackage.PARAMETER__PARAMETER_VALUE: + getParameterValue().clear(); + return; + case BpsimPackage.PARAMETER__KPI: + unsetKpi(); + return; + case BpsimPackage.PARAMETER__SLA: + unsetSla(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.PARAMETER__RESULT_REQUEST: + return resultRequest != null && !resultRequest.isEmpty(); + case BpsimPackage.PARAMETER__PARAMETER_VALUE_GROUP: + return parameterValueGroup != null && !parameterValueGroup.isEmpty(); + case BpsimPackage.PARAMETER__PARAMETER_VALUE: + return !getParameterValue().isEmpty(); + case BpsimPackage.PARAMETER__KPI: + return isSetKpi(); + case BpsimPackage.PARAMETER__SLA: + return isSetSla(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (resultRequest: "); + result.append(resultRequest); + result.append(", parameterValueGroup: "); + result.append(parameterValueGroup); + result.append(", kpi: "); + if (kpiESet) result.append(kpi); else result.append(""); + result.append(", sla: "); + if (slaESet) result.append(sla); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //ParameterImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ParameterValueImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ParameterValueImpl.java new file mode 100644 index 00000000000..6c1361c2ba9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ParameterValueImpl.java @@ -0,0 +1,320 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.ParameterValue; +import bpsim.ResultType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Parameter Value'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.ParameterValueImpl#getInstance Instance}
  • + *
  • {@link bpsim.impl.ParameterValueImpl#getResult Result}
  • + *
  • {@link bpsim.impl.ParameterValueImpl#getValidFor Valid For}
  • + *
+ * + * @generated + */ +public class ParameterValueImpl extends EObjectImpl implements ParameterValue { + /** + * The default value of the '{@link #getInstance() Instance}' attribute. + * + * + * @see #getInstance() + * @generated + * @ordered + */ + protected static final String INSTANCE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getInstance() Instance}' attribute. + * + * + * @see #getInstance() + * @generated + * @ordered + */ + @GwtTransient + protected String instance = INSTANCE_EDEFAULT; + + /** + * The default value of the '{@link #getResult() Result}' attribute. + * + * + * @see #getResult() + * @generated + * @ordered + */ + protected static final ResultType RESULT_EDEFAULT = ResultType.MIN; + + /** + * The cached value of the '{@link #getResult() Result}' attribute. + * + * + * @see #getResult() + * @generated + * @ordered + */ + @GwtTransient + protected ResultType result = RESULT_EDEFAULT; + + /** + * This is true if the Result attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean resultESet; + + /** + * The default value of the '{@link #getValidFor() Valid For}' attribute. + * + * + * @see #getValidFor() + * @generated + * @ordered + */ + protected static final String VALID_FOR_EDEFAULT = null; + + /** + * The cached value of the '{@link #getValidFor() Valid For}' attribute. + * + * + * @see #getValidFor() + * @generated + * @ordered + */ + @GwtTransient + protected String validFor = VALID_FOR_EDEFAULT; + + /** + * + * + * @generated + */ + protected ParameterValueImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.PARAMETER_VALUE; + } + + /** + * + * + * @generated + */ + @Override + public String getInstance() { + return instance; + } + + /** + * + * + * @generated + */ + @Override + public void setInstance(String newInstance) { + String oldInstance = instance; + instance = newInstance; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.PARAMETER_VALUE__INSTANCE, oldInstance, instance)); + } + + /** + * + * + * @generated + */ + @Override + public ResultType getResult() { + return result; + } + + /** + * + * + * @generated + */ + @Override + public void setResult(ResultType newResult) { + ResultType oldResult = result; + result = newResult == null ? RESULT_EDEFAULT : newResult; + boolean oldResultESet = resultESet; + resultESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.PARAMETER_VALUE__RESULT, oldResult, result, !oldResultESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetResult() { + ResultType oldResult = result; + boolean oldResultESet = resultESet; + result = RESULT_EDEFAULT; + resultESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.PARAMETER_VALUE__RESULT, oldResult, RESULT_EDEFAULT, oldResultESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetResult() { + return resultESet; + } + + /** + * + * + * @generated + */ + @Override + public String getValidFor() { + return validFor; + } + + /** + * + * + * @generated + */ + @Override + public void setValidFor(String newValidFor) { + String oldValidFor = validFor; + validFor = newValidFor; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.PARAMETER_VALUE__VALID_FOR, oldValidFor, validFor)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.PARAMETER_VALUE__INSTANCE: + return getInstance(); + case BpsimPackage.PARAMETER_VALUE__RESULT: + return getResult(); + case BpsimPackage.PARAMETER_VALUE__VALID_FOR: + return getValidFor(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.PARAMETER_VALUE__INSTANCE: + setInstance((String)newValue); + return; + case BpsimPackage.PARAMETER_VALUE__RESULT: + setResult((ResultType)newValue); + return; + case BpsimPackage.PARAMETER_VALUE__VALID_FOR: + setValidFor((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.PARAMETER_VALUE__INSTANCE: + setInstance(INSTANCE_EDEFAULT); + return; + case BpsimPackage.PARAMETER_VALUE__RESULT: + unsetResult(); + return; + case BpsimPackage.PARAMETER_VALUE__VALID_FOR: + setValidFor(VALID_FOR_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.PARAMETER_VALUE__INSTANCE: + return INSTANCE_EDEFAULT == null ? instance != null : !INSTANCE_EDEFAULT.equals(instance); + case BpsimPackage.PARAMETER_VALUE__RESULT: + return isSetResult(); + case BpsimPackage.PARAMETER_VALUE__VALID_FOR: + return VALID_FOR_EDEFAULT == null ? validFor != null : !VALID_FOR_EDEFAULT.equals(validFor); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (instance: "); + result.append(instance); + result.append(", result: "); + if (resultESet) result.append(result); else result.append(""); + result.append(", validFor: "); + result.append(validFor); + result.append(')'); + return result.toString(); + } + +} //ParameterValueImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/PoissonDistributionTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/PoissonDistributionTypeImpl.java new file mode 100644 index 00000000000..11c8daf2206 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/PoissonDistributionTypeImpl.java @@ -0,0 +1,204 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.PoissonDistributionType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Poisson Distribution Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.PoissonDistributionTypeImpl#getMean Mean}
  • + *
+ * + * @generated + */ +public class PoissonDistributionTypeImpl extends DistributionParameterImpl implements PoissonDistributionType { + /** + * The default value of the '{@link #getMean() Mean}' attribute. + * + * + * @see #getMean() + * @generated + * @ordered + */ + protected static final double MEAN_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getMean() Mean}' attribute. + * + * + * @see #getMean() + * @generated + * @ordered + */ + @GwtTransient + protected double mean = MEAN_EDEFAULT; + + /** + * This is true if the Mean attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean meanESet; + + /** + * + * + * @generated + */ + protected PoissonDistributionTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.POISSON_DISTRIBUTION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public double getMean() { + return mean; + } + + /** + * + * + * @generated + */ + @Override + public void setMean(double newMean) { + double oldMean = mean; + mean = newMean; + boolean oldMeanESet = meanESet; + meanESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.POISSON_DISTRIBUTION_TYPE__MEAN, oldMean, mean, !oldMeanESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetMean() { + double oldMean = mean; + boolean oldMeanESet = meanESet; + mean = MEAN_EDEFAULT; + meanESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.POISSON_DISTRIBUTION_TYPE__MEAN, oldMean, MEAN_EDEFAULT, oldMeanESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetMean() { + return meanESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.POISSON_DISTRIBUTION_TYPE__MEAN: + return getMean(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.POISSON_DISTRIBUTION_TYPE__MEAN: + setMean((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.POISSON_DISTRIBUTION_TYPE__MEAN: + unsetMean(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.POISSON_DISTRIBUTION_TYPE__MEAN: + return isSetMean(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (mean: "); + if (meanESet) result.append(mean); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //PoissonDistributionTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/PriorityParametersImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/PriorityParametersImpl.java new file mode 100644 index 00000000000..3c85eb69c05 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/PriorityParametersImpl.java @@ -0,0 +1,250 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.Parameter; +import bpsim.PriorityParameters; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Priority Parameters'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.PriorityParametersImpl#getInterruptible Interruptible}
  • + *
  • {@link bpsim.impl.PriorityParametersImpl#getPriority Priority}
  • + *
+ * + * @generated + */ +public class PriorityParametersImpl extends EObjectImpl implements PriorityParameters { + /** + * The cached value of the '{@link #getInterruptible() Interruptible}' containment reference. + * + * + * @see #getInterruptible() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter interruptible; + + /** + * The cached value of the '{@link #getPriority() Priority}' containment reference. + * + * + * @see #getPriority() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter priority; + + /** + * + * + * @generated + */ + protected PriorityParametersImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.PRIORITY_PARAMETERS; + } + + /** + * + * + * @generated + */ + @Override + public Parameter getInterruptible() { + return interruptible; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetInterruptible(Parameter newInterruptible, NotificationChain msgs) { + Parameter oldInterruptible = interruptible; + interruptible = newInterruptible; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.PRIORITY_PARAMETERS__INTERRUPTIBLE, oldInterruptible, newInterruptible); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setInterruptible(Parameter newInterruptible) { + if (newInterruptible != interruptible) { + NotificationChain msgs = null; + if (interruptible != null) + msgs = ((InternalEObject)interruptible).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.PRIORITY_PARAMETERS__INTERRUPTIBLE, null, msgs); + if (newInterruptible != null) + msgs = ((InternalEObject)newInterruptible).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.PRIORITY_PARAMETERS__INTERRUPTIBLE, null, msgs); + msgs = basicSetInterruptible(newInterruptible, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.PRIORITY_PARAMETERS__INTERRUPTIBLE, newInterruptible, newInterruptible)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getPriority() { + return priority; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetPriority(Parameter newPriority, NotificationChain msgs) { + Parameter oldPriority = priority; + priority = newPriority; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.PRIORITY_PARAMETERS__PRIORITY, oldPriority, newPriority); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setPriority(Parameter newPriority) { + if (newPriority != priority) { + NotificationChain msgs = null; + if (priority != null) + msgs = ((InternalEObject)priority).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.PRIORITY_PARAMETERS__PRIORITY, null, msgs); + if (newPriority != null) + msgs = ((InternalEObject)newPriority).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.PRIORITY_PARAMETERS__PRIORITY, null, msgs); + msgs = basicSetPriority(newPriority, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.PRIORITY_PARAMETERS__PRIORITY, newPriority, newPriority)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.PRIORITY_PARAMETERS__INTERRUPTIBLE: + return basicSetInterruptible(null, msgs); + case BpsimPackage.PRIORITY_PARAMETERS__PRIORITY: + return basicSetPriority(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.PRIORITY_PARAMETERS__INTERRUPTIBLE: + return getInterruptible(); + case BpsimPackage.PRIORITY_PARAMETERS__PRIORITY: + return getPriority(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.PRIORITY_PARAMETERS__INTERRUPTIBLE: + setInterruptible((Parameter)newValue); + return; + case BpsimPackage.PRIORITY_PARAMETERS__PRIORITY: + setPriority((Parameter)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.PRIORITY_PARAMETERS__INTERRUPTIBLE: + setInterruptible((Parameter)null); + return; + case BpsimPackage.PRIORITY_PARAMETERS__PRIORITY: + setPriority((Parameter)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.PRIORITY_PARAMETERS__INTERRUPTIBLE: + return interruptible != null; + case BpsimPackage.PRIORITY_PARAMETERS__PRIORITY: + return priority != null; + } + return super.eIsSet(featureID); + } + +} //PriorityParametersImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/PropertyParametersImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/PropertyParametersImpl.java new file mode 100644 index 00000000000..458ed8c1e6a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/PropertyParametersImpl.java @@ -0,0 +1,156 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.PropertyParameters; +import bpsim.PropertyType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Property Parameters'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.PropertyParametersImpl#getProperty Property}
  • + *
+ * + * @generated + */ +public class PropertyParametersImpl extends EObjectImpl implements PropertyParameters { + /** + * The cached value of the '{@link #getProperty() Property}' containment reference list. + * + * + * @see #getProperty() + * @generated + * @ordered + */ + @GwtTransient + protected EList property; + + /** + * + * + * @generated + */ + protected PropertyParametersImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.PROPERTY_PARAMETERS; + } + + /** + * + * + * @generated + */ + @Override + public EList getProperty() { + if (property == null) { + property = new EObjectContainmentEList(PropertyType.class, this, BpsimPackage.PROPERTY_PARAMETERS__PROPERTY); + } + return property; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.PROPERTY_PARAMETERS__PROPERTY: + return ((InternalEList)getProperty()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.PROPERTY_PARAMETERS__PROPERTY: + return getProperty(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.PROPERTY_PARAMETERS__PROPERTY: + getProperty().clear(); + getProperty().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.PROPERTY_PARAMETERS__PROPERTY: + getProperty().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.PROPERTY_PARAMETERS__PROPERTY: + return property != null && !property.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //PropertyParametersImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/PropertyTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/PropertyTypeImpl.java new file mode 100644 index 00000000000..be8540e581b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/PropertyTypeImpl.java @@ -0,0 +1,167 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.PropertyType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Property Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.PropertyTypeImpl#getName Name}
  • + *
+ * + * @generated + */ +public class PropertyTypeImpl extends ParameterImpl implements PropertyType { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected PropertyTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.PROPERTY_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.PROPERTY_TYPE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.PROPERTY_TYPE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.PROPERTY_TYPE__NAME: + setName((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.PROPERTY_TYPE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.PROPERTY_TYPE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //PropertyTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ResourceParametersImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ResourceParametersImpl.java new file mode 100644 index 00000000000..dbb8f70b417 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ResourceParametersImpl.java @@ -0,0 +1,365 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.Parameter; +import bpsim.ResourceParameters; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Resource Parameters'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.ResourceParametersImpl#getSelection Selection}
  • + *
  • {@link bpsim.impl.ResourceParametersImpl#getAvailability Availability}
  • + *
  • {@link bpsim.impl.ResourceParametersImpl#getQuantity Quantity}
  • + *
  • {@link bpsim.impl.ResourceParametersImpl#getRole Role}
  • + *
+ * + * @generated + */ +public class ResourceParametersImpl extends EObjectImpl implements ResourceParameters { + /** + * The cached value of the '{@link #getSelection() Selection}' containment reference. + * + * + * @see #getSelection() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter selection; + + /** + * The cached value of the '{@link #getAvailability() Availability}' containment reference. + * + * + * @see #getAvailability() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter availability; + + /** + * The cached value of the '{@link #getQuantity() Quantity}' containment reference. + * + * + * @see #getQuantity() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter quantity; + + /** + * The cached value of the '{@link #getRole() Role}' containment reference list. + * + * + * @see #getRole() + * @generated + * @ordered + */ + @GwtTransient + protected EList role; + + /** + * + * + * @generated + */ + protected ResourceParametersImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.RESOURCE_PARAMETERS; + } + + /** + * + * + * @generated + */ + @Override + public Parameter getSelection() { + return selection; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSelection(Parameter newSelection, NotificationChain msgs) { + Parameter oldSelection = selection; + selection = newSelection; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.RESOURCE_PARAMETERS__SELECTION, oldSelection, newSelection); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setSelection(Parameter newSelection) { + if (newSelection != selection) { + NotificationChain msgs = null; + if (selection != null) + msgs = ((InternalEObject)selection).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.RESOURCE_PARAMETERS__SELECTION, null, msgs); + if (newSelection != null) + msgs = ((InternalEObject)newSelection).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.RESOURCE_PARAMETERS__SELECTION, null, msgs); + msgs = basicSetSelection(newSelection, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.RESOURCE_PARAMETERS__SELECTION, newSelection, newSelection)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getAvailability() { + return availability; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetAvailability(Parameter newAvailability, NotificationChain msgs) { + Parameter oldAvailability = availability; + availability = newAvailability; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.RESOURCE_PARAMETERS__AVAILABILITY, oldAvailability, newAvailability); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setAvailability(Parameter newAvailability) { + if (newAvailability != availability) { + NotificationChain msgs = null; + if (availability != null) + msgs = ((InternalEObject)availability).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.RESOURCE_PARAMETERS__AVAILABILITY, null, msgs); + if (newAvailability != null) + msgs = ((InternalEObject)newAvailability).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.RESOURCE_PARAMETERS__AVAILABILITY, null, msgs); + msgs = basicSetAvailability(newAvailability, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.RESOURCE_PARAMETERS__AVAILABILITY, newAvailability, newAvailability)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getQuantity() { + return quantity; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetQuantity(Parameter newQuantity, NotificationChain msgs) { + Parameter oldQuantity = quantity; + quantity = newQuantity; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.RESOURCE_PARAMETERS__QUANTITY, oldQuantity, newQuantity); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setQuantity(Parameter newQuantity) { + if (newQuantity != quantity) { + NotificationChain msgs = null; + if (quantity != null) + msgs = ((InternalEObject)quantity).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.RESOURCE_PARAMETERS__QUANTITY, null, msgs); + if (newQuantity != null) + msgs = ((InternalEObject)newQuantity).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.RESOURCE_PARAMETERS__QUANTITY, null, msgs); + msgs = basicSetQuantity(newQuantity, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.RESOURCE_PARAMETERS__QUANTITY, newQuantity, newQuantity)); + } + + /** + * + * + * @generated + */ + @Override + public EList getRole() { + if (role == null) { + role = new EObjectContainmentEList(Parameter.class, this, BpsimPackage.RESOURCE_PARAMETERS__ROLE); + } + return role; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.RESOURCE_PARAMETERS__SELECTION: + return basicSetSelection(null, msgs); + case BpsimPackage.RESOURCE_PARAMETERS__AVAILABILITY: + return basicSetAvailability(null, msgs); + case BpsimPackage.RESOURCE_PARAMETERS__QUANTITY: + return basicSetQuantity(null, msgs); + case BpsimPackage.RESOURCE_PARAMETERS__ROLE: + return ((InternalEList)getRole()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.RESOURCE_PARAMETERS__SELECTION: + return getSelection(); + case BpsimPackage.RESOURCE_PARAMETERS__AVAILABILITY: + return getAvailability(); + case BpsimPackage.RESOURCE_PARAMETERS__QUANTITY: + return getQuantity(); + case BpsimPackage.RESOURCE_PARAMETERS__ROLE: + return getRole(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.RESOURCE_PARAMETERS__SELECTION: + setSelection((Parameter)newValue); + return; + case BpsimPackage.RESOURCE_PARAMETERS__AVAILABILITY: + setAvailability((Parameter)newValue); + return; + case BpsimPackage.RESOURCE_PARAMETERS__QUANTITY: + setQuantity((Parameter)newValue); + return; + case BpsimPackage.RESOURCE_PARAMETERS__ROLE: + getRole().clear(); + getRole().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.RESOURCE_PARAMETERS__SELECTION: + setSelection((Parameter)null); + return; + case BpsimPackage.RESOURCE_PARAMETERS__AVAILABILITY: + setAvailability((Parameter)null); + return; + case BpsimPackage.RESOURCE_PARAMETERS__QUANTITY: + setQuantity((Parameter)null); + return; + case BpsimPackage.RESOURCE_PARAMETERS__ROLE: + getRole().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.RESOURCE_PARAMETERS__SELECTION: + return selection != null; + case BpsimPackage.RESOURCE_PARAMETERS__AVAILABILITY: + return availability != null; + case BpsimPackage.RESOURCE_PARAMETERS__QUANTITY: + return quantity != null; + case BpsimPackage.RESOURCE_PARAMETERS__ROLE: + return role != null && !role.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //ResourceParametersImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ScenarioImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ScenarioImpl.java new file mode 100644 index 00000000000..33bd1b1dd47 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ScenarioImpl.java @@ -0,0 +1,892 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.Calendar; +import bpsim.ElementParameters; +import bpsim.Scenario; +import bpsim.ScenarioParameters; +import bpsim.VendorExtension; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import javax.xml.datatype.XMLGregorianCalendar; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Scenario'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.ScenarioImpl#getScenarioParameters Scenario Parameters}
  • + *
  • {@link bpsim.impl.ScenarioImpl#getElementParameters Element Parameters}
  • + *
  • {@link bpsim.impl.ScenarioImpl#getCalendar Calendar}
  • + *
  • {@link bpsim.impl.ScenarioImpl#getVendorExtension Vendor Extension}
  • + *
  • {@link bpsim.impl.ScenarioImpl#getAuthor Author}
  • + *
  • {@link bpsim.impl.ScenarioImpl#getCreated Created}
  • + *
  • {@link bpsim.impl.ScenarioImpl#getDescription Description}
  • + *
  • {@link bpsim.impl.ScenarioImpl#getId Id}
  • + *
  • {@link bpsim.impl.ScenarioImpl#getInherits Inherits}
  • + *
  • {@link bpsim.impl.ScenarioImpl#getModified Modified}
  • + *
  • {@link bpsim.impl.ScenarioImpl#getName Name}
  • + *
  • {@link bpsim.impl.ScenarioImpl#getResult Result}
  • + *
  • {@link bpsim.impl.ScenarioImpl#getVendor Vendor}
  • + *
  • {@link bpsim.impl.ScenarioImpl#getVersion Version}
  • + *
+ * + * @generated + */ +public class ScenarioImpl extends EObjectImpl implements Scenario { + /** + * The cached value of the '{@link #getScenarioParameters() Scenario Parameters}' containment reference. + * + * + * @see #getScenarioParameters() + * @generated + * @ordered + */ + @GwtTransient + protected ScenarioParameters scenarioParameters; + + /** + * The cached value of the '{@link #getElementParameters() Element Parameters}' containment reference list. + * + * + * @see #getElementParameters() + * @generated + * @ordered + */ + @GwtTransient + protected EList elementParameters; + + /** + * The cached value of the '{@link #getCalendar() Calendar}' containment reference list. + * + * + * @see #getCalendar() + * @generated + * @ordered + */ + @GwtTransient + protected EList calendar; + + /** + * The cached value of the '{@link #getVendorExtension() Vendor Extension}' containment reference list. + * + * + * @see #getVendorExtension() + * @generated + * @ordered + */ + @GwtTransient + protected EList vendorExtension; + + /** + * The default value of the '{@link #getAuthor() Author}' attribute. + * + * + * @see #getAuthor() + * @generated + * @ordered + */ + protected static final String AUTHOR_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAuthor() Author}' attribute. + * + * + * @see #getAuthor() + * @generated + * @ordered + */ + @GwtTransient + protected String author = AUTHOR_EDEFAULT; + + /** + * The default value of the '{@link #getCreated() Created}' attribute. + * + * + * @see #getCreated() + * @generated + * @ordered + */ + protected static final XMLGregorianCalendar CREATED_EDEFAULT = null; + + /** + * The cached value of the '{@link #getCreated() Created}' attribute. + * + * + * @see #getCreated() + * @generated + * @ordered + */ + @GwtTransient + protected XMLGregorianCalendar created = CREATED_EDEFAULT; + + /** + * The default value of the '{@link #getDescription() Description}' attribute. + * + * + * @see #getDescription() + * @generated + * @ordered + */ + protected static final String DESCRIPTION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDescription() Description}' attribute. + * + * + * @see #getDescription() + * @generated + * @ordered + */ + @GwtTransient + protected String description = DESCRIPTION_EDEFAULT; + + /** + * The default value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + protected static final String ID_EDEFAULT = null; + + /** + * The cached value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + @GwtTransient + protected String id = ID_EDEFAULT; + + /** + * The default value of the '{@link #getInherits() Inherits}' attribute. + * + * + * @see #getInherits() + * @generated + * @ordered + */ + protected static final String INHERITS_EDEFAULT = null; + + /** + * The cached value of the '{@link #getInherits() Inherits}' attribute. + * + * + * @see #getInherits() + * @generated + * @ordered + */ + @GwtTransient + protected String inherits = INHERITS_EDEFAULT; + + /** + * The default value of the '{@link #getModified() Modified}' attribute. + * + * + * @see #getModified() + * @generated + * @ordered + */ + protected static final XMLGregorianCalendar MODIFIED_EDEFAULT = null; + + /** + * The cached value of the '{@link #getModified() Modified}' attribute. + * + * + * @see #getModified() + * @generated + * @ordered + */ + @GwtTransient + protected XMLGregorianCalendar modified = MODIFIED_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getResult() Result}' attribute. + * + * + * @see #getResult() + * @generated + * @ordered + */ + protected static final String RESULT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getResult() Result}' attribute. + * + * + * @see #getResult() + * @generated + * @ordered + */ + @GwtTransient + protected String result = RESULT_EDEFAULT; + + /** + * The default value of the '{@link #getVendor() Vendor}' attribute. + * + * + * @see #getVendor() + * @generated + * @ordered + */ + protected static final String VENDOR_EDEFAULT = null; + + /** + * The cached value of the '{@link #getVendor() Vendor}' attribute. + * + * + * @see #getVendor() + * @generated + * @ordered + */ + @GwtTransient + protected String vendor = VENDOR_EDEFAULT; + + /** + * The default value of the '{@link #getVersion() Version}' attribute. + * + * + * @see #getVersion() + * @generated + * @ordered + */ + protected static final String VERSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getVersion() Version}' attribute. + * + * + * @see #getVersion() + * @generated + * @ordered + */ + @GwtTransient + protected String version = VERSION_EDEFAULT; + + /** + * + * + * @generated + */ + protected ScenarioImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.SCENARIO; + } + + /** + * + * + * @generated + */ + @Override + public ScenarioParameters getScenarioParameters() { + return scenarioParameters; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetScenarioParameters(ScenarioParameters newScenarioParameters, NotificationChain msgs) { + ScenarioParameters oldScenarioParameters = scenarioParameters; + scenarioParameters = newScenarioParameters; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__SCENARIO_PARAMETERS, oldScenarioParameters, newScenarioParameters); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setScenarioParameters(ScenarioParameters newScenarioParameters) { + if (newScenarioParameters != scenarioParameters) { + NotificationChain msgs = null; + if (scenarioParameters != null) + msgs = ((InternalEObject)scenarioParameters).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO__SCENARIO_PARAMETERS, null, msgs); + if (newScenarioParameters != null) + msgs = ((InternalEObject)newScenarioParameters).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO__SCENARIO_PARAMETERS, null, msgs); + msgs = basicSetScenarioParameters(newScenarioParameters, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__SCENARIO_PARAMETERS, newScenarioParameters, newScenarioParameters)); + } + + /** + * + * + * @generated + */ + @Override + public EList getElementParameters() { + if (elementParameters == null) { + elementParameters = new EObjectContainmentEList(ElementParameters.class, this, BpsimPackage.SCENARIO__ELEMENT_PARAMETERS); + } + return elementParameters; + } + + /** + * + * + * @generated + */ + @Override + public EList getCalendar() { + if (calendar == null) { + calendar = new EObjectContainmentEList(Calendar.class, this, BpsimPackage.SCENARIO__CALENDAR); + } + return calendar; + } + + /** + * + * + * @generated + */ + @Override + public EList getVendorExtension() { + if (vendorExtension == null) { + vendorExtension = new EObjectContainmentEList(VendorExtension.class, this, BpsimPackage.SCENARIO__VENDOR_EXTENSION); + } + return vendorExtension; + } + + /** + * + * + * @generated + */ + @Override + public String getAuthor() { + return author; + } + + /** + * + * + * @generated + */ + @Override + public void setAuthor(String newAuthor) { + String oldAuthor = author; + author = newAuthor; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__AUTHOR, oldAuthor, author)); + } + + /** + * + * + * @generated + */ + @Override + public XMLGregorianCalendar getCreated() { + return created; + } + + /** + * + * + * @generated + */ + @Override + public void setCreated(XMLGregorianCalendar newCreated) { + XMLGregorianCalendar oldCreated = created; + created = newCreated; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__CREATED, oldCreated, created)); + } + + /** + * + * + * @generated + */ + @Override + public String getDescription() { + return description; + } + + /** + * + * + * @generated + */ + @Override + public void setDescription(String newDescription) { + String oldDescription = description; + description = newDescription; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__DESCRIPTION, oldDescription, description)); + } + + /** + * + * + * @generated + */ + @Override + public String getId() { + return id; + } + + /** + * + * + * @generated + */ + @Override + public void setId(String newId) { + String oldId = id; + id = newId; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__ID, oldId, id)); + } + + /** + * + * + * @generated + */ + @Override + public String getInherits() { + return inherits; + } + + /** + * + * + * @generated + */ + @Override + public void setInherits(String newInherits) { + String oldInherits = inherits; + inherits = newInherits; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__INHERITS, oldInherits, inherits)); + } + + /** + * + * + * @generated + */ + @Override + public XMLGregorianCalendar getModified() { + return modified; + } + + /** + * + * + * @generated + */ + @Override + public void setModified(XMLGregorianCalendar newModified) { + XMLGregorianCalendar oldModified = modified; + modified = newModified; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__MODIFIED, oldModified, modified)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public String getResult() { + return result; + } + + /** + * + * + * @generated + */ + @Override + public void setResult(String newResult) { + String oldResult = result; + result = newResult; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__RESULT, oldResult, result)); + } + + /** + * + * + * @generated + */ + @Override + public String getVendor() { + return vendor; + } + + /** + * + * + * @generated + */ + @Override + public void setVendor(String newVendor) { + String oldVendor = vendor; + vendor = newVendor; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__VENDOR, oldVendor, vendor)); + } + + /** + * + * + * @generated + */ + @Override + public String getVersion() { + return version; + } + + /** + * + * + * @generated + */ + @Override + public void setVersion(String newVersion) { + String oldVersion = version; + version = newVersion; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__VERSION, oldVersion, version)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS: + return basicSetScenarioParameters(null, msgs); + case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS: + return ((InternalEList)getElementParameters()).basicRemove(otherEnd, msgs); + case BpsimPackage.SCENARIO__CALENDAR: + return ((InternalEList)getCalendar()).basicRemove(otherEnd, msgs); + case BpsimPackage.SCENARIO__VENDOR_EXTENSION: + return ((InternalEList)getVendorExtension()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS: + return getScenarioParameters(); + case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS: + return getElementParameters(); + case BpsimPackage.SCENARIO__CALENDAR: + return getCalendar(); + case BpsimPackage.SCENARIO__VENDOR_EXTENSION: + return getVendorExtension(); + case BpsimPackage.SCENARIO__AUTHOR: + return getAuthor(); + case BpsimPackage.SCENARIO__CREATED: + return getCreated(); + case BpsimPackage.SCENARIO__DESCRIPTION: + return getDescription(); + case BpsimPackage.SCENARIO__ID: + return getId(); + case BpsimPackage.SCENARIO__INHERITS: + return getInherits(); + case BpsimPackage.SCENARIO__MODIFIED: + return getModified(); + case BpsimPackage.SCENARIO__NAME: + return getName(); + case BpsimPackage.SCENARIO__RESULT: + return getResult(); + case BpsimPackage.SCENARIO__VENDOR: + return getVendor(); + case BpsimPackage.SCENARIO__VERSION: + return getVersion(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS: + setScenarioParameters((ScenarioParameters)newValue); + return; + case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS: + getElementParameters().clear(); + getElementParameters().addAll((Collection)newValue); + return; + case BpsimPackage.SCENARIO__CALENDAR: + getCalendar().clear(); + getCalendar().addAll((Collection)newValue); + return; + case BpsimPackage.SCENARIO__VENDOR_EXTENSION: + getVendorExtension().clear(); + getVendorExtension().addAll((Collection)newValue); + return; + case BpsimPackage.SCENARIO__AUTHOR: + setAuthor((String)newValue); + return; + case BpsimPackage.SCENARIO__CREATED: + setCreated((XMLGregorianCalendar)newValue); + return; + case BpsimPackage.SCENARIO__DESCRIPTION: + setDescription((String)newValue); + return; + case BpsimPackage.SCENARIO__ID: + setId((String)newValue); + return; + case BpsimPackage.SCENARIO__INHERITS: + setInherits((String)newValue); + return; + case BpsimPackage.SCENARIO__MODIFIED: + setModified((XMLGregorianCalendar)newValue); + return; + case BpsimPackage.SCENARIO__NAME: + setName((String)newValue); + return; + case BpsimPackage.SCENARIO__RESULT: + setResult((String)newValue); + return; + case BpsimPackage.SCENARIO__VENDOR: + setVendor((String)newValue); + return; + case BpsimPackage.SCENARIO__VERSION: + setVersion((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS: + setScenarioParameters((ScenarioParameters)null); + return; + case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS: + getElementParameters().clear(); + return; + case BpsimPackage.SCENARIO__CALENDAR: + getCalendar().clear(); + return; + case BpsimPackage.SCENARIO__VENDOR_EXTENSION: + getVendorExtension().clear(); + return; + case BpsimPackage.SCENARIO__AUTHOR: + setAuthor(AUTHOR_EDEFAULT); + return; + case BpsimPackage.SCENARIO__CREATED: + setCreated(CREATED_EDEFAULT); + return; + case BpsimPackage.SCENARIO__DESCRIPTION: + setDescription(DESCRIPTION_EDEFAULT); + return; + case BpsimPackage.SCENARIO__ID: + setId(ID_EDEFAULT); + return; + case BpsimPackage.SCENARIO__INHERITS: + setInherits(INHERITS_EDEFAULT); + return; + case BpsimPackage.SCENARIO__MODIFIED: + setModified(MODIFIED_EDEFAULT); + return; + case BpsimPackage.SCENARIO__NAME: + setName(NAME_EDEFAULT); + return; + case BpsimPackage.SCENARIO__RESULT: + setResult(RESULT_EDEFAULT); + return; + case BpsimPackage.SCENARIO__VENDOR: + setVendor(VENDOR_EDEFAULT); + return; + case BpsimPackage.SCENARIO__VERSION: + setVersion(VERSION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS: + return scenarioParameters != null; + case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS: + return elementParameters != null && !elementParameters.isEmpty(); + case BpsimPackage.SCENARIO__CALENDAR: + return calendar != null && !calendar.isEmpty(); + case BpsimPackage.SCENARIO__VENDOR_EXTENSION: + return vendorExtension != null && !vendorExtension.isEmpty(); + case BpsimPackage.SCENARIO__AUTHOR: + return AUTHOR_EDEFAULT == null ? author != null : !AUTHOR_EDEFAULT.equals(author); + case BpsimPackage.SCENARIO__CREATED: + return CREATED_EDEFAULT == null ? created != null : !CREATED_EDEFAULT.equals(created); + case BpsimPackage.SCENARIO__DESCRIPTION: + return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); + case BpsimPackage.SCENARIO__ID: + return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); + case BpsimPackage.SCENARIO__INHERITS: + return INHERITS_EDEFAULT == null ? inherits != null : !INHERITS_EDEFAULT.equals(inherits); + case BpsimPackage.SCENARIO__MODIFIED: + return MODIFIED_EDEFAULT == null ? modified != null : !MODIFIED_EDEFAULT.equals(modified); + case BpsimPackage.SCENARIO__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case BpsimPackage.SCENARIO__RESULT: + return RESULT_EDEFAULT == null ? result != null : !RESULT_EDEFAULT.equals(result); + case BpsimPackage.SCENARIO__VENDOR: + return VENDOR_EDEFAULT == null ? vendor != null : !VENDOR_EDEFAULT.equals(vendor); + case BpsimPackage.SCENARIO__VERSION: + return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (author: "); + result.append(author); + result.append(", created: "); + result.append(created); + result.append(", description: "); + result.append(description); + result.append(", id: "); + result.append(id); + result.append(", inherits: "); + result.append(inherits); + result.append(", modified: "); + result.append(modified); + result.append(", name: "); + result.append(name); + result.append(", result: "); + result.append(result); + result.append(", vendor: "); + result.append(vendor); + result.append(", version: "); + result.append(version); + result.append(')'); + return result.toString(); + } + +} //ScenarioImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ScenarioParametersImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ScenarioParametersImpl.java new file mode 100644 index 00000000000..fbdcdeeced3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ScenarioParametersImpl.java @@ -0,0 +1,674 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.Parameter; +import bpsim.PropertyParameters; +import bpsim.ScenarioParameters; +import bpsim.TimeUnit; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Scenario Parameters'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.ScenarioParametersImpl#getStart Start}
  • + *
  • {@link bpsim.impl.ScenarioParametersImpl#getDuration Duration}
  • + *
  • {@link bpsim.impl.ScenarioParametersImpl#getPropertyParameters Property Parameters}
  • + *
  • {@link bpsim.impl.ScenarioParametersImpl#getBaseCurrencyUnit Base Currency Unit}
  • + *
  • {@link bpsim.impl.ScenarioParametersImpl#getBaseTimeUnit Base Time Unit}
  • + *
  • {@link bpsim.impl.ScenarioParametersImpl#getReplication Replication}
  • + *
  • {@link bpsim.impl.ScenarioParametersImpl#getSeed Seed}
  • + *
+ * + * @generated + */ +public class ScenarioParametersImpl extends EObjectImpl implements ScenarioParameters { + /** + * The cached value of the '{@link #getStart() Start}' containment reference. + * + * + * @see #getStart() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter start; + + /** + * The cached value of the '{@link #getDuration() Duration}' containment reference. + * + * + * @see #getDuration() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter duration; + + /** + * The cached value of the '{@link #getPropertyParameters() Property Parameters}' containment reference. + * + * + * @see #getPropertyParameters() + * @generated + * @ordered + */ + @GwtTransient + protected PropertyParameters propertyParameters; + + /** + * The default value of the '{@link #getBaseCurrencyUnit() Base Currency Unit}' attribute. + * + * + * @see #getBaseCurrencyUnit() + * @generated + * @ordered + */ + protected static final String BASE_CURRENCY_UNIT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getBaseCurrencyUnit() Base Currency Unit}' attribute. + * + * + * @see #getBaseCurrencyUnit() + * @generated + * @ordered + */ + @GwtTransient + protected String baseCurrencyUnit = BASE_CURRENCY_UNIT_EDEFAULT; + + /** + * The default value of the '{@link #getBaseTimeUnit() Base Time Unit}' attribute. + * + * + * @see #getBaseTimeUnit() + * @generated + * @ordered + */ + protected static final TimeUnit BASE_TIME_UNIT_EDEFAULT = TimeUnit.MS; + + /** + * The cached value of the '{@link #getBaseTimeUnit() Base Time Unit}' attribute. + * + * + * @see #getBaseTimeUnit() + * @generated + * @ordered + */ + @GwtTransient + protected TimeUnit baseTimeUnit = BASE_TIME_UNIT_EDEFAULT; + + /** + * This is true if the Base Time Unit attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean baseTimeUnitESet; + + /** + * The default value of the '{@link #getReplication() Replication}' attribute. + * + * + * @see #getReplication() + * @generated + * @ordered + */ + protected static final int REPLICATION_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getReplication() Replication}' attribute. + * + * + * @see #getReplication() + * @generated + * @ordered + */ + @GwtTransient + protected int replication = REPLICATION_EDEFAULT; + + /** + * This is true if the Replication attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean replicationESet; + + /** + * The default value of the '{@link #getSeed() Seed}' attribute. + * + * + * @see #getSeed() + * @generated + * @ordered + */ + protected static final long SEED_EDEFAULT = 0L; + + /** + * The cached value of the '{@link #getSeed() Seed}' attribute. + * + * + * @see #getSeed() + * @generated + * @ordered + */ + @GwtTransient + protected long seed = SEED_EDEFAULT; + + /** + * This is true if the Seed attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean seedESet; + + /** + * + * + * @generated + */ + protected ScenarioParametersImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.SCENARIO_PARAMETERS; + } + + /** + * + * + * @generated + */ + @Override + public Parameter getStart() { + return start; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetStart(Parameter newStart, NotificationChain msgs) { + Parameter oldStart = start; + start = newStart; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO_PARAMETERS__START, oldStart, newStart); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setStart(Parameter newStart) { + if (newStart != start) { + NotificationChain msgs = null; + if (start != null) + msgs = ((InternalEObject)start).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO_PARAMETERS__START, null, msgs); + if (newStart != null) + msgs = ((InternalEObject)newStart).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO_PARAMETERS__START, null, msgs); + msgs = basicSetStart(newStart, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO_PARAMETERS__START, newStart, newStart)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getDuration() { + return duration; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDuration(Parameter newDuration, NotificationChain msgs) { + Parameter oldDuration = duration; + duration = newDuration; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO_PARAMETERS__DURATION, oldDuration, newDuration); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setDuration(Parameter newDuration) { + if (newDuration != duration) { + NotificationChain msgs = null; + if (duration != null) + msgs = ((InternalEObject)duration).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO_PARAMETERS__DURATION, null, msgs); + if (newDuration != null) + msgs = ((InternalEObject)newDuration).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO_PARAMETERS__DURATION, null, msgs); + msgs = basicSetDuration(newDuration, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO_PARAMETERS__DURATION, newDuration, newDuration)); + } + + /** + * + * + * @generated + */ + @Override + public PropertyParameters getPropertyParameters() { + return propertyParameters; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetPropertyParameters(PropertyParameters newPropertyParameters, NotificationChain msgs) { + PropertyParameters oldPropertyParameters = propertyParameters; + propertyParameters = newPropertyParameters; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO_PARAMETERS__PROPERTY_PARAMETERS, oldPropertyParameters, newPropertyParameters); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setPropertyParameters(PropertyParameters newPropertyParameters) { + if (newPropertyParameters != propertyParameters) { + NotificationChain msgs = null; + if (propertyParameters != null) + msgs = ((InternalEObject)propertyParameters).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO_PARAMETERS__PROPERTY_PARAMETERS, null, msgs); + if (newPropertyParameters != null) + msgs = ((InternalEObject)newPropertyParameters).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO_PARAMETERS__PROPERTY_PARAMETERS, null, msgs); + msgs = basicSetPropertyParameters(newPropertyParameters, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO_PARAMETERS__PROPERTY_PARAMETERS, newPropertyParameters, newPropertyParameters)); + } + + /** + * + * + * @generated + */ + @Override + public String getBaseCurrencyUnit() { + return baseCurrencyUnit; + } + + /** + * + * + * @generated + */ + @Override + public void setBaseCurrencyUnit(String newBaseCurrencyUnit) { + String oldBaseCurrencyUnit = baseCurrencyUnit; + baseCurrencyUnit = newBaseCurrencyUnit; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO_PARAMETERS__BASE_CURRENCY_UNIT, oldBaseCurrencyUnit, baseCurrencyUnit)); + } + + /** + * + * + * @generated + */ + @Override + public TimeUnit getBaseTimeUnit() { + return baseTimeUnit; + } + + /** + * + * + * @generated + */ + @Override + public void setBaseTimeUnit(TimeUnit newBaseTimeUnit) { + TimeUnit oldBaseTimeUnit = baseTimeUnit; + baseTimeUnit = newBaseTimeUnit == null ? BASE_TIME_UNIT_EDEFAULT : newBaseTimeUnit; + boolean oldBaseTimeUnitESet = baseTimeUnitESet; + baseTimeUnitESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO_PARAMETERS__BASE_TIME_UNIT, oldBaseTimeUnit, baseTimeUnit, !oldBaseTimeUnitESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetBaseTimeUnit() { + TimeUnit oldBaseTimeUnit = baseTimeUnit; + boolean oldBaseTimeUnitESet = baseTimeUnitESet; + baseTimeUnit = BASE_TIME_UNIT_EDEFAULT; + baseTimeUnitESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.SCENARIO_PARAMETERS__BASE_TIME_UNIT, oldBaseTimeUnit, BASE_TIME_UNIT_EDEFAULT, oldBaseTimeUnitESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetBaseTimeUnit() { + return baseTimeUnitESet; + } + + /** + * + * + * @generated + */ + @Override + public int getReplication() { + return replication; + } + + /** + * + * + * @generated + */ + @Override + public void setReplication(int newReplication) { + int oldReplication = replication; + replication = newReplication; + boolean oldReplicationESet = replicationESet; + replicationESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO_PARAMETERS__REPLICATION, oldReplication, replication, !oldReplicationESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetReplication() { + int oldReplication = replication; + boolean oldReplicationESet = replicationESet; + replication = REPLICATION_EDEFAULT; + replicationESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.SCENARIO_PARAMETERS__REPLICATION, oldReplication, REPLICATION_EDEFAULT, oldReplicationESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetReplication() { + return replicationESet; + } + + /** + * + * + * @generated + */ + @Override + public long getSeed() { + return seed; + } + + /** + * + * + * @generated + */ + @Override + public void setSeed(long newSeed) { + long oldSeed = seed; + seed = newSeed; + boolean oldSeedESet = seedESet; + seedESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO_PARAMETERS__SEED, oldSeed, seed, !oldSeedESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetSeed() { + long oldSeed = seed; + boolean oldSeedESet = seedESet; + seed = SEED_EDEFAULT; + seedESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.SCENARIO_PARAMETERS__SEED, oldSeed, SEED_EDEFAULT, oldSeedESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetSeed() { + return seedESet; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.SCENARIO_PARAMETERS__START: + return basicSetStart(null, msgs); + case BpsimPackage.SCENARIO_PARAMETERS__DURATION: + return basicSetDuration(null, msgs); + case BpsimPackage.SCENARIO_PARAMETERS__PROPERTY_PARAMETERS: + return basicSetPropertyParameters(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.SCENARIO_PARAMETERS__START: + return getStart(); + case BpsimPackage.SCENARIO_PARAMETERS__DURATION: + return getDuration(); + case BpsimPackage.SCENARIO_PARAMETERS__PROPERTY_PARAMETERS: + return getPropertyParameters(); + case BpsimPackage.SCENARIO_PARAMETERS__BASE_CURRENCY_UNIT: + return getBaseCurrencyUnit(); + case BpsimPackage.SCENARIO_PARAMETERS__BASE_TIME_UNIT: + return getBaseTimeUnit(); + case BpsimPackage.SCENARIO_PARAMETERS__REPLICATION: + return getReplication(); + case BpsimPackage.SCENARIO_PARAMETERS__SEED: + return getSeed(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.SCENARIO_PARAMETERS__START: + setStart((Parameter)newValue); + return; + case BpsimPackage.SCENARIO_PARAMETERS__DURATION: + setDuration((Parameter)newValue); + return; + case BpsimPackage.SCENARIO_PARAMETERS__PROPERTY_PARAMETERS: + setPropertyParameters((PropertyParameters)newValue); + return; + case BpsimPackage.SCENARIO_PARAMETERS__BASE_CURRENCY_UNIT: + setBaseCurrencyUnit((String)newValue); + return; + case BpsimPackage.SCENARIO_PARAMETERS__BASE_TIME_UNIT: + setBaseTimeUnit((TimeUnit)newValue); + return; + case BpsimPackage.SCENARIO_PARAMETERS__REPLICATION: + setReplication((Integer)newValue); + return; + case BpsimPackage.SCENARIO_PARAMETERS__SEED: + setSeed((Long)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.SCENARIO_PARAMETERS__START: + setStart((Parameter)null); + return; + case BpsimPackage.SCENARIO_PARAMETERS__DURATION: + setDuration((Parameter)null); + return; + case BpsimPackage.SCENARIO_PARAMETERS__PROPERTY_PARAMETERS: + setPropertyParameters((PropertyParameters)null); + return; + case BpsimPackage.SCENARIO_PARAMETERS__BASE_CURRENCY_UNIT: + setBaseCurrencyUnit(BASE_CURRENCY_UNIT_EDEFAULT); + return; + case BpsimPackage.SCENARIO_PARAMETERS__BASE_TIME_UNIT: + unsetBaseTimeUnit(); + return; + case BpsimPackage.SCENARIO_PARAMETERS__REPLICATION: + unsetReplication(); + return; + case BpsimPackage.SCENARIO_PARAMETERS__SEED: + unsetSeed(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.SCENARIO_PARAMETERS__START: + return start != null; + case BpsimPackage.SCENARIO_PARAMETERS__DURATION: + return duration != null; + case BpsimPackage.SCENARIO_PARAMETERS__PROPERTY_PARAMETERS: + return propertyParameters != null; + case BpsimPackage.SCENARIO_PARAMETERS__BASE_CURRENCY_UNIT: + return BASE_CURRENCY_UNIT_EDEFAULT == null ? baseCurrencyUnit != null : !BASE_CURRENCY_UNIT_EDEFAULT.equals(baseCurrencyUnit); + case BpsimPackage.SCENARIO_PARAMETERS__BASE_TIME_UNIT: + return isSetBaseTimeUnit(); + case BpsimPackage.SCENARIO_PARAMETERS__REPLICATION: + return isSetReplication(); + case BpsimPackage.SCENARIO_PARAMETERS__SEED: + return isSetSeed(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (baseCurrencyUnit: "); + result.append(baseCurrencyUnit); + result.append(", baseTimeUnit: "); + if (baseTimeUnitESet) result.append(baseTimeUnit); else result.append(""); + result.append(", replication: "); + if (replicationESet) result.append(replication); else result.append(""); + result.append(", seed: "); + if (seedESet) result.append(seed); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //ScenarioParametersImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ScenarioParametersTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ScenarioParametersTypeImpl.java new file mode 100644 index 00000000000..96552f698a0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/ScenarioParametersTypeImpl.java @@ -0,0 +1,37 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.ScenarioParametersType; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Scenario Parameters Type'. + * + * + * @generated + */ +public class ScenarioParametersTypeImpl extends ScenarioParametersImpl implements ScenarioParametersType { + /** + * + * + * @generated + */ + protected ScenarioParametersTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.SCENARIO_PARAMETERS_TYPE; + } + +} //ScenarioParametersTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/StringParameterTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/StringParameterTypeImpl.java new file mode 100644 index 00000000000..4c6590544b9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/StringParameterTypeImpl.java @@ -0,0 +1,167 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.StringParameterType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'String Parameter Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.StringParameterTypeImpl#getValue Value}
  • + *
+ * + * @generated + */ +public class StringParameterTypeImpl extends ConstantParameterImpl implements StringParameterType { + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final String VALUE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + @GwtTransient + protected String value = VALUE_EDEFAULT; + + /** + * + * + * @generated + */ + protected StringParameterTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.STRING_PARAMETER_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public String getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public void setValue(String newValue) { + String oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.STRING_PARAMETER_TYPE__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.STRING_PARAMETER_TYPE__VALUE: + return getValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.STRING_PARAMETER_TYPE__VALUE: + setValue((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.STRING_PARAMETER_TYPE__VALUE: + setValue(VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.STRING_PARAMETER_TYPE__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (value: "); + result.append(value); + result.append(')'); + return result.toString(); + } + +} //StringParameterTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/TimeParametersImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/TimeParametersImpl.java new file mode 100644 index 00000000000..83dffc938b3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/TimeParametersImpl.java @@ -0,0 +1,595 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.Parameter; +import bpsim.TimeParameters; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Time Parameters'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.TimeParametersImpl#getTransferTime Transfer Time}
  • + *
  • {@link bpsim.impl.TimeParametersImpl#getQueueTime Queue Time}
  • + *
  • {@link bpsim.impl.TimeParametersImpl#getWaitTime Wait Time}
  • + *
  • {@link bpsim.impl.TimeParametersImpl#getSetUpTime Set Up Time}
  • + *
  • {@link bpsim.impl.TimeParametersImpl#getProcessingTime Processing Time}
  • + *
  • {@link bpsim.impl.TimeParametersImpl#getValidationTime Validation Time}
  • + *
  • {@link bpsim.impl.TimeParametersImpl#getReworkTime Rework Time}
  • + *
+ * + * @generated + */ +public class TimeParametersImpl extends EObjectImpl implements TimeParameters { + /** + * The cached value of the '{@link #getTransferTime() Transfer Time}' containment reference. + * + * + * @see #getTransferTime() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter transferTime; + + /** + * The cached value of the '{@link #getQueueTime() Queue Time}' containment reference. + * + * + * @see #getQueueTime() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter queueTime; + + /** + * The cached value of the '{@link #getWaitTime() Wait Time}' containment reference. + * + * + * @see #getWaitTime() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter waitTime; + + /** + * The cached value of the '{@link #getSetUpTime() Set Up Time}' containment reference. + * + * + * @see #getSetUpTime() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter setUpTime; + + /** + * The cached value of the '{@link #getProcessingTime() Processing Time}' containment reference. + * + * + * @see #getProcessingTime() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter processingTime; + + /** + * The cached value of the '{@link #getValidationTime() Validation Time}' containment reference. + * + * + * @see #getValidationTime() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter validationTime; + + /** + * The cached value of the '{@link #getReworkTime() Rework Time}' containment reference. + * + * + * @see #getReworkTime() + * @generated + * @ordered + */ + @GwtTransient + protected Parameter reworkTime; + + /** + * + * + * @generated + */ + protected TimeParametersImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.TIME_PARAMETERS; + } + + /** + * + * + * @generated + */ + @Override + public Parameter getTransferTime() { + return transferTime; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTransferTime(Parameter newTransferTime, NotificationChain msgs) { + Parameter oldTransferTime = transferTime; + transferTime = newTransferTime; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__TRANSFER_TIME, oldTransferTime, newTransferTime); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setTransferTime(Parameter newTransferTime) { + if (newTransferTime != transferTime) { + NotificationChain msgs = null; + if (transferTime != null) + msgs = ((InternalEObject)transferTime).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__TRANSFER_TIME, null, msgs); + if (newTransferTime != null) + msgs = ((InternalEObject)newTransferTime).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__TRANSFER_TIME, null, msgs); + msgs = basicSetTransferTime(newTransferTime, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__TRANSFER_TIME, newTransferTime, newTransferTime)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getQueueTime() { + return queueTime; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetQueueTime(Parameter newQueueTime, NotificationChain msgs) { + Parameter oldQueueTime = queueTime; + queueTime = newQueueTime; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__QUEUE_TIME, oldQueueTime, newQueueTime); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setQueueTime(Parameter newQueueTime) { + if (newQueueTime != queueTime) { + NotificationChain msgs = null; + if (queueTime != null) + msgs = ((InternalEObject)queueTime).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__QUEUE_TIME, null, msgs); + if (newQueueTime != null) + msgs = ((InternalEObject)newQueueTime).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__QUEUE_TIME, null, msgs); + msgs = basicSetQueueTime(newQueueTime, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__QUEUE_TIME, newQueueTime, newQueueTime)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getWaitTime() { + return waitTime; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetWaitTime(Parameter newWaitTime, NotificationChain msgs) { + Parameter oldWaitTime = waitTime; + waitTime = newWaitTime; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__WAIT_TIME, oldWaitTime, newWaitTime); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setWaitTime(Parameter newWaitTime) { + if (newWaitTime != waitTime) { + NotificationChain msgs = null; + if (waitTime != null) + msgs = ((InternalEObject)waitTime).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__WAIT_TIME, null, msgs); + if (newWaitTime != null) + msgs = ((InternalEObject)newWaitTime).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__WAIT_TIME, null, msgs); + msgs = basicSetWaitTime(newWaitTime, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__WAIT_TIME, newWaitTime, newWaitTime)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getSetUpTime() { + return setUpTime; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSetUpTime(Parameter newSetUpTime, NotificationChain msgs) { + Parameter oldSetUpTime = setUpTime; + setUpTime = newSetUpTime; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__SET_UP_TIME, oldSetUpTime, newSetUpTime); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setSetUpTime(Parameter newSetUpTime) { + if (newSetUpTime != setUpTime) { + NotificationChain msgs = null; + if (setUpTime != null) + msgs = ((InternalEObject)setUpTime).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__SET_UP_TIME, null, msgs); + if (newSetUpTime != null) + msgs = ((InternalEObject)newSetUpTime).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__SET_UP_TIME, null, msgs); + msgs = basicSetSetUpTime(newSetUpTime, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__SET_UP_TIME, newSetUpTime, newSetUpTime)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getProcessingTime() { + return processingTime; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetProcessingTime(Parameter newProcessingTime, NotificationChain msgs) { + Parameter oldProcessingTime = processingTime; + processingTime = newProcessingTime; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__PROCESSING_TIME, oldProcessingTime, newProcessingTime); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setProcessingTime(Parameter newProcessingTime) { + if (newProcessingTime != processingTime) { + NotificationChain msgs = null; + if (processingTime != null) + msgs = ((InternalEObject)processingTime).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__PROCESSING_TIME, null, msgs); + if (newProcessingTime != null) + msgs = ((InternalEObject)newProcessingTime).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__PROCESSING_TIME, null, msgs); + msgs = basicSetProcessingTime(newProcessingTime, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__PROCESSING_TIME, newProcessingTime, newProcessingTime)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getValidationTime() { + return validationTime; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetValidationTime(Parameter newValidationTime, NotificationChain msgs) { + Parameter oldValidationTime = validationTime; + validationTime = newValidationTime; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__VALIDATION_TIME, oldValidationTime, newValidationTime); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setValidationTime(Parameter newValidationTime) { + if (newValidationTime != validationTime) { + NotificationChain msgs = null; + if (validationTime != null) + msgs = ((InternalEObject)validationTime).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__VALIDATION_TIME, null, msgs); + if (newValidationTime != null) + msgs = ((InternalEObject)newValidationTime).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__VALIDATION_TIME, null, msgs); + msgs = basicSetValidationTime(newValidationTime, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__VALIDATION_TIME, newValidationTime, newValidationTime)); + } + + /** + * + * + * @generated + */ + @Override + public Parameter getReworkTime() { + return reworkTime; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetReworkTime(Parameter newReworkTime, NotificationChain msgs) { + Parameter oldReworkTime = reworkTime; + reworkTime = newReworkTime; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__REWORK_TIME, oldReworkTime, newReworkTime); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setReworkTime(Parameter newReworkTime) { + if (newReworkTime != reworkTime) { + NotificationChain msgs = null; + if (reworkTime != null) + msgs = ((InternalEObject)reworkTime).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__REWORK_TIME, null, msgs); + if (newReworkTime != null) + msgs = ((InternalEObject)newReworkTime).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.TIME_PARAMETERS__REWORK_TIME, null, msgs); + msgs = basicSetReworkTime(newReworkTime, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__REWORK_TIME, newReworkTime, newReworkTime)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.TIME_PARAMETERS__TRANSFER_TIME: + return basicSetTransferTime(null, msgs); + case BpsimPackage.TIME_PARAMETERS__QUEUE_TIME: + return basicSetQueueTime(null, msgs); + case BpsimPackage.TIME_PARAMETERS__WAIT_TIME: + return basicSetWaitTime(null, msgs); + case BpsimPackage.TIME_PARAMETERS__SET_UP_TIME: + return basicSetSetUpTime(null, msgs); + case BpsimPackage.TIME_PARAMETERS__PROCESSING_TIME: + return basicSetProcessingTime(null, msgs); + case BpsimPackage.TIME_PARAMETERS__VALIDATION_TIME: + return basicSetValidationTime(null, msgs); + case BpsimPackage.TIME_PARAMETERS__REWORK_TIME: + return basicSetReworkTime(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.TIME_PARAMETERS__TRANSFER_TIME: + return getTransferTime(); + case BpsimPackage.TIME_PARAMETERS__QUEUE_TIME: + return getQueueTime(); + case BpsimPackage.TIME_PARAMETERS__WAIT_TIME: + return getWaitTime(); + case BpsimPackage.TIME_PARAMETERS__SET_UP_TIME: + return getSetUpTime(); + case BpsimPackage.TIME_PARAMETERS__PROCESSING_TIME: + return getProcessingTime(); + case BpsimPackage.TIME_PARAMETERS__VALIDATION_TIME: + return getValidationTime(); + case BpsimPackage.TIME_PARAMETERS__REWORK_TIME: + return getReworkTime(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.TIME_PARAMETERS__TRANSFER_TIME: + setTransferTime((Parameter)newValue); + return; + case BpsimPackage.TIME_PARAMETERS__QUEUE_TIME: + setQueueTime((Parameter)newValue); + return; + case BpsimPackage.TIME_PARAMETERS__WAIT_TIME: + setWaitTime((Parameter)newValue); + return; + case BpsimPackage.TIME_PARAMETERS__SET_UP_TIME: + setSetUpTime((Parameter)newValue); + return; + case BpsimPackage.TIME_PARAMETERS__PROCESSING_TIME: + setProcessingTime((Parameter)newValue); + return; + case BpsimPackage.TIME_PARAMETERS__VALIDATION_TIME: + setValidationTime((Parameter)newValue); + return; + case BpsimPackage.TIME_PARAMETERS__REWORK_TIME: + setReworkTime((Parameter)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.TIME_PARAMETERS__TRANSFER_TIME: + setTransferTime((Parameter)null); + return; + case BpsimPackage.TIME_PARAMETERS__QUEUE_TIME: + setQueueTime((Parameter)null); + return; + case BpsimPackage.TIME_PARAMETERS__WAIT_TIME: + setWaitTime((Parameter)null); + return; + case BpsimPackage.TIME_PARAMETERS__SET_UP_TIME: + setSetUpTime((Parameter)null); + return; + case BpsimPackage.TIME_PARAMETERS__PROCESSING_TIME: + setProcessingTime((Parameter)null); + return; + case BpsimPackage.TIME_PARAMETERS__VALIDATION_TIME: + setValidationTime((Parameter)null); + return; + case BpsimPackage.TIME_PARAMETERS__REWORK_TIME: + setReworkTime((Parameter)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.TIME_PARAMETERS__TRANSFER_TIME: + return transferTime != null; + case BpsimPackage.TIME_PARAMETERS__QUEUE_TIME: + return queueTime != null; + case BpsimPackage.TIME_PARAMETERS__WAIT_TIME: + return waitTime != null; + case BpsimPackage.TIME_PARAMETERS__SET_UP_TIME: + return setUpTime != null; + case BpsimPackage.TIME_PARAMETERS__PROCESSING_TIME: + return processingTime != null; + case BpsimPackage.TIME_PARAMETERS__VALIDATION_TIME: + return validationTime != null; + case BpsimPackage.TIME_PARAMETERS__REWORK_TIME: + return reworkTime != null; + } + return super.eIsSet(featureID); + } + +} //TimeParametersImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/TriangularDistributionTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/TriangularDistributionTypeImpl.java new file mode 100644 index 00000000000..088930f9375 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/TriangularDistributionTypeImpl.java @@ -0,0 +1,392 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.TriangularDistributionType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Triangular Distribution Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.TriangularDistributionTypeImpl#getMax Max}
  • + *
  • {@link bpsim.impl.TriangularDistributionTypeImpl#getMin Min}
  • + *
  • {@link bpsim.impl.TriangularDistributionTypeImpl#getMode Mode}
  • + *
+ * + * @generated + */ +public class TriangularDistributionTypeImpl extends DistributionParameterImpl implements TriangularDistributionType { + /** + * The default value of the '{@link #getMax() Max}' attribute. + * + * + * @see #getMax() + * @generated + * @ordered + */ + protected static final double MAX_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getMax() Max}' attribute. + * + * + * @see #getMax() + * @generated + * @ordered + */ + @GwtTransient + protected double max = MAX_EDEFAULT; + + /** + * This is true if the Max attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean maxESet; + + /** + * The default value of the '{@link #getMin() Min}' attribute. + * + * + * @see #getMin() + * @generated + * @ordered + */ + protected static final double MIN_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getMin() Min}' attribute. + * + * + * @see #getMin() + * @generated + * @ordered + */ + @GwtTransient + protected double min = MIN_EDEFAULT; + + /** + * This is true if the Min attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean minESet; + + /** + * The default value of the '{@link #getMode() Mode}' attribute. + * + * + * @see #getMode() + * @generated + * @ordered + */ + protected static final double MODE_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getMode() Mode}' attribute. + * + * + * @see #getMode() + * @generated + * @ordered + */ + @GwtTransient + protected double mode = MODE_EDEFAULT; + + /** + * This is true if the Mode attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean modeESet; + + /** + * + * + * @generated + */ + protected TriangularDistributionTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.TRIANGULAR_DISTRIBUTION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public double getMax() { + return max; + } + + /** + * + * + * @generated + */ + @Override + public void setMax(double newMax) { + double oldMax = max; + max = newMax; + boolean oldMaxESet = maxESet; + maxESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MAX, oldMax, max, !oldMaxESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetMax() { + double oldMax = max; + boolean oldMaxESet = maxESet; + max = MAX_EDEFAULT; + maxESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MAX, oldMax, MAX_EDEFAULT, oldMaxESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetMax() { + return maxESet; + } + + /** + * + * + * @generated + */ + @Override + public double getMin() { + return min; + } + + /** + * + * + * @generated + */ + @Override + public void setMin(double newMin) { + double oldMin = min; + min = newMin; + boolean oldMinESet = minESet; + minESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MIN, oldMin, min, !oldMinESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetMin() { + double oldMin = min; + boolean oldMinESet = minESet; + min = MIN_EDEFAULT; + minESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MIN, oldMin, MIN_EDEFAULT, oldMinESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetMin() { + return minESet; + } + + /** + * + * + * @generated + */ + @Override + public double getMode() { + return mode; + } + + /** + * + * + * @generated + */ + @Override + public void setMode(double newMode) { + double oldMode = mode; + mode = newMode; + boolean oldModeESet = modeESet; + modeESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MODE, oldMode, mode, !oldModeESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetMode() { + double oldMode = mode; + boolean oldModeESet = modeESet; + mode = MODE_EDEFAULT; + modeESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MODE, oldMode, MODE_EDEFAULT, oldModeESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetMode() { + return modeESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MAX: + return getMax(); + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MIN: + return getMin(); + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MODE: + return getMode(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MAX: + setMax((Double)newValue); + return; + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MIN: + setMin((Double)newValue); + return; + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MODE: + setMode((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MAX: + unsetMax(); + return; + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MIN: + unsetMin(); + return; + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MODE: + unsetMode(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MAX: + return isSetMax(); + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MIN: + return isSetMin(); + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE__MODE: + return isSetMode(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (max: "); + if (maxESet) result.append(max); else result.append(""); + result.append(", min: "); + if (minESet) result.append(min); else result.append(""); + result.append(", mode: "); + if (modeESet) result.append(mode); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //TriangularDistributionTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/TruncatedNormalDistributionTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/TruncatedNormalDistributionTypeImpl.java new file mode 100644 index 00000000000..04f86d60de8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/TruncatedNormalDistributionTypeImpl.java @@ -0,0 +1,486 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.TruncatedNormalDistributionType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Truncated Normal Distribution Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.TruncatedNormalDistributionTypeImpl#getMax Max}
  • + *
  • {@link bpsim.impl.TruncatedNormalDistributionTypeImpl#getMean Mean}
  • + *
  • {@link bpsim.impl.TruncatedNormalDistributionTypeImpl#getMin Min}
  • + *
  • {@link bpsim.impl.TruncatedNormalDistributionTypeImpl#getStandardDeviation Standard Deviation}
  • + *
+ * + * @generated + */ +public class TruncatedNormalDistributionTypeImpl extends DistributionParameterImpl implements TruncatedNormalDistributionType { + /** + * The default value of the '{@link #getMax() Max}' attribute. + * + * + * @see #getMax() + * @generated + * @ordered + */ + protected static final double MAX_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getMax() Max}' attribute. + * + * + * @see #getMax() + * @generated + * @ordered + */ + @GwtTransient + protected double max = MAX_EDEFAULT; + + /** + * This is true if the Max attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean maxESet; + + /** + * The default value of the '{@link #getMean() Mean}' attribute. + * + * + * @see #getMean() + * @generated + * @ordered + */ + protected static final double MEAN_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getMean() Mean}' attribute. + * + * + * @see #getMean() + * @generated + * @ordered + */ + @GwtTransient + protected double mean = MEAN_EDEFAULT; + + /** + * This is true if the Mean attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean meanESet; + + /** + * The default value of the '{@link #getMin() Min}' attribute. + * + * + * @see #getMin() + * @generated + * @ordered + */ + protected static final double MIN_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getMin() Min}' attribute. + * + * + * @see #getMin() + * @generated + * @ordered + */ + @GwtTransient + protected double min = MIN_EDEFAULT; + + /** + * This is true if the Min attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean minESet; + + /** + * The default value of the '{@link #getStandardDeviation() Standard Deviation}' attribute. + * + * + * @see #getStandardDeviation() + * @generated + * @ordered + */ + protected static final double STANDARD_DEVIATION_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getStandardDeviation() Standard Deviation}' attribute. + * + * + * @see #getStandardDeviation() + * @generated + * @ordered + */ + @GwtTransient + protected double standardDeviation = STANDARD_DEVIATION_EDEFAULT; + + /** + * This is true if the Standard Deviation attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean standardDeviationESet; + + /** + * + * + * @generated + */ + protected TruncatedNormalDistributionTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.TRUNCATED_NORMAL_DISTRIBUTION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public double getMax() { + return max; + } + + /** + * + * + * @generated + */ + @Override + public void setMax(double newMax) { + double oldMax = max; + max = newMax; + boolean oldMaxESet = maxESet; + maxESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MAX, oldMax, max, !oldMaxESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetMax() { + double oldMax = max; + boolean oldMaxESet = maxESet; + max = MAX_EDEFAULT; + maxESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MAX, oldMax, MAX_EDEFAULT, oldMaxESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetMax() { + return maxESet; + } + + /** + * + * + * @generated + */ + @Override + public double getMean() { + return mean; + } + + /** + * + * + * @generated + */ + @Override + public void setMean(double newMean) { + double oldMean = mean; + mean = newMean; + boolean oldMeanESet = meanESet; + meanESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MEAN, oldMean, mean, !oldMeanESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetMean() { + double oldMean = mean; + boolean oldMeanESet = meanESet; + mean = MEAN_EDEFAULT; + meanESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MEAN, oldMean, MEAN_EDEFAULT, oldMeanESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetMean() { + return meanESet; + } + + /** + * + * + * @generated + */ + @Override + public double getMin() { + return min; + } + + /** + * + * + * @generated + */ + @Override + public void setMin(double newMin) { + double oldMin = min; + min = newMin; + boolean oldMinESet = minESet; + minESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MIN, oldMin, min, !oldMinESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetMin() { + double oldMin = min; + boolean oldMinESet = minESet; + min = MIN_EDEFAULT; + minESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MIN, oldMin, MIN_EDEFAULT, oldMinESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetMin() { + return minESet; + } + + /** + * + * + * @generated + */ + @Override + public double getStandardDeviation() { + return standardDeviation; + } + + /** + * + * + * @generated + */ + @Override + public void setStandardDeviation(double newStandardDeviation) { + double oldStandardDeviation = standardDeviation; + standardDeviation = newStandardDeviation; + boolean oldStandardDeviationESet = standardDeviationESet; + standardDeviationESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION, oldStandardDeviation, standardDeviation, !oldStandardDeviationESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetStandardDeviation() { + double oldStandardDeviation = standardDeviation; + boolean oldStandardDeviationESet = standardDeviationESet; + standardDeviation = STANDARD_DEVIATION_EDEFAULT; + standardDeviationESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION, oldStandardDeviation, STANDARD_DEVIATION_EDEFAULT, oldStandardDeviationESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetStandardDeviation() { + return standardDeviationESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MAX: + return getMax(); + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MEAN: + return getMean(); + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MIN: + return getMin(); + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION: + return getStandardDeviation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MAX: + setMax((Double)newValue); + return; + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MEAN: + setMean((Double)newValue); + return; + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MIN: + setMin((Double)newValue); + return; + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION: + setStandardDeviation((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MAX: + unsetMax(); + return; + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MEAN: + unsetMean(); + return; + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MIN: + unsetMin(); + return; + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION: + unsetStandardDeviation(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MAX: + return isSetMax(); + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MEAN: + return isSetMean(); + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__MIN: + return isSetMin(); + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION: + return isSetStandardDeviation(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (max: "); + if (maxESet) result.append(max); else result.append(""); + result.append(", mean: "); + if (meanESet) result.append(mean); else result.append(""); + result.append(", min: "); + if (minESet) result.append(min); else result.append(""); + result.append(", standardDeviation: "); + if (standardDeviationESet) result.append(standardDeviation); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //TruncatedNormalDistributionTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/UniformDistributionTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/UniformDistributionTypeImpl.java new file mode 100644 index 00000000000..bd0d124c054 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/UniformDistributionTypeImpl.java @@ -0,0 +1,298 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.UniformDistributionType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Uniform Distribution Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.UniformDistributionTypeImpl#getMax Max}
  • + *
  • {@link bpsim.impl.UniformDistributionTypeImpl#getMin Min}
  • + *
+ * + * @generated + */ +public class UniformDistributionTypeImpl extends DistributionParameterImpl implements UniformDistributionType { + /** + * The default value of the '{@link #getMax() Max}' attribute. + * + * + * @see #getMax() + * @generated + * @ordered + */ + protected static final double MAX_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getMax() Max}' attribute. + * + * + * @see #getMax() + * @generated + * @ordered + */ + @GwtTransient + protected double max = MAX_EDEFAULT; + + /** + * This is true if the Max attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean maxESet; + + /** + * The default value of the '{@link #getMin() Min}' attribute. + * + * + * @see #getMin() + * @generated + * @ordered + */ + protected static final double MIN_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getMin() Min}' attribute. + * + * + * @see #getMin() + * @generated + * @ordered + */ + @GwtTransient + protected double min = MIN_EDEFAULT; + + /** + * This is true if the Min attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean minESet; + + /** + * + * + * @generated + */ + protected UniformDistributionTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.UNIFORM_DISTRIBUTION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public double getMax() { + return max; + } + + /** + * + * + * @generated + */ + @Override + public void setMax(double newMax) { + double oldMax = max; + max = newMax; + boolean oldMaxESet = maxESet; + maxESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.UNIFORM_DISTRIBUTION_TYPE__MAX, oldMax, max, !oldMaxESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetMax() { + double oldMax = max; + boolean oldMaxESet = maxESet; + max = MAX_EDEFAULT; + maxESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.UNIFORM_DISTRIBUTION_TYPE__MAX, oldMax, MAX_EDEFAULT, oldMaxESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetMax() { + return maxESet; + } + + /** + * + * + * @generated + */ + @Override + public double getMin() { + return min; + } + + /** + * + * + * @generated + */ + @Override + public void setMin(double newMin) { + double oldMin = min; + min = newMin; + boolean oldMinESet = minESet; + minESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.UNIFORM_DISTRIBUTION_TYPE__MIN, oldMin, min, !oldMinESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetMin() { + double oldMin = min; + boolean oldMinESet = minESet; + min = MIN_EDEFAULT; + minESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.UNIFORM_DISTRIBUTION_TYPE__MIN, oldMin, MIN_EDEFAULT, oldMinESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetMin() { + return minESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.UNIFORM_DISTRIBUTION_TYPE__MAX: + return getMax(); + case BpsimPackage.UNIFORM_DISTRIBUTION_TYPE__MIN: + return getMin(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.UNIFORM_DISTRIBUTION_TYPE__MAX: + setMax((Double)newValue); + return; + case BpsimPackage.UNIFORM_DISTRIBUTION_TYPE__MIN: + setMin((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.UNIFORM_DISTRIBUTION_TYPE__MAX: + unsetMax(); + return; + case BpsimPackage.UNIFORM_DISTRIBUTION_TYPE__MIN: + unsetMin(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.UNIFORM_DISTRIBUTION_TYPE__MAX: + return isSetMax(); + case BpsimPackage.UNIFORM_DISTRIBUTION_TYPE__MIN: + return isSetMin(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (max: "); + if (maxESet) result.append(max); else result.append(""); + result.append(", min: "); + if (minESet) result.append(min); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //UniformDistributionTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/UserDistributionDataPointTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/UserDistributionDataPointTypeImpl.java new file mode 100644 index 00000000000..777ccdb7f49 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/UserDistributionDataPointTypeImpl.java @@ -0,0 +1,306 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.ParameterValue; +import bpsim.UserDistributionDataPointType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'User Distribution Data Point Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.UserDistributionDataPointTypeImpl#getParameterValueGroup Parameter Value Group}
  • + *
  • {@link bpsim.impl.UserDistributionDataPointTypeImpl#getParameterValue Parameter Value}
  • + *
  • {@link bpsim.impl.UserDistributionDataPointTypeImpl#getProbability Probability}
  • + *
+ * + * @generated + */ +public class UserDistributionDataPointTypeImpl extends EObjectImpl implements UserDistributionDataPointType { + /** + * The cached value of the '{@link #getParameterValueGroup() Parameter Value Group}' attribute list. + * + * + * @see #getParameterValueGroup() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap parameterValueGroup; + + /** + * The default value of the '{@link #getProbability() Probability}' attribute. + * + * + * @see #getProbability() + * @generated + * @ordered + */ + protected static final float PROBABILITY_EDEFAULT = 0.0F; + + /** + * The cached value of the '{@link #getProbability() Probability}' attribute. + * + * + * @see #getProbability() + * @generated + * @ordered + */ + @GwtTransient + protected float probability = PROBABILITY_EDEFAULT; + + /** + * This is true if the Probability attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean probabilityESet; + + /** + * + * + * @generated + */ + protected UserDistributionDataPointTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.USER_DISTRIBUTION_DATA_POINT_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getParameterValueGroup() { + if (parameterValueGroup == null) { + parameterValueGroup = new BasicFeatureMap(this, BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE_GROUP); + } + return parameterValueGroup; + } + + /** + * + * + * @generated + */ + @Override + public ParameterValue getParameterValue() { + return (ParameterValue)getParameterValueGroup().get(BpsimPackage.Literals.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetParameterValue(ParameterValue newParameterValue, NotificationChain msgs) { + return ((FeatureMap.Internal)getParameterValueGroup()).basicAdd(BpsimPackage.Literals.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE, newParameterValue, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setParameterValue(ParameterValue newParameterValue) { + ((FeatureMap.Internal)getParameterValueGroup()).set(BpsimPackage.Literals.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE, newParameterValue); + } + + /** + * + * + * @generated + */ + @Override + public float getProbability() { + return probability; + } + + /** + * + * + * @generated + */ + @Override + public void setProbability(float newProbability) { + float oldProbability = probability; + probability = newProbability; + boolean oldProbabilityESet = probabilityESet; + probabilityESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PROBABILITY, oldProbability, probability, !oldProbabilityESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetProbability() { + float oldProbability = probability; + boolean oldProbabilityESet = probabilityESet; + probability = PROBABILITY_EDEFAULT; + probabilityESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PROBABILITY, oldProbability, PROBABILITY_EDEFAULT, oldProbabilityESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetProbability() { + return probabilityESet; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE_GROUP: + return ((InternalEList)getParameterValueGroup()).basicRemove(otherEnd, msgs); + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE: + return basicSetParameterValue(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE_GROUP: + if (coreType) return getParameterValueGroup(); + return ((FeatureMap.Internal)getParameterValueGroup()).getWrapper(); + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE: + return getParameterValue(); + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PROBABILITY: + return getProbability(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE_GROUP: + ((FeatureMap.Internal)getParameterValueGroup()).set(newValue); + return; + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE: + setParameterValue((ParameterValue)newValue); + return; + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PROBABILITY: + setProbability((Float)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE_GROUP: + getParameterValueGroup().clear(); + return; + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE: + setParameterValue((ParameterValue)null); + return; + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PROBABILITY: + unsetProbability(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE_GROUP: + return parameterValueGroup != null && !parameterValueGroup.isEmpty(); + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE: + return getParameterValue() != null; + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PROBABILITY: + return isSetProbability(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (parameterValueGroup: "); + result.append(parameterValueGroup); + result.append(", probability: "); + if (probabilityESet) result.append(probability); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //UserDistributionDataPointTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/UserDistributionTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/UserDistributionTypeImpl.java new file mode 100644 index 00000000000..d9ede923a08 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/UserDistributionTypeImpl.java @@ -0,0 +1,292 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.UserDistributionDataPointType; +import bpsim.UserDistributionType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'User Distribution Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.UserDistributionTypeImpl#getGroup Group}
  • + *
  • {@link bpsim.impl.UserDistributionTypeImpl#getUserDistributionDataPoint User Distribution Data Point}
  • + *
  • {@link bpsim.impl.UserDistributionTypeImpl#isDiscrete Discrete}
  • + *
+ * + * @generated + */ +public class UserDistributionTypeImpl extends DistributionParameterImpl implements UserDistributionType { + /** + * The cached value of the '{@link #getGroup() Group}' attribute list. + * + * + * @see #getGroup() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap group; + + /** + * The default value of the '{@link #isDiscrete() Discrete}' attribute. + * + * + * @see #isDiscrete() + * @generated + * @ordered + */ + protected static final boolean DISCRETE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isDiscrete() Discrete}' attribute. + * + * + * @see #isDiscrete() + * @generated + * @ordered + */ + @GwtTransient + protected boolean discrete = DISCRETE_EDEFAULT; + + /** + * This is true if the Discrete attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean discreteESet; + + /** + * + * + * @generated + */ + protected UserDistributionTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.USER_DISTRIBUTION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getGroup() { + if (group == null) { + group = new BasicFeatureMap(this, BpsimPackage.USER_DISTRIBUTION_TYPE__GROUP); + } + return group; + } + + /** + * + * + * @generated + */ + @Override + public EList getUserDistributionDataPoint() { + return getGroup().list(BpsimPackage.Literals.USER_DISTRIBUTION_TYPE__USER_DISTRIBUTION_DATA_POINT); + } + + /** + * + * + * @generated + */ + @Override + public boolean isDiscrete() { + return discrete; + } + + /** + * + * + * @generated + */ + @Override + public void setDiscrete(boolean newDiscrete) { + boolean oldDiscrete = discrete; + discrete = newDiscrete; + boolean oldDiscreteESet = discreteESet; + discreteESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.USER_DISTRIBUTION_TYPE__DISCRETE, oldDiscrete, discrete, !oldDiscreteESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetDiscrete() { + boolean oldDiscrete = discrete; + boolean oldDiscreteESet = discreteESet; + discrete = DISCRETE_EDEFAULT; + discreteESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.USER_DISTRIBUTION_TYPE__DISCRETE, oldDiscrete, DISCRETE_EDEFAULT, oldDiscreteESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetDiscrete() { + return discreteESet; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.USER_DISTRIBUTION_TYPE__GROUP: + return ((InternalEList)getGroup()).basicRemove(otherEnd, msgs); + case BpsimPackage.USER_DISTRIBUTION_TYPE__USER_DISTRIBUTION_DATA_POINT: + return ((InternalEList)getUserDistributionDataPoint()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.USER_DISTRIBUTION_TYPE__GROUP: + if (coreType) return getGroup(); + return ((FeatureMap.Internal)getGroup()).getWrapper(); + case BpsimPackage.USER_DISTRIBUTION_TYPE__USER_DISTRIBUTION_DATA_POINT: + return getUserDistributionDataPoint(); + case BpsimPackage.USER_DISTRIBUTION_TYPE__DISCRETE: + return isDiscrete(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.USER_DISTRIBUTION_TYPE__GROUP: + ((FeatureMap.Internal)getGroup()).set(newValue); + return; + case BpsimPackage.USER_DISTRIBUTION_TYPE__USER_DISTRIBUTION_DATA_POINT: + getUserDistributionDataPoint().clear(); + getUserDistributionDataPoint().addAll((Collection)newValue); + return; + case BpsimPackage.USER_DISTRIBUTION_TYPE__DISCRETE: + setDiscrete((Boolean)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.USER_DISTRIBUTION_TYPE__GROUP: + getGroup().clear(); + return; + case BpsimPackage.USER_DISTRIBUTION_TYPE__USER_DISTRIBUTION_DATA_POINT: + getUserDistributionDataPoint().clear(); + return; + case BpsimPackage.USER_DISTRIBUTION_TYPE__DISCRETE: + unsetDiscrete(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.USER_DISTRIBUTION_TYPE__GROUP: + return group != null && !group.isEmpty(); + case BpsimPackage.USER_DISTRIBUTION_TYPE__USER_DISTRIBUTION_DATA_POINT: + return !getUserDistributionDataPoint().isEmpty(); + case BpsimPackage.USER_DISTRIBUTION_TYPE__DISCRETE: + return isSetDiscrete(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (group: "); + result.append(group); + result.append(", discrete: "); + if (discreteESet) result.append(discrete); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //UserDistributionTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/VendorExtensionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/VendorExtensionImpl.java new file mode 100644 index 00000000000..95ce36b0b26 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/VendorExtensionImpl.java @@ -0,0 +1,266 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.VendorExtension; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Vendor Extension'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.VendorExtensionImpl#getAny Any}
  • + *
  • {@link bpsim.impl.VendorExtensionImpl#getName Name}
  • + *
  • {@link bpsim.impl.VendorExtensionImpl#getAnyAttribute Any Attribute}
  • + *
+ * + * @generated + */ +public class VendorExtensionImpl extends EObjectImpl implements VendorExtension { + /** + * The cached value of the '{@link #getAny() Any}' attribute list. + * + * + * @see #getAny() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap any; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getAnyAttribute() Any Attribute}' attribute list. + * + * + * @see #getAnyAttribute() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap anyAttribute; + + /** + * + * + * @generated + */ + protected VendorExtensionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.VENDOR_EXTENSION; + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getAny() { + if (any == null) { + any = new BasicFeatureMap(this, BpsimPackage.VENDOR_EXTENSION__ANY); + } + return any; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.VENDOR_EXTENSION__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getAnyAttribute() { + if (anyAttribute == null) { + anyAttribute = new BasicFeatureMap(this, BpsimPackage.VENDOR_EXTENSION__ANY_ATTRIBUTE); + } + return anyAttribute; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpsimPackage.VENDOR_EXTENSION__ANY: + return ((InternalEList)getAny()).basicRemove(otherEnd, msgs); + case BpsimPackage.VENDOR_EXTENSION__ANY_ATTRIBUTE: + return ((InternalEList)getAnyAttribute()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.VENDOR_EXTENSION__ANY: + if (coreType) return getAny(); + return ((FeatureMap.Internal)getAny()).getWrapper(); + case BpsimPackage.VENDOR_EXTENSION__NAME: + return getName(); + case BpsimPackage.VENDOR_EXTENSION__ANY_ATTRIBUTE: + if (coreType) return getAnyAttribute(); + return ((FeatureMap.Internal)getAnyAttribute()).getWrapper(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.VENDOR_EXTENSION__ANY: + ((FeatureMap.Internal)getAny()).set(newValue); + return; + case BpsimPackage.VENDOR_EXTENSION__NAME: + setName((String)newValue); + return; + case BpsimPackage.VENDOR_EXTENSION__ANY_ATTRIBUTE: + ((FeatureMap.Internal)getAnyAttribute()).set(newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.VENDOR_EXTENSION__ANY: + getAny().clear(); + return; + case BpsimPackage.VENDOR_EXTENSION__NAME: + setName(NAME_EDEFAULT); + return; + case BpsimPackage.VENDOR_EXTENSION__ANY_ATTRIBUTE: + getAnyAttribute().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.VENDOR_EXTENSION__ANY: + return any != null && !any.isEmpty(); + case BpsimPackage.VENDOR_EXTENSION__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case BpsimPackage.VENDOR_EXTENSION__ANY_ATTRIBUTE: + return anyAttribute != null && !anyAttribute.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (any: "); + result.append(any); + result.append(", name: "); + result.append(name); + result.append(", anyAttribute: "); + result.append(anyAttribute); + result.append(')'); + return result.toString(); + } + +} //VendorExtensionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/WeibullDistributionTypeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/WeibullDistributionTypeImpl.java new file mode 100644 index 00000000000..4cc1054363d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/impl/WeibullDistributionTypeImpl.java @@ -0,0 +1,298 @@ +/** + */ +package bpsim.impl; + +import bpsim.BpsimPackage; +import bpsim.WeibullDistributionType; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Weibull Distribution Type'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link bpsim.impl.WeibullDistributionTypeImpl#getScale Scale}
  • + *
  • {@link bpsim.impl.WeibullDistributionTypeImpl#getShape Shape}
  • + *
+ * + * @generated + */ +public class WeibullDistributionTypeImpl extends DistributionParameterImpl implements WeibullDistributionType { + /** + * The default value of the '{@link #getScale() Scale}' attribute. + * + * + * @see #getScale() + * @generated + * @ordered + */ + protected static final double SCALE_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getScale() Scale}' attribute. + * + * + * @see #getScale() + * @generated + * @ordered + */ + @GwtTransient + protected double scale = SCALE_EDEFAULT; + + /** + * This is true if the Scale attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean scaleESet; + + /** + * The default value of the '{@link #getShape() Shape}' attribute. + * + * + * @see #getShape() + * @generated + * @ordered + */ + protected static final double SHAPE_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getShape() Shape}' attribute. + * + * + * @see #getShape() + * @generated + * @ordered + */ + @GwtTransient + protected double shape = SHAPE_EDEFAULT; + + /** + * This is true if the Shape attribute has been set. + * + * + * @generated + * @ordered + */ + @GwtTransient + protected boolean shapeESet; + + /** + * + * + * @generated + */ + protected WeibullDistributionTypeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpsimPackage.Literals.WEIBULL_DISTRIBUTION_TYPE; + } + + /** + * + * + * @generated + */ + @Override + public double getScale() { + return scale; + } + + /** + * + * + * @generated + */ + @Override + public void setScale(double newScale) { + double oldScale = scale; + scale = newScale; + boolean oldScaleESet = scaleESet; + scaleESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SCALE, oldScale, scale, !oldScaleESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetScale() { + double oldScale = scale; + boolean oldScaleESet = scaleESet; + scale = SCALE_EDEFAULT; + scaleESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SCALE, oldScale, SCALE_EDEFAULT, oldScaleESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetScale() { + return scaleESet; + } + + /** + * + * + * @generated + */ + @Override + public double getShape() { + return shape; + } + + /** + * + * + * @generated + */ + @Override + public void setShape(double newShape) { + double oldShape = shape; + shape = newShape; + boolean oldShapeESet = shapeESet; + shapeESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SHAPE, oldShape, shape, !oldShapeESet)); + } + + /** + * + * + * @generated + */ + @Override + public void unsetShape() { + double oldShape = shape; + boolean oldShapeESet = shapeESet; + shape = SHAPE_EDEFAULT; + shapeESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SHAPE, oldShape, SHAPE_EDEFAULT, oldShapeESet)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isSetShape() { + return shapeESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SCALE: + return getScale(); + case BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SHAPE: + return getShape(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SCALE: + setScale((Double)newValue); + return; + case BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SHAPE: + setShape((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SCALE: + unsetScale(); + return; + case BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SHAPE: + unsetShape(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SCALE: + return isSetScale(); + case BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SHAPE: + return isSetShape(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (scale: "); + if (scaleESet) result.append(scale); else result.append(""); + result.append(", shape: "); + if (shapeESet) result.append(shape); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //WeibullDistributionTypeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/util/BpsimAdapterFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/util/BpsimAdapterFactory.java new file mode 100644 index 00000000000..fd1a7c5e4b8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/util/BpsimAdapterFactory.java @@ -0,0 +1,858 @@ +/** + */ +package bpsim.util; + +import bpsim.*; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see bpsim.BpsimPackage + * @generated + */ +public class BpsimAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static BpsimPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public BpsimAdapterFactory() { + if (modelPackage == null) { + modelPackage = BpsimPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected BpsimSwitch modelSwitch = + new BpsimSwitch() { + @Override + public Adapter caseBetaDistributionType(BetaDistributionType object) { + return createBetaDistributionTypeAdapter(); + } + @Override + public Adapter caseBinomialDistributionType(BinomialDistributionType object) { + return createBinomialDistributionTypeAdapter(); + } + @Override + public Adapter caseBooleanParameterType(BooleanParameterType object) { + return createBooleanParameterTypeAdapter(); + } + @Override + public Adapter caseBPSimDataType(BPSimDataType object) { + return createBPSimDataTypeAdapter(); + } + @Override + public Adapter caseCalendar(Calendar object) { + return createCalendarAdapter(); + } + @Override + public Adapter caseConstantParameter(ConstantParameter object) { + return createConstantParameterAdapter(); + } + @Override + public Adapter caseControlParameters(ControlParameters object) { + return createControlParametersAdapter(); + } + @Override + public Adapter caseCostParameters(CostParameters object) { + return createCostParametersAdapter(); + } + @Override + public Adapter caseDateTimeParameterType(DateTimeParameterType object) { + return createDateTimeParameterTypeAdapter(); + } + @Override + public Adapter caseDistributionParameter(DistributionParameter object) { + return createDistributionParameterAdapter(); + } + @Override + public Adapter caseDocumentRoot(DocumentRoot object) { + return createDocumentRootAdapter(); + } + @Override + public Adapter caseDurationParameterType(DurationParameterType object) { + return createDurationParameterTypeAdapter(); + } + @Override + public Adapter caseElementParameters(ElementParameters object) { + return createElementParametersAdapter(); + } + @Override + public Adapter caseElementParametersType(ElementParametersType object) { + return createElementParametersTypeAdapter(); + } + @Override + public Adapter caseEnumParameterType(EnumParameterType object) { + return createEnumParameterTypeAdapter(); + } + @Override + public Adapter caseErlangDistributionType(ErlangDistributionType object) { + return createErlangDistributionTypeAdapter(); + } + @Override + public Adapter caseExpressionParameterType(ExpressionParameterType object) { + return createExpressionParameterTypeAdapter(); + } + @Override + public Adapter caseFloatingParameterType(FloatingParameterType object) { + return createFloatingParameterTypeAdapter(); + } + @Override + public Adapter caseGammaDistributionType(GammaDistributionType object) { + return createGammaDistributionTypeAdapter(); + } + @Override + public Adapter caseLogNormalDistributionType(LogNormalDistributionType object) { + return createLogNormalDistributionTypeAdapter(); + } + @Override + public Adapter caseNegativeExponentialDistributionType(NegativeExponentialDistributionType object) { + return createNegativeExponentialDistributionTypeAdapter(); + } + @Override + public Adapter caseNormalDistributionType(NormalDistributionType object) { + return createNormalDistributionTypeAdapter(); + } + @Override + public Adapter caseNumericParameterType(NumericParameterType object) { + return createNumericParameterTypeAdapter(); + } + @Override + public Adapter caseParameter(Parameter object) { + return createParameterAdapter(); + } + @Override + public Adapter caseParameterValue(ParameterValue object) { + return createParameterValueAdapter(); + } + @Override + public Adapter casePoissonDistributionType(PoissonDistributionType object) { + return createPoissonDistributionTypeAdapter(); + } + @Override + public Adapter casePriorityParameters(PriorityParameters object) { + return createPriorityParametersAdapter(); + } + @Override + public Adapter casePropertyParameters(PropertyParameters object) { + return createPropertyParametersAdapter(); + } + @Override + public Adapter casePropertyType(PropertyType object) { + return createPropertyTypeAdapter(); + } + @Override + public Adapter caseResourceParameters(ResourceParameters object) { + return createResourceParametersAdapter(); + } + @Override + public Adapter caseScenario(Scenario object) { + return createScenarioAdapter(); + } + @Override + public Adapter caseScenarioParameters(ScenarioParameters object) { + return createScenarioParametersAdapter(); + } + @Override + public Adapter caseScenarioParametersType(ScenarioParametersType object) { + return createScenarioParametersTypeAdapter(); + } + @Override + public Adapter caseStringParameterType(StringParameterType object) { + return createStringParameterTypeAdapter(); + } + @Override + public Adapter caseTimeParameters(TimeParameters object) { + return createTimeParametersAdapter(); + } + @Override + public Adapter caseTriangularDistributionType(TriangularDistributionType object) { + return createTriangularDistributionTypeAdapter(); + } + @Override + public Adapter caseTruncatedNormalDistributionType(TruncatedNormalDistributionType object) { + return createTruncatedNormalDistributionTypeAdapter(); + } + @Override + public Adapter caseUniformDistributionType(UniformDistributionType object) { + return createUniformDistributionTypeAdapter(); + } + @Override + public Adapter caseUserDistributionDataPointType(UserDistributionDataPointType object) { + return createUserDistributionDataPointTypeAdapter(); + } + @Override + public Adapter caseUserDistributionType(UserDistributionType object) { + return createUserDistributionTypeAdapter(); + } + @Override + public Adapter caseVendorExtension(VendorExtension object) { + return createVendorExtensionAdapter(); + } + @Override + public Adapter caseWeibullDistributionType(WeibullDistributionType object) { + return createWeibullDistributionTypeAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link bpsim.BetaDistributionType Beta Distribution Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.BetaDistributionType + * @generated + */ + public Adapter createBetaDistributionTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.BinomialDistributionType Binomial Distribution Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.BinomialDistributionType + * @generated + */ + public Adapter createBinomialDistributionTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.BooleanParameterType Boolean Parameter Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.BooleanParameterType + * @generated + */ + public Adapter createBooleanParameterTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.BPSimDataType BP Sim Data Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.BPSimDataType + * @generated + */ + public Adapter createBPSimDataTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.Calendar Calendar}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.Calendar + * @generated + */ + public Adapter createCalendarAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.ConstantParameter Constant Parameter}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.ConstantParameter + * @generated + */ + public Adapter createConstantParameterAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.ControlParameters Control Parameters}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.ControlParameters + * @generated + */ + public Adapter createControlParametersAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.CostParameters Cost Parameters}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.CostParameters + * @generated + */ + public Adapter createCostParametersAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.DateTimeParameterType Date Time Parameter Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.DateTimeParameterType + * @generated + */ + public Adapter createDateTimeParameterTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.DistributionParameter Distribution Parameter}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.DistributionParameter + * @generated + */ + public Adapter createDistributionParameterAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.DocumentRoot Document Root}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.DocumentRoot + * @generated + */ + public Adapter createDocumentRootAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.DurationParameterType Duration Parameter Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.DurationParameterType + * @generated + */ + public Adapter createDurationParameterTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.ElementParameters Element Parameters}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.ElementParameters + * @generated + */ + public Adapter createElementParametersAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.ElementParametersType Element Parameters Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.ElementParametersType + * @generated + */ + public Adapter createElementParametersTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.EnumParameterType Enum Parameter Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.EnumParameterType + * @generated + */ + public Adapter createEnumParameterTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.ErlangDistributionType Erlang Distribution Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.ErlangDistributionType + * @generated + */ + public Adapter createErlangDistributionTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.ExpressionParameterType Expression Parameter Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.ExpressionParameterType + * @generated + */ + public Adapter createExpressionParameterTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.FloatingParameterType Floating Parameter Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.FloatingParameterType + * @generated + */ + public Adapter createFloatingParameterTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.GammaDistributionType Gamma Distribution Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.GammaDistributionType + * @generated + */ + public Adapter createGammaDistributionTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.LogNormalDistributionType Log Normal Distribution Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.LogNormalDistributionType + * @generated + */ + public Adapter createLogNormalDistributionTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.NegativeExponentialDistributionType Negative Exponential Distribution Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.NegativeExponentialDistributionType + * @generated + */ + public Adapter createNegativeExponentialDistributionTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.NormalDistributionType Normal Distribution Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.NormalDistributionType + * @generated + */ + public Adapter createNormalDistributionTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.NumericParameterType Numeric Parameter Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.NumericParameterType + * @generated + */ + public Adapter createNumericParameterTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.Parameter Parameter}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.Parameter + * @generated + */ + public Adapter createParameterAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.ParameterValue Parameter Value}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.ParameterValue + * @generated + */ + public Adapter createParameterValueAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.PoissonDistributionType Poisson Distribution Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.PoissonDistributionType + * @generated + */ + public Adapter createPoissonDistributionTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.PriorityParameters Priority Parameters}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.PriorityParameters + * @generated + */ + public Adapter createPriorityParametersAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.PropertyParameters Property Parameters}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.PropertyParameters + * @generated + */ + public Adapter createPropertyParametersAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.PropertyType Property Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.PropertyType + * @generated + */ + public Adapter createPropertyTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.ResourceParameters Resource Parameters}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.ResourceParameters + * @generated + */ + public Adapter createResourceParametersAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.Scenario Scenario}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.Scenario + * @generated + */ + public Adapter createScenarioAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.ScenarioParameters Scenario Parameters}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.ScenarioParameters + * @generated + */ + public Adapter createScenarioParametersAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.ScenarioParametersType Scenario Parameters Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.ScenarioParametersType + * @generated + */ + public Adapter createScenarioParametersTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.StringParameterType String Parameter Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.StringParameterType + * @generated + */ + public Adapter createStringParameterTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.TimeParameters Time Parameters}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.TimeParameters + * @generated + */ + public Adapter createTimeParametersAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.TriangularDistributionType Triangular Distribution Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.TriangularDistributionType + * @generated + */ + public Adapter createTriangularDistributionTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.TruncatedNormalDistributionType Truncated Normal Distribution Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.TruncatedNormalDistributionType + * @generated + */ + public Adapter createTruncatedNormalDistributionTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.UniformDistributionType Uniform Distribution Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.UniformDistributionType + * @generated + */ + public Adapter createUniformDistributionTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.UserDistributionDataPointType User Distribution Data Point Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.UserDistributionDataPointType + * @generated + */ + public Adapter createUserDistributionDataPointTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.UserDistributionType User Distribution Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.UserDistributionType + * @generated + */ + public Adapter createUserDistributionTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.VendorExtension Vendor Extension}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.VendorExtension + * @generated + */ + public Adapter createVendorExtensionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link bpsim.WeibullDistributionType Weibull Distribution Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see bpsim.WeibullDistributionType + * @generated + */ + public Adapter createWeibullDistributionTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //BpsimAdapterFactory diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/util/BpsimSwitch.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/util/BpsimSwitch.java new file mode 100644 index 00000000000..ea123ee47f0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/bpsim/util/BpsimSwitch.java @@ -0,0 +1,1032 @@ +/** + */ +package bpsim.util; + +import bpsim.*; + +import java.util.List; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see bpsim.BpsimPackage + * @generated + */ +public class BpsimSwitch { + /** + * The cached model package + * + * + * @generated + */ + protected static BpsimPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public BpsimSwitch() { + if (modelPackage == null) { + modelPackage = BpsimPackage.eINSTANCE; + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + public T doSwitch(EObject theEObject) { + return doSwitch(theEObject.eClass(), theEObject); + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected T doSwitch(EClass theEClass, EObject theEObject) { + if (theEClass.eContainer() == modelPackage) { + return doSwitch(theEClass.getClassifierID(), theEObject); + } + else { + List eSuperTypes = theEClass.getESuperTypes(); + return + eSuperTypes.isEmpty() ? + defaultCase(theEObject) : + doSwitch(eSuperTypes.get(0), theEObject); + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case BpsimPackage.BETA_DISTRIBUTION_TYPE: { + BetaDistributionType betaDistributionType = (BetaDistributionType)theEObject; + T result = caseBetaDistributionType(betaDistributionType); + if (result == null) result = caseDistributionParameter(betaDistributionType); + if (result == null) result = caseParameterValue(betaDistributionType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE: { + BinomialDistributionType binomialDistributionType = (BinomialDistributionType)theEObject; + T result = caseBinomialDistributionType(binomialDistributionType); + if (result == null) result = caseDistributionParameter(binomialDistributionType); + if (result == null) result = caseParameterValue(binomialDistributionType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.BOOLEAN_PARAMETER_TYPE: { + BooleanParameterType booleanParameterType = (BooleanParameterType)theEObject; + T result = caseBooleanParameterType(booleanParameterType); + if (result == null) result = caseConstantParameter(booleanParameterType); + if (result == null) result = caseParameterValue(booleanParameterType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.BP_SIM_DATA_TYPE: { + BPSimDataType bpSimDataType = (BPSimDataType)theEObject; + T result = caseBPSimDataType(bpSimDataType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.CALENDAR: { + Calendar calendar = (Calendar)theEObject; + T result = caseCalendar(calendar); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.CONSTANT_PARAMETER: { + ConstantParameter constantParameter = (ConstantParameter)theEObject; + T result = caseConstantParameter(constantParameter); + if (result == null) result = caseParameterValue(constantParameter); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.CONTROL_PARAMETERS: { + ControlParameters controlParameters = (ControlParameters)theEObject; + T result = caseControlParameters(controlParameters); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.COST_PARAMETERS: { + CostParameters costParameters = (CostParameters)theEObject; + T result = caseCostParameters(costParameters); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.DATE_TIME_PARAMETER_TYPE: { + DateTimeParameterType dateTimeParameterType = (DateTimeParameterType)theEObject; + T result = caseDateTimeParameterType(dateTimeParameterType); + if (result == null) result = caseConstantParameter(dateTimeParameterType); + if (result == null) result = caseParameterValue(dateTimeParameterType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.DISTRIBUTION_PARAMETER: { + DistributionParameter distributionParameter = (DistributionParameter)theEObject; + T result = caseDistributionParameter(distributionParameter); + if (result == null) result = caseParameterValue(distributionParameter); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.DOCUMENT_ROOT: { + DocumentRoot documentRoot = (DocumentRoot)theEObject; + T result = caseDocumentRoot(documentRoot); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.DURATION_PARAMETER_TYPE: { + DurationParameterType durationParameterType = (DurationParameterType)theEObject; + T result = caseDurationParameterType(durationParameterType); + if (result == null) result = caseConstantParameter(durationParameterType); + if (result == null) result = caseParameterValue(durationParameterType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.ELEMENT_PARAMETERS: { + ElementParameters elementParameters = (ElementParameters)theEObject; + T result = caseElementParameters(elementParameters); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.ELEMENT_PARAMETERS_TYPE: { + ElementParametersType elementParametersType = (ElementParametersType)theEObject; + T result = caseElementParametersType(elementParametersType); + if (result == null) result = caseElementParameters(elementParametersType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.ENUM_PARAMETER_TYPE: { + EnumParameterType enumParameterType = (EnumParameterType)theEObject; + T result = caseEnumParameterType(enumParameterType); + if (result == null) result = caseParameterValue(enumParameterType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.ERLANG_DISTRIBUTION_TYPE: { + ErlangDistributionType erlangDistributionType = (ErlangDistributionType)theEObject; + T result = caseErlangDistributionType(erlangDistributionType); + if (result == null) result = caseDistributionParameter(erlangDistributionType); + if (result == null) result = caseParameterValue(erlangDistributionType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.EXPRESSION_PARAMETER_TYPE: { + ExpressionParameterType expressionParameterType = (ExpressionParameterType)theEObject; + T result = caseExpressionParameterType(expressionParameterType); + if (result == null) result = caseParameterValue(expressionParameterType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.FLOATING_PARAMETER_TYPE: { + FloatingParameterType floatingParameterType = (FloatingParameterType)theEObject; + T result = caseFloatingParameterType(floatingParameterType); + if (result == null) result = caseConstantParameter(floatingParameterType); + if (result == null) result = caseParameterValue(floatingParameterType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.GAMMA_DISTRIBUTION_TYPE: { + GammaDistributionType gammaDistributionType = (GammaDistributionType)theEObject; + T result = caseGammaDistributionType(gammaDistributionType); + if (result == null) result = caseDistributionParameter(gammaDistributionType); + if (result == null) result = caseParameterValue(gammaDistributionType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.LOG_NORMAL_DISTRIBUTION_TYPE: { + LogNormalDistributionType logNormalDistributionType = (LogNormalDistributionType)theEObject; + T result = caseLogNormalDistributionType(logNormalDistributionType); + if (result == null) result = caseDistributionParameter(logNormalDistributionType); + if (result == null) result = caseParameterValue(logNormalDistributionType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.NEGATIVE_EXPONENTIAL_DISTRIBUTION_TYPE: { + NegativeExponentialDistributionType negativeExponentialDistributionType = (NegativeExponentialDistributionType)theEObject; + T result = caseNegativeExponentialDistributionType(negativeExponentialDistributionType); + if (result == null) result = caseDistributionParameter(negativeExponentialDistributionType); + if (result == null) result = caseParameterValue(negativeExponentialDistributionType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.NORMAL_DISTRIBUTION_TYPE: { + NormalDistributionType normalDistributionType = (NormalDistributionType)theEObject; + T result = caseNormalDistributionType(normalDistributionType); + if (result == null) result = caseDistributionParameter(normalDistributionType); + if (result == null) result = caseParameterValue(normalDistributionType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.NUMERIC_PARAMETER_TYPE: { + NumericParameterType numericParameterType = (NumericParameterType)theEObject; + T result = caseNumericParameterType(numericParameterType); + if (result == null) result = caseConstantParameter(numericParameterType); + if (result == null) result = caseParameterValue(numericParameterType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.PARAMETER: { + Parameter parameter = (Parameter)theEObject; + T result = caseParameter(parameter); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.PARAMETER_VALUE: { + ParameterValue parameterValue = (ParameterValue)theEObject; + T result = caseParameterValue(parameterValue); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.POISSON_DISTRIBUTION_TYPE: { + PoissonDistributionType poissonDistributionType = (PoissonDistributionType)theEObject; + T result = casePoissonDistributionType(poissonDistributionType); + if (result == null) result = caseDistributionParameter(poissonDistributionType); + if (result == null) result = caseParameterValue(poissonDistributionType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.PRIORITY_PARAMETERS: { + PriorityParameters priorityParameters = (PriorityParameters)theEObject; + T result = casePriorityParameters(priorityParameters); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.PROPERTY_PARAMETERS: { + PropertyParameters propertyParameters = (PropertyParameters)theEObject; + T result = casePropertyParameters(propertyParameters); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.PROPERTY_TYPE: { + PropertyType propertyType = (PropertyType)theEObject; + T result = casePropertyType(propertyType); + if (result == null) result = caseParameter(propertyType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.RESOURCE_PARAMETERS: { + ResourceParameters resourceParameters = (ResourceParameters)theEObject; + T result = caseResourceParameters(resourceParameters); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.SCENARIO: { + Scenario scenario = (Scenario)theEObject; + T result = caseScenario(scenario); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.SCENARIO_PARAMETERS: { + ScenarioParameters scenarioParameters = (ScenarioParameters)theEObject; + T result = caseScenarioParameters(scenarioParameters); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.SCENARIO_PARAMETERS_TYPE: { + ScenarioParametersType scenarioParametersType = (ScenarioParametersType)theEObject; + T result = caseScenarioParametersType(scenarioParametersType); + if (result == null) result = caseScenarioParameters(scenarioParametersType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.STRING_PARAMETER_TYPE: { + StringParameterType stringParameterType = (StringParameterType)theEObject; + T result = caseStringParameterType(stringParameterType); + if (result == null) result = caseConstantParameter(stringParameterType); + if (result == null) result = caseParameterValue(stringParameterType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.TIME_PARAMETERS: { + TimeParameters timeParameters = (TimeParameters)theEObject; + T result = caseTimeParameters(timeParameters); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.TRIANGULAR_DISTRIBUTION_TYPE: { + TriangularDistributionType triangularDistributionType = (TriangularDistributionType)theEObject; + T result = caseTriangularDistributionType(triangularDistributionType); + if (result == null) result = caseDistributionParameter(triangularDistributionType); + if (result == null) result = caseParameterValue(triangularDistributionType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.TRUNCATED_NORMAL_DISTRIBUTION_TYPE: { + TruncatedNormalDistributionType truncatedNormalDistributionType = (TruncatedNormalDistributionType)theEObject; + T result = caseTruncatedNormalDistributionType(truncatedNormalDistributionType); + if (result == null) result = caseDistributionParameter(truncatedNormalDistributionType); + if (result == null) result = caseParameterValue(truncatedNormalDistributionType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.UNIFORM_DISTRIBUTION_TYPE: { + UniformDistributionType uniformDistributionType = (UniformDistributionType)theEObject; + T result = caseUniformDistributionType(uniformDistributionType); + if (result == null) result = caseDistributionParameter(uniformDistributionType); + if (result == null) result = caseParameterValue(uniformDistributionType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE: { + UserDistributionDataPointType userDistributionDataPointType = (UserDistributionDataPointType)theEObject; + T result = caseUserDistributionDataPointType(userDistributionDataPointType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.USER_DISTRIBUTION_TYPE: { + UserDistributionType userDistributionType = (UserDistributionType)theEObject; + T result = caseUserDistributionType(userDistributionType); + if (result == null) result = caseDistributionParameter(userDistributionType); + if (result == null) result = caseParameterValue(userDistributionType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.VENDOR_EXTENSION: { + VendorExtension vendorExtension = (VendorExtension)theEObject; + T result = caseVendorExtension(vendorExtension); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BpsimPackage.WEIBULL_DISTRIBUTION_TYPE: { + WeibullDistributionType weibullDistributionType = (WeibullDistributionType)theEObject; + T result = caseWeibullDistributionType(weibullDistributionType); + if (result == null) result = caseDistributionParameter(weibullDistributionType); + if (result == null) result = caseParameterValue(weibullDistributionType); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Beta Distribution Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Beta Distribution Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBetaDistributionType(BetaDistributionType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Binomial Distribution Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Binomial Distribution Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBinomialDistributionType(BinomialDistributionType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Boolean Parameter Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Boolean Parameter Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBooleanParameterType(BooleanParameterType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'BP Sim Data Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'BP Sim Data Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBPSimDataType(BPSimDataType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Calendar'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Calendar'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCalendar(Calendar object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Constant Parameter'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Constant Parameter'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConstantParameter(ConstantParameter object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Control Parameters'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Control Parameters'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseControlParameters(ControlParameters object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Cost Parameters'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Cost Parameters'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCostParameters(CostParameters object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Date Time Parameter Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Date Time Parameter Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDateTimeParameterType(DateTimeParameterType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Distribution Parameter'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Distribution Parameter'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDistributionParameter(DistributionParameter object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Document Root'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Document Root'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDocumentRoot(DocumentRoot object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Duration Parameter Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Duration Parameter Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDurationParameterType(DurationParameterType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Element Parameters'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Element Parameters'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseElementParameters(ElementParameters object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Element Parameters Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Element Parameters Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseElementParametersType(ElementParametersType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Enum Parameter Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Enum Parameter Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEnumParameterType(EnumParameterType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Erlang Distribution Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Erlang Distribution Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseErlangDistributionType(ErlangDistributionType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Expression Parameter Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Expression Parameter Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseExpressionParameterType(ExpressionParameterType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Floating Parameter Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Floating Parameter Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFloatingParameterType(FloatingParameterType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Gamma Distribution Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Gamma Distribution Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGammaDistributionType(GammaDistributionType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Log Normal Distribution Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Log Normal Distribution Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseLogNormalDistributionType(LogNormalDistributionType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Negative Exponential Distribution Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Negative Exponential Distribution Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseNegativeExponentialDistributionType(NegativeExponentialDistributionType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Normal Distribution Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Normal Distribution Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseNormalDistributionType(NormalDistributionType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Numeric Parameter Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Numeric Parameter Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseNumericParameterType(NumericParameterType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Parameter'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Parameter'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseParameter(Parameter object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Parameter Value'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Parameter Value'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseParameterValue(ParameterValue object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Poisson Distribution Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Poisson Distribution Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePoissonDistributionType(PoissonDistributionType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Priority Parameters'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Priority Parameters'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePriorityParameters(PriorityParameters object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Property Parameters'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Property Parameters'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePropertyParameters(PropertyParameters object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Property Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Property Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePropertyType(PropertyType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Resource Parameters'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Resource Parameters'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseResourceParameters(ResourceParameters object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Scenario'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Scenario'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseScenario(Scenario object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Scenario Parameters'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Scenario Parameters'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseScenarioParameters(ScenarioParameters object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Scenario Parameters Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Scenario Parameters Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseScenarioParametersType(ScenarioParametersType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'String Parameter Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'String Parameter Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseStringParameterType(StringParameterType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Time Parameters'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Time Parameters'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTimeParameters(TimeParameters object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Triangular Distribution Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Triangular Distribution Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTriangularDistributionType(TriangularDistributionType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Truncated Normal Distribution Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Truncated Normal Distribution Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTruncatedNormalDistributionType(TruncatedNormalDistributionType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Uniform Distribution Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Uniform Distribution Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseUniformDistributionType(UniformDistributionType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'User Distribution Data Point Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'User Distribution Data Point Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseUserDistributionDataPointType(UserDistributionDataPointType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'User Distribution Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'User Distribution Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseUserDistributionType(UserDistributionType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Vendor Extension'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Vendor Extension'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseVendorExtension(VendorExtension object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Weibull Distribution Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Weibull Distribution Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseWeibullDistributionType(WeibullDistributionType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + public T defaultCase(EObject object) { + return null; + } + +} //BpsimSwitch diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Activity.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Activity.java new file mode 100644 index 00000000000..3801b8df3f1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Activity.java @@ -0,0 +1,253 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Activity'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Activity#getIoSpecification Io Specification}
  • + *
  • {@link org.eclipse.bpmn2.Activity#getBoundaryEventRefs Boundary Event Refs}
  • + *
  • {@link org.eclipse.bpmn2.Activity#getProperties Properties}
  • + *
  • {@link org.eclipse.bpmn2.Activity#getDataInputAssociations Data Input Associations}
  • + *
  • {@link org.eclipse.bpmn2.Activity#getDataOutputAssociations Data Output Associations}
  • + *
  • {@link org.eclipse.bpmn2.Activity#getResources Resources}
  • + *
  • {@link org.eclipse.bpmn2.Activity#getLoopCharacteristics Loop Characteristics}
  • + *
  • {@link org.eclipse.bpmn2.Activity#getCompletionQuantity Completion Quantity}
  • + *
  • {@link org.eclipse.bpmn2.Activity#getDefault Default}
  • + *
  • {@link org.eclipse.bpmn2.Activity#isIsForCompensation Is For Compensation}
  • + *
  • {@link org.eclipse.bpmn2.Activity#getStartQuantity Start Quantity}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getActivity() + * @model extendedMetaData="name='tActivity' kind='elementOnly' abstract='true'" + * @generated + */ +public interface Activity extends FlowNode { + /** + * Returns the value of the 'Io Specification' containment reference. + * + * + * @return the value of the 'Io Specification' containment reference. + * @see #setIoSpecification(InputOutputSpecification) + * @see org.eclipse.bpmn2.Bpmn2Package#getActivity_IoSpecification() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='ioSpecification' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + InputOutputSpecification getIoSpecification(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Activity#getIoSpecification Io Specification}' containment reference. + * + * + * @param value the new value of the 'Io Specification' containment reference. + * @see #getIoSpecification() + * @generated + */ + void setIoSpecification(InputOutputSpecification value); + + /** + * Returns the value of the 'Boundary Event Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.BoundaryEvent}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.BoundaryEvent#getAttachedToRef Attached To Ref}'. + * + * + * @return the value of the 'Boundary Event Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getActivity_BoundaryEventRefs() + * @see org.eclipse.bpmn2.BoundaryEvent#getAttachedToRef + * @model opposite="attachedToRef" resolveProxies="false" transient="true" derived="true" ordered="false" + * @generated + */ + EList getBoundaryEventRefs(); + + /** + * Returns the value of the 'Properties' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Property}. + * + * + * @return the value of the 'Properties' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getActivity_Properties() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='property' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getProperties(); + + /** + * Returns the value of the 'Data Input Associations' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataInputAssociation}. + * + * + * @return the value of the 'Data Input Associations' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getActivity_DataInputAssociations() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='dataInputAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getDataInputAssociations(); + + /** + * Returns the value of the 'Data Output Associations' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataOutputAssociation}. + * + * + * @return the value of the 'Data Output Associations' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getActivity_DataOutputAssociations() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='dataOutputAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getDataOutputAssociations(); + + /** + * Returns the value of the 'Resources' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ResourceRole}. + * + * + * @return the value of the 'Resources' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getActivity_Resources() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='resourceRole' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#resourceRole'" + * @generated + */ + EList getResources(); + + /** + * Returns the value of the 'Loop Characteristics' containment reference. + * + * + * @return the value of the 'Loop Characteristics' containment reference. + * @see #setLoopCharacteristics(LoopCharacteristics) + * @see org.eclipse.bpmn2.Bpmn2Package#getActivity_LoopCharacteristics() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='loopCharacteristics' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#loopCharacteristics'" + * @generated + */ + LoopCharacteristics getLoopCharacteristics(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Activity#getLoopCharacteristics Loop Characteristics}' containment reference. + * + * + * @param value the new value of the 'Loop Characteristics' containment reference. + * @see #getLoopCharacteristics() + * @generated + */ + void setLoopCharacteristics(LoopCharacteristics value); + + /** + * Returns the value of the 'Completion Quantity' attribute. + * The default value is "1". + * + * + * @return the value of the 'Completion Quantity' attribute. + * @see #setCompletionQuantity(int) + * @see org.eclipse.bpmn2.Bpmn2Package#getActivity_CompletionQuantity() + * @model default="1" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='completionQuantity'" + * @generated + */ + int getCompletionQuantity(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Activity#getCompletionQuantity Completion Quantity}' attribute. + * + * + * @param value the new value of the 'Completion Quantity' attribute. + * @see #getCompletionQuantity() + * @generated + */ + void setCompletionQuantity(int value); + + /** + * Returns the value of the 'Default' reference. + * + * + * @return the value of the 'Default' reference. + * @see #setDefault(SequenceFlow) + * @see org.eclipse.bpmn2.Bpmn2Package#getActivity_Default() + * @model resolveProxies="false" ordered="false" + * extendedMetaData="kind='attribute' name='default'" + * @generated + */ + SequenceFlow getDefault(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Activity#getDefault Default}' reference. + * + * + * @param value the new value of the 'Default' reference. + * @see #getDefault() + * @generated + */ + void setDefault(SequenceFlow value); + + /** + * Returns the value of the 'Is For Compensation' attribute. + * The default value is "false". + * + * + * @return the value of the 'Is For Compensation' attribute. + * @see #setIsForCompensation(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getActivity_IsForCompensation() + * @model default="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='isForCompensation'" + * @generated + */ + boolean isIsForCompensation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Activity#isIsForCompensation Is For Compensation}' attribute. + * + * + * @param value the new value of the 'Is For Compensation' attribute. + * @see #isIsForCompensation() + * @generated + */ + void setIsForCompensation(boolean value); + + /** + * Returns the value of the 'Start Quantity' attribute. + * The default value is "1". + * + * + * @return the value of the 'Start Quantity' attribute. + * @see #setStartQuantity(int) + * @see org.eclipse.bpmn2.Bpmn2Package#getActivity_StartQuantity() + * @model default="1" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='startQuantity'" + * @generated + */ + int getStartQuantity(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Activity#getStartQuantity Start Quantity}' attribute. + * + * + * @param value the new value of the 'Start Quantity' attribute. + * @see #getStartQuantity() + * @generated + */ + void setStartQuantity(int value); + +} // Activity diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/AdHocOrdering.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/AdHocOrdering.java new file mode 100644 index 00000000000..bba959e825c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/AdHocOrdering.java @@ -0,0 +1,219 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Ad Hoc Ordering', + * and utility methods for working with them. + * + * @see org.eclipse.bpmn2.Bpmn2Package#getAdHocOrdering() + * @model extendedMetaData="name='tAdHocOrdering'" + * @generated + */ +public enum AdHocOrdering implements Enumerator { + /** + * The 'Parallel' literal object. + * + * + * @see #PARALLEL_VALUE + * @generated + * @ordered + */ + PARALLEL(0, "Parallel", "Parallel"), + + /** + * The 'Sequential' literal object. + * + * + * @see #SEQUENTIAL_VALUE + * @generated + * @ordered + */ + SEQUENTIAL(1, "Sequential", "Sequential"); + + /** + * The 'Parallel' literal value. + * + * + * @see #PARALLEL + * @model name="Parallel" + * @generated + * @ordered + */ + public static final int PARALLEL_VALUE = 0; + + /** + * The 'Sequential' literal value. + * + * + * @see #SEQUENTIAL + * @model name="Sequential" + * @generated + * @ordered + */ + public static final int SEQUENTIAL_VALUE = 1; + + /** + * An array of all the 'Ad Hoc Ordering' enumerators. + * + * + * @generated + */ + private static final AdHocOrdering[] VALUES_ARRAY = new AdHocOrdering[] { PARALLEL, SEQUENTIAL, }; + + /** + * A public read-only list of all the 'Ad Hoc Ordering' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Ad Hoc Ordering' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static AdHocOrdering get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + AdHocOrdering result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Ad Hoc Ordering' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static AdHocOrdering getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + AdHocOrdering result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Ad Hoc Ordering' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static AdHocOrdering get(int value) { + switch (value) { + case PARALLEL_VALUE: + return PARALLEL; + case SEQUENTIAL_VALUE: + return SEQUENTIAL; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private AdHocOrdering(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //AdHocOrdering diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/AdHocSubProcess.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/AdHocSubProcess.java new file mode 100644 index 00000000000..1e61f78bf19 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/AdHocSubProcess.java @@ -0,0 +1,109 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Ad Hoc Sub Process'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.AdHocSubProcess#getCompletionCondition Completion Condition}
  • + *
  • {@link org.eclipse.bpmn2.AdHocSubProcess#isCancelRemainingInstances Cancel Remaining Instances}
  • + *
  • {@link org.eclipse.bpmn2.AdHocSubProcess#getOrdering Ordering}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getAdHocSubProcess() + * @model extendedMetaData="name='tAdHocSubProcess' kind='elementOnly'" + * @generated + */ +public interface AdHocSubProcess extends SubProcess { + /** + * Returns the value of the 'Completion Condition' containment reference. + * + * + * @return the value of the 'Completion Condition' containment reference. + * @see #setCompletionCondition(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getAdHocSubProcess_CompletionCondition() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='completionCondition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Expression getCompletionCondition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.AdHocSubProcess#getCompletionCondition Completion Condition}' containment reference. + * + * + * @param value the new value of the 'Completion Condition' containment reference. + * @see #getCompletionCondition() + * @generated + */ + void setCompletionCondition(Expression value); + + /** + * Returns the value of the 'Cancel Remaining Instances' attribute. + * The default value is "true". + * + * + * @return the value of the 'Cancel Remaining Instances' attribute. + * @see #setCancelRemainingInstances(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getAdHocSubProcess_CancelRemainingInstances() + * @model default="true" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='cancelRemainingInstances'" + * @generated + */ + boolean isCancelRemainingInstances(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.AdHocSubProcess#isCancelRemainingInstances Cancel Remaining Instances}' attribute. + * + * + * @param value the new value of the 'Cancel Remaining Instances' attribute. + * @see #isCancelRemainingInstances() + * @generated + */ + void setCancelRemainingInstances(boolean value); + + /** + * Returns the value of the 'Ordering' attribute. + * The literals are from the enumeration {@link org.eclipse.bpmn2.AdHocOrdering}. + * + * + * @return the value of the 'Ordering' attribute. + * @see org.eclipse.bpmn2.AdHocOrdering + * @see #setOrdering(AdHocOrdering) + * @see org.eclipse.bpmn2.Bpmn2Package#getAdHocSubProcess_Ordering() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='ordering'" + * @generated + */ + AdHocOrdering getOrdering(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.AdHocSubProcess#getOrdering Ordering}' attribute. + * + * + * @param value the new value of the 'Ordering' attribute. + * @see org.eclipse.bpmn2.AdHocOrdering + * @see #getOrdering() + * @generated + */ + void setOrdering(AdHocOrdering value); + +} // AdHocSubProcess diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Artifact.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Artifact.java new file mode 100644 index 00000000000..0dabd10e12b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Artifact.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Artifact'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getArtifact() + * @model extendedMetaData="name='tArtifact' kind='elementOnly' abstract='true'" + * @generated + */ +public interface Artifact extends BaseElement { +} // Artifact diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Assignment.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Assignment.java new file mode 100644 index 00000000000..0ced8fde142 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Assignment.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Assignment'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Assignment#getFrom From}
  • + *
  • {@link org.eclipse.bpmn2.Assignment#getTo To}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getAssignment() + * @model extendedMetaData="name='tAssignment' kind='elementOnly'" + * @generated + */ +public interface Assignment extends BaseElement { + /** + * Returns the value of the 'From' containment reference. + * + * + * @return the value of the 'From' containment reference. + * @see #setFrom(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getAssignment_From() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='from' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Expression getFrom(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Assignment#getFrom From}' containment reference. + * + * + * @param value the new value of the 'From' containment reference. + * @see #getFrom() + * @generated + */ + void setFrom(Expression value); + + /** + * Returns the value of the 'To' containment reference. + * + * + * @return the value of the 'To' containment reference. + * @see #setTo(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getAssignment_To() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='to' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Expression getTo(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Assignment#getTo To}' containment reference. + * + * + * @param value the new value of the 'To' containment reference. + * @see #getTo() + * @generated + */ + void setTo(Expression value); + +} // Assignment diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Association.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Association.java new file mode 100644 index 00000000000..484a7ffe1bb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Association.java @@ -0,0 +1,108 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Association'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Association#getAssociationDirection Association Direction}
  • + *
  • {@link org.eclipse.bpmn2.Association#getSourceRef Source Ref}
  • + *
  • {@link org.eclipse.bpmn2.Association#getTargetRef Target Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getAssociation() + * @model extendedMetaData="name='tAssociation' kind='elementOnly'" + * @generated + */ +public interface Association extends Artifact { + /** + * Returns the value of the 'Association Direction' attribute. + * The literals are from the enumeration {@link org.eclipse.bpmn2.AssociationDirection}. + * + * + * @return the value of the 'Association Direction' attribute. + * @see org.eclipse.bpmn2.AssociationDirection + * @see #setAssociationDirection(AssociationDirection) + * @see org.eclipse.bpmn2.Bpmn2Package#getAssociation_AssociationDirection() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='associationDirection'" + * @generated + */ + AssociationDirection getAssociationDirection(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Association#getAssociationDirection Association Direction}' attribute. + * + * + * @param value the new value of the 'Association Direction' attribute. + * @see org.eclipse.bpmn2.AssociationDirection + * @see #getAssociationDirection() + * @generated + */ + void setAssociationDirection(AssociationDirection value); + + /** + * Returns the value of the 'Source Ref' reference. + * + * + * @return the value of the 'Source Ref' reference. + * @see #setSourceRef(BaseElement) + * @see org.eclipse.bpmn2.Bpmn2Package#getAssociation_SourceRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='sourceRef'" + * @generated + */ + BaseElement getSourceRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Association#getSourceRef Source Ref}' reference. + * + * + * @param value the new value of the 'Source Ref' reference. + * @see #getSourceRef() + * @generated + */ + void setSourceRef(BaseElement value); + + /** + * Returns the value of the 'Target Ref' reference. + * + * + * @return the value of the 'Target Ref' reference. + * @see #setTargetRef(BaseElement) + * @see org.eclipse.bpmn2.Bpmn2Package#getAssociation_TargetRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='targetRef'" + * @generated + */ + BaseElement getTargetRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Association#getTargetRef Target Ref}' reference. + * + * + * @param value the new value of the 'Target Ref' reference. + * @see #getTargetRef() + * @generated + */ + void setTargetRef(BaseElement value); + +} // Association diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/AssociationDirection.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/AssociationDirection.java new file mode 100644 index 00000000000..c5c98a2bdc6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/AssociationDirection.java @@ -0,0 +1,242 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Association Direction', + * and utility methods for working with them. + * + * @see org.eclipse.bpmn2.Bpmn2Package#getAssociationDirection() + * @model extendedMetaData="name='tAssociationDirection'" + * @generated + */ +public enum AssociationDirection implements Enumerator { + /** + * The 'None' literal object. + * + * + * @see #NONE_VALUE + * @generated + * @ordered + */ + NONE(0, "None", "None"), + + /** + * The 'One' literal object. + * + * + * @see #ONE_VALUE + * @generated + * @ordered + */ + ONE(1, "One", "One"), + + /** + * The 'Both' literal object. + * + * + * @see #BOTH_VALUE + * @generated + * @ordered + */ + BOTH(2, "Both", "Both"); + + /** + * The 'None' literal value. + * + * + * @see #NONE + * @model name="None" + * @generated + * @ordered + */ + public static final int NONE_VALUE = 0; + + /** + * The 'One' literal value. + * + * + * @see #ONE + * @model name="One" + * @generated + * @ordered + */ + public static final int ONE_VALUE = 1; + + /** + * The 'Both' literal value. + * + * + * @see #BOTH + * @model name="Both" + * @generated + * @ordered + */ + public static final int BOTH_VALUE = 2; + + /** + * An array of all the 'Association Direction' enumerators. + * + * + * @generated + */ + private static final AssociationDirection[] VALUES_ARRAY = new AssociationDirection[] { NONE, ONE, BOTH, }; + + /** + * A public read-only list of all the 'Association Direction' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Association Direction' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static AssociationDirection get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + AssociationDirection result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Association Direction' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static AssociationDirection getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + AssociationDirection result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Association Direction' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static AssociationDirection get(int value) { + switch (value) { + case NONE_VALUE: + return NONE; + case ONE_VALUE: + return ONE; + case BOTH_VALUE: + return BOTH; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private AssociationDirection(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //AssociationDirection diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Auditing.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Auditing.java new file mode 100644 index 00000000000..abfae92fdae --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Auditing.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Auditing'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getAuditing() + * @model extendedMetaData="name='tAuditing' kind='elementOnly'" + * @generated + */ +public interface Auditing extends BaseElement { +} // Auditing diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/BaseElement.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/BaseElement.java new file mode 100644 index 00000000000..3e857c33dcf --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/BaseElement.java @@ -0,0 +1,118 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'Base Element'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.BaseElement#getDocumentation Documentation}
  • + *
  • {@link org.eclipse.bpmn2.BaseElement#getExtensionValues Extension Values}
  • + *
  • {@link org.eclipse.bpmn2.BaseElement#getExtensionDefinitions Extension Definitions}
  • + *
  • {@link org.eclipse.bpmn2.BaseElement#getId Id}
  • + *
  • {@link org.eclipse.bpmn2.BaseElement#getAnyAttribute Any Attribute}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getBaseElement() + * @model extendedMetaData="name='tBaseElement' kind='elementOnly' abstract='true'" + * @generated + */ +public interface BaseElement extends EObject { + /** + * Returns the value of the 'Documentation' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Documentation}. + * + * + * @return the value of the 'Documentation' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getBaseElement_Documentation() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='documentation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getDocumentation(); + + /** + * Returns the value of the 'Extension Values' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ExtensionAttributeValue}. + * + * + * @return the value of the 'Extension Values' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getBaseElement_ExtensionValues() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='extensionElements' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getExtensionValues(); + + /** + * Returns the value of the 'Extension Definitions' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ExtensionDefinition}. + * + * + * @return the value of the 'Extension Definitions' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getBaseElement_ExtensionDefinitions() + * @model ordered="false" + * @generated + */ + EList getExtensionDefinitions(); + + /** + * Returns the value of the 'Id' attribute. + * + * + * @return the value of the 'Id' attribute. + * @see #setId(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getBaseElement_Id() + * @model id="true" dataType="org.eclipse.emf.ecore.xml.type.NCName" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='id'" + * @generated + */ + String getId(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.BaseElement#getId Id}' attribute. + * + * + * @param value the new value of the 'Id' attribute. + * @see #getId() + * @generated + */ + void setId(String value); + + /** + * Returns the value of the 'Any Attribute' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Any Attribute' attribute list. + * @see org.eclipse.bpmn2.Bpmn2Package#getBaseElement_AnyAttribute() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='attributeWildcard' wildcards='##other' name=':3' processing='lax'" + * @generated + */ + FeatureMap getAnyAttribute(); + +} // BaseElement diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/BoundaryEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/BoundaryEvent.java new file mode 100644 index 00000000000..7bcd9798336 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/BoundaryEvent.java @@ -0,0 +1,84 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Boundary Event'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.BoundaryEvent#getAttachedToRef Attached To Ref}
  • + *
  • {@link org.eclipse.bpmn2.BoundaryEvent#isCancelActivity Cancel Activity}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getBoundaryEvent() + * @model extendedMetaData="name='tBoundaryEvent' kind='elementOnly'" + * @generated + */ +public interface BoundaryEvent extends CatchEvent { + /** + * Returns the value of the 'Attached To Ref' reference. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.Activity#getBoundaryEventRefs Boundary Event Refs}'. + * + * + * @return the value of the 'Attached To Ref' reference. + * @see #setAttachedToRef(Activity) + * @see org.eclipse.bpmn2.Bpmn2Package#getBoundaryEvent_AttachedToRef() + * @see org.eclipse.bpmn2.Activity#getBoundaryEventRefs + * @model opposite="boundaryEventRefs" resolveProxies="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='attachedToRef'" + * @generated + */ + Activity getAttachedToRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.BoundaryEvent#getAttachedToRef Attached To Ref}' reference. + * + * + * @param value the new value of the 'Attached To Ref' reference. + * @see #getAttachedToRef() + * @generated + */ + void setAttachedToRef(Activity value); + + /** + * Returns the value of the 'Cancel Activity' attribute. + * The default value is "true". + * + * + * @return the value of the 'Cancel Activity' attribute. + * @see #setCancelActivity(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getBoundaryEvent_CancelActivity() + * @model default="true" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='cancelActivity'" + * @generated + */ + boolean isCancelActivity(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.BoundaryEvent#isCancelActivity Cancel Activity}' attribute. + * + * + * @param value the new value of the 'Cancel Activity' attribute. + * @see #isCancelActivity() + * @generated + */ + void setCancelActivity(boolean value); + +} // BoundaryEvent diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Bpmn2Factory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Bpmn2Factory.java new file mode 100644 index 00000000000..642091eb966 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Bpmn2Factory.java @@ -0,0 +1,1215 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see org.eclipse.bpmn2.Bpmn2Package + * @generated + */ +public interface Bpmn2Factory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + Bpmn2Factory eINSTANCE = org.eclipse.bpmn2.impl.Bpmn2FactoryImpl.init(); + + /** + * Returns a new object of class 'Document Root'. + * + * + * @return a new object of class 'Document Root'. + * @generated + */ + DocumentRoot createDocumentRoot(); + + /** + * Returns a new object of class 'Activity'. + * + * + * @return a new object of class 'Activity'. + * @generated + */ + Activity createActivity(); + + /** + * Returns a new object of class 'Ad Hoc Sub Process'. + * + * + * @return a new object of class 'Ad Hoc Sub Process'. + * @generated + */ + AdHocSubProcess createAdHocSubProcess(); + + /** + * Returns a new object of class 'Artifact'. + * + * + * @return a new object of class 'Artifact'. + * @generated + */ + Artifact createArtifact(); + + /** + * Returns a new object of class 'Assignment'. + * + * + * @return a new object of class 'Assignment'. + * @generated + */ + Assignment createAssignment(); + + /** + * Returns a new object of class 'Association'. + * + * + * @return a new object of class 'Association'. + * @generated + */ + Association createAssociation(); + + /** + * Returns a new object of class 'Auditing'. + * + * + * @return a new object of class 'Auditing'. + * @generated + */ + Auditing createAuditing(); + + /** + * Returns a new object of class 'Base Element'. + * + * + * @return a new object of class 'Base Element'. + * @generated + */ + BaseElement createBaseElement(); + + /** + * Returns a new object of class 'Boundary Event'. + * + * + * @return a new object of class 'Boundary Event'. + * @generated + */ + BoundaryEvent createBoundaryEvent(); + + /** + * Returns a new object of class 'Business Rule Task'. + * + * + * @return a new object of class 'Business Rule Task'. + * @generated + */ + BusinessRuleTask createBusinessRuleTask(); + + /** + * Returns a new object of class 'Call Activity'. + * + * + * @return a new object of class 'Call Activity'. + * @generated + */ + CallActivity createCallActivity(); + + /** + * Returns a new object of class 'Call Choreography'. + * + * + * @return a new object of class 'Call Choreography'. + * @generated + */ + CallChoreography createCallChoreography(); + + /** + * Returns a new object of class 'Call Conversation'. + * + * + * @return a new object of class 'Call Conversation'. + * @generated + */ + CallConversation createCallConversation(); + + /** + * Returns a new object of class 'Callable Element'. + * + * + * @return a new object of class 'Callable Element'. + * @generated + */ + CallableElement createCallableElement(); + + /** + * Returns a new object of class 'Cancel Event Definition'. + * + * + * @return a new object of class 'Cancel Event Definition'. + * @generated + */ + CancelEventDefinition createCancelEventDefinition(); + + /** + * Returns a new object of class 'Category'. + * + * + * @return a new object of class 'Category'. + * @generated + */ + Category createCategory(); + + /** + * Returns a new object of class 'Category Value'. + * + * + * @return a new object of class 'Category Value'. + * @generated + */ + CategoryValue createCategoryValue(); + + /** + * Returns a new object of class 'Choreography'. + * + * + * @return a new object of class 'Choreography'. + * @generated + */ + Choreography createChoreography(); + + /** + * Returns a new object of class 'Choreography Task'. + * + * + * @return a new object of class 'Choreography Task'. + * @generated + */ + ChoreographyTask createChoreographyTask(); + + /** + * Returns a new object of class 'Collaboration'. + * + * + * @return a new object of class 'Collaboration'. + * @generated + */ + Collaboration createCollaboration(); + + /** + * Returns a new object of class 'Compensate Event Definition'. + * + * + * @return a new object of class 'Compensate Event Definition'. + * @generated + */ + CompensateEventDefinition createCompensateEventDefinition(); + + /** + * Returns a new object of class 'Complex Behavior Definition'. + * + * + * @return a new object of class 'Complex Behavior Definition'. + * @generated + */ + ComplexBehaviorDefinition createComplexBehaviorDefinition(); + + /** + * Returns a new object of class 'Complex Gateway'. + * + * + * @return a new object of class 'Complex Gateway'. + * @generated + */ + ComplexGateway createComplexGateway(); + + /** + * Returns a new object of class 'Conditional Event Definition'. + * + * + * @return a new object of class 'Conditional Event Definition'. + * @generated + */ + ConditionalEventDefinition createConditionalEventDefinition(); + + /** + * Returns a new object of class 'Conversation'. + * + * + * @return a new object of class 'Conversation'. + * @generated + */ + Conversation createConversation(); + + /** + * Returns a new object of class 'Conversation Association'. + * + * + * @return a new object of class 'Conversation Association'. + * @generated + */ + ConversationAssociation createConversationAssociation(); + + /** + * Returns a new object of class 'Conversation Link'. + * + * + * @return a new object of class 'Conversation Link'. + * @generated + */ + ConversationLink createConversationLink(); + + /** + * Returns a new object of class 'Conversation Node'. + * + * + * @return a new object of class 'Conversation Node'. + * @generated + */ + ConversationNode createConversationNode(); + + /** + * Returns a new object of class 'Correlation Key'. + * + * + * @return a new object of class 'Correlation Key'. + * @generated + */ + CorrelationKey createCorrelationKey(); + + /** + * Returns a new object of class 'Correlation Property'. + * + * + * @return a new object of class 'Correlation Property'. + * @generated + */ + CorrelationProperty createCorrelationProperty(); + + /** + * Returns a new object of class 'Correlation Property Binding'. + * + * + * @return a new object of class 'Correlation Property Binding'. + * @generated + */ + CorrelationPropertyBinding createCorrelationPropertyBinding(); + + /** + * Returns a new object of class 'Correlation Property Retrieval Expression'. + * + * + * @return a new object of class 'Correlation Property Retrieval Expression'. + * @generated + */ + CorrelationPropertyRetrievalExpression createCorrelationPropertyRetrievalExpression(); + + /** + * Returns a new object of class 'Correlation Subscription'. + * + * + * @return a new object of class 'Correlation Subscription'. + * @generated + */ + CorrelationSubscription createCorrelationSubscription(); + + /** + * Returns a new object of class 'Data Association'. + * + * + * @return a new object of class 'Data Association'. + * @generated + */ + DataAssociation createDataAssociation(); + + /** + * Returns a new object of class 'Data Input'. + * + * + * @return a new object of class 'Data Input'. + * @generated + */ + DataInput createDataInput(); + + /** + * Returns a new object of class 'Data Input Association'. + * + * + * @return a new object of class 'Data Input Association'. + * @generated + */ + DataInputAssociation createDataInputAssociation(); + + /** + * Returns a new object of class 'Data Object'. + * + * + * @return a new object of class 'Data Object'. + * @generated + */ + DataObject createDataObject(); + + /** + * Returns a new object of class 'Data Object Reference'. + * + * + * @return a new object of class 'Data Object Reference'. + * @generated + */ + DataObjectReference createDataObjectReference(); + + /** + * Returns a new object of class 'Data Output'. + * + * + * @return a new object of class 'Data Output'. + * @generated + */ + DataOutput createDataOutput(); + + /** + * Returns a new object of class 'Data Output Association'. + * + * + * @return a new object of class 'Data Output Association'. + * @generated + */ + DataOutputAssociation createDataOutputAssociation(); + + /** + * Returns a new object of class 'Data State'. + * + * + * @return a new object of class 'Data State'. + * @generated + */ + DataState createDataState(); + + /** + * Returns a new object of class 'Data Store'. + * + * + * @return a new object of class 'Data Store'. + * @generated + */ + DataStore createDataStore(); + + /** + * Returns a new object of class 'Data Store Reference'. + * + * + * @return a new object of class 'Data Store Reference'. + * @generated + */ + DataStoreReference createDataStoreReference(); + + /** + * Returns a new object of class 'Definitions'. + * + * + * @return a new object of class 'Definitions'. + * @generated + */ + Definitions createDefinitions(); + + /** + * Returns a new object of class 'Documentation'. + * + * + * @return a new object of class 'Documentation'. + * @generated + */ + Documentation createDocumentation(); + + /** + * Returns a new object of class 'End Event'. + * + * + * @return a new object of class 'End Event'. + * @generated + */ + EndEvent createEndEvent(); + + /** + * Returns a new object of class 'End Point'. + * + * + * @return a new object of class 'End Point'. + * @generated + */ + EndPoint createEndPoint(); + + /** + * Returns a new object of class 'Error'. + * + * + * @return a new object of class 'Error'. + * @generated + */ + Error createError(); + + /** + * Returns a new object of class 'Error Event Definition'. + * + * + * @return a new object of class 'Error Event Definition'. + * @generated + */ + ErrorEventDefinition createErrorEventDefinition(); + + /** + * Returns a new object of class 'Escalation'. + * + * + * @return a new object of class 'Escalation'. + * @generated + */ + Escalation createEscalation(); + + /** + * Returns a new object of class 'Escalation Event Definition'. + * + * + * @return a new object of class 'Escalation Event Definition'. + * @generated + */ + EscalationEventDefinition createEscalationEventDefinition(); + + /** + * Returns a new object of class 'Event Based Gateway'. + * + * + * @return a new object of class 'Event Based Gateway'. + * @generated + */ + EventBasedGateway createEventBasedGateway(); + + /** + * Returns a new object of class 'Event Definition'. + * + * + * @return a new object of class 'Event Definition'. + * @generated + */ + EventDefinition createEventDefinition(); + + /** + * Returns a new object of class 'Exclusive Gateway'. + * + * + * @return a new object of class 'Exclusive Gateway'. + * @generated + */ + ExclusiveGateway createExclusiveGateway(); + + /** + * Returns a new object of class 'Expression'. + * + * + * @return a new object of class 'Expression'. + * @generated + */ + Expression createExpression(); + + /** + * Returns a new object of class 'Extension'. + * + * + * @return a new object of class 'Extension'. + * @generated + */ + Extension createExtension(); + + /** + * Returns a new object of class 'Extension Attribute Definition'. + * + * + * @return a new object of class 'Extension Attribute Definition'. + * @generated + */ + ExtensionAttributeDefinition createExtensionAttributeDefinition(); + + /** + * Returns a new object of class 'Extension Attribute Value'. + * + * + * @return a new object of class 'Extension Attribute Value'. + * @generated + */ + ExtensionAttributeValue createExtensionAttributeValue(); + + /** + * Returns a new object of class 'Extension Definition'. + * + * + * @return a new object of class 'Extension Definition'. + * @generated + */ + ExtensionDefinition createExtensionDefinition(); + + /** + * Returns a new object of class 'Formal Expression'. + * + * + * @return a new object of class 'Formal Expression'. + * @generated + */ + FormalExpression createFormalExpression(); + + /** + * Returns a new object of class 'Global Business Rule Task'. + * + * + * @return a new object of class 'Global Business Rule Task'. + * @generated + */ + GlobalBusinessRuleTask createGlobalBusinessRuleTask(); + + /** + * Returns a new object of class 'Global Choreography Task'. + * + * + * @return a new object of class 'Global Choreography Task'. + * @generated + */ + GlobalChoreographyTask createGlobalChoreographyTask(); + + /** + * Returns a new object of class 'Global Conversation'. + * + * + * @return a new object of class 'Global Conversation'. + * @generated + */ + GlobalConversation createGlobalConversation(); + + /** + * Returns a new object of class 'Global Manual Task'. + * + * + * @return a new object of class 'Global Manual Task'. + * @generated + */ + GlobalManualTask createGlobalManualTask(); + + /** + * Returns a new object of class 'Global Script Task'. + * + * + * @return a new object of class 'Global Script Task'. + * @generated + */ + GlobalScriptTask createGlobalScriptTask(); + + /** + * Returns a new object of class 'Global Task'. + * + * + * @return a new object of class 'Global Task'. + * @generated + */ + GlobalTask createGlobalTask(); + + /** + * Returns a new object of class 'Global User Task'. + * + * + * @return a new object of class 'Global User Task'. + * @generated + */ + GlobalUserTask createGlobalUserTask(); + + /** + * Returns a new object of class 'Group'. + * + * + * @return a new object of class 'Group'. + * @generated + */ + Group createGroup(); + + /** + * Returns a new object of class 'Human Performer'. + * + * + * @return a new object of class 'Human Performer'. + * @generated + */ + HumanPerformer createHumanPerformer(); + + /** + * Returns a new object of class 'Implicit Throw Event'. + * + * + * @return a new object of class 'Implicit Throw Event'. + * @generated + */ + ImplicitThrowEvent createImplicitThrowEvent(); + + /** + * Returns a new object of class 'Import'. + * + * + * @return a new object of class 'Import'. + * @generated + */ + Import createImport(); + + /** + * Returns a new object of class 'Inclusive Gateway'. + * + * + * @return a new object of class 'Inclusive Gateway'. + * @generated + */ + InclusiveGateway createInclusiveGateway(); + + /** + * Returns a new object of class 'Input Output Binding'. + * + * + * @return a new object of class 'Input Output Binding'. + * @generated + */ + InputOutputBinding createInputOutputBinding(); + + /** + * Returns a new object of class 'Input Output Specification'. + * + * + * @return a new object of class 'Input Output Specification'. + * @generated + */ + InputOutputSpecification createInputOutputSpecification(); + + /** + * Returns a new object of class 'Input Set'. + * + * + * @return a new object of class 'Input Set'. + * @generated + */ + InputSet createInputSet(); + + /** + * Returns a new object of class 'Interaction Node'. + * + * + * @return a new object of class 'Interaction Node'. + * @generated + */ + InteractionNode createInteractionNode(); + + /** + * Returns a new object of class 'Interface'. + * + * + * @return a new object of class 'Interface'. + * @generated + */ + Interface createInterface(); + + /** + * Returns a new object of class 'Intermediate Catch Event'. + * + * + * @return a new object of class 'Intermediate Catch Event'. + * @generated + */ + IntermediateCatchEvent createIntermediateCatchEvent(); + + /** + * Returns a new object of class 'Intermediate Throw Event'. + * + * + * @return a new object of class 'Intermediate Throw Event'. + * @generated + */ + IntermediateThrowEvent createIntermediateThrowEvent(); + + /** + * Returns a new object of class 'Item Aware Element'. + * + * + * @return a new object of class 'Item Aware Element'. + * @generated + */ + ItemAwareElement createItemAwareElement(); + + /** + * Returns a new object of class 'Item Definition'. + * + * + * @return a new object of class 'Item Definition'. + * @generated + */ + ItemDefinition createItemDefinition(); + + /** + * Returns a new object of class 'Lane'. + * + * + * @return a new object of class 'Lane'. + * @generated + */ + Lane createLane(); + + /** + * Returns a new object of class 'Lane Set'. + * + * + * @return a new object of class 'Lane Set'. + * @generated + */ + LaneSet createLaneSet(); + + /** + * Returns a new object of class 'Link Event Definition'. + * + * + * @return a new object of class 'Link Event Definition'. + * @generated + */ + LinkEventDefinition createLinkEventDefinition(); + + /** + * Returns a new object of class 'Manual Task'. + * + * + * @return a new object of class 'Manual Task'. + * @generated + */ + ManualTask createManualTask(); + + /** + * Returns a new object of class 'Message'. + * + * + * @return a new object of class 'Message'. + * @generated + */ + Message createMessage(); + + /** + * Returns a new object of class 'Message Event Definition'. + * + * + * @return a new object of class 'Message Event Definition'. + * @generated + */ + MessageEventDefinition createMessageEventDefinition(); + + /** + * Returns a new object of class 'Message Flow'. + * + * + * @return a new object of class 'Message Flow'. + * @generated + */ + MessageFlow createMessageFlow(); + + /** + * Returns a new object of class 'Message Flow Association'. + * + * + * @return a new object of class 'Message Flow Association'. + * @generated + */ + MessageFlowAssociation createMessageFlowAssociation(); + + /** + * Returns a new object of class 'Monitoring'. + * + * + * @return a new object of class 'Monitoring'. + * @generated + */ + Monitoring createMonitoring(); + + /** + * Returns a new object of class 'Multi Instance Loop Characteristics'. + * + * + * @return a new object of class 'Multi Instance Loop Characteristics'. + * @generated + */ + MultiInstanceLoopCharacteristics createMultiInstanceLoopCharacteristics(); + + /** + * Returns a new object of class 'Operation'. + * + * + * @return a new object of class 'Operation'. + * @generated + */ + Operation createOperation(); + + /** + * Returns a new object of class 'Output Set'. + * + * + * @return a new object of class 'Output Set'. + * @generated + */ + OutputSet createOutputSet(); + + /** + * Returns a new object of class 'Parallel Gateway'. + * + * + * @return a new object of class 'Parallel Gateway'. + * @generated + */ + ParallelGateway createParallelGateway(); + + /** + * Returns a new object of class 'Participant'. + * + * + * @return a new object of class 'Participant'. + * @generated + */ + Participant createParticipant(); + + /** + * Returns a new object of class 'Participant Association'. + * + * + * @return a new object of class 'Participant Association'. + * @generated + */ + ParticipantAssociation createParticipantAssociation(); + + /** + * Returns a new object of class 'Participant Multiplicity'. + * + * + * @return a new object of class 'Participant Multiplicity'. + * @generated + */ + ParticipantMultiplicity createParticipantMultiplicity(); + + /** + * Returns a new object of class 'Partner Entity'. + * + * + * @return a new object of class 'Partner Entity'. + * @generated + */ + PartnerEntity createPartnerEntity(); + + /** + * Returns a new object of class 'Partner Role'. + * + * + * @return a new object of class 'Partner Role'. + * @generated + */ + PartnerRole createPartnerRole(); + + /** + * Returns a new object of class 'Performer'. + * + * + * @return a new object of class 'Performer'. + * @generated + */ + Performer createPerformer(); + + /** + * Returns a new object of class 'Potential Owner'. + * + * + * @return a new object of class 'Potential Owner'. + * @generated + */ + PotentialOwner createPotentialOwner(); + + /** + * Returns a new object of class 'Process'. + * + * + * @return a new object of class 'Process'. + * @generated + */ + Process createProcess(); + + /** + * Returns a new object of class 'Property'. + * + * + * @return a new object of class 'Property'. + * @generated + */ + Property createProperty(); + + /** + * Returns a new object of class 'Receive Task'. + * + * + * @return a new object of class 'Receive Task'. + * @generated + */ + ReceiveTask createReceiveTask(); + + /** + * Returns a new object of class 'Relationship'. + * + * + * @return a new object of class 'Relationship'. + * @generated + */ + Relationship createRelationship(); + + /** + * Returns a new object of class 'Rendering'. + * + * + * @return a new object of class 'Rendering'. + * @generated + */ + Rendering createRendering(); + + /** + * Returns a new object of class 'Resource'. + * + * + * @return a new object of class 'Resource'. + * @generated + */ + Resource createResource(); + + /** + * Returns a new object of class 'Resource Assignment Expression'. + * + * + * @return a new object of class 'Resource Assignment Expression'. + * @generated + */ + ResourceAssignmentExpression createResourceAssignmentExpression(); + + /** + * Returns a new object of class 'Resource Parameter'. + * + * + * @return a new object of class 'Resource Parameter'. + * @generated + */ + ResourceParameter createResourceParameter(); + + /** + * Returns a new object of class 'Resource Parameter Binding'. + * + * + * @return a new object of class 'Resource Parameter Binding'. + * @generated + */ + ResourceParameterBinding createResourceParameterBinding(); + + /** + * Returns a new object of class 'Resource Role'. + * + * + * @return a new object of class 'Resource Role'. + * @generated + */ + ResourceRole createResourceRole(); + + /** + * Returns a new object of class 'Root Element'. + * + * + * @return a new object of class 'Root Element'. + * @generated + */ + RootElement createRootElement(); + + /** + * Returns a new object of class 'Script Task'. + * + * + * @return a new object of class 'Script Task'. + * @generated + */ + ScriptTask createScriptTask(); + + /** + * Returns a new object of class 'Send Task'. + * + * + * @return a new object of class 'Send Task'. + * @generated + */ + SendTask createSendTask(); + + /** + * Returns a new object of class 'Sequence Flow'. + * + * + * @return a new object of class 'Sequence Flow'. + * @generated + */ + SequenceFlow createSequenceFlow(); + + /** + * Returns a new object of class 'Service Task'. + * + * + * @return a new object of class 'Service Task'. + * @generated + */ + ServiceTask createServiceTask(); + + /** + * Returns a new object of class 'Signal'. + * + * + * @return a new object of class 'Signal'. + * @generated + */ + Signal createSignal(); + + /** + * Returns a new object of class 'Signal Event Definition'. + * + * + * @return a new object of class 'Signal Event Definition'. + * @generated + */ + SignalEventDefinition createSignalEventDefinition(); + + /** + * Returns a new object of class 'Standard Loop Characteristics'. + * + * + * @return a new object of class 'Standard Loop Characteristics'. + * @generated + */ + StandardLoopCharacteristics createStandardLoopCharacteristics(); + + /** + * Returns a new object of class 'Start Event'. + * + * + * @return a new object of class 'Start Event'. + * @generated + */ + StartEvent createStartEvent(); + + /** + * Returns a new object of class 'Sub Choreography'. + * + * + * @return a new object of class 'Sub Choreography'. + * @generated + */ + SubChoreography createSubChoreography(); + + /** + * Returns a new object of class 'Sub Conversation'. + * + * + * @return a new object of class 'Sub Conversation'. + * @generated + */ + SubConversation createSubConversation(); + + /** + * Returns a new object of class 'Sub Process'. + * + * + * @return a new object of class 'Sub Process'. + * @generated + */ + SubProcess createSubProcess(); + + /** + * Returns a new object of class 'Task'. + * + * + * @return a new object of class 'Task'. + * @generated + */ + Task createTask(); + + /** + * Returns a new object of class 'Terminate Event Definition'. + * + * + * @return a new object of class 'Terminate Event Definition'. + * @generated + */ + TerminateEventDefinition createTerminateEventDefinition(); + + /** + * Returns a new object of class 'Text Annotation'. + * + * + * @return a new object of class 'Text Annotation'. + * @generated + */ + TextAnnotation createTextAnnotation(); + + /** + * Returns a new object of class 'Timer Event Definition'. + * + * + * @return a new object of class 'Timer Event Definition'. + * @generated + */ + TimerEventDefinition createTimerEventDefinition(); + + /** + * Returns a new object of class 'Transaction'. + * + * + * @return a new object of class 'Transaction'. + * @generated + */ + Transaction createTransaction(); + + /** + * Returns a new object of class 'User Task'. + * + * + * @return a new object of class 'User Task'. + * @generated + */ + UserTask createUserTask(); + + /** + * Returns a new object of class 'Event Subprocess'. + * + * + * @return a new object of class 'Event Subprocess'. + * @generated + */ + EventSubprocess createEventSubprocess(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + Bpmn2Package getBpmn2Package(); + +} //Bpmn2Factory diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Bpmn2Package.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Bpmn2Package.java new file mode 100644 index 00000000000..30f8a7d2da9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Bpmn2Package.java @@ -0,0 +1,30290 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Factory + * @model kind="package" + * @generated + */ +public interface Bpmn2Package extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "bpmn2"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.omg.org/spec/BPMN/20100524/MODEL-XMI"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "bpmn2"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + Bpmn2Package eINSTANCE = org.eclipse.bpmn2.impl.Bpmn2PackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.DocumentRootImpl Document Root}' class. + * + * + * @see org.eclipse.bpmn2.impl.DocumentRootImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDocumentRoot() + * @generated + */ + int DOCUMENT_ROOT = 0; + + /** + * The feature id for the 'Mixed' attribute list. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__MIXED = 0; + + /** + * The feature id for the 'XMLNS Prefix Map' map. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1; + + /** + * The feature id for the 'XSI Schema Location' map. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2; + + /** + * The feature id for the 'Activity' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__ACTIVITY = 3; + + /** + * The feature id for the 'Ad Hoc Sub Process' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__AD_HOC_SUB_PROCESS = 4; + + /** + * The feature id for the 'Flow Element' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__FLOW_ELEMENT = 5; + + /** + * The feature id for the 'Artifact' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__ARTIFACT = 6; + + /** + * The feature id for the 'Assignment' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__ASSIGNMENT = 7; + + /** + * The feature id for the 'Association' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__ASSOCIATION = 8; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__AUDITING = 9; + + /** + * The feature id for the 'Base Element' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BASE_ELEMENT = 10; + + /** + * The feature id for the 'Base Element With Mixed Content' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BASE_ELEMENT_WITH_MIXED_CONTENT = 11; + + /** + * The feature id for the 'Boundary Event' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BOUNDARY_EVENT = 12; + + /** + * The feature id for the 'Business Rule Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BUSINESS_RULE_TASK = 13; + + /** + * The feature id for the 'Callable Element' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CALLABLE_ELEMENT = 14; + + /** + * The feature id for the 'Call Activity' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CALL_ACTIVITY = 15; + + /** + * The feature id for the 'Call Choreography' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CALL_CHOREOGRAPHY = 16; + + /** + * The feature id for the 'Call Conversation' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CALL_CONVERSATION = 17; + + /** + * The feature id for the 'Conversation Node' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CONVERSATION_NODE = 18; + + /** + * The feature id for the 'Cancel Event Definition' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CANCEL_EVENT_DEFINITION = 19; + + /** + * The feature id for the 'Event Definition' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__EVENT_DEFINITION = 20; + + /** + * The feature id for the 'Root Element' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__ROOT_ELEMENT = 21; + + /** + * The feature id for the 'Catch Event' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CATCH_EVENT = 22; + + /** + * The feature id for the 'Category' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CATEGORY = 23; + + /** + * The feature id for the 'Category Value' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CATEGORY_VALUE = 24; + + /** + * The feature id for the 'Choreography' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CHOREOGRAPHY = 25; + + /** + * The feature id for the 'Collaboration' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__COLLABORATION = 26; + + /** + * The feature id for the 'Choreography Activity' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CHOREOGRAPHY_ACTIVITY = 27; + + /** + * The feature id for the 'Choreography Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CHOREOGRAPHY_TASK = 28; + + /** + * The feature id for the 'Compensate Event Definition' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__COMPENSATE_EVENT_DEFINITION = 29; + + /** + * The feature id for the 'Complex Behavior Definition' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__COMPLEX_BEHAVIOR_DEFINITION = 30; + + /** + * The feature id for the 'Complex Gateway' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__COMPLEX_GATEWAY = 31; + + /** + * The feature id for the 'Conditional Event Definition' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CONDITIONAL_EVENT_DEFINITION = 32; + + /** + * The feature id for the 'Conversation' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CONVERSATION = 33; + + /** + * The feature id for the 'Conversation Association' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CONVERSATION_ASSOCIATION = 34; + + /** + * The feature id for the 'Conversation Link' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CONVERSATION_LINK = 35; + + /** + * The feature id for the 'Correlation Key' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CORRELATION_KEY = 36; + + /** + * The feature id for the 'Correlation Property' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CORRELATION_PROPERTY = 37; + + /** + * The feature id for the 'Correlation Property Binding' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CORRELATION_PROPERTY_BINDING = 38; + + /** + * The feature id for the 'Correlation Property Retrieval Expression' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION = 39; + + /** + * The feature id for the 'Correlation Subscription' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__CORRELATION_SUBSCRIPTION = 40; + + /** + * The feature id for the 'Data Association' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DATA_ASSOCIATION = 41; + + /** + * The feature id for the 'Data Input' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DATA_INPUT = 42; + + /** + * The feature id for the 'Data Input Association' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DATA_INPUT_ASSOCIATION = 43; + + /** + * The feature id for the 'Data Object' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DATA_OBJECT = 44; + + /** + * The feature id for the 'Data Object Reference' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DATA_OBJECT_REFERENCE = 45; + + /** + * The feature id for the 'Data Output' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DATA_OUTPUT = 46; + + /** + * The feature id for the 'Data Output Association' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DATA_OUTPUT_ASSOCIATION = 47; + + /** + * The feature id for the 'Data State' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DATA_STATE = 48; + + /** + * The feature id for the 'Data Store' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DATA_STORE = 49; + + /** + * The feature id for the 'Data Store Reference' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DATA_STORE_REFERENCE = 50; + + /** + * The feature id for the 'Definitions' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DEFINITIONS = 51; + + /** + * The feature id for the 'Documentation' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DOCUMENTATION = 52; + + /** + * The feature id for the 'End Event' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__END_EVENT = 53; + + /** + * The feature id for the 'End Point' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__END_POINT = 54; + + /** + * The feature id for the 'Error' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__ERROR = 55; + + /** + * The feature id for the 'Error Event Definition' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__ERROR_EVENT_DEFINITION = 56; + + /** + * The feature id for the 'Escalation' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__ESCALATION = 57; + + /** + * The feature id for the 'Escalation Event Definition' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__ESCALATION_EVENT_DEFINITION = 58; + + /** + * The feature id for the 'Event' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__EVENT = 59; + + /** + * The feature id for the 'Event Based Gateway' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__EVENT_BASED_GATEWAY = 60; + + /** + * The feature id for the 'Exclusive Gateway' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__EXCLUSIVE_GATEWAY = 61; + + /** + * The feature id for the 'Expression' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__EXPRESSION = 62; + + /** + * The feature id for the 'Extension' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__EXTENSION = 63; + + /** + * The feature id for the 'Extension Elements' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__EXTENSION_ELEMENTS = 64; + + /** + * The feature id for the 'Flow Node' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__FLOW_NODE = 65; + + /** + * The feature id for the 'Formal Expression' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__FORMAL_EXPRESSION = 66; + + /** + * The feature id for the 'Gateway' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__GATEWAY = 67; + + /** + * The feature id for the 'Global Business Rule Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__GLOBAL_BUSINESS_RULE_TASK = 68; + + /** + * The feature id for the 'Global Choreography Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__GLOBAL_CHOREOGRAPHY_TASK = 69; + + /** + * The feature id for the 'Global Conversation' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__GLOBAL_CONVERSATION = 70; + + /** + * The feature id for the 'Global Manual Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__GLOBAL_MANUAL_TASK = 71; + + /** + * The feature id for the 'Global Script Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__GLOBAL_SCRIPT_TASK = 72; + + /** + * The feature id for the 'Global Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__GLOBAL_TASK = 73; + + /** + * The feature id for the 'Global User Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__GLOBAL_USER_TASK = 74; + + /** + * The feature id for the 'Group' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__GROUP = 75; + + /** + * The feature id for the 'Human Performer' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__HUMAN_PERFORMER = 76; + + /** + * The feature id for the 'Performer' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__PERFORMER = 77; + + /** + * The feature id for the 'Resource Role' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__RESOURCE_ROLE = 78; + + /** + * The feature id for the 'Implicit Throw Event' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__IMPLICIT_THROW_EVENT = 79; + + /** + * The feature id for the 'Import' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__IMPORT = 80; + + /** + * The feature id for the 'Inclusive Gateway' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__INCLUSIVE_GATEWAY = 81; + + /** + * The feature id for the 'Input Set' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__INPUT_SET = 82; + + /** + * The feature id for the 'Interface' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__INTERFACE = 83; + + /** + * The feature id for the 'Intermediate Catch Event' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__INTERMEDIATE_CATCH_EVENT = 84; + + /** + * The feature id for the 'Intermediate Throw Event' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__INTERMEDIATE_THROW_EVENT = 85; + + /** + * The feature id for the 'Io Binding' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__IO_BINDING = 86; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__IO_SPECIFICATION = 87; + + /** + * The feature id for the 'Item Definition' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__ITEM_DEFINITION = 88; + + /** + * The feature id for the 'Lane' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__LANE = 89; + + /** + * The feature id for the 'Lane Set' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__LANE_SET = 90; + + /** + * The feature id for the 'Link Event Definition' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__LINK_EVENT_DEFINITION = 91; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__LOOP_CHARACTERISTICS = 92; + + /** + * The feature id for the 'Manual Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__MANUAL_TASK = 93; + + /** + * The feature id for the 'Message' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__MESSAGE = 94; + + /** + * The feature id for the 'Message Event Definition' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__MESSAGE_EVENT_DEFINITION = 95; + + /** + * The feature id for the 'Message Flow' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__MESSAGE_FLOW = 96; + + /** + * The feature id for the 'Message Flow Association' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__MESSAGE_FLOW_ASSOCIATION = 97; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__MONITORING = 98; + + /** + * The feature id for the 'Multi Instance Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__MULTI_INSTANCE_LOOP_CHARACTERISTICS = 99; + + /** + * The feature id for the 'Operation' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__OPERATION = 100; + + /** + * The feature id for the 'Output Set' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__OUTPUT_SET = 101; + + /** + * The feature id for the 'Parallel Gateway' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__PARALLEL_GATEWAY = 102; + + /** + * The feature id for the 'Participant' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__PARTICIPANT = 103; + + /** + * The feature id for the 'Participant Association' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__PARTICIPANT_ASSOCIATION = 104; + + /** + * The feature id for the 'Participant Multiplicity' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__PARTICIPANT_MULTIPLICITY = 105; + + /** + * The feature id for the 'Partner Entity' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__PARTNER_ENTITY = 106; + + /** + * The feature id for the 'Partner Role' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__PARTNER_ROLE = 107; + + /** + * The feature id for the 'Potential Owner' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__POTENTIAL_OWNER = 108; + + /** + * The feature id for the 'Process' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__PROCESS = 109; + + /** + * The feature id for the 'Property' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__PROPERTY = 110; + + /** + * The feature id for the 'Receive Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__RECEIVE_TASK = 111; + + /** + * The feature id for the 'Relationship' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__RELATIONSHIP = 112; + + /** + * The feature id for the 'Rendering' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__RENDERING = 113; + + /** + * The feature id for the 'Resource' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__RESOURCE = 114; + + /** + * The feature id for the 'Resource Assignment Expression' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__RESOURCE_ASSIGNMENT_EXPRESSION = 115; + + /** + * The feature id for the 'Resource Parameter' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__RESOURCE_PARAMETER = 116; + + /** + * The feature id for the 'Resource Parameter Binding' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__RESOURCE_PARAMETER_BINDING = 117; + + /** + * The feature id for the 'Script' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__SCRIPT = 118; + + /** + * The feature id for the 'Script Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__SCRIPT_TASK = 119; + + /** + * The feature id for the 'Send Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__SEND_TASK = 120; + + /** + * The feature id for the 'Sequence Flow' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__SEQUENCE_FLOW = 121; + + /** + * The feature id for the 'Service Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__SERVICE_TASK = 122; + + /** + * The feature id for the 'Signal' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__SIGNAL = 123; + + /** + * The feature id for the 'Signal Event Definition' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__SIGNAL_EVENT_DEFINITION = 124; + + /** + * The feature id for the 'Standard Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__STANDARD_LOOP_CHARACTERISTICS = 125; + + /** + * The feature id for the 'Start Event' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__START_EVENT = 126; + + /** + * The feature id for the 'Sub Choreography' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__SUB_CHOREOGRAPHY = 127; + + /** + * The feature id for the 'Sub Conversation' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__SUB_CONVERSATION = 128; + + /** + * The feature id for the 'Sub Process' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__SUB_PROCESS = 129; + + /** + * The feature id for the 'Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__TASK = 130; + + /** + * The feature id for the 'Terminate Event Definition' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__TERMINATE_EVENT_DEFINITION = 131; + + /** + * The feature id for the 'Text' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__TEXT = 132; + + /** + * The feature id for the 'Text Annotation' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__TEXT_ANNOTATION = 133; + + /** + * The feature id for the 'Throw Event' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__THROW_EVENT = 134; + + /** + * The feature id for the 'Timer Event Definition' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__TIMER_EVENT_DEFINITION = 135; + + /** + * The feature id for the 'Transaction' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__TRANSACTION = 136; + + /** + * The feature id for the 'User Task' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__USER_TASK = 137; + + /** + * The feature id for the 'Event Sub Process' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__EVENT_SUB_PROCESS = 138; + + /** + * The number of structural features of the 'Document Root' class. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT_FEATURE_COUNT = 139; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.BaseElementImpl Base Element}' class. + * + * + * @see org.eclipse.bpmn2.impl.BaseElementImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getBaseElement() + * @generated + */ + int BASE_ELEMENT = 7; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int BASE_ELEMENT__DOCUMENTATION = 0; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int BASE_ELEMENT__EXTENSION_VALUES = 1; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int BASE_ELEMENT__EXTENSION_DEFINITIONS = 2; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int BASE_ELEMENT__ID = 3; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int BASE_ELEMENT__ANY_ATTRIBUTE = 4; + + /** + * The number of structural features of the 'Base Element' class. + * + * + * @generated + * @ordered + */ + int BASE_ELEMENT_FEATURE_COUNT = 5; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.FlowElementImpl Flow Element}' class. + * + * + * @see org.eclipse.bpmn2.impl.FlowElementImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getFlowElement() + * @generated + */ + int FLOW_ELEMENT = 62; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENT__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENT__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENT__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENT__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENT__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENT__AUDITING = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENT__MONITORING = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENT__CATEGORY_VALUE_REF = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENT__NAME = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Flow Element' class. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENT_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.FlowNodeImpl Flow Node}' class. + * + * + * @see org.eclipse.bpmn2.impl.FlowNodeImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getFlowNode() + * @generated + */ + int FLOW_NODE = 64; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int FLOW_NODE__DOCUMENTATION = FLOW_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int FLOW_NODE__EXTENSION_VALUES = FLOW_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int FLOW_NODE__EXTENSION_DEFINITIONS = FLOW_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int FLOW_NODE__ID = FLOW_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int FLOW_NODE__ANY_ATTRIBUTE = FLOW_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int FLOW_NODE__AUDITING = FLOW_ELEMENT__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int FLOW_NODE__MONITORING = FLOW_ELEMENT__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int FLOW_NODE__CATEGORY_VALUE_REF = FLOW_ELEMENT__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int FLOW_NODE__NAME = FLOW_ELEMENT__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int FLOW_NODE__INCOMING = FLOW_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int FLOW_NODE__LANES = FLOW_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int FLOW_NODE__OUTGOING = FLOW_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Flow Node' class. + * + * + * @generated + * @ordered + */ + int FLOW_NODE_FEATURE_COUNT = FLOW_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ActivityImpl Activity}' class. + * + * + * @see org.eclipse.bpmn2.impl.ActivityImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getActivity() + * @generated + */ + int ACTIVITY = 1; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int ACTIVITY__DOCUMENTATION = FLOW_NODE__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int ACTIVITY__EXTENSION_VALUES = FLOW_NODE__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int ACTIVITY__EXTENSION_DEFINITIONS = FLOW_NODE__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int ACTIVITY__ID = FLOW_NODE__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int ACTIVITY__ANY_ATTRIBUTE = FLOW_NODE__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int ACTIVITY__AUDITING = FLOW_NODE__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int ACTIVITY__MONITORING = FLOW_NODE__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int ACTIVITY__CATEGORY_VALUE_REF = FLOW_NODE__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int ACTIVITY__NAME = FLOW_NODE__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int ACTIVITY__INCOMING = FLOW_NODE__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int ACTIVITY__LANES = FLOW_NODE__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int ACTIVITY__OUTGOING = FLOW_NODE__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int ACTIVITY__IO_SPECIFICATION = FLOW_NODE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int ACTIVITY__BOUNDARY_EVENT_REFS = FLOW_NODE_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int ACTIVITY__PROPERTIES = FLOW_NODE_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int ACTIVITY__DATA_INPUT_ASSOCIATIONS = FLOW_NODE_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int ACTIVITY__DATA_OUTPUT_ASSOCIATIONS = FLOW_NODE_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int ACTIVITY__RESOURCES = FLOW_NODE_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int ACTIVITY__LOOP_CHARACTERISTICS = FLOW_NODE_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int ACTIVITY__COMPLETION_QUANTITY = FLOW_NODE_FEATURE_COUNT + 7; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int ACTIVITY__DEFAULT = FLOW_NODE_FEATURE_COUNT + 8; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int ACTIVITY__IS_FOR_COMPENSATION = FLOW_NODE_FEATURE_COUNT + 9; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int ACTIVITY__START_QUANTITY = FLOW_NODE_FEATURE_COUNT + 10; + + /** + * The number of structural features of the 'Activity' class. + * + * + * @generated + * @ordered + */ + int ACTIVITY_FEATURE_COUNT = FLOW_NODE_FEATURE_COUNT + 11; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.SubProcessImpl Sub Process}' class. + * + * + * @see org.eclipse.bpmn2.impl.SubProcessImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSubProcess() + * @generated + */ + int SUB_PROCESS = 130; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__DOCUMENTATION = ACTIVITY__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__EXTENSION_VALUES = ACTIVITY__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__EXTENSION_DEFINITIONS = ACTIVITY__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__ID = ACTIVITY__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__ANY_ATTRIBUTE = ACTIVITY__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__AUDITING = ACTIVITY__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__MONITORING = ACTIVITY__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__CATEGORY_VALUE_REF = ACTIVITY__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__NAME = ACTIVITY__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__INCOMING = ACTIVITY__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__LANES = ACTIVITY__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__OUTGOING = ACTIVITY__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__IO_SPECIFICATION = ACTIVITY__IO_SPECIFICATION; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__BOUNDARY_EVENT_REFS = ACTIVITY__BOUNDARY_EVENT_REFS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__PROPERTIES = ACTIVITY__PROPERTIES; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__DATA_INPUT_ASSOCIATIONS = ACTIVITY__DATA_INPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__DATA_OUTPUT_ASSOCIATIONS = ACTIVITY__DATA_OUTPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__RESOURCES = ACTIVITY__RESOURCES; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__LOOP_CHARACTERISTICS = ACTIVITY__LOOP_CHARACTERISTICS; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__COMPLETION_QUANTITY = ACTIVITY__COMPLETION_QUANTITY; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__DEFAULT = ACTIVITY__DEFAULT; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__IS_FOR_COMPENSATION = ACTIVITY__IS_FOR_COMPENSATION; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__START_QUANTITY = ACTIVITY__START_QUANTITY; + + /** + * The feature id for the 'Lane Sets' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__LANE_SETS = ACTIVITY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Flow Elements' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__FLOW_ELEMENTS = ACTIVITY_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Artifacts' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__ARTIFACTS = ACTIVITY_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Triggered By Event' attribute. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS__TRIGGERED_BY_EVENT = ACTIVITY_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Sub Process' class. + * + * + * @generated + * @ordered + */ + int SUB_PROCESS_FEATURE_COUNT = ACTIVITY_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.AdHocSubProcessImpl Ad Hoc Sub Process}' class. + * + * + * @see org.eclipse.bpmn2.impl.AdHocSubProcessImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getAdHocSubProcess() + * @generated + */ + int AD_HOC_SUB_PROCESS = 2; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__DOCUMENTATION = SUB_PROCESS__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__EXTENSION_VALUES = SUB_PROCESS__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__EXTENSION_DEFINITIONS = SUB_PROCESS__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__ID = SUB_PROCESS__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__ANY_ATTRIBUTE = SUB_PROCESS__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__AUDITING = SUB_PROCESS__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__MONITORING = SUB_PROCESS__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__CATEGORY_VALUE_REF = SUB_PROCESS__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__NAME = SUB_PROCESS__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__INCOMING = SUB_PROCESS__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__LANES = SUB_PROCESS__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__OUTGOING = SUB_PROCESS__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__IO_SPECIFICATION = SUB_PROCESS__IO_SPECIFICATION; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__BOUNDARY_EVENT_REFS = SUB_PROCESS__BOUNDARY_EVENT_REFS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__PROPERTIES = SUB_PROCESS__PROPERTIES; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__DATA_INPUT_ASSOCIATIONS = SUB_PROCESS__DATA_INPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__DATA_OUTPUT_ASSOCIATIONS = SUB_PROCESS__DATA_OUTPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__RESOURCES = SUB_PROCESS__RESOURCES; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__LOOP_CHARACTERISTICS = SUB_PROCESS__LOOP_CHARACTERISTICS; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__COMPLETION_QUANTITY = SUB_PROCESS__COMPLETION_QUANTITY; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__DEFAULT = SUB_PROCESS__DEFAULT; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__IS_FOR_COMPENSATION = SUB_PROCESS__IS_FOR_COMPENSATION; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__START_QUANTITY = SUB_PROCESS__START_QUANTITY; + + /** + * The feature id for the 'Lane Sets' containment reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__LANE_SETS = SUB_PROCESS__LANE_SETS; + + /** + * The feature id for the 'Flow Elements' containment reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__FLOW_ELEMENTS = SUB_PROCESS__FLOW_ELEMENTS; + + /** + * The feature id for the 'Artifacts' containment reference list. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__ARTIFACTS = SUB_PROCESS__ARTIFACTS; + + /** + * The feature id for the 'Triggered By Event' attribute. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__TRIGGERED_BY_EVENT = SUB_PROCESS__TRIGGERED_BY_EVENT; + + /** + * The feature id for the 'Completion Condition' containment reference. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__COMPLETION_CONDITION = SUB_PROCESS_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Cancel Remaining Instances' attribute. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__CANCEL_REMAINING_INSTANCES = SUB_PROCESS_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Ordering' attribute. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS__ORDERING = SUB_PROCESS_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Ad Hoc Sub Process' class. + * + * + * @generated + * @ordered + */ + int AD_HOC_SUB_PROCESS_FEATURE_COUNT = SUB_PROCESS_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ArtifactImpl Artifact}' class. + * + * + * @see org.eclipse.bpmn2.impl.ArtifactImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getArtifact() + * @generated + */ + int ARTIFACT = 3; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int ARTIFACT__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int ARTIFACT__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int ARTIFACT__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int ARTIFACT__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int ARTIFACT__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The number of structural features of the 'Artifact' class. + * + * + * @generated + * @ordered + */ + int ARTIFACT_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.AssignmentImpl Assignment}' class. + * + * + * @see org.eclipse.bpmn2.impl.AssignmentImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getAssignment() + * @generated + */ + int ASSIGNMENT = 4; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int ASSIGNMENT__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int ASSIGNMENT__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int ASSIGNMENT__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int ASSIGNMENT__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int ASSIGNMENT__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'From' containment reference. + * + * + * @generated + * @ordered + */ + int ASSIGNMENT__FROM = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'To' containment reference. + * + * + * @generated + * @ordered + */ + int ASSIGNMENT__TO = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Assignment' class. + * + * + * @generated + * @ordered + */ + int ASSIGNMENT_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.AssociationImpl Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.AssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getAssociation() + * @generated + */ + int ASSOCIATION = 5; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int ASSOCIATION__DOCUMENTATION = ARTIFACT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int ASSOCIATION__EXTENSION_VALUES = ARTIFACT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int ASSOCIATION__EXTENSION_DEFINITIONS = ARTIFACT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int ASSOCIATION__ID = ARTIFACT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int ASSOCIATION__ANY_ATTRIBUTE = ARTIFACT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Association Direction' attribute. + * + * + * @generated + * @ordered + */ + int ASSOCIATION__ASSOCIATION_DIRECTION = ARTIFACT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Source Ref' reference. + * + * + * @generated + * @ordered + */ + int ASSOCIATION__SOURCE_REF = ARTIFACT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Target Ref' reference. + * + * + * @generated + * @ordered + */ + int ASSOCIATION__TARGET_REF = ARTIFACT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Association' class. + * + * + * @generated + * @ordered + */ + int ASSOCIATION_FEATURE_COUNT = ARTIFACT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.AuditingImpl Auditing}' class. + * + * + * @see org.eclipse.bpmn2.impl.AuditingImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getAuditing() + * @generated + */ + int AUDITING = 6; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int AUDITING__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int AUDITING__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int AUDITING__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int AUDITING__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int AUDITING__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The number of structural features of the 'Auditing' class. + * + * + * @generated + * @ordered + */ + int AUDITING_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.EventImpl Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.EventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEvent() + * @generated + */ + int EVENT = 53; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT__DOCUMENTATION = FLOW_NODE__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT__EXTENSION_VALUES = FLOW_NODE__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int EVENT__EXTENSION_DEFINITIONS = FLOW_NODE__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int EVENT__ID = FLOW_NODE__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int EVENT__ANY_ATTRIBUTE = FLOW_NODE__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int EVENT__AUDITING = FLOW_NODE__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int EVENT__MONITORING = FLOW_NODE__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int EVENT__CATEGORY_VALUE_REF = FLOW_NODE__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int EVENT__NAME = FLOW_NODE__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int EVENT__INCOMING = FLOW_NODE__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int EVENT__LANES = FLOW_NODE__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int EVENT__OUTGOING = FLOW_NODE__OUTGOING; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int EVENT__INCOMING_CONVERSATION_LINKS = FLOW_NODE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int EVENT__OUTGOING_CONVERSATION_LINKS = FLOW_NODE_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT__PROPERTIES = FLOW_NODE_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Event' class. + * + * + * @generated + * @ordered + */ + int EVENT_FEATURE_COUNT = FLOW_NODE_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CatchEventImpl Catch Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.CatchEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCatchEvent() + * @generated + */ + int CATCH_EVENT = 15; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__DOCUMENTATION = EVENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__EXTENSION_VALUES = EVENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__EXTENSION_DEFINITIONS = EVENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__ID = EVENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__ANY_ATTRIBUTE = EVENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__AUDITING = EVENT__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__MONITORING = EVENT__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__CATEGORY_VALUE_REF = EVENT__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__NAME = EVENT__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__INCOMING = EVENT__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__LANES = EVENT__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__OUTGOING = EVENT__OUTGOING; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__INCOMING_CONVERSATION_LINKS = EVENT__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__OUTGOING_CONVERSATION_LINKS = EVENT__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__PROPERTIES = EVENT__PROPERTIES; + + /** + * The feature id for the 'Data Outputs' containment reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__DATA_OUTPUTS = EVENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Data Output Association' containment reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__DATA_OUTPUT_ASSOCIATION = EVENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Output Set' containment reference. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__OUTPUT_SET = EVENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Event Definitions' containment reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__EVENT_DEFINITIONS = EVENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Event Definition Refs' reference list. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__EVENT_DEFINITION_REFS = EVENT_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Parallel Multiple' attribute. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT__PARALLEL_MULTIPLE = EVENT_FEATURE_COUNT + 5; + + /** + * The number of structural features of the 'Catch Event' class. + * + * + * @generated + * @ordered + */ + int CATCH_EVENT_FEATURE_COUNT = EVENT_FEATURE_COUNT + 6; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.BoundaryEventImpl Boundary Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.BoundaryEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getBoundaryEvent() + * @generated + */ + int BOUNDARY_EVENT = 8; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__DOCUMENTATION = CATCH_EVENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__EXTENSION_VALUES = CATCH_EVENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__EXTENSION_DEFINITIONS = CATCH_EVENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__ID = CATCH_EVENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__ANY_ATTRIBUTE = CATCH_EVENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__AUDITING = CATCH_EVENT__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__MONITORING = CATCH_EVENT__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__CATEGORY_VALUE_REF = CATCH_EVENT__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__NAME = CATCH_EVENT__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__INCOMING = CATCH_EVENT__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__LANES = CATCH_EVENT__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__OUTGOING = CATCH_EVENT__OUTGOING; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__INCOMING_CONVERSATION_LINKS = CATCH_EVENT__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__OUTGOING_CONVERSATION_LINKS = CATCH_EVENT__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__PROPERTIES = CATCH_EVENT__PROPERTIES; + + /** + * The feature id for the 'Data Outputs' containment reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__DATA_OUTPUTS = CATCH_EVENT__DATA_OUTPUTS; + + /** + * The feature id for the 'Data Output Association' containment reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__DATA_OUTPUT_ASSOCIATION = CATCH_EVENT__DATA_OUTPUT_ASSOCIATION; + + /** + * The feature id for the 'Output Set' containment reference. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__OUTPUT_SET = CATCH_EVENT__OUTPUT_SET; + + /** + * The feature id for the 'Event Definitions' containment reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__EVENT_DEFINITIONS = CATCH_EVENT__EVENT_DEFINITIONS; + + /** + * The feature id for the 'Event Definition Refs' reference list. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__EVENT_DEFINITION_REFS = CATCH_EVENT__EVENT_DEFINITION_REFS; + + /** + * The feature id for the 'Parallel Multiple' attribute. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__PARALLEL_MULTIPLE = CATCH_EVENT__PARALLEL_MULTIPLE; + + /** + * The feature id for the 'Attached To Ref' reference. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__ATTACHED_TO_REF = CATCH_EVENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Cancel Activity' attribute. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT__CANCEL_ACTIVITY = CATCH_EVENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Boundary Event' class. + * + * + * @generated + * @ordered + */ + int BOUNDARY_EVENT_FEATURE_COUNT = CATCH_EVENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.TaskImpl Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.TaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getTask() + * @generated + */ + int TASK = 131; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int TASK__DOCUMENTATION = ACTIVITY__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int TASK__EXTENSION_VALUES = ACTIVITY__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int TASK__EXTENSION_DEFINITIONS = ACTIVITY__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int TASK__ID = ACTIVITY__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int TASK__ANY_ATTRIBUTE = ACTIVITY__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int TASK__AUDITING = ACTIVITY__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int TASK__MONITORING = ACTIVITY__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int TASK__CATEGORY_VALUE_REF = ACTIVITY__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int TASK__NAME = ACTIVITY__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int TASK__INCOMING = ACTIVITY__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int TASK__LANES = ACTIVITY__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int TASK__OUTGOING = ACTIVITY__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int TASK__IO_SPECIFICATION = ACTIVITY__IO_SPECIFICATION; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int TASK__BOUNDARY_EVENT_REFS = ACTIVITY__BOUNDARY_EVENT_REFS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int TASK__PROPERTIES = ACTIVITY__PROPERTIES; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int TASK__DATA_INPUT_ASSOCIATIONS = ACTIVITY__DATA_INPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int TASK__DATA_OUTPUT_ASSOCIATIONS = ACTIVITY__DATA_OUTPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int TASK__RESOURCES = ACTIVITY__RESOURCES; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int TASK__LOOP_CHARACTERISTICS = ACTIVITY__LOOP_CHARACTERISTICS; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int TASK__COMPLETION_QUANTITY = ACTIVITY__COMPLETION_QUANTITY; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int TASK__DEFAULT = ACTIVITY__DEFAULT; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int TASK__IS_FOR_COMPENSATION = ACTIVITY__IS_FOR_COMPENSATION; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int TASK__START_QUANTITY = ACTIVITY__START_QUANTITY; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int TASK__INCOMING_CONVERSATION_LINKS = ACTIVITY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int TASK__OUTGOING_CONVERSATION_LINKS = ACTIVITY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Task' class. + * + * + * @generated + * @ordered + */ + int TASK_FEATURE_COUNT = ACTIVITY_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.BusinessRuleTaskImpl Business Rule Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.BusinessRuleTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getBusinessRuleTask() + * @generated + */ + int BUSINESS_RULE_TASK = 9; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__DOCUMENTATION = TASK__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__EXTENSION_VALUES = TASK__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__EXTENSION_DEFINITIONS = TASK__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__ID = TASK__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__ANY_ATTRIBUTE = TASK__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__AUDITING = TASK__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__MONITORING = TASK__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__CATEGORY_VALUE_REF = TASK__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__NAME = TASK__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__INCOMING = TASK__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__LANES = TASK__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__OUTGOING = TASK__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__IO_SPECIFICATION = TASK__IO_SPECIFICATION; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__BOUNDARY_EVENT_REFS = TASK__BOUNDARY_EVENT_REFS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__PROPERTIES = TASK__PROPERTIES; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__DATA_INPUT_ASSOCIATIONS = TASK__DATA_INPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__DATA_OUTPUT_ASSOCIATIONS = TASK__DATA_OUTPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__RESOURCES = TASK__RESOURCES; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__LOOP_CHARACTERISTICS = TASK__LOOP_CHARACTERISTICS; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__COMPLETION_QUANTITY = TASK__COMPLETION_QUANTITY; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__DEFAULT = TASK__DEFAULT; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__IS_FOR_COMPENSATION = TASK__IS_FOR_COMPENSATION; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__START_QUANTITY = TASK__START_QUANTITY; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__INCOMING_CONVERSATION_LINKS = TASK__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__OUTGOING_CONVERSATION_LINKS = TASK__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Implementation' attribute. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK__IMPLEMENTATION = TASK_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Business Rule Task' class. + * + * + * @generated + * @ordered + */ + int BUSINESS_RULE_TASK_FEATURE_COUNT = TASK_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CallActivityImpl Call Activity}' class. + * + * + * @see org.eclipse.bpmn2.impl.CallActivityImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCallActivity() + * @generated + */ + int CALL_ACTIVITY = 10; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__DOCUMENTATION = ACTIVITY__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__EXTENSION_VALUES = ACTIVITY__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__EXTENSION_DEFINITIONS = ACTIVITY__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__ID = ACTIVITY__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__ANY_ATTRIBUTE = ACTIVITY__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__AUDITING = ACTIVITY__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__MONITORING = ACTIVITY__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__CATEGORY_VALUE_REF = ACTIVITY__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__NAME = ACTIVITY__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__INCOMING = ACTIVITY__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__LANES = ACTIVITY__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__OUTGOING = ACTIVITY__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__IO_SPECIFICATION = ACTIVITY__IO_SPECIFICATION; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__BOUNDARY_EVENT_REFS = ACTIVITY__BOUNDARY_EVENT_REFS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__PROPERTIES = ACTIVITY__PROPERTIES; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__DATA_INPUT_ASSOCIATIONS = ACTIVITY__DATA_INPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__DATA_OUTPUT_ASSOCIATIONS = ACTIVITY__DATA_OUTPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__RESOURCES = ACTIVITY__RESOURCES; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__LOOP_CHARACTERISTICS = ACTIVITY__LOOP_CHARACTERISTICS; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__COMPLETION_QUANTITY = ACTIVITY__COMPLETION_QUANTITY; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__DEFAULT = ACTIVITY__DEFAULT; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__IS_FOR_COMPENSATION = ACTIVITY__IS_FOR_COMPENSATION; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__START_QUANTITY = ACTIVITY__START_QUANTITY; + + /** + * The feature id for the 'Called Element' attribute. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY__CALLED_ELEMENT = ACTIVITY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Call Activity' class. + * + * + * @generated + * @ordered + */ + int CALL_ACTIVITY_FEATURE_COUNT = ACTIVITY_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ChoreographyActivityImpl Choreography Activity}' class. + * + * + * @see org.eclipse.bpmn2.impl.ChoreographyActivityImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getChoreographyActivity() + * @generated + */ + int CHOREOGRAPHY_ACTIVITY = 19; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__DOCUMENTATION = FLOW_NODE__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__EXTENSION_VALUES = FLOW_NODE__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__EXTENSION_DEFINITIONS = FLOW_NODE__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__ID = FLOW_NODE__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__ANY_ATTRIBUTE = FLOW_NODE__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__AUDITING = FLOW_NODE__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__MONITORING = FLOW_NODE__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__CATEGORY_VALUE_REF = FLOW_NODE__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__NAME = FLOW_NODE__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__INCOMING = FLOW_NODE__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__LANES = FLOW_NODE__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__OUTGOING = FLOW_NODE__OUTGOING; + + /** + * The feature id for the 'Participant Refs' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__PARTICIPANT_REFS = FLOW_NODE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Correlation Keys' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__CORRELATION_KEYS = FLOW_NODE_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Initiating Participant Ref' reference. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__INITIATING_PARTICIPANT_REF = FLOW_NODE_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Loop Type' attribute. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY__LOOP_TYPE = FLOW_NODE_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Choreography Activity' class. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_ACTIVITY_FEATURE_COUNT = FLOW_NODE_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CallChoreographyImpl Call Choreography}' class. + * + * + * @see org.eclipse.bpmn2.impl.CallChoreographyImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCallChoreography() + * @generated + */ + int CALL_CHOREOGRAPHY = 11; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__DOCUMENTATION = CHOREOGRAPHY_ACTIVITY__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__EXTENSION_VALUES = CHOREOGRAPHY_ACTIVITY__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__EXTENSION_DEFINITIONS = CHOREOGRAPHY_ACTIVITY__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__ID = CHOREOGRAPHY_ACTIVITY__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__ANY_ATTRIBUTE = CHOREOGRAPHY_ACTIVITY__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__AUDITING = CHOREOGRAPHY_ACTIVITY__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__MONITORING = CHOREOGRAPHY_ACTIVITY__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__CATEGORY_VALUE_REF = CHOREOGRAPHY_ACTIVITY__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__NAME = CHOREOGRAPHY_ACTIVITY__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__INCOMING = CHOREOGRAPHY_ACTIVITY__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__LANES = CHOREOGRAPHY_ACTIVITY__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__OUTGOING = CHOREOGRAPHY_ACTIVITY__OUTGOING; + + /** + * The feature id for the 'Participant Refs' reference list. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__PARTICIPANT_REFS = CHOREOGRAPHY_ACTIVITY__PARTICIPANT_REFS; + + /** + * The feature id for the 'Correlation Keys' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__CORRELATION_KEYS = CHOREOGRAPHY_ACTIVITY__CORRELATION_KEYS; + + /** + * The feature id for the 'Initiating Participant Ref' reference. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__INITIATING_PARTICIPANT_REF = CHOREOGRAPHY_ACTIVITY__INITIATING_PARTICIPANT_REF; + + /** + * The feature id for the 'Loop Type' attribute. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__LOOP_TYPE = CHOREOGRAPHY_ACTIVITY__LOOP_TYPE; + + /** + * The feature id for the 'Participant Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__PARTICIPANT_ASSOCIATIONS = CHOREOGRAPHY_ACTIVITY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Called Choreography Ref' reference. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY__CALLED_CHOREOGRAPHY_REF = CHOREOGRAPHY_ACTIVITY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Call Choreography' class. + * + * + * @generated + * @ordered + */ + int CALL_CHOREOGRAPHY_FEATURE_COUNT = CHOREOGRAPHY_ACTIVITY_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ConversationNodeImpl Conversation Node}' class. + * + * + * @see org.eclipse.bpmn2.impl.ConversationNodeImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getConversationNode() + * @generated + */ + int CONVERSATION_NODE = 29; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_NODE__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_NODE__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_NODE__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CONVERSATION_NODE__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_NODE__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_NODE__INCOMING_CONVERSATION_LINKS = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_NODE__OUTGOING_CONVERSATION_LINKS = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Participant Refs' reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_NODE__PARTICIPANT_REFS = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Message Flow Refs' reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_NODE__MESSAGE_FLOW_REFS = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Correlation Keys' containment reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_NODE__CORRELATION_KEYS = BASE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CONVERSATION_NODE__NAME = BASE_ELEMENT_FEATURE_COUNT + 5; + + /** + * The number of structural features of the 'Conversation Node' class. + * + * + * @generated + * @ordered + */ + int CONVERSATION_NODE_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 6; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CallConversationImpl Call Conversation}' class. + * + * + * @see org.eclipse.bpmn2.impl.CallConversationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCallConversation() + * @generated + */ + int CALL_CONVERSATION = 12; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION__DOCUMENTATION = CONVERSATION_NODE__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION__EXTENSION_VALUES = CONVERSATION_NODE__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION__EXTENSION_DEFINITIONS = CONVERSATION_NODE__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION__ID = CONVERSATION_NODE__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION__ANY_ATTRIBUTE = CONVERSATION_NODE__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION__INCOMING_CONVERSATION_LINKS = CONVERSATION_NODE__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION__OUTGOING_CONVERSATION_LINKS = CONVERSATION_NODE__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Participant Refs' reference list. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION__PARTICIPANT_REFS = CONVERSATION_NODE__PARTICIPANT_REFS; + + /** + * The feature id for the 'Message Flow Refs' reference list. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION__MESSAGE_FLOW_REFS = CONVERSATION_NODE__MESSAGE_FLOW_REFS; + + /** + * The feature id for the 'Correlation Keys' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION__CORRELATION_KEYS = CONVERSATION_NODE__CORRELATION_KEYS; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION__NAME = CONVERSATION_NODE__NAME; + + /** + * The feature id for the 'Participant Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION__PARTICIPANT_ASSOCIATIONS = CONVERSATION_NODE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Called Collaboration Ref' reference. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION__CALLED_COLLABORATION_REF = CONVERSATION_NODE_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Call Conversation' class. + * + * + * @generated + * @ordered + */ + int CALL_CONVERSATION_FEATURE_COUNT = CONVERSATION_NODE_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.RootElementImpl Root Element}' class. + * + * + * @see org.eclipse.bpmn2.impl.RootElementImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getRootElement() + * @generated + */ + int ROOT_ELEMENT = 119; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int ROOT_ELEMENT__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int ROOT_ELEMENT__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int ROOT_ELEMENT__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int ROOT_ELEMENT__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int ROOT_ELEMENT__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The number of structural features of the 'Root Element' class. + * + * + * @generated + * @ordered + */ + int ROOT_ELEMENT_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CallableElementImpl Callable Element}' class. + * + * + * @see org.eclipse.bpmn2.impl.CallableElementImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCallableElement() + * @generated + */ + int CALLABLE_ELEMENT = 13; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CALLABLE_ELEMENT__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CALLABLE_ELEMENT__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CALLABLE_ELEMENT__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CALLABLE_ELEMENT__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CALLABLE_ELEMENT__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Supported Interface Refs' reference list. + * + * + * @generated + * @ordered + */ + int CALLABLE_ELEMENT__SUPPORTED_INTERFACE_REFS = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int CALLABLE_ELEMENT__IO_SPECIFICATION = ROOT_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Io Binding' containment reference list. + * + * + * @generated + * @ordered + */ + int CALLABLE_ELEMENT__IO_BINDING = ROOT_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CALLABLE_ELEMENT__NAME = ROOT_ELEMENT_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Callable Element' class. + * + * + * @generated + * @ordered + */ + int CALLABLE_ELEMENT_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.EventDefinitionImpl Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.EventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEventDefinition() + * @generated + */ + int EVENT_DEFINITION = 55; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT_DEFINITION__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT_DEFINITION__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_DEFINITION__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int EVENT_DEFINITION__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int EVENT_DEFINITION__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The number of structural features of the 'Event Definition' class. + * + * + * @generated + * @ordered + */ + int EVENT_DEFINITION_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CancelEventDefinitionImpl Cancel Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.CancelEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCancelEventDefinition() + * @generated + */ + int CANCEL_EVENT_DEFINITION = 14; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CANCEL_EVENT_DEFINITION__DOCUMENTATION = EVENT_DEFINITION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CANCEL_EVENT_DEFINITION__EXTENSION_VALUES = EVENT_DEFINITION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CANCEL_EVENT_DEFINITION__EXTENSION_DEFINITIONS = EVENT_DEFINITION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CANCEL_EVENT_DEFINITION__ID = EVENT_DEFINITION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CANCEL_EVENT_DEFINITION__ANY_ATTRIBUTE = EVENT_DEFINITION__ANY_ATTRIBUTE; + + /** + * The number of structural features of the 'Cancel Event Definition' class. + * + * + * @generated + * @ordered + */ + int CANCEL_EVENT_DEFINITION_FEATURE_COUNT = EVENT_DEFINITION_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CategoryImpl Category}' class. + * + * + * @see org.eclipse.bpmn2.impl.CategoryImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCategory() + * @generated + */ + int CATEGORY = 16; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CATEGORY__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CATEGORY__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CATEGORY__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CATEGORY__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CATEGORY__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Category Value' containment reference list. + * + * + * @generated + * @ordered + */ + int CATEGORY__CATEGORY_VALUE = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CATEGORY__NAME = ROOT_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Category' class. + * + * + * @generated + * @ordered + */ + int CATEGORY_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CategoryValueImpl Category Value}' class. + * + * + * @see org.eclipse.bpmn2.impl.CategoryValueImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCategoryValue() + * @generated + */ + int CATEGORY_VALUE = 17; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CATEGORY_VALUE__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CATEGORY_VALUE__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CATEGORY_VALUE__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CATEGORY_VALUE__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CATEGORY_VALUE__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int CATEGORY_VALUE__VALUE = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Categorized Flow Elements' reference list. + * + * + * @generated + * @ordered + */ + int CATEGORY_VALUE__CATEGORIZED_FLOW_ELEMENTS = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Category Value' class. + * + * + * @generated + * @ordered + */ + int CATEGORY_VALUE_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CollaborationImpl Collaboration}' class. + * + * + * @see org.eclipse.bpmn2.impl.CollaborationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCollaboration() + * @generated + */ + int COLLABORATION = 21; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int COLLABORATION__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int COLLABORATION__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int COLLABORATION__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int COLLABORATION__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int COLLABORATION__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Participants' containment reference list. + * + * + * @generated + * @ordered + */ + int COLLABORATION__PARTICIPANTS = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Message Flows' containment reference list. + * + * + * @generated + * @ordered + */ + int COLLABORATION__MESSAGE_FLOWS = ROOT_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Artifacts' containment reference list. + * + * + * @generated + * @ordered + */ + int COLLABORATION__ARTIFACTS = ROOT_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Conversations' containment reference list. + * + * + * @generated + * @ordered + */ + int COLLABORATION__CONVERSATIONS = ROOT_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Conversation Associations' containment reference. + * + * + * @generated + * @ordered + */ + int COLLABORATION__CONVERSATION_ASSOCIATIONS = ROOT_ELEMENT_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Participant Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int COLLABORATION__PARTICIPANT_ASSOCIATIONS = ROOT_ELEMENT_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Message Flow Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS = ROOT_ELEMENT_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Correlation Keys' containment reference list. + * + * + * @generated + * @ordered + */ + int COLLABORATION__CORRELATION_KEYS = ROOT_ELEMENT_FEATURE_COUNT + 7; + + /** + * The feature id for the 'Choreography Ref' reference list. + * + * + * @generated + * @ordered + */ + int COLLABORATION__CHOREOGRAPHY_REF = ROOT_ELEMENT_FEATURE_COUNT + 8; + + /** + * The feature id for the 'Conversation Links' containment reference list. + * + * + * @generated + * @ordered + */ + int COLLABORATION__CONVERSATION_LINKS = ROOT_ELEMENT_FEATURE_COUNT + 9; + + /** + * The feature id for the 'Is Closed' attribute. + * + * + * @generated + * @ordered + */ + int COLLABORATION__IS_CLOSED = ROOT_ELEMENT_FEATURE_COUNT + 10; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int COLLABORATION__NAME = ROOT_ELEMENT_FEATURE_COUNT + 11; + + /** + * The number of structural features of the 'Collaboration' class. + * + * + * @generated + * @ordered + */ + int COLLABORATION_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 12; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ChoreographyImpl Choreography}' class. + * + * + * @see org.eclipse.bpmn2.impl.ChoreographyImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getChoreography() + * @generated + */ + int CHOREOGRAPHY = 18; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__DOCUMENTATION = COLLABORATION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__EXTENSION_VALUES = COLLABORATION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__EXTENSION_DEFINITIONS = COLLABORATION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__ID = COLLABORATION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__ANY_ATTRIBUTE = COLLABORATION__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Participants' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__PARTICIPANTS = COLLABORATION__PARTICIPANTS; + + /** + * The feature id for the 'Message Flows' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__MESSAGE_FLOWS = COLLABORATION__MESSAGE_FLOWS; + + /** + * The feature id for the 'Artifacts' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__ARTIFACTS = COLLABORATION__ARTIFACTS; + + /** + * The feature id for the 'Conversations' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__CONVERSATIONS = COLLABORATION__CONVERSATIONS; + + /** + * The feature id for the 'Conversation Associations' containment reference. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__CONVERSATION_ASSOCIATIONS = COLLABORATION__CONVERSATION_ASSOCIATIONS; + + /** + * The feature id for the 'Participant Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__PARTICIPANT_ASSOCIATIONS = COLLABORATION__PARTICIPANT_ASSOCIATIONS; + + /** + * The feature id for the 'Message Flow Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__MESSAGE_FLOW_ASSOCIATIONS = COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS; + + /** + * The feature id for the 'Correlation Keys' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__CORRELATION_KEYS = COLLABORATION__CORRELATION_KEYS; + + /** + * The feature id for the 'Choreography Ref' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__CHOREOGRAPHY_REF = COLLABORATION__CHOREOGRAPHY_REF; + + /** + * The feature id for the 'Conversation Links' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__CONVERSATION_LINKS = COLLABORATION__CONVERSATION_LINKS; + + /** + * The feature id for the 'Is Closed' attribute. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__IS_CLOSED = COLLABORATION__IS_CLOSED; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__NAME = COLLABORATION__NAME; + + /** + * The feature id for the 'Lane Sets' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__LANE_SETS = COLLABORATION_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Flow Elements' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY__FLOW_ELEMENTS = COLLABORATION_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Choreography' class. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_FEATURE_COUNT = COLLABORATION_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ChoreographyTaskImpl Choreography Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.ChoreographyTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getChoreographyTask() + * @generated + */ + int CHOREOGRAPHY_TASK = 20; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__DOCUMENTATION = CHOREOGRAPHY_ACTIVITY__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__EXTENSION_VALUES = CHOREOGRAPHY_ACTIVITY__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__EXTENSION_DEFINITIONS = CHOREOGRAPHY_ACTIVITY__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__ID = CHOREOGRAPHY_ACTIVITY__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__ANY_ATTRIBUTE = CHOREOGRAPHY_ACTIVITY__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__AUDITING = CHOREOGRAPHY_ACTIVITY__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__MONITORING = CHOREOGRAPHY_ACTIVITY__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__CATEGORY_VALUE_REF = CHOREOGRAPHY_ACTIVITY__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__NAME = CHOREOGRAPHY_ACTIVITY__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__INCOMING = CHOREOGRAPHY_ACTIVITY__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__LANES = CHOREOGRAPHY_ACTIVITY__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__OUTGOING = CHOREOGRAPHY_ACTIVITY__OUTGOING; + + /** + * The feature id for the 'Participant Refs' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__PARTICIPANT_REFS = CHOREOGRAPHY_ACTIVITY__PARTICIPANT_REFS; + + /** + * The feature id for the 'Correlation Keys' containment reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__CORRELATION_KEYS = CHOREOGRAPHY_ACTIVITY__CORRELATION_KEYS; + + /** + * The feature id for the 'Initiating Participant Ref' reference. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__INITIATING_PARTICIPANT_REF = CHOREOGRAPHY_ACTIVITY__INITIATING_PARTICIPANT_REF; + + /** + * The feature id for the 'Loop Type' attribute. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__LOOP_TYPE = CHOREOGRAPHY_ACTIVITY__LOOP_TYPE; + + /** + * The feature id for the 'Message Flow Ref' reference list. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK__MESSAGE_FLOW_REF = CHOREOGRAPHY_ACTIVITY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Choreography Task' class. + * + * + * @generated + * @ordered + */ + int CHOREOGRAPHY_TASK_FEATURE_COUNT = CHOREOGRAPHY_ACTIVITY_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CompensateEventDefinitionImpl Compensate Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.CompensateEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCompensateEventDefinition() + * @generated + */ + int COMPENSATE_EVENT_DEFINITION = 22; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int COMPENSATE_EVENT_DEFINITION__DOCUMENTATION = EVENT_DEFINITION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int COMPENSATE_EVENT_DEFINITION__EXTENSION_VALUES = EVENT_DEFINITION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int COMPENSATE_EVENT_DEFINITION__EXTENSION_DEFINITIONS = EVENT_DEFINITION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int COMPENSATE_EVENT_DEFINITION__ID = EVENT_DEFINITION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int COMPENSATE_EVENT_DEFINITION__ANY_ATTRIBUTE = EVENT_DEFINITION__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Activity Ref' reference. + * + * + * @generated + * @ordered + */ + int COMPENSATE_EVENT_DEFINITION__ACTIVITY_REF = EVENT_DEFINITION_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Wait For Completion' attribute. + * + * + * @generated + * @ordered + */ + int COMPENSATE_EVENT_DEFINITION__WAIT_FOR_COMPLETION = EVENT_DEFINITION_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Compensate Event Definition' class. + * + * + * @generated + * @ordered + */ + int COMPENSATE_EVENT_DEFINITION_FEATURE_COUNT = EVENT_DEFINITION_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ComplexBehaviorDefinitionImpl Complex Behavior Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.ComplexBehaviorDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getComplexBehaviorDefinition() + * @generated + */ + int COMPLEX_BEHAVIOR_DEFINITION = 23; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int COMPLEX_BEHAVIOR_DEFINITION__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int COMPLEX_BEHAVIOR_DEFINITION__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int COMPLEX_BEHAVIOR_DEFINITION__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int COMPLEX_BEHAVIOR_DEFINITION__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int COMPLEX_BEHAVIOR_DEFINITION__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Condition' containment reference. + * + * + * @generated + * @ordered + */ + int COMPLEX_BEHAVIOR_DEFINITION__CONDITION = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Event' containment reference. + * + * + * @generated + * @ordered + */ + int COMPLEX_BEHAVIOR_DEFINITION__EVENT = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Complex Behavior Definition' class. + * + * + * @generated + * @ordered + */ + int COMPLEX_BEHAVIOR_DEFINITION_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.GatewayImpl Gateway}' class. + * + * + * @see org.eclipse.bpmn2.impl.GatewayImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGateway() + * @generated + */ + int GATEWAY = 66; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int GATEWAY__DOCUMENTATION = FLOW_NODE__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int GATEWAY__EXTENSION_VALUES = FLOW_NODE__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int GATEWAY__EXTENSION_DEFINITIONS = FLOW_NODE__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int GATEWAY__ID = FLOW_NODE__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int GATEWAY__ANY_ATTRIBUTE = FLOW_NODE__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int GATEWAY__AUDITING = FLOW_NODE__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int GATEWAY__MONITORING = FLOW_NODE__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int GATEWAY__CATEGORY_VALUE_REF = FLOW_NODE__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int GATEWAY__NAME = FLOW_NODE__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int GATEWAY__INCOMING = FLOW_NODE__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int GATEWAY__LANES = FLOW_NODE__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int GATEWAY__OUTGOING = FLOW_NODE__OUTGOING; + + /** + * The feature id for the 'Gateway Direction' attribute. + * + * + * @generated + * @ordered + */ + int GATEWAY__GATEWAY_DIRECTION = FLOW_NODE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Gateway' class. + * + * + * @generated + * @ordered + */ + int GATEWAY_FEATURE_COUNT = FLOW_NODE_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ComplexGatewayImpl Complex Gateway}' class. + * + * + * @see org.eclipse.bpmn2.impl.ComplexGatewayImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getComplexGateway() + * @generated + */ + int COMPLEX_GATEWAY = 24; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__DOCUMENTATION = GATEWAY__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__EXTENSION_VALUES = GATEWAY__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__EXTENSION_DEFINITIONS = GATEWAY__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__ID = GATEWAY__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__ANY_ATTRIBUTE = GATEWAY__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__AUDITING = GATEWAY__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__MONITORING = GATEWAY__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__CATEGORY_VALUE_REF = GATEWAY__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__NAME = GATEWAY__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__INCOMING = GATEWAY__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__LANES = GATEWAY__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__OUTGOING = GATEWAY__OUTGOING; + + /** + * The feature id for the 'Gateway Direction' attribute. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__GATEWAY_DIRECTION = GATEWAY__GATEWAY_DIRECTION; + + /** + * The feature id for the 'Activation Condition' containment reference. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__ACTIVATION_CONDITION = GATEWAY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY__DEFAULT = GATEWAY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Complex Gateway' class. + * + * + * @generated + * @ordered + */ + int COMPLEX_GATEWAY_FEATURE_COUNT = GATEWAY_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ConditionalEventDefinitionImpl Conditional Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.ConditionalEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getConditionalEventDefinition() + * @generated + */ + int CONDITIONAL_EVENT_DEFINITION = 25; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CONDITIONAL_EVENT_DEFINITION__DOCUMENTATION = EVENT_DEFINITION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CONDITIONAL_EVENT_DEFINITION__EXTENSION_VALUES = EVENT_DEFINITION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CONDITIONAL_EVENT_DEFINITION__EXTENSION_DEFINITIONS = EVENT_DEFINITION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CONDITIONAL_EVENT_DEFINITION__ID = EVENT_DEFINITION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CONDITIONAL_EVENT_DEFINITION__ANY_ATTRIBUTE = EVENT_DEFINITION__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Condition' containment reference. + * + * + * @generated + * @ordered + */ + int CONDITIONAL_EVENT_DEFINITION__CONDITION = EVENT_DEFINITION_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Conditional Event Definition' class. + * + * + * @generated + * @ordered + */ + int CONDITIONAL_EVENT_DEFINITION_FEATURE_COUNT = EVENT_DEFINITION_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ConversationImpl Conversation}' class. + * + * + * @see org.eclipse.bpmn2.impl.ConversationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getConversation() + * @generated + */ + int CONVERSATION = 26; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION__DOCUMENTATION = CONVERSATION_NODE__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION__EXTENSION_VALUES = CONVERSATION_NODE__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION__EXTENSION_DEFINITIONS = CONVERSATION_NODE__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CONVERSATION__ID = CONVERSATION_NODE__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CONVERSATION__ANY_ATTRIBUTE = CONVERSATION_NODE__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION__INCOMING_CONVERSATION_LINKS = CONVERSATION_NODE__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION__OUTGOING_CONVERSATION_LINKS = CONVERSATION_NODE__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Participant Refs' reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION__PARTICIPANT_REFS = CONVERSATION_NODE__PARTICIPANT_REFS; + + /** + * The feature id for the 'Message Flow Refs' reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION__MESSAGE_FLOW_REFS = CONVERSATION_NODE__MESSAGE_FLOW_REFS; + + /** + * The feature id for the 'Correlation Keys' containment reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION__CORRELATION_KEYS = CONVERSATION_NODE__CORRELATION_KEYS; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CONVERSATION__NAME = CONVERSATION_NODE__NAME; + + /** + * The number of structural features of the 'Conversation' class. + * + * + * @generated + * @ordered + */ + int CONVERSATION_FEATURE_COUNT = CONVERSATION_NODE_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ConversationAssociationImpl Conversation Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.ConversationAssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getConversationAssociation() + * @generated + */ + int CONVERSATION_ASSOCIATION = 27; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_ASSOCIATION__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_ASSOCIATION__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_ASSOCIATION__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CONVERSATION_ASSOCIATION__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_ASSOCIATION__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Inner Conversation Node Ref' reference. + * + * + * @generated + * @ordered + */ + int CONVERSATION_ASSOCIATION__INNER_CONVERSATION_NODE_REF = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Outer Conversation Node Ref' reference. + * + * + * @generated + * @ordered + */ + int CONVERSATION_ASSOCIATION__OUTER_CONVERSATION_NODE_REF = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Conversation Association' class. + * + * + * @generated + * @ordered + */ + int CONVERSATION_ASSOCIATION_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ConversationLinkImpl Conversation Link}' class. + * + * + * @see org.eclipse.bpmn2.impl.ConversationLinkImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getConversationLink() + * @generated + */ + int CONVERSATION_LINK = 28; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_LINK__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_LINK__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_LINK__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CONVERSATION_LINK__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CONVERSATION_LINK__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CONVERSATION_LINK__NAME = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Source Ref' reference. + * + * + * @generated + * @ordered + */ + int CONVERSATION_LINK__SOURCE_REF = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Target Ref' reference. + * + * + * @generated + * @ordered + */ + int CONVERSATION_LINK__TARGET_REF = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Conversation Link' class. + * + * + * @generated + * @ordered + */ + int CONVERSATION_LINK_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CorrelationKeyImpl Correlation Key}' class. + * + * + * @see org.eclipse.bpmn2.impl.CorrelationKeyImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCorrelationKey() + * @generated + */ + int CORRELATION_KEY = 30; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_KEY__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_KEY__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_KEY__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CORRELATION_KEY__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CORRELATION_KEY__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Correlation Property Ref' reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_KEY__CORRELATION_PROPERTY_REF = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CORRELATION_KEY__NAME = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Correlation Key' class. + * + * + * @generated + * @ordered + */ + int CORRELATION_KEY_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CorrelationPropertyImpl Correlation Property}' class. + * + * + * @see org.eclipse.bpmn2.impl.CorrelationPropertyImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCorrelationProperty() + * @generated + */ + int CORRELATION_PROPERTY = 31; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Correlation Property Retrieval Expression' containment reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY__NAME = ROOT_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Type' reference. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY__TYPE = ROOT_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Correlation Property' class. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CorrelationPropertyBindingImpl Correlation Property Binding}' class. + * + * + * @see org.eclipse.bpmn2.impl.CorrelationPropertyBindingImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCorrelationPropertyBinding() + * @generated + */ + int CORRELATION_PROPERTY_BINDING = 32; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_BINDING__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_BINDING__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_BINDING__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_BINDING__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_BINDING__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Data Path' containment reference. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_BINDING__DATA_PATH = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Correlation Property Ref' reference. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_BINDING__CORRELATION_PROPERTY_REF = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Correlation Property Binding' class. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_BINDING_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CorrelationPropertyRetrievalExpressionImpl Correlation Property Retrieval Expression}' class. + * + * + * @see org.eclipse.bpmn2.impl.CorrelationPropertyRetrievalExpressionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCorrelationPropertyRetrievalExpression() + * @generated + */ + int CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION = 33; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Message Path' containment reference. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_PATH = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Message Ref' reference. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_REF = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Correlation Property Retrieval Expression' class. + * + * + * @generated + * @ordered + */ + int CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.CorrelationSubscriptionImpl Correlation Subscription}' class. + * + * + * @see org.eclipse.bpmn2.impl.CorrelationSubscriptionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCorrelationSubscription() + * @generated + */ + int CORRELATION_SUBSCRIPTION = 34; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_SUBSCRIPTION__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_SUBSCRIPTION__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_SUBSCRIPTION__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int CORRELATION_SUBSCRIPTION__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int CORRELATION_SUBSCRIPTION__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Correlation Property Binding' containment reference list. + * + * + * @generated + * @ordered + */ + int CORRELATION_SUBSCRIPTION__CORRELATION_PROPERTY_BINDING = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Correlation Key Ref' reference. + * + * + * @generated + * @ordered + */ + int CORRELATION_SUBSCRIPTION__CORRELATION_KEY_REF = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Correlation Subscription' class. + * + * + * @generated + * @ordered + */ + int CORRELATION_SUBSCRIPTION_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.DataAssociationImpl Data Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataAssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataAssociation() + * @generated + */ + int DATA_ASSOCIATION = 35; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_ASSOCIATION__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_ASSOCIATION__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int DATA_ASSOCIATION__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DATA_ASSOCIATION__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int DATA_ASSOCIATION__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Source Ref' reference list. + * + * + * @generated + * @ordered + */ + int DATA_ASSOCIATION__SOURCE_REF = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Target Ref' reference. + * + * + * @generated + * @ordered + */ + int DATA_ASSOCIATION__TARGET_REF = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Transformation' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_ASSOCIATION__TRANSFORMATION = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Assignment' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_ASSOCIATION__ASSIGNMENT = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Data Association' class. + * + * + * @generated + * @ordered + */ + int DATA_ASSOCIATION_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ItemAwareElementImpl Item Aware Element}' class. + * + * + * @see org.eclipse.bpmn2.impl.ItemAwareElementImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getItemAwareElement() + * @generated + */ + int ITEM_AWARE_ELEMENT = 86; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int ITEM_AWARE_ELEMENT__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int ITEM_AWARE_ELEMENT__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int ITEM_AWARE_ELEMENT__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int ITEM_AWARE_ELEMENT__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int ITEM_AWARE_ELEMENT__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Data State' containment reference. + * + * + * @generated + * @ordered + */ + int ITEM_AWARE_ELEMENT__DATA_STATE = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Item Subject Ref' reference. + * + * + * @generated + * @ordered + */ + int ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Item Aware Element' class. + * + * + * @generated + * @ordered + */ + int ITEM_AWARE_ELEMENT_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.DataInputImpl Data Input}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataInputImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataInput() + * @generated + */ + int DATA_INPUT = 36; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_INPUT__DOCUMENTATION = ITEM_AWARE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_INPUT__EXTENSION_VALUES = ITEM_AWARE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int DATA_INPUT__EXTENSION_DEFINITIONS = ITEM_AWARE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DATA_INPUT__ID = ITEM_AWARE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int DATA_INPUT__ANY_ATTRIBUTE = ITEM_AWARE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Data State' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_INPUT__DATA_STATE = ITEM_AWARE_ELEMENT__DATA_STATE; + + /** + * The feature id for the 'Item Subject Ref' reference. + * + * + * @generated + * @ordered + */ + int DATA_INPUT__ITEM_SUBJECT_REF = ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF; + + /** + * The feature id for the 'Input Set With Optional' reference list. + * + * + * @generated + * @ordered + */ + int DATA_INPUT__INPUT_SET_WITH_OPTIONAL = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Input Set With While Executing' reference list. + * + * + * @generated + * @ordered + */ + int DATA_INPUT__INPUT_SET_WITH_WHILE_EXECUTING = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Input Set Refs' reference list. + * + * + * @generated + * @ordered + */ + int DATA_INPUT__INPUT_SET_REFS = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Is Collection' attribute. + * + * + * @generated + * @ordered + */ + int DATA_INPUT__IS_COLLECTION = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int DATA_INPUT__NAME = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The number of structural features of the 'Data Input' class. + * + * + * @generated + * @ordered + */ + int DATA_INPUT_FEATURE_COUNT = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 5; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.DataInputAssociationImpl Data Input Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataInputAssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataInputAssociation() + * @generated + */ + int DATA_INPUT_ASSOCIATION = 37; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_INPUT_ASSOCIATION__DOCUMENTATION = DATA_ASSOCIATION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_INPUT_ASSOCIATION__EXTENSION_VALUES = DATA_ASSOCIATION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int DATA_INPUT_ASSOCIATION__EXTENSION_DEFINITIONS = DATA_ASSOCIATION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DATA_INPUT_ASSOCIATION__ID = DATA_ASSOCIATION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int DATA_INPUT_ASSOCIATION__ANY_ATTRIBUTE = DATA_ASSOCIATION__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Source Ref' reference list. + * + * + * @generated + * @ordered + */ + int DATA_INPUT_ASSOCIATION__SOURCE_REF = DATA_ASSOCIATION__SOURCE_REF; + + /** + * The feature id for the 'Target Ref' reference. + * + * + * @generated + * @ordered + */ + int DATA_INPUT_ASSOCIATION__TARGET_REF = DATA_ASSOCIATION__TARGET_REF; + + /** + * The feature id for the 'Transformation' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_INPUT_ASSOCIATION__TRANSFORMATION = DATA_ASSOCIATION__TRANSFORMATION; + + /** + * The feature id for the 'Assignment' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_INPUT_ASSOCIATION__ASSIGNMENT = DATA_ASSOCIATION__ASSIGNMENT; + + /** + * The number of structural features of the 'Data Input Association' class. + * + * + * @generated + * @ordered + */ + int DATA_INPUT_ASSOCIATION_FEATURE_COUNT = DATA_ASSOCIATION_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.DataObjectImpl Data Object}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataObjectImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataObject() + * @generated + */ + int DATA_OBJECT = 38; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT__DOCUMENTATION = FLOW_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT__EXTENSION_VALUES = FLOW_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT__EXTENSION_DEFINITIONS = FLOW_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT__ID = FLOW_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT__ANY_ATTRIBUTE = FLOW_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT__AUDITING = FLOW_ELEMENT__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT__MONITORING = FLOW_ELEMENT__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT__CATEGORY_VALUE_REF = FLOW_ELEMENT__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT__NAME = FLOW_ELEMENT__NAME; + + /** + * The feature id for the 'Data State' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT__DATA_STATE = FLOW_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Item Subject Ref' reference. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT__ITEM_SUBJECT_REF = FLOW_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Is Collection' attribute. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT__IS_COLLECTION = FLOW_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Data Object' class. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_FEATURE_COUNT = FLOW_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.DataObjectReferenceImpl Data Object Reference}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataObjectReferenceImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataObjectReference() + * @generated + */ + int DATA_OBJECT_REFERENCE = 39; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_REFERENCE__DOCUMENTATION = FLOW_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_REFERENCE__EXTENSION_VALUES = FLOW_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_REFERENCE__EXTENSION_DEFINITIONS = FLOW_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_REFERENCE__ID = FLOW_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_REFERENCE__ANY_ATTRIBUTE = FLOW_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_REFERENCE__AUDITING = FLOW_ELEMENT__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_REFERENCE__MONITORING = FLOW_ELEMENT__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_REFERENCE__CATEGORY_VALUE_REF = FLOW_ELEMENT__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_REFERENCE__NAME = FLOW_ELEMENT__NAME; + + /** + * The feature id for the 'Data State' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_REFERENCE__DATA_STATE = FLOW_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Item Subject Ref' reference. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_REFERENCE__ITEM_SUBJECT_REF = FLOW_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Data Object Ref' reference. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_REFERENCE__DATA_OBJECT_REF = FLOW_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Data Object Reference' class. + * + * + * @generated + * @ordered + */ + int DATA_OBJECT_REFERENCE_FEATURE_COUNT = FLOW_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.DataOutputImpl Data Output}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataOutputImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataOutput() + * @generated + */ + int DATA_OUTPUT = 40; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT__DOCUMENTATION = ITEM_AWARE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT__EXTENSION_VALUES = ITEM_AWARE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT__EXTENSION_DEFINITIONS = ITEM_AWARE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT__ID = ITEM_AWARE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT__ANY_ATTRIBUTE = ITEM_AWARE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Data State' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT__DATA_STATE = ITEM_AWARE_ELEMENT__DATA_STATE; + + /** + * The feature id for the 'Item Subject Ref' reference. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT__ITEM_SUBJECT_REF = ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF; + + /** + * The feature id for the 'Output Set With Optional' reference list. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT__OUTPUT_SET_WITH_OPTIONAL = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Output Set With While Executing' reference list. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT__OUTPUT_SET_WITH_WHILE_EXECUTING = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Output Set Refs' reference list. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT__OUTPUT_SET_REFS = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Is Collection' attribute. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT__IS_COLLECTION = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT__NAME = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The number of structural features of the 'Data Output' class. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT_FEATURE_COUNT = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 5; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.DataOutputAssociationImpl Data Output Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataOutputAssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataOutputAssociation() + * @generated + */ + int DATA_OUTPUT_ASSOCIATION = 41; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT_ASSOCIATION__DOCUMENTATION = DATA_ASSOCIATION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT_ASSOCIATION__EXTENSION_VALUES = DATA_ASSOCIATION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT_ASSOCIATION__EXTENSION_DEFINITIONS = DATA_ASSOCIATION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT_ASSOCIATION__ID = DATA_ASSOCIATION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT_ASSOCIATION__ANY_ATTRIBUTE = DATA_ASSOCIATION__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Source Ref' reference list. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT_ASSOCIATION__SOURCE_REF = DATA_ASSOCIATION__SOURCE_REF; + + /** + * The feature id for the 'Target Ref' reference. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT_ASSOCIATION__TARGET_REF = DATA_ASSOCIATION__TARGET_REF; + + /** + * The feature id for the 'Transformation' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT_ASSOCIATION__TRANSFORMATION = DATA_ASSOCIATION__TRANSFORMATION; + + /** + * The feature id for the 'Assignment' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT_ASSOCIATION__ASSIGNMENT = DATA_ASSOCIATION__ASSIGNMENT; + + /** + * The number of structural features of the 'Data Output Association' class. + * + * + * @generated + * @ordered + */ + int DATA_OUTPUT_ASSOCIATION_FEATURE_COUNT = DATA_ASSOCIATION_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.DataStateImpl Data State}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataStateImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataState() + * @generated + */ + int DATA_STATE = 42; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_STATE__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_STATE__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int DATA_STATE__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DATA_STATE__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int DATA_STATE__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int DATA_STATE__NAME = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Data State' class. + * + * + * @generated + * @ordered + */ + int DATA_STATE_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.DataStoreImpl Data Store}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataStoreImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataStore() + * @generated + */ + int DATA_STORE = 43; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_STORE__DOCUMENTATION = ITEM_AWARE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_STORE__EXTENSION_VALUES = ITEM_AWARE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int DATA_STORE__EXTENSION_DEFINITIONS = ITEM_AWARE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DATA_STORE__ID = ITEM_AWARE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int DATA_STORE__ANY_ATTRIBUTE = ITEM_AWARE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Data State' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_STORE__DATA_STATE = ITEM_AWARE_ELEMENT__DATA_STATE; + + /** + * The feature id for the 'Item Subject Ref' reference. + * + * + * @generated + * @ordered + */ + int DATA_STORE__ITEM_SUBJECT_REF = ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF; + + /** + * The feature id for the 'Capacity' attribute. + * + * + * @generated + * @ordered + */ + int DATA_STORE__CAPACITY = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Is Unlimited' attribute. + * + * + * @generated + * @ordered + */ + int DATA_STORE__IS_UNLIMITED = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int DATA_STORE__NAME = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Data Store' class. + * + * + * @generated + * @ordered + */ + int DATA_STORE_FEATURE_COUNT = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.DataStoreReferenceImpl Data Store Reference}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataStoreReferenceImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataStoreReference() + * @generated + */ + int DATA_STORE_REFERENCE = 44; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_STORE_REFERENCE__DOCUMENTATION = FLOW_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_STORE_REFERENCE__EXTENSION_VALUES = FLOW_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int DATA_STORE_REFERENCE__EXTENSION_DEFINITIONS = FLOW_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DATA_STORE_REFERENCE__ID = FLOW_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int DATA_STORE_REFERENCE__ANY_ATTRIBUTE = FLOW_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_STORE_REFERENCE__AUDITING = FLOW_ELEMENT__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_STORE_REFERENCE__MONITORING = FLOW_ELEMENT__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int DATA_STORE_REFERENCE__CATEGORY_VALUE_REF = FLOW_ELEMENT__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int DATA_STORE_REFERENCE__NAME = FLOW_ELEMENT__NAME; + + /** + * The feature id for the 'Data State' containment reference. + * + * + * @generated + * @ordered + */ + int DATA_STORE_REFERENCE__DATA_STATE = FLOW_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Item Subject Ref' reference. + * + * + * @generated + * @ordered + */ + int DATA_STORE_REFERENCE__ITEM_SUBJECT_REF = FLOW_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Data Store Ref' reference. + * + * + * @generated + * @ordered + */ + int DATA_STORE_REFERENCE__DATA_STORE_REF = FLOW_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Data Store Reference' class. + * + * + * @generated + * @ordered + */ + int DATA_STORE_REFERENCE_FEATURE_COUNT = FLOW_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.DefinitionsImpl Definitions}' class. + * + * + * @see org.eclipse.bpmn2.impl.DefinitionsImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDefinitions() + * @generated + */ + int DEFINITIONS = 45; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Imports' containment reference list. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__IMPORTS = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Extensions' containment reference list. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__EXTENSIONS = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Root Elements' containment reference list. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__ROOT_ELEMENTS = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Diagrams' containment reference list. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__DIAGRAMS = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Relationships' containment reference list. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__RELATIONSHIPS = BASE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Exporter' attribute. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__EXPORTER = BASE_ELEMENT_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Exporter Version' attribute. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__EXPORTER_VERSION = BASE_ELEMENT_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Expression Language' attribute. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__EXPRESSION_LANGUAGE = BASE_ELEMENT_FEATURE_COUNT + 7; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__NAME = BASE_ELEMENT_FEATURE_COUNT + 8; + + /** + * The feature id for the 'Target Namespace' attribute. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__TARGET_NAMESPACE = BASE_ELEMENT_FEATURE_COUNT + 9; + + /** + * The feature id for the 'Type Language' attribute. + * + * + * @generated + * @ordered + */ + int DEFINITIONS__TYPE_LANGUAGE = BASE_ELEMENT_FEATURE_COUNT + 10; + + /** + * The number of structural features of the 'Definitions' class. + * + * + * @generated + * @ordered + */ + int DEFINITIONS_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 11; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.DocumentationImpl Documentation}' class. + * + * + * @see org.eclipse.bpmn2.impl.DocumentationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDocumentation() + * @generated + */ + int DOCUMENTATION = 46; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int DOCUMENTATION__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int DOCUMENTATION__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int DOCUMENTATION__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DOCUMENTATION__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int DOCUMENTATION__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Mixed' attribute list. + * + * + * @generated + * @ordered + */ + int DOCUMENTATION__MIXED = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Text' attribute. + * + * + * @generated + * @ordered + */ + int DOCUMENTATION__TEXT = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Text Format' attribute. + * + * + * @generated + * @ordered + */ + int DOCUMENTATION__TEXT_FORMAT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Documentation' class. + * + * + * @generated + * @ordered + */ + int DOCUMENTATION_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ThrowEventImpl Throw Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.ThrowEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getThrowEvent() + * @generated + */ + int THROW_EVENT = 134; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__DOCUMENTATION = EVENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__EXTENSION_VALUES = EVENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__EXTENSION_DEFINITIONS = EVENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__ID = EVENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__ANY_ATTRIBUTE = EVENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__AUDITING = EVENT__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__MONITORING = EVENT__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__CATEGORY_VALUE_REF = EVENT__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__NAME = EVENT__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__INCOMING = EVENT__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__LANES = EVENT__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__OUTGOING = EVENT__OUTGOING; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__INCOMING_CONVERSATION_LINKS = EVENT__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__OUTGOING_CONVERSATION_LINKS = EVENT__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__PROPERTIES = EVENT__PROPERTIES; + + /** + * The feature id for the 'Data Inputs' containment reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__DATA_INPUTS = EVENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Data Input Association' containment reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__DATA_INPUT_ASSOCIATION = EVENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Input Set' containment reference. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__INPUT_SET = EVENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Event Definitions' containment reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__EVENT_DEFINITIONS = EVENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Event Definition Refs' reference list. + * + * + * @generated + * @ordered + */ + int THROW_EVENT__EVENT_DEFINITION_REFS = EVENT_FEATURE_COUNT + 4; + + /** + * The number of structural features of the 'Throw Event' class. + * + * + * @generated + * @ordered + */ + int THROW_EVENT_FEATURE_COUNT = EVENT_FEATURE_COUNT + 5; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.EndEventImpl End Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.EndEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEndEvent() + * @generated + */ + int END_EVENT = 47; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__DOCUMENTATION = THROW_EVENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__EXTENSION_VALUES = THROW_EVENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__EXTENSION_DEFINITIONS = THROW_EVENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int END_EVENT__ID = THROW_EVENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int END_EVENT__ANY_ATTRIBUTE = THROW_EVENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int END_EVENT__AUDITING = THROW_EVENT__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int END_EVENT__MONITORING = THROW_EVENT__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__CATEGORY_VALUE_REF = THROW_EVENT__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int END_EVENT__NAME = THROW_EVENT__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__INCOMING = THROW_EVENT__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__LANES = THROW_EVENT__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__OUTGOING = THROW_EVENT__OUTGOING; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__INCOMING_CONVERSATION_LINKS = THROW_EVENT__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__OUTGOING_CONVERSATION_LINKS = THROW_EVENT__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__PROPERTIES = THROW_EVENT__PROPERTIES; + + /** + * The feature id for the 'Data Inputs' containment reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__DATA_INPUTS = THROW_EVENT__DATA_INPUTS; + + /** + * The feature id for the 'Data Input Association' containment reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__DATA_INPUT_ASSOCIATION = THROW_EVENT__DATA_INPUT_ASSOCIATION; + + /** + * The feature id for the 'Input Set' containment reference. + * + * + * @generated + * @ordered + */ + int END_EVENT__INPUT_SET = THROW_EVENT__INPUT_SET; + + /** + * The feature id for the 'Event Definitions' containment reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__EVENT_DEFINITIONS = THROW_EVENT__EVENT_DEFINITIONS; + + /** + * The feature id for the 'Event Definition Refs' reference list. + * + * + * @generated + * @ordered + */ + int END_EVENT__EVENT_DEFINITION_REFS = THROW_EVENT__EVENT_DEFINITION_REFS; + + /** + * The number of structural features of the 'End Event' class. + * + * + * @generated + * @ordered + */ + int END_EVENT_FEATURE_COUNT = THROW_EVENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.EndPointImpl End Point}' class. + * + * + * @see org.eclipse.bpmn2.impl.EndPointImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEndPoint() + * @generated + */ + int END_POINT = 48; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int END_POINT__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int END_POINT__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int END_POINT__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int END_POINT__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int END_POINT__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The number of structural features of the 'End Point' class. + * + * + * @generated + * @ordered + */ + int END_POINT_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ErrorImpl Error}' class. + * + * + * @see org.eclipse.bpmn2.impl.ErrorImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getError() + * @generated + */ + int ERROR = 49; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int ERROR__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int ERROR__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int ERROR__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int ERROR__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int ERROR__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Error Code' attribute. + * + * + * @generated + * @ordered + */ + int ERROR__ERROR_CODE = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int ERROR__NAME = ROOT_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Structure Ref' reference. + * + * + * @generated + * @ordered + */ + int ERROR__STRUCTURE_REF = ROOT_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Error' class. + * + * + * @generated + * @ordered + */ + int ERROR_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ErrorEventDefinitionImpl Error Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.ErrorEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getErrorEventDefinition() + * @generated + */ + int ERROR_EVENT_DEFINITION = 50; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int ERROR_EVENT_DEFINITION__DOCUMENTATION = EVENT_DEFINITION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int ERROR_EVENT_DEFINITION__EXTENSION_VALUES = EVENT_DEFINITION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int ERROR_EVENT_DEFINITION__EXTENSION_DEFINITIONS = EVENT_DEFINITION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int ERROR_EVENT_DEFINITION__ID = EVENT_DEFINITION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int ERROR_EVENT_DEFINITION__ANY_ATTRIBUTE = EVENT_DEFINITION__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Error Ref' reference. + * + * + * @generated + * @ordered + */ + int ERROR_EVENT_DEFINITION__ERROR_REF = EVENT_DEFINITION_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Error Event Definition' class. + * + * + * @generated + * @ordered + */ + int ERROR_EVENT_DEFINITION_FEATURE_COUNT = EVENT_DEFINITION_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.EscalationImpl Escalation}' class. + * + * + * @see org.eclipse.bpmn2.impl.EscalationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEscalation() + * @generated + */ + int ESCALATION = 51; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int ESCALATION__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int ESCALATION__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int ESCALATION__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int ESCALATION__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int ESCALATION__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Escalation Code' attribute. + * + * + * @generated + * @ordered + */ + int ESCALATION__ESCALATION_CODE = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int ESCALATION__NAME = ROOT_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Structure Ref' reference. + * + * + * @generated + * @ordered + */ + int ESCALATION__STRUCTURE_REF = ROOT_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Escalation' class. + * + * + * @generated + * @ordered + */ + int ESCALATION_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.EscalationEventDefinitionImpl Escalation Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.EscalationEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEscalationEventDefinition() + * @generated + */ + int ESCALATION_EVENT_DEFINITION = 52; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int ESCALATION_EVENT_DEFINITION__DOCUMENTATION = EVENT_DEFINITION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int ESCALATION_EVENT_DEFINITION__EXTENSION_VALUES = EVENT_DEFINITION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int ESCALATION_EVENT_DEFINITION__EXTENSION_DEFINITIONS = EVENT_DEFINITION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int ESCALATION_EVENT_DEFINITION__ID = EVENT_DEFINITION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int ESCALATION_EVENT_DEFINITION__ANY_ATTRIBUTE = EVENT_DEFINITION__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Escalation Ref' reference. + * + * + * @generated + * @ordered + */ + int ESCALATION_EVENT_DEFINITION__ESCALATION_REF = EVENT_DEFINITION_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Escalation Event Definition' class. + * + * + * @generated + * @ordered + */ + int ESCALATION_EVENT_DEFINITION_FEATURE_COUNT = EVENT_DEFINITION_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.EventBasedGatewayImpl Event Based Gateway}' class. + * + * + * @see org.eclipse.bpmn2.impl.EventBasedGatewayImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEventBasedGateway() + * @generated + */ + int EVENT_BASED_GATEWAY = 54; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__DOCUMENTATION = GATEWAY__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__EXTENSION_VALUES = GATEWAY__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__EXTENSION_DEFINITIONS = GATEWAY__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__ID = GATEWAY__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__ANY_ATTRIBUTE = GATEWAY__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__AUDITING = GATEWAY__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__MONITORING = GATEWAY__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__CATEGORY_VALUE_REF = GATEWAY__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__NAME = GATEWAY__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__INCOMING = GATEWAY__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__LANES = GATEWAY__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__OUTGOING = GATEWAY__OUTGOING; + + /** + * The feature id for the 'Gateway Direction' attribute. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__GATEWAY_DIRECTION = GATEWAY__GATEWAY_DIRECTION; + + /** + * The feature id for the 'Event Gateway Type' attribute. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__EVENT_GATEWAY_TYPE = GATEWAY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Instantiate' attribute. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY__INSTANTIATE = GATEWAY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Event Based Gateway' class. + * + * + * @generated + * @ordered + */ + int EVENT_BASED_GATEWAY_FEATURE_COUNT = GATEWAY_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ExclusiveGatewayImpl Exclusive Gateway}' class. + * + * + * @see org.eclipse.bpmn2.impl.ExclusiveGatewayImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getExclusiveGateway() + * @generated + */ + int EXCLUSIVE_GATEWAY = 56; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__DOCUMENTATION = GATEWAY__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__EXTENSION_VALUES = GATEWAY__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__EXTENSION_DEFINITIONS = GATEWAY__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__ID = GATEWAY__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__ANY_ATTRIBUTE = GATEWAY__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__AUDITING = GATEWAY__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__MONITORING = GATEWAY__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__CATEGORY_VALUE_REF = GATEWAY__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__NAME = GATEWAY__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__INCOMING = GATEWAY__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__LANES = GATEWAY__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__OUTGOING = GATEWAY__OUTGOING; + + /** + * The feature id for the 'Gateway Direction' attribute. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__GATEWAY_DIRECTION = GATEWAY__GATEWAY_DIRECTION; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY__DEFAULT = GATEWAY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Exclusive Gateway' class. + * + * + * @generated + * @ordered + */ + int EXCLUSIVE_GATEWAY_FEATURE_COUNT = GATEWAY_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ExpressionImpl Expression}' class. + * + * + * @see org.eclipse.bpmn2.impl.ExpressionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getExpression() + * @generated + */ + int EXPRESSION = 57; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int EXPRESSION__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int EXPRESSION__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int EXPRESSION__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int EXPRESSION__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int EXPRESSION__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The number of structural features of the 'Expression' class. + * + * + * @generated + * @ordered + */ + int EXPRESSION_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ExtensionImpl Extension}' class. + * + * + * @see org.eclipse.bpmn2.impl.ExtensionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getExtension() + * @generated + */ + int EXTENSION = 58; + + /** + * The feature id for the 'Definition' containment reference. + * + * + * @generated + * @ordered + */ + int EXTENSION__DEFINITION = 0; + + /** + * The feature id for the 'Must Understand' attribute. + * + * + * @generated + * @ordered + */ + int EXTENSION__MUST_UNDERSTAND = 1; + + /** + * The feature id for the 'Xsd Definition' attribute. + * + * + * @generated + * @ordered + */ + int EXTENSION__XSD_DEFINITION = 2; + + /** + * The number of structural features of the 'Extension' class. + * + * + * @generated + * @ordered + */ + int EXTENSION_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ExtensionAttributeDefinitionImpl Extension Attribute Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.ExtensionAttributeDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getExtensionAttributeDefinition() + * @generated + */ + int EXTENSION_ATTRIBUTE_DEFINITION = 59; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int EXTENSION_ATTRIBUTE_DEFINITION__NAME = 0; + + /** + * The feature id for the 'Type' attribute. + * + * + * @generated + * @ordered + */ + int EXTENSION_ATTRIBUTE_DEFINITION__TYPE = 1; + + /** + * The feature id for the 'Is Reference' attribute. + * + * + * @generated + * @ordered + */ + int EXTENSION_ATTRIBUTE_DEFINITION__IS_REFERENCE = 2; + + /** + * The feature id for the 'Extension Definition' container reference. + * + * + * @generated + * @ordered + */ + int EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION = 3; + + /** + * The number of structural features of the 'Extension Attribute Definition' class. + * + * + * @generated + * @ordered + */ + int EXTENSION_ATTRIBUTE_DEFINITION_FEATURE_COUNT = 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ExtensionAttributeValueImpl Extension Attribute Value}' class. + * + * + * @see org.eclipse.bpmn2.impl.ExtensionAttributeValueImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getExtensionAttributeValue() + * @generated + */ + int EXTENSION_ATTRIBUTE_VALUE = 60; + + /** + * The feature id for the 'Value Ref' reference. + * + * + * @generated + * @ordered + */ + int EXTENSION_ATTRIBUTE_VALUE__VALUE_REF = 0; + + /** + * The feature id for the 'Value' attribute list. + * + * + * @generated + * @ordered + */ + int EXTENSION_ATTRIBUTE_VALUE__VALUE = 1; + + /** + * The feature id for the 'Extension Attribute Definition' reference. + * + * + * @generated + * @ordered + */ + int EXTENSION_ATTRIBUTE_VALUE__EXTENSION_ATTRIBUTE_DEFINITION = 2; + + /** + * The number of structural features of the 'Extension Attribute Value' class. + * + * + * @generated + * @ordered + */ + int EXTENSION_ATTRIBUTE_VALUE_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ExtensionDefinitionImpl Extension Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.ExtensionDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getExtensionDefinition() + * @generated + */ + int EXTENSION_DEFINITION = 61; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int EXTENSION_DEFINITION__NAME = 0; + + /** + * The feature id for the 'Extension Attribute Definitions' containment reference list. + * + * + * @generated + * @ordered + */ + int EXTENSION_DEFINITION__EXTENSION_ATTRIBUTE_DEFINITIONS = 1; + + /** + * The number of structural features of the 'Extension Definition' class. + * + * + * @generated + * @ordered + */ + int EXTENSION_DEFINITION_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.FlowElementsContainerImpl Flow Elements Container}' class. + * + * + * @see org.eclipse.bpmn2.impl.FlowElementsContainerImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getFlowElementsContainer() + * @generated + */ + int FLOW_ELEMENTS_CONTAINER = 63; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENTS_CONTAINER__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENTS_CONTAINER__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENTS_CONTAINER__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENTS_CONTAINER__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENTS_CONTAINER__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Lane Sets' containment reference list. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENTS_CONTAINER__LANE_SETS = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Flow Elements' containment reference list. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Flow Elements Container' class. + * + * + * @generated + * @ordered + */ + int FLOW_ELEMENTS_CONTAINER_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.FormalExpressionImpl Formal Expression}' class. + * + * + * @see org.eclipse.bpmn2.impl.FormalExpressionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getFormalExpression() + * @generated + */ + int FORMAL_EXPRESSION = 65; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int FORMAL_EXPRESSION__DOCUMENTATION = EXPRESSION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int FORMAL_EXPRESSION__EXTENSION_VALUES = EXPRESSION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int FORMAL_EXPRESSION__EXTENSION_DEFINITIONS = EXPRESSION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int FORMAL_EXPRESSION__ID = EXPRESSION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int FORMAL_EXPRESSION__ANY_ATTRIBUTE = EXPRESSION__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Mixed' attribute list. + * + * + * @generated + * @ordered + */ + int FORMAL_EXPRESSION__MIXED = EXPRESSION_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Body' attribute. + * + * + * @generated + * @ordered + */ + int FORMAL_EXPRESSION__BODY = EXPRESSION_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Evaluates To Type Ref' reference. + * + * + * @generated + * @ordered + */ + int FORMAL_EXPRESSION__EVALUATES_TO_TYPE_REF = EXPRESSION_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Language' attribute. + * + * + * @generated + * @ordered + */ + int FORMAL_EXPRESSION__LANGUAGE = EXPRESSION_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Formal Expression' class. + * + * + * @generated + * @ordered + */ + int FORMAL_EXPRESSION_FEATURE_COUNT = EXPRESSION_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.GlobalTaskImpl Global Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalTask() + * @generated + */ + int GLOBAL_TASK = 72; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_TASK__DOCUMENTATION = CALLABLE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_TASK__EXTENSION_VALUES = CALLABLE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_TASK__EXTENSION_DEFINITIONS = CALLABLE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_TASK__ID = CALLABLE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int GLOBAL_TASK__ANY_ATTRIBUTE = CALLABLE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Supported Interface Refs' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_TASK__SUPPORTED_INTERFACE_REFS = CALLABLE_ELEMENT__SUPPORTED_INTERFACE_REFS; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int GLOBAL_TASK__IO_SPECIFICATION = CALLABLE_ELEMENT__IO_SPECIFICATION; + + /** + * The feature id for the 'Io Binding' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_TASK__IO_BINDING = CALLABLE_ELEMENT__IO_BINDING; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_TASK__NAME = CALLABLE_ELEMENT__NAME; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_TASK__RESOURCES = CALLABLE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Global Task' class. + * + * + * @generated + * @ordered + */ + int GLOBAL_TASK_FEATURE_COUNT = CALLABLE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.GlobalBusinessRuleTaskImpl Global Business Rule Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalBusinessRuleTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalBusinessRuleTask() + * @generated + */ + int GLOBAL_BUSINESS_RULE_TASK = 67; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_BUSINESS_RULE_TASK__DOCUMENTATION = GLOBAL_TASK__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_BUSINESS_RULE_TASK__EXTENSION_VALUES = GLOBAL_TASK__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_BUSINESS_RULE_TASK__EXTENSION_DEFINITIONS = GLOBAL_TASK__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_BUSINESS_RULE_TASK__ID = GLOBAL_TASK__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int GLOBAL_BUSINESS_RULE_TASK__ANY_ATTRIBUTE = GLOBAL_TASK__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Supported Interface Refs' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_BUSINESS_RULE_TASK__SUPPORTED_INTERFACE_REFS = GLOBAL_TASK__SUPPORTED_INTERFACE_REFS; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int GLOBAL_BUSINESS_RULE_TASK__IO_SPECIFICATION = GLOBAL_TASK__IO_SPECIFICATION; + + /** + * The feature id for the 'Io Binding' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_BUSINESS_RULE_TASK__IO_BINDING = GLOBAL_TASK__IO_BINDING; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_BUSINESS_RULE_TASK__NAME = GLOBAL_TASK__NAME; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_BUSINESS_RULE_TASK__RESOURCES = GLOBAL_TASK__RESOURCES; + + /** + * The feature id for the 'Implementation' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_BUSINESS_RULE_TASK__IMPLEMENTATION = GLOBAL_TASK_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Global Business Rule Task' class. + * + * + * @generated + * @ordered + */ + int GLOBAL_BUSINESS_RULE_TASK_FEATURE_COUNT = GLOBAL_TASK_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.GlobalChoreographyTaskImpl Global Choreography Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalChoreographyTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalChoreographyTask() + * @generated + */ + int GLOBAL_CHOREOGRAPHY_TASK = 68; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__DOCUMENTATION = CHOREOGRAPHY__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__EXTENSION_VALUES = CHOREOGRAPHY__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__EXTENSION_DEFINITIONS = CHOREOGRAPHY__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__ID = CHOREOGRAPHY__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__ANY_ATTRIBUTE = CHOREOGRAPHY__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Participants' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__PARTICIPANTS = CHOREOGRAPHY__PARTICIPANTS; + + /** + * The feature id for the 'Message Flows' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__MESSAGE_FLOWS = CHOREOGRAPHY__MESSAGE_FLOWS; + + /** + * The feature id for the 'Artifacts' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__ARTIFACTS = CHOREOGRAPHY__ARTIFACTS; + + /** + * The feature id for the 'Conversations' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__CONVERSATIONS = CHOREOGRAPHY__CONVERSATIONS; + + /** + * The feature id for the 'Conversation Associations' containment reference. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__CONVERSATION_ASSOCIATIONS = CHOREOGRAPHY__CONVERSATION_ASSOCIATIONS; + + /** + * The feature id for the 'Participant Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__PARTICIPANT_ASSOCIATIONS = CHOREOGRAPHY__PARTICIPANT_ASSOCIATIONS; + + /** + * The feature id for the 'Message Flow Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__MESSAGE_FLOW_ASSOCIATIONS = CHOREOGRAPHY__MESSAGE_FLOW_ASSOCIATIONS; + + /** + * The feature id for the 'Correlation Keys' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__CORRELATION_KEYS = CHOREOGRAPHY__CORRELATION_KEYS; + + /** + * The feature id for the 'Choreography Ref' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__CHOREOGRAPHY_REF = CHOREOGRAPHY__CHOREOGRAPHY_REF; + + /** + * The feature id for the 'Conversation Links' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__CONVERSATION_LINKS = CHOREOGRAPHY__CONVERSATION_LINKS; + + /** + * The feature id for the 'Is Closed' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__IS_CLOSED = CHOREOGRAPHY__IS_CLOSED; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__NAME = CHOREOGRAPHY__NAME; + + /** + * The feature id for the 'Lane Sets' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__LANE_SETS = CHOREOGRAPHY__LANE_SETS; + + /** + * The feature id for the 'Flow Elements' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__FLOW_ELEMENTS = CHOREOGRAPHY__FLOW_ELEMENTS; + + /** + * The feature id for the 'Initiating Participant Ref' reference. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK__INITIATING_PARTICIPANT_REF = CHOREOGRAPHY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Global Choreography Task' class. + * + * + * @generated + * @ordered + */ + int GLOBAL_CHOREOGRAPHY_TASK_FEATURE_COUNT = CHOREOGRAPHY_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.GlobalConversationImpl Global Conversation}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalConversationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalConversation() + * @generated + */ + int GLOBAL_CONVERSATION = 69; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__DOCUMENTATION = COLLABORATION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__EXTENSION_VALUES = COLLABORATION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__EXTENSION_DEFINITIONS = COLLABORATION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__ID = COLLABORATION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__ANY_ATTRIBUTE = COLLABORATION__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Participants' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__PARTICIPANTS = COLLABORATION__PARTICIPANTS; + + /** + * The feature id for the 'Message Flows' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__MESSAGE_FLOWS = COLLABORATION__MESSAGE_FLOWS; + + /** + * The feature id for the 'Artifacts' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__ARTIFACTS = COLLABORATION__ARTIFACTS; + + /** + * The feature id for the 'Conversations' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__CONVERSATIONS = COLLABORATION__CONVERSATIONS; + + /** + * The feature id for the 'Conversation Associations' containment reference. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__CONVERSATION_ASSOCIATIONS = COLLABORATION__CONVERSATION_ASSOCIATIONS; + + /** + * The feature id for the 'Participant Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__PARTICIPANT_ASSOCIATIONS = COLLABORATION__PARTICIPANT_ASSOCIATIONS; + + /** + * The feature id for the 'Message Flow Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__MESSAGE_FLOW_ASSOCIATIONS = COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS; + + /** + * The feature id for the 'Correlation Keys' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__CORRELATION_KEYS = COLLABORATION__CORRELATION_KEYS; + + /** + * The feature id for the 'Choreography Ref' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__CHOREOGRAPHY_REF = COLLABORATION__CHOREOGRAPHY_REF; + + /** + * The feature id for the 'Conversation Links' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__CONVERSATION_LINKS = COLLABORATION__CONVERSATION_LINKS; + + /** + * The feature id for the 'Is Closed' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__IS_CLOSED = COLLABORATION__IS_CLOSED; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION__NAME = COLLABORATION__NAME; + + /** + * The number of structural features of the 'Global Conversation' class. + * + * + * @generated + * @ordered + */ + int GLOBAL_CONVERSATION_FEATURE_COUNT = COLLABORATION_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.GlobalManualTaskImpl Global Manual Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalManualTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalManualTask() + * @generated + */ + int GLOBAL_MANUAL_TASK = 70; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_MANUAL_TASK__DOCUMENTATION = GLOBAL_TASK__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_MANUAL_TASK__EXTENSION_VALUES = GLOBAL_TASK__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_MANUAL_TASK__EXTENSION_DEFINITIONS = GLOBAL_TASK__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_MANUAL_TASK__ID = GLOBAL_TASK__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int GLOBAL_MANUAL_TASK__ANY_ATTRIBUTE = GLOBAL_TASK__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Supported Interface Refs' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_MANUAL_TASK__SUPPORTED_INTERFACE_REFS = GLOBAL_TASK__SUPPORTED_INTERFACE_REFS; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int GLOBAL_MANUAL_TASK__IO_SPECIFICATION = GLOBAL_TASK__IO_SPECIFICATION; + + /** + * The feature id for the 'Io Binding' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_MANUAL_TASK__IO_BINDING = GLOBAL_TASK__IO_BINDING; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_MANUAL_TASK__NAME = GLOBAL_TASK__NAME; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_MANUAL_TASK__RESOURCES = GLOBAL_TASK__RESOURCES; + + /** + * The number of structural features of the 'Global Manual Task' class. + * + * + * @generated + * @ordered + */ + int GLOBAL_MANUAL_TASK_FEATURE_COUNT = GLOBAL_TASK_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.GlobalScriptTaskImpl Global Script Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalScriptTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalScriptTask() + * @generated + */ + int GLOBAL_SCRIPT_TASK = 71; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_SCRIPT_TASK__DOCUMENTATION = GLOBAL_TASK__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_SCRIPT_TASK__EXTENSION_VALUES = GLOBAL_TASK__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_SCRIPT_TASK__EXTENSION_DEFINITIONS = GLOBAL_TASK__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_SCRIPT_TASK__ID = GLOBAL_TASK__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int GLOBAL_SCRIPT_TASK__ANY_ATTRIBUTE = GLOBAL_TASK__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Supported Interface Refs' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_SCRIPT_TASK__SUPPORTED_INTERFACE_REFS = GLOBAL_TASK__SUPPORTED_INTERFACE_REFS; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int GLOBAL_SCRIPT_TASK__IO_SPECIFICATION = GLOBAL_TASK__IO_SPECIFICATION; + + /** + * The feature id for the 'Io Binding' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_SCRIPT_TASK__IO_BINDING = GLOBAL_TASK__IO_BINDING; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_SCRIPT_TASK__NAME = GLOBAL_TASK__NAME; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_SCRIPT_TASK__RESOURCES = GLOBAL_TASK__RESOURCES; + + /** + * The feature id for the 'Script' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_SCRIPT_TASK__SCRIPT = GLOBAL_TASK_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Script Language' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_SCRIPT_TASK__SCRIPT_LANGUAGE = GLOBAL_TASK_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Global Script Task' class. + * + * + * @generated + * @ordered + */ + int GLOBAL_SCRIPT_TASK_FEATURE_COUNT = GLOBAL_TASK_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.GlobalUserTaskImpl Global User Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalUserTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalUserTask() + * @generated + */ + int GLOBAL_USER_TASK = 73; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_USER_TASK__DOCUMENTATION = GLOBAL_TASK__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_USER_TASK__EXTENSION_VALUES = GLOBAL_TASK__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_USER_TASK__EXTENSION_DEFINITIONS = GLOBAL_TASK__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_USER_TASK__ID = GLOBAL_TASK__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int GLOBAL_USER_TASK__ANY_ATTRIBUTE = GLOBAL_TASK__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Supported Interface Refs' reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_USER_TASK__SUPPORTED_INTERFACE_REFS = GLOBAL_TASK__SUPPORTED_INTERFACE_REFS; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int GLOBAL_USER_TASK__IO_SPECIFICATION = GLOBAL_TASK__IO_SPECIFICATION; + + /** + * The feature id for the 'Io Binding' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_USER_TASK__IO_BINDING = GLOBAL_TASK__IO_BINDING; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_USER_TASK__NAME = GLOBAL_TASK__NAME; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_USER_TASK__RESOURCES = GLOBAL_TASK__RESOURCES; + + /** + * The feature id for the 'Renderings' containment reference list. + * + * + * @generated + * @ordered + */ + int GLOBAL_USER_TASK__RENDERINGS = GLOBAL_TASK_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Implementation' attribute. + * + * + * @generated + * @ordered + */ + int GLOBAL_USER_TASK__IMPLEMENTATION = GLOBAL_TASK_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Global User Task' class. + * + * + * @generated + * @ordered + */ + int GLOBAL_USER_TASK_FEATURE_COUNT = GLOBAL_TASK_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.GroupImpl Group}' class. + * + * + * @see org.eclipse.bpmn2.impl.GroupImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGroup() + * @generated + */ + int GROUP = 74; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int GROUP__DOCUMENTATION = ARTIFACT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int GROUP__EXTENSION_VALUES = ARTIFACT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int GROUP__EXTENSION_DEFINITIONS = ARTIFACT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int GROUP__ID = ARTIFACT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int GROUP__ANY_ATTRIBUTE = ARTIFACT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Category Value Ref' reference. + * + * + * @generated + * @ordered + */ + int GROUP__CATEGORY_VALUE_REF = ARTIFACT_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Group' class. + * + * + * @generated + * @ordered + */ + int GROUP_FEATURE_COUNT = ARTIFACT_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ResourceRoleImpl Resource Role}' class. + * + * + * @see org.eclipse.bpmn2.impl.ResourceRoleImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getResourceRole() + * @generated + */ + int RESOURCE_ROLE = 118; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_ROLE__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_ROLE__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_ROLE__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE_ROLE__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int RESOURCE_ROLE__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Resource Ref' reference. + * + * + * @generated + * @ordered + */ + int RESOURCE_ROLE__RESOURCE_REF = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Resource Parameter Bindings' containment reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Resource Assignment Expression' containment reference. + * + * + * @generated + * @ordered + */ + int RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE_ROLE__NAME = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Resource Role' class. + * + * + * @generated + * @ordered + */ + int RESOURCE_ROLE_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.PerformerImpl Performer}' class. + * + * + * @see org.eclipse.bpmn2.impl.PerformerImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getPerformer() + * @generated + */ + int PERFORMER = 107; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int PERFORMER__DOCUMENTATION = RESOURCE_ROLE__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int PERFORMER__EXTENSION_VALUES = RESOURCE_ROLE__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int PERFORMER__EXTENSION_DEFINITIONS = RESOURCE_ROLE__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int PERFORMER__ID = RESOURCE_ROLE__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int PERFORMER__ANY_ATTRIBUTE = RESOURCE_ROLE__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Resource Ref' reference. + * + * + * @generated + * @ordered + */ + int PERFORMER__RESOURCE_REF = RESOURCE_ROLE__RESOURCE_REF; + + /** + * The feature id for the 'Resource Parameter Bindings' containment reference list. + * + * + * @generated + * @ordered + */ + int PERFORMER__RESOURCE_PARAMETER_BINDINGS = RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS; + + /** + * The feature id for the 'Resource Assignment Expression' containment reference. + * + * + * @generated + * @ordered + */ + int PERFORMER__RESOURCE_ASSIGNMENT_EXPRESSION = RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PERFORMER__NAME = RESOURCE_ROLE__NAME; + + /** + * The number of structural features of the 'Performer' class. + * + * + * @generated + * @ordered + */ + int PERFORMER_FEATURE_COUNT = RESOURCE_ROLE_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.HumanPerformerImpl Human Performer}' class. + * + * + * @see org.eclipse.bpmn2.impl.HumanPerformerImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getHumanPerformer() + * @generated + */ + int HUMAN_PERFORMER = 75; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int HUMAN_PERFORMER__DOCUMENTATION = PERFORMER__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int HUMAN_PERFORMER__EXTENSION_VALUES = PERFORMER__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int HUMAN_PERFORMER__EXTENSION_DEFINITIONS = PERFORMER__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int HUMAN_PERFORMER__ID = PERFORMER__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int HUMAN_PERFORMER__ANY_ATTRIBUTE = PERFORMER__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Resource Ref' reference. + * + * + * @generated + * @ordered + */ + int HUMAN_PERFORMER__RESOURCE_REF = PERFORMER__RESOURCE_REF; + + /** + * The feature id for the 'Resource Parameter Bindings' containment reference list. + * + * + * @generated + * @ordered + */ + int HUMAN_PERFORMER__RESOURCE_PARAMETER_BINDINGS = PERFORMER__RESOURCE_PARAMETER_BINDINGS; + + /** + * The feature id for the 'Resource Assignment Expression' containment reference. + * + * + * @generated + * @ordered + */ + int HUMAN_PERFORMER__RESOURCE_ASSIGNMENT_EXPRESSION = PERFORMER__RESOURCE_ASSIGNMENT_EXPRESSION; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int HUMAN_PERFORMER__NAME = PERFORMER__NAME; + + /** + * The number of structural features of the 'Human Performer' class. + * + * + * @generated + * @ordered + */ + int HUMAN_PERFORMER_FEATURE_COUNT = PERFORMER_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ImplicitThrowEventImpl Implicit Throw Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.ImplicitThrowEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getImplicitThrowEvent() + * @generated + */ + int IMPLICIT_THROW_EVENT = 76; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__DOCUMENTATION = THROW_EVENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__EXTENSION_VALUES = THROW_EVENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__EXTENSION_DEFINITIONS = THROW_EVENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__ID = THROW_EVENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__ANY_ATTRIBUTE = THROW_EVENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__AUDITING = THROW_EVENT__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__MONITORING = THROW_EVENT__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__CATEGORY_VALUE_REF = THROW_EVENT__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__NAME = THROW_EVENT__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__INCOMING = THROW_EVENT__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__LANES = THROW_EVENT__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__OUTGOING = THROW_EVENT__OUTGOING; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__INCOMING_CONVERSATION_LINKS = THROW_EVENT__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__OUTGOING_CONVERSATION_LINKS = THROW_EVENT__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__PROPERTIES = THROW_EVENT__PROPERTIES; + + /** + * The feature id for the 'Data Inputs' containment reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__DATA_INPUTS = THROW_EVENT__DATA_INPUTS; + + /** + * The feature id for the 'Data Input Association' containment reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__DATA_INPUT_ASSOCIATION = THROW_EVENT__DATA_INPUT_ASSOCIATION; + + /** + * The feature id for the 'Input Set' containment reference. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__INPUT_SET = THROW_EVENT__INPUT_SET; + + /** + * The feature id for the 'Event Definitions' containment reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__EVENT_DEFINITIONS = THROW_EVENT__EVENT_DEFINITIONS; + + /** + * The feature id for the 'Event Definition Refs' reference list. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT__EVENT_DEFINITION_REFS = THROW_EVENT__EVENT_DEFINITION_REFS; + + /** + * The number of structural features of the 'Implicit Throw Event' class. + * + * + * @generated + * @ordered + */ + int IMPLICIT_THROW_EVENT_FEATURE_COUNT = THROW_EVENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ImportImpl Import}' class. + * + * + * @see org.eclipse.bpmn2.impl.ImportImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getImport() + * @generated + */ + int IMPORT = 77; + + /** + * The feature id for the 'Import Type' attribute. + * + * + * @generated + * @ordered + */ + int IMPORT__IMPORT_TYPE = 0; + + /** + * The feature id for the 'Location' attribute. + * + * + * @generated + * @ordered + */ + int IMPORT__LOCATION = 1; + + /** + * The feature id for the 'Namespace' attribute. + * + * + * @generated + * @ordered + */ + int IMPORT__NAMESPACE = 2; + + /** + * The number of structural features of the 'Import' class. + * + * + * @generated + * @ordered + */ + int IMPORT_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.InclusiveGatewayImpl Inclusive Gateway}' class. + * + * + * @see org.eclipse.bpmn2.impl.InclusiveGatewayImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getInclusiveGateway() + * @generated + */ + int INCLUSIVE_GATEWAY = 78; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__DOCUMENTATION = GATEWAY__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__EXTENSION_VALUES = GATEWAY__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__EXTENSION_DEFINITIONS = GATEWAY__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__ID = GATEWAY__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__ANY_ATTRIBUTE = GATEWAY__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__AUDITING = GATEWAY__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__MONITORING = GATEWAY__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__CATEGORY_VALUE_REF = GATEWAY__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__NAME = GATEWAY__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__INCOMING = GATEWAY__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__LANES = GATEWAY__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__OUTGOING = GATEWAY__OUTGOING; + + /** + * The feature id for the 'Gateway Direction' attribute. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__GATEWAY_DIRECTION = GATEWAY__GATEWAY_DIRECTION; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY__DEFAULT = GATEWAY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Inclusive Gateway' class. + * + * + * @generated + * @ordered + */ + int INCLUSIVE_GATEWAY_FEATURE_COUNT = GATEWAY_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.InputOutputBindingImpl Input Output Binding}' class. + * + * + * @see org.eclipse.bpmn2.impl.InputOutputBindingImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getInputOutputBinding() + * @generated + */ + int INPUT_OUTPUT_BINDING = 79; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_BINDING__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_BINDING__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_BINDING__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_BINDING__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_BINDING__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Input Data Ref' reference. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_BINDING__INPUT_DATA_REF = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Operation Ref' reference. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_BINDING__OPERATION_REF = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Output Data Ref' reference. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_BINDING__OUTPUT_DATA_REF = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Input Output Binding' class. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_BINDING_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.InputOutputSpecificationImpl Input Output Specification}' class. + * + * + * @see org.eclipse.bpmn2.impl.InputOutputSpecificationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getInputOutputSpecification() + * @generated + */ + int INPUT_OUTPUT_SPECIFICATION = 80; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_SPECIFICATION__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_SPECIFICATION__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_SPECIFICATION__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_SPECIFICATION__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_SPECIFICATION__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Data Inputs' containment reference list. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_SPECIFICATION__DATA_INPUTS = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Data Outputs' containment reference list. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_SPECIFICATION__DATA_OUTPUTS = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Input Sets' containment reference list. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_SPECIFICATION__INPUT_SETS = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Output Sets' containment reference list. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_SPECIFICATION__OUTPUT_SETS = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Input Output Specification' class. + * + * + * @generated + * @ordered + */ + int INPUT_OUTPUT_SPECIFICATION_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.InputSetImpl Input Set}' class. + * + * + * @see org.eclipse.bpmn2.impl.InputSetImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getInputSet() + * @generated + */ + int INPUT_SET = 81; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int INPUT_SET__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int INPUT_SET__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int INPUT_SET__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int INPUT_SET__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int INPUT_SET__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Data Input Refs' reference list. + * + * + * @generated + * @ordered + */ + int INPUT_SET__DATA_INPUT_REFS = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Optional Input Refs' reference list. + * + * + * @generated + * @ordered + */ + int INPUT_SET__OPTIONAL_INPUT_REFS = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'While Executing Input Refs' reference list. + * + * + * @generated + * @ordered + */ + int INPUT_SET__WHILE_EXECUTING_INPUT_REFS = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Output Set Refs' reference list. + * + * + * @generated + * @ordered + */ + int INPUT_SET__OUTPUT_SET_REFS = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int INPUT_SET__NAME = BASE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The number of structural features of the 'Input Set' class. + * + * + * @generated + * @ordered + */ + int INPUT_SET_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 5; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.InteractionNodeImpl Interaction Node}' class. + * + * + * @see org.eclipse.bpmn2.impl.InteractionNodeImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getInteractionNode() + * @generated + */ + int INTERACTION_NODE = 82; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int INTERACTION_NODE__INCOMING_CONVERSATION_LINKS = 0; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS = 1; + + /** + * The number of structural features of the 'Interaction Node' class. + * + * + * @generated + * @ordered + */ + int INTERACTION_NODE_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.InterfaceImpl Interface}' class. + * + * + * @see org.eclipse.bpmn2.impl.InterfaceImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getInterface() + * @generated + */ + int INTERFACE = 83; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERFACE__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERFACE__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int INTERFACE__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int INTERFACE__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int INTERFACE__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Operations' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERFACE__OPERATIONS = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int INTERFACE__NAME = ROOT_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Implementation Ref' attribute. + * + * + * @generated + * @ordered + */ + int INTERFACE__IMPLEMENTATION_REF = ROOT_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Interface' class. + * + * + * @generated + * @ordered + */ + int INTERFACE_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.IntermediateCatchEventImpl Intermediate Catch Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.IntermediateCatchEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getIntermediateCatchEvent() + * @generated + */ + int INTERMEDIATE_CATCH_EVENT = 84; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__DOCUMENTATION = CATCH_EVENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__EXTENSION_VALUES = CATCH_EVENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__EXTENSION_DEFINITIONS = CATCH_EVENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__ID = CATCH_EVENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__ANY_ATTRIBUTE = CATCH_EVENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__AUDITING = CATCH_EVENT__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__MONITORING = CATCH_EVENT__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__CATEGORY_VALUE_REF = CATCH_EVENT__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__NAME = CATCH_EVENT__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__INCOMING = CATCH_EVENT__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__LANES = CATCH_EVENT__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__OUTGOING = CATCH_EVENT__OUTGOING; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__INCOMING_CONVERSATION_LINKS = CATCH_EVENT__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__OUTGOING_CONVERSATION_LINKS = CATCH_EVENT__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__PROPERTIES = CATCH_EVENT__PROPERTIES; + + /** + * The feature id for the 'Data Outputs' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__DATA_OUTPUTS = CATCH_EVENT__DATA_OUTPUTS; + + /** + * The feature id for the 'Data Output Association' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__DATA_OUTPUT_ASSOCIATION = CATCH_EVENT__DATA_OUTPUT_ASSOCIATION; + + /** + * The feature id for the 'Output Set' containment reference. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__OUTPUT_SET = CATCH_EVENT__OUTPUT_SET; + + /** + * The feature id for the 'Event Definitions' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__EVENT_DEFINITIONS = CATCH_EVENT__EVENT_DEFINITIONS; + + /** + * The feature id for the 'Event Definition Refs' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__EVENT_DEFINITION_REFS = CATCH_EVENT__EVENT_DEFINITION_REFS; + + /** + * The feature id for the 'Parallel Multiple' attribute. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT__PARALLEL_MULTIPLE = CATCH_EVENT__PARALLEL_MULTIPLE; + + /** + * The number of structural features of the 'Intermediate Catch Event' class. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_CATCH_EVENT_FEATURE_COUNT = CATCH_EVENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.IntermediateThrowEventImpl Intermediate Throw Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.IntermediateThrowEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getIntermediateThrowEvent() + * @generated + */ + int INTERMEDIATE_THROW_EVENT = 85; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__DOCUMENTATION = THROW_EVENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__EXTENSION_VALUES = THROW_EVENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__EXTENSION_DEFINITIONS = THROW_EVENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__ID = THROW_EVENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__ANY_ATTRIBUTE = THROW_EVENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__AUDITING = THROW_EVENT__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__MONITORING = THROW_EVENT__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__CATEGORY_VALUE_REF = THROW_EVENT__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__NAME = THROW_EVENT__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__INCOMING = THROW_EVENT__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__LANES = THROW_EVENT__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__OUTGOING = THROW_EVENT__OUTGOING; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__INCOMING_CONVERSATION_LINKS = THROW_EVENT__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__OUTGOING_CONVERSATION_LINKS = THROW_EVENT__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__PROPERTIES = THROW_EVENT__PROPERTIES; + + /** + * The feature id for the 'Data Inputs' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__DATA_INPUTS = THROW_EVENT__DATA_INPUTS; + + /** + * The feature id for the 'Data Input Association' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__DATA_INPUT_ASSOCIATION = THROW_EVENT__DATA_INPUT_ASSOCIATION; + + /** + * The feature id for the 'Input Set' containment reference. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__INPUT_SET = THROW_EVENT__INPUT_SET; + + /** + * The feature id for the 'Event Definitions' containment reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__EVENT_DEFINITIONS = THROW_EVENT__EVENT_DEFINITIONS; + + /** + * The feature id for the 'Event Definition Refs' reference list. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT__EVENT_DEFINITION_REFS = THROW_EVENT__EVENT_DEFINITION_REFS; + + /** + * The number of structural features of the 'Intermediate Throw Event' class. + * + * + * @generated + * @ordered + */ + int INTERMEDIATE_THROW_EVENT_FEATURE_COUNT = THROW_EVENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ItemDefinitionImpl Item Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.ItemDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getItemDefinition() + * @generated + */ + int ITEM_DEFINITION = 87; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int ITEM_DEFINITION__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int ITEM_DEFINITION__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int ITEM_DEFINITION__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int ITEM_DEFINITION__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int ITEM_DEFINITION__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Is Collection' attribute. + * + * + * @generated + * @ordered + */ + int ITEM_DEFINITION__IS_COLLECTION = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Import' reference. + * + * + * @generated + * @ordered + */ + int ITEM_DEFINITION__IMPORT = ROOT_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Item Kind' attribute. + * + * + * @generated + * @ordered + */ + int ITEM_DEFINITION__ITEM_KIND = ROOT_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Structure Ref' attribute. + * + * + * @generated + * @ordered + */ + int ITEM_DEFINITION__STRUCTURE_REF = ROOT_ELEMENT_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Item Definition' class. + * + * + * @generated + * @ordered + */ + int ITEM_DEFINITION_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.LaneImpl Lane}' class. + * + * + * @see org.eclipse.bpmn2.impl.LaneImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getLane() + * @generated + */ + int LANE = 88; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int LANE__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int LANE__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int LANE__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int LANE__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int LANE__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Partition Element' containment reference. + * + * + * @generated + * @ordered + */ + int LANE__PARTITION_ELEMENT = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Flow Node Refs' reference list. + * + * + * @generated + * @ordered + */ + int LANE__FLOW_NODE_REFS = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Child Lane Set' containment reference. + * + * + * @generated + * @ordered + */ + int LANE__CHILD_LANE_SET = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int LANE__NAME = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Partition Element Ref' reference. + * + * + * @generated + * @ordered + */ + int LANE__PARTITION_ELEMENT_REF = BASE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The number of structural features of the 'Lane' class. + * + * + * @generated + * @ordered + */ + int LANE_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 5; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.LaneSetImpl Lane Set}' class. + * + * + * @see org.eclipse.bpmn2.impl.LaneSetImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getLaneSet() + * @generated + */ + int LANE_SET = 89; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int LANE_SET__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int LANE_SET__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int LANE_SET__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int LANE_SET__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int LANE_SET__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Lanes' containment reference list. + * + * + * @generated + * @ordered + */ + int LANE_SET__LANES = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int LANE_SET__NAME = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Lane Set' class. + * + * + * @generated + * @ordered + */ + int LANE_SET_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.LinkEventDefinitionImpl Link Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.LinkEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getLinkEventDefinition() + * @generated + */ + int LINK_EVENT_DEFINITION = 90; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int LINK_EVENT_DEFINITION__DOCUMENTATION = EVENT_DEFINITION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int LINK_EVENT_DEFINITION__EXTENSION_VALUES = EVENT_DEFINITION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int LINK_EVENT_DEFINITION__EXTENSION_DEFINITIONS = EVENT_DEFINITION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int LINK_EVENT_DEFINITION__ID = EVENT_DEFINITION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int LINK_EVENT_DEFINITION__ANY_ATTRIBUTE = EVENT_DEFINITION__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Source' reference list. + * + * + * @generated + * @ordered + */ + int LINK_EVENT_DEFINITION__SOURCE = EVENT_DEFINITION_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int LINK_EVENT_DEFINITION__TARGET = EVENT_DEFINITION_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int LINK_EVENT_DEFINITION__NAME = EVENT_DEFINITION_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Link Event Definition' class. + * + * + * @generated + * @ordered + */ + int LINK_EVENT_DEFINITION_FEATURE_COUNT = EVENT_DEFINITION_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.LoopCharacteristicsImpl Loop Characteristics}' class. + * + * + * @see org.eclipse.bpmn2.impl.LoopCharacteristicsImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getLoopCharacteristics() + * @generated + */ + int LOOP_CHARACTERISTICS = 91; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int LOOP_CHARACTERISTICS__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int LOOP_CHARACTERISTICS__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int LOOP_CHARACTERISTICS__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int LOOP_CHARACTERISTICS__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int LOOP_CHARACTERISTICS__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The number of structural features of the 'Loop Characteristics' class. + * + * + * @generated + * @ordered + */ + int LOOP_CHARACTERISTICS_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ManualTaskImpl Manual Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.ManualTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getManualTask() + * @generated + */ + int MANUAL_TASK = 92; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__DOCUMENTATION = TASK__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__EXTENSION_VALUES = TASK__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__EXTENSION_DEFINITIONS = TASK__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__ID = TASK__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__ANY_ATTRIBUTE = TASK__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__AUDITING = TASK__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__MONITORING = TASK__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__CATEGORY_VALUE_REF = TASK__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__NAME = TASK__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__INCOMING = TASK__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__LANES = TASK__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__OUTGOING = TASK__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__IO_SPECIFICATION = TASK__IO_SPECIFICATION; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__BOUNDARY_EVENT_REFS = TASK__BOUNDARY_EVENT_REFS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__PROPERTIES = TASK__PROPERTIES; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__DATA_INPUT_ASSOCIATIONS = TASK__DATA_INPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__DATA_OUTPUT_ASSOCIATIONS = TASK__DATA_OUTPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__RESOURCES = TASK__RESOURCES; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__LOOP_CHARACTERISTICS = TASK__LOOP_CHARACTERISTICS; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__COMPLETION_QUANTITY = TASK__COMPLETION_QUANTITY; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__DEFAULT = TASK__DEFAULT; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__IS_FOR_COMPENSATION = TASK__IS_FOR_COMPENSATION; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__START_QUANTITY = TASK__START_QUANTITY; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__INCOMING_CONVERSATION_LINKS = TASK__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK__OUTGOING_CONVERSATION_LINKS = TASK__OUTGOING_CONVERSATION_LINKS; + + /** + * The number of structural features of the 'Manual Task' class. + * + * + * @generated + * @ordered + */ + int MANUAL_TASK_FEATURE_COUNT = TASK_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.MessageImpl Message}' class. + * + * + * @see org.eclipse.bpmn2.impl.MessageImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMessage() + * @generated + */ + int MESSAGE = 93; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int MESSAGE__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int MESSAGE__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int MESSAGE__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int MESSAGE__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int MESSAGE__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Item Ref' reference. + * + * + * @generated + * @ordered + */ + int MESSAGE__ITEM_REF = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int MESSAGE__NAME = ROOT_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Message' class. + * + * + * @generated + * @ordered + */ + int MESSAGE_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.MessageEventDefinitionImpl Message Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.MessageEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMessageEventDefinition() + * @generated + */ + int MESSAGE_EVENT_DEFINITION = 94; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int MESSAGE_EVENT_DEFINITION__DOCUMENTATION = EVENT_DEFINITION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int MESSAGE_EVENT_DEFINITION__EXTENSION_VALUES = EVENT_DEFINITION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int MESSAGE_EVENT_DEFINITION__EXTENSION_DEFINITIONS = EVENT_DEFINITION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int MESSAGE_EVENT_DEFINITION__ID = EVENT_DEFINITION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int MESSAGE_EVENT_DEFINITION__ANY_ATTRIBUTE = EVENT_DEFINITION__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Operation Ref' reference. + * + * + * @generated + * @ordered + */ + int MESSAGE_EVENT_DEFINITION__OPERATION_REF = EVENT_DEFINITION_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Message Ref' reference. + * + * + * @generated + * @ordered + */ + int MESSAGE_EVENT_DEFINITION__MESSAGE_REF = EVENT_DEFINITION_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Message Event Definition' class. + * + * + * @generated + * @ordered + */ + int MESSAGE_EVENT_DEFINITION_FEATURE_COUNT = EVENT_DEFINITION_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.MessageFlowImpl Message Flow}' class. + * + * + * @see org.eclipse.bpmn2.impl.MessageFlowImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMessageFlow() + * @generated + */ + int MESSAGE_FLOW = 95; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Message Ref' reference. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW__MESSAGE_REF = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW__NAME = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Source Ref' reference. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW__SOURCE_REF = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Target Ref' reference. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW__TARGET_REF = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Message Flow' class. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.MessageFlowAssociationImpl Message Flow Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.MessageFlowAssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMessageFlowAssociation() + * @generated + */ + int MESSAGE_FLOW_ASSOCIATION = 96; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW_ASSOCIATION__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW_ASSOCIATION__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW_ASSOCIATION__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW_ASSOCIATION__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW_ASSOCIATION__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Inner Message Flow Ref' reference. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW_ASSOCIATION__INNER_MESSAGE_FLOW_REF = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Outer Message Flow Ref' reference. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW_ASSOCIATION__OUTER_MESSAGE_FLOW_REF = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Message Flow Association' class. + * + * + * @generated + * @ordered + */ + int MESSAGE_FLOW_ASSOCIATION_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.MonitoringImpl Monitoring}' class. + * + * + * @see org.eclipse.bpmn2.impl.MonitoringImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMonitoring() + * @generated + */ + int MONITORING = 97; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int MONITORING__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int MONITORING__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int MONITORING__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int MONITORING__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int MONITORING__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The number of structural features of the 'Monitoring' class. + * + * + * @generated + * @ordered + */ + int MONITORING_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl Multi Instance Loop Characteristics}' class. + * + * + * @see org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMultiInstanceLoopCharacteristics() + * @generated + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS = 98; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__DOCUMENTATION = LOOP_CHARACTERISTICS__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__EXTENSION_VALUES = LOOP_CHARACTERISTICS__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__EXTENSION_DEFINITIONS = LOOP_CHARACTERISTICS__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__ID = LOOP_CHARACTERISTICS__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__ANY_ATTRIBUTE = LOOP_CHARACTERISTICS__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Loop Cardinality' containment reference. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_CARDINALITY = LOOP_CHARACTERISTICS_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Loop Data Input Ref' reference. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_INPUT_REF = LOOP_CHARACTERISTICS_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Loop Data Output Ref' reference. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_OUTPUT_REF = LOOP_CHARACTERISTICS_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Input Data Item' containment reference. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__INPUT_DATA_ITEM = LOOP_CHARACTERISTICS_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Output Data Item' containment reference. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__OUTPUT_DATA_ITEM = LOOP_CHARACTERISTICS_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Complex Behavior Definition' containment reference list. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLEX_BEHAVIOR_DEFINITION = LOOP_CHARACTERISTICS_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Completion Condition' containment reference. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLETION_CONDITION = LOOP_CHARACTERISTICS_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Behavior' attribute. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__BEHAVIOR = LOOP_CHARACTERISTICS_FEATURE_COUNT + 7; + + /** + * The feature id for the 'Is Sequential' attribute. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__IS_SEQUENTIAL = LOOP_CHARACTERISTICS_FEATURE_COUNT + 8; + + /** + * The feature id for the 'None Behavior Event Ref' reference. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__NONE_BEHAVIOR_EVENT_REF = LOOP_CHARACTERISTICS_FEATURE_COUNT + 9; + + /** + * The feature id for the 'One Behavior Event Ref' reference. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS__ONE_BEHAVIOR_EVENT_REF = LOOP_CHARACTERISTICS_FEATURE_COUNT + 10; + + /** + * The number of structural features of the 'Multi Instance Loop Characteristics' class. + * + * + * @generated + * @ordered + */ + int MULTI_INSTANCE_LOOP_CHARACTERISTICS_FEATURE_COUNT = LOOP_CHARACTERISTICS_FEATURE_COUNT + 11; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.OperationImpl Operation}' class. + * + * + * @see org.eclipse.bpmn2.impl.OperationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getOperation() + * @generated + */ + int OPERATION = 99; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int OPERATION__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int OPERATION__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int OPERATION__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int OPERATION__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int OPERATION__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'In Message Ref' reference. + * + * + * @generated + * @ordered + */ + int OPERATION__IN_MESSAGE_REF = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Out Message Ref' reference. + * + * + * @generated + * @ordered + */ + int OPERATION__OUT_MESSAGE_REF = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Error Refs' reference list. + * + * + * @generated + * @ordered + */ + int OPERATION__ERROR_REFS = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int OPERATION__NAME = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Implementation Ref' attribute. + * + * + * @generated + * @ordered + */ + int OPERATION__IMPLEMENTATION_REF = BASE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The number of structural features of the 'Operation' class. + * + * + * @generated + * @ordered + */ + int OPERATION_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 5; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.OutputSetImpl Output Set}' class. + * + * + * @see org.eclipse.bpmn2.impl.OutputSetImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getOutputSet() + * @generated + */ + int OUTPUT_SET = 100; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int OUTPUT_SET__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int OUTPUT_SET__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int OUTPUT_SET__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int OUTPUT_SET__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int OUTPUT_SET__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Data Output Refs' reference list. + * + * + * @generated + * @ordered + */ + int OUTPUT_SET__DATA_OUTPUT_REFS = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Optional Output Refs' reference list. + * + * + * @generated + * @ordered + */ + int OUTPUT_SET__OPTIONAL_OUTPUT_REFS = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'While Executing Output Refs' reference list. + * + * + * @generated + * @ordered + */ + int OUTPUT_SET__WHILE_EXECUTING_OUTPUT_REFS = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Input Set Refs' reference list. + * + * + * @generated + * @ordered + */ + int OUTPUT_SET__INPUT_SET_REFS = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int OUTPUT_SET__NAME = BASE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The number of structural features of the 'Output Set' class. + * + * + * @generated + * @ordered + */ + int OUTPUT_SET_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 5; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ParallelGatewayImpl Parallel Gateway}' class. + * + * + * @see org.eclipse.bpmn2.impl.ParallelGatewayImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getParallelGateway() + * @generated + */ + int PARALLEL_GATEWAY = 101; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY__DOCUMENTATION = GATEWAY__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY__EXTENSION_VALUES = GATEWAY__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY__EXTENSION_DEFINITIONS = GATEWAY__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY__ID = GATEWAY__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY__ANY_ATTRIBUTE = GATEWAY__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY__AUDITING = GATEWAY__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY__MONITORING = GATEWAY__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY__CATEGORY_VALUE_REF = GATEWAY__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY__NAME = GATEWAY__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY__INCOMING = GATEWAY__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY__LANES = GATEWAY__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY__OUTGOING = GATEWAY__OUTGOING; + + /** + * The feature id for the 'Gateway Direction' attribute. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY__GATEWAY_DIRECTION = GATEWAY__GATEWAY_DIRECTION; + + /** + * The number of structural features of the 'Parallel Gateway' class. + * + * + * @generated + * @ordered + */ + int PARALLEL_GATEWAY_FEATURE_COUNT = GATEWAY_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ParticipantImpl Participant}' class. + * + * + * @see org.eclipse.bpmn2.impl.ParticipantImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getParticipant() + * @generated + */ + int PARTICIPANT = 102; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int PARTICIPANT__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT__INCOMING_CONVERSATION_LINKS = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT__OUTGOING_CONVERSATION_LINKS = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Interface Refs' reference list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT__INTERFACE_REFS = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'End Point Refs' reference list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT__END_POINT_REFS = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Participant Multiplicity' containment reference. + * + * + * @generated + * @ordered + */ + int PARTICIPANT__PARTICIPANT_MULTIPLICITY = BASE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PARTICIPANT__NAME = BASE_ELEMENT_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Process Ref' reference. + * + * + * @generated + * @ordered + */ + int PARTICIPANT__PROCESS_REF = BASE_ELEMENT_FEATURE_COUNT + 6; + + /** + * The number of structural features of the 'Participant' class. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 7; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ParticipantAssociationImpl Participant Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.ParticipantAssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getParticipantAssociation() + * @generated + */ + int PARTICIPANT_ASSOCIATION = 103; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_ASSOCIATION__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_ASSOCIATION__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_ASSOCIATION__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_ASSOCIATION__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_ASSOCIATION__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Inner Participant Ref' reference. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Outer Participant Ref' reference. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Participant Association' class. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_ASSOCIATION_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ParticipantMultiplicityImpl Participant Multiplicity}' class. + * + * + * @see org.eclipse.bpmn2.impl.ParticipantMultiplicityImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getParticipantMultiplicity() + * @generated + */ + int PARTICIPANT_MULTIPLICITY = 104; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_MULTIPLICITY__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_MULTIPLICITY__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_MULTIPLICITY__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_MULTIPLICITY__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_MULTIPLICITY__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Maximum' attribute. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_MULTIPLICITY__MAXIMUM = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Minimum' attribute. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_MULTIPLICITY__MINIMUM = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Participant Multiplicity' class. + * + * + * @generated + * @ordered + */ + int PARTICIPANT_MULTIPLICITY_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.PartnerEntityImpl Partner Entity}' class. + * + * + * @see org.eclipse.bpmn2.impl.PartnerEntityImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getPartnerEntity() + * @generated + */ + int PARTNER_ENTITY = 105; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int PARTNER_ENTITY__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int PARTNER_ENTITY__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int PARTNER_ENTITY__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int PARTNER_ENTITY__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int PARTNER_ENTITY__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Participant Ref' reference list. + * + * + * @generated + * @ordered + */ + int PARTNER_ENTITY__PARTICIPANT_REF = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PARTNER_ENTITY__NAME = ROOT_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Partner Entity' class. + * + * + * @generated + * @ordered + */ + int PARTNER_ENTITY_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.PartnerRoleImpl Partner Role}' class. + * + * + * @see org.eclipse.bpmn2.impl.PartnerRoleImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getPartnerRole() + * @generated + */ + int PARTNER_ROLE = 106; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int PARTNER_ROLE__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int PARTNER_ROLE__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int PARTNER_ROLE__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int PARTNER_ROLE__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int PARTNER_ROLE__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Participant Ref' reference list. + * + * + * @generated + * @ordered + */ + int PARTNER_ROLE__PARTICIPANT_REF = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PARTNER_ROLE__NAME = ROOT_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Partner Role' class. + * + * + * @generated + * @ordered + */ + int PARTNER_ROLE_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.PotentialOwnerImpl Potential Owner}' class. + * + * + * @see org.eclipse.bpmn2.impl.PotentialOwnerImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getPotentialOwner() + * @generated + */ + int POTENTIAL_OWNER = 108; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int POTENTIAL_OWNER__DOCUMENTATION = HUMAN_PERFORMER__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int POTENTIAL_OWNER__EXTENSION_VALUES = HUMAN_PERFORMER__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int POTENTIAL_OWNER__EXTENSION_DEFINITIONS = HUMAN_PERFORMER__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int POTENTIAL_OWNER__ID = HUMAN_PERFORMER__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int POTENTIAL_OWNER__ANY_ATTRIBUTE = HUMAN_PERFORMER__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Resource Ref' reference. + * + * + * @generated + * @ordered + */ + int POTENTIAL_OWNER__RESOURCE_REF = HUMAN_PERFORMER__RESOURCE_REF; + + /** + * The feature id for the 'Resource Parameter Bindings' containment reference list. + * + * + * @generated + * @ordered + */ + int POTENTIAL_OWNER__RESOURCE_PARAMETER_BINDINGS = HUMAN_PERFORMER__RESOURCE_PARAMETER_BINDINGS; + + /** + * The feature id for the 'Resource Assignment Expression' containment reference. + * + * + * @generated + * @ordered + */ + int POTENTIAL_OWNER__RESOURCE_ASSIGNMENT_EXPRESSION = HUMAN_PERFORMER__RESOURCE_ASSIGNMENT_EXPRESSION; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int POTENTIAL_OWNER__NAME = HUMAN_PERFORMER__NAME; + + /** + * The number of structural features of the 'Potential Owner' class. + * + * + * @generated + * @ordered + */ + int POTENTIAL_OWNER_FEATURE_COUNT = HUMAN_PERFORMER_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ProcessImpl Process}' class. + * + * + * @see org.eclipse.bpmn2.impl.ProcessImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getProcess() + * @generated + */ + int PROCESS = 109; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int PROCESS__DOCUMENTATION = CALLABLE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int PROCESS__EXTENSION_VALUES = CALLABLE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int PROCESS__EXTENSION_DEFINITIONS = CALLABLE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int PROCESS__ID = CALLABLE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int PROCESS__ANY_ATTRIBUTE = CALLABLE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Supported Interface Refs' reference list. + * + * + * @generated + * @ordered + */ + int PROCESS__SUPPORTED_INTERFACE_REFS = CALLABLE_ELEMENT__SUPPORTED_INTERFACE_REFS; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int PROCESS__IO_SPECIFICATION = CALLABLE_ELEMENT__IO_SPECIFICATION; + + /** + * The feature id for the 'Io Binding' containment reference list. + * + * + * @generated + * @ordered + */ + int PROCESS__IO_BINDING = CALLABLE_ELEMENT__IO_BINDING; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PROCESS__NAME = CALLABLE_ELEMENT__NAME; + + /** + * The feature id for the 'Lane Sets' containment reference list. + * + * + * @generated + * @ordered + */ + int PROCESS__LANE_SETS = CALLABLE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Flow Elements' containment reference list. + * + * + * @generated + * @ordered + */ + int PROCESS__FLOW_ELEMENTS = CALLABLE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int PROCESS__AUDITING = CALLABLE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int PROCESS__MONITORING = CALLABLE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int PROCESS__PROPERTIES = CALLABLE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Artifacts' containment reference list. + * + * + * @generated + * @ordered + */ + int PROCESS__ARTIFACTS = CALLABLE_ELEMENT_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int PROCESS__RESOURCES = CALLABLE_ELEMENT_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Correlation Subscriptions' containment reference list. + * + * + * @generated + * @ordered + */ + int PROCESS__CORRELATION_SUBSCRIPTIONS = CALLABLE_ELEMENT_FEATURE_COUNT + 7; + + /** + * The feature id for the 'Supports' reference list. + * + * + * @generated + * @ordered + */ + int PROCESS__SUPPORTS = CALLABLE_ELEMENT_FEATURE_COUNT + 8; + + /** + * The feature id for the 'Definitional Collaboration Ref' reference. + * + * + * @generated + * @ordered + */ + int PROCESS__DEFINITIONAL_COLLABORATION_REF = CALLABLE_ELEMENT_FEATURE_COUNT + 9; + + /** + * The feature id for the 'Is Closed' attribute. + * + * + * @generated + * @ordered + */ + int PROCESS__IS_CLOSED = CALLABLE_ELEMENT_FEATURE_COUNT + 10; + + /** + * The feature id for the 'Is Executable' attribute. + * + * + * @generated + * @ordered + */ + int PROCESS__IS_EXECUTABLE = CALLABLE_ELEMENT_FEATURE_COUNT + 11; + + /** + * The feature id for the 'Process Type' attribute. + * + * + * @generated + * @ordered + */ + int PROCESS__PROCESS_TYPE = CALLABLE_ELEMENT_FEATURE_COUNT + 12; + + /** + * The number of structural features of the 'Process' class. + * + * + * @generated + * @ordered + */ + int PROCESS_FEATURE_COUNT = CALLABLE_ELEMENT_FEATURE_COUNT + 13; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.PropertyImpl Property}' class. + * + * + * @see org.eclipse.bpmn2.impl.PropertyImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getProperty() + * @generated + */ + int PROPERTY = 110; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int PROPERTY__DOCUMENTATION = ITEM_AWARE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int PROPERTY__EXTENSION_VALUES = ITEM_AWARE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int PROPERTY__EXTENSION_DEFINITIONS = ITEM_AWARE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int PROPERTY__ID = ITEM_AWARE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int PROPERTY__ANY_ATTRIBUTE = ITEM_AWARE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Data State' containment reference. + * + * + * @generated + * @ordered + */ + int PROPERTY__DATA_STATE = ITEM_AWARE_ELEMENT__DATA_STATE; + + /** + * The feature id for the 'Item Subject Ref' reference. + * + * + * @generated + * @ordered + */ + int PROPERTY__ITEM_SUBJECT_REF = ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PROPERTY__NAME = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Property' class. + * + * + * @generated + * @ordered + */ + int PROPERTY_FEATURE_COUNT = ITEM_AWARE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ReceiveTaskImpl Receive Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.ReceiveTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getReceiveTask() + * @generated + */ + int RECEIVE_TASK = 111; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__DOCUMENTATION = TASK__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__EXTENSION_VALUES = TASK__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__EXTENSION_DEFINITIONS = TASK__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__ID = TASK__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__ANY_ATTRIBUTE = TASK__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__AUDITING = TASK__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__MONITORING = TASK__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__CATEGORY_VALUE_REF = TASK__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__NAME = TASK__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__INCOMING = TASK__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__LANES = TASK__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__OUTGOING = TASK__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__IO_SPECIFICATION = TASK__IO_SPECIFICATION; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__BOUNDARY_EVENT_REFS = TASK__BOUNDARY_EVENT_REFS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__PROPERTIES = TASK__PROPERTIES; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__DATA_INPUT_ASSOCIATIONS = TASK__DATA_INPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__DATA_OUTPUT_ASSOCIATIONS = TASK__DATA_OUTPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__RESOURCES = TASK__RESOURCES; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__LOOP_CHARACTERISTICS = TASK__LOOP_CHARACTERISTICS; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__COMPLETION_QUANTITY = TASK__COMPLETION_QUANTITY; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__DEFAULT = TASK__DEFAULT; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__IS_FOR_COMPENSATION = TASK__IS_FOR_COMPENSATION; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__START_QUANTITY = TASK__START_QUANTITY; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__INCOMING_CONVERSATION_LINKS = TASK__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__OUTGOING_CONVERSATION_LINKS = TASK__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Implementation' attribute. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__IMPLEMENTATION = TASK_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Instantiate' attribute. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__INSTANTIATE = TASK_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Message Ref' reference. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__MESSAGE_REF = TASK_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Operation Ref' reference. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK__OPERATION_REF = TASK_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Receive Task' class. + * + * + * @generated + * @ordered + */ + int RECEIVE_TASK_FEATURE_COUNT = TASK_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.RelationshipImpl Relationship}' class. + * + * + * @see org.eclipse.bpmn2.impl.RelationshipImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getRelationship() + * @generated + */ + int RELATIONSHIP = 112; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int RELATIONSHIP__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int RELATIONSHIP__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int RELATIONSHIP__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int RELATIONSHIP__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int RELATIONSHIP__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Sources' reference list. + * + * + * @generated + * @ordered + */ + int RELATIONSHIP__SOURCES = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Targets' reference list. + * + * + * @generated + * @ordered + */ + int RELATIONSHIP__TARGETS = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Direction' attribute. + * + * + * @generated + * @ordered + */ + int RELATIONSHIP__DIRECTION = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Type' attribute. + * + * + * @generated + * @ordered + */ + int RELATIONSHIP__TYPE = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Relationship' class. + * + * + * @generated + * @ordered + */ + int RELATIONSHIP_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.RenderingImpl Rendering}' class. + * + * + * @see org.eclipse.bpmn2.impl.RenderingImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getRendering() + * @generated + */ + int RENDERING = 113; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int RENDERING__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int RENDERING__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int RENDERING__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int RENDERING__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int RENDERING__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The number of structural features of the 'Rendering' class. + * + * + * @generated + * @ordered + */ + int RENDERING_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ResourceImpl Resource}' class. + * + * + * @see org.eclipse.bpmn2.impl.ResourceImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getResource() + * @generated + */ + int RESOURCE = 114; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int RESOURCE__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Resource Parameters' containment reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE__RESOURCE_PARAMETERS = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE__NAME = ROOT_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Resource' class. + * + * + * @generated + * @ordered + */ + int RESOURCE_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ResourceAssignmentExpressionImpl Resource Assignment Expression}' class. + * + * + * @see org.eclipse.bpmn2.impl.ResourceAssignmentExpressionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getResourceAssignmentExpression() + * @generated + */ + int RESOURCE_ASSIGNMENT_EXPRESSION = 115; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_ASSIGNMENT_EXPRESSION__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_ASSIGNMENT_EXPRESSION__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_ASSIGNMENT_EXPRESSION__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE_ASSIGNMENT_EXPRESSION__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int RESOURCE_ASSIGNMENT_EXPRESSION__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Expression' containment reference. + * + * + * @generated + * @ordered + */ + int RESOURCE_ASSIGNMENT_EXPRESSION__EXPRESSION = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Resource Assignment Expression' class. + * + * + * @generated + * @ordered + */ + int RESOURCE_ASSIGNMENT_EXPRESSION_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ResourceParameterImpl Resource Parameter}' class. + * + * + * @see org.eclipse.bpmn2.impl.ResourceParameterImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getResourceParameter() + * @generated + */ + int RESOURCE_PARAMETER = 116; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Is Required' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER__IS_REQUIRED = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER__NAME = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Type' reference. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER__TYPE = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Resource Parameter' class. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ResourceParameterBindingImpl Resource Parameter Binding}' class. + * + * + * @see org.eclipse.bpmn2.impl.ResourceParameterBindingImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getResourceParameterBinding() + * @generated + */ + int RESOURCE_PARAMETER_BINDING = 117; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER_BINDING__DOCUMENTATION = BASE_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER_BINDING__EXTENSION_VALUES = BASE_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER_BINDING__EXTENSION_DEFINITIONS = BASE_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER_BINDING__ID = BASE_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER_BINDING__ANY_ATTRIBUTE = BASE_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Expression' containment reference. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER_BINDING__EXPRESSION = BASE_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Parameter Ref' reference. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER_BINDING__PARAMETER_REF = BASE_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Resource Parameter Binding' class. + * + * + * @generated + * @ordered + */ + int RESOURCE_PARAMETER_BINDING_FEATURE_COUNT = BASE_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ScriptTaskImpl Script Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.ScriptTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getScriptTask() + * @generated + */ + int SCRIPT_TASK = 120; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__DOCUMENTATION = TASK__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__EXTENSION_VALUES = TASK__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__EXTENSION_DEFINITIONS = TASK__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__ID = TASK__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__ANY_ATTRIBUTE = TASK__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__AUDITING = TASK__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__MONITORING = TASK__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__CATEGORY_VALUE_REF = TASK__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__NAME = TASK__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__INCOMING = TASK__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__LANES = TASK__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__OUTGOING = TASK__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__IO_SPECIFICATION = TASK__IO_SPECIFICATION; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__BOUNDARY_EVENT_REFS = TASK__BOUNDARY_EVENT_REFS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__PROPERTIES = TASK__PROPERTIES; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__DATA_INPUT_ASSOCIATIONS = TASK__DATA_INPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__DATA_OUTPUT_ASSOCIATIONS = TASK__DATA_OUTPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__RESOURCES = TASK__RESOURCES; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__LOOP_CHARACTERISTICS = TASK__LOOP_CHARACTERISTICS; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__COMPLETION_QUANTITY = TASK__COMPLETION_QUANTITY; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__DEFAULT = TASK__DEFAULT; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__IS_FOR_COMPENSATION = TASK__IS_FOR_COMPENSATION; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__START_QUANTITY = TASK__START_QUANTITY; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__INCOMING_CONVERSATION_LINKS = TASK__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__OUTGOING_CONVERSATION_LINKS = TASK__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Script' attribute. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__SCRIPT = TASK_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Script Format' attribute. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK__SCRIPT_FORMAT = TASK_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Script Task' class. + * + * + * @generated + * @ordered + */ + int SCRIPT_TASK_FEATURE_COUNT = TASK_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.SendTaskImpl Send Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.SendTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSendTask() + * @generated + */ + int SEND_TASK = 121; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__DOCUMENTATION = TASK__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__EXTENSION_VALUES = TASK__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__EXTENSION_DEFINITIONS = TASK__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int SEND_TASK__ID = TASK__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__ANY_ATTRIBUTE = TASK__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int SEND_TASK__AUDITING = TASK__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int SEND_TASK__MONITORING = TASK__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__CATEGORY_VALUE_REF = TASK__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SEND_TASK__NAME = TASK__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__INCOMING = TASK__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__LANES = TASK__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__OUTGOING = TASK__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int SEND_TASK__IO_SPECIFICATION = TASK__IO_SPECIFICATION; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__BOUNDARY_EVENT_REFS = TASK__BOUNDARY_EVENT_REFS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__PROPERTIES = TASK__PROPERTIES; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__DATA_INPUT_ASSOCIATIONS = TASK__DATA_INPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__DATA_OUTPUT_ASSOCIATIONS = TASK__DATA_OUTPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__RESOURCES = TASK__RESOURCES; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int SEND_TASK__LOOP_CHARACTERISTICS = TASK__LOOP_CHARACTERISTICS; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int SEND_TASK__COMPLETION_QUANTITY = TASK__COMPLETION_QUANTITY; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int SEND_TASK__DEFAULT = TASK__DEFAULT; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int SEND_TASK__IS_FOR_COMPENSATION = TASK__IS_FOR_COMPENSATION; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int SEND_TASK__START_QUANTITY = TASK__START_QUANTITY; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__INCOMING_CONVERSATION_LINKS = TASK__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int SEND_TASK__OUTGOING_CONVERSATION_LINKS = TASK__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Implementation' attribute. + * + * + * @generated + * @ordered + */ + int SEND_TASK__IMPLEMENTATION = TASK_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Message Ref' reference. + * + * + * @generated + * @ordered + */ + int SEND_TASK__MESSAGE_REF = TASK_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Operation Ref' reference. + * + * + * @generated + * @ordered + */ + int SEND_TASK__OPERATION_REF = TASK_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Send Task' class. + * + * + * @generated + * @ordered + */ + int SEND_TASK_FEATURE_COUNT = TASK_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.SequenceFlowImpl Sequence Flow}' class. + * + * + * @see org.eclipse.bpmn2.impl.SequenceFlowImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSequenceFlow() + * @generated + */ + int SEQUENCE_FLOW = 122; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW__DOCUMENTATION = FLOW_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW__EXTENSION_VALUES = FLOW_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW__EXTENSION_DEFINITIONS = FLOW_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW__ID = FLOW_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW__ANY_ATTRIBUTE = FLOW_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW__AUDITING = FLOW_ELEMENT__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW__MONITORING = FLOW_ELEMENT__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW__CATEGORY_VALUE_REF = FLOW_ELEMENT__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW__NAME = FLOW_ELEMENT__NAME; + + /** + * The feature id for the 'Condition Expression' containment reference. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW__CONDITION_EXPRESSION = FLOW_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Is Immediate' attribute. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW__IS_IMMEDIATE = FLOW_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Source Ref' reference. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW__SOURCE_REF = FLOW_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Target Ref' reference. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW__TARGET_REF = FLOW_ELEMENT_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Sequence Flow' class. + * + * + * @generated + * @ordered + */ + int SEQUENCE_FLOW_FEATURE_COUNT = FLOW_ELEMENT_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.ServiceTaskImpl Service Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.ServiceTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getServiceTask() + * @generated + */ + int SERVICE_TASK = 123; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__DOCUMENTATION = TASK__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__EXTENSION_VALUES = TASK__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__EXTENSION_DEFINITIONS = TASK__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__ID = TASK__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__ANY_ATTRIBUTE = TASK__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__AUDITING = TASK__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__MONITORING = TASK__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__CATEGORY_VALUE_REF = TASK__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__NAME = TASK__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__INCOMING = TASK__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__LANES = TASK__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__OUTGOING = TASK__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__IO_SPECIFICATION = TASK__IO_SPECIFICATION; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__BOUNDARY_EVENT_REFS = TASK__BOUNDARY_EVENT_REFS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__PROPERTIES = TASK__PROPERTIES; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__DATA_INPUT_ASSOCIATIONS = TASK__DATA_INPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__DATA_OUTPUT_ASSOCIATIONS = TASK__DATA_OUTPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__RESOURCES = TASK__RESOURCES; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__LOOP_CHARACTERISTICS = TASK__LOOP_CHARACTERISTICS; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__COMPLETION_QUANTITY = TASK__COMPLETION_QUANTITY; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__DEFAULT = TASK__DEFAULT; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__IS_FOR_COMPENSATION = TASK__IS_FOR_COMPENSATION; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__START_QUANTITY = TASK__START_QUANTITY; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__INCOMING_CONVERSATION_LINKS = TASK__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__OUTGOING_CONVERSATION_LINKS = TASK__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Implementation' attribute. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__IMPLEMENTATION = TASK_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Operation Ref' reference. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK__OPERATION_REF = TASK_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Service Task' class. + * + * + * @generated + * @ordered + */ + int SERVICE_TASK_FEATURE_COUNT = TASK_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.SignalImpl Signal}' class. + * + * + * @see org.eclipse.bpmn2.impl.SignalImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSignal() + * @generated + */ + int SIGNAL = 124; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int SIGNAL__DOCUMENTATION = ROOT_ELEMENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int SIGNAL__EXTENSION_VALUES = ROOT_ELEMENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int SIGNAL__EXTENSION_DEFINITIONS = ROOT_ELEMENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int SIGNAL__ID = ROOT_ELEMENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int SIGNAL__ANY_ATTRIBUTE = ROOT_ELEMENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SIGNAL__NAME = ROOT_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Structure Ref' reference. + * + * + * @generated + * @ordered + */ + int SIGNAL__STRUCTURE_REF = ROOT_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Signal' class. + * + * + * @generated + * @ordered + */ + int SIGNAL_FEATURE_COUNT = ROOT_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.SignalEventDefinitionImpl Signal Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.SignalEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSignalEventDefinition() + * @generated + */ + int SIGNAL_EVENT_DEFINITION = 125; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int SIGNAL_EVENT_DEFINITION__DOCUMENTATION = EVENT_DEFINITION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int SIGNAL_EVENT_DEFINITION__EXTENSION_VALUES = EVENT_DEFINITION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int SIGNAL_EVENT_DEFINITION__EXTENSION_DEFINITIONS = EVENT_DEFINITION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int SIGNAL_EVENT_DEFINITION__ID = EVENT_DEFINITION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int SIGNAL_EVENT_DEFINITION__ANY_ATTRIBUTE = EVENT_DEFINITION__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Signal Ref' attribute. + * + * + * @generated + * @ordered + */ + int SIGNAL_EVENT_DEFINITION__SIGNAL_REF = EVENT_DEFINITION_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Signal Event Definition' class. + * + * + * @generated + * @ordered + */ + int SIGNAL_EVENT_DEFINITION_FEATURE_COUNT = EVENT_DEFINITION_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.StandardLoopCharacteristicsImpl Standard Loop Characteristics}' class. + * + * + * @see org.eclipse.bpmn2.impl.StandardLoopCharacteristicsImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getStandardLoopCharacteristics() + * @generated + */ + int STANDARD_LOOP_CHARACTERISTICS = 126; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int STANDARD_LOOP_CHARACTERISTICS__DOCUMENTATION = LOOP_CHARACTERISTICS__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int STANDARD_LOOP_CHARACTERISTICS__EXTENSION_VALUES = LOOP_CHARACTERISTICS__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int STANDARD_LOOP_CHARACTERISTICS__EXTENSION_DEFINITIONS = LOOP_CHARACTERISTICS__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int STANDARD_LOOP_CHARACTERISTICS__ID = LOOP_CHARACTERISTICS__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int STANDARD_LOOP_CHARACTERISTICS__ANY_ATTRIBUTE = LOOP_CHARACTERISTICS__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Loop Condition' containment reference. + * + * + * @generated + * @ordered + */ + int STANDARD_LOOP_CHARACTERISTICS__LOOP_CONDITION = LOOP_CHARACTERISTICS_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Loop Maximum' containment reference. + * + * + * @generated + * @ordered + */ + int STANDARD_LOOP_CHARACTERISTICS__LOOP_MAXIMUM = LOOP_CHARACTERISTICS_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Test Before' attribute. + * + * + * @generated + * @ordered + */ + int STANDARD_LOOP_CHARACTERISTICS__TEST_BEFORE = LOOP_CHARACTERISTICS_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Standard Loop Characteristics' class. + * + * + * @generated + * @ordered + */ + int STANDARD_LOOP_CHARACTERISTICS_FEATURE_COUNT = LOOP_CHARACTERISTICS_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.StartEventImpl Start Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.StartEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getStartEvent() + * @generated + */ + int START_EVENT = 127; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__DOCUMENTATION = CATCH_EVENT__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__EXTENSION_VALUES = CATCH_EVENT__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__EXTENSION_DEFINITIONS = CATCH_EVENT__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int START_EVENT__ID = CATCH_EVENT__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int START_EVENT__ANY_ATTRIBUTE = CATCH_EVENT__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int START_EVENT__AUDITING = CATCH_EVENT__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int START_EVENT__MONITORING = CATCH_EVENT__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__CATEGORY_VALUE_REF = CATCH_EVENT__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int START_EVENT__NAME = CATCH_EVENT__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__INCOMING = CATCH_EVENT__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__LANES = CATCH_EVENT__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__OUTGOING = CATCH_EVENT__OUTGOING; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__INCOMING_CONVERSATION_LINKS = CATCH_EVENT__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__OUTGOING_CONVERSATION_LINKS = CATCH_EVENT__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__PROPERTIES = CATCH_EVENT__PROPERTIES; + + /** + * The feature id for the 'Data Outputs' containment reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__DATA_OUTPUTS = CATCH_EVENT__DATA_OUTPUTS; + + /** + * The feature id for the 'Data Output Association' containment reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__DATA_OUTPUT_ASSOCIATION = CATCH_EVENT__DATA_OUTPUT_ASSOCIATION; + + /** + * The feature id for the 'Output Set' containment reference. + * + * + * @generated + * @ordered + */ + int START_EVENT__OUTPUT_SET = CATCH_EVENT__OUTPUT_SET; + + /** + * The feature id for the 'Event Definitions' containment reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__EVENT_DEFINITIONS = CATCH_EVENT__EVENT_DEFINITIONS; + + /** + * The feature id for the 'Event Definition Refs' reference list. + * + * + * @generated + * @ordered + */ + int START_EVENT__EVENT_DEFINITION_REFS = CATCH_EVENT__EVENT_DEFINITION_REFS; + + /** + * The feature id for the 'Parallel Multiple' attribute. + * + * + * @generated + * @ordered + */ + int START_EVENT__PARALLEL_MULTIPLE = CATCH_EVENT__PARALLEL_MULTIPLE; + + /** + * The feature id for the 'Is Interrupting' attribute. + * + * + * @generated + * @ordered + */ + int START_EVENT__IS_INTERRUPTING = CATCH_EVENT_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Start Event' class. + * + * + * @generated + * @ordered + */ + int START_EVENT_FEATURE_COUNT = CATCH_EVENT_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.SubChoreographyImpl Sub Choreography}' class. + * + * + * @see org.eclipse.bpmn2.impl.SubChoreographyImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSubChoreography() + * @generated + */ + int SUB_CHOREOGRAPHY = 128; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__DOCUMENTATION = CHOREOGRAPHY_ACTIVITY__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__EXTENSION_VALUES = CHOREOGRAPHY_ACTIVITY__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__EXTENSION_DEFINITIONS = CHOREOGRAPHY_ACTIVITY__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__ID = CHOREOGRAPHY_ACTIVITY__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__ANY_ATTRIBUTE = CHOREOGRAPHY_ACTIVITY__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__AUDITING = CHOREOGRAPHY_ACTIVITY__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__MONITORING = CHOREOGRAPHY_ACTIVITY__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__CATEGORY_VALUE_REF = CHOREOGRAPHY_ACTIVITY__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__NAME = CHOREOGRAPHY_ACTIVITY__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__INCOMING = CHOREOGRAPHY_ACTIVITY__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__LANES = CHOREOGRAPHY_ACTIVITY__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__OUTGOING = CHOREOGRAPHY_ACTIVITY__OUTGOING; + + /** + * The feature id for the 'Participant Refs' reference list. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__PARTICIPANT_REFS = CHOREOGRAPHY_ACTIVITY__PARTICIPANT_REFS; + + /** + * The feature id for the 'Correlation Keys' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__CORRELATION_KEYS = CHOREOGRAPHY_ACTIVITY__CORRELATION_KEYS; + + /** + * The feature id for the 'Initiating Participant Ref' reference. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__INITIATING_PARTICIPANT_REF = CHOREOGRAPHY_ACTIVITY__INITIATING_PARTICIPANT_REF; + + /** + * The feature id for the 'Loop Type' attribute. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__LOOP_TYPE = CHOREOGRAPHY_ACTIVITY__LOOP_TYPE; + + /** + * The feature id for the 'Lane Sets' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__LANE_SETS = CHOREOGRAPHY_ACTIVITY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Flow Elements' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__FLOW_ELEMENTS = CHOREOGRAPHY_ACTIVITY_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Artifacts' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY__ARTIFACTS = CHOREOGRAPHY_ACTIVITY_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Sub Choreography' class. + * + * + * @generated + * @ordered + */ + int SUB_CHOREOGRAPHY_FEATURE_COUNT = CHOREOGRAPHY_ACTIVITY_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.SubConversationImpl Sub Conversation}' class. + * + * + * @see org.eclipse.bpmn2.impl.SubConversationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSubConversation() + * @generated + */ + int SUB_CONVERSATION = 129; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_CONVERSATION__DOCUMENTATION = CONVERSATION_NODE__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_CONVERSATION__EXTENSION_VALUES = CONVERSATION_NODE__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int SUB_CONVERSATION__EXTENSION_DEFINITIONS = CONVERSATION_NODE__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int SUB_CONVERSATION__ID = CONVERSATION_NODE__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int SUB_CONVERSATION__ANY_ATTRIBUTE = CONVERSATION_NODE__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int SUB_CONVERSATION__INCOMING_CONVERSATION_LINKS = CONVERSATION_NODE__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int SUB_CONVERSATION__OUTGOING_CONVERSATION_LINKS = CONVERSATION_NODE__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Participant Refs' reference list. + * + * + * @generated + * @ordered + */ + int SUB_CONVERSATION__PARTICIPANT_REFS = CONVERSATION_NODE__PARTICIPANT_REFS; + + /** + * The feature id for the 'Message Flow Refs' reference list. + * + * + * @generated + * @ordered + */ + int SUB_CONVERSATION__MESSAGE_FLOW_REFS = CONVERSATION_NODE__MESSAGE_FLOW_REFS; + + /** + * The feature id for the 'Correlation Keys' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_CONVERSATION__CORRELATION_KEYS = CONVERSATION_NODE__CORRELATION_KEYS; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SUB_CONVERSATION__NAME = CONVERSATION_NODE__NAME; + + /** + * The feature id for the 'Conversation Nodes' containment reference list. + * + * + * @generated + * @ordered + */ + int SUB_CONVERSATION__CONVERSATION_NODES = CONVERSATION_NODE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Sub Conversation' class. + * + * + * @generated + * @ordered + */ + int SUB_CONVERSATION_FEATURE_COUNT = CONVERSATION_NODE_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.TerminateEventDefinitionImpl Terminate Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.TerminateEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getTerminateEventDefinition() + * @generated + */ + int TERMINATE_EVENT_DEFINITION = 132; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int TERMINATE_EVENT_DEFINITION__DOCUMENTATION = EVENT_DEFINITION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int TERMINATE_EVENT_DEFINITION__EXTENSION_VALUES = EVENT_DEFINITION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int TERMINATE_EVENT_DEFINITION__EXTENSION_DEFINITIONS = EVENT_DEFINITION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int TERMINATE_EVENT_DEFINITION__ID = EVENT_DEFINITION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int TERMINATE_EVENT_DEFINITION__ANY_ATTRIBUTE = EVENT_DEFINITION__ANY_ATTRIBUTE; + + /** + * The number of structural features of the 'Terminate Event Definition' class. + * + * + * @generated + * @ordered + */ + int TERMINATE_EVENT_DEFINITION_FEATURE_COUNT = EVENT_DEFINITION_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.TextAnnotationImpl Text Annotation}' class. + * + * + * @see org.eclipse.bpmn2.impl.TextAnnotationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getTextAnnotation() + * @generated + */ + int TEXT_ANNOTATION = 133; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__DOCUMENTATION = FLOW_NODE__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__EXTENSION_VALUES = FLOW_NODE__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__EXTENSION_DEFINITIONS = FLOW_NODE__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__ID = FLOW_NODE__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__ANY_ATTRIBUTE = FLOW_NODE__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__AUDITING = FLOW_NODE__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__MONITORING = FLOW_NODE__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__CATEGORY_VALUE_REF = FLOW_NODE__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__NAME = FLOW_NODE__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__INCOMING = FLOW_NODE__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__LANES = FLOW_NODE__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__OUTGOING = FLOW_NODE__OUTGOING; + + /** + * The feature id for the 'Text' attribute. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__TEXT = FLOW_NODE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Text Format' attribute. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION__TEXT_FORMAT = FLOW_NODE_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Text Annotation' class. + * + * + * @generated + * @ordered + */ + int TEXT_ANNOTATION_FEATURE_COUNT = FLOW_NODE_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.TimerEventDefinitionImpl Timer Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.TimerEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getTimerEventDefinition() + * @generated + */ + int TIMER_EVENT_DEFINITION = 135; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int TIMER_EVENT_DEFINITION__DOCUMENTATION = EVENT_DEFINITION__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int TIMER_EVENT_DEFINITION__EXTENSION_VALUES = EVENT_DEFINITION__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int TIMER_EVENT_DEFINITION__EXTENSION_DEFINITIONS = EVENT_DEFINITION__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int TIMER_EVENT_DEFINITION__ID = EVENT_DEFINITION__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int TIMER_EVENT_DEFINITION__ANY_ATTRIBUTE = EVENT_DEFINITION__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Time Date' containment reference. + * + * + * @generated + * @ordered + */ + int TIMER_EVENT_DEFINITION__TIME_DATE = EVENT_DEFINITION_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Time Duration' containment reference. + * + * + * @generated + * @ordered + */ + int TIMER_EVENT_DEFINITION__TIME_DURATION = EVENT_DEFINITION_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Time Cycle' containment reference. + * + * + * @generated + * @ordered + */ + int TIMER_EVENT_DEFINITION__TIME_CYCLE = EVENT_DEFINITION_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Timer Event Definition' class. + * + * + * @generated + * @ordered + */ + int TIMER_EVENT_DEFINITION_FEATURE_COUNT = EVENT_DEFINITION_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.TransactionImpl Transaction}' class. + * + * + * @see org.eclipse.bpmn2.impl.TransactionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getTransaction() + * @generated + */ + int TRANSACTION = 136; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__DOCUMENTATION = SUB_PROCESS__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__EXTENSION_VALUES = SUB_PROCESS__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__EXTENSION_DEFINITIONS = SUB_PROCESS__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int TRANSACTION__ID = SUB_PROCESS__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__ANY_ATTRIBUTE = SUB_PROCESS__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int TRANSACTION__AUDITING = SUB_PROCESS__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int TRANSACTION__MONITORING = SUB_PROCESS__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__CATEGORY_VALUE_REF = SUB_PROCESS__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int TRANSACTION__NAME = SUB_PROCESS__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__INCOMING = SUB_PROCESS__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__LANES = SUB_PROCESS__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__OUTGOING = SUB_PROCESS__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int TRANSACTION__IO_SPECIFICATION = SUB_PROCESS__IO_SPECIFICATION; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__BOUNDARY_EVENT_REFS = SUB_PROCESS__BOUNDARY_EVENT_REFS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__PROPERTIES = SUB_PROCESS__PROPERTIES; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__DATA_INPUT_ASSOCIATIONS = SUB_PROCESS__DATA_INPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__DATA_OUTPUT_ASSOCIATIONS = SUB_PROCESS__DATA_OUTPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__RESOURCES = SUB_PROCESS__RESOURCES; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int TRANSACTION__LOOP_CHARACTERISTICS = SUB_PROCESS__LOOP_CHARACTERISTICS; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int TRANSACTION__COMPLETION_QUANTITY = SUB_PROCESS__COMPLETION_QUANTITY; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int TRANSACTION__DEFAULT = SUB_PROCESS__DEFAULT; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int TRANSACTION__IS_FOR_COMPENSATION = SUB_PROCESS__IS_FOR_COMPENSATION; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int TRANSACTION__START_QUANTITY = SUB_PROCESS__START_QUANTITY; + + /** + * The feature id for the 'Lane Sets' containment reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__LANE_SETS = SUB_PROCESS__LANE_SETS; + + /** + * The feature id for the 'Flow Elements' containment reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__FLOW_ELEMENTS = SUB_PROCESS__FLOW_ELEMENTS; + + /** + * The feature id for the 'Artifacts' containment reference list. + * + * + * @generated + * @ordered + */ + int TRANSACTION__ARTIFACTS = SUB_PROCESS__ARTIFACTS; + + /** + * The feature id for the 'Triggered By Event' attribute. + * + * + * @generated + * @ordered + */ + int TRANSACTION__TRIGGERED_BY_EVENT = SUB_PROCESS__TRIGGERED_BY_EVENT; + + /** + * The feature id for the 'Protocol' attribute. + * + * + * @generated + * @ordered + */ + int TRANSACTION__PROTOCOL = SUB_PROCESS_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Method' attribute. + * + * + * @generated + * @ordered + */ + int TRANSACTION__METHOD = SUB_PROCESS_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Transaction' class. + * + * + * @generated + * @ordered + */ + int TRANSACTION_FEATURE_COUNT = SUB_PROCESS_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.UserTaskImpl User Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.UserTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getUserTask() + * @generated + */ + int USER_TASK = 137; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__DOCUMENTATION = TASK__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__EXTENSION_VALUES = TASK__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__EXTENSION_DEFINITIONS = TASK__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int USER_TASK__ID = TASK__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int USER_TASK__ANY_ATTRIBUTE = TASK__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int USER_TASK__AUDITING = TASK__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int USER_TASK__MONITORING = TASK__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__CATEGORY_VALUE_REF = TASK__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int USER_TASK__NAME = TASK__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__INCOMING = TASK__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__LANES = TASK__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__OUTGOING = TASK__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int USER_TASK__IO_SPECIFICATION = TASK__IO_SPECIFICATION; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__BOUNDARY_EVENT_REFS = TASK__BOUNDARY_EVENT_REFS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__PROPERTIES = TASK__PROPERTIES; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__DATA_INPUT_ASSOCIATIONS = TASK__DATA_INPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__DATA_OUTPUT_ASSOCIATIONS = TASK__DATA_OUTPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__RESOURCES = TASK__RESOURCES; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int USER_TASK__LOOP_CHARACTERISTICS = TASK__LOOP_CHARACTERISTICS; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int USER_TASK__COMPLETION_QUANTITY = TASK__COMPLETION_QUANTITY; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int USER_TASK__DEFAULT = TASK__DEFAULT; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int USER_TASK__IS_FOR_COMPENSATION = TASK__IS_FOR_COMPENSATION; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int USER_TASK__START_QUANTITY = TASK__START_QUANTITY; + + /** + * The feature id for the 'Incoming Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__INCOMING_CONVERSATION_LINKS = TASK__INCOMING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Outgoing Conversation Links' reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__OUTGOING_CONVERSATION_LINKS = TASK__OUTGOING_CONVERSATION_LINKS; + + /** + * The feature id for the 'Renderings' containment reference list. + * + * + * @generated + * @ordered + */ + int USER_TASK__RENDERINGS = TASK_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Implementation' attribute. + * + * + * @generated + * @ordered + */ + int USER_TASK__IMPLEMENTATION = TASK_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'User Task' class. + * + * + * @generated + * @ordered + */ + int USER_TASK_FEATURE_COUNT = TASK_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.impl.EventSubprocessImpl Event Subprocess}' class. + * + * + * @see org.eclipse.bpmn2.impl.EventSubprocessImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEventSubprocess() + * @generated + */ + int EVENT_SUBPROCESS = 138; + + /** + * The feature id for the 'Documentation' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__DOCUMENTATION = SUB_PROCESS__DOCUMENTATION; + + /** + * The feature id for the 'Extension Values' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__EXTENSION_VALUES = SUB_PROCESS__EXTENSION_VALUES; + + /** + * The feature id for the 'Extension Definitions' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__EXTENSION_DEFINITIONS = SUB_PROCESS__EXTENSION_DEFINITIONS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__ID = SUB_PROCESS__ID; + + /** + * The feature id for the 'Any Attribute' attribute list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__ANY_ATTRIBUTE = SUB_PROCESS__ANY_ATTRIBUTE; + + /** + * The feature id for the 'Auditing' containment reference. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__AUDITING = SUB_PROCESS__AUDITING; + + /** + * The feature id for the 'Monitoring' containment reference. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__MONITORING = SUB_PROCESS__MONITORING; + + /** + * The feature id for the 'Category Value Ref' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__CATEGORY_VALUE_REF = SUB_PROCESS__CATEGORY_VALUE_REF; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__NAME = SUB_PROCESS__NAME; + + /** + * The feature id for the 'Incoming' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__INCOMING = SUB_PROCESS__INCOMING; + + /** + * The feature id for the 'Lanes' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__LANES = SUB_PROCESS__LANES; + + /** + * The feature id for the 'Outgoing' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__OUTGOING = SUB_PROCESS__OUTGOING; + + /** + * The feature id for the 'Io Specification' containment reference. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__IO_SPECIFICATION = SUB_PROCESS__IO_SPECIFICATION; + + /** + * The feature id for the 'Boundary Event Refs' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__BOUNDARY_EVENT_REFS = SUB_PROCESS__BOUNDARY_EVENT_REFS; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__PROPERTIES = SUB_PROCESS__PROPERTIES; + + /** + * The feature id for the 'Data Input Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__DATA_INPUT_ASSOCIATIONS = SUB_PROCESS__DATA_INPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Data Output Associations' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__DATA_OUTPUT_ASSOCIATIONS = SUB_PROCESS__DATA_OUTPUT_ASSOCIATIONS; + + /** + * The feature id for the 'Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__RESOURCES = SUB_PROCESS__RESOURCES; + + /** + * The feature id for the 'Loop Characteristics' containment reference. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__LOOP_CHARACTERISTICS = SUB_PROCESS__LOOP_CHARACTERISTICS; + + /** + * The feature id for the 'Completion Quantity' attribute. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__COMPLETION_QUANTITY = SUB_PROCESS__COMPLETION_QUANTITY; + + /** + * The feature id for the 'Default' reference. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__DEFAULT = SUB_PROCESS__DEFAULT; + + /** + * The feature id for the 'Is For Compensation' attribute. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__IS_FOR_COMPENSATION = SUB_PROCESS__IS_FOR_COMPENSATION; + + /** + * The feature id for the 'Start Quantity' attribute. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__START_QUANTITY = SUB_PROCESS__START_QUANTITY; + + /** + * The feature id for the 'Lane Sets' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__LANE_SETS = SUB_PROCESS__LANE_SETS; + + /** + * The feature id for the 'Flow Elements' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__FLOW_ELEMENTS = SUB_PROCESS__FLOW_ELEMENTS; + + /** + * The feature id for the 'Artifacts' containment reference list. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__ARTIFACTS = SUB_PROCESS__ARTIFACTS; + + /** + * The feature id for the 'Triggered By Event' attribute. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS__TRIGGERED_BY_EVENT = SUB_PROCESS__TRIGGERED_BY_EVENT; + + /** + * The number of structural features of the 'Event Subprocess' class. + * + * + * @generated + * @ordered + */ + int EVENT_SUBPROCESS_FEATURE_COUNT = SUB_PROCESS_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.AdHocOrdering Ad Hoc Ordering}' enum. + * + * + * @see org.eclipse.bpmn2.AdHocOrdering + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getAdHocOrdering() + * @generated + */ + int AD_HOC_ORDERING = 139; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.AssociationDirection Association Direction}' enum. + * + * + * @see org.eclipse.bpmn2.AssociationDirection + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getAssociationDirection() + * @generated + */ + int ASSOCIATION_DIRECTION = 140; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.ChoreographyLoopType Choreography Loop Type}' enum. + * + * + * @see org.eclipse.bpmn2.ChoreographyLoopType + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getChoreographyLoopType() + * @generated + */ + int CHOREOGRAPHY_LOOP_TYPE = 141; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.EventBasedGatewayType Event Based Gateway Type}' enum. + * + * + * @see org.eclipse.bpmn2.EventBasedGatewayType + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEventBasedGatewayType() + * @generated + */ + int EVENT_BASED_GATEWAY_TYPE = 142; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.GatewayDirection Gateway Direction}' enum. + * + * + * @see org.eclipse.bpmn2.GatewayDirection + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGatewayDirection() + * @generated + */ + int GATEWAY_DIRECTION = 143; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.ItemKind Item Kind}' enum. + * + * + * @see org.eclipse.bpmn2.ItemKind + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getItemKind() + * @generated + */ + int ITEM_KIND = 144; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.MultiInstanceBehavior Multi Instance Behavior}' enum. + * + * + * @see org.eclipse.bpmn2.MultiInstanceBehavior + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMultiInstanceBehavior() + * @generated + */ + int MULTI_INSTANCE_BEHAVIOR = 145; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.ProcessType Process Type}' enum. + * + * + * @see org.eclipse.bpmn2.ProcessType + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getProcessType() + * @generated + */ + int PROCESS_TYPE = 146; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.RelationshipDirection Relationship Direction}' enum. + * + * + * @see org.eclipse.bpmn2.RelationshipDirection + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getRelationshipDirection() + * @generated + */ + int RELATIONSHIP_DIRECTION = 147; + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.DocumentRoot Document Root}'. + * + * + * @return the meta object for class 'Document Root'. + * @see org.eclipse.bpmn2.DocumentRoot + * @generated + */ + EClass getDocumentRoot(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.bpmn2.DocumentRoot#getMixed Mixed}'. + * + * + * @return the meta object for the attribute list 'Mixed'. + * @see org.eclipse.bpmn2.DocumentRoot#getMixed() + * @see #getDocumentRoot() + * @generated + */ + EAttribute getDocumentRoot_Mixed(); + + /** + * Returns the meta object for the map '{@link org.eclipse.bpmn2.DocumentRoot#getXMLNSPrefixMap XMLNS Prefix Map}'. + * + * + * @return the meta object for the map 'XMLNS Prefix Map'. + * @see org.eclipse.bpmn2.DocumentRoot#getXMLNSPrefixMap() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_XMLNSPrefixMap(); + + /** + * Returns the meta object for the map '{@link org.eclipse.bpmn2.DocumentRoot#getXSISchemaLocation XSI Schema Location}'. + * + * + * @return the meta object for the map 'XSI Schema Location'. + * @see org.eclipse.bpmn2.DocumentRoot#getXSISchemaLocation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_XSISchemaLocation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getActivity Activity}'. + * + * + * @return the meta object for the containment reference 'Activity'. + * @see org.eclipse.bpmn2.DocumentRoot#getActivity() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Activity(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getAdHocSubProcess Ad Hoc Sub Process}'. + * + * + * @return the meta object for the containment reference 'Ad Hoc Sub Process'. + * @see org.eclipse.bpmn2.DocumentRoot#getAdHocSubProcess() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_AdHocSubProcess(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getFlowElement Flow Element}'. + * + * + * @return the meta object for the containment reference 'Flow Element'. + * @see org.eclipse.bpmn2.DocumentRoot#getFlowElement() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_FlowElement(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getArtifact Artifact}'. + * + * + * @return the meta object for the containment reference 'Artifact'. + * @see org.eclipse.bpmn2.DocumentRoot#getArtifact() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Artifact(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getAssignment Assignment}'. + * + * + * @return the meta object for the containment reference 'Assignment'. + * @see org.eclipse.bpmn2.DocumentRoot#getAssignment() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Assignment(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getAssociation Association}'. + * + * + * @return the meta object for the containment reference 'Association'. + * @see org.eclipse.bpmn2.DocumentRoot#getAssociation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Association(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getAuditing Auditing}'. + * + * + * @return the meta object for the containment reference 'Auditing'. + * @see org.eclipse.bpmn2.DocumentRoot#getAuditing() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Auditing(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getBaseElement Base Element}'. + * + * + * @return the meta object for the containment reference 'Base Element'. + * @see org.eclipse.bpmn2.DocumentRoot#getBaseElement() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BaseElement(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getBaseElementWithMixedContent Base Element With Mixed Content}'. + * + * + * @return the meta object for the containment reference 'Base Element With Mixed Content'. + * @see org.eclipse.bpmn2.DocumentRoot#getBaseElementWithMixedContent() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BaseElementWithMixedContent(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getBoundaryEvent Boundary Event}'. + * + * + * @return the meta object for the containment reference 'Boundary Event'. + * @see org.eclipse.bpmn2.DocumentRoot#getBoundaryEvent() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BoundaryEvent(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getBusinessRuleTask Business Rule Task}'. + * + * + * @return the meta object for the containment reference 'Business Rule Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getBusinessRuleTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BusinessRuleTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCallableElement Callable Element}'. + * + * + * @return the meta object for the containment reference 'Callable Element'. + * @see org.eclipse.bpmn2.DocumentRoot#getCallableElement() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_CallableElement(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCallActivity Call Activity}'. + * + * + * @return the meta object for the containment reference 'Call Activity'. + * @see org.eclipse.bpmn2.DocumentRoot#getCallActivity() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_CallActivity(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCallChoreography Call Choreography}'. + * + * + * @return the meta object for the containment reference 'Call Choreography'. + * @see org.eclipse.bpmn2.DocumentRoot#getCallChoreography() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_CallChoreography(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCallConversation Call Conversation}'. + * + * + * @return the meta object for the containment reference 'Call Conversation'. + * @see org.eclipse.bpmn2.DocumentRoot#getCallConversation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_CallConversation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getConversationNode Conversation Node}'. + * + * + * @return the meta object for the containment reference 'Conversation Node'. + * @see org.eclipse.bpmn2.DocumentRoot#getConversationNode() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ConversationNode(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCancelEventDefinition Cancel Event Definition}'. + * + * + * @return the meta object for the containment reference 'Cancel Event Definition'. + * @see org.eclipse.bpmn2.DocumentRoot#getCancelEventDefinition() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_CancelEventDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getEventDefinition Event Definition}'. + * + * + * @return the meta object for the containment reference 'Event Definition'. + * @see org.eclipse.bpmn2.DocumentRoot#getEventDefinition() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_EventDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getRootElement Root Element}'. + * + * + * @return the meta object for the containment reference 'Root Element'. + * @see org.eclipse.bpmn2.DocumentRoot#getRootElement() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_RootElement(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCatchEvent Catch Event}'. + * + * + * @return the meta object for the containment reference 'Catch Event'. + * @see org.eclipse.bpmn2.DocumentRoot#getCatchEvent() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_CatchEvent(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCategory Category}'. + * + * + * @return the meta object for the containment reference 'Category'. + * @see org.eclipse.bpmn2.DocumentRoot#getCategory() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Category(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCategoryValue Category Value}'. + * + * + * @return the meta object for the containment reference 'Category Value'. + * @see org.eclipse.bpmn2.DocumentRoot#getCategoryValue() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_CategoryValue(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getChoreography Choreography}'. + * + * + * @return the meta object for the containment reference 'Choreography'. + * @see org.eclipse.bpmn2.DocumentRoot#getChoreography() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Choreography(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCollaboration Collaboration}'. + * + * + * @return the meta object for the containment reference 'Collaboration'. + * @see org.eclipse.bpmn2.DocumentRoot#getCollaboration() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Collaboration(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getChoreographyActivity Choreography Activity}'. + * + * + * @return the meta object for the containment reference 'Choreography Activity'. + * @see org.eclipse.bpmn2.DocumentRoot#getChoreographyActivity() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ChoreographyActivity(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getChoreographyTask Choreography Task}'. + * + * + * @return the meta object for the containment reference 'Choreography Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getChoreographyTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ChoreographyTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCompensateEventDefinition Compensate Event Definition}'. + * + * + * @return the meta object for the containment reference 'Compensate Event Definition'. + * @see org.eclipse.bpmn2.DocumentRoot#getCompensateEventDefinition() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_CompensateEventDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getComplexBehaviorDefinition Complex Behavior Definition}'. + * + * + * @return the meta object for the containment reference 'Complex Behavior Definition'. + * @see org.eclipse.bpmn2.DocumentRoot#getComplexBehaviorDefinition() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ComplexBehaviorDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getComplexGateway Complex Gateway}'. + * + * + * @return the meta object for the containment reference 'Complex Gateway'. + * @see org.eclipse.bpmn2.DocumentRoot#getComplexGateway() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ComplexGateway(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getConditionalEventDefinition Conditional Event Definition}'. + * + * + * @return the meta object for the containment reference 'Conditional Event Definition'. + * @see org.eclipse.bpmn2.DocumentRoot#getConditionalEventDefinition() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ConditionalEventDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getConversation Conversation}'. + * + * + * @return the meta object for the containment reference 'Conversation'. + * @see org.eclipse.bpmn2.DocumentRoot#getConversation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Conversation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getConversationAssociation Conversation Association}'. + * + * + * @return the meta object for the containment reference 'Conversation Association'. + * @see org.eclipse.bpmn2.DocumentRoot#getConversationAssociation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ConversationAssociation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getConversationLink Conversation Link}'. + * + * + * @return the meta object for the containment reference 'Conversation Link'. + * @see org.eclipse.bpmn2.DocumentRoot#getConversationLink() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ConversationLink(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCorrelationKey Correlation Key}'. + * + * + * @return the meta object for the containment reference 'Correlation Key'. + * @see org.eclipse.bpmn2.DocumentRoot#getCorrelationKey() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_CorrelationKey(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCorrelationProperty Correlation Property}'. + * + * + * @return the meta object for the containment reference 'Correlation Property'. + * @see org.eclipse.bpmn2.DocumentRoot#getCorrelationProperty() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_CorrelationProperty(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCorrelationPropertyBinding Correlation Property Binding}'. + * + * + * @return the meta object for the containment reference 'Correlation Property Binding'. + * @see org.eclipse.bpmn2.DocumentRoot#getCorrelationPropertyBinding() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_CorrelationPropertyBinding(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCorrelationPropertyRetrievalExpression Correlation Property Retrieval Expression}'. + * + * + * @return the meta object for the containment reference 'Correlation Property Retrieval Expression'. + * @see org.eclipse.bpmn2.DocumentRoot#getCorrelationPropertyRetrievalExpression() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_CorrelationPropertyRetrievalExpression(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCorrelationSubscription Correlation Subscription}'. + * + * + * @return the meta object for the containment reference 'Correlation Subscription'. + * @see org.eclipse.bpmn2.DocumentRoot#getCorrelationSubscription() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_CorrelationSubscription(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getDataAssociation Data Association}'. + * + * + * @return the meta object for the containment reference 'Data Association'. + * @see org.eclipse.bpmn2.DocumentRoot#getDataAssociation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_DataAssociation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getDataInput Data Input}'. + * + * + * @return the meta object for the containment reference 'Data Input'. + * @see org.eclipse.bpmn2.DocumentRoot#getDataInput() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_DataInput(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getDataInputAssociation Data Input Association}'. + * + * + * @return the meta object for the containment reference 'Data Input Association'. + * @see org.eclipse.bpmn2.DocumentRoot#getDataInputAssociation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_DataInputAssociation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getDataObject Data Object}'. + * + * + * @return the meta object for the containment reference 'Data Object'. + * @see org.eclipse.bpmn2.DocumentRoot#getDataObject() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_DataObject(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getDataObjectReference Data Object Reference}'. + * + * + * @return the meta object for the containment reference 'Data Object Reference'. + * @see org.eclipse.bpmn2.DocumentRoot#getDataObjectReference() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_DataObjectReference(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getDataOutput Data Output}'. + * + * + * @return the meta object for the containment reference 'Data Output'. + * @see org.eclipse.bpmn2.DocumentRoot#getDataOutput() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_DataOutput(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getDataOutputAssociation Data Output Association}'. + * + * + * @return the meta object for the containment reference 'Data Output Association'. + * @see org.eclipse.bpmn2.DocumentRoot#getDataOutputAssociation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_DataOutputAssociation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getDataState Data State}'. + * + * + * @return the meta object for the containment reference 'Data State'. + * @see org.eclipse.bpmn2.DocumentRoot#getDataState() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_DataState(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getDataStore Data Store}'. + * + * + * @return the meta object for the containment reference 'Data Store'. + * @see org.eclipse.bpmn2.DocumentRoot#getDataStore() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_DataStore(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getDataStoreReference Data Store Reference}'. + * + * + * @return the meta object for the containment reference 'Data Store Reference'. + * @see org.eclipse.bpmn2.DocumentRoot#getDataStoreReference() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_DataStoreReference(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getDefinitions Definitions}'. + * + * + * @return the meta object for the containment reference 'Definitions'. + * @see org.eclipse.bpmn2.DocumentRoot#getDefinitions() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Definitions(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getDocumentation Documentation}'. + * + * + * @return the meta object for the containment reference 'Documentation'. + * @see org.eclipse.bpmn2.DocumentRoot#getDocumentation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Documentation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getEndEvent End Event}'. + * + * + * @return the meta object for the containment reference 'End Event'. + * @see org.eclipse.bpmn2.DocumentRoot#getEndEvent() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_EndEvent(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getEndPoint End Point}'. + * + * + * @return the meta object for the containment reference 'End Point'. + * @see org.eclipse.bpmn2.DocumentRoot#getEndPoint() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_EndPoint(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getError Error}'. + * + * + * @return the meta object for the containment reference 'Error'. + * @see org.eclipse.bpmn2.DocumentRoot#getError() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Error(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getErrorEventDefinition Error Event Definition}'. + * + * + * @return the meta object for the containment reference 'Error Event Definition'. + * @see org.eclipse.bpmn2.DocumentRoot#getErrorEventDefinition() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ErrorEventDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getEscalation Escalation}'. + * + * + * @return the meta object for the containment reference 'Escalation'. + * @see org.eclipse.bpmn2.DocumentRoot#getEscalation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Escalation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getEscalationEventDefinition Escalation Event Definition}'. + * + * + * @return the meta object for the containment reference 'Escalation Event Definition'. + * @see org.eclipse.bpmn2.DocumentRoot#getEscalationEventDefinition() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_EscalationEventDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getEvent Event}'. + * + * + * @return the meta object for the containment reference 'Event'. + * @see org.eclipse.bpmn2.DocumentRoot#getEvent() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Event(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getEventBasedGateway Event Based Gateway}'. + * + * + * @return the meta object for the containment reference 'Event Based Gateway'. + * @see org.eclipse.bpmn2.DocumentRoot#getEventBasedGateway() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_EventBasedGateway(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getExclusiveGateway Exclusive Gateway}'. + * + * + * @return the meta object for the containment reference 'Exclusive Gateway'. + * @see org.eclipse.bpmn2.DocumentRoot#getExclusiveGateway() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ExclusiveGateway(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getExpression Expression}'. + * + * + * @return the meta object for the containment reference 'Expression'. + * @see org.eclipse.bpmn2.DocumentRoot#getExpression() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Expression(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getExtension Extension}'. + * + * + * @return the meta object for the containment reference 'Extension'. + * @see org.eclipse.bpmn2.DocumentRoot#getExtension() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Extension(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getExtensionElements Extension Elements}'. + * + * + * @return the meta object for the containment reference 'Extension Elements'. + * @see org.eclipse.bpmn2.DocumentRoot#getExtensionElements() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ExtensionElements(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getFlowNode Flow Node}'. + * + * + * @return the meta object for the containment reference 'Flow Node'. + * @see org.eclipse.bpmn2.DocumentRoot#getFlowNode() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_FlowNode(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getFormalExpression Formal Expression}'. + * + * + * @return the meta object for the containment reference 'Formal Expression'. + * @see org.eclipse.bpmn2.DocumentRoot#getFormalExpression() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_FormalExpression(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getGateway Gateway}'. + * + * + * @return the meta object for the containment reference 'Gateway'. + * @see org.eclipse.bpmn2.DocumentRoot#getGateway() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Gateway(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalBusinessRuleTask Global Business Rule Task}'. + * + * + * @return the meta object for the containment reference 'Global Business Rule Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getGlobalBusinessRuleTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_GlobalBusinessRuleTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalChoreographyTask Global Choreography Task}'. + * + * + * @return the meta object for the containment reference 'Global Choreography Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getGlobalChoreographyTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_GlobalChoreographyTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalConversation Global Conversation}'. + * + * + * @return the meta object for the containment reference 'Global Conversation'. + * @see org.eclipse.bpmn2.DocumentRoot#getGlobalConversation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_GlobalConversation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalManualTask Global Manual Task}'. + * + * + * @return the meta object for the containment reference 'Global Manual Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getGlobalManualTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_GlobalManualTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalScriptTask Global Script Task}'. + * + * + * @return the meta object for the containment reference 'Global Script Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getGlobalScriptTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_GlobalScriptTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalTask Global Task}'. + * + * + * @return the meta object for the containment reference 'Global Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getGlobalTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_GlobalTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalUserTask Global User Task}'. + * + * + * @return the meta object for the containment reference 'Global User Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getGlobalUserTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_GlobalUserTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getGroup Group}'. + * + * + * @return the meta object for the containment reference 'Group'. + * @see org.eclipse.bpmn2.DocumentRoot#getGroup() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Group(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getHumanPerformer Human Performer}'. + * + * + * @return the meta object for the containment reference 'Human Performer'. + * @see org.eclipse.bpmn2.DocumentRoot#getHumanPerformer() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_HumanPerformer(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getPerformer Performer}'. + * + * + * @return the meta object for the containment reference 'Performer'. + * @see org.eclipse.bpmn2.DocumentRoot#getPerformer() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Performer(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getResourceRole Resource Role}'. + * + * + * @return the meta object for the containment reference 'Resource Role'. + * @see org.eclipse.bpmn2.DocumentRoot#getResourceRole() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ResourceRole(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getImplicitThrowEvent Implicit Throw Event}'. + * + * + * @return the meta object for the containment reference 'Implicit Throw Event'. + * @see org.eclipse.bpmn2.DocumentRoot#getImplicitThrowEvent() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ImplicitThrowEvent(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getImport Import}'. + * + * + * @return the meta object for the containment reference 'Import'. + * @see org.eclipse.bpmn2.DocumentRoot#getImport() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Import(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getInclusiveGateway Inclusive Gateway}'. + * + * + * @return the meta object for the containment reference 'Inclusive Gateway'. + * @see org.eclipse.bpmn2.DocumentRoot#getInclusiveGateway() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_InclusiveGateway(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getInputSet Input Set}'. + * + * + * @return the meta object for the containment reference 'Input Set'. + * @see org.eclipse.bpmn2.DocumentRoot#getInputSet() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_InputSet(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getInterface Interface}'. + * + * + * @return the meta object for the containment reference 'Interface'. + * @see org.eclipse.bpmn2.DocumentRoot#getInterface() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Interface(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getIntermediateCatchEvent Intermediate Catch Event}'. + * + * + * @return the meta object for the containment reference 'Intermediate Catch Event'. + * @see org.eclipse.bpmn2.DocumentRoot#getIntermediateCatchEvent() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_IntermediateCatchEvent(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getIntermediateThrowEvent Intermediate Throw Event}'. + * + * + * @return the meta object for the containment reference 'Intermediate Throw Event'. + * @see org.eclipse.bpmn2.DocumentRoot#getIntermediateThrowEvent() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_IntermediateThrowEvent(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getIoBinding Io Binding}'. + * + * + * @return the meta object for the containment reference 'Io Binding'. + * @see org.eclipse.bpmn2.DocumentRoot#getIoBinding() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_IoBinding(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getIoSpecification Io Specification}'. + * + * + * @return the meta object for the containment reference 'Io Specification'. + * @see org.eclipse.bpmn2.DocumentRoot#getIoSpecification() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_IoSpecification(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getItemDefinition Item Definition}'. + * + * + * @return the meta object for the containment reference 'Item Definition'. + * @see org.eclipse.bpmn2.DocumentRoot#getItemDefinition() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ItemDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getLane Lane}'. + * + * + * @return the meta object for the containment reference 'Lane'. + * @see org.eclipse.bpmn2.DocumentRoot#getLane() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Lane(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getLaneSet Lane Set}'. + * + * + * @return the meta object for the containment reference 'Lane Set'. + * @see org.eclipse.bpmn2.DocumentRoot#getLaneSet() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_LaneSet(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getLinkEventDefinition Link Event Definition}'. + * + * + * @return the meta object for the containment reference 'Link Event Definition'. + * @see org.eclipse.bpmn2.DocumentRoot#getLinkEventDefinition() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_LinkEventDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getLoopCharacteristics Loop Characteristics}'. + * + * + * @return the meta object for the containment reference 'Loop Characteristics'. + * @see org.eclipse.bpmn2.DocumentRoot#getLoopCharacteristics() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_LoopCharacteristics(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getManualTask Manual Task}'. + * + * + * @return the meta object for the containment reference 'Manual Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getManualTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ManualTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getMessage Message}'. + * + * + * @return the meta object for the containment reference 'Message'. + * @see org.eclipse.bpmn2.DocumentRoot#getMessage() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Message(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getMessageEventDefinition Message Event Definition}'. + * + * + * @return the meta object for the containment reference 'Message Event Definition'. + * @see org.eclipse.bpmn2.DocumentRoot#getMessageEventDefinition() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_MessageEventDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getMessageFlow Message Flow}'. + * + * + * @return the meta object for the containment reference 'Message Flow'. + * @see org.eclipse.bpmn2.DocumentRoot#getMessageFlow() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_MessageFlow(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getMessageFlowAssociation Message Flow Association}'. + * + * + * @return the meta object for the containment reference 'Message Flow Association'. + * @see org.eclipse.bpmn2.DocumentRoot#getMessageFlowAssociation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_MessageFlowAssociation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getMonitoring Monitoring}'. + * + * + * @return the meta object for the containment reference 'Monitoring'. + * @see org.eclipse.bpmn2.DocumentRoot#getMonitoring() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Monitoring(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getMultiInstanceLoopCharacteristics Multi Instance Loop Characteristics}'. + * + * + * @return the meta object for the containment reference 'Multi Instance Loop Characteristics'. + * @see org.eclipse.bpmn2.DocumentRoot#getMultiInstanceLoopCharacteristics() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_MultiInstanceLoopCharacteristics(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getOperation Operation}'. + * + * + * @return the meta object for the containment reference 'Operation'. + * @see org.eclipse.bpmn2.DocumentRoot#getOperation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Operation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getOutputSet Output Set}'. + * + * + * @return the meta object for the containment reference 'Output Set'. + * @see org.eclipse.bpmn2.DocumentRoot#getOutputSet() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_OutputSet(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getParallelGateway Parallel Gateway}'. + * + * + * @return the meta object for the containment reference 'Parallel Gateway'. + * @see org.eclipse.bpmn2.DocumentRoot#getParallelGateway() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ParallelGateway(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getParticipant Participant}'. + * + * + * @return the meta object for the containment reference 'Participant'. + * @see org.eclipse.bpmn2.DocumentRoot#getParticipant() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Participant(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getParticipantAssociation Participant Association}'. + * + * + * @return the meta object for the containment reference 'Participant Association'. + * @see org.eclipse.bpmn2.DocumentRoot#getParticipantAssociation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ParticipantAssociation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getParticipantMultiplicity Participant Multiplicity}'. + * + * + * @return the meta object for the containment reference 'Participant Multiplicity'. + * @see org.eclipse.bpmn2.DocumentRoot#getParticipantMultiplicity() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ParticipantMultiplicity(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getPartnerEntity Partner Entity}'. + * + * + * @return the meta object for the containment reference 'Partner Entity'. + * @see org.eclipse.bpmn2.DocumentRoot#getPartnerEntity() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_PartnerEntity(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getPartnerRole Partner Role}'. + * + * + * @return the meta object for the containment reference 'Partner Role'. + * @see org.eclipse.bpmn2.DocumentRoot#getPartnerRole() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_PartnerRole(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getPotentialOwner Potential Owner}'. + * + * + * @return the meta object for the containment reference 'Potential Owner'. + * @see org.eclipse.bpmn2.DocumentRoot#getPotentialOwner() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_PotentialOwner(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getProcess Process}'. + * + * + * @return the meta object for the containment reference 'Process'. + * @see org.eclipse.bpmn2.DocumentRoot#getProcess() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Process(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getProperty Property}'. + * + * + * @return the meta object for the containment reference 'Property'. + * @see org.eclipse.bpmn2.DocumentRoot#getProperty() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Property(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getReceiveTask Receive Task}'. + * + * + * @return the meta object for the containment reference 'Receive Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getReceiveTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ReceiveTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getRelationship Relationship}'. + * + * + * @return the meta object for the containment reference 'Relationship'. + * @see org.eclipse.bpmn2.DocumentRoot#getRelationship() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Relationship(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getRendering Rendering}'. + * + * + * @return the meta object for the containment reference 'Rendering'. + * @see org.eclipse.bpmn2.DocumentRoot#getRendering() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Rendering(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getResource Resource}'. + * + * + * @return the meta object for the containment reference 'Resource'. + * @see org.eclipse.bpmn2.DocumentRoot#getResource() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Resource(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getResourceAssignmentExpression Resource Assignment Expression}'. + * + * + * @return the meta object for the containment reference 'Resource Assignment Expression'. + * @see org.eclipse.bpmn2.DocumentRoot#getResourceAssignmentExpression() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ResourceAssignmentExpression(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getResourceParameter Resource Parameter}'. + * + * + * @return the meta object for the containment reference 'Resource Parameter'. + * @see org.eclipse.bpmn2.DocumentRoot#getResourceParameter() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ResourceParameter(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getResourceParameterBinding Resource Parameter Binding}'. + * + * + * @return the meta object for the containment reference 'Resource Parameter Binding'. + * @see org.eclipse.bpmn2.DocumentRoot#getResourceParameterBinding() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ResourceParameterBinding(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getScript Script}'. + * + * + * @return the meta object for the containment reference 'Script'. + * @see org.eclipse.bpmn2.DocumentRoot#getScript() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Script(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getScriptTask Script Task}'. + * + * + * @return the meta object for the containment reference 'Script Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getScriptTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ScriptTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getSendTask Send Task}'. + * + * + * @return the meta object for the containment reference 'Send Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getSendTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_SendTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getSequenceFlow Sequence Flow}'. + * + * + * @return the meta object for the containment reference 'Sequence Flow'. + * @see org.eclipse.bpmn2.DocumentRoot#getSequenceFlow() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_SequenceFlow(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getServiceTask Service Task}'. + * + * + * @return the meta object for the containment reference 'Service Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getServiceTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ServiceTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getSignal Signal}'. + * + * + * @return the meta object for the containment reference 'Signal'. + * @see org.eclipse.bpmn2.DocumentRoot#getSignal() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Signal(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getSignalEventDefinition Signal Event Definition}'. + * + * + * @return the meta object for the containment reference 'Signal Event Definition'. + * @see org.eclipse.bpmn2.DocumentRoot#getSignalEventDefinition() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_SignalEventDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getStandardLoopCharacteristics Standard Loop Characteristics}'. + * + * + * @return the meta object for the containment reference 'Standard Loop Characteristics'. + * @see org.eclipse.bpmn2.DocumentRoot#getStandardLoopCharacteristics() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_StandardLoopCharacteristics(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getStartEvent Start Event}'. + * + * + * @return the meta object for the containment reference 'Start Event'. + * @see org.eclipse.bpmn2.DocumentRoot#getStartEvent() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_StartEvent(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getSubChoreography Sub Choreography}'. + * + * + * @return the meta object for the containment reference 'Sub Choreography'. + * @see org.eclipse.bpmn2.DocumentRoot#getSubChoreography() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_SubChoreography(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getSubConversation Sub Conversation}'. + * + * + * @return the meta object for the containment reference 'Sub Conversation'. + * @see org.eclipse.bpmn2.DocumentRoot#getSubConversation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_SubConversation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getSubProcess Sub Process}'. + * + * + * @return the meta object for the containment reference 'Sub Process'. + * @see org.eclipse.bpmn2.DocumentRoot#getSubProcess() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_SubProcess(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getTask Task}'. + * + * + * @return the meta object for the containment reference 'Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Task(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getTerminateEventDefinition Terminate Event Definition}'. + * + * + * @return the meta object for the containment reference 'Terminate Event Definition'. + * @see org.eclipse.bpmn2.DocumentRoot#getTerminateEventDefinition() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_TerminateEventDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getText Text}'. + * + * + * @return the meta object for the containment reference 'Text'. + * @see org.eclipse.bpmn2.DocumentRoot#getText() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Text(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getTextAnnotation Text Annotation}'. + * + * + * @return the meta object for the containment reference 'Text Annotation'. + * @see org.eclipse.bpmn2.DocumentRoot#getTextAnnotation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_TextAnnotation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getThrowEvent Throw Event}'. + * + * + * @return the meta object for the containment reference 'Throw Event'. + * @see org.eclipse.bpmn2.DocumentRoot#getThrowEvent() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_ThrowEvent(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getTimerEventDefinition Timer Event Definition}'. + * + * + * @return the meta object for the containment reference 'Timer Event Definition'. + * @see org.eclipse.bpmn2.DocumentRoot#getTimerEventDefinition() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_TimerEventDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getTransaction Transaction}'. + * + * + * @return the meta object for the containment reference 'Transaction'. + * @see org.eclipse.bpmn2.DocumentRoot#getTransaction() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Transaction(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getUserTask User Task}'. + * + * + * @return the meta object for the containment reference 'User Task'. + * @see org.eclipse.bpmn2.DocumentRoot#getUserTask() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_UserTask(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getEventSubProcess Event Sub Process}'. + * + * + * @return the meta object for the containment reference 'Event Sub Process'. + * @see org.eclipse.bpmn2.DocumentRoot#getEventSubProcess() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_EventSubProcess(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Activity Activity}'. + * + * + * @return the meta object for class 'Activity'. + * @see org.eclipse.bpmn2.Activity + * @generated + */ + EClass getActivity(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.Activity#getIoSpecification Io Specification}'. + * + * + * @return the meta object for the containment reference 'Io Specification'. + * @see org.eclipse.bpmn2.Activity#getIoSpecification() + * @see #getActivity() + * @generated + */ + EReference getActivity_IoSpecification(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.Activity#getBoundaryEventRefs Boundary Event Refs}'. + * + * + * @return the meta object for the reference list 'Boundary Event Refs'. + * @see org.eclipse.bpmn2.Activity#getBoundaryEventRefs() + * @see #getActivity() + * @generated + */ + EReference getActivity_BoundaryEventRefs(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Activity#getProperties Properties}'. + * + * + * @return the meta object for the containment reference list 'Properties'. + * @see org.eclipse.bpmn2.Activity#getProperties() + * @see #getActivity() + * @generated + */ + EReference getActivity_Properties(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Activity#getDataInputAssociations Data Input Associations}'. + * + * + * @return the meta object for the containment reference list 'Data Input Associations'. + * @see org.eclipse.bpmn2.Activity#getDataInputAssociations() + * @see #getActivity() + * @generated + */ + EReference getActivity_DataInputAssociations(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Activity#getDataOutputAssociations Data Output Associations}'. + * + * + * @return the meta object for the containment reference list 'Data Output Associations'. + * @see org.eclipse.bpmn2.Activity#getDataOutputAssociations() + * @see #getActivity() + * @generated + */ + EReference getActivity_DataOutputAssociations(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Activity#getResources Resources}'. + * + * + * @return the meta object for the containment reference list 'Resources'. + * @see org.eclipse.bpmn2.Activity#getResources() + * @see #getActivity() + * @generated + */ + EReference getActivity_Resources(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.Activity#getLoopCharacteristics Loop Characteristics}'. + * + * + * @return the meta object for the containment reference 'Loop Characteristics'. + * @see org.eclipse.bpmn2.Activity#getLoopCharacteristics() + * @see #getActivity() + * @generated + */ + EReference getActivity_LoopCharacteristics(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Activity#getCompletionQuantity Completion Quantity}'. + * + * + * @return the meta object for the attribute 'Completion Quantity'. + * @see org.eclipse.bpmn2.Activity#getCompletionQuantity() + * @see #getActivity() + * @generated + */ + EAttribute getActivity_CompletionQuantity(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Activity#getDefault Default}'. + * + * + * @return the meta object for the reference 'Default'. + * @see org.eclipse.bpmn2.Activity#getDefault() + * @see #getActivity() + * @generated + */ + EReference getActivity_Default(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Activity#isIsForCompensation Is For Compensation}'. + * + * + * @return the meta object for the attribute 'Is For Compensation'. + * @see org.eclipse.bpmn2.Activity#isIsForCompensation() + * @see #getActivity() + * @generated + */ + EAttribute getActivity_IsForCompensation(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Activity#getStartQuantity Start Quantity}'. + * + * + * @return the meta object for the attribute 'Start Quantity'. + * @see org.eclipse.bpmn2.Activity#getStartQuantity() + * @see #getActivity() + * @generated + */ + EAttribute getActivity_StartQuantity(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.AdHocSubProcess Ad Hoc Sub Process}'. + * + * + * @return the meta object for class 'Ad Hoc Sub Process'. + * @see org.eclipse.bpmn2.AdHocSubProcess + * @generated + */ + EClass getAdHocSubProcess(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.AdHocSubProcess#getCompletionCondition Completion Condition}'. + * + * + * @return the meta object for the containment reference 'Completion Condition'. + * @see org.eclipse.bpmn2.AdHocSubProcess#getCompletionCondition() + * @see #getAdHocSubProcess() + * @generated + */ + EReference getAdHocSubProcess_CompletionCondition(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.AdHocSubProcess#isCancelRemainingInstances Cancel Remaining Instances}'. + * + * + * @return the meta object for the attribute 'Cancel Remaining Instances'. + * @see org.eclipse.bpmn2.AdHocSubProcess#isCancelRemainingInstances() + * @see #getAdHocSubProcess() + * @generated + */ + EAttribute getAdHocSubProcess_CancelRemainingInstances(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.AdHocSubProcess#getOrdering Ordering}'. + * + * + * @return the meta object for the attribute 'Ordering'. + * @see org.eclipse.bpmn2.AdHocSubProcess#getOrdering() + * @see #getAdHocSubProcess() + * @generated + */ + EAttribute getAdHocSubProcess_Ordering(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Artifact Artifact}'. + * + * + * @return the meta object for class 'Artifact'. + * @see org.eclipse.bpmn2.Artifact + * @generated + */ + EClass getArtifact(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Assignment Assignment}'. + * + * + * @return the meta object for class 'Assignment'. + * @see org.eclipse.bpmn2.Assignment + * @generated + */ + EClass getAssignment(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.Assignment#getFrom From}'. + * + * + * @return the meta object for the containment reference 'From'. + * @see org.eclipse.bpmn2.Assignment#getFrom() + * @see #getAssignment() + * @generated + */ + EReference getAssignment_From(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.Assignment#getTo To}'. + * + * + * @return the meta object for the containment reference 'To'. + * @see org.eclipse.bpmn2.Assignment#getTo() + * @see #getAssignment() + * @generated + */ + EReference getAssignment_To(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Association Association}'. + * + * + * @return the meta object for class 'Association'. + * @see org.eclipse.bpmn2.Association + * @generated + */ + EClass getAssociation(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Association#getAssociationDirection Association Direction}'. + * + * + * @return the meta object for the attribute 'Association Direction'. + * @see org.eclipse.bpmn2.Association#getAssociationDirection() + * @see #getAssociation() + * @generated + */ + EAttribute getAssociation_AssociationDirection(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Association#getSourceRef Source Ref}'. + * + * + * @return the meta object for the reference 'Source Ref'. + * @see org.eclipse.bpmn2.Association#getSourceRef() + * @see #getAssociation() + * @generated + */ + EReference getAssociation_SourceRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Association#getTargetRef Target Ref}'. + * + * + * @return the meta object for the reference 'Target Ref'. + * @see org.eclipse.bpmn2.Association#getTargetRef() + * @see #getAssociation() + * @generated + */ + EReference getAssociation_TargetRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Auditing Auditing}'. + * + * + * @return the meta object for class 'Auditing'. + * @see org.eclipse.bpmn2.Auditing + * @generated + */ + EClass getAuditing(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.BaseElement Base Element}'. + * + * + * @return the meta object for class 'Base Element'. + * @see org.eclipse.bpmn2.BaseElement + * @generated + */ + EClass getBaseElement(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.BaseElement#getDocumentation Documentation}'. + * + * + * @return the meta object for the containment reference list 'Documentation'. + * @see org.eclipse.bpmn2.BaseElement#getDocumentation() + * @see #getBaseElement() + * @generated + */ + EReference getBaseElement_Documentation(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.BaseElement#getExtensionValues Extension Values}'. + * + * + * @return the meta object for the containment reference list 'Extension Values'. + * @see org.eclipse.bpmn2.BaseElement#getExtensionValues() + * @see #getBaseElement() + * @generated + */ + EReference getBaseElement_ExtensionValues(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.BaseElement#getExtensionDefinitions Extension Definitions}'. + * + * + * @return the meta object for the reference list 'Extension Definitions'. + * @see org.eclipse.bpmn2.BaseElement#getExtensionDefinitions() + * @see #getBaseElement() + * @generated + */ + EReference getBaseElement_ExtensionDefinitions(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.BaseElement#getId Id}'. + * + * + * @return the meta object for the attribute 'Id'. + * @see org.eclipse.bpmn2.BaseElement#getId() + * @see #getBaseElement() + * @generated + */ + EAttribute getBaseElement_Id(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.bpmn2.BaseElement#getAnyAttribute Any Attribute}'. + * + * + * @return the meta object for the attribute list 'Any Attribute'. + * @see org.eclipse.bpmn2.BaseElement#getAnyAttribute() + * @see #getBaseElement() + * @generated + */ + EAttribute getBaseElement_AnyAttribute(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.BoundaryEvent Boundary Event}'. + * + * + * @return the meta object for class 'Boundary Event'. + * @see org.eclipse.bpmn2.BoundaryEvent + * @generated + */ + EClass getBoundaryEvent(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.BoundaryEvent#getAttachedToRef Attached To Ref}'. + * + * + * @return the meta object for the reference 'Attached To Ref'. + * @see org.eclipse.bpmn2.BoundaryEvent#getAttachedToRef() + * @see #getBoundaryEvent() + * @generated + */ + EReference getBoundaryEvent_AttachedToRef(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.BoundaryEvent#isCancelActivity Cancel Activity}'. + * + * + * @return the meta object for the attribute 'Cancel Activity'. + * @see org.eclipse.bpmn2.BoundaryEvent#isCancelActivity() + * @see #getBoundaryEvent() + * @generated + */ + EAttribute getBoundaryEvent_CancelActivity(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.BusinessRuleTask Business Rule Task}'. + * + * + * @return the meta object for class 'Business Rule Task'. + * @see org.eclipse.bpmn2.BusinessRuleTask + * @generated + */ + EClass getBusinessRuleTask(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.BusinessRuleTask#getImplementation Implementation}'. + * + * + * @return the meta object for the attribute 'Implementation'. + * @see org.eclipse.bpmn2.BusinessRuleTask#getImplementation() + * @see #getBusinessRuleTask() + * @generated + */ + EAttribute getBusinessRuleTask_Implementation(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.CallActivity Call Activity}'. + * + * + * @return the meta object for class 'Call Activity'. + * @see org.eclipse.bpmn2.CallActivity + * @generated + */ + EClass getCallActivity(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.CallActivity#getCalledElement Called Element}'. + * + * + * @return the meta object for the attribute 'Called Element'. + * @see org.eclipse.bpmn2.CallActivity#getCalledElement() + * @see #getCallActivity() + * @generated + */ + EAttribute getCallActivity_CalledElement(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.CallChoreography Call Choreography}'. + * + * + * @return the meta object for class 'Call Choreography'. + * @see org.eclipse.bpmn2.CallChoreography + * @generated + */ + EClass getCallChoreography(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.CallChoreography#getParticipantAssociations Participant Associations}'. + * + * + * @return the meta object for the containment reference list 'Participant Associations'. + * @see org.eclipse.bpmn2.CallChoreography#getParticipantAssociations() + * @see #getCallChoreography() + * @generated + */ + EReference getCallChoreography_ParticipantAssociations(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.CallChoreography#getCalledChoreographyRef Called Choreography Ref}'. + * + * + * @return the meta object for the reference 'Called Choreography Ref'. + * @see org.eclipse.bpmn2.CallChoreography#getCalledChoreographyRef() + * @see #getCallChoreography() + * @generated + */ + EReference getCallChoreography_CalledChoreographyRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.CallConversation Call Conversation}'. + * + * + * @return the meta object for class 'Call Conversation'. + * @see org.eclipse.bpmn2.CallConversation + * @generated + */ + EClass getCallConversation(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.CallConversation#getParticipantAssociations Participant Associations}'. + * + * + * @return the meta object for the containment reference list 'Participant Associations'. + * @see org.eclipse.bpmn2.CallConversation#getParticipantAssociations() + * @see #getCallConversation() + * @generated + */ + EReference getCallConversation_ParticipantAssociations(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.CallConversation#getCalledCollaborationRef Called Collaboration Ref}'. + * + * + * @return the meta object for the reference 'Called Collaboration Ref'. + * @see org.eclipse.bpmn2.CallConversation#getCalledCollaborationRef() + * @see #getCallConversation() + * @generated + */ + EReference getCallConversation_CalledCollaborationRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.CallableElement Callable Element}'. + * + * + * @return the meta object for class 'Callable Element'. + * @see org.eclipse.bpmn2.CallableElement + * @generated + */ + EClass getCallableElement(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.CallableElement#getSupportedInterfaceRefs Supported Interface Refs}'. + * + * + * @return the meta object for the reference list 'Supported Interface Refs'. + * @see org.eclipse.bpmn2.CallableElement#getSupportedInterfaceRefs() + * @see #getCallableElement() + * @generated + */ + EReference getCallableElement_SupportedInterfaceRefs(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.CallableElement#getIoSpecification Io Specification}'. + * + * + * @return the meta object for the containment reference 'Io Specification'. + * @see org.eclipse.bpmn2.CallableElement#getIoSpecification() + * @see #getCallableElement() + * @generated + */ + EReference getCallableElement_IoSpecification(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.CallableElement#getIoBinding Io Binding}'. + * + * + * @return the meta object for the containment reference list 'Io Binding'. + * @see org.eclipse.bpmn2.CallableElement#getIoBinding() + * @see #getCallableElement() + * @generated + */ + EReference getCallableElement_IoBinding(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.CallableElement#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.CallableElement#getName() + * @see #getCallableElement() + * @generated + */ + EAttribute getCallableElement_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.CancelEventDefinition Cancel Event Definition}'. + * + * + * @return the meta object for class 'Cancel Event Definition'. + * @see org.eclipse.bpmn2.CancelEventDefinition + * @generated + */ + EClass getCancelEventDefinition(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.CatchEvent Catch Event}'. + * + * + * @return the meta object for class 'Catch Event'. + * @see org.eclipse.bpmn2.CatchEvent + * @generated + */ + EClass getCatchEvent(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.CatchEvent#getDataOutputs Data Outputs}'. + * + * + * @return the meta object for the containment reference list 'Data Outputs'. + * @see org.eclipse.bpmn2.CatchEvent#getDataOutputs() + * @see #getCatchEvent() + * @generated + */ + EReference getCatchEvent_DataOutputs(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.CatchEvent#getDataOutputAssociation Data Output Association}'. + * + * + * @return the meta object for the containment reference list 'Data Output Association'. + * @see org.eclipse.bpmn2.CatchEvent#getDataOutputAssociation() + * @see #getCatchEvent() + * @generated + */ + EReference getCatchEvent_DataOutputAssociation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.CatchEvent#getOutputSet Output Set}'. + * + * + * @return the meta object for the containment reference 'Output Set'. + * @see org.eclipse.bpmn2.CatchEvent#getOutputSet() + * @see #getCatchEvent() + * @generated + */ + EReference getCatchEvent_OutputSet(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.CatchEvent#getEventDefinitions Event Definitions}'. + * + * + * @return the meta object for the containment reference list 'Event Definitions'. + * @see org.eclipse.bpmn2.CatchEvent#getEventDefinitions() + * @see #getCatchEvent() + * @generated + */ + EReference getCatchEvent_EventDefinitions(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.CatchEvent#getEventDefinitionRefs Event Definition Refs}'. + * + * + * @return the meta object for the reference list 'Event Definition Refs'. + * @see org.eclipse.bpmn2.CatchEvent#getEventDefinitionRefs() + * @see #getCatchEvent() + * @generated + */ + EReference getCatchEvent_EventDefinitionRefs(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.CatchEvent#isParallelMultiple Parallel Multiple}'. + * + * + * @return the meta object for the attribute 'Parallel Multiple'. + * @see org.eclipse.bpmn2.CatchEvent#isParallelMultiple() + * @see #getCatchEvent() + * @generated + */ + EAttribute getCatchEvent_ParallelMultiple(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Category Category}'. + * + * + * @return the meta object for class 'Category'. + * @see org.eclipse.bpmn2.Category + * @generated + */ + EClass getCategory(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Category#getCategoryValue Category Value}'. + * + * + * @return the meta object for the containment reference list 'Category Value'. + * @see org.eclipse.bpmn2.Category#getCategoryValue() + * @see #getCategory() + * @generated + */ + EReference getCategory_CategoryValue(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Category#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.Category#getName() + * @see #getCategory() + * @generated + */ + EAttribute getCategory_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.CategoryValue Category Value}'. + * + * + * @return the meta object for class 'Category Value'. + * @see org.eclipse.bpmn2.CategoryValue + * @generated + */ + EClass getCategoryValue(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.CategoryValue#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see org.eclipse.bpmn2.CategoryValue#getValue() + * @see #getCategoryValue() + * @generated + */ + EAttribute getCategoryValue_Value(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.CategoryValue#getCategorizedFlowElements Categorized Flow Elements}'. + * + * + * @return the meta object for the reference list 'Categorized Flow Elements'. + * @see org.eclipse.bpmn2.CategoryValue#getCategorizedFlowElements() + * @see #getCategoryValue() + * @generated + */ + EReference getCategoryValue_CategorizedFlowElements(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Choreography Choreography}'. + * + * + * @return the meta object for class 'Choreography'. + * @see org.eclipse.bpmn2.Choreography + * @generated + */ + EClass getChoreography(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ChoreographyActivity Choreography Activity}'. + * + * + * @return the meta object for class 'Choreography Activity'. + * @see org.eclipse.bpmn2.ChoreographyActivity + * @generated + */ + EClass getChoreographyActivity(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.ChoreographyActivity#getParticipantRefs Participant Refs}'. + * + * + * @return the meta object for the reference list 'Participant Refs'. + * @see org.eclipse.bpmn2.ChoreographyActivity#getParticipantRefs() + * @see #getChoreographyActivity() + * @generated + */ + EReference getChoreographyActivity_ParticipantRefs(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.ChoreographyActivity#getCorrelationKeys Correlation Keys}'. + * + * + * @return the meta object for the containment reference list 'Correlation Keys'. + * @see org.eclipse.bpmn2.ChoreographyActivity#getCorrelationKeys() + * @see #getChoreographyActivity() + * @generated + */ + EReference getChoreographyActivity_CorrelationKeys(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ChoreographyActivity#getInitiatingParticipantRef Initiating Participant Ref}'. + * + * + * @return the meta object for the reference 'Initiating Participant Ref'. + * @see org.eclipse.bpmn2.ChoreographyActivity#getInitiatingParticipantRef() + * @see #getChoreographyActivity() + * @generated + */ + EReference getChoreographyActivity_InitiatingParticipantRef(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ChoreographyActivity#getLoopType Loop Type}'. + * + * + * @return the meta object for the attribute 'Loop Type'. + * @see org.eclipse.bpmn2.ChoreographyActivity#getLoopType() + * @see #getChoreographyActivity() + * @generated + */ + EAttribute getChoreographyActivity_LoopType(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ChoreographyTask Choreography Task}'. + * + * + * @return the meta object for class 'Choreography Task'. + * @see org.eclipse.bpmn2.ChoreographyTask + * @generated + */ + EClass getChoreographyTask(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.ChoreographyTask#getMessageFlowRef Message Flow Ref}'. + * + * + * @return the meta object for the reference list 'Message Flow Ref'. + * @see org.eclipse.bpmn2.ChoreographyTask#getMessageFlowRef() + * @see #getChoreographyTask() + * @generated + */ + EReference getChoreographyTask_MessageFlowRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Collaboration Collaboration}'. + * + * + * @return the meta object for class 'Collaboration'. + * @see org.eclipse.bpmn2.Collaboration + * @generated + */ + EClass getCollaboration(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Collaboration#getParticipants Participants}'. + * + * + * @return the meta object for the containment reference list 'Participants'. + * @see org.eclipse.bpmn2.Collaboration#getParticipants() + * @see #getCollaboration() + * @generated + */ + EReference getCollaboration_Participants(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Collaboration#getMessageFlows Message Flows}'. + * + * + * @return the meta object for the containment reference list 'Message Flows'. + * @see org.eclipse.bpmn2.Collaboration#getMessageFlows() + * @see #getCollaboration() + * @generated + */ + EReference getCollaboration_MessageFlows(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Collaboration#getArtifacts Artifacts}'. + * + * + * @return the meta object for the containment reference list 'Artifacts'. + * @see org.eclipse.bpmn2.Collaboration#getArtifacts() + * @see #getCollaboration() + * @generated + */ + EReference getCollaboration_Artifacts(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Collaboration#getConversations Conversations}'. + * + * + * @return the meta object for the containment reference list 'Conversations'. + * @see org.eclipse.bpmn2.Collaboration#getConversations() + * @see #getCollaboration() + * @generated + */ + EReference getCollaboration_Conversations(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.Collaboration#getConversationAssociations Conversation Associations}'. + * + * + * @return the meta object for the containment reference 'Conversation Associations'. + * @see org.eclipse.bpmn2.Collaboration#getConversationAssociations() + * @see #getCollaboration() + * @generated + */ + EReference getCollaboration_ConversationAssociations(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Collaboration#getParticipantAssociations Participant Associations}'. + * + * + * @return the meta object for the containment reference list 'Participant Associations'. + * @see org.eclipse.bpmn2.Collaboration#getParticipantAssociations() + * @see #getCollaboration() + * @generated + */ + EReference getCollaboration_ParticipantAssociations(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Collaboration#getMessageFlowAssociations Message Flow Associations}'. + * + * + * @return the meta object for the containment reference list 'Message Flow Associations'. + * @see org.eclipse.bpmn2.Collaboration#getMessageFlowAssociations() + * @see #getCollaboration() + * @generated + */ + EReference getCollaboration_MessageFlowAssociations(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Collaboration#getCorrelationKeys Correlation Keys}'. + * + * + * @return the meta object for the containment reference list 'Correlation Keys'. + * @see org.eclipse.bpmn2.Collaboration#getCorrelationKeys() + * @see #getCollaboration() + * @generated + */ + EReference getCollaboration_CorrelationKeys(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.Collaboration#getChoreographyRef Choreography Ref}'. + * + * + * @return the meta object for the reference list 'Choreography Ref'. + * @see org.eclipse.bpmn2.Collaboration#getChoreographyRef() + * @see #getCollaboration() + * @generated + */ + EReference getCollaboration_ChoreographyRef(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Collaboration#getConversationLinks Conversation Links}'. + * + * + * @return the meta object for the containment reference list 'Conversation Links'. + * @see org.eclipse.bpmn2.Collaboration#getConversationLinks() + * @see #getCollaboration() + * @generated + */ + EReference getCollaboration_ConversationLinks(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Collaboration#isIsClosed Is Closed}'. + * + * + * @return the meta object for the attribute 'Is Closed'. + * @see org.eclipse.bpmn2.Collaboration#isIsClosed() + * @see #getCollaboration() + * @generated + */ + EAttribute getCollaboration_IsClosed(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Collaboration#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.Collaboration#getName() + * @see #getCollaboration() + * @generated + */ + EAttribute getCollaboration_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.CompensateEventDefinition Compensate Event Definition}'. + * + * + * @return the meta object for class 'Compensate Event Definition'. + * @see org.eclipse.bpmn2.CompensateEventDefinition + * @generated + */ + EClass getCompensateEventDefinition(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.CompensateEventDefinition#getActivityRef Activity Ref}'. + * + * + * @return the meta object for the reference 'Activity Ref'. + * @see org.eclipse.bpmn2.CompensateEventDefinition#getActivityRef() + * @see #getCompensateEventDefinition() + * @generated + */ + EReference getCompensateEventDefinition_ActivityRef(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.CompensateEventDefinition#isWaitForCompletion Wait For Completion}'. + * + * + * @return the meta object for the attribute 'Wait For Completion'. + * @see org.eclipse.bpmn2.CompensateEventDefinition#isWaitForCompletion() + * @see #getCompensateEventDefinition() + * @generated + */ + EAttribute getCompensateEventDefinition_WaitForCompletion(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ComplexBehaviorDefinition Complex Behavior Definition}'. + * + * + * @return the meta object for class 'Complex Behavior Definition'. + * @see org.eclipse.bpmn2.ComplexBehaviorDefinition + * @generated + */ + EClass getComplexBehaviorDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.ComplexBehaviorDefinition#getCondition Condition}'. + * + * + * @return the meta object for the containment reference 'Condition'. + * @see org.eclipse.bpmn2.ComplexBehaviorDefinition#getCondition() + * @see #getComplexBehaviorDefinition() + * @generated + */ + EReference getComplexBehaviorDefinition_Condition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.ComplexBehaviorDefinition#getEvent Event}'. + * + * + * @return the meta object for the containment reference 'Event'. + * @see org.eclipse.bpmn2.ComplexBehaviorDefinition#getEvent() + * @see #getComplexBehaviorDefinition() + * @generated + */ + EReference getComplexBehaviorDefinition_Event(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ComplexGateway Complex Gateway}'. + * + * + * @return the meta object for class 'Complex Gateway'. + * @see org.eclipse.bpmn2.ComplexGateway + * @generated + */ + EClass getComplexGateway(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.ComplexGateway#getActivationCondition Activation Condition}'. + * + * + * @return the meta object for the containment reference 'Activation Condition'. + * @see org.eclipse.bpmn2.ComplexGateway#getActivationCondition() + * @see #getComplexGateway() + * @generated + */ + EReference getComplexGateway_ActivationCondition(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ComplexGateway#getDefault Default}'. + * + * + * @return the meta object for the reference 'Default'. + * @see org.eclipse.bpmn2.ComplexGateway#getDefault() + * @see #getComplexGateway() + * @generated + */ + EReference getComplexGateway_Default(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ConditionalEventDefinition Conditional Event Definition}'. + * + * + * @return the meta object for class 'Conditional Event Definition'. + * @see org.eclipse.bpmn2.ConditionalEventDefinition + * @generated + */ + EClass getConditionalEventDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.ConditionalEventDefinition#getCondition Condition}'. + * + * + * @return the meta object for the containment reference 'Condition'. + * @see org.eclipse.bpmn2.ConditionalEventDefinition#getCondition() + * @see #getConditionalEventDefinition() + * @generated + */ + EReference getConditionalEventDefinition_Condition(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Conversation Conversation}'. + * + * + * @return the meta object for class 'Conversation'. + * @see org.eclipse.bpmn2.Conversation + * @generated + */ + EClass getConversation(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ConversationAssociation Conversation Association}'. + * + * + * @return the meta object for class 'Conversation Association'. + * @see org.eclipse.bpmn2.ConversationAssociation + * @generated + */ + EClass getConversationAssociation(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ConversationAssociation#getInnerConversationNodeRef Inner Conversation Node Ref}'. + * + * + * @return the meta object for the reference 'Inner Conversation Node Ref'. + * @see org.eclipse.bpmn2.ConversationAssociation#getInnerConversationNodeRef() + * @see #getConversationAssociation() + * @generated + */ + EReference getConversationAssociation_InnerConversationNodeRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ConversationAssociation#getOuterConversationNodeRef Outer Conversation Node Ref}'. + * + * + * @return the meta object for the reference 'Outer Conversation Node Ref'. + * @see org.eclipse.bpmn2.ConversationAssociation#getOuterConversationNodeRef() + * @see #getConversationAssociation() + * @generated + */ + EReference getConversationAssociation_OuterConversationNodeRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ConversationLink Conversation Link}'. + * + * + * @return the meta object for class 'Conversation Link'. + * @see org.eclipse.bpmn2.ConversationLink + * @generated + */ + EClass getConversationLink(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ConversationLink#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.ConversationLink#getName() + * @see #getConversationLink() + * @generated + */ + EAttribute getConversationLink_Name(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ConversationLink#getSourceRef Source Ref}'. + * + * + * @return the meta object for the reference 'Source Ref'. + * @see org.eclipse.bpmn2.ConversationLink#getSourceRef() + * @see #getConversationLink() + * @generated + */ + EReference getConversationLink_SourceRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ConversationLink#getTargetRef Target Ref}'. + * + * + * @return the meta object for the reference 'Target Ref'. + * @see org.eclipse.bpmn2.ConversationLink#getTargetRef() + * @see #getConversationLink() + * @generated + */ + EReference getConversationLink_TargetRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ConversationNode Conversation Node}'. + * + * + * @return the meta object for class 'Conversation Node'. + * @see org.eclipse.bpmn2.ConversationNode + * @generated + */ + EClass getConversationNode(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.ConversationNode#getParticipantRefs Participant Refs}'. + * + * + * @return the meta object for the reference list 'Participant Refs'. + * @see org.eclipse.bpmn2.ConversationNode#getParticipantRefs() + * @see #getConversationNode() + * @generated + */ + EReference getConversationNode_ParticipantRefs(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.ConversationNode#getMessageFlowRefs Message Flow Refs}'. + * + * + * @return the meta object for the reference list 'Message Flow Refs'. + * @see org.eclipse.bpmn2.ConversationNode#getMessageFlowRefs() + * @see #getConversationNode() + * @generated + */ + EReference getConversationNode_MessageFlowRefs(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.ConversationNode#getCorrelationKeys Correlation Keys}'. + * + * + * @return the meta object for the containment reference list 'Correlation Keys'. + * @see org.eclipse.bpmn2.ConversationNode#getCorrelationKeys() + * @see #getConversationNode() + * @generated + */ + EReference getConversationNode_CorrelationKeys(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ConversationNode#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.ConversationNode#getName() + * @see #getConversationNode() + * @generated + */ + EAttribute getConversationNode_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.CorrelationKey Correlation Key}'. + * + * + * @return the meta object for class 'Correlation Key'. + * @see org.eclipse.bpmn2.CorrelationKey + * @generated + */ + EClass getCorrelationKey(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.CorrelationKey#getCorrelationPropertyRef Correlation Property Ref}'. + * + * + * @return the meta object for the reference list 'Correlation Property Ref'. + * @see org.eclipse.bpmn2.CorrelationKey#getCorrelationPropertyRef() + * @see #getCorrelationKey() + * @generated + */ + EReference getCorrelationKey_CorrelationPropertyRef(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.CorrelationKey#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.CorrelationKey#getName() + * @see #getCorrelationKey() + * @generated + */ + EAttribute getCorrelationKey_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.CorrelationProperty Correlation Property}'. + * + * + * @return the meta object for class 'Correlation Property'. + * @see org.eclipse.bpmn2.CorrelationProperty + * @generated + */ + EClass getCorrelationProperty(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.CorrelationProperty#getCorrelationPropertyRetrievalExpression Correlation Property Retrieval Expression}'. + * + * + * @return the meta object for the containment reference list 'Correlation Property Retrieval Expression'. + * @see org.eclipse.bpmn2.CorrelationProperty#getCorrelationPropertyRetrievalExpression() + * @see #getCorrelationProperty() + * @generated + */ + EReference getCorrelationProperty_CorrelationPropertyRetrievalExpression(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.CorrelationProperty#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.CorrelationProperty#getName() + * @see #getCorrelationProperty() + * @generated + */ + EAttribute getCorrelationProperty_Name(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.CorrelationProperty#getType Type}'. + * + * + * @return the meta object for the reference 'Type'. + * @see org.eclipse.bpmn2.CorrelationProperty#getType() + * @see #getCorrelationProperty() + * @generated + */ + EReference getCorrelationProperty_Type(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.CorrelationPropertyBinding Correlation Property Binding}'. + * + * + * @return the meta object for class 'Correlation Property Binding'. + * @see org.eclipse.bpmn2.CorrelationPropertyBinding + * @generated + */ + EClass getCorrelationPropertyBinding(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.CorrelationPropertyBinding#getDataPath Data Path}'. + * + * + * @return the meta object for the containment reference 'Data Path'. + * @see org.eclipse.bpmn2.CorrelationPropertyBinding#getDataPath() + * @see #getCorrelationPropertyBinding() + * @generated + */ + EReference getCorrelationPropertyBinding_DataPath(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.CorrelationPropertyBinding#getCorrelationPropertyRef Correlation Property Ref}'. + * + * + * @return the meta object for the reference 'Correlation Property Ref'. + * @see org.eclipse.bpmn2.CorrelationPropertyBinding#getCorrelationPropertyRef() + * @see #getCorrelationPropertyBinding() + * @generated + */ + EReference getCorrelationPropertyBinding_CorrelationPropertyRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression Correlation Property Retrieval Expression}'. + * + * + * @return the meta object for class 'Correlation Property Retrieval Expression'. + * @see org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression + * @generated + */ + EClass getCorrelationPropertyRetrievalExpression(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression#getMessagePath Message Path}'. + * + * + * @return the meta object for the containment reference 'Message Path'. + * @see org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression#getMessagePath() + * @see #getCorrelationPropertyRetrievalExpression() + * @generated + */ + EReference getCorrelationPropertyRetrievalExpression_MessagePath(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression#getMessageRef Message Ref}'. + * + * + * @return the meta object for the reference 'Message Ref'. + * @see org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression#getMessageRef() + * @see #getCorrelationPropertyRetrievalExpression() + * @generated + */ + EReference getCorrelationPropertyRetrievalExpression_MessageRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.CorrelationSubscription Correlation Subscription}'. + * + * + * @return the meta object for class 'Correlation Subscription'. + * @see org.eclipse.bpmn2.CorrelationSubscription + * @generated + */ + EClass getCorrelationSubscription(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.CorrelationSubscription#getCorrelationPropertyBinding Correlation Property Binding}'. + * + * + * @return the meta object for the containment reference list 'Correlation Property Binding'. + * @see org.eclipse.bpmn2.CorrelationSubscription#getCorrelationPropertyBinding() + * @see #getCorrelationSubscription() + * @generated + */ + EReference getCorrelationSubscription_CorrelationPropertyBinding(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.CorrelationSubscription#getCorrelationKeyRef Correlation Key Ref}'. + * + * + * @return the meta object for the reference 'Correlation Key Ref'. + * @see org.eclipse.bpmn2.CorrelationSubscription#getCorrelationKeyRef() + * @see #getCorrelationSubscription() + * @generated + */ + EReference getCorrelationSubscription_CorrelationKeyRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.DataAssociation Data Association}'. + * + * + * @return the meta object for class 'Data Association'. + * @see org.eclipse.bpmn2.DataAssociation + * @generated + */ + EClass getDataAssociation(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.DataAssociation#getSourceRef Source Ref}'. + * + * + * @return the meta object for the reference list 'Source Ref'. + * @see org.eclipse.bpmn2.DataAssociation#getSourceRef() + * @see #getDataAssociation() + * @generated + */ + EReference getDataAssociation_SourceRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.DataAssociation#getTargetRef Target Ref}'. + * + * + * @return the meta object for the reference 'Target Ref'. + * @see org.eclipse.bpmn2.DataAssociation#getTargetRef() + * @see #getDataAssociation() + * @generated + */ + EReference getDataAssociation_TargetRef(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DataAssociation#getTransformation Transformation}'. + * + * + * @return the meta object for the containment reference 'Transformation'. + * @see org.eclipse.bpmn2.DataAssociation#getTransformation() + * @see #getDataAssociation() + * @generated + */ + EReference getDataAssociation_Transformation(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.DataAssociation#getAssignment Assignment}'. + * + * + * @return the meta object for the containment reference list 'Assignment'. + * @see org.eclipse.bpmn2.DataAssociation#getAssignment() + * @see #getDataAssociation() + * @generated + */ + EReference getDataAssociation_Assignment(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.DataInput Data Input}'. + * + * + * @return the meta object for class 'Data Input'. + * @see org.eclipse.bpmn2.DataInput + * @generated + */ + EClass getDataInput(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.DataInput#getInputSetWithOptional Input Set With Optional}'. + * + * + * @return the meta object for the reference list 'Input Set With Optional'. + * @see org.eclipse.bpmn2.DataInput#getInputSetWithOptional() + * @see #getDataInput() + * @generated + */ + EReference getDataInput_InputSetWithOptional(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.DataInput#getInputSetWithWhileExecuting Input Set With While Executing}'. + * + * + * @return the meta object for the reference list 'Input Set With While Executing'. + * @see org.eclipse.bpmn2.DataInput#getInputSetWithWhileExecuting() + * @see #getDataInput() + * @generated + */ + EReference getDataInput_InputSetWithWhileExecuting(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.DataInput#getInputSetRefs Input Set Refs}'. + * + * + * @return the meta object for the reference list 'Input Set Refs'. + * @see org.eclipse.bpmn2.DataInput#getInputSetRefs() + * @see #getDataInput() + * @generated + */ + EReference getDataInput_InputSetRefs(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.DataInput#isIsCollection Is Collection}'. + * + * + * @return the meta object for the attribute 'Is Collection'. + * @see org.eclipse.bpmn2.DataInput#isIsCollection() + * @see #getDataInput() + * @generated + */ + EAttribute getDataInput_IsCollection(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.DataInput#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.DataInput#getName() + * @see #getDataInput() + * @generated + */ + EAttribute getDataInput_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.DataInputAssociation Data Input Association}'. + * + * + * @return the meta object for class 'Data Input Association'. + * @see org.eclipse.bpmn2.DataInputAssociation + * @generated + */ + EClass getDataInputAssociation(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.DataObject Data Object}'. + * + * + * @return the meta object for class 'Data Object'. + * @see org.eclipse.bpmn2.DataObject + * @generated + */ + EClass getDataObject(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.DataObject#isIsCollection Is Collection}'. + * + * + * @return the meta object for the attribute 'Is Collection'. + * @see org.eclipse.bpmn2.DataObject#isIsCollection() + * @see #getDataObject() + * @generated + */ + EAttribute getDataObject_IsCollection(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.DataObjectReference Data Object Reference}'. + * + * + * @return the meta object for class 'Data Object Reference'. + * @see org.eclipse.bpmn2.DataObjectReference + * @generated + */ + EClass getDataObjectReference(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.DataObjectReference#getDataObjectRef Data Object Ref}'. + * + * + * @return the meta object for the reference 'Data Object Ref'. + * @see org.eclipse.bpmn2.DataObjectReference#getDataObjectRef() + * @see #getDataObjectReference() + * @generated + */ + EReference getDataObjectReference_DataObjectRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.DataOutput Data Output}'. + * + * + * @return the meta object for class 'Data Output'. + * @see org.eclipse.bpmn2.DataOutput + * @generated + */ + EClass getDataOutput(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.DataOutput#getOutputSetWithOptional Output Set With Optional}'. + * + * + * @return the meta object for the reference list 'Output Set With Optional'. + * @see org.eclipse.bpmn2.DataOutput#getOutputSetWithOptional() + * @see #getDataOutput() + * @generated + */ + EReference getDataOutput_OutputSetWithOptional(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.DataOutput#getOutputSetWithWhileExecuting Output Set With While Executing}'. + * + * + * @return the meta object for the reference list 'Output Set With While Executing'. + * @see org.eclipse.bpmn2.DataOutput#getOutputSetWithWhileExecuting() + * @see #getDataOutput() + * @generated + */ + EReference getDataOutput_OutputSetWithWhileExecuting(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.DataOutput#getOutputSetRefs Output Set Refs}'. + * + * + * @return the meta object for the reference list 'Output Set Refs'. + * @see org.eclipse.bpmn2.DataOutput#getOutputSetRefs() + * @see #getDataOutput() + * @generated + */ + EReference getDataOutput_OutputSetRefs(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.DataOutput#isIsCollection Is Collection}'. + * + * + * @return the meta object for the attribute 'Is Collection'. + * @see org.eclipse.bpmn2.DataOutput#isIsCollection() + * @see #getDataOutput() + * @generated + */ + EAttribute getDataOutput_IsCollection(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.DataOutput#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.DataOutput#getName() + * @see #getDataOutput() + * @generated + */ + EAttribute getDataOutput_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.DataOutputAssociation Data Output Association}'. + * + * + * @return the meta object for class 'Data Output Association'. + * @see org.eclipse.bpmn2.DataOutputAssociation + * @generated + */ + EClass getDataOutputAssociation(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.DataState Data State}'. + * + * + * @return the meta object for class 'Data State'. + * @see org.eclipse.bpmn2.DataState + * @generated + */ + EClass getDataState(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.DataState#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.DataState#getName() + * @see #getDataState() + * @generated + */ + EAttribute getDataState_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.DataStore Data Store}'. + * + * + * @return the meta object for class 'Data Store'. + * @see org.eclipse.bpmn2.DataStore + * @generated + */ + EClass getDataStore(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.DataStore#getCapacity Capacity}'. + * + * + * @return the meta object for the attribute 'Capacity'. + * @see org.eclipse.bpmn2.DataStore#getCapacity() + * @see #getDataStore() + * @generated + */ + EAttribute getDataStore_Capacity(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.DataStore#isIsUnlimited Is Unlimited}'. + * + * + * @return the meta object for the attribute 'Is Unlimited'. + * @see org.eclipse.bpmn2.DataStore#isIsUnlimited() + * @see #getDataStore() + * @generated + */ + EAttribute getDataStore_IsUnlimited(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.DataStore#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.DataStore#getName() + * @see #getDataStore() + * @generated + */ + EAttribute getDataStore_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.DataStoreReference Data Store Reference}'. + * + * + * @return the meta object for class 'Data Store Reference'. + * @see org.eclipse.bpmn2.DataStoreReference + * @generated + */ + EClass getDataStoreReference(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.DataStoreReference#getDataStoreRef Data Store Ref}'. + * + * + * @return the meta object for the reference 'Data Store Ref'. + * @see org.eclipse.bpmn2.DataStoreReference#getDataStoreRef() + * @see #getDataStoreReference() + * @generated + */ + EReference getDataStoreReference_DataStoreRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Definitions Definitions}'. + * + * + * @return the meta object for class 'Definitions'. + * @see org.eclipse.bpmn2.Definitions + * @generated + */ + EClass getDefinitions(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Definitions#getImports Imports}'. + * + * + * @return the meta object for the containment reference list 'Imports'. + * @see org.eclipse.bpmn2.Definitions#getImports() + * @see #getDefinitions() + * @generated + */ + EReference getDefinitions_Imports(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Definitions#getExtensions Extensions}'. + * + * + * @return the meta object for the containment reference list 'Extensions'. + * @see org.eclipse.bpmn2.Definitions#getExtensions() + * @see #getDefinitions() + * @generated + */ + EReference getDefinitions_Extensions(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Definitions#getRootElements Root Elements}'. + * + * + * @return the meta object for the containment reference list 'Root Elements'. + * @see org.eclipse.bpmn2.Definitions#getRootElements() + * @see #getDefinitions() + * @generated + */ + EReference getDefinitions_RootElements(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Definitions#getDiagrams Diagrams}'. + * + * + * @return the meta object for the containment reference list 'Diagrams'. + * @see org.eclipse.bpmn2.Definitions#getDiagrams() + * @see #getDefinitions() + * @generated + */ + EReference getDefinitions_Diagrams(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Definitions#getRelationships Relationships}'. + * + * + * @return the meta object for the containment reference list 'Relationships'. + * @see org.eclipse.bpmn2.Definitions#getRelationships() + * @see #getDefinitions() + * @generated + */ + EReference getDefinitions_Relationships(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Definitions#getExporter Exporter}'. + * + * + * @return the meta object for the attribute 'Exporter'. + * @see org.eclipse.bpmn2.Definitions#getExporter() + * @see #getDefinitions() + * @generated + */ + EAttribute getDefinitions_Exporter(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Definitions#getExporterVersion Exporter Version}'. + * + * + * @return the meta object for the attribute 'Exporter Version'. + * @see org.eclipse.bpmn2.Definitions#getExporterVersion() + * @see #getDefinitions() + * @generated + */ + EAttribute getDefinitions_ExporterVersion(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Definitions#getExpressionLanguage Expression Language}'. + * + * + * @return the meta object for the attribute 'Expression Language'. + * @see org.eclipse.bpmn2.Definitions#getExpressionLanguage() + * @see #getDefinitions() + * @generated + */ + EAttribute getDefinitions_ExpressionLanguage(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Definitions#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.Definitions#getName() + * @see #getDefinitions() + * @generated + */ + EAttribute getDefinitions_Name(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Definitions#getTargetNamespace Target Namespace}'. + * + * + * @return the meta object for the attribute 'Target Namespace'. + * @see org.eclipse.bpmn2.Definitions#getTargetNamespace() + * @see #getDefinitions() + * @generated + */ + EAttribute getDefinitions_TargetNamespace(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Definitions#getTypeLanguage Type Language}'. + * + * + * @return the meta object for the attribute 'Type Language'. + * @see org.eclipse.bpmn2.Definitions#getTypeLanguage() + * @see #getDefinitions() + * @generated + */ + EAttribute getDefinitions_TypeLanguage(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Documentation Documentation}'. + * + * + * @return the meta object for class 'Documentation'. + * @see org.eclipse.bpmn2.Documentation + * @generated + */ + EClass getDocumentation(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.bpmn2.Documentation#getMixed Mixed}'. + * + * + * @return the meta object for the attribute list 'Mixed'. + * @see org.eclipse.bpmn2.Documentation#getMixed() + * @see #getDocumentation() + * @generated + */ + EAttribute getDocumentation_Mixed(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Documentation#getText Text}'. + * + * + * @return the meta object for the attribute 'Text'. + * @see org.eclipse.bpmn2.Documentation#getText() + * @see #getDocumentation() + * @generated + */ + EAttribute getDocumentation_Text(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Documentation#getTextFormat Text Format}'. + * + * + * @return the meta object for the attribute 'Text Format'. + * @see org.eclipse.bpmn2.Documentation#getTextFormat() + * @see #getDocumentation() + * @generated + */ + EAttribute getDocumentation_TextFormat(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.EndEvent End Event}'. + * + * + * @return the meta object for class 'End Event'. + * @see org.eclipse.bpmn2.EndEvent + * @generated + */ + EClass getEndEvent(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.EndPoint End Point}'. + * + * + * @return the meta object for class 'End Point'. + * @see org.eclipse.bpmn2.EndPoint + * @generated + */ + EClass getEndPoint(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Error Error}'. + * + * + * @return the meta object for class 'Error'. + * @see org.eclipse.bpmn2.Error + * @generated + */ + EClass getError(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Error#getErrorCode Error Code}'. + * + * + * @return the meta object for the attribute 'Error Code'. + * @see org.eclipse.bpmn2.Error#getErrorCode() + * @see #getError() + * @generated + */ + EAttribute getError_ErrorCode(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Error#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.Error#getName() + * @see #getError() + * @generated + */ + EAttribute getError_Name(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Error#getStructureRef Structure Ref}'. + * + * + * @return the meta object for the reference 'Structure Ref'. + * @see org.eclipse.bpmn2.Error#getStructureRef() + * @see #getError() + * @generated + */ + EReference getError_StructureRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ErrorEventDefinition Error Event Definition}'. + * + * + * @return the meta object for class 'Error Event Definition'. + * @see org.eclipse.bpmn2.ErrorEventDefinition + * @generated + */ + EClass getErrorEventDefinition(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ErrorEventDefinition#getErrorRef Error Ref}'. + * + * + * @return the meta object for the reference 'Error Ref'. + * @see org.eclipse.bpmn2.ErrorEventDefinition#getErrorRef() + * @see #getErrorEventDefinition() + * @generated + */ + EReference getErrorEventDefinition_ErrorRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Escalation Escalation}'. + * + * + * @return the meta object for class 'Escalation'. + * @see org.eclipse.bpmn2.Escalation + * @generated + */ + EClass getEscalation(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Escalation#getEscalationCode Escalation Code}'. + * + * + * @return the meta object for the attribute 'Escalation Code'. + * @see org.eclipse.bpmn2.Escalation#getEscalationCode() + * @see #getEscalation() + * @generated + */ + EAttribute getEscalation_EscalationCode(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Escalation#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.Escalation#getName() + * @see #getEscalation() + * @generated + */ + EAttribute getEscalation_Name(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Escalation#getStructureRef Structure Ref}'. + * + * + * @return the meta object for the reference 'Structure Ref'. + * @see org.eclipse.bpmn2.Escalation#getStructureRef() + * @see #getEscalation() + * @generated + */ + EReference getEscalation_StructureRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.EscalationEventDefinition Escalation Event Definition}'. + * + * + * @return the meta object for class 'Escalation Event Definition'. + * @see org.eclipse.bpmn2.EscalationEventDefinition + * @generated + */ + EClass getEscalationEventDefinition(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.EscalationEventDefinition#getEscalationRef Escalation Ref}'. + * + * + * @return the meta object for the reference 'Escalation Ref'. + * @see org.eclipse.bpmn2.EscalationEventDefinition#getEscalationRef() + * @see #getEscalationEventDefinition() + * @generated + */ + EReference getEscalationEventDefinition_EscalationRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Event Event}'. + * + * + * @return the meta object for class 'Event'. + * @see org.eclipse.bpmn2.Event + * @generated + */ + EClass getEvent(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Event#getProperties Properties}'. + * + * + * @return the meta object for the containment reference list 'Properties'. + * @see org.eclipse.bpmn2.Event#getProperties() + * @see #getEvent() + * @generated + */ + EReference getEvent_Properties(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.EventBasedGateway Event Based Gateway}'. + * + * + * @return the meta object for class 'Event Based Gateway'. + * @see org.eclipse.bpmn2.EventBasedGateway + * @generated + */ + EClass getEventBasedGateway(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.EventBasedGateway#getEventGatewayType Event Gateway Type}'. + * + * + * @return the meta object for the attribute 'Event Gateway Type'. + * @see org.eclipse.bpmn2.EventBasedGateway#getEventGatewayType() + * @see #getEventBasedGateway() + * @generated + */ + EAttribute getEventBasedGateway_EventGatewayType(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.EventBasedGateway#isInstantiate Instantiate}'. + * + * + * @return the meta object for the attribute 'Instantiate'. + * @see org.eclipse.bpmn2.EventBasedGateway#isInstantiate() + * @see #getEventBasedGateway() + * @generated + */ + EAttribute getEventBasedGateway_Instantiate(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.EventDefinition Event Definition}'. + * + * + * @return the meta object for class 'Event Definition'. + * @see org.eclipse.bpmn2.EventDefinition + * @generated + */ + EClass getEventDefinition(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ExclusiveGateway Exclusive Gateway}'. + * + * + * @return the meta object for class 'Exclusive Gateway'. + * @see org.eclipse.bpmn2.ExclusiveGateway + * @generated + */ + EClass getExclusiveGateway(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ExclusiveGateway#getDefault Default}'. + * + * + * @return the meta object for the reference 'Default'. + * @see org.eclipse.bpmn2.ExclusiveGateway#getDefault() + * @see #getExclusiveGateway() + * @generated + */ + EReference getExclusiveGateway_Default(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Expression Expression}'. + * + * + * @return the meta object for class 'Expression'. + * @see org.eclipse.bpmn2.Expression + * @generated + */ + EClass getExpression(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Extension Extension}'. + * + * + * @return the meta object for class 'Extension'. + * @see org.eclipse.bpmn2.Extension + * @generated + */ + EClass getExtension(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.Extension#getDefinition Definition}'. + * + * + * @return the meta object for the containment reference 'Definition'. + * @see org.eclipse.bpmn2.Extension#getDefinition() + * @see #getExtension() + * @generated + */ + EReference getExtension_Definition(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Extension#isMustUnderstand Must Understand}'. + * + * + * @return the meta object for the attribute 'Must Understand'. + * @see org.eclipse.bpmn2.Extension#isMustUnderstand() + * @see #getExtension() + * @generated + */ + EAttribute getExtension_MustUnderstand(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Extension#getXsdDefinition Xsd Definition}'. + * + * + * @return the meta object for the attribute 'Xsd Definition'. + * @see org.eclipse.bpmn2.Extension#getXsdDefinition() + * @see #getExtension() + * @generated + */ + EAttribute getExtension_XsdDefinition(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ExtensionAttributeDefinition Extension Attribute Definition}'. + * + * + * @return the meta object for class 'Extension Attribute Definition'. + * @see org.eclipse.bpmn2.ExtensionAttributeDefinition + * @generated + */ + EClass getExtensionAttributeDefinition(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ExtensionAttributeDefinition#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.ExtensionAttributeDefinition#getName() + * @see #getExtensionAttributeDefinition() + * @generated + */ + EAttribute getExtensionAttributeDefinition_Name(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ExtensionAttributeDefinition#getType Type}'. + * + * + * @return the meta object for the attribute 'Type'. + * @see org.eclipse.bpmn2.ExtensionAttributeDefinition#getType() + * @see #getExtensionAttributeDefinition() + * @generated + */ + EAttribute getExtensionAttributeDefinition_Type(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ExtensionAttributeDefinition#isIsReference Is Reference}'. + * + * + * @return the meta object for the attribute 'Is Reference'. + * @see org.eclipse.bpmn2.ExtensionAttributeDefinition#isIsReference() + * @see #getExtensionAttributeDefinition() + * @generated + */ + EAttribute getExtensionAttributeDefinition_IsReference(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.bpmn2.ExtensionAttributeDefinition#getExtensionDefinition Extension Definition}'. + * + * + * @return the meta object for the container reference 'Extension Definition'. + * @see org.eclipse.bpmn2.ExtensionAttributeDefinition#getExtensionDefinition() + * @see #getExtensionAttributeDefinition() + * @generated + */ + EReference getExtensionAttributeDefinition_ExtensionDefinition(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ExtensionAttributeValue Extension Attribute Value}'. + * + * + * @return the meta object for class 'Extension Attribute Value'. + * @see org.eclipse.bpmn2.ExtensionAttributeValue + * @generated + */ + EClass getExtensionAttributeValue(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ExtensionAttributeValue#getValueRef Value Ref}'. + * + * + * @return the meta object for the reference 'Value Ref'. + * @see org.eclipse.bpmn2.ExtensionAttributeValue#getValueRef() + * @see #getExtensionAttributeValue() + * @generated + */ + EReference getExtensionAttributeValue_ValueRef(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.bpmn2.ExtensionAttributeValue#getValue Value}'. + * + * + * @return the meta object for the attribute list 'Value'. + * @see org.eclipse.bpmn2.ExtensionAttributeValue#getValue() + * @see #getExtensionAttributeValue() + * @generated + */ + EAttribute getExtensionAttributeValue_Value(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ExtensionAttributeValue#getExtensionAttributeDefinition Extension Attribute Definition}'. + * + * + * @return the meta object for the reference 'Extension Attribute Definition'. + * @see org.eclipse.bpmn2.ExtensionAttributeValue#getExtensionAttributeDefinition() + * @see #getExtensionAttributeValue() + * @generated + */ + EReference getExtensionAttributeValue_ExtensionAttributeDefinition(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ExtensionDefinition Extension Definition}'. + * + * + * @return the meta object for class 'Extension Definition'. + * @see org.eclipse.bpmn2.ExtensionDefinition + * @generated + */ + EClass getExtensionDefinition(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ExtensionDefinition#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.ExtensionDefinition#getName() + * @see #getExtensionDefinition() + * @generated + */ + EAttribute getExtensionDefinition_Name(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.ExtensionDefinition#getExtensionAttributeDefinitions Extension Attribute Definitions}'. + * + * + * @return the meta object for the containment reference list 'Extension Attribute Definitions'. + * @see org.eclipse.bpmn2.ExtensionDefinition#getExtensionAttributeDefinitions() + * @see #getExtensionDefinition() + * @generated + */ + EReference getExtensionDefinition_ExtensionAttributeDefinitions(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.FlowElement Flow Element}'. + * + * + * @return the meta object for class 'Flow Element'. + * @see org.eclipse.bpmn2.FlowElement + * @generated + */ + EClass getFlowElement(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.FlowElement#getAuditing Auditing}'. + * + * + * @return the meta object for the containment reference 'Auditing'. + * @see org.eclipse.bpmn2.FlowElement#getAuditing() + * @see #getFlowElement() + * @generated + */ + EReference getFlowElement_Auditing(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.FlowElement#getMonitoring Monitoring}'. + * + * + * @return the meta object for the containment reference 'Monitoring'. + * @see org.eclipse.bpmn2.FlowElement#getMonitoring() + * @see #getFlowElement() + * @generated + */ + EReference getFlowElement_Monitoring(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.FlowElement#getCategoryValueRef Category Value Ref}'. + * + * + * @return the meta object for the reference list 'Category Value Ref'. + * @see org.eclipse.bpmn2.FlowElement#getCategoryValueRef() + * @see #getFlowElement() + * @generated + */ + EReference getFlowElement_CategoryValueRef(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.FlowElement#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.FlowElement#getName() + * @see #getFlowElement() + * @generated + */ + EAttribute getFlowElement_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.FlowElementsContainer Flow Elements Container}'. + * + * + * @return the meta object for class 'Flow Elements Container'. + * @see org.eclipse.bpmn2.FlowElementsContainer + * @generated + */ + EClass getFlowElementsContainer(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.FlowElementsContainer#getLaneSets Lane Sets}'. + * + * + * @return the meta object for the containment reference list 'Lane Sets'. + * @see org.eclipse.bpmn2.FlowElementsContainer#getLaneSets() + * @see #getFlowElementsContainer() + * @generated + */ + EReference getFlowElementsContainer_LaneSets(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.FlowElementsContainer#getFlowElements Flow Elements}'. + * + * + * @return the meta object for the containment reference list 'Flow Elements'. + * @see org.eclipse.bpmn2.FlowElementsContainer#getFlowElements() + * @see #getFlowElementsContainer() + * @generated + */ + EReference getFlowElementsContainer_FlowElements(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.FlowNode Flow Node}'. + * + * + * @return the meta object for class 'Flow Node'. + * @see org.eclipse.bpmn2.FlowNode + * @generated + */ + EClass getFlowNode(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.FlowNode#getIncoming Incoming}'. + * + * + * @return the meta object for the reference list 'Incoming'. + * @see org.eclipse.bpmn2.FlowNode#getIncoming() + * @see #getFlowNode() + * @generated + */ + EReference getFlowNode_Incoming(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.FlowNode#getLanes Lanes}'. + * + * + * @return the meta object for the reference list 'Lanes'. + * @see org.eclipse.bpmn2.FlowNode#getLanes() + * @see #getFlowNode() + * @generated + */ + EReference getFlowNode_Lanes(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.FlowNode#getOutgoing Outgoing}'. + * + * + * @return the meta object for the reference list 'Outgoing'. + * @see org.eclipse.bpmn2.FlowNode#getOutgoing() + * @see #getFlowNode() + * @generated + */ + EReference getFlowNode_Outgoing(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.FormalExpression Formal Expression}'. + * + * + * @return the meta object for class 'Formal Expression'. + * @see org.eclipse.bpmn2.FormalExpression + * @generated + */ + EClass getFormalExpression(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.bpmn2.FormalExpression#getMixed Mixed}'. + * + * + * @return the meta object for the attribute list 'Mixed'. + * @see org.eclipse.bpmn2.FormalExpression#getMixed() + * @see #getFormalExpression() + * @generated + */ + EAttribute getFormalExpression_Mixed(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.FormalExpression#getBody Body}'. + * + * + * @return the meta object for the attribute 'Body'. + * @see org.eclipse.bpmn2.FormalExpression#getBody() + * @see #getFormalExpression() + * @generated + */ + EAttribute getFormalExpression_Body(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.FormalExpression#getEvaluatesToTypeRef Evaluates To Type Ref}'. + * + * + * @return the meta object for the reference 'Evaluates To Type Ref'. + * @see org.eclipse.bpmn2.FormalExpression#getEvaluatesToTypeRef() + * @see #getFormalExpression() + * @generated + */ + EReference getFormalExpression_EvaluatesToTypeRef(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.FormalExpression#getLanguage Language}'. + * + * + * @return the meta object for the attribute 'Language'. + * @see org.eclipse.bpmn2.FormalExpression#getLanguage() + * @see #getFormalExpression() + * @generated + */ + EAttribute getFormalExpression_Language(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Gateway Gateway}'. + * + * + * @return the meta object for class 'Gateway'. + * @see org.eclipse.bpmn2.Gateway + * @generated + */ + EClass getGateway(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Gateway#getGatewayDirection Gateway Direction}'. + * + * + * @return the meta object for the attribute 'Gateway Direction'. + * @see org.eclipse.bpmn2.Gateway#getGatewayDirection() + * @see #getGateway() + * @generated + */ + EAttribute getGateway_GatewayDirection(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.GlobalBusinessRuleTask Global Business Rule Task}'. + * + * + * @return the meta object for class 'Global Business Rule Task'. + * @see org.eclipse.bpmn2.GlobalBusinessRuleTask + * @generated + */ + EClass getGlobalBusinessRuleTask(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.GlobalBusinessRuleTask#getImplementation Implementation}'. + * + * + * @return the meta object for the attribute 'Implementation'. + * @see org.eclipse.bpmn2.GlobalBusinessRuleTask#getImplementation() + * @see #getGlobalBusinessRuleTask() + * @generated + */ + EAttribute getGlobalBusinessRuleTask_Implementation(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.GlobalChoreographyTask Global Choreography Task}'. + * + * + * @return the meta object for class 'Global Choreography Task'. + * @see org.eclipse.bpmn2.GlobalChoreographyTask + * @generated + */ + EClass getGlobalChoreographyTask(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.GlobalChoreographyTask#getInitiatingParticipantRef Initiating Participant Ref}'. + * + * + * @return the meta object for the reference 'Initiating Participant Ref'. + * @see org.eclipse.bpmn2.GlobalChoreographyTask#getInitiatingParticipantRef() + * @see #getGlobalChoreographyTask() + * @generated + */ + EReference getGlobalChoreographyTask_InitiatingParticipantRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.GlobalConversation Global Conversation}'. + * + * + * @return the meta object for class 'Global Conversation'. + * @see org.eclipse.bpmn2.GlobalConversation + * @generated + */ + EClass getGlobalConversation(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.GlobalManualTask Global Manual Task}'. + * + * + * @return the meta object for class 'Global Manual Task'. + * @see org.eclipse.bpmn2.GlobalManualTask + * @generated + */ + EClass getGlobalManualTask(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.GlobalScriptTask Global Script Task}'. + * + * + * @return the meta object for class 'Global Script Task'. + * @see org.eclipse.bpmn2.GlobalScriptTask + * @generated + */ + EClass getGlobalScriptTask(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.GlobalScriptTask#getScript Script}'. + * + * + * @return the meta object for the attribute 'Script'. + * @see org.eclipse.bpmn2.GlobalScriptTask#getScript() + * @see #getGlobalScriptTask() + * @generated + */ + EAttribute getGlobalScriptTask_Script(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.GlobalScriptTask#getScriptLanguage Script Language}'. + * + * + * @return the meta object for the attribute 'Script Language'. + * @see org.eclipse.bpmn2.GlobalScriptTask#getScriptLanguage() + * @see #getGlobalScriptTask() + * @generated + */ + EAttribute getGlobalScriptTask_ScriptLanguage(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.GlobalTask Global Task}'. + * + * + * @return the meta object for class 'Global Task'. + * @see org.eclipse.bpmn2.GlobalTask + * @generated + */ + EClass getGlobalTask(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.GlobalTask#getResources Resources}'. + * + * + * @return the meta object for the containment reference list 'Resources'. + * @see org.eclipse.bpmn2.GlobalTask#getResources() + * @see #getGlobalTask() + * @generated + */ + EReference getGlobalTask_Resources(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.GlobalUserTask Global User Task}'. + * + * + * @return the meta object for class 'Global User Task'. + * @see org.eclipse.bpmn2.GlobalUserTask + * @generated + */ + EClass getGlobalUserTask(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.GlobalUserTask#getRenderings Renderings}'. + * + * + * @return the meta object for the containment reference list 'Renderings'. + * @see org.eclipse.bpmn2.GlobalUserTask#getRenderings() + * @see #getGlobalUserTask() + * @generated + */ + EReference getGlobalUserTask_Renderings(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.GlobalUserTask#getImplementation Implementation}'. + * + * + * @return the meta object for the attribute 'Implementation'. + * @see org.eclipse.bpmn2.GlobalUserTask#getImplementation() + * @see #getGlobalUserTask() + * @generated + */ + EAttribute getGlobalUserTask_Implementation(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Group Group}'. + * + * + * @return the meta object for class 'Group'. + * @see org.eclipse.bpmn2.Group + * @generated + */ + EClass getGroup(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Group#getCategoryValueRef Category Value Ref}'. + * + * + * @return the meta object for the reference 'Category Value Ref'. + * @see org.eclipse.bpmn2.Group#getCategoryValueRef() + * @see #getGroup() + * @generated + */ + EReference getGroup_CategoryValueRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.HumanPerformer Human Performer}'. + * + * + * @return the meta object for class 'Human Performer'. + * @see org.eclipse.bpmn2.HumanPerformer + * @generated + */ + EClass getHumanPerformer(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ImplicitThrowEvent Implicit Throw Event}'. + * + * + * @return the meta object for class 'Implicit Throw Event'. + * @see org.eclipse.bpmn2.ImplicitThrowEvent + * @generated + */ + EClass getImplicitThrowEvent(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Import Import}'. + * + * + * @return the meta object for class 'Import'. + * @see org.eclipse.bpmn2.Import + * @generated + */ + EClass getImport(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Import#getImportType Import Type}'. + * + * + * @return the meta object for the attribute 'Import Type'. + * @see org.eclipse.bpmn2.Import#getImportType() + * @see #getImport() + * @generated + */ + EAttribute getImport_ImportType(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Import#getLocation Location}'. + * + * + * @return the meta object for the attribute 'Location'. + * @see org.eclipse.bpmn2.Import#getLocation() + * @see #getImport() + * @generated + */ + EAttribute getImport_Location(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Import#getNamespace Namespace}'. + * + * + * @return the meta object for the attribute 'Namespace'. + * @see org.eclipse.bpmn2.Import#getNamespace() + * @see #getImport() + * @generated + */ + EAttribute getImport_Namespace(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.InclusiveGateway Inclusive Gateway}'. + * + * + * @return the meta object for class 'Inclusive Gateway'. + * @see org.eclipse.bpmn2.InclusiveGateway + * @generated + */ + EClass getInclusiveGateway(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.InclusiveGateway#getDefault Default}'. + * + * + * @return the meta object for the reference 'Default'. + * @see org.eclipse.bpmn2.InclusiveGateway#getDefault() + * @see #getInclusiveGateway() + * @generated + */ + EReference getInclusiveGateway_Default(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.InputOutputBinding Input Output Binding}'. + * + * + * @return the meta object for class 'Input Output Binding'. + * @see org.eclipse.bpmn2.InputOutputBinding + * @generated + */ + EClass getInputOutputBinding(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.InputOutputBinding#getInputDataRef Input Data Ref}'. + * + * + * @return the meta object for the reference 'Input Data Ref'. + * @see org.eclipse.bpmn2.InputOutputBinding#getInputDataRef() + * @see #getInputOutputBinding() + * @generated + */ + EReference getInputOutputBinding_InputDataRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.InputOutputBinding#getOperationRef Operation Ref}'. + * + * + * @return the meta object for the reference 'Operation Ref'. + * @see org.eclipse.bpmn2.InputOutputBinding#getOperationRef() + * @see #getInputOutputBinding() + * @generated + */ + EReference getInputOutputBinding_OperationRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.InputOutputBinding#getOutputDataRef Output Data Ref}'. + * + * + * @return the meta object for the reference 'Output Data Ref'. + * @see org.eclipse.bpmn2.InputOutputBinding#getOutputDataRef() + * @see #getInputOutputBinding() + * @generated + */ + EReference getInputOutputBinding_OutputDataRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.InputOutputSpecification Input Output Specification}'. + * + * + * @return the meta object for class 'Input Output Specification'. + * @see org.eclipse.bpmn2.InputOutputSpecification + * @generated + */ + EClass getInputOutputSpecification(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.InputOutputSpecification#getDataInputs Data Inputs}'. + * + * + * @return the meta object for the containment reference list 'Data Inputs'. + * @see org.eclipse.bpmn2.InputOutputSpecification#getDataInputs() + * @see #getInputOutputSpecification() + * @generated + */ + EReference getInputOutputSpecification_DataInputs(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.InputOutputSpecification#getDataOutputs Data Outputs}'. + * + * + * @return the meta object for the containment reference list 'Data Outputs'. + * @see org.eclipse.bpmn2.InputOutputSpecification#getDataOutputs() + * @see #getInputOutputSpecification() + * @generated + */ + EReference getInputOutputSpecification_DataOutputs(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.InputOutputSpecification#getInputSets Input Sets}'. + * + * + * @return the meta object for the containment reference list 'Input Sets'. + * @see org.eclipse.bpmn2.InputOutputSpecification#getInputSets() + * @see #getInputOutputSpecification() + * @generated + */ + EReference getInputOutputSpecification_InputSets(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.InputOutputSpecification#getOutputSets Output Sets}'. + * + * + * @return the meta object for the containment reference list 'Output Sets'. + * @see org.eclipse.bpmn2.InputOutputSpecification#getOutputSets() + * @see #getInputOutputSpecification() + * @generated + */ + EReference getInputOutputSpecification_OutputSets(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.InputSet Input Set}'. + * + * + * @return the meta object for class 'Input Set'. + * @see org.eclipse.bpmn2.InputSet + * @generated + */ + EClass getInputSet(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.InputSet#getDataInputRefs Data Input Refs}'. + * + * + * @return the meta object for the reference list 'Data Input Refs'. + * @see org.eclipse.bpmn2.InputSet#getDataInputRefs() + * @see #getInputSet() + * @generated + */ + EReference getInputSet_DataInputRefs(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.InputSet#getOptionalInputRefs Optional Input Refs}'. + * + * + * @return the meta object for the reference list 'Optional Input Refs'. + * @see org.eclipse.bpmn2.InputSet#getOptionalInputRefs() + * @see #getInputSet() + * @generated + */ + EReference getInputSet_OptionalInputRefs(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.InputSet#getWhileExecutingInputRefs While Executing Input Refs}'. + * + * + * @return the meta object for the reference list 'While Executing Input Refs'. + * @see org.eclipse.bpmn2.InputSet#getWhileExecutingInputRefs() + * @see #getInputSet() + * @generated + */ + EReference getInputSet_WhileExecutingInputRefs(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.InputSet#getOutputSetRefs Output Set Refs}'. + * + * + * @return the meta object for the reference list 'Output Set Refs'. + * @see org.eclipse.bpmn2.InputSet#getOutputSetRefs() + * @see #getInputSet() + * @generated + */ + EReference getInputSet_OutputSetRefs(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.InputSet#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.InputSet#getName() + * @see #getInputSet() + * @generated + */ + EAttribute getInputSet_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.InteractionNode Interaction Node}'. + * + * + * @return the meta object for class 'Interaction Node'. + * @see org.eclipse.bpmn2.InteractionNode + * @generated + */ + EClass getInteractionNode(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.InteractionNode#getIncomingConversationLinks Incoming Conversation Links}'. + * + * + * @return the meta object for the reference list 'Incoming Conversation Links'. + * @see org.eclipse.bpmn2.InteractionNode#getIncomingConversationLinks() + * @see #getInteractionNode() + * @generated + */ + EReference getInteractionNode_IncomingConversationLinks(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.InteractionNode#getOutgoingConversationLinks Outgoing Conversation Links}'. + * + * + * @return the meta object for the reference list 'Outgoing Conversation Links'. + * @see org.eclipse.bpmn2.InteractionNode#getOutgoingConversationLinks() + * @see #getInteractionNode() + * @generated + */ + EReference getInteractionNode_OutgoingConversationLinks(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Interface Interface}'. + * + * + * @return the meta object for class 'Interface'. + * @see org.eclipse.bpmn2.Interface + * @generated + */ + EClass getInterface(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Interface#getOperations Operations}'. + * + * + * @return the meta object for the containment reference list 'Operations'. + * @see org.eclipse.bpmn2.Interface#getOperations() + * @see #getInterface() + * @generated + */ + EReference getInterface_Operations(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Interface#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.Interface#getName() + * @see #getInterface() + * @generated + */ + EAttribute getInterface_Name(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Interface#getImplementationRef Implementation Ref}'. + * + * + * @return the meta object for the attribute 'Implementation Ref'. + * @see org.eclipse.bpmn2.Interface#getImplementationRef() + * @see #getInterface() + * @generated + */ + EAttribute getInterface_ImplementationRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.IntermediateCatchEvent Intermediate Catch Event}'. + * + * + * @return the meta object for class 'Intermediate Catch Event'. + * @see org.eclipse.bpmn2.IntermediateCatchEvent + * @generated + */ + EClass getIntermediateCatchEvent(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.IntermediateThrowEvent Intermediate Throw Event}'. + * + * + * @return the meta object for class 'Intermediate Throw Event'. + * @see org.eclipse.bpmn2.IntermediateThrowEvent + * @generated + */ + EClass getIntermediateThrowEvent(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ItemAwareElement Item Aware Element}'. + * + * + * @return the meta object for class 'Item Aware Element'. + * @see org.eclipse.bpmn2.ItemAwareElement + * @generated + */ + EClass getItemAwareElement(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.ItemAwareElement#getDataState Data State}'. + * + * + * @return the meta object for the containment reference 'Data State'. + * @see org.eclipse.bpmn2.ItemAwareElement#getDataState() + * @see #getItemAwareElement() + * @generated + */ + EReference getItemAwareElement_DataState(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ItemAwareElement#getItemSubjectRef Item Subject Ref}'. + * + * + * @return the meta object for the reference 'Item Subject Ref'. + * @see org.eclipse.bpmn2.ItemAwareElement#getItemSubjectRef() + * @see #getItemAwareElement() + * @generated + */ + EReference getItemAwareElement_ItemSubjectRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ItemDefinition Item Definition}'. + * + * + * @return the meta object for class 'Item Definition'. + * @see org.eclipse.bpmn2.ItemDefinition + * @generated + */ + EClass getItemDefinition(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ItemDefinition#isIsCollection Is Collection}'. + * + * + * @return the meta object for the attribute 'Is Collection'. + * @see org.eclipse.bpmn2.ItemDefinition#isIsCollection() + * @see #getItemDefinition() + * @generated + */ + EAttribute getItemDefinition_IsCollection(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ItemDefinition#getImport Import}'. + * + * + * @return the meta object for the reference 'Import'. + * @see org.eclipse.bpmn2.ItemDefinition#getImport() + * @see #getItemDefinition() + * @generated + */ + EReference getItemDefinition_Import(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ItemDefinition#getItemKind Item Kind}'. + * + * + * @return the meta object for the attribute 'Item Kind'. + * @see org.eclipse.bpmn2.ItemDefinition#getItemKind() + * @see #getItemDefinition() + * @generated + */ + EAttribute getItemDefinition_ItemKind(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ItemDefinition#getStructureRef Structure Ref}'. + * + * + * @return the meta object for the attribute 'Structure Ref'. + * @see org.eclipse.bpmn2.ItemDefinition#getStructureRef() + * @see #getItemDefinition() + * @generated + */ + EAttribute getItemDefinition_StructureRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Lane Lane}'. + * + * + * @return the meta object for class 'Lane'. + * @see org.eclipse.bpmn2.Lane + * @generated + */ + EClass getLane(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.Lane#getPartitionElement Partition Element}'. + * + * + * @return the meta object for the containment reference 'Partition Element'. + * @see org.eclipse.bpmn2.Lane#getPartitionElement() + * @see #getLane() + * @generated + */ + EReference getLane_PartitionElement(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.Lane#getFlowNodeRefs Flow Node Refs}'. + * + * + * @return the meta object for the reference list 'Flow Node Refs'. + * @see org.eclipse.bpmn2.Lane#getFlowNodeRefs() + * @see #getLane() + * @generated + */ + EReference getLane_FlowNodeRefs(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.Lane#getChildLaneSet Child Lane Set}'. + * + * + * @return the meta object for the containment reference 'Child Lane Set'. + * @see org.eclipse.bpmn2.Lane#getChildLaneSet() + * @see #getLane() + * @generated + */ + EReference getLane_ChildLaneSet(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Lane#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.Lane#getName() + * @see #getLane() + * @generated + */ + EAttribute getLane_Name(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Lane#getPartitionElementRef Partition Element Ref}'. + * + * + * @return the meta object for the reference 'Partition Element Ref'. + * @see org.eclipse.bpmn2.Lane#getPartitionElementRef() + * @see #getLane() + * @generated + */ + EReference getLane_PartitionElementRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.LaneSet Lane Set}'. + * + * + * @return the meta object for class 'Lane Set'. + * @see org.eclipse.bpmn2.LaneSet + * @generated + */ + EClass getLaneSet(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.LaneSet#getLanes Lanes}'. + * + * + * @return the meta object for the containment reference list 'Lanes'. + * @see org.eclipse.bpmn2.LaneSet#getLanes() + * @see #getLaneSet() + * @generated + */ + EReference getLaneSet_Lanes(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.LaneSet#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.LaneSet#getName() + * @see #getLaneSet() + * @generated + */ + EAttribute getLaneSet_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.LinkEventDefinition Link Event Definition}'. + * + * + * @return the meta object for class 'Link Event Definition'. + * @see org.eclipse.bpmn2.LinkEventDefinition + * @generated + */ + EClass getLinkEventDefinition(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.LinkEventDefinition#getSource Source}'. + * + * + * @return the meta object for the reference list 'Source'. + * @see org.eclipse.bpmn2.LinkEventDefinition#getSource() + * @see #getLinkEventDefinition() + * @generated + */ + EReference getLinkEventDefinition_Source(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.LinkEventDefinition#getTarget Target}'. + * + * + * @return the meta object for the reference 'Target'. + * @see org.eclipse.bpmn2.LinkEventDefinition#getTarget() + * @see #getLinkEventDefinition() + * @generated + */ + EReference getLinkEventDefinition_Target(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.LinkEventDefinition#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.LinkEventDefinition#getName() + * @see #getLinkEventDefinition() + * @generated + */ + EAttribute getLinkEventDefinition_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.LoopCharacteristics Loop Characteristics}'. + * + * + * @return the meta object for class 'Loop Characteristics'. + * @see org.eclipse.bpmn2.LoopCharacteristics + * @generated + */ + EClass getLoopCharacteristics(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ManualTask Manual Task}'. + * + * + * @return the meta object for class 'Manual Task'. + * @see org.eclipse.bpmn2.ManualTask + * @generated + */ + EClass getManualTask(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Message Message}'. + * + * + * @return the meta object for class 'Message'. + * @see org.eclipse.bpmn2.Message + * @generated + */ + EClass getMessage(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Message#getItemRef Item Ref}'. + * + * + * @return the meta object for the reference 'Item Ref'. + * @see org.eclipse.bpmn2.Message#getItemRef() + * @see #getMessage() + * @generated + */ + EReference getMessage_ItemRef(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Message#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.Message#getName() + * @see #getMessage() + * @generated + */ + EAttribute getMessage_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.MessageEventDefinition Message Event Definition}'. + * + * + * @return the meta object for class 'Message Event Definition'. + * @see org.eclipse.bpmn2.MessageEventDefinition + * @generated + */ + EClass getMessageEventDefinition(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.MessageEventDefinition#getOperationRef Operation Ref}'. + * + * + * @return the meta object for the reference 'Operation Ref'. + * @see org.eclipse.bpmn2.MessageEventDefinition#getOperationRef() + * @see #getMessageEventDefinition() + * @generated + */ + EReference getMessageEventDefinition_OperationRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.MessageEventDefinition#getMessageRef Message Ref}'. + * + * + * @return the meta object for the reference 'Message Ref'. + * @see org.eclipse.bpmn2.MessageEventDefinition#getMessageRef() + * @see #getMessageEventDefinition() + * @generated + */ + EReference getMessageEventDefinition_MessageRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.MessageFlow Message Flow}'. + * + * + * @return the meta object for class 'Message Flow'. + * @see org.eclipse.bpmn2.MessageFlow + * @generated + */ + EClass getMessageFlow(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.MessageFlow#getMessageRef Message Ref}'. + * + * + * @return the meta object for the reference 'Message Ref'. + * @see org.eclipse.bpmn2.MessageFlow#getMessageRef() + * @see #getMessageFlow() + * @generated + */ + EReference getMessageFlow_MessageRef(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.MessageFlow#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.MessageFlow#getName() + * @see #getMessageFlow() + * @generated + */ + EAttribute getMessageFlow_Name(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.MessageFlow#getSourceRef Source Ref}'. + * + * + * @return the meta object for the reference 'Source Ref'. + * @see org.eclipse.bpmn2.MessageFlow#getSourceRef() + * @see #getMessageFlow() + * @generated + */ + EReference getMessageFlow_SourceRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.MessageFlow#getTargetRef Target Ref}'. + * + * + * @return the meta object for the reference 'Target Ref'. + * @see org.eclipse.bpmn2.MessageFlow#getTargetRef() + * @see #getMessageFlow() + * @generated + */ + EReference getMessageFlow_TargetRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.MessageFlowAssociation Message Flow Association}'. + * + * + * @return the meta object for class 'Message Flow Association'. + * @see org.eclipse.bpmn2.MessageFlowAssociation + * @generated + */ + EClass getMessageFlowAssociation(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.MessageFlowAssociation#getInnerMessageFlowRef Inner Message Flow Ref}'. + * + * + * @return the meta object for the reference 'Inner Message Flow Ref'. + * @see org.eclipse.bpmn2.MessageFlowAssociation#getInnerMessageFlowRef() + * @see #getMessageFlowAssociation() + * @generated + */ + EReference getMessageFlowAssociation_InnerMessageFlowRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.MessageFlowAssociation#getOuterMessageFlowRef Outer Message Flow Ref}'. + * + * + * @return the meta object for the reference 'Outer Message Flow Ref'. + * @see org.eclipse.bpmn2.MessageFlowAssociation#getOuterMessageFlowRef() + * @see #getMessageFlowAssociation() + * @generated + */ + EReference getMessageFlowAssociation_OuterMessageFlowRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Monitoring Monitoring}'. + * + * + * @return the meta object for class 'Monitoring'. + * @see org.eclipse.bpmn2.Monitoring + * @generated + */ + EClass getMonitoring(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics Multi Instance Loop Characteristics}'. + * + * + * @return the meta object for class 'Multi Instance Loop Characteristics'. + * @see org.eclipse.bpmn2.MultiInstanceLoopCharacteristics + * @generated + */ + EClass getMultiInstanceLoopCharacteristics(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getLoopCardinality Loop Cardinality}'. + * + * + * @return the meta object for the containment reference 'Loop Cardinality'. + * @see org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getLoopCardinality() + * @see #getMultiInstanceLoopCharacteristics() + * @generated + */ + EReference getMultiInstanceLoopCharacteristics_LoopCardinality(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getLoopDataInputRef Loop Data Input Ref}'. + * + * + * @return the meta object for the reference 'Loop Data Input Ref'. + * @see org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getLoopDataInputRef() + * @see #getMultiInstanceLoopCharacteristics() + * @generated + */ + EReference getMultiInstanceLoopCharacteristics_LoopDataInputRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getLoopDataOutputRef Loop Data Output Ref}'. + * + * + * @return the meta object for the reference 'Loop Data Output Ref'. + * @see org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getLoopDataOutputRef() + * @see #getMultiInstanceLoopCharacteristics() + * @generated + */ + EReference getMultiInstanceLoopCharacteristics_LoopDataOutputRef(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getInputDataItem Input Data Item}'. + * + * + * @return the meta object for the containment reference 'Input Data Item'. + * @see org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getInputDataItem() + * @see #getMultiInstanceLoopCharacteristics() + * @generated + */ + EReference getMultiInstanceLoopCharacteristics_InputDataItem(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getOutputDataItem Output Data Item}'. + * + * + * @return the meta object for the containment reference 'Output Data Item'. + * @see org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getOutputDataItem() + * @see #getMultiInstanceLoopCharacteristics() + * @generated + */ + EReference getMultiInstanceLoopCharacteristics_OutputDataItem(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getComplexBehaviorDefinition Complex Behavior Definition}'. + * + * + * @return the meta object for the containment reference list 'Complex Behavior Definition'. + * @see org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getComplexBehaviorDefinition() + * @see #getMultiInstanceLoopCharacteristics() + * @generated + */ + EReference getMultiInstanceLoopCharacteristics_ComplexBehaviorDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getCompletionCondition Completion Condition}'. + * + * + * @return the meta object for the containment reference 'Completion Condition'. + * @see org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getCompletionCondition() + * @see #getMultiInstanceLoopCharacteristics() + * @generated + */ + EReference getMultiInstanceLoopCharacteristics_CompletionCondition(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getBehavior Behavior}'. + * + * + * @return the meta object for the attribute 'Behavior'. + * @see org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getBehavior() + * @see #getMultiInstanceLoopCharacteristics() + * @generated + */ + EAttribute getMultiInstanceLoopCharacteristics_Behavior(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#isIsSequential Is Sequential}'. + * + * + * @return the meta object for the attribute 'Is Sequential'. + * @see org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#isIsSequential() + * @see #getMultiInstanceLoopCharacteristics() + * @generated + */ + EAttribute getMultiInstanceLoopCharacteristics_IsSequential(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getNoneBehaviorEventRef None Behavior Event Ref}'. + * + * + * @return the meta object for the reference 'None Behavior Event Ref'. + * @see org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getNoneBehaviorEventRef() + * @see #getMultiInstanceLoopCharacteristics() + * @generated + */ + EReference getMultiInstanceLoopCharacteristics_NoneBehaviorEventRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getOneBehaviorEventRef One Behavior Event Ref}'. + * + * + * @return the meta object for the reference 'One Behavior Event Ref'. + * @see org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getOneBehaviorEventRef() + * @see #getMultiInstanceLoopCharacteristics() + * @generated + */ + EReference getMultiInstanceLoopCharacteristics_OneBehaviorEventRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Operation Operation}'. + * + * + * @return the meta object for class 'Operation'. + * @see org.eclipse.bpmn2.Operation + * @generated + */ + EClass getOperation(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Operation#getInMessageRef In Message Ref}'. + * + * + * @return the meta object for the reference 'In Message Ref'. + * @see org.eclipse.bpmn2.Operation#getInMessageRef() + * @see #getOperation() + * @generated + */ + EReference getOperation_InMessageRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Operation#getOutMessageRef Out Message Ref}'. + * + * + * @return the meta object for the reference 'Out Message Ref'. + * @see org.eclipse.bpmn2.Operation#getOutMessageRef() + * @see #getOperation() + * @generated + */ + EReference getOperation_OutMessageRef(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.Operation#getErrorRefs Error Refs}'. + * + * + * @return the meta object for the reference list 'Error Refs'. + * @see org.eclipse.bpmn2.Operation#getErrorRefs() + * @see #getOperation() + * @generated + */ + EReference getOperation_ErrorRefs(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Operation#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.Operation#getName() + * @see #getOperation() + * @generated + */ + EAttribute getOperation_Name(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Operation#getImplementationRef Implementation Ref}'. + * + * + * @return the meta object for the attribute 'Implementation Ref'. + * @see org.eclipse.bpmn2.Operation#getImplementationRef() + * @see #getOperation() + * @generated + */ + EAttribute getOperation_ImplementationRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.OutputSet Output Set}'. + * + * + * @return the meta object for class 'Output Set'. + * @see org.eclipse.bpmn2.OutputSet + * @generated + */ + EClass getOutputSet(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.OutputSet#getDataOutputRefs Data Output Refs}'. + * + * + * @return the meta object for the reference list 'Data Output Refs'. + * @see org.eclipse.bpmn2.OutputSet#getDataOutputRefs() + * @see #getOutputSet() + * @generated + */ + EReference getOutputSet_DataOutputRefs(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.OutputSet#getOptionalOutputRefs Optional Output Refs}'. + * + * + * @return the meta object for the reference list 'Optional Output Refs'. + * @see org.eclipse.bpmn2.OutputSet#getOptionalOutputRefs() + * @see #getOutputSet() + * @generated + */ + EReference getOutputSet_OptionalOutputRefs(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.OutputSet#getWhileExecutingOutputRefs While Executing Output Refs}'. + * + * + * @return the meta object for the reference list 'While Executing Output Refs'. + * @see org.eclipse.bpmn2.OutputSet#getWhileExecutingOutputRefs() + * @see #getOutputSet() + * @generated + */ + EReference getOutputSet_WhileExecutingOutputRefs(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.OutputSet#getInputSetRefs Input Set Refs}'. + * + * + * @return the meta object for the reference list 'Input Set Refs'. + * @see org.eclipse.bpmn2.OutputSet#getInputSetRefs() + * @see #getOutputSet() + * @generated + */ + EReference getOutputSet_InputSetRefs(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.OutputSet#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.OutputSet#getName() + * @see #getOutputSet() + * @generated + */ + EAttribute getOutputSet_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ParallelGateway Parallel Gateway}'. + * + * + * @return the meta object for class 'Parallel Gateway'. + * @see org.eclipse.bpmn2.ParallelGateway + * @generated + */ + EClass getParallelGateway(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Participant Participant}'. + * + * + * @return the meta object for class 'Participant'. + * @see org.eclipse.bpmn2.Participant + * @generated + */ + EClass getParticipant(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.Participant#getInterfaceRefs Interface Refs}'. + * + * + * @return the meta object for the reference list 'Interface Refs'. + * @see org.eclipse.bpmn2.Participant#getInterfaceRefs() + * @see #getParticipant() + * @generated + */ + EReference getParticipant_InterfaceRefs(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.Participant#getEndPointRefs End Point Refs}'. + * + * + * @return the meta object for the reference list 'End Point Refs'. + * @see org.eclipse.bpmn2.Participant#getEndPointRefs() + * @see #getParticipant() + * @generated + */ + EReference getParticipant_EndPointRefs(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.Participant#getParticipantMultiplicity Participant Multiplicity}'. + * + * + * @return the meta object for the containment reference 'Participant Multiplicity'. + * @see org.eclipse.bpmn2.Participant#getParticipantMultiplicity() + * @see #getParticipant() + * @generated + */ + EReference getParticipant_ParticipantMultiplicity(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Participant#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.Participant#getName() + * @see #getParticipant() + * @generated + */ + EAttribute getParticipant_Name(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Participant#getProcessRef Process Ref}'. + * + * + * @return the meta object for the reference 'Process Ref'. + * @see org.eclipse.bpmn2.Participant#getProcessRef() + * @see #getParticipant() + * @generated + */ + EReference getParticipant_ProcessRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ParticipantAssociation Participant Association}'. + * + * + * @return the meta object for class 'Participant Association'. + * @see org.eclipse.bpmn2.ParticipantAssociation + * @generated + */ + EClass getParticipantAssociation(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ParticipantAssociation#getInnerParticipantRef Inner Participant Ref}'. + * + * + * @return the meta object for the reference 'Inner Participant Ref'. + * @see org.eclipse.bpmn2.ParticipantAssociation#getInnerParticipantRef() + * @see #getParticipantAssociation() + * @generated + */ + EReference getParticipantAssociation_InnerParticipantRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ParticipantAssociation#getOuterParticipantRef Outer Participant Ref}'. + * + * + * @return the meta object for the reference 'Outer Participant Ref'. + * @see org.eclipse.bpmn2.ParticipantAssociation#getOuterParticipantRef() + * @see #getParticipantAssociation() + * @generated + */ + EReference getParticipantAssociation_OuterParticipantRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ParticipantMultiplicity Participant Multiplicity}'. + * + * + * @return the meta object for class 'Participant Multiplicity'. + * @see org.eclipse.bpmn2.ParticipantMultiplicity + * @generated + */ + EClass getParticipantMultiplicity(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ParticipantMultiplicity#getMaximum Maximum}'. + * + * + * @return the meta object for the attribute 'Maximum'. + * @see org.eclipse.bpmn2.ParticipantMultiplicity#getMaximum() + * @see #getParticipantMultiplicity() + * @generated + */ + EAttribute getParticipantMultiplicity_Maximum(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ParticipantMultiplicity#getMinimum Minimum}'. + * + * + * @return the meta object for the attribute 'Minimum'. + * @see org.eclipse.bpmn2.ParticipantMultiplicity#getMinimum() + * @see #getParticipantMultiplicity() + * @generated + */ + EAttribute getParticipantMultiplicity_Minimum(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.PartnerEntity Partner Entity}'. + * + * + * @return the meta object for class 'Partner Entity'. + * @see org.eclipse.bpmn2.PartnerEntity + * @generated + */ + EClass getPartnerEntity(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.PartnerEntity#getParticipantRef Participant Ref}'. + * + * + * @return the meta object for the reference list 'Participant Ref'. + * @see org.eclipse.bpmn2.PartnerEntity#getParticipantRef() + * @see #getPartnerEntity() + * @generated + */ + EReference getPartnerEntity_ParticipantRef(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.PartnerEntity#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.PartnerEntity#getName() + * @see #getPartnerEntity() + * @generated + */ + EAttribute getPartnerEntity_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.PartnerRole Partner Role}'. + * + * + * @return the meta object for class 'Partner Role'. + * @see org.eclipse.bpmn2.PartnerRole + * @generated + */ + EClass getPartnerRole(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.PartnerRole#getParticipantRef Participant Ref}'. + * + * + * @return the meta object for the reference list 'Participant Ref'. + * @see org.eclipse.bpmn2.PartnerRole#getParticipantRef() + * @see #getPartnerRole() + * @generated + */ + EReference getPartnerRole_ParticipantRef(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.PartnerRole#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.PartnerRole#getName() + * @see #getPartnerRole() + * @generated + */ + EAttribute getPartnerRole_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Performer Performer}'. + * + * + * @return the meta object for class 'Performer'. + * @see org.eclipse.bpmn2.Performer + * @generated + */ + EClass getPerformer(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.PotentialOwner Potential Owner}'. + * + * + * @return the meta object for class 'Potential Owner'. + * @see org.eclipse.bpmn2.PotentialOwner + * @generated + */ + EClass getPotentialOwner(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Process Process}'. + * + * + * @return the meta object for class 'Process'. + * @see org.eclipse.bpmn2.Process + * @generated + */ + EClass getProcess(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.Process#getAuditing Auditing}'. + * + * + * @return the meta object for the containment reference 'Auditing'. + * @see org.eclipse.bpmn2.Process#getAuditing() + * @see #getProcess() + * @generated + */ + EReference getProcess_Auditing(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.Process#getMonitoring Monitoring}'. + * + * + * @return the meta object for the containment reference 'Monitoring'. + * @see org.eclipse.bpmn2.Process#getMonitoring() + * @see #getProcess() + * @generated + */ + EReference getProcess_Monitoring(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Process#getProperties Properties}'. + * + * + * @return the meta object for the containment reference list 'Properties'. + * @see org.eclipse.bpmn2.Process#getProperties() + * @see #getProcess() + * @generated + */ + EReference getProcess_Properties(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Process#getArtifacts Artifacts}'. + * + * + * @return the meta object for the containment reference list 'Artifacts'. + * @see org.eclipse.bpmn2.Process#getArtifacts() + * @see #getProcess() + * @generated + */ + EReference getProcess_Artifacts(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Process#getResources Resources}'. + * + * + * @return the meta object for the containment reference list 'Resources'. + * @see org.eclipse.bpmn2.Process#getResources() + * @see #getProcess() + * @generated + */ + EReference getProcess_Resources(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Process#getCorrelationSubscriptions Correlation Subscriptions}'. + * + * + * @return the meta object for the containment reference list 'Correlation Subscriptions'. + * @see org.eclipse.bpmn2.Process#getCorrelationSubscriptions() + * @see #getProcess() + * @generated + */ + EReference getProcess_CorrelationSubscriptions(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.Process#getSupports Supports}'. + * + * + * @return the meta object for the reference list 'Supports'. + * @see org.eclipse.bpmn2.Process#getSupports() + * @see #getProcess() + * @generated + */ + EReference getProcess_Supports(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Process#getDefinitionalCollaborationRef Definitional Collaboration Ref}'. + * + * + * @return the meta object for the reference 'Definitional Collaboration Ref'. + * @see org.eclipse.bpmn2.Process#getDefinitionalCollaborationRef() + * @see #getProcess() + * @generated + */ + EReference getProcess_DefinitionalCollaborationRef(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Process#isIsClosed Is Closed}'. + * + * + * @return the meta object for the attribute 'Is Closed'. + * @see org.eclipse.bpmn2.Process#isIsClosed() + * @see #getProcess() + * @generated + */ + EAttribute getProcess_IsClosed(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Process#isIsExecutable Is Executable}'. + * + * + * @return the meta object for the attribute 'Is Executable'. + * @see org.eclipse.bpmn2.Process#isIsExecutable() + * @see #getProcess() + * @generated + */ + EAttribute getProcess_IsExecutable(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Process#getProcessType Process Type}'. + * + * + * @return the meta object for the attribute 'Process Type'. + * @see org.eclipse.bpmn2.Process#getProcessType() + * @see #getProcess() + * @generated + */ + EAttribute getProcess_ProcessType(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Property Property}'. + * + * + * @return the meta object for class 'Property'. + * @see org.eclipse.bpmn2.Property + * @generated + */ + EClass getProperty(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Property#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.Property#getName() + * @see #getProperty() + * @generated + */ + EAttribute getProperty_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ReceiveTask Receive Task}'. + * + * + * @return the meta object for class 'Receive Task'. + * @see org.eclipse.bpmn2.ReceiveTask + * @generated + */ + EClass getReceiveTask(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ReceiveTask#getImplementation Implementation}'. + * + * + * @return the meta object for the attribute 'Implementation'. + * @see org.eclipse.bpmn2.ReceiveTask#getImplementation() + * @see #getReceiveTask() + * @generated + */ + EAttribute getReceiveTask_Implementation(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ReceiveTask#isInstantiate Instantiate}'. + * + * + * @return the meta object for the attribute 'Instantiate'. + * @see org.eclipse.bpmn2.ReceiveTask#isInstantiate() + * @see #getReceiveTask() + * @generated + */ + EAttribute getReceiveTask_Instantiate(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ReceiveTask#getMessageRef Message Ref}'. + * + * + * @return the meta object for the reference 'Message Ref'. + * @see org.eclipse.bpmn2.ReceiveTask#getMessageRef() + * @see #getReceiveTask() + * @generated + */ + EReference getReceiveTask_MessageRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ReceiveTask#getOperationRef Operation Ref}'. + * + * + * @return the meta object for the reference 'Operation Ref'. + * @see org.eclipse.bpmn2.ReceiveTask#getOperationRef() + * @see #getReceiveTask() + * @generated + */ + EReference getReceiveTask_OperationRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Relationship Relationship}'. + * + * + * @return the meta object for class 'Relationship'. + * @see org.eclipse.bpmn2.Relationship + * @generated + */ + EClass getRelationship(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.Relationship#getSources Sources}'. + * + * + * @return the meta object for the reference list 'Sources'. + * @see org.eclipse.bpmn2.Relationship#getSources() + * @see #getRelationship() + * @generated + */ + EReference getRelationship_Sources(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.Relationship#getTargets Targets}'. + * + * + * @return the meta object for the reference list 'Targets'. + * @see org.eclipse.bpmn2.Relationship#getTargets() + * @see #getRelationship() + * @generated + */ + EReference getRelationship_Targets(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Relationship#getDirection Direction}'. + * + * + * @return the meta object for the attribute 'Direction'. + * @see org.eclipse.bpmn2.Relationship#getDirection() + * @see #getRelationship() + * @generated + */ + EAttribute getRelationship_Direction(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Relationship#getType Type}'. + * + * + * @return the meta object for the attribute 'Type'. + * @see org.eclipse.bpmn2.Relationship#getType() + * @see #getRelationship() + * @generated + */ + EAttribute getRelationship_Type(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Rendering Rendering}'. + * + * + * @return the meta object for class 'Rendering'. + * @see org.eclipse.bpmn2.Rendering + * @generated + */ + EClass getRendering(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Resource Resource}'. + * + * + * @return the meta object for class 'Resource'. + * @see org.eclipse.bpmn2.Resource + * @generated + */ + EClass getResource(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.Resource#getResourceParameters Resource Parameters}'. + * + * + * @return the meta object for the containment reference list 'Resource Parameters'. + * @see org.eclipse.bpmn2.Resource#getResourceParameters() + * @see #getResource() + * @generated + */ + EReference getResource_ResourceParameters(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Resource#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.Resource#getName() + * @see #getResource() + * @generated + */ + EAttribute getResource_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ResourceAssignmentExpression Resource Assignment Expression}'. + * + * + * @return the meta object for class 'Resource Assignment Expression'. + * @see org.eclipse.bpmn2.ResourceAssignmentExpression + * @generated + */ + EClass getResourceAssignmentExpression(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.ResourceAssignmentExpression#getExpression Expression}'. + * + * + * @return the meta object for the containment reference 'Expression'. + * @see org.eclipse.bpmn2.ResourceAssignmentExpression#getExpression() + * @see #getResourceAssignmentExpression() + * @generated + */ + EReference getResourceAssignmentExpression_Expression(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ResourceParameter Resource Parameter}'. + * + * + * @return the meta object for class 'Resource Parameter'. + * @see org.eclipse.bpmn2.ResourceParameter + * @generated + */ + EClass getResourceParameter(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ResourceParameter#isIsRequired Is Required}'. + * + * + * @return the meta object for the attribute 'Is Required'. + * @see org.eclipse.bpmn2.ResourceParameter#isIsRequired() + * @see #getResourceParameter() + * @generated + */ + EAttribute getResourceParameter_IsRequired(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ResourceParameter#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.ResourceParameter#getName() + * @see #getResourceParameter() + * @generated + */ + EAttribute getResourceParameter_Name(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ResourceParameter#getType Type}'. + * + * + * @return the meta object for the reference 'Type'. + * @see org.eclipse.bpmn2.ResourceParameter#getType() + * @see #getResourceParameter() + * @generated + */ + EReference getResourceParameter_Type(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ResourceParameterBinding Resource Parameter Binding}'. + * + * + * @return the meta object for class 'Resource Parameter Binding'. + * @see org.eclipse.bpmn2.ResourceParameterBinding + * @generated + */ + EClass getResourceParameterBinding(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.ResourceParameterBinding#getExpression Expression}'. + * + * + * @return the meta object for the containment reference 'Expression'. + * @see org.eclipse.bpmn2.ResourceParameterBinding#getExpression() + * @see #getResourceParameterBinding() + * @generated + */ + EReference getResourceParameterBinding_Expression(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ResourceParameterBinding#getParameterRef Parameter Ref}'. + * + * + * @return the meta object for the reference 'Parameter Ref'. + * @see org.eclipse.bpmn2.ResourceParameterBinding#getParameterRef() + * @see #getResourceParameterBinding() + * @generated + */ + EReference getResourceParameterBinding_ParameterRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ResourceRole Resource Role}'. + * + * + * @return the meta object for class 'Resource Role'. + * @see org.eclipse.bpmn2.ResourceRole + * @generated + */ + EClass getResourceRole(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ResourceRole#getResourceRef Resource Ref}'. + * + * + * @return the meta object for the reference 'Resource Ref'. + * @see org.eclipse.bpmn2.ResourceRole#getResourceRef() + * @see #getResourceRole() + * @generated + */ + EReference getResourceRole_ResourceRef(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.ResourceRole#getResourceParameterBindings Resource Parameter Bindings}'. + * + * + * @return the meta object for the containment reference list 'Resource Parameter Bindings'. + * @see org.eclipse.bpmn2.ResourceRole#getResourceParameterBindings() + * @see #getResourceRole() + * @generated + */ + EReference getResourceRole_ResourceParameterBindings(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.ResourceRole#getResourceAssignmentExpression Resource Assignment Expression}'. + * + * + * @return the meta object for the containment reference 'Resource Assignment Expression'. + * @see org.eclipse.bpmn2.ResourceRole#getResourceAssignmentExpression() + * @see #getResourceRole() + * @generated + */ + EReference getResourceRole_ResourceAssignmentExpression(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ResourceRole#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.ResourceRole#getName() + * @see #getResourceRole() + * @generated + */ + EAttribute getResourceRole_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.RootElement Root Element}'. + * + * + * @return the meta object for class 'Root Element'. + * @see org.eclipse.bpmn2.RootElement + * @generated + */ + EClass getRootElement(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ScriptTask Script Task}'. + * + * + * @return the meta object for class 'Script Task'. + * @see org.eclipse.bpmn2.ScriptTask + * @generated + */ + EClass getScriptTask(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ScriptTask#getScript Script}'. + * + * + * @return the meta object for the attribute 'Script'. + * @see org.eclipse.bpmn2.ScriptTask#getScript() + * @see #getScriptTask() + * @generated + */ + EAttribute getScriptTask_Script(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ScriptTask#getScriptFormat Script Format}'. + * + * + * @return the meta object for the attribute 'Script Format'. + * @see org.eclipse.bpmn2.ScriptTask#getScriptFormat() + * @see #getScriptTask() + * @generated + */ + EAttribute getScriptTask_ScriptFormat(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.SendTask Send Task}'. + * + * + * @return the meta object for class 'Send Task'. + * @see org.eclipse.bpmn2.SendTask + * @generated + */ + EClass getSendTask(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.SendTask#getImplementation Implementation}'. + * + * + * @return the meta object for the attribute 'Implementation'. + * @see org.eclipse.bpmn2.SendTask#getImplementation() + * @see #getSendTask() + * @generated + */ + EAttribute getSendTask_Implementation(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.SendTask#getMessageRef Message Ref}'. + * + * + * @return the meta object for the reference 'Message Ref'. + * @see org.eclipse.bpmn2.SendTask#getMessageRef() + * @see #getSendTask() + * @generated + */ + EReference getSendTask_MessageRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.SendTask#getOperationRef Operation Ref}'. + * + * + * @return the meta object for the reference 'Operation Ref'. + * @see org.eclipse.bpmn2.SendTask#getOperationRef() + * @see #getSendTask() + * @generated + */ + EReference getSendTask_OperationRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.SequenceFlow Sequence Flow}'. + * + * + * @return the meta object for class 'Sequence Flow'. + * @see org.eclipse.bpmn2.SequenceFlow + * @generated + */ + EClass getSequenceFlow(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.SequenceFlow#getConditionExpression Condition Expression}'. + * + * + * @return the meta object for the containment reference 'Condition Expression'. + * @see org.eclipse.bpmn2.SequenceFlow#getConditionExpression() + * @see #getSequenceFlow() + * @generated + */ + EReference getSequenceFlow_ConditionExpression(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.SequenceFlow#isIsImmediate Is Immediate}'. + * + * + * @return the meta object for the attribute 'Is Immediate'. + * @see org.eclipse.bpmn2.SequenceFlow#isIsImmediate() + * @see #getSequenceFlow() + * @generated + */ + EAttribute getSequenceFlow_IsImmediate(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.SequenceFlow#getSourceRef Source Ref}'. + * + * + * @return the meta object for the reference 'Source Ref'. + * @see org.eclipse.bpmn2.SequenceFlow#getSourceRef() + * @see #getSequenceFlow() + * @generated + */ + EReference getSequenceFlow_SourceRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.SequenceFlow#getTargetRef Target Ref}'. + * + * + * @return the meta object for the reference 'Target Ref'. + * @see org.eclipse.bpmn2.SequenceFlow#getTargetRef() + * @see #getSequenceFlow() + * @generated + */ + EReference getSequenceFlow_TargetRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ServiceTask Service Task}'. + * + * + * @return the meta object for class 'Service Task'. + * @see org.eclipse.bpmn2.ServiceTask + * @generated + */ + EClass getServiceTask(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.ServiceTask#getImplementation Implementation}'. + * + * + * @return the meta object for the attribute 'Implementation'. + * @see org.eclipse.bpmn2.ServiceTask#getImplementation() + * @see #getServiceTask() + * @generated + */ + EAttribute getServiceTask_Implementation(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ServiceTask#getOperationRef Operation Ref}'. + * + * + * @return the meta object for the reference 'Operation Ref'. + * @see org.eclipse.bpmn2.ServiceTask#getOperationRef() + * @see #getServiceTask() + * @generated + */ + EReference getServiceTask_OperationRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Signal Signal}'. + * + * + * @return the meta object for class 'Signal'. + * @see org.eclipse.bpmn2.Signal + * @generated + */ + EClass getSignal(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Signal#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.bpmn2.Signal#getName() + * @see #getSignal() + * @generated + */ + EAttribute getSignal_Name(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Signal#getStructureRef Structure Ref}'. + * + * + * @return the meta object for the reference 'Structure Ref'. + * @see org.eclipse.bpmn2.Signal#getStructureRef() + * @see #getSignal() + * @generated + */ + EReference getSignal_StructureRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.SignalEventDefinition Signal Event Definition}'. + * + * + * @return the meta object for class 'Signal Event Definition'. + * @see org.eclipse.bpmn2.SignalEventDefinition + * @generated + */ + EClass getSignalEventDefinition(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.SignalEventDefinition#getSignalRef Signal Ref}'. + * + * + * @return the meta object for the attribute 'Signal Ref'. + * @see org.eclipse.bpmn2.SignalEventDefinition#getSignalRef() + * @see #getSignalEventDefinition() + * @generated + */ + EAttribute getSignalEventDefinition_SignalRef(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.StandardLoopCharacteristics Standard Loop Characteristics}'. + * + * + * @return the meta object for class 'Standard Loop Characteristics'. + * @see org.eclipse.bpmn2.StandardLoopCharacteristics + * @generated + */ + EClass getStandardLoopCharacteristics(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.StandardLoopCharacteristics#getLoopCondition Loop Condition}'. + * + * + * @return the meta object for the containment reference 'Loop Condition'. + * @see org.eclipse.bpmn2.StandardLoopCharacteristics#getLoopCondition() + * @see #getStandardLoopCharacteristics() + * @generated + */ + EReference getStandardLoopCharacteristics_LoopCondition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.StandardLoopCharacteristics#getLoopMaximum Loop Maximum}'. + * + * + * @return the meta object for the containment reference 'Loop Maximum'. + * @see org.eclipse.bpmn2.StandardLoopCharacteristics#getLoopMaximum() + * @see #getStandardLoopCharacteristics() + * @generated + */ + EReference getStandardLoopCharacteristics_LoopMaximum(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.StandardLoopCharacteristics#isTestBefore Test Before}'. + * + * + * @return the meta object for the attribute 'Test Before'. + * @see org.eclipse.bpmn2.StandardLoopCharacteristics#isTestBefore() + * @see #getStandardLoopCharacteristics() + * @generated + */ + EAttribute getStandardLoopCharacteristics_TestBefore(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.StartEvent Start Event}'. + * + * + * @return the meta object for class 'Start Event'. + * @see org.eclipse.bpmn2.StartEvent + * @generated + */ + EClass getStartEvent(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.StartEvent#isIsInterrupting Is Interrupting}'. + * + * + * @return the meta object for the attribute 'Is Interrupting'. + * @see org.eclipse.bpmn2.StartEvent#isIsInterrupting() + * @see #getStartEvent() + * @generated + */ + EAttribute getStartEvent_IsInterrupting(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.SubChoreography Sub Choreography}'. + * + * + * @return the meta object for class 'Sub Choreography'. + * @see org.eclipse.bpmn2.SubChoreography + * @generated + */ + EClass getSubChoreography(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.SubChoreography#getArtifacts Artifacts}'. + * + * + * @return the meta object for the containment reference list 'Artifacts'. + * @see org.eclipse.bpmn2.SubChoreography#getArtifacts() + * @see #getSubChoreography() + * @generated + */ + EReference getSubChoreography_Artifacts(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.SubConversation Sub Conversation}'. + * + * + * @return the meta object for class 'Sub Conversation'. + * @see org.eclipse.bpmn2.SubConversation + * @generated + */ + EClass getSubConversation(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.SubConversation#getConversationNodes Conversation Nodes}'. + * + * + * @return the meta object for the containment reference list 'Conversation Nodes'. + * @see org.eclipse.bpmn2.SubConversation#getConversationNodes() + * @see #getSubConversation() + * @generated + */ + EReference getSubConversation_ConversationNodes(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.SubProcess Sub Process}'. + * + * + * @return the meta object for class 'Sub Process'. + * @see org.eclipse.bpmn2.SubProcess + * @generated + */ + EClass getSubProcess(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.SubProcess#getArtifacts Artifacts}'. + * + * + * @return the meta object for the containment reference list 'Artifacts'. + * @see org.eclipse.bpmn2.SubProcess#getArtifacts() + * @see #getSubProcess() + * @generated + */ + EReference getSubProcess_Artifacts(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.SubProcess#isTriggeredByEvent Triggered By Event}'. + * + * + * @return the meta object for the attribute 'Triggered By Event'. + * @see org.eclipse.bpmn2.SubProcess#isTriggeredByEvent() + * @see #getSubProcess() + * @generated + */ + EAttribute getSubProcess_TriggeredByEvent(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Task Task}'. + * + * + * @return the meta object for class 'Task'. + * @see org.eclipse.bpmn2.Task + * @generated + */ + EClass getTask(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.TerminateEventDefinition Terminate Event Definition}'. + * + * + * @return the meta object for class 'Terminate Event Definition'. + * @see org.eclipse.bpmn2.TerminateEventDefinition + * @generated + */ + EClass getTerminateEventDefinition(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.TextAnnotation Text Annotation}'. + * + * + * @return the meta object for class 'Text Annotation'. + * @see org.eclipse.bpmn2.TextAnnotation + * @generated + */ + EClass getTextAnnotation(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.TextAnnotation#getText Text}'. + * + * + * @return the meta object for the attribute 'Text'. + * @see org.eclipse.bpmn2.TextAnnotation#getText() + * @see #getTextAnnotation() + * @generated + */ + EAttribute getTextAnnotation_Text(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.TextAnnotation#getTextFormat Text Format}'. + * + * + * @return the meta object for the attribute 'Text Format'. + * @see org.eclipse.bpmn2.TextAnnotation#getTextFormat() + * @see #getTextAnnotation() + * @generated + */ + EAttribute getTextAnnotation_TextFormat(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.ThrowEvent Throw Event}'. + * + * + * @return the meta object for class 'Throw Event'. + * @see org.eclipse.bpmn2.ThrowEvent + * @generated + */ + EClass getThrowEvent(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.ThrowEvent#getDataInputs Data Inputs}'. + * + * + * @return the meta object for the containment reference list 'Data Inputs'. + * @see org.eclipse.bpmn2.ThrowEvent#getDataInputs() + * @see #getThrowEvent() + * @generated + */ + EReference getThrowEvent_DataInputs(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.ThrowEvent#getDataInputAssociation Data Input Association}'. + * + * + * @return the meta object for the containment reference list 'Data Input Association'. + * @see org.eclipse.bpmn2.ThrowEvent#getDataInputAssociation() + * @see #getThrowEvent() + * @generated + */ + EReference getThrowEvent_DataInputAssociation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.ThrowEvent#getInputSet Input Set}'. + * + * + * @return the meta object for the containment reference 'Input Set'. + * @see org.eclipse.bpmn2.ThrowEvent#getInputSet() + * @see #getThrowEvent() + * @generated + */ + EReference getThrowEvent_InputSet(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.ThrowEvent#getEventDefinitions Event Definitions}'. + * + * + * @return the meta object for the containment reference list 'Event Definitions'. + * @see org.eclipse.bpmn2.ThrowEvent#getEventDefinitions() + * @see #getThrowEvent() + * @generated + */ + EReference getThrowEvent_EventDefinitions(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.bpmn2.ThrowEvent#getEventDefinitionRefs Event Definition Refs}'. + * + * + * @return the meta object for the reference list 'Event Definition Refs'. + * @see org.eclipse.bpmn2.ThrowEvent#getEventDefinitionRefs() + * @see #getThrowEvent() + * @generated + */ + EReference getThrowEvent_EventDefinitionRefs(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.TimerEventDefinition Timer Event Definition}'. + * + * + * @return the meta object for class 'Timer Event Definition'. + * @see org.eclipse.bpmn2.TimerEventDefinition + * @generated + */ + EClass getTimerEventDefinition(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.TimerEventDefinition#getTimeDate Time Date}'. + * + * + * @return the meta object for the containment reference 'Time Date'. + * @see org.eclipse.bpmn2.TimerEventDefinition#getTimeDate() + * @see #getTimerEventDefinition() + * @generated + */ + EReference getTimerEventDefinition_TimeDate(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.TimerEventDefinition#getTimeDuration Time Duration}'. + * + * + * @return the meta object for the containment reference 'Time Duration'. + * @see org.eclipse.bpmn2.TimerEventDefinition#getTimeDuration() + * @see #getTimerEventDefinition() + * @generated + */ + EReference getTimerEventDefinition_TimeDuration(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.TimerEventDefinition#getTimeCycle Time Cycle}'. + * + * + * @return the meta object for the containment reference 'Time Cycle'. + * @see org.eclipse.bpmn2.TimerEventDefinition#getTimeCycle() + * @see #getTimerEventDefinition() + * @generated + */ + EReference getTimerEventDefinition_TimeCycle(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.Transaction Transaction}'. + * + * + * @return the meta object for class 'Transaction'. + * @see org.eclipse.bpmn2.Transaction + * @generated + */ + EClass getTransaction(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Transaction#getProtocol Protocol}'. + * + * + * @return the meta object for the attribute 'Protocol'. + * @see org.eclipse.bpmn2.Transaction#getProtocol() + * @see #getTransaction() + * @generated + */ + EAttribute getTransaction_Protocol(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.Transaction#getMethod Method}'. + * + * + * @return the meta object for the attribute 'Method'. + * @see org.eclipse.bpmn2.Transaction#getMethod() + * @see #getTransaction() + * @generated + */ + EAttribute getTransaction_Method(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.UserTask User Task}'. + * + * + * @return the meta object for class 'User Task'. + * @see org.eclipse.bpmn2.UserTask + * @generated + */ + EClass getUserTask(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.UserTask#getRenderings Renderings}'. + * + * + * @return the meta object for the containment reference list 'Renderings'. + * @see org.eclipse.bpmn2.UserTask#getRenderings() + * @see #getUserTask() + * @generated + */ + EReference getUserTask_Renderings(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.UserTask#getImplementation Implementation}'. + * + * + * @return the meta object for the attribute 'Implementation'. + * @see org.eclipse.bpmn2.UserTask#getImplementation() + * @see #getUserTask() + * @generated + */ + EAttribute getUserTask_Implementation(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.EventSubprocess Event Subprocess}'. + * + * + * @return the meta object for class 'Event Subprocess'. + * @see org.eclipse.bpmn2.EventSubprocess + * @generated + */ + EClass getEventSubprocess(); + + /** + * Returns the meta object for enum '{@link org.eclipse.bpmn2.AdHocOrdering Ad Hoc Ordering}'. + * + * + * @return the meta object for enum 'Ad Hoc Ordering'. + * @see org.eclipse.bpmn2.AdHocOrdering + * @generated + */ + EEnum getAdHocOrdering(); + + /** + * Returns the meta object for enum '{@link org.eclipse.bpmn2.AssociationDirection Association Direction}'. + * + * + * @return the meta object for enum 'Association Direction'. + * @see org.eclipse.bpmn2.AssociationDirection + * @generated + */ + EEnum getAssociationDirection(); + + /** + * Returns the meta object for enum '{@link org.eclipse.bpmn2.ChoreographyLoopType Choreography Loop Type}'. + * + * + * @return the meta object for enum 'Choreography Loop Type'. + * @see org.eclipse.bpmn2.ChoreographyLoopType + * @generated + */ + EEnum getChoreographyLoopType(); + + /** + * Returns the meta object for enum '{@link org.eclipse.bpmn2.EventBasedGatewayType Event Based Gateway Type}'. + * + * + * @return the meta object for enum 'Event Based Gateway Type'. + * @see org.eclipse.bpmn2.EventBasedGatewayType + * @generated + */ + EEnum getEventBasedGatewayType(); + + /** + * Returns the meta object for enum '{@link org.eclipse.bpmn2.GatewayDirection Gateway Direction}'. + * + * + * @return the meta object for enum 'Gateway Direction'. + * @see org.eclipse.bpmn2.GatewayDirection + * @generated + */ + EEnum getGatewayDirection(); + + /** + * Returns the meta object for enum '{@link org.eclipse.bpmn2.ItemKind Item Kind}'. + * + * + * @return the meta object for enum 'Item Kind'. + * @see org.eclipse.bpmn2.ItemKind + * @generated + */ + EEnum getItemKind(); + + /** + * Returns the meta object for enum '{@link org.eclipse.bpmn2.MultiInstanceBehavior Multi Instance Behavior}'. + * + * + * @return the meta object for enum 'Multi Instance Behavior'. + * @see org.eclipse.bpmn2.MultiInstanceBehavior + * @generated + */ + EEnum getMultiInstanceBehavior(); + + /** + * Returns the meta object for enum '{@link org.eclipse.bpmn2.ProcessType Process Type}'. + * + * + * @return the meta object for enum 'Process Type'. + * @see org.eclipse.bpmn2.ProcessType + * @generated + */ + EEnum getProcessType(); + + /** + * Returns the meta object for enum '{@link org.eclipse.bpmn2.RelationshipDirection Relationship Direction}'. + * + * + * @return the meta object for enum 'Relationship Direction'. + * @see org.eclipse.bpmn2.RelationshipDirection + * @generated + */ + EEnum getRelationshipDirection(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + Bpmn2Factory getBpmn2Factory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.DocumentRootImpl Document Root}' class. + * + * + * @see org.eclipse.bpmn2.impl.DocumentRootImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDocumentRoot() + * @generated + */ + EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot(); + + /** + * The meta object literal for the 'Mixed' attribute list feature. + * + * + * @generated + */ + EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed(); + + /** + * The meta object literal for the 'XMLNS Prefix Map' map feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap(); + + /** + * The meta object literal for the 'XSI Schema Location' map feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation(); + + /** + * The meta object literal for the 'Activity' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__ACTIVITY = eINSTANCE.getDocumentRoot_Activity(); + + /** + * The meta object literal for the 'Ad Hoc Sub Process' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__AD_HOC_SUB_PROCESS = eINSTANCE.getDocumentRoot_AdHocSubProcess(); + + /** + * The meta object literal for the 'Flow Element' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__FLOW_ELEMENT = eINSTANCE.getDocumentRoot_FlowElement(); + + /** + * The meta object literal for the 'Artifact' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__ARTIFACT = eINSTANCE.getDocumentRoot_Artifact(); + + /** + * The meta object literal for the 'Assignment' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__ASSIGNMENT = eINSTANCE.getDocumentRoot_Assignment(); + + /** + * The meta object literal for the 'Association' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__ASSOCIATION = eINSTANCE.getDocumentRoot_Association(); + + /** + * The meta object literal for the 'Auditing' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__AUDITING = eINSTANCE.getDocumentRoot_Auditing(); + + /** + * The meta object literal for the 'Base Element' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BASE_ELEMENT = eINSTANCE.getDocumentRoot_BaseElement(); + + /** + * The meta object literal for the 'Base Element With Mixed Content' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BASE_ELEMENT_WITH_MIXED_CONTENT = eINSTANCE + .getDocumentRoot_BaseElementWithMixedContent(); + + /** + * The meta object literal for the 'Boundary Event' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BOUNDARY_EVENT = eINSTANCE.getDocumentRoot_BoundaryEvent(); + + /** + * The meta object literal for the 'Business Rule Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BUSINESS_RULE_TASK = eINSTANCE.getDocumentRoot_BusinessRuleTask(); + + /** + * The meta object literal for the 'Callable Element' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CALLABLE_ELEMENT = eINSTANCE.getDocumentRoot_CallableElement(); + + /** + * The meta object literal for the 'Call Activity' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CALL_ACTIVITY = eINSTANCE.getDocumentRoot_CallActivity(); + + /** + * The meta object literal for the 'Call Choreography' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CALL_CHOREOGRAPHY = eINSTANCE.getDocumentRoot_CallChoreography(); + + /** + * The meta object literal for the 'Call Conversation' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CALL_CONVERSATION = eINSTANCE.getDocumentRoot_CallConversation(); + + /** + * The meta object literal for the 'Conversation Node' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CONVERSATION_NODE = eINSTANCE.getDocumentRoot_ConversationNode(); + + /** + * The meta object literal for the 'Cancel Event Definition' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CANCEL_EVENT_DEFINITION = eINSTANCE.getDocumentRoot_CancelEventDefinition(); + + /** + * The meta object literal for the 'Event Definition' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__EVENT_DEFINITION = eINSTANCE.getDocumentRoot_EventDefinition(); + + /** + * The meta object literal for the 'Root Element' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__ROOT_ELEMENT = eINSTANCE.getDocumentRoot_RootElement(); + + /** + * The meta object literal for the 'Catch Event' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CATCH_EVENT = eINSTANCE.getDocumentRoot_CatchEvent(); + + /** + * The meta object literal for the 'Category' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CATEGORY = eINSTANCE.getDocumentRoot_Category(); + + /** + * The meta object literal for the 'Category Value' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CATEGORY_VALUE = eINSTANCE.getDocumentRoot_CategoryValue(); + + /** + * The meta object literal for the 'Choreography' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CHOREOGRAPHY = eINSTANCE.getDocumentRoot_Choreography(); + + /** + * The meta object literal for the 'Collaboration' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__COLLABORATION = eINSTANCE.getDocumentRoot_Collaboration(); + + /** + * The meta object literal for the 'Choreography Activity' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CHOREOGRAPHY_ACTIVITY = eINSTANCE.getDocumentRoot_ChoreographyActivity(); + + /** + * The meta object literal for the 'Choreography Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CHOREOGRAPHY_TASK = eINSTANCE.getDocumentRoot_ChoreographyTask(); + + /** + * The meta object literal for the 'Compensate Event Definition' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__COMPENSATE_EVENT_DEFINITION = eINSTANCE.getDocumentRoot_CompensateEventDefinition(); + + /** + * The meta object literal for the 'Complex Behavior Definition' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__COMPLEX_BEHAVIOR_DEFINITION = eINSTANCE.getDocumentRoot_ComplexBehaviorDefinition(); + + /** + * The meta object literal for the 'Complex Gateway' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__COMPLEX_GATEWAY = eINSTANCE.getDocumentRoot_ComplexGateway(); + + /** + * The meta object literal for the 'Conditional Event Definition' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CONDITIONAL_EVENT_DEFINITION = eINSTANCE.getDocumentRoot_ConditionalEventDefinition(); + + /** + * The meta object literal for the 'Conversation' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CONVERSATION = eINSTANCE.getDocumentRoot_Conversation(); + + /** + * The meta object literal for the 'Conversation Association' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CONVERSATION_ASSOCIATION = eINSTANCE.getDocumentRoot_ConversationAssociation(); + + /** + * The meta object literal for the 'Conversation Link' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CONVERSATION_LINK = eINSTANCE.getDocumentRoot_ConversationLink(); + + /** + * The meta object literal for the 'Correlation Key' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CORRELATION_KEY = eINSTANCE.getDocumentRoot_CorrelationKey(); + + /** + * The meta object literal for the 'Correlation Property' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CORRELATION_PROPERTY = eINSTANCE.getDocumentRoot_CorrelationProperty(); + + /** + * The meta object literal for the 'Correlation Property Binding' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CORRELATION_PROPERTY_BINDING = eINSTANCE.getDocumentRoot_CorrelationPropertyBinding(); + + /** + * The meta object literal for the 'Correlation Property Retrieval Expression' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION = eINSTANCE + .getDocumentRoot_CorrelationPropertyRetrievalExpression(); + + /** + * The meta object literal for the 'Correlation Subscription' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__CORRELATION_SUBSCRIPTION = eINSTANCE.getDocumentRoot_CorrelationSubscription(); + + /** + * The meta object literal for the 'Data Association' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DATA_ASSOCIATION = eINSTANCE.getDocumentRoot_DataAssociation(); + + /** + * The meta object literal for the 'Data Input' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DATA_INPUT = eINSTANCE.getDocumentRoot_DataInput(); + + /** + * The meta object literal for the 'Data Input Association' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DATA_INPUT_ASSOCIATION = eINSTANCE.getDocumentRoot_DataInputAssociation(); + + /** + * The meta object literal for the 'Data Object' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DATA_OBJECT = eINSTANCE.getDocumentRoot_DataObject(); + + /** + * The meta object literal for the 'Data Object Reference' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DATA_OBJECT_REFERENCE = eINSTANCE.getDocumentRoot_DataObjectReference(); + + /** + * The meta object literal for the 'Data Output' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DATA_OUTPUT = eINSTANCE.getDocumentRoot_DataOutput(); + + /** + * The meta object literal for the 'Data Output Association' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DATA_OUTPUT_ASSOCIATION = eINSTANCE.getDocumentRoot_DataOutputAssociation(); + + /** + * The meta object literal for the 'Data State' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DATA_STATE = eINSTANCE.getDocumentRoot_DataState(); + + /** + * The meta object literal for the 'Data Store' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DATA_STORE = eINSTANCE.getDocumentRoot_DataStore(); + + /** + * The meta object literal for the 'Data Store Reference' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DATA_STORE_REFERENCE = eINSTANCE.getDocumentRoot_DataStoreReference(); + + /** + * The meta object literal for the 'Definitions' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DEFINITIONS = eINSTANCE.getDocumentRoot_Definitions(); + + /** + * The meta object literal for the 'Documentation' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DOCUMENTATION = eINSTANCE.getDocumentRoot_Documentation(); + + /** + * The meta object literal for the 'End Event' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__END_EVENT = eINSTANCE.getDocumentRoot_EndEvent(); + + /** + * The meta object literal for the 'End Point' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__END_POINT = eINSTANCE.getDocumentRoot_EndPoint(); + + /** + * The meta object literal for the 'Error' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__ERROR = eINSTANCE.getDocumentRoot_Error(); + + /** + * The meta object literal for the 'Error Event Definition' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__ERROR_EVENT_DEFINITION = eINSTANCE.getDocumentRoot_ErrorEventDefinition(); + + /** + * The meta object literal for the 'Escalation' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__ESCALATION = eINSTANCE.getDocumentRoot_Escalation(); + + /** + * The meta object literal for the 'Escalation Event Definition' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__ESCALATION_EVENT_DEFINITION = eINSTANCE.getDocumentRoot_EscalationEventDefinition(); + + /** + * The meta object literal for the 'Event' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__EVENT = eINSTANCE.getDocumentRoot_Event(); + + /** + * The meta object literal for the 'Event Based Gateway' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__EVENT_BASED_GATEWAY = eINSTANCE.getDocumentRoot_EventBasedGateway(); + + /** + * The meta object literal for the 'Exclusive Gateway' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__EXCLUSIVE_GATEWAY = eINSTANCE.getDocumentRoot_ExclusiveGateway(); + + /** + * The meta object literal for the 'Expression' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__EXPRESSION = eINSTANCE.getDocumentRoot_Expression(); + + /** + * The meta object literal for the 'Extension' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__EXTENSION = eINSTANCE.getDocumentRoot_Extension(); + + /** + * The meta object literal for the 'Extension Elements' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__EXTENSION_ELEMENTS = eINSTANCE.getDocumentRoot_ExtensionElements(); + + /** + * The meta object literal for the 'Flow Node' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__FLOW_NODE = eINSTANCE.getDocumentRoot_FlowNode(); + + /** + * The meta object literal for the 'Formal Expression' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__FORMAL_EXPRESSION = eINSTANCE.getDocumentRoot_FormalExpression(); + + /** + * The meta object literal for the 'Gateway' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__GATEWAY = eINSTANCE.getDocumentRoot_Gateway(); + + /** + * The meta object literal for the 'Global Business Rule Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__GLOBAL_BUSINESS_RULE_TASK = eINSTANCE.getDocumentRoot_GlobalBusinessRuleTask(); + + /** + * The meta object literal for the 'Global Choreography Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__GLOBAL_CHOREOGRAPHY_TASK = eINSTANCE.getDocumentRoot_GlobalChoreographyTask(); + + /** + * The meta object literal for the 'Global Conversation' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__GLOBAL_CONVERSATION = eINSTANCE.getDocumentRoot_GlobalConversation(); + + /** + * The meta object literal for the 'Global Manual Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__GLOBAL_MANUAL_TASK = eINSTANCE.getDocumentRoot_GlobalManualTask(); + + /** + * The meta object literal for the 'Global Script Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__GLOBAL_SCRIPT_TASK = eINSTANCE.getDocumentRoot_GlobalScriptTask(); + + /** + * The meta object literal for the 'Global Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__GLOBAL_TASK = eINSTANCE.getDocumentRoot_GlobalTask(); + + /** + * The meta object literal for the 'Global User Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__GLOBAL_USER_TASK = eINSTANCE.getDocumentRoot_GlobalUserTask(); + + /** + * The meta object literal for the 'Group' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__GROUP = eINSTANCE.getDocumentRoot_Group(); + + /** + * The meta object literal for the 'Human Performer' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__HUMAN_PERFORMER = eINSTANCE.getDocumentRoot_HumanPerformer(); + + /** + * The meta object literal for the 'Performer' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__PERFORMER = eINSTANCE.getDocumentRoot_Performer(); + + /** + * The meta object literal for the 'Resource Role' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__RESOURCE_ROLE = eINSTANCE.getDocumentRoot_ResourceRole(); + + /** + * The meta object literal for the 'Implicit Throw Event' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__IMPLICIT_THROW_EVENT = eINSTANCE.getDocumentRoot_ImplicitThrowEvent(); + + /** + * The meta object literal for the 'Import' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__IMPORT = eINSTANCE.getDocumentRoot_Import(); + + /** + * The meta object literal for the 'Inclusive Gateway' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__INCLUSIVE_GATEWAY = eINSTANCE.getDocumentRoot_InclusiveGateway(); + + /** + * The meta object literal for the 'Input Set' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__INPUT_SET = eINSTANCE.getDocumentRoot_InputSet(); + + /** + * The meta object literal for the 'Interface' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__INTERFACE = eINSTANCE.getDocumentRoot_Interface(); + + /** + * The meta object literal for the 'Intermediate Catch Event' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__INTERMEDIATE_CATCH_EVENT = eINSTANCE.getDocumentRoot_IntermediateCatchEvent(); + + /** + * The meta object literal for the 'Intermediate Throw Event' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__INTERMEDIATE_THROW_EVENT = eINSTANCE.getDocumentRoot_IntermediateThrowEvent(); + + /** + * The meta object literal for the 'Io Binding' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__IO_BINDING = eINSTANCE.getDocumentRoot_IoBinding(); + + /** + * The meta object literal for the 'Io Specification' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__IO_SPECIFICATION = eINSTANCE.getDocumentRoot_IoSpecification(); + + /** + * The meta object literal for the 'Item Definition' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__ITEM_DEFINITION = eINSTANCE.getDocumentRoot_ItemDefinition(); + + /** + * The meta object literal for the 'Lane' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__LANE = eINSTANCE.getDocumentRoot_Lane(); + + /** + * The meta object literal for the 'Lane Set' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__LANE_SET = eINSTANCE.getDocumentRoot_LaneSet(); + + /** + * The meta object literal for the 'Link Event Definition' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__LINK_EVENT_DEFINITION = eINSTANCE.getDocumentRoot_LinkEventDefinition(); + + /** + * The meta object literal for the 'Loop Characteristics' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__LOOP_CHARACTERISTICS = eINSTANCE.getDocumentRoot_LoopCharacteristics(); + + /** + * The meta object literal for the 'Manual Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__MANUAL_TASK = eINSTANCE.getDocumentRoot_ManualTask(); + + /** + * The meta object literal for the 'Message' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__MESSAGE = eINSTANCE.getDocumentRoot_Message(); + + /** + * The meta object literal for the 'Message Event Definition' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__MESSAGE_EVENT_DEFINITION = eINSTANCE.getDocumentRoot_MessageEventDefinition(); + + /** + * The meta object literal for the 'Message Flow' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__MESSAGE_FLOW = eINSTANCE.getDocumentRoot_MessageFlow(); + + /** + * The meta object literal for the 'Message Flow Association' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__MESSAGE_FLOW_ASSOCIATION = eINSTANCE.getDocumentRoot_MessageFlowAssociation(); + + /** + * The meta object literal for the 'Monitoring' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__MONITORING = eINSTANCE.getDocumentRoot_Monitoring(); + + /** + * The meta object literal for the 'Multi Instance Loop Characteristics' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__MULTI_INSTANCE_LOOP_CHARACTERISTICS = eINSTANCE + .getDocumentRoot_MultiInstanceLoopCharacteristics(); + + /** + * The meta object literal for the 'Operation' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__OPERATION = eINSTANCE.getDocumentRoot_Operation(); + + /** + * The meta object literal for the 'Output Set' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__OUTPUT_SET = eINSTANCE.getDocumentRoot_OutputSet(); + + /** + * The meta object literal for the 'Parallel Gateway' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__PARALLEL_GATEWAY = eINSTANCE.getDocumentRoot_ParallelGateway(); + + /** + * The meta object literal for the 'Participant' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__PARTICIPANT = eINSTANCE.getDocumentRoot_Participant(); + + /** + * The meta object literal for the 'Participant Association' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__PARTICIPANT_ASSOCIATION = eINSTANCE.getDocumentRoot_ParticipantAssociation(); + + /** + * The meta object literal for the 'Participant Multiplicity' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__PARTICIPANT_MULTIPLICITY = eINSTANCE.getDocumentRoot_ParticipantMultiplicity(); + + /** + * The meta object literal for the 'Partner Entity' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__PARTNER_ENTITY = eINSTANCE.getDocumentRoot_PartnerEntity(); + + /** + * The meta object literal for the 'Partner Role' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__PARTNER_ROLE = eINSTANCE.getDocumentRoot_PartnerRole(); + + /** + * The meta object literal for the 'Potential Owner' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__POTENTIAL_OWNER = eINSTANCE.getDocumentRoot_PotentialOwner(); + + /** + * The meta object literal for the 'Process' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__PROCESS = eINSTANCE.getDocumentRoot_Process(); + + /** + * The meta object literal for the 'Property' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__PROPERTY = eINSTANCE.getDocumentRoot_Property(); + + /** + * The meta object literal for the 'Receive Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__RECEIVE_TASK = eINSTANCE.getDocumentRoot_ReceiveTask(); + + /** + * The meta object literal for the 'Relationship' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__RELATIONSHIP = eINSTANCE.getDocumentRoot_Relationship(); + + /** + * The meta object literal for the 'Rendering' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__RENDERING = eINSTANCE.getDocumentRoot_Rendering(); + + /** + * The meta object literal for the 'Resource' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__RESOURCE = eINSTANCE.getDocumentRoot_Resource(); + + /** + * The meta object literal for the 'Resource Assignment Expression' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__RESOURCE_ASSIGNMENT_EXPRESSION = eINSTANCE + .getDocumentRoot_ResourceAssignmentExpression(); + + /** + * The meta object literal for the 'Resource Parameter' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__RESOURCE_PARAMETER = eINSTANCE.getDocumentRoot_ResourceParameter(); + + /** + * The meta object literal for the 'Resource Parameter Binding' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__RESOURCE_PARAMETER_BINDING = eINSTANCE.getDocumentRoot_ResourceParameterBinding(); + + /** + * The meta object literal for the 'Script' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__SCRIPT = eINSTANCE.getDocumentRoot_Script(); + + /** + * The meta object literal for the 'Script Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__SCRIPT_TASK = eINSTANCE.getDocumentRoot_ScriptTask(); + + /** + * The meta object literal for the 'Send Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__SEND_TASK = eINSTANCE.getDocumentRoot_SendTask(); + + /** + * The meta object literal for the 'Sequence Flow' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__SEQUENCE_FLOW = eINSTANCE.getDocumentRoot_SequenceFlow(); + + /** + * The meta object literal for the 'Service Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__SERVICE_TASK = eINSTANCE.getDocumentRoot_ServiceTask(); + + /** + * The meta object literal for the 'Signal' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__SIGNAL = eINSTANCE.getDocumentRoot_Signal(); + + /** + * The meta object literal for the 'Signal Event Definition' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__SIGNAL_EVENT_DEFINITION = eINSTANCE.getDocumentRoot_SignalEventDefinition(); + + /** + * The meta object literal for the 'Standard Loop Characteristics' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__STANDARD_LOOP_CHARACTERISTICS = eINSTANCE + .getDocumentRoot_StandardLoopCharacteristics(); + + /** + * The meta object literal for the 'Start Event' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__START_EVENT = eINSTANCE.getDocumentRoot_StartEvent(); + + /** + * The meta object literal for the 'Sub Choreography' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__SUB_CHOREOGRAPHY = eINSTANCE.getDocumentRoot_SubChoreography(); + + /** + * The meta object literal for the 'Sub Conversation' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__SUB_CONVERSATION = eINSTANCE.getDocumentRoot_SubConversation(); + + /** + * The meta object literal for the 'Sub Process' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__SUB_PROCESS = eINSTANCE.getDocumentRoot_SubProcess(); + + /** + * The meta object literal for the 'Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__TASK = eINSTANCE.getDocumentRoot_Task(); + + /** + * The meta object literal for the 'Terminate Event Definition' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__TERMINATE_EVENT_DEFINITION = eINSTANCE.getDocumentRoot_TerminateEventDefinition(); + + /** + * The meta object literal for the 'Text' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__TEXT = eINSTANCE.getDocumentRoot_Text(); + + /** + * The meta object literal for the 'Text Annotation' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__TEXT_ANNOTATION = eINSTANCE.getDocumentRoot_TextAnnotation(); + + /** + * The meta object literal for the 'Throw Event' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__THROW_EVENT = eINSTANCE.getDocumentRoot_ThrowEvent(); + + /** + * The meta object literal for the 'Timer Event Definition' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__TIMER_EVENT_DEFINITION = eINSTANCE.getDocumentRoot_TimerEventDefinition(); + + /** + * The meta object literal for the 'Transaction' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__TRANSACTION = eINSTANCE.getDocumentRoot_Transaction(); + + /** + * The meta object literal for the 'User Task' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__USER_TASK = eINSTANCE.getDocumentRoot_UserTask(); + + /** + * The meta object literal for the 'Event Sub Process' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__EVENT_SUB_PROCESS = eINSTANCE.getDocumentRoot_EventSubProcess(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ActivityImpl Activity}' class. + * + * + * @see org.eclipse.bpmn2.impl.ActivityImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getActivity() + * @generated + */ + EClass ACTIVITY = eINSTANCE.getActivity(); + + /** + * The meta object literal for the 'Io Specification' containment reference feature. + * + * + * @generated + */ + EReference ACTIVITY__IO_SPECIFICATION = eINSTANCE.getActivity_IoSpecification(); + + /** + * The meta object literal for the 'Boundary Event Refs' reference list feature. + * + * + * @generated + */ + EReference ACTIVITY__BOUNDARY_EVENT_REFS = eINSTANCE.getActivity_BoundaryEventRefs(); + + /** + * The meta object literal for the 'Properties' containment reference list feature. + * + * + * @generated + */ + EReference ACTIVITY__PROPERTIES = eINSTANCE.getActivity_Properties(); + + /** + * The meta object literal for the 'Data Input Associations' containment reference list feature. + * + * + * @generated + */ + EReference ACTIVITY__DATA_INPUT_ASSOCIATIONS = eINSTANCE.getActivity_DataInputAssociations(); + + /** + * The meta object literal for the 'Data Output Associations' containment reference list feature. + * + * + * @generated + */ + EReference ACTIVITY__DATA_OUTPUT_ASSOCIATIONS = eINSTANCE.getActivity_DataOutputAssociations(); + + /** + * The meta object literal for the 'Resources' containment reference list feature. + * + * + * @generated + */ + EReference ACTIVITY__RESOURCES = eINSTANCE.getActivity_Resources(); + + /** + * The meta object literal for the 'Loop Characteristics' containment reference feature. + * + * + * @generated + */ + EReference ACTIVITY__LOOP_CHARACTERISTICS = eINSTANCE.getActivity_LoopCharacteristics(); + + /** + * The meta object literal for the 'Completion Quantity' attribute feature. + * + * + * @generated + */ + EAttribute ACTIVITY__COMPLETION_QUANTITY = eINSTANCE.getActivity_CompletionQuantity(); + + /** + * The meta object literal for the 'Default' reference feature. + * + * + * @generated + */ + EReference ACTIVITY__DEFAULT = eINSTANCE.getActivity_Default(); + + /** + * The meta object literal for the 'Is For Compensation' attribute feature. + * + * + * @generated + */ + EAttribute ACTIVITY__IS_FOR_COMPENSATION = eINSTANCE.getActivity_IsForCompensation(); + + /** + * The meta object literal for the 'Start Quantity' attribute feature. + * + * + * @generated + */ + EAttribute ACTIVITY__START_QUANTITY = eINSTANCE.getActivity_StartQuantity(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.AdHocSubProcessImpl Ad Hoc Sub Process}' class. + * + * + * @see org.eclipse.bpmn2.impl.AdHocSubProcessImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getAdHocSubProcess() + * @generated + */ + EClass AD_HOC_SUB_PROCESS = eINSTANCE.getAdHocSubProcess(); + + /** + * The meta object literal for the 'Completion Condition' containment reference feature. + * + * + * @generated + */ + EReference AD_HOC_SUB_PROCESS__COMPLETION_CONDITION = eINSTANCE.getAdHocSubProcess_CompletionCondition(); + + /** + * The meta object literal for the 'Cancel Remaining Instances' attribute feature. + * + * + * @generated + */ + EAttribute AD_HOC_SUB_PROCESS__CANCEL_REMAINING_INSTANCES = eINSTANCE + .getAdHocSubProcess_CancelRemainingInstances(); + + /** + * The meta object literal for the 'Ordering' attribute feature. + * + * + * @generated + */ + EAttribute AD_HOC_SUB_PROCESS__ORDERING = eINSTANCE.getAdHocSubProcess_Ordering(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ArtifactImpl Artifact}' class. + * + * + * @see org.eclipse.bpmn2.impl.ArtifactImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getArtifact() + * @generated + */ + EClass ARTIFACT = eINSTANCE.getArtifact(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.AssignmentImpl Assignment}' class. + * + * + * @see org.eclipse.bpmn2.impl.AssignmentImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getAssignment() + * @generated + */ + EClass ASSIGNMENT = eINSTANCE.getAssignment(); + + /** + * The meta object literal for the 'From' containment reference feature. + * + * + * @generated + */ + EReference ASSIGNMENT__FROM = eINSTANCE.getAssignment_From(); + + /** + * The meta object literal for the 'To' containment reference feature. + * + * + * @generated + */ + EReference ASSIGNMENT__TO = eINSTANCE.getAssignment_To(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.AssociationImpl Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.AssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getAssociation() + * @generated + */ + EClass ASSOCIATION = eINSTANCE.getAssociation(); + + /** + * The meta object literal for the 'Association Direction' attribute feature. + * + * + * @generated + */ + EAttribute ASSOCIATION__ASSOCIATION_DIRECTION = eINSTANCE.getAssociation_AssociationDirection(); + + /** + * The meta object literal for the 'Source Ref' reference feature. + * + * + * @generated + */ + EReference ASSOCIATION__SOURCE_REF = eINSTANCE.getAssociation_SourceRef(); + + /** + * The meta object literal for the 'Target Ref' reference feature. + * + * + * @generated + */ + EReference ASSOCIATION__TARGET_REF = eINSTANCE.getAssociation_TargetRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.AuditingImpl Auditing}' class. + * + * + * @see org.eclipse.bpmn2.impl.AuditingImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getAuditing() + * @generated + */ + EClass AUDITING = eINSTANCE.getAuditing(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.BaseElementImpl Base Element}' class. + * + * + * @see org.eclipse.bpmn2.impl.BaseElementImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getBaseElement() + * @generated + */ + EClass BASE_ELEMENT = eINSTANCE.getBaseElement(); + + /** + * The meta object literal for the 'Documentation' containment reference list feature. + * + * + * @generated + */ + EReference BASE_ELEMENT__DOCUMENTATION = eINSTANCE.getBaseElement_Documentation(); + + /** + * The meta object literal for the 'Extension Values' containment reference list feature. + * + * + * @generated + */ + EReference BASE_ELEMENT__EXTENSION_VALUES = eINSTANCE.getBaseElement_ExtensionValues(); + + /** + * The meta object literal for the 'Extension Definitions' reference list feature. + * + * + * @generated + */ + EReference BASE_ELEMENT__EXTENSION_DEFINITIONS = eINSTANCE.getBaseElement_ExtensionDefinitions(); + + /** + * The meta object literal for the 'Id' attribute feature. + * + * + * @generated + */ + EAttribute BASE_ELEMENT__ID = eINSTANCE.getBaseElement_Id(); + + /** + * The meta object literal for the 'Any Attribute' attribute list feature. + * + * + * @generated + */ + EAttribute BASE_ELEMENT__ANY_ATTRIBUTE = eINSTANCE.getBaseElement_AnyAttribute(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.BoundaryEventImpl Boundary Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.BoundaryEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getBoundaryEvent() + * @generated + */ + EClass BOUNDARY_EVENT = eINSTANCE.getBoundaryEvent(); + + /** + * The meta object literal for the 'Attached To Ref' reference feature. + * + * + * @generated + */ + EReference BOUNDARY_EVENT__ATTACHED_TO_REF = eINSTANCE.getBoundaryEvent_AttachedToRef(); + + /** + * The meta object literal for the 'Cancel Activity' attribute feature. + * + * + * @generated + */ + EAttribute BOUNDARY_EVENT__CANCEL_ACTIVITY = eINSTANCE.getBoundaryEvent_CancelActivity(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.BusinessRuleTaskImpl Business Rule Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.BusinessRuleTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getBusinessRuleTask() + * @generated + */ + EClass BUSINESS_RULE_TASK = eINSTANCE.getBusinessRuleTask(); + + /** + * The meta object literal for the 'Implementation' attribute feature. + * + * + * @generated + */ + EAttribute BUSINESS_RULE_TASK__IMPLEMENTATION = eINSTANCE.getBusinessRuleTask_Implementation(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CallActivityImpl Call Activity}' class. + * + * + * @see org.eclipse.bpmn2.impl.CallActivityImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCallActivity() + * @generated + */ + EClass CALL_ACTIVITY = eINSTANCE.getCallActivity(); + + /** + * The meta object literal for the 'Called Element' attribute feature. + * + * + * @generated + */ + EAttribute CALL_ACTIVITY__CALLED_ELEMENT = eINSTANCE.getCallActivity_CalledElement(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CallChoreographyImpl Call Choreography}' class. + * + * + * @see org.eclipse.bpmn2.impl.CallChoreographyImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCallChoreography() + * @generated + */ + EClass CALL_CHOREOGRAPHY = eINSTANCE.getCallChoreography(); + + /** + * The meta object literal for the 'Participant Associations' containment reference list feature. + * + * + * @generated + */ + EReference CALL_CHOREOGRAPHY__PARTICIPANT_ASSOCIATIONS = eINSTANCE + .getCallChoreography_ParticipantAssociations(); + + /** + * The meta object literal for the 'Called Choreography Ref' reference feature. + * + * + * @generated + */ + EReference CALL_CHOREOGRAPHY__CALLED_CHOREOGRAPHY_REF = eINSTANCE.getCallChoreography_CalledChoreographyRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CallConversationImpl Call Conversation}' class. + * + * + * @see org.eclipse.bpmn2.impl.CallConversationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCallConversation() + * @generated + */ + EClass CALL_CONVERSATION = eINSTANCE.getCallConversation(); + + /** + * The meta object literal for the 'Participant Associations' containment reference list feature. + * + * + * @generated + */ + EReference CALL_CONVERSATION__PARTICIPANT_ASSOCIATIONS = eINSTANCE + .getCallConversation_ParticipantAssociations(); + + /** + * The meta object literal for the 'Called Collaboration Ref' reference feature. + * + * + * @generated + */ + EReference CALL_CONVERSATION__CALLED_COLLABORATION_REF = eINSTANCE.getCallConversation_CalledCollaborationRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CallableElementImpl Callable Element}' class. + * + * + * @see org.eclipse.bpmn2.impl.CallableElementImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCallableElement() + * @generated + */ + EClass CALLABLE_ELEMENT = eINSTANCE.getCallableElement(); + + /** + * The meta object literal for the 'Supported Interface Refs' reference list feature. + * + * + * @generated + */ + EReference CALLABLE_ELEMENT__SUPPORTED_INTERFACE_REFS = eINSTANCE.getCallableElement_SupportedInterfaceRefs(); + + /** + * The meta object literal for the 'Io Specification' containment reference feature. + * + * + * @generated + */ + EReference CALLABLE_ELEMENT__IO_SPECIFICATION = eINSTANCE.getCallableElement_IoSpecification(); + + /** + * The meta object literal for the 'Io Binding' containment reference list feature. + * + * + * @generated + */ + EReference CALLABLE_ELEMENT__IO_BINDING = eINSTANCE.getCallableElement_IoBinding(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute CALLABLE_ELEMENT__NAME = eINSTANCE.getCallableElement_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CancelEventDefinitionImpl Cancel Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.CancelEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCancelEventDefinition() + * @generated + */ + EClass CANCEL_EVENT_DEFINITION = eINSTANCE.getCancelEventDefinition(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CatchEventImpl Catch Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.CatchEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCatchEvent() + * @generated + */ + EClass CATCH_EVENT = eINSTANCE.getCatchEvent(); + + /** + * The meta object literal for the 'Data Outputs' containment reference list feature. + * + * + * @generated + */ + EReference CATCH_EVENT__DATA_OUTPUTS = eINSTANCE.getCatchEvent_DataOutputs(); + + /** + * The meta object literal for the 'Data Output Association' containment reference list feature. + * + * + * @generated + */ + EReference CATCH_EVENT__DATA_OUTPUT_ASSOCIATION = eINSTANCE.getCatchEvent_DataOutputAssociation(); + + /** + * The meta object literal for the 'Output Set' containment reference feature. + * + * + * @generated + */ + EReference CATCH_EVENT__OUTPUT_SET = eINSTANCE.getCatchEvent_OutputSet(); + + /** + * The meta object literal for the 'Event Definitions' containment reference list feature. + * + * + * @generated + */ + EReference CATCH_EVENT__EVENT_DEFINITIONS = eINSTANCE.getCatchEvent_EventDefinitions(); + + /** + * The meta object literal for the 'Event Definition Refs' reference list feature. + * + * + * @generated + */ + EReference CATCH_EVENT__EVENT_DEFINITION_REFS = eINSTANCE.getCatchEvent_EventDefinitionRefs(); + + /** + * The meta object literal for the 'Parallel Multiple' attribute feature. + * + * + * @generated + */ + EAttribute CATCH_EVENT__PARALLEL_MULTIPLE = eINSTANCE.getCatchEvent_ParallelMultiple(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CategoryImpl Category}' class. + * + * + * @see org.eclipse.bpmn2.impl.CategoryImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCategory() + * @generated + */ + EClass CATEGORY = eINSTANCE.getCategory(); + + /** + * The meta object literal for the 'Category Value' containment reference list feature. + * + * + * @generated + */ + EReference CATEGORY__CATEGORY_VALUE = eINSTANCE.getCategory_CategoryValue(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute CATEGORY__NAME = eINSTANCE.getCategory_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CategoryValueImpl Category Value}' class. + * + * + * @see org.eclipse.bpmn2.impl.CategoryValueImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCategoryValue() + * @generated + */ + EClass CATEGORY_VALUE = eINSTANCE.getCategoryValue(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute CATEGORY_VALUE__VALUE = eINSTANCE.getCategoryValue_Value(); + + /** + * The meta object literal for the 'Categorized Flow Elements' reference list feature. + * + * + * @generated + */ + EReference CATEGORY_VALUE__CATEGORIZED_FLOW_ELEMENTS = eINSTANCE.getCategoryValue_CategorizedFlowElements(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ChoreographyImpl Choreography}' class. + * + * + * @see org.eclipse.bpmn2.impl.ChoreographyImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getChoreography() + * @generated + */ + EClass CHOREOGRAPHY = eINSTANCE.getChoreography(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ChoreographyActivityImpl Choreography Activity}' class. + * + * + * @see org.eclipse.bpmn2.impl.ChoreographyActivityImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getChoreographyActivity() + * @generated + */ + EClass CHOREOGRAPHY_ACTIVITY = eINSTANCE.getChoreographyActivity(); + + /** + * The meta object literal for the 'Participant Refs' reference list feature. + * + * + * @generated + */ + EReference CHOREOGRAPHY_ACTIVITY__PARTICIPANT_REFS = eINSTANCE.getChoreographyActivity_ParticipantRefs(); + + /** + * The meta object literal for the 'Correlation Keys' containment reference list feature. + * + * + * @generated + */ + EReference CHOREOGRAPHY_ACTIVITY__CORRELATION_KEYS = eINSTANCE.getChoreographyActivity_CorrelationKeys(); + + /** + * The meta object literal for the 'Initiating Participant Ref' reference feature. + * + * + * @generated + */ + EReference CHOREOGRAPHY_ACTIVITY__INITIATING_PARTICIPANT_REF = eINSTANCE + .getChoreographyActivity_InitiatingParticipantRef(); + + /** + * The meta object literal for the 'Loop Type' attribute feature. + * + * + * @generated + */ + EAttribute CHOREOGRAPHY_ACTIVITY__LOOP_TYPE = eINSTANCE.getChoreographyActivity_LoopType(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ChoreographyTaskImpl Choreography Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.ChoreographyTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getChoreographyTask() + * @generated + */ + EClass CHOREOGRAPHY_TASK = eINSTANCE.getChoreographyTask(); + + /** + * The meta object literal for the 'Message Flow Ref' reference list feature. + * + * + * @generated + */ + EReference CHOREOGRAPHY_TASK__MESSAGE_FLOW_REF = eINSTANCE.getChoreographyTask_MessageFlowRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CollaborationImpl Collaboration}' class. + * + * + * @see org.eclipse.bpmn2.impl.CollaborationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCollaboration() + * @generated + */ + EClass COLLABORATION = eINSTANCE.getCollaboration(); + + /** + * The meta object literal for the 'Participants' containment reference list feature. + * + * + * @generated + */ + EReference COLLABORATION__PARTICIPANTS = eINSTANCE.getCollaboration_Participants(); + + /** + * The meta object literal for the 'Message Flows' containment reference list feature. + * + * + * @generated + */ + EReference COLLABORATION__MESSAGE_FLOWS = eINSTANCE.getCollaboration_MessageFlows(); + + /** + * The meta object literal for the 'Artifacts' containment reference list feature. + * + * + * @generated + */ + EReference COLLABORATION__ARTIFACTS = eINSTANCE.getCollaboration_Artifacts(); + + /** + * The meta object literal for the 'Conversations' containment reference list feature. + * + * + * @generated + */ + EReference COLLABORATION__CONVERSATIONS = eINSTANCE.getCollaboration_Conversations(); + + /** + * The meta object literal for the 'Conversation Associations' containment reference feature. + * + * + * @generated + */ + EReference COLLABORATION__CONVERSATION_ASSOCIATIONS = eINSTANCE.getCollaboration_ConversationAssociations(); + + /** + * The meta object literal for the 'Participant Associations' containment reference list feature. + * + * + * @generated + */ + EReference COLLABORATION__PARTICIPANT_ASSOCIATIONS = eINSTANCE.getCollaboration_ParticipantAssociations(); + + /** + * The meta object literal for the 'Message Flow Associations' containment reference list feature. + * + * + * @generated + */ + EReference COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS = eINSTANCE.getCollaboration_MessageFlowAssociations(); + + /** + * The meta object literal for the 'Correlation Keys' containment reference list feature. + * + * + * @generated + */ + EReference COLLABORATION__CORRELATION_KEYS = eINSTANCE.getCollaboration_CorrelationKeys(); + + /** + * The meta object literal for the 'Choreography Ref' reference list feature. + * + * + * @generated + */ + EReference COLLABORATION__CHOREOGRAPHY_REF = eINSTANCE.getCollaboration_ChoreographyRef(); + + /** + * The meta object literal for the 'Conversation Links' containment reference list feature. + * + * + * @generated + */ + EReference COLLABORATION__CONVERSATION_LINKS = eINSTANCE.getCollaboration_ConversationLinks(); + + /** + * The meta object literal for the 'Is Closed' attribute feature. + * + * + * @generated + */ + EAttribute COLLABORATION__IS_CLOSED = eINSTANCE.getCollaboration_IsClosed(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute COLLABORATION__NAME = eINSTANCE.getCollaboration_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CompensateEventDefinitionImpl Compensate Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.CompensateEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCompensateEventDefinition() + * @generated + */ + EClass COMPENSATE_EVENT_DEFINITION = eINSTANCE.getCompensateEventDefinition(); + + /** + * The meta object literal for the 'Activity Ref' reference feature. + * + * + * @generated + */ + EReference COMPENSATE_EVENT_DEFINITION__ACTIVITY_REF = eINSTANCE.getCompensateEventDefinition_ActivityRef(); + + /** + * The meta object literal for the 'Wait For Completion' attribute feature. + * + * + * @generated + */ + EAttribute COMPENSATE_EVENT_DEFINITION__WAIT_FOR_COMPLETION = eINSTANCE + .getCompensateEventDefinition_WaitForCompletion(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ComplexBehaviorDefinitionImpl Complex Behavior Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.ComplexBehaviorDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getComplexBehaviorDefinition() + * @generated + */ + EClass COMPLEX_BEHAVIOR_DEFINITION = eINSTANCE.getComplexBehaviorDefinition(); + + /** + * The meta object literal for the 'Condition' containment reference feature. + * + * + * @generated + */ + EReference COMPLEX_BEHAVIOR_DEFINITION__CONDITION = eINSTANCE.getComplexBehaviorDefinition_Condition(); + + /** + * The meta object literal for the 'Event' containment reference feature. + * + * + * @generated + */ + EReference COMPLEX_BEHAVIOR_DEFINITION__EVENT = eINSTANCE.getComplexBehaviorDefinition_Event(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ComplexGatewayImpl Complex Gateway}' class. + * + * + * @see org.eclipse.bpmn2.impl.ComplexGatewayImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getComplexGateway() + * @generated + */ + EClass COMPLEX_GATEWAY = eINSTANCE.getComplexGateway(); + + /** + * The meta object literal for the 'Activation Condition' containment reference feature. + * + * + * @generated + */ + EReference COMPLEX_GATEWAY__ACTIVATION_CONDITION = eINSTANCE.getComplexGateway_ActivationCondition(); + + /** + * The meta object literal for the 'Default' reference feature. + * + * + * @generated + */ + EReference COMPLEX_GATEWAY__DEFAULT = eINSTANCE.getComplexGateway_Default(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ConditionalEventDefinitionImpl Conditional Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.ConditionalEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getConditionalEventDefinition() + * @generated + */ + EClass CONDITIONAL_EVENT_DEFINITION = eINSTANCE.getConditionalEventDefinition(); + + /** + * The meta object literal for the 'Condition' containment reference feature. + * + * + * @generated + */ + EReference CONDITIONAL_EVENT_DEFINITION__CONDITION = eINSTANCE.getConditionalEventDefinition_Condition(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ConversationImpl Conversation}' class. + * + * + * @see org.eclipse.bpmn2.impl.ConversationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getConversation() + * @generated + */ + EClass CONVERSATION = eINSTANCE.getConversation(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ConversationAssociationImpl Conversation Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.ConversationAssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getConversationAssociation() + * @generated + */ + EClass CONVERSATION_ASSOCIATION = eINSTANCE.getConversationAssociation(); + + /** + * The meta object literal for the 'Inner Conversation Node Ref' reference feature. + * + * + * @generated + */ + EReference CONVERSATION_ASSOCIATION__INNER_CONVERSATION_NODE_REF = eINSTANCE + .getConversationAssociation_InnerConversationNodeRef(); + + /** + * The meta object literal for the 'Outer Conversation Node Ref' reference feature. + * + * + * @generated + */ + EReference CONVERSATION_ASSOCIATION__OUTER_CONVERSATION_NODE_REF = eINSTANCE + .getConversationAssociation_OuterConversationNodeRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ConversationLinkImpl Conversation Link}' class. + * + * + * @see org.eclipse.bpmn2.impl.ConversationLinkImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getConversationLink() + * @generated + */ + EClass CONVERSATION_LINK = eINSTANCE.getConversationLink(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute CONVERSATION_LINK__NAME = eINSTANCE.getConversationLink_Name(); + + /** + * The meta object literal for the 'Source Ref' reference feature. + * + * + * @generated + */ + EReference CONVERSATION_LINK__SOURCE_REF = eINSTANCE.getConversationLink_SourceRef(); + + /** + * The meta object literal for the 'Target Ref' reference feature. + * + * + * @generated + */ + EReference CONVERSATION_LINK__TARGET_REF = eINSTANCE.getConversationLink_TargetRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ConversationNodeImpl Conversation Node}' class. + * + * + * @see org.eclipse.bpmn2.impl.ConversationNodeImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getConversationNode() + * @generated + */ + EClass CONVERSATION_NODE = eINSTANCE.getConversationNode(); + + /** + * The meta object literal for the 'Participant Refs' reference list feature. + * + * + * @generated + */ + EReference CONVERSATION_NODE__PARTICIPANT_REFS = eINSTANCE.getConversationNode_ParticipantRefs(); + + /** + * The meta object literal for the 'Message Flow Refs' reference list feature. + * + * + * @generated + */ + EReference CONVERSATION_NODE__MESSAGE_FLOW_REFS = eINSTANCE.getConversationNode_MessageFlowRefs(); + + /** + * The meta object literal for the 'Correlation Keys' containment reference list feature. + * + * + * @generated + */ + EReference CONVERSATION_NODE__CORRELATION_KEYS = eINSTANCE.getConversationNode_CorrelationKeys(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute CONVERSATION_NODE__NAME = eINSTANCE.getConversationNode_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CorrelationKeyImpl Correlation Key}' class. + * + * + * @see org.eclipse.bpmn2.impl.CorrelationKeyImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCorrelationKey() + * @generated + */ + EClass CORRELATION_KEY = eINSTANCE.getCorrelationKey(); + + /** + * The meta object literal for the 'Correlation Property Ref' reference list feature. + * + * + * @generated + */ + EReference CORRELATION_KEY__CORRELATION_PROPERTY_REF = eINSTANCE.getCorrelationKey_CorrelationPropertyRef(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute CORRELATION_KEY__NAME = eINSTANCE.getCorrelationKey_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CorrelationPropertyImpl Correlation Property}' class. + * + * + * @see org.eclipse.bpmn2.impl.CorrelationPropertyImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCorrelationProperty() + * @generated + */ + EClass CORRELATION_PROPERTY = eINSTANCE.getCorrelationProperty(); + + /** + * The meta object literal for the 'Correlation Property Retrieval Expression' containment reference list feature. + * + * + * @generated + */ + EReference CORRELATION_PROPERTY__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION = eINSTANCE + .getCorrelationProperty_CorrelationPropertyRetrievalExpression(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute CORRELATION_PROPERTY__NAME = eINSTANCE.getCorrelationProperty_Name(); + + /** + * The meta object literal for the 'Type' reference feature. + * + * + * @generated + */ + EReference CORRELATION_PROPERTY__TYPE = eINSTANCE.getCorrelationProperty_Type(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CorrelationPropertyBindingImpl Correlation Property Binding}' class. + * + * + * @see org.eclipse.bpmn2.impl.CorrelationPropertyBindingImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCorrelationPropertyBinding() + * @generated + */ + EClass CORRELATION_PROPERTY_BINDING = eINSTANCE.getCorrelationPropertyBinding(); + + /** + * The meta object literal for the 'Data Path' containment reference feature. + * + * + * @generated + */ + EReference CORRELATION_PROPERTY_BINDING__DATA_PATH = eINSTANCE.getCorrelationPropertyBinding_DataPath(); + + /** + * The meta object literal for the 'Correlation Property Ref' reference feature. + * + * + * @generated + */ + EReference CORRELATION_PROPERTY_BINDING__CORRELATION_PROPERTY_REF = eINSTANCE + .getCorrelationPropertyBinding_CorrelationPropertyRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CorrelationPropertyRetrievalExpressionImpl Correlation Property Retrieval Expression}' class. + * + * + * @see org.eclipse.bpmn2.impl.CorrelationPropertyRetrievalExpressionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCorrelationPropertyRetrievalExpression() + * @generated + */ + EClass CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION = eINSTANCE.getCorrelationPropertyRetrievalExpression(); + + /** + * The meta object literal for the 'Message Path' containment reference feature. + * + * + * @generated + */ + EReference CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_PATH = eINSTANCE + .getCorrelationPropertyRetrievalExpression_MessagePath(); + + /** + * The meta object literal for the 'Message Ref' reference feature. + * + * + * @generated + */ + EReference CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_REF = eINSTANCE + .getCorrelationPropertyRetrievalExpression_MessageRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.CorrelationSubscriptionImpl Correlation Subscription}' class. + * + * + * @see org.eclipse.bpmn2.impl.CorrelationSubscriptionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getCorrelationSubscription() + * @generated + */ + EClass CORRELATION_SUBSCRIPTION = eINSTANCE.getCorrelationSubscription(); + + /** + * The meta object literal for the 'Correlation Property Binding' containment reference list feature. + * + * + * @generated + */ + EReference CORRELATION_SUBSCRIPTION__CORRELATION_PROPERTY_BINDING = eINSTANCE + .getCorrelationSubscription_CorrelationPropertyBinding(); + + /** + * The meta object literal for the 'Correlation Key Ref' reference feature. + * + * + * @generated + */ + EReference CORRELATION_SUBSCRIPTION__CORRELATION_KEY_REF = eINSTANCE + .getCorrelationSubscription_CorrelationKeyRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.DataAssociationImpl Data Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataAssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataAssociation() + * @generated + */ + EClass DATA_ASSOCIATION = eINSTANCE.getDataAssociation(); + + /** + * The meta object literal for the 'Source Ref' reference list feature. + * + * + * @generated + */ + EReference DATA_ASSOCIATION__SOURCE_REF = eINSTANCE.getDataAssociation_SourceRef(); + + /** + * The meta object literal for the 'Target Ref' reference feature. + * + * + * @generated + */ + EReference DATA_ASSOCIATION__TARGET_REF = eINSTANCE.getDataAssociation_TargetRef(); + + /** + * The meta object literal for the 'Transformation' containment reference feature. + * + * + * @generated + */ + EReference DATA_ASSOCIATION__TRANSFORMATION = eINSTANCE.getDataAssociation_Transformation(); + + /** + * The meta object literal for the 'Assignment' containment reference list feature. + * + * + * @generated + */ + EReference DATA_ASSOCIATION__ASSIGNMENT = eINSTANCE.getDataAssociation_Assignment(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.DataInputImpl Data Input}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataInputImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataInput() + * @generated + */ + EClass DATA_INPUT = eINSTANCE.getDataInput(); + + /** + * The meta object literal for the 'Input Set With Optional' reference list feature. + * + * + * @generated + */ + EReference DATA_INPUT__INPUT_SET_WITH_OPTIONAL = eINSTANCE.getDataInput_InputSetWithOptional(); + + /** + * The meta object literal for the 'Input Set With While Executing' reference list feature. + * + * + * @generated + */ + EReference DATA_INPUT__INPUT_SET_WITH_WHILE_EXECUTING = eINSTANCE.getDataInput_InputSetWithWhileExecuting(); + + /** + * The meta object literal for the 'Input Set Refs' reference list feature. + * + * + * @generated + */ + EReference DATA_INPUT__INPUT_SET_REFS = eINSTANCE.getDataInput_InputSetRefs(); + + /** + * The meta object literal for the 'Is Collection' attribute feature. + * + * + * @generated + */ + EAttribute DATA_INPUT__IS_COLLECTION = eINSTANCE.getDataInput_IsCollection(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute DATA_INPUT__NAME = eINSTANCE.getDataInput_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.DataInputAssociationImpl Data Input Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataInputAssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataInputAssociation() + * @generated + */ + EClass DATA_INPUT_ASSOCIATION = eINSTANCE.getDataInputAssociation(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.DataObjectImpl Data Object}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataObjectImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataObject() + * @generated + */ + EClass DATA_OBJECT = eINSTANCE.getDataObject(); + + /** + * The meta object literal for the 'Is Collection' attribute feature. + * + * + * @generated + */ + EAttribute DATA_OBJECT__IS_COLLECTION = eINSTANCE.getDataObject_IsCollection(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.DataObjectReferenceImpl Data Object Reference}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataObjectReferenceImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataObjectReference() + * @generated + */ + EClass DATA_OBJECT_REFERENCE = eINSTANCE.getDataObjectReference(); + + /** + * The meta object literal for the 'Data Object Ref' reference feature. + * + * + * @generated + */ + EReference DATA_OBJECT_REFERENCE__DATA_OBJECT_REF = eINSTANCE.getDataObjectReference_DataObjectRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.DataOutputImpl Data Output}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataOutputImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataOutput() + * @generated + */ + EClass DATA_OUTPUT = eINSTANCE.getDataOutput(); + + /** + * The meta object literal for the 'Output Set With Optional' reference list feature. + * + * + * @generated + */ + EReference DATA_OUTPUT__OUTPUT_SET_WITH_OPTIONAL = eINSTANCE.getDataOutput_OutputSetWithOptional(); + + /** + * The meta object literal for the 'Output Set With While Executing' reference list feature. + * + * + * @generated + */ + EReference DATA_OUTPUT__OUTPUT_SET_WITH_WHILE_EXECUTING = eINSTANCE.getDataOutput_OutputSetWithWhileExecuting(); + + /** + * The meta object literal for the 'Output Set Refs' reference list feature. + * + * + * @generated + */ + EReference DATA_OUTPUT__OUTPUT_SET_REFS = eINSTANCE.getDataOutput_OutputSetRefs(); + + /** + * The meta object literal for the 'Is Collection' attribute feature. + * + * + * @generated + */ + EAttribute DATA_OUTPUT__IS_COLLECTION = eINSTANCE.getDataOutput_IsCollection(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute DATA_OUTPUT__NAME = eINSTANCE.getDataOutput_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.DataOutputAssociationImpl Data Output Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataOutputAssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataOutputAssociation() + * @generated + */ + EClass DATA_OUTPUT_ASSOCIATION = eINSTANCE.getDataOutputAssociation(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.DataStateImpl Data State}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataStateImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataState() + * @generated + */ + EClass DATA_STATE = eINSTANCE.getDataState(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute DATA_STATE__NAME = eINSTANCE.getDataState_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.DataStoreImpl Data Store}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataStoreImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataStore() + * @generated + */ + EClass DATA_STORE = eINSTANCE.getDataStore(); + + /** + * The meta object literal for the 'Capacity' attribute feature. + * + * + * @generated + */ + EAttribute DATA_STORE__CAPACITY = eINSTANCE.getDataStore_Capacity(); + + /** + * The meta object literal for the 'Is Unlimited' attribute feature. + * + * + * @generated + */ + EAttribute DATA_STORE__IS_UNLIMITED = eINSTANCE.getDataStore_IsUnlimited(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute DATA_STORE__NAME = eINSTANCE.getDataStore_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.DataStoreReferenceImpl Data Store Reference}' class. + * + * + * @see org.eclipse.bpmn2.impl.DataStoreReferenceImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDataStoreReference() + * @generated + */ + EClass DATA_STORE_REFERENCE = eINSTANCE.getDataStoreReference(); + + /** + * The meta object literal for the 'Data Store Ref' reference feature. + * + * + * @generated + */ + EReference DATA_STORE_REFERENCE__DATA_STORE_REF = eINSTANCE.getDataStoreReference_DataStoreRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.DefinitionsImpl Definitions}' class. + * + * + * @see org.eclipse.bpmn2.impl.DefinitionsImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDefinitions() + * @generated + */ + EClass DEFINITIONS = eINSTANCE.getDefinitions(); + + /** + * The meta object literal for the 'Imports' containment reference list feature. + * + * + * @generated + */ + EReference DEFINITIONS__IMPORTS = eINSTANCE.getDefinitions_Imports(); + + /** + * The meta object literal for the 'Extensions' containment reference list feature. + * + * + * @generated + */ + EReference DEFINITIONS__EXTENSIONS = eINSTANCE.getDefinitions_Extensions(); + + /** + * The meta object literal for the 'Root Elements' containment reference list feature. + * + * + * @generated + */ + EReference DEFINITIONS__ROOT_ELEMENTS = eINSTANCE.getDefinitions_RootElements(); + + /** + * The meta object literal for the 'Diagrams' containment reference list feature. + * + * + * @generated + */ + EReference DEFINITIONS__DIAGRAMS = eINSTANCE.getDefinitions_Diagrams(); + + /** + * The meta object literal for the 'Relationships' containment reference list feature. + * + * + * @generated + */ + EReference DEFINITIONS__RELATIONSHIPS = eINSTANCE.getDefinitions_Relationships(); + + /** + * The meta object literal for the 'Exporter' attribute feature. + * + * + * @generated + */ + EAttribute DEFINITIONS__EXPORTER = eINSTANCE.getDefinitions_Exporter(); + + /** + * The meta object literal for the 'Exporter Version' attribute feature. + * + * + * @generated + */ + EAttribute DEFINITIONS__EXPORTER_VERSION = eINSTANCE.getDefinitions_ExporterVersion(); + + /** + * The meta object literal for the 'Expression Language' attribute feature. + * + * + * @generated + */ + EAttribute DEFINITIONS__EXPRESSION_LANGUAGE = eINSTANCE.getDefinitions_ExpressionLanguage(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute DEFINITIONS__NAME = eINSTANCE.getDefinitions_Name(); + + /** + * The meta object literal for the 'Target Namespace' attribute feature. + * + * + * @generated + */ + EAttribute DEFINITIONS__TARGET_NAMESPACE = eINSTANCE.getDefinitions_TargetNamespace(); + + /** + * The meta object literal for the 'Type Language' attribute feature. + * + * + * @generated + */ + EAttribute DEFINITIONS__TYPE_LANGUAGE = eINSTANCE.getDefinitions_TypeLanguage(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.DocumentationImpl Documentation}' class. + * + * + * @see org.eclipse.bpmn2.impl.DocumentationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getDocumentation() + * @generated + */ + EClass DOCUMENTATION = eINSTANCE.getDocumentation(); + + /** + * The meta object literal for the 'Mixed' attribute list feature. + * + * + * @generated + */ + EAttribute DOCUMENTATION__MIXED = eINSTANCE.getDocumentation_Mixed(); + + /** + * The meta object literal for the 'Text' attribute feature. + * + * + * @generated + */ + EAttribute DOCUMENTATION__TEXT = eINSTANCE.getDocumentation_Text(); + + /** + * The meta object literal for the 'Text Format' attribute feature. + * + * + * @generated + */ + EAttribute DOCUMENTATION__TEXT_FORMAT = eINSTANCE.getDocumentation_TextFormat(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.EndEventImpl End Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.EndEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEndEvent() + * @generated + */ + EClass END_EVENT = eINSTANCE.getEndEvent(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.EndPointImpl End Point}' class. + * + * + * @see org.eclipse.bpmn2.impl.EndPointImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEndPoint() + * @generated + */ + EClass END_POINT = eINSTANCE.getEndPoint(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ErrorImpl Error}' class. + * + * + * @see org.eclipse.bpmn2.impl.ErrorImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getError() + * @generated + */ + EClass ERROR = eINSTANCE.getError(); + + /** + * The meta object literal for the 'Error Code' attribute feature. + * + * + * @generated + */ + EAttribute ERROR__ERROR_CODE = eINSTANCE.getError_ErrorCode(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute ERROR__NAME = eINSTANCE.getError_Name(); + + /** + * The meta object literal for the 'Structure Ref' reference feature. + * + * + * @generated + */ + EReference ERROR__STRUCTURE_REF = eINSTANCE.getError_StructureRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ErrorEventDefinitionImpl Error Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.ErrorEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getErrorEventDefinition() + * @generated + */ + EClass ERROR_EVENT_DEFINITION = eINSTANCE.getErrorEventDefinition(); + + /** + * The meta object literal for the 'Error Ref' reference feature. + * + * + * @generated + */ + EReference ERROR_EVENT_DEFINITION__ERROR_REF = eINSTANCE.getErrorEventDefinition_ErrorRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.EscalationImpl Escalation}' class. + * + * + * @see org.eclipse.bpmn2.impl.EscalationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEscalation() + * @generated + */ + EClass ESCALATION = eINSTANCE.getEscalation(); + + /** + * The meta object literal for the 'Escalation Code' attribute feature. + * + * + * @generated + */ + EAttribute ESCALATION__ESCALATION_CODE = eINSTANCE.getEscalation_EscalationCode(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute ESCALATION__NAME = eINSTANCE.getEscalation_Name(); + + /** + * The meta object literal for the 'Structure Ref' reference feature. + * + * + * @generated + */ + EReference ESCALATION__STRUCTURE_REF = eINSTANCE.getEscalation_StructureRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.EscalationEventDefinitionImpl Escalation Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.EscalationEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEscalationEventDefinition() + * @generated + */ + EClass ESCALATION_EVENT_DEFINITION = eINSTANCE.getEscalationEventDefinition(); + + /** + * The meta object literal for the 'Escalation Ref' reference feature. + * + * + * @generated + */ + EReference ESCALATION_EVENT_DEFINITION__ESCALATION_REF = eINSTANCE.getEscalationEventDefinition_EscalationRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.EventImpl Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.EventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEvent() + * @generated + */ + EClass EVENT = eINSTANCE.getEvent(); + + /** + * The meta object literal for the 'Properties' containment reference list feature. + * + * + * @generated + */ + EReference EVENT__PROPERTIES = eINSTANCE.getEvent_Properties(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.EventBasedGatewayImpl Event Based Gateway}' class. + * + * + * @see org.eclipse.bpmn2.impl.EventBasedGatewayImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEventBasedGateway() + * @generated + */ + EClass EVENT_BASED_GATEWAY = eINSTANCE.getEventBasedGateway(); + + /** + * The meta object literal for the 'Event Gateway Type' attribute feature. + * + * + * @generated + */ + EAttribute EVENT_BASED_GATEWAY__EVENT_GATEWAY_TYPE = eINSTANCE.getEventBasedGateway_EventGatewayType(); + + /** + * The meta object literal for the 'Instantiate' attribute feature. + * + * + * @generated + */ + EAttribute EVENT_BASED_GATEWAY__INSTANTIATE = eINSTANCE.getEventBasedGateway_Instantiate(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.EventDefinitionImpl Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.EventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEventDefinition() + * @generated + */ + EClass EVENT_DEFINITION = eINSTANCE.getEventDefinition(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ExclusiveGatewayImpl Exclusive Gateway}' class. + * + * + * @see org.eclipse.bpmn2.impl.ExclusiveGatewayImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getExclusiveGateway() + * @generated + */ + EClass EXCLUSIVE_GATEWAY = eINSTANCE.getExclusiveGateway(); + + /** + * The meta object literal for the 'Default' reference feature. + * + * + * @generated + */ + EReference EXCLUSIVE_GATEWAY__DEFAULT = eINSTANCE.getExclusiveGateway_Default(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ExpressionImpl Expression}' class. + * + * + * @see org.eclipse.bpmn2.impl.ExpressionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getExpression() + * @generated + */ + EClass EXPRESSION = eINSTANCE.getExpression(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ExtensionImpl Extension}' class. + * + * + * @see org.eclipse.bpmn2.impl.ExtensionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getExtension() + * @generated + */ + EClass EXTENSION = eINSTANCE.getExtension(); + + /** + * The meta object literal for the 'Definition' containment reference feature. + * + * + * @generated + */ + EReference EXTENSION__DEFINITION = eINSTANCE.getExtension_Definition(); + + /** + * The meta object literal for the 'Must Understand' attribute feature. + * + * + * @generated + */ + EAttribute EXTENSION__MUST_UNDERSTAND = eINSTANCE.getExtension_MustUnderstand(); + + /** + * The meta object literal for the 'Xsd Definition' attribute feature. + * + * + * @generated + */ + EAttribute EXTENSION__XSD_DEFINITION = eINSTANCE.getExtension_XsdDefinition(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ExtensionAttributeDefinitionImpl Extension Attribute Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.ExtensionAttributeDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getExtensionAttributeDefinition() + * @generated + */ + EClass EXTENSION_ATTRIBUTE_DEFINITION = eINSTANCE.getExtensionAttributeDefinition(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute EXTENSION_ATTRIBUTE_DEFINITION__NAME = eINSTANCE.getExtensionAttributeDefinition_Name(); + + /** + * The meta object literal for the 'Type' attribute feature. + * + * + * @generated + */ + EAttribute EXTENSION_ATTRIBUTE_DEFINITION__TYPE = eINSTANCE.getExtensionAttributeDefinition_Type(); + + /** + * The meta object literal for the 'Is Reference' attribute feature. + * + * + * @generated + */ + EAttribute EXTENSION_ATTRIBUTE_DEFINITION__IS_REFERENCE = eINSTANCE + .getExtensionAttributeDefinition_IsReference(); + + /** + * The meta object literal for the 'Extension Definition' container reference feature. + * + * + * @generated + */ + EReference EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION = eINSTANCE + .getExtensionAttributeDefinition_ExtensionDefinition(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ExtensionAttributeValueImpl Extension Attribute Value}' class. + * + * + * @see org.eclipse.bpmn2.impl.ExtensionAttributeValueImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getExtensionAttributeValue() + * @generated + */ + EClass EXTENSION_ATTRIBUTE_VALUE = eINSTANCE.getExtensionAttributeValue(); + + /** + * The meta object literal for the 'Value Ref' reference feature. + * + * + * @generated + */ + EReference EXTENSION_ATTRIBUTE_VALUE__VALUE_REF = eINSTANCE.getExtensionAttributeValue_ValueRef(); + + /** + * The meta object literal for the 'Value' attribute list feature. + * + * + * @generated + */ + EAttribute EXTENSION_ATTRIBUTE_VALUE__VALUE = eINSTANCE.getExtensionAttributeValue_Value(); + + /** + * The meta object literal for the 'Extension Attribute Definition' reference feature. + * + * + * @generated + */ + EReference EXTENSION_ATTRIBUTE_VALUE__EXTENSION_ATTRIBUTE_DEFINITION = eINSTANCE + .getExtensionAttributeValue_ExtensionAttributeDefinition(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ExtensionDefinitionImpl Extension Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.ExtensionDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getExtensionDefinition() + * @generated + */ + EClass EXTENSION_DEFINITION = eINSTANCE.getExtensionDefinition(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute EXTENSION_DEFINITION__NAME = eINSTANCE.getExtensionDefinition_Name(); + + /** + * The meta object literal for the 'Extension Attribute Definitions' containment reference list feature. + * + * + * @generated + */ + EReference EXTENSION_DEFINITION__EXTENSION_ATTRIBUTE_DEFINITIONS = eINSTANCE + .getExtensionDefinition_ExtensionAttributeDefinitions(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.FlowElementImpl Flow Element}' class. + * + * + * @see org.eclipse.bpmn2.impl.FlowElementImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getFlowElement() + * @generated + */ + EClass FLOW_ELEMENT = eINSTANCE.getFlowElement(); + + /** + * The meta object literal for the 'Auditing' containment reference feature. + * + * + * @generated + */ + EReference FLOW_ELEMENT__AUDITING = eINSTANCE.getFlowElement_Auditing(); + + /** + * The meta object literal for the 'Monitoring' containment reference feature. + * + * + * @generated + */ + EReference FLOW_ELEMENT__MONITORING = eINSTANCE.getFlowElement_Monitoring(); + + /** + * The meta object literal for the 'Category Value Ref' reference list feature. + * + * + * @generated + */ + EReference FLOW_ELEMENT__CATEGORY_VALUE_REF = eINSTANCE.getFlowElement_CategoryValueRef(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute FLOW_ELEMENT__NAME = eINSTANCE.getFlowElement_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.FlowElementsContainerImpl Flow Elements Container}' class. + * + * + * @see org.eclipse.bpmn2.impl.FlowElementsContainerImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getFlowElementsContainer() + * @generated + */ + EClass FLOW_ELEMENTS_CONTAINER = eINSTANCE.getFlowElementsContainer(); + + /** + * The meta object literal for the 'Lane Sets' containment reference list feature. + * + * + * @generated + */ + EReference FLOW_ELEMENTS_CONTAINER__LANE_SETS = eINSTANCE.getFlowElementsContainer_LaneSets(); + + /** + * The meta object literal for the 'Flow Elements' containment reference list feature. + * + * + * @generated + */ + EReference FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS = eINSTANCE.getFlowElementsContainer_FlowElements(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.FlowNodeImpl Flow Node}' class. + * + * + * @see org.eclipse.bpmn2.impl.FlowNodeImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getFlowNode() + * @generated + */ + EClass FLOW_NODE = eINSTANCE.getFlowNode(); + + /** + * The meta object literal for the 'Incoming' reference list feature. + * + * + * @generated + */ + EReference FLOW_NODE__INCOMING = eINSTANCE.getFlowNode_Incoming(); + + /** + * The meta object literal for the 'Lanes' reference list feature. + * + * + * @generated + */ + EReference FLOW_NODE__LANES = eINSTANCE.getFlowNode_Lanes(); + + /** + * The meta object literal for the 'Outgoing' reference list feature. + * + * + * @generated + */ + EReference FLOW_NODE__OUTGOING = eINSTANCE.getFlowNode_Outgoing(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.FormalExpressionImpl Formal Expression}' class. + * + * + * @see org.eclipse.bpmn2.impl.FormalExpressionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getFormalExpression() + * @generated + */ + EClass FORMAL_EXPRESSION = eINSTANCE.getFormalExpression(); + + /** + * The meta object literal for the 'Mixed' attribute list feature. + * + * + * @generated + */ + EAttribute FORMAL_EXPRESSION__MIXED = eINSTANCE.getFormalExpression_Mixed(); + + /** + * The meta object literal for the 'Body' attribute feature. + * + * + * @generated + */ + EAttribute FORMAL_EXPRESSION__BODY = eINSTANCE.getFormalExpression_Body(); + + /** + * The meta object literal for the 'Evaluates To Type Ref' reference feature. + * + * + * @generated + */ + EReference FORMAL_EXPRESSION__EVALUATES_TO_TYPE_REF = eINSTANCE.getFormalExpression_EvaluatesToTypeRef(); + + /** + * The meta object literal for the 'Language' attribute feature. + * + * + * @generated + */ + EAttribute FORMAL_EXPRESSION__LANGUAGE = eINSTANCE.getFormalExpression_Language(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.GatewayImpl Gateway}' class. + * + * + * @see org.eclipse.bpmn2.impl.GatewayImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGateway() + * @generated + */ + EClass GATEWAY = eINSTANCE.getGateway(); + + /** + * The meta object literal for the 'Gateway Direction' attribute feature. + * + * + * @generated + */ + EAttribute GATEWAY__GATEWAY_DIRECTION = eINSTANCE.getGateway_GatewayDirection(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.GlobalBusinessRuleTaskImpl Global Business Rule Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalBusinessRuleTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalBusinessRuleTask() + * @generated + */ + EClass GLOBAL_BUSINESS_RULE_TASK = eINSTANCE.getGlobalBusinessRuleTask(); + + /** + * The meta object literal for the 'Implementation' attribute feature. + * + * + * @generated + */ + EAttribute GLOBAL_BUSINESS_RULE_TASK__IMPLEMENTATION = eINSTANCE.getGlobalBusinessRuleTask_Implementation(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.GlobalChoreographyTaskImpl Global Choreography Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalChoreographyTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalChoreographyTask() + * @generated + */ + EClass GLOBAL_CHOREOGRAPHY_TASK = eINSTANCE.getGlobalChoreographyTask(); + + /** + * The meta object literal for the 'Initiating Participant Ref' reference feature. + * + * + * @generated + */ + EReference GLOBAL_CHOREOGRAPHY_TASK__INITIATING_PARTICIPANT_REF = eINSTANCE + .getGlobalChoreographyTask_InitiatingParticipantRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.GlobalConversationImpl Global Conversation}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalConversationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalConversation() + * @generated + */ + EClass GLOBAL_CONVERSATION = eINSTANCE.getGlobalConversation(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.GlobalManualTaskImpl Global Manual Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalManualTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalManualTask() + * @generated + */ + EClass GLOBAL_MANUAL_TASK = eINSTANCE.getGlobalManualTask(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.GlobalScriptTaskImpl Global Script Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalScriptTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalScriptTask() + * @generated + */ + EClass GLOBAL_SCRIPT_TASK = eINSTANCE.getGlobalScriptTask(); + + /** + * The meta object literal for the 'Script' attribute feature. + * + * + * @generated + */ + EAttribute GLOBAL_SCRIPT_TASK__SCRIPT = eINSTANCE.getGlobalScriptTask_Script(); + + /** + * The meta object literal for the 'Script Language' attribute feature. + * + * + * @generated + */ + EAttribute GLOBAL_SCRIPT_TASK__SCRIPT_LANGUAGE = eINSTANCE.getGlobalScriptTask_ScriptLanguage(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.GlobalTaskImpl Global Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalTask() + * @generated + */ + EClass GLOBAL_TASK = eINSTANCE.getGlobalTask(); + + /** + * The meta object literal for the 'Resources' containment reference list feature. + * + * + * @generated + */ + EReference GLOBAL_TASK__RESOURCES = eINSTANCE.getGlobalTask_Resources(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.GlobalUserTaskImpl Global User Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.GlobalUserTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGlobalUserTask() + * @generated + */ + EClass GLOBAL_USER_TASK = eINSTANCE.getGlobalUserTask(); + + /** + * The meta object literal for the 'Renderings' containment reference list feature. + * + * + * @generated + */ + EReference GLOBAL_USER_TASK__RENDERINGS = eINSTANCE.getGlobalUserTask_Renderings(); + + /** + * The meta object literal for the 'Implementation' attribute feature. + * + * + * @generated + */ + EAttribute GLOBAL_USER_TASK__IMPLEMENTATION = eINSTANCE.getGlobalUserTask_Implementation(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.GroupImpl Group}' class. + * + * + * @see org.eclipse.bpmn2.impl.GroupImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGroup() + * @generated + */ + EClass GROUP = eINSTANCE.getGroup(); + + /** + * The meta object literal for the 'Category Value Ref' reference feature. + * + * + * @generated + */ + EReference GROUP__CATEGORY_VALUE_REF = eINSTANCE.getGroup_CategoryValueRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.HumanPerformerImpl Human Performer}' class. + * + * + * @see org.eclipse.bpmn2.impl.HumanPerformerImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getHumanPerformer() + * @generated + */ + EClass HUMAN_PERFORMER = eINSTANCE.getHumanPerformer(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ImplicitThrowEventImpl Implicit Throw Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.ImplicitThrowEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getImplicitThrowEvent() + * @generated + */ + EClass IMPLICIT_THROW_EVENT = eINSTANCE.getImplicitThrowEvent(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ImportImpl Import}' class. + * + * + * @see org.eclipse.bpmn2.impl.ImportImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getImport() + * @generated + */ + EClass IMPORT = eINSTANCE.getImport(); + + /** + * The meta object literal for the 'Import Type' attribute feature. + * + * + * @generated + */ + EAttribute IMPORT__IMPORT_TYPE = eINSTANCE.getImport_ImportType(); + + /** + * The meta object literal for the 'Location' attribute feature. + * + * + * @generated + */ + EAttribute IMPORT__LOCATION = eINSTANCE.getImport_Location(); + + /** + * The meta object literal for the 'Namespace' attribute feature. + * + * + * @generated + */ + EAttribute IMPORT__NAMESPACE = eINSTANCE.getImport_Namespace(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.InclusiveGatewayImpl Inclusive Gateway}' class. + * + * + * @see org.eclipse.bpmn2.impl.InclusiveGatewayImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getInclusiveGateway() + * @generated + */ + EClass INCLUSIVE_GATEWAY = eINSTANCE.getInclusiveGateway(); + + /** + * The meta object literal for the 'Default' reference feature. + * + * + * @generated + */ + EReference INCLUSIVE_GATEWAY__DEFAULT = eINSTANCE.getInclusiveGateway_Default(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.InputOutputBindingImpl Input Output Binding}' class. + * + * + * @see org.eclipse.bpmn2.impl.InputOutputBindingImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getInputOutputBinding() + * @generated + */ + EClass INPUT_OUTPUT_BINDING = eINSTANCE.getInputOutputBinding(); + + /** + * The meta object literal for the 'Input Data Ref' reference feature. + * + * + * @generated + */ + EReference INPUT_OUTPUT_BINDING__INPUT_DATA_REF = eINSTANCE.getInputOutputBinding_InputDataRef(); + + /** + * The meta object literal for the 'Operation Ref' reference feature. + * + * + * @generated + */ + EReference INPUT_OUTPUT_BINDING__OPERATION_REF = eINSTANCE.getInputOutputBinding_OperationRef(); + + /** + * The meta object literal for the 'Output Data Ref' reference feature. + * + * + * @generated + */ + EReference INPUT_OUTPUT_BINDING__OUTPUT_DATA_REF = eINSTANCE.getInputOutputBinding_OutputDataRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.InputOutputSpecificationImpl Input Output Specification}' class. + * + * + * @see org.eclipse.bpmn2.impl.InputOutputSpecificationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getInputOutputSpecification() + * @generated + */ + EClass INPUT_OUTPUT_SPECIFICATION = eINSTANCE.getInputOutputSpecification(); + + /** + * The meta object literal for the 'Data Inputs' containment reference list feature. + * + * + * @generated + */ + EReference INPUT_OUTPUT_SPECIFICATION__DATA_INPUTS = eINSTANCE.getInputOutputSpecification_DataInputs(); + + /** + * The meta object literal for the 'Data Outputs' containment reference list feature. + * + * + * @generated + */ + EReference INPUT_OUTPUT_SPECIFICATION__DATA_OUTPUTS = eINSTANCE.getInputOutputSpecification_DataOutputs(); + + /** + * The meta object literal for the 'Input Sets' containment reference list feature. + * + * + * @generated + */ + EReference INPUT_OUTPUT_SPECIFICATION__INPUT_SETS = eINSTANCE.getInputOutputSpecification_InputSets(); + + /** + * The meta object literal for the 'Output Sets' containment reference list feature. + * + * + * @generated + */ + EReference INPUT_OUTPUT_SPECIFICATION__OUTPUT_SETS = eINSTANCE.getInputOutputSpecification_OutputSets(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.InputSetImpl Input Set}' class. + * + * + * @see org.eclipse.bpmn2.impl.InputSetImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getInputSet() + * @generated + */ + EClass INPUT_SET = eINSTANCE.getInputSet(); + + /** + * The meta object literal for the 'Data Input Refs' reference list feature. + * + * + * @generated + */ + EReference INPUT_SET__DATA_INPUT_REFS = eINSTANCE.getInputSet_DataInputRefs(); + + /** + * The meta object literal for the 'Optional Input Refs' reference list feature. + * + * + * @generated + */ + EReference INPUT_SET__OPTIONAL_INPUT_REFS = eINSTANCE.getInputSet_OptionalInputRefs(); + + /** + * The meta object literal for the 'While Executing Input Refs' reference list feature. + * + * + * @generated + */ + EReference INPUT_SET__WHILE_EXECUTING_INPUT_REFS = eINSTANCE.getInputSet_WhileExecutingInputRefs(); + + /** + * The meta object literal for the 'Output Set Refs' reference list feature. + * + * + * @generated + */ + EReference INPUT_SET__OUTPUT_SET_REFS = eINSTANCE.getInputSet_OutputSetRefs(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute INPUT_SET__NAME = eINSTANCE.getInputSet_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.InteractionNodeImpl Interaction Node}' class. + * + * + * @see org.eclipse.bpmn2.impl.InteractionNodeImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getInteractionNode() + * @generated + */ + EClass INTERACTION_NODE = eINSTANCE.getInteractionNode(); + + /** + * The meta object literal for the 'Incoming Conversation Links' reference list feature. + * + * + * @generated + */ + EReference INTERACTION_NODE__INCOMING_CONVERSATION_LINKS = eINSTANCE + .getInteractionNode_IncomingConversationLinks(); + + /** + * The meta object literal for the 'Outgoing Conversation Links' reference list feature. + * + * + * @generated + */ + EReference INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS = eINSTANCE + .getInteractionNode_OutgoingConversationLinks(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.InterfaceImpl Interface}' class. + * + * + * @see org.eclipse.bpmn2.impl.InterfaceImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getInterface() + * @generated + */ + EClass INTERFACE = eINSTANCE.getInterface(); + + /** + * The meta object literal for the 'Operations' containment reference list feature. + * + * + * @generated + */ + EReference INTERFACE__OPERATIONS = eINSTANCE.getInterface_Operations(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute INTERFACE__NAME = eINSTANCE.getInterface_Name(); + + /** + * The meta object literal for the 'Implementation Ref' attribute feature. + * + * + * @generated + */ + EAttribute INTERFACE__IMPLEMENTATION_REF = eINSTANCE.getInterface_ImplementationRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.IntermediateCatchEventImpl Intermediate Catch Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.IntermediateCatchEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getIntermediateCatchEvent() + * @generated + */ + EClass INTERMEDIATE_CATCH_EVENT = eINSTANCE.getIntermediateCatchEvent(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.IntermediateThrowEventImpl Intermediate Throw Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.IntermediateThrowEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getIntermediateThrowEvent() + * @generated + */ + EClass INTERMEDIATE_THROW_EVENT = eINSTANCE.getIntermediateThrowEvent(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ItemAwareElementImpl Item Aware Element}' class. + * + * + * @see org.eclipse.bpmn2.impl.ItemAwareElementImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getItemAwareElement() + * @generated + */ + EClass ITEM_AWARE_ELEMENT = eINSTANCE.getItemAwareElement(); + + /** + * The meta object literal for the 'Data State' containment reference feature. + * + * + * @generated + */ + EReference ITEM_AWARE_ELEMENT__DATA_STATE = eINSTANCE.getItemAwareElement_DataState(); + + /** + * The meta object literal for the 'Item Subject Ref' reference feature. + * + * + * @generated + */ + EReference ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF = eINSTANCE.getItemAwareElement_ItemSubjectRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ItemDefinitionImpl Item Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.ItemDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getItemDefinition() + * @generated + */ + EClass ITEM_DEFINITION = eINSTANCE.getItemDefinition(); + + /** + * The meta object literal for the 'Is Collection' attribute feature. + * + * + * @generated + */ + EAttribute ITEM_DEFINITION__IS_COLLECTION = eINSTANCE.getItemDefinition_IsCollection(); + + /** + * The meta object literal for the 'Import' reference feature. + * + * + * @generated + */ + EReference ITEM_DEFINITION__IMPORT = eINSTANCE.getItemDefinition_Import(); + + /** + * The meta object literal for the 'Item Kind' attribute feature. + * + * + * @generated + */ + EAttribute ITEM_DEFINITION__ITEM_KIND = eINSTANCE.getItemDefinition_ItemKind(); + + /** + * The meta object literal for the 'Structure Ref' attribute feature. + * + * + * @generated + */ + EAttribute ITEM_DEFINITION__STRUCTURE_REF = eINSTANCE.getItemDefinition_StructureRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.LaneImpl Lane}' class. + * + * + * @see org.eclipse.bpmn2.impl.LaneImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getLane() + * @generated + */ + EClass LANE = eINSTANCE.getLane(); + + /** + * The meta object literal for the 'Partition Element' containment reference feature. + * + * + * @generated + */ + EReference LANE__PARTITION_ELEMENT = eINSTANCE.getLane_PartitionElement(); + + /** + * The meta object literal for the 'Flow Node Refs' reference list feature. + * + * + * @generated + */ + EReference LANE__FLOW_NODE_REFS = eINSTANCE.getLane_FlowNodeRefs(); + + /** + * The meta object literal for the 'Child Lane Set' containment reference feature. + * + * + * @generated + */ + EReference LANE__CHILD_LANE_SET = eINSTANCE.getLane_ChildLaneSet(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute LANE__NAME = eINSTANCE.getLane_Name(); + + /** + * The meta object literal for the 'Partition Element Ref' reference feature. + * + * + * @generated + */ + EReference LANE__PARTITION_ELEMENT_REF = eINSTANCE.getLane_PartitionElementRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.LaneSetImpl Lane Set}' class. + * + * + * @see org.eclipse.bpmn2.impl.LaneSetImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getLaneSet() + * @generated + */ + EClass LANE_SET = eINSTANCE.getLaneSet(); + + /** + * The meta object literal for the 'Lanes' containment reference list feature. + * + * + * @generated + */ + EReference LANE_SET__LANES = eINSTANCE.getLaneSet_Lanes(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute LANE_SET__NAME = eINSTANCE.getLaneSet_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.LinkEventDefinitionImpl Link Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.LinkEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getLinkEventDefinition() + * @generated + */ + EClass LINK_EVENT_DEFINITION = eINSTANCE.getLinkEventDefinition(); + + /** + * The meta object literal for the 'Source' reference list feature. + * + * + * @generated + */ + EReference LINK_EVENT_DEFINITION__SOURCE = eINSTANCE.getLinkEventDefinition_Source(); + + /** + * The meta object literal for the 'Target' reference feature. + * + * + * @generated + */ + EReference LINK_EVENT_DEFINITION__TARGET = eINSTANCE.getLinkEventDefinition_Target(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute LINK_EVENT_DEFINITION__NAME = eINSTANCE.getLinkEventDefinition_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.LoopCharacteristicsImpl Loop Characteristics}' class. + * + * + * @see org.eclipse.bpmn2.impl.LoopCharacteristicsImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getLoopCharacteristics() + * @generated + */ + EClass LOOP_CHARACTERISTICS = eINSTANCE.getLoopCharacteristics(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ManualTaskImpl Manual Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.ManualTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getManualTask() + * @generated + */ + EClass MANUAL_TASK = eINSTANCE.getManualTask(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.MessageImpl Message}' class. + * + * + * @see org.eclipse.bpmn2.impl.MessageImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMessage() + * @generated + */ + EClass MESSAGE = eINSTANCE.getMessage(); + + /** + * The meta object literal for the 'Item Ref' reference feature. + * + * + * @generated + */ + EReference MESSAGE__ITEM_REF = eINSTANCE.getMessage_ItemRef(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute MESSAGE__NAME = eINSTANCE.getMessage_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.MessageEventDefinitionImpl Message Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.MessageEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMessageEventDefinition() + * @generated + */ + EClass MESSAGE_EVENT_DEFINITION = eINSTANCE.getMessageEventDefinition(); + + /** + * The meta object literal for the 'Operation Ref' reference feature. + * + * + * @generated + */ + EReference MESSAGE_EVENT_DEFINITION__OPERATION_REF = eINSTANCE.getMessageEventDefinition_OperationRef(); + + /** + * The meta object literal for the 'Message Ref' reference feature. + * + * + * @generated + */ + EReference MESSAGE_EVENT_DEFINITION__MESSAGE_REF = eINSTANCE.getMessageEventDefinition_MessageRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.MessageFlowImpl Message Flow}' class. + * + * + * @see org.eclipse.bpmn2.impl.MessageFlowImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMessageFlow() + * @generated + */ + EClass MESSAGE_FLOW = eINSTANCE.getMessageFlow(); + + /** + * The meta object literal for the 'Message Ref' reference feature. + * + * + * @generated + */ + EReference MESSAGE_FLOW__MESSAGE_REF = eINSTANCE.getMessageFlow_MessageRef(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute MESSAGE_FLOW__NAME = eINSTANCE.getMessageFlow_Name(); + + /** + * The meta object literal for the 'Source Ref' reference feature. + * + * + * @generated + */ + EReference MESSAGE_FLOW__SOURCE_REF = eINSTANCE.getMessageFlow_SourceRef(); + + /** + * The meta object literal for the 'Target Ref' reference feature. + * + * + * @generated + */ + EReference MESSAGE_FLOW__TARGET_REF = eINSTANCE.getMessageFlow_TargetRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.MessageFlowAssociationImpl Message Flow Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.MessageFlowAssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMessageFlowAssociation() + * @generated + */ + EClass MESSAGE_FLOW_ASSOCIATION = eINSTANCE.getMessageFlowAssociation(); + + /** + * The meta object literal for the 'Inner Message Flow Ref' reference feature. + * + * + * @generated + */ + EReference MESSAGE_FLOW_ASSOCIATION__INNER_MESSAGE_FLOW_REF = eINSTANCE + .getMessageFlowAssociation_InnerMessageFlowRef(); + + /** + * The meta object literal for the 'Outer Message Flow Ref' reference feature. + * + * + * @generated + */ + EReference MESSAGE_FLOW_ASSOCIATION__OUTER_MESSAGE_FLOW_REF = eINSTANCE + .getMessageFlowAssociation_OuterMessageFlowRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.MonitoringImpl Monitoring}' class. + * + * + * @see org.eclipse.bpmn2.impl.MonitoringImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMonitoring() + * @generated + */ + EClass MONITORING = eINSTANCE.getMonitoring(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl Multi Instance Loop Characteristics}' class. + * + * + * @see org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMultiInstanceLoopCharacteristics() + * @generated + */ + EClass MULTI_INSTANCE_LOOP_CHARACTERISTICS = eINSTANCE.getMultiInstanceLoopCharacteristics(); + + /** + * The meta object literal for the 'Loop Cardinality' containment reference feature. + * + * + * @generated + */ + EReference MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_CARDINALITY = eINSTANCE + .getMultiInstanceLoopCharacteristics_LoopCardinality(); + + /** + * The meta object literal for the 'Loop Data Input Ref' reference feature. + * + * + * @generated + */ + EReference MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_INPUT_REF = eINSTANCE + .getMultiInstanceLoopCharacteristics_LoopDataInputRef(); + + /** + * The meta object literal for the 'Loop Data Output Ref' reference feature. + * + * + * @generated + */ + EReference MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_OUTPUT_REF = eINSTANCE + .getMultiInstanceLoopCharacteristics_LoopDataOutputRef(); + + /** + * The meta object literal for the 'Input Data Item' containment reference feature. + * + * + * @generated + */ + EReference MULTI_INSTANCE_LOOP_CHARACTERISTICS__INPUT_DATA_ITEM = eINSTANCE + .getMultiInstanceLoopCharacteristics_InputDataItem(); + + /** + * The meta object literal for the 'Output Data Item' containment reference feature. + * + * + * @generated + */ + EReference MULTI_INSTANCE_LOOP_CHARACTERISTICS__OUTPUT_DATA_ITEM = eINSTANCE + .getMultiInstanceLoopCharacteristics_OutputDataItem(); + + /** + * The meta object literal for the 'Complex Behavior Definition' containment reference list feature. + * + * + * @generated + */ + EReference MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLEX_BEHAVIOR_DEFINITION = eINSTANCE + .getMultiInstanceLoopCharacteristics_ComplexBehaviorDefinition(); + + /** + * The meta object literal for the 'Completion Condition' containment reference feature. + * + * + * @generated + */ + EReference MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLETION_CONDITION = eINSTANCE + .getMultiInstanceLoopCharacteristics_CompletionCondition(); + + /** + * The meta object literal for the 'Behavior' attribute feature. + * + * + * @generated + */ + EAttribute MULTI_INSTANCE_LOOP_CHARACTERISTICS__BEHAVIOR = eINSTANCE + .getMultiInstanceLoopCharacteristics_Behavior(); + + /** + * The meta object literal for the 'Is Sequential' attribute feature. + * + * + * @generated + */ + EAttribute MULTI_INSTANCE_LOOP_CHARACTERISTICS__IS_SEQUENTIAL = eINSTANCE + .getMultiInstanceLoopCharacteristics_IsSequential(); + + /** + * The meta object literal for the 'None Behavior Event Ref' reference feature. + * + * + * @generated + */ + EReference MULTI_INSTANCE_LOOP_CHARACTERISTICS__NONE_BEHAVIOR_EVENT_REF = eINSTANCE + .getMultiInstanceLoopCharacteristics_NoneBehaviorEventRef(); + + /** + * The meta object literal for the 'One Behavior Event Ref' reference feature. + * + * + * @generated + */ + EReference MULTI_INSTANCE_LOOP_CHARACTERISTICS__ONE_BEHAVIOR_EVENT_REF = eINSTANCE + .getMultiInstanceLoopCharacteristics_OneBehaviorEventRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.OperationImpl Operation}' class. + * + * + * @see org.eclipse.bpmn2.impl.OperationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getOperation() + * @generated + */ + EClass OPERATION = eINSTANCE.getOperation(); + + /** + * The meta object literal for the 'In Message Ref' reference feature. + * + * + * @generated + */ + EReference OPERATION__IN_MESSAGE_REF = eINSTANCE.getOperation_InMessageRef(); + + /** + * The meta object literal for the 'Out Message Ref' reference feature. + * + * + * @generated + */ + EReference OPERATION__OUT_MESSAGE_REF = eINSTANCE.getOperation_OutMessageRef(); + + /** + * The meta object literal for the 'Error Refs' reference list feature. + * + * + * @generated + */ + EReference OPERATION__ERROR_REFS = eINSTANCE.getOperation_ErrorRefs(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute OPERATION__NAME = eINSTANCE.getOperation_Name(); + + /** + * The meta object literal for the 'Implementation Ref' attribute feature. + * + * + * @generated + */ + EAttribute OPERATION__IMPLEMENTATION_REF = eINSTANCE.getOperation_ImplementationRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.OutputSetImpl Output Set}' class. + * + * + * @see org.eclipse.bpmn2.impl.OutputSetImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getOutputSet() + * @generated + */ + EClass OUTPUT_SET = eINSTANCE.getOutputSet(); + + /** + * The meta object literal for the 'Data Output Refs' reference list feature. + * + * + * @generated + */ + EReference OUTPUT_SET__DATA_OUTPUT_REFS = eINSTANCE.getOutputSet_DataOutputRefs(); + + /** + * The meta object literal for the 'Optional Output Refs' reference list feature. + * + * + * @generated + */ + EReference OUTPUT_SET__OPTIONAL_OUTPUT_REFS = eINSTANCE.getOutputSet_OptionalOutputRefs(); + + /** + * The meta object literal for the 'While Executing Output Refs' reference list feature. + * + * + * @generated + */ + EReference OUTPUT_SET__WHILE_EXECUTING_OUTPUT_REFS = eINSTANCE.getOutputSet_WhileExecutingOutputRefs(); + + /** + * The meta object literal for the 'Input Set Refs' reference list feature. + * + * + * @generated + */ + EReference OUTPUT_SET__INPUT_SET_REFS = eINSTANCE.getOutputSet_InputSetRefs(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute OUTPUT_SET__NAME = eINSTANCE.getOutputSet_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ParallelGatewayImpl Parallel Gateway}' class. + * + * + * @see org.eclipse.bpmn2.impl.ParallelGatewayImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getParallelGateway() + * @generated + */ + EClass PARALLEL_GATEWAY = eINSTANCE.getParallelGateway(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ParticipantImpl Participant}' class. + * + * + * @see org.eclipse.bpmn2.impl.ParticipantImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getParticipant() + * @generated + */ + EClass PARTICIPANT = eINSTANCE.getParticipant(); + + /** + * The meta object literal for the 'Interface Refs' reference list feature. + * + * + * @generated + */ + EReference PARTICIPANT__INTERFACE_REFS = eINSTANCE.getParticipant_InterfaceRefs(); + + /** + * The meta object literal for the 'End Point Refs' reference list feature. + * + * + * @generated + */ + EReference PARTICIPANT__END_POINT_REFS = eINSTANCE.getParticipant_EndPointRefs(); + + /** + * The meta object literal for the 'Participant Multiplicity' containment reference feature. + * + * + * @generated + */ + EReference PARTICIPANT__PARTICIPANT_MULTIPLICITY = eINSTANCE.getParticipant_ParticipantMultiplicity(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute PARTICIPANT__NAME = eINSTANCE.getParticipant_Name(); + + /** + * The meta object literal for the 'Process Ref' reference feature. + * + * + * @generated + */ + EReference PARTICIPANT__PROCESS_REF = eINSTANCE.getParticipant_ProcessRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ParticipantAssociationImpl Participant Association}' class. + * + * + * @see org.eclipse.bpmn2.impl.ParticipantAssociationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getParticipantAssociation() + * @generated + */ + EClass PARTICIPANT_ASSOCIATION = eINSTANCE.getParticipantAssociation(); + + /** + * The meta object literal for the 'Inner Participant Ref' reference feature. + * + * + * @generated + */ + EReference PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF = eINSTANCE + .getParticipantAssociation_InnerParticipantRef(); + + /** + * The meta object literal for the 'Outer Participant Ref' reference feature. + * + * + * @generated + */ + EReference PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF = eINSTANCE + .getParticipantAssociation_OuterParticipantRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ParticipantMultiplicityImpl Participant Multiplicity}' class. + * + * + * @see org.eclipse.bpmn2.impl.ParticipantMultiplicityImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getParticipantMultiplicity() + * @generated + */ + EClass PARTICIPANT_MULTIPLICITY = eINSTANCE.getParticipantMultiplicity(); + + /** + * The meta object literal for the 'Maximum' attribute feature. + * + * + * @generated + */ + EAttribute PARTICIPANT_MULTIPLICITY__MAXIMUM = eINSTANCE.getParticipantMultiplicity_Maximum(); + + /** + * The meta object literal for the 'Minimum' attribute feature. + * + * + * @generated + */ + EAttribute PARTICIPANT_MULTIPLICITY__MINIMUM = eINSTANCE.getParticipantMultiplicity_Minimum(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.PartnerEntityImpl Partner Entity}' class. + * + * + * @see org.eclipse.bpmn2.impl.PartnerEntityImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getPartnerEntity() + * @generated + */ + EClass PARTNER_ENTITY = eINSTANCE.getPartnerEntity(); + + /** + * The meta object literal for the 'Participant Ref' reference list feature. + * + * + * @generated + */ + EReference PARTNER_ENTITY__PARTICIPANT_REF = eINSTANCE.getPartnerEntity_ParticipantRef(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute PARTNER_ENTITY__NAME = eINSTANCE.getPartnerEntity_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.PartnerRoleImpl Partner Role}' class. + * + * + * @see org.eclipse.bpmn2.impl.PartnerRoleImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getPartnerRole() + * @generated + */ + EClass PARTNER_ROLE = eINSTANCE.getPartnerRole(); + + /** + * The meta object literal for the 'Participant Ref' reference list feature. + * + * + * @generated + */ + EReference PARTNER_ROLE__PARTICIPANT_REF = eINSTANCE.getPartnerRole_ParticipantRef(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute PARTNER_ROLE__NAME = eINSTANCE.getPartnerRole_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.PerformerImpl Performer}' class. + * + * + * @see org.eclipse.bpmn2.impl.PerformerImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getPerformer() + * @generated + */ + EClass PERFORMER = eINSTANCE.getPerformer(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.PotentialOwnerImpl Potential Owner}' class. + * + * + * @see org.eclipse.bpmn2.impl.PotentialOwnerImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getPotentialOwner() + * @generated + */ + EClass POTENTIAL_OWNER = eINSTANCE.getPotentialOwner(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ProcessImpl Process}' class. + * + * + * @see org.eclipse.bpmn2.impl.ProcessImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getProcess() + * @generated + */ + EClass PROCESS = eINSTANCE.getProcess(); + + /** + * The meta object literal for the 'Auditing' containment reference feature. + * + * + * @generated + */ + EReference PROCESS__AUDITING = eINSTANCE.getProcess_Auditing(); + + /** + * The meta object literal for the 'Monitoring' containment reference feature. + * + * + * @generated + */ + EReference PROCESS__MONITORING = eINSTANCE.getProcess_Monitoring(); + + /** + * The meta object literal for the 'Properties' containment reference list feature. + * + * + * @generated + */ + EReference PROCESS__PROPERTIES = eINSTANCE.getProcess_Properties(); + + /** + * The meta object literal for the 'Artifacts' containment reference list feature. + * + * + * @generated + */ + EReference PROCESS__ARTIFACTS = eINSTANCE.getProcess_Artifacts(); + + /** + * The meta object literal for the 'Resources' containment reference list feature. + * + * + * @generated + */ + EReference PROCESS__RESOURCES = eINSTANCE.getProcess_Resources(); + + /** + * The meta object literal for the 'Correlation Subscriptions' containment reference list feature. + * + * + * @generated + */ + EReference PROCESS__CORRELATION_SUBSCRIPTIONS = eINSTANCE.getProcess_CorrelationSubscriptions(); + + /** + * The meta object literal for the 'Supports' reference list feature. + * + * + * @generated + */ + EReference PROCESS__SUPPORTS = eINSTANCE.getProcess_Supports(); + + /** + * The meta object literal for the 'Definitional Collaboration Ref' reference feature. + * + * + * @generated + */ + EReference PROCESS__DEFINITIONAL_COLLABORATION_REF = eINSTANCE.getProcess_DefinitionalCollaborationRef(); + + /** + * The meta object literal for the 'Is Closed' attribute feature. + * + * + * @generated + */ + EAttribute PROCESS__IS_CLOSED = eINSTANCE.getProcess_IsClosed(); + + /** + * The meta object literal for the 'Is Executable' attribute feature. + * + * + * @generated + */ + EAttribute PROCESS__IS_EXECUTABLE = eINSTANCE.getProcess_IsExecutable(); + + /** + * The meta object literal for the 'Process Type' attribute feature. + * + * + * @generated + */ + EAttribute PROCESS__PROCESS_TYPE = eINSTANCE.getProcess_ProcessType(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.PropertyImpl Property}' class. + * + * + * @see org.eclipse.bpmn2.impl.PropertyImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getProperty() + * @generated + */ + EClass PROPERTY = eINSTANCE.getProperty(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute PROPERTY__NAME = eINSTANCE.getProperty_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ReceiveTaskImpl Receive Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.ReceiveTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getReceiveTask() + * @generated + */ + EClass RECEIVE_TASK = eINSTANCE.getReceiveTask(); + + /** + * The meta object literal for the 'Implementation' attribute feature. + * + * + * @generated + */ + EAttribute RECEIVE_TASK__IMPLEMENTATION = eINSTANCE.getReceiveTask_Implementation(); + + /** + * The meta object literal for the 'Instantiate' attribute feature. + * + * + * @generated + */ + EAttribute RECEIVE_TASK__INSTANTIATE = eINSTANCE.getReceiveTask_Instantiate(); + + /** + * The meta object literal for the 'Message Ref' reference feature. + * + * + * @generated + */ + EReference RECEIVE_TASK__MESSAGE_REF = eINSTANCE.getReceiveTask_MessageRef(); + + /** + * The meta object literal for the 'Operation Ref' reference feature. + * + * + * @generated + */ + EReference RECEIVE_TASK__OPERATION_REF = eINSTANCE.getReceiveTask_OperationRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.RelationshipImpl Relationship}' class. + * + * + * @see org.eclipse.bpmn2.impl.RelationshipImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getRelationship() + * @generated + */ + EClass RELATIONSHIP = eINSTANCE.getRelationship(); + + /** + * The meta object literal for the 'Sources' reference list feature. + * + * + * @generated + */ + EReference RELATIONSHIP__SOURCES = eINSTANCE.getRelationship_Sources(); + + /** + * The meta object literal for the 'Targets' reference list feature. + * + * + * @generated + */ + EReference RELATIONSHIP__TARGETS = eINSTANCE.getRelationship_Targets(); + + /** + * The meta object literal for the 'Direction' attribute feature. + * + * + * @generated + */ + EAttribute RELATIONSHIP__DIRECTION = eINSTANCE.getRelationship_Direction(); + + /** + * The meta object literal for the 'Type' attribute feature. + * + * + * @generated + */ + EAttribute RELATIONSHIP__TYPE = eINSTANCE.getRelationship_Type(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.RenderingImpl Rendering}' class. + * + * + * @see org.eclipse.bpmn2.impl.RenderingImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getRendering() + * @generated + */ + EClass RENDERING = eINSTANCE.getRendering(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ResourceImpl Resource}' class. + * + * + * @see org.eclipse.bpmn2.impl.ResourceImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getResource() + * @generated + */ + EClass RESOURCE = eINSTANCE.getResource(); + + /** + * The meta object literal for the 'Resource Parameters' containment reference list feature. + * + * + * @generated + */ + EReference RESOURCE__RESOURCE_PARAMETERS = eINSTANCE.getResource_ResourceParameters(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute RESOURCE__NAME = eINSTANCE.getResource_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ResourceAssignmentExpressionImpl Resource Assignment Expression}' class. + * + * + * @see org.eclipse.bpmn2.impl.ResourceAssignmentExpressionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getResourceAssignmentExpression() + * @generated + */ + EClass RESOURCE_ASSIGNMENT_EXPRESSION = eINSTANCE.getResourceAssignmentExpression(); + + /** + * The meta object literal for the 'Expression' containment reference feature. + * + * + * @generated + */ + EReference RESOURCE_ASSIGNMENT_EXPRESSION__EXPRESSION = eINSTANCE.getResourceAssignmentExpression_Expression(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ResourceParameterImpl Resource Parameter}' class. + * + * + * @see org.eclipse.bpmn2.impl.ResourceParameterImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getResourceParameter() + * @generated + */ + EClass RESOURCE_PARAMETER = eINSTANCE.getResourceParameter(); + + /** + * The meta object literal for the 'Is Required' attribute feature. + * + * + * @generated + */ + EAttribute RESOURCE_PARAMETER__IS_REQUIRED = eINSTANCE.getResourceParameter_IsRequired(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute RESOURCE_PARAMETER__NAME = eINSTANCE.getResourceParameter_Name(); + + /** + * The meta object literal for the 'Type' reference feature. + * + * + * @generated + */ + EReference RESOURCE_PARAMETER__TYPE = eINSTANCE.getResourceParameter_Type(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ResourceParameterBindingImpl Resource Parameter Binding}' class. + * + * + * @see org.eclipse.bpmn2.impl.ResourceParameterBindingImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getResourceParameterBinding() + * @generated + */ + EClass RESOURCE_PARAMETER_BINDING = eINSTANCE.getResourceParameterBinding(); + + /** + * The meta object literal for the 'Expression' containment reference feature. + * + * + * @generated + */ + EReference RESOURCE_PARAMETER_BINDING__EXPRESSION = eINSTANCE.getResourceParameterBinding_Expression(); + + /** + * The meta object literal for the 'Parameter Ref' reference feature. + * + * + * @generated + */ + EReference RESOURCE_PARAMETER_BINDING__PARAMETER_REF = eINSTANCE.getResourceParameterBinding_ParameterRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ResourceRoleImpl Resource Role}' class. + * + * + * @see org.eclipse.bpmn2.impl.ResourceRoleImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getResourceRole() + * @generated + */ + EClass RESOURCE_ROLE = eINSTANCE.getResourceRole(); + + /** + * The meta object literal for the 'Resource Ref' reference feature. + * + * + * @generated + */ + EReference RESOURCE_ROLE__RESOURCE_REF = eINSTANCE.getResourceRole_ResourceRef(); + + /** + * The meta object literal for the 'Resource Parameter Bindings' containment reference list feature. + * + * + * @generated + */ + EReference RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS = eINSTANCE.getResourceRole_ResourceParameterBindings(); + + /** + * The meta object literal for the 'Resource Assignment Expression' containment reference feature. + * + * + * @generated + */ + EReference RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION = eINSTANCE + .getResourceRole_ResourceAssignmentExpression(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute RESOURCE_ROLE__NAME = eINSTANCE.getResourceRole_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.RootElementImpl Root Element}' class. + * + * + * @see org.eclipse.bpmn2.impl.RootElementImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getRootElement() + * @generated + */ + EClass ROOT_ELEMENT = eINSTANCE.getRootElement(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ScriptTaskImpl Script Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.ScriptTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getScriptTask() + * @generated + */ + EClass SCRIPT_TASK = eINSTANCE.getScriptTask(); + + /** + * The meta object literal for the 'Script' attribute feature. + * + * + * @generated + */ + EAttribute SCRIPT_TASK__SCRIPT = eINSTANCE.getScriptTask_Script(); + + /** + * The meta object literal for the 'Script Format' attribute feature. + * + * + * @generated + */ + EAttribute SCRIPT_TASK__SCRIPT_FORMAT = eINSTANCE.getScriptTask_ScriptFormat(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.SendTaskImpl Send Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.SendTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSendTask() + * @generated + */ + EClass SEND_TASK = eINSTANCE.getSendTask(); + + /** + * The meta object literal for the 'Implementation' attribute feature. + * + * + * @generated + */ + EAttribute SEND_TASK__IMPLEMENTATION = eINSTANCE.getSendTask_Implementation(); + + /** + * The meta object literal for the 'Message Ref' reference feature. + * + * + * @generated + */ + EReference SEND_TASK__MESSAGE_REF = eINSTANCE.getSendTask_MessageRef(); + + /** + * The meta object literal for the 'Operation Ref' reference feature. + * + * + * @generated + */ + EReference SEND_TASK__OPERATION_REF = eINSTANCE.getSendTask_OperationRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.SequenceFlowImpl Sequence Flow}' class. + * + * + * @see org.eclipse.bpmn2.impl.SequenceFlowImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSequenceFlow() + * @generated + */ + EClass SEQUENCE_FLOW = eINSTANCE.getSequenceFlow(); + + /** + * The meta object literal for the 'Condition Expression' containment reference feature. + * + * + * @generated + */ + EReference SEQUENCE_FLOW__CONDITION_EXPRESSION = eINSTANCE.getSequenceFlow_ConditionExpression(); + + /** + * The meta object literal for the 'Is Immediate' attribute feature. + * + * + * @generated + */ + EAttribute SEQUENCE_FLOW__IS_IMMEDIATE = eINSTANCE.getSequenceFlow_IsImmediate(); + + /** + * The meta object literal for the 'Source Ref' reference feature. + * + * + * @generated + */ + EReference SEQUENCE_FLOW__SOURCE_REF = eINSTANCE.getSequenceFlow_SourceRef(); + + /** + * The meta object literal for the 'Target Ref' reference feature. + * + * + * @generated + */ + EReference SEQUENCE_FLOW__TARGET_REF = eINSTANCE.getSequenceFlow_TargetRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ServiceTaskImpl Service Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.ServiceTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getServiceTask() + * @generated + */ + EClass SERVICE_TASK = eINSTANCE.getServiceTask(); + + /** + * The meta object literal for the 'Implementation' attribute feature. + * + * + * @generated + */ + EAttribute SERVICE_TASK__IMPLEMENTATION = eINSTANCE.getServiceTask_Implementation(); + + /** + * The meta object literal for the 'Operation Ref' reference feature. + * + * + * @generated + */ + EReference SERVICE_TASK__OPERATION_REF = eINSTANCE.getServiceTask_OperationRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.SignalImpl Signal}' class. + * + * + * @see org.eclipse.bpmn2.impl.SignalImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSignal() + * @generated + */ + EClass SIGNAL = eINSTANCE.getSignal(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute SIGNAL__NAME = eINSTANCE.getSignal_Name(); + + /** + * The meta object literal for the 'Structure Ref' reference feature. + * + * + * @generated + */ + EReference SIGNAL__STRUCTURE_REF = eINSTANCE.getSignal_StructureRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.SignalEventDefinitionImpl Signal Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.SignalEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSignalEventDefinition() + * @generated + */ + EClass SIGNAL_EVENT_DEFINITION = eINSTANCE.getSignalEventDefinition(); + + /** + * The meta object literal for the 'Signal Ref' attribute feature. + * + * + * @generated + */ + EAttribute SIGNAL_EVENT_DEFINITION__SIGNAL_REF = eINSTANCE.getSignalEventDefinition_SignalRef(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.StandardLoopCharacteristicsImpl Standard Loop Characteristics}' class. + * + * + * @see org.eclipse.bpmn2.impl.StandardLoopCharacteristicsImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getStandardLoopCharacteristics() + * @generated + */ + EClass STANDARD_LOOP_CHARACTERISTICS = eINSTANCE.getStandardLoopCharacteristics(); + + /** + * The meta object literal for the 'Loop Condition' containment reference feature. + * + * + * @generated + */ + EReference STANDARD_LOOP_CHARACTERISTICS__LOOP_CONDITION = eINSTANCE + .getStandardLoopCharacteristics_LoopCondition(); + + /** + * The meta object literal for the 'Loop Maximum' containment reference feature. + * + * + * @generated + */ + EReference STANDARD_LOOP_CHARACTERISTICS__LOOP_MAXIMUM = eINSTANCE.getStandardLoopCharacteristics_LoopMaximum(); + + /** + * The meta object literal for the 'Test Before' attribute feature. + * + * + * @generated + */ + EAttribute STANDARD_LOOP_CHARACTERISTICS__TEST_BEFORE = eINSTANCE.getStandardLoopCharacteristics_TestBefore(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.StartEventImpl Start Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.StartEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getStartEvent() + * @generated + */ + EClass START_EVENT = eINSTANCE.getStartEvent(); + + /** + * The meta object literal for the 'Is Interrupting' attribute feature. + * + * + * @generated + */ + EAttribute START_EVENT__IS_INTERRUPTING = eINSTANCE.getStartEvent_IsInterrupting(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.SubChoreographyImpl Sub Choreography}' class. + * + * + * @see org.eclipse.bpmn2.impl.SubChoreographyImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSubChoreography() + * @generated + */ + EClass SUB_CHOREOGRAPHY = eINSTANCE.getSubChoreography(); + + /** + * The meta object literal for the 'Artifacts' containment reference list feature. + * + * + * @generated + */ + EReference SUB_CHOREOGRAPHY__ARTIFACTS = eINSTANCE.getSubChoreography_Artifacts(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.SubConversationImpl Sub Conversation}' class. + * + * + * @see org.eclipse.bpmn2.impl.SubConversationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSubConversation() + * @generated + */ + EClass SUB_CONVERSATION = eINSTANCE.getSubConversation(); + + /** + * The meta object literal for the 'Conversation Nodes' containment reference list feature. + * + * + * @generated + */ + EReference SUB_CONVERSATION__CONVERSATION_NODES = eINSTANCE.getSubConversation_ConversationNodes(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.SubProcessImpl Sub Process}' class. + * + * + * @see org.eclipse.bpmn2.impl.SubProcessImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getSubProcess() + * @generated + */ + EClass SUB_PROCESS = eINSTANCE.getSubProcess(); + + /** + * The meta object literal for the 'Artifacts' containment reference list feature. + * + * + * @generated + */ + EReference SUB_PROCESS__ARTIFACTS = eINSTANCE.getSubProcess_Artifacts(); + + /** + * The meta object literal for the 'Triggered By Event' attribute feature. + * + * + * @generated + */ + EAttribute SUB_PROCESS__TRIGGERED_BY_EVENT = eINSTANCE.getSubProcess_TriggeredByEvent(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.TaskImpl Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.TaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getTask() + * @generated + */ + EClass TASK = eINSTANCE.getTask(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.TerminateEventDefinitionImpl Terminate Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.TerminateEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getTerminateEventDefinition() + * @generated + */ + EClass TERMINATE_EVENT_DEFINITION = eINSTANCE.getTerminateEventDefinition(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.TextAnnotationImpl Text Annotation}' class. + * + * + * @see org.eclipse.bpmn2.impl.TextAnnotationImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getTextAnnotation() + * @generated + */ + EClass TEXT_ANNOTATION = eINSTANCE.getTextAnnotation(); + + /** + * The meta object literal for the 'Text' attribute feature. + * + * + * @generated + */ + EAttribute TEXT_ANNOTATION__TEXT = eINSTANCE.getTextAnnotation_Text(); + + /** + * The meta object literal for the 'Text Format' attribute feature. + * + * + * @generated + */ + EAttribute TEXT_ANNOTATION__TEXT_FORMAT = eINSTANCE.getTextAnnotation_TextFormat(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.ThrowEventImpl Throw Event}' class. + * + * + * @see org.eclipse.bpmn2.impl.ThrowEventImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getThrowEvent() + * @generated + */ + EClass THROW_EVENT = eINSTANCE.getThrowEvent(); + + /** + * The meta object literal for the 'Data Inputs' containment reference list feature. + * + * + * @generated + */ + EReference THROW_EVENT__DATA_INPUTS = eINSTANCE.getThrowEvent_DataInputs(); + + /** + * The meta object literal for the 'Data Input Association' containment reference list feature. + * + * + * @generated + */ + EReference THROW_EVENT__DATA_INPUT_ASSOCIATION = eINSTANCE.getThrowEvent_DataInputAssociation(); + + /** + * The meta object literal for the 'Input Set' containment reference feature. + * + * + * @generated + */ + EReference THROW_EVENT__INPUT_SET = eINSTANCE.getThrowEvent_InputSet(); + + /** + * The meta object literal for the 'Event Definitions' containment reference list feature. + * + * + * @generated + */ + EReference THROW_EVENT__EVENT_DEFINITIONS = eINSTANCE.getThrowEvent_EventDefinitions(); + + /** + * The meta object literal for the 'Event Definition Refs' reference list feature. + * + * + * @generated + */ + EReference THROW_EVENT__EVENT_DEFINITION_REFS = eINSTANCE.getThrowEvent_EventDefinitionRefs(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.TimerEventDefinitionImpl Timer Event Definition}' class. + * + * + * @see org.eclipse.bpmn2.impl.TimerEventDefinitionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getTimerEventDefinition() + * @generated + */ + EClass TIMER_EVENT_DEFINITION = eINSTANCE.getTimerEventDefinition(); + + /** + * The meta object literal for the 'Time Date' containment reference feature. + * + * + * @generated + */ + EReference TIMER_EVENT_DEFINITION__TIME_DATE = eINSTANCE.getTimerEventDefinition_TimeDate(); + + /** + * The meta object literal for the 'Time Duration' containment reference feature. + * + * + * @generated + */ + EReference TIMER_EVENT_DEFINITION__TIME_DURATION = eINSTANCE.getTimerEventDefinition_TimeDuration(); + + /** + * The meta object literal for the 'Time Cycle' containment reference feature. + * + * + * @generated + */ + EReference TIMER_EVENT_DEFINITION__TIME_CYCLE = eINSTANCE.getTimerEventDefinition_TimeCycle(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.TransactionImpl Transaction}' class. + * + * + * @see org.eclipse.bpmn2.impl.TransactionImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getTransaction() + * @generated + */ + EClass TRANSACTION = eINSTANCE.getTransaction(); + + /** + * The meta object literal for the 'Protocol' attribute feature. + * + * + * @generated + */ + EAttribute TRANSACTION__PROTOCOL = eINSTANCE.getTransaction_Protocol(); + + /** + * The meta object literal for the 'Method' attribute feature. + * + * + * @generated + */ + EAttribute TRANSACTION__METHOD = eINSTANCE.getTransaction_Method(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.UserTaskImpl User Task}' class. + * + * + * @see org.eclipse.bpmn2.impl.UserTaskImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getUserTask() + * @generated + */ + EClass USER_TASK = eINSTANCE.getUserTask(); + + /** + * The meta object literal for the 'Renderings' containment reference list feature. + * + * + * @generated + */ + EReference USER_TASK__RENDERINGS = eINSTANCE.getUserTask_Renderings(); + + /** + * The meta object literal for the 'Implementation' attribute feature. + * + * + * @generated + */ + EAttribute USER_TASK__IMPLEMENTATION = eINSTANCE.getUserTask_Implementation(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.impl.EventSubprocessImpl Event Subprocess}' class. + * + * + * @see org.eclipse.bpmn2.impl.EventSubprocessImpl + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEventSubprocess() + * @generated + */ + EClass EVENT_SUBPROCESS = eINSTANCE.getEventSubprocess(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.AdHocOrdering Ad Hoc Ordering}' enum. + * + * + * @see org.eclipse.bpmn2.AdHocOrdering + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getAdHocOrdering() + * @generated + */ + EEnum AD_HOC_ORDERING = eINSTANCE.getAdHocOrdering(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.AssociationDirection Association Direction}' enum. + * + * + * @see org.eclipse.bpmn2.AssociationDirection + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getAssociationDirection() + * @generated + */ + EEnum ASSOCIATION_DIRECTION = eINSTANCE.getAssociationDirection(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.ChoreographyLoopType Choreography Loop Type}' enum. + * + * + * @see org.eclipse.bpmn2.ChoreographyLoopType + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getChoreographyLoopType() + * @generated + */ + EEnum CHOREOGRAPHY_LOOP_TYPE = eINSTANCE.getChoreographyLoopType(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.EventBasedGatewayType Event Based Gateway Type}' enum. + * + * + * @see org.eclipse.bpmn2.EventBasedGatewayType + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getEventBasedGatewayType() + * @generated + */ + EEnum EVENT_BASED_GATEWAY_TYPE = eINSTANCE.getEventBasedGatewayType(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.GatewayDirection Gateway Direction}' enum. + * + * + * @see org.eclipse.bpmn2.GatewayDirection + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getGatewayDirection() + * @generated + */ + EEnum GATEWAY_DIRECTION = eINSTANCE.getGatewayDirection(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.ItemKind Item Kind}' enum. + * + * + * @see org.eclipse.bpmn2.ItemKind + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getItemKind() + * @generated + */ + EEnum ITEM_KIND = eINSTANCE.getItemKind(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.MultiInstanceBehavior Multi Instance Behavior}' enum. + * + * + * @see org.eclipse.bpmn2.MultiInstanceBehavior + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getMultiInstanceBehavior() + * @generated + */ + EEnum MULTI_INSTANCE_BEHAVIOR = eINSTANCE.getMultiInstanceBehavior(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.ProcessType Process Type}' enum. + * + * + * @see org.eclipse.bpmn2.ProcessType + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getProcessType() + * @generated + */ + EEnum PROCESS_TYPE = eINSTANCE.getProcessType(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.RelationshipDirection Relationship Direction}' enum. + * + * + * @see org.eclipse.bpmn2.RelationshipDirection + * @see org.eclipse.bpmn2.impl.Bpmn2PackageImpl#getRelationshipDirection() + * @generated + */ + EEnum RELATIONSHIP_DIRECTION = eINSTANCE.getRelationshipDirection(); + + } + +} //Bpmn2Package diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/BusinessRuleTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/BusinessRuleTask.java new file mode 100644 index 00000000000..74f91198142 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/BusinessRuleTask.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Business Rule Task'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.BusinessRuleTask#getImplementation Implementation}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getBusinessRuleTask() + * @model extendedMetaData="name='tBusinessRuleTask' kind='elementOnly'" + * @generated + */ +public interface BusinessRuleTask extends Task { + /** + * Returns the value of the 'Implementation' attribute. + * + * + * @return the value of the 'Implementation' attribute. + * @see #setImplementation(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getBusinessRuleTask_Implementation() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='implementation'" + * @generated + */ + String getImplementation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.BusinessRuleTask#getImplementation Implementation}' attribute. + * + * + * @param value the new value of the 'Implementation' attribute. + * @see #getImplementation() + * @generated + */ + void setImplementation(String value); + +} // BusinessRuleTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CallActivity.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CallActivity.java new file mode 100644 index 00000000000..5db1814c1a8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CallActivity.java @@ -0,0 +1,56 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Call Activity'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.CallActivity#getCalledElement Called Element}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCallActivity() + * @model extendedMetaData="name='tCallActivity' kind='elementOnly'" + * @generated + */ +public interface CallActivity extends Activity { + /** + * Returns the value of the 'Called Element' attribute. + * + * + * @return the value of the 'Called Element' attribute. + * @see #setCalledElement(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getCallActivity_CalledElement() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true" ordered="false" + * @generated + */ + String getCalledElement(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CallActivity#getCalledElement Called Element}' attribute. + * + * + * @param value the new value of the 'Called Element' attribute. + * @see #getCalledElement() + * @generated + */ + void setCalledElement(String value); + +} // CallActivity diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CallChoreography.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CallChoreography.java new file mode 100644 index 00000000000..eb9130ae89a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CallChoreography.java @@ -0,0 +1,73 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Call Choreography'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.CallChoreography#getParticipantAssociations Participant Associations}
  • + *
  • {@link org.eclipse.bpmn2.CallChoreography#getCalledChoreographyRef Called Choreography Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCallChoreography() + * @model extendedMetaData="name='tCallChoreography' kind='elementOnly'" + * @generated + */ +public interface CallChoreography extends ChoreographyActivity { + /** + * Returns the value of the 'Participant Associations' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ParticipantAssociation}. + * + * + * @return the value of the 'Participant Associations' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCallChoreography_ParticipantAssociations() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='participantAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getParticipantAssociations(); + + /** + * Returns the value of the 'Called Choreography Ref' reference. + * + * + * @return the value of the 'Called Choreography Ref' reference. + * @see #setCalledChoreographyRef(Choreography) + * @see org.eclipse.bpmn2.Bpmn2Package#getCallChoreography_CalledChoreographyRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='calledChoreographyRef'" + * @generated + */ + Choreography getCalledChoreographyRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CallChoreography#getCalledChoreographyRef Called Choreography Ref}' reference. + * + * + * @param value the new value of the 'Called Choreography Ref' reference. + * @see #getCalledChoreographyRef() + * @generated + */ + void setCalledChoreographyRef(Choreography value); + +} // CallChoreography diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CallConversation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CallConversation.java new file mode 100644 index 00000000000..38443b4aab7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CallConversation.java @@ -0,0 +1,73 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Call Conversation'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.CallConversation#getParticipantAssociations Participant Associations}
  • + *
  • {@link org.eclipse.bpmn2.CallConversation#getCalledCollaborationRef Called Collaboration Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCallConversation() + * @model extendedMetaData="name='tCallConversation' kind='elementOnly'" + * @generated + */ +public interface CallConversation extends ConversationNode { + /** + * Returns the value of the 'Participant Associations' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ParticipantAssociation}. + * + * + * @return the value of the 'Participant Associations' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCallConversation_ParticipantAssociations() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='participantAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getParticipantAssociations(); + + /** + * Returns the value of the 'Called Collaboration Ref' reference. + * + * + * @return the value of the 'Called Collaboration Ref' reference. + * @see #setCalledCollaborationRef(Collaboration) + * @see org.eclipse.bpmn2.Bpmn2Package#getCallConversation_CalledCollaborationRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='calledCollaborationRef'" + * @generated + */ + Collaboration getCalledCollaborationRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CallConversation#getCalledCollaborationRef Called Collaboration Ref}' reference. + * + * + * @param value the new value of the 'Called Collaboration Ref' reference. + * @see #getCalledCollaborationRef() + * @generated + */ + void setCalledCollaborationRef(Collaboration value); + +} // CallConversation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CallableElement.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CallableElement.java new file mode 100644 index 00000000000..3f8dd4f074b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CallableElement.java @@ -0,0 +1,111 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Callable Element'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.CallableElement#getSupportedInterfaceRefs Supported Interface Refs}
  • + *
  • {@link org.eclipse.bpmn2.CallableElement#getIoSpecification Io Specification}
  • + *
  • {@link org.eclipse.bpmn2.CallableElement#getIoBinding Io Binding}
  • + *
  • {@link org.eclipse.bpmn2.CallableElement#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCallableElement() + * @model extendedMetaData="name='tCallableElement' kind='elementOnly' abstract='true'" + * @generated + */ +public interface CallableElement extends RootElement { + /** + * Returns the value of the 'Supported Interface Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Interface}. + * + * + * @return the value of the 'Supported Interface Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCallableElement_SupportedInterfaceRefs() + * @model ordered="false" + * extendedMetaData="kind='element' name='supportedInterfaceRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getSupportedInterfaceRefs(); + + /** + * Returns the value of the 'Io Specification' containment reference. + * + * + * @return the value of the 'Io Specification' containment reference. + * @see #setIoSpecification(InputOutputSpecification) + * @see org.eclipse.bpmn2.Bpmn2Package#getCallableElement_IoSpecification() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='ioSpecification' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + InputOutputSpecification getIoSpecification(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CallableElement#getIoSpecification Io Specification}' containment reference. + * + * + * @param value the new value of the 'Io Specification' containment reference. + * @see #getIoSpecification() + * @generated + */ + void setIoSpecification(InputOutputSpecification value); + + /** + * Returns the value of the 'Io Binding' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.InputOutputBinding}. + * + * + * @return the value of the 'Io Binding' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCallableElement_IoBinding() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='ioBinding' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getIoBinding(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getCallableElement_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CallableElement#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // CallableElement diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CancelEventDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CancelEventDefinition.java new file mode 100644 index 00000000000..8019bd4fd89 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CancelEventDefinition.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Cancel Event Definition'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getCancelEventDefinition() + * @model extendedMetaData="name='tCancelEventDefinition' kind='elementOnly'" + * @generated + */ +public interface CancelEventDefinition extends EventDefinition { +} // CancelEventDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CatchEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CatchEvent.java new file mode 100644 index 00000000000..a3da9421bee --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CatchEvent.java @@ -0,0 +1,140 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Catch Event'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.CatchEvent#getDataOutputs Data Outputs}
  • + *
  • {@link org.eclipse.bpmn2.CatchEvent#getDataOutputAssociation Data Output Association}
  • + *
  • {@link org.eclipse.bpmn2.CatchEvent#getOutputSet Output Set}
  • + *
  • {@link org.eclipse.bpmn2.CatchEvent#getEventDefinitions Event Definitions}
  • + *
  • {@link org.eclipse.bpmn2.CatchEvent#getEventDefinitionRefs Event Definition Refs}
  • + *
  • {@link org.eclipse.bpmn2.CatchEvent#isParallelMultiple Parallel Multiple}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCatchEvent() + * @model abstract="true" + * extendedMetaData="name='tCatchEvent' kind='elementOnly'" + * @generated + */ +public interface CatchEvent extends Event { + /** + * Returns the value of the 'Data Outputs' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataOutput}. + * + * + * @return the value of the 'Data Outputs' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCatchEvent_DataOutputs() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='dataOutput' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getDataOutputs(); + + /** + * Returns the value of the 'Data Output Association' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataOutputAssociation}. + * + * + * @return the value of the 'Data Output Association' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCatchEvent_DataOutputAssociation() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='dataOutputAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getDataOutputAssociation(); + + /** + * Returns the value of the 'Output Set' containment reference. + * + * + * @return the value of the 'Output Set' containment reference. + * @see #setOutputSet(OutputSet) + * @see org.eclipse.bpmn2.Bpmn2Package#getCatchEvent_OutputSet() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='outputSet' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + OutputSet getOutputSet(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CatchEvent#getOutputSet Output Set}' containment reference. + * + * + * @param value the new value of the 'Output Set' containment reference. + * @see #getOutputSet() + * @generated + */ + void setOutputSet(OutputSet value); + + /** + * Returns the value of the 'Event Definitions' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.EventDefinition}. + * + * + * @return the value of the 'Event Definitions' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCatchEvent_EventDefinitions() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='eventDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition'" + * @generated + */ + EList getEventDefinitions(); + + /** + * Returns the value of the 'Event Definition Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.EventDefinition}. + * + * + * @return the value of the 'Event Definition Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCatchEvent_EventDefinitionRefs() + * @model ordered="false" + * extendedMetaData="kind='element' name='eventDefinitionRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getEventDefinitionRefs(); + + /** + * Returns the value of the 'Parallel Multiple' attribute. + * + * + * @return the value of the 'Parallel Multiple' attribute. + * @see #setParallelMultiple(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getCatchEvent_ParallelMultiple() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='parallelMultiple'" + * @generated + */ + boolean isParallelMultiple(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CatchEvent#isParallelMultiple Parallel Multiple}' attribute. + * + * + * @param value the new value of the 'Parallel Multiple' attribute. + * @see #isParallelMultiple() + * @generated + */ + void setParallelMultiple(boolean value); + +} // CatchEvent diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Category.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Category.java new file mode 100644 index 00000000000..63c8b742535 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Category.java @@ -0,0 +1,73 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Category'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Category#getCategoryValue Category Value}
  • + *
  • {@link org.eclipse.bpmn2.Category#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCategory() + * @model extendedMetaData="name='tCategory' kind='elementOnly'" + * @generated + */ +public interface Category extends RootElement { + /** + * Returns the value of the 'Category Value' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.CategoryValue}. + * + * + * @return the value of the 'Category Value' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCategory_CategoryValue() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='categoryValue' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getCategoryValue(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getCategory_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Category#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // Category diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CategoryValue.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CategoryValue.java new file mode 100644 index 00000000000..7ce69743331 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CategoryValue.java @@ -0,0 +1,72 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Category Value'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.CategoryValue#getValue Value}
  • + *
  • {@link org.eclipse.bpmn2.CategoryValue#getCategorizedFlowElements Categorized Flow Elements}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCategoryValue() + * @model extendedMetaData="name='tCategoryValue' kind='elementOnly'" + * @generated + */ +public interface CategoryValue extends BaseElement { + /** + * Returns the value of the 'Value' attribute. + * + * + * @return the value of the 'Value' attribute. + * @see #setValue(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getCategoryValue_Value() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='value'" + * @generated + */ + String getValue(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CategoryValue#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(String value); + + /** + * Returns the value of the 'Categorized Flow Elements' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.FlowElement}. + * + * + * @return the value of the 'Categorized Flow Elements' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCategoryValue_CategorizedFlowElements() + * @model resolveProxies="false" transient="true" changeable="false" volatile="true" derived="true" ordered="false" + * @generated + */ + EList getCategorizedFlowElements(); + +} // CategoryValue diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Choreography.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Choreography.java new file mode 100644 index 00000000000..5d127882771 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Choreography.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Choreography'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getChoreography() + * @model extendedMetaData="name='tChoreography' kind='elementOnly'" + * @generated + */ +public interface Choreography extends Collaboration, FlowElementsContainer { +} // Choreography diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ChoreographyActivity.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ChoreographyActivity.java new file mode 100644 index 00000000000..c04efc02117 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ChoreographyActivity.java @@ -0,0 +1,116 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Choreography Activity'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ChoreographyActivity#getParticipantRefs Participant Refs}
  • + *
  • {@link org.eclipse.bpmn2.ChoreographyActivity#getCorrelationKeys Correlation Keys}
  • + *
  • {@link org.eclipse.bpmn2.ChoreographyActivity#getInitiatingParticipantRef Initiating Participant Ref}
  • + *
  • {@link org.eclipse.bpmn2.ChoreographyActivity#getLoopType Loop Type}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getChoreographyActivity() + * @model abstract="true" + * extendedMetaData="name='tChoreographyActivity' kind='elementOnly'" + * @generated + */ +public interface ChoreographyActivity extends FlowNode { + /** + * Returns the value of the 'Participant Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Participant}. + * + * + * @return the value of the 'Participant Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getChoreographyActivity_ParticipantRefs() + * @model lower="2" ordered="false" + * extendedMetaData="kind='element' name='participantRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getParticipantRefs(); + + /** + * Returns the value of the 'Correlation Keys' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.CorrelationKey}. + * + * + * @return the value of the 'Correlation Keys' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getChoreographyActivity_CorrelationKeys() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='correlationKey' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getCorrelationKeys(); + + /** + * Returns the value of the 'Initiating Participant Ref' reference. + * + * + * @return the value of the 'Initiating Participant Ref' reference. + * @see #setInitiatingParticipantRef(Participant) + * @see org.eclipse.bpmn2.Bpmn2Package#getChoreographyActivity_InitiatingParticipantRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='initiatingParticipantRef'" + * @generated + */ + Participant getInitiatingParticipantRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ChoreographyActivity#getInitiatingParticipantRef Initiating Participant Ref}' reference. + * + * + * @param value the new value of the 'Initiating Participant Ref' reference. + * @see #getInitiatingParticipantRef() + * @generated + */ + void setInitiatingParticipantRef(Participant value); + + /** + * Returns the value of the 'Loop Type' attribute. + * The default value is "None". + * The literals are from the enumeration {@link org.eclipse.bpmn2.ChoreographyLoopType}. + * + * + * @return the value of the 'Loop Type' attribute. + * @see org.eclipse.bpmn2.ChoreographyLoopType + * @see #setLoopType(ChoreographyLoopType) + * @see org.eclipse.bpmn2.Bpmn2Package#getChoreographyActivity_LoopType() + * @model default="None" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='loopType'" + * @generated + */ + ChoreographyLoopType getLoopType(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ChoreographyActivity#getLoopType Loop Type}' attribute. + * + * + * @param value the new value of the 'Loop Type' attribute. + * @see org.eclipse.bpmn2.ChoreographyLoopType + * @see #getLoopType() + * @generated + */ + void setLoopType(ChoreographyLoopType value); + +} // ChoreographyActivity diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ChoreographyLoopType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ChoreographyLoopType.java new file mode 100644 index 00000000000..2c1c29553c9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ChoreographyLoopType.java @@ -0,0 +1,266 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Choreography Loop Type', + * and utility methods for working with them. + * + * @see org.eclipse.bpmn2.Bpmn2Package#getChoreographyLoopType() + * @model extendedMetaData="name='tChoreographyLoopType'" + * @generated + */ +public enum ChoreographyLoopType implements Enumerator { + /** + * The 'None' literal object. + * + * + * @see #NONE_VALUE + * @generated + * @ordered + */ + NONE(0, "None", "None"), + + /** + * The 'Standard' literal object. + * + * + * @see #STANDARD_VALUE + * @generated + * @ordered + */ + STANDARD(1, "Standard", "Standard"), + + /** + * The 'Multi Instance Sequential' literal object. + * + * + * @see #MULTI_INSTANCE_SEQUENTIAL_VALUE + * @generated + * @ordered + */ + MULTI_INSTANCE_SEQUENTIAL(2, "MultiInstanceSequential", "MultiInstanceSequential"), + + /** + * The 'Multi Instance Parallel' literal object. + * + * + * @see #MULTI_INSTANCE_PARALLEL_VALUE + * @generated + * @ordered + */ + MULTI_INSTANCE_PARALLEL(3, "MultiInstanceParallel", "MultiInstanceParallel"); + + /** + * The 'None' literal value. + * + * + * @see #NONE + * @model name="None" + * @generated + * @ordered + */ + public static final int NONE_VALUE = 0; + + /** + * The 'Standard' literal value. + * + * + * @see #STANDARD + * @model name="Standard" + * @generated + * @ordered + */ + public static final int STANDARD_VALUE = 1; + + /** + * The 'Multi Instance Sequential' literal value. + * + * + * @see #MULTI_INSTANCE_SEQUENTIAL + * @model name="MultiInstanceSequential" + * @generated + * @ordered + */ + public static final int MULTI_INSTANCE_SEQUENTIAL_VALUE = 2; + + /** + * The 'Multi Instance Parallel' literal value. + * + * + * @see #MULTI_INSTANCE_PARALLEL + * @model name="MultiInstanceParallel" + * @generated + * @ordered + */ + public static final int MULTI_INSTANCE_PARALLEL_VALUE = 3; + + /** + * An array of all the 'Choreography Loop Type' enumerators. + * + * + * @generated + */ + private static final ChoreographyLoopType[] VALUES_ARRAY = new ChoreographyLoopType[] { NONE, STANDARD, + MULTI_INSTANCE_SEQUENTIAL, MULTI_INSTANCE_PARALLEL, }; + + /** + * A public read-only list of all the 'Choreography Loop Type' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Choreography Loop Type' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static ChoreographyLoopType get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ChoreographyLoopType result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Choreography Loop Type' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static ChoreographyLoopType getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ChoreographyLoopType result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Choreography Loop Type' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static ChoreographyLoopType get(int value) { + switch (value) { + case NONE_VALUE: + return NONE; + case STANDARD_VALUE: + return STANDARD; + case MULTI_INSTANCE_SEQUENTIAL_VALUE: + return MULTI_INSTANCE_SEQUENTIAL; + case MULTI_INSTANCE_PARALLEL_VALUE: + return MULTI_INSTANCE_PARALLEL; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private ChoreographyLoopType(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //ChoreographyLoopType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ChoreographyTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ChoreographyTask.java new file mode 100644 index 00000000000..55853acb4ed --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ChoreographyTask.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Choreography Task'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ChoreographyTask#getMessageFlowRef Message Flow Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getChoreographyTask() + * @model extendedMetaData="name='tChoreographyTask' kind='elementOnly'" + * @generated + */ +public interface ChoreographyTask extends ChoreographyActivity { + /** + * Returns the value of the 'Message Flow Ref' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.MessageFlow}. + * + * + * @return the value of the 'Message Flow Ref' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getChoreographyTask_MessageFlowRef() + * @model required="true" upper="2" ordered="false" + * extendedMetaData="kind='element' name='messageFlowRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getMessageFlowRef(); + +} // ChoreographyTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Collaboration.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Collaboration.java new file mode 100644 index 00000000000..da9b6d6caff --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Collaboration.java @@ -0,0 +1,233 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Collaboration'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Collaboration#getParticipants Participants}
  • + *
  • {@link org.eclipse.bpmn2.Collaboration#getMessageFlows Message Flows}
  • + *
  • {@link org.eclipse.bpmn2.Collaboration#getArtifacts Artifacts}
  • + *
  • {@link org.eclipse.bpmn2.Collaboration#getConversations Conversations}
  • + *
  • {@link org.eclipse.bpmn2.Collaboration#getConversationAssociations Conversation Associations}
  • + *
  • {@link org.eclipse.bpmn2.Collaboration#getParticipantAssociations Participant Associations}
  • + *
  • {@link org.eclipse.bpmn2.Collaboration#getMessageFlowAssociations Message Flow Associations}
  • + *
  • {@link org.eclipse.bpmn2.Collaboration#getCorrelationKeys Correlation Keys}
  • + *
  • {@link org.eclipse.bpmn2.Collaboration#getChoreographyRef Choreography Ref}
  • + *
  • {@link org.eclipse.bpmn2.Collaboration#getConversationLinks Conversation Links}
  • + *
  • {@link org.eclipse.bpmn2.Collaboration#isIsClosed Is Closed}
  • + *
  • {@link org.eclipse.bpmn2.Collaboration#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCollaboration() + * @model extendedMetaData="name='tCollaboration' kind='elementOnly'" + * @generated + */ +public interface Collaboration extends RootElement { + /** + * Returns the value of the 'Participants' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Participant}. + * + * + * @return the value of the 'Participants' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCollaboration_Participants() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='participant' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getParticipants(); + + /** + * Returns the value of the 'Message Flows' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.MessageFlow}. + * + * + * @return the value of the 'Message Flows' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCollaboration_MessageFlows() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='messageFlow' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getMessageFlows(); + + /** + * Returns the value of the 'Artifacts' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Artifact}. + * + * + * @return the value of the 'Artifacts' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCollaboration_Artifacts() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='artifact' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#artifact'" + * @generated + */ + EList getArtifacts(); + + /** + * Returns the value of the 'Conversations' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ConversationNode}. + * + * + * @return the value of the 'Conversations' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCollaboration_Conversations() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='conversationNode' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#conversationNode'" + * @generated + */ + EList getConversations(); + + /** + * Returns the value of the 'Conversation Associations' containment reference. + * + * + * @return the value of the 'Conversation Associations' containment reference. + * @see #setConversationAssociations(ConversationAssociation) + * @see org.eclipse.bpmn2.Bpmn2Package#getCollaboration_ConversationAssociations() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='conversationAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ConversationAssociation getConversationAssociations(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Collaboration#getConversationAssociations Conversation Associations}' containment reference. + * + * + * @param value the new value of the 'Conversation Associations' containment reference. + * @see #getConversationAssociations() + * @generated + */ + void setConversationAssociations(ConversationAssociation value); + + /** + * Returns the value of the 'Participant Associations' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ParticipantAssociation}. + * + * + * @return the value of the 'Participant Associations' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCollaboration_ParticipantAssociations() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='participantAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getParticipantAssociations(); + + /** + * Returns the value of the 'Message Flow Associations' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.MessageFlowAssociation}. + * + * + * @return the value of the 'Message Flow Associations' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCollaboration_MessageFlowAssociations() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='messageFlowAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getMessageFlowAssociations(); + + /** + * Returns the value of the 'Correlation Keys' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.CorrelationKey}. + * + * + * @return the value of the 'Correlation Keys' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCollaboration_CorrelationKeys() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='correlationKey' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getCorrelationKeys(); + + /** + * Returns the value of the 'Choreography Ref' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Choreography}. + * + * + * @return the value of the 'Choreography Ref' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCollaboration_ChoreographyRef() + * @model ordered="false" + * extendedMetaData="kind='element' name='choreographyRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getChoreographyRef(); + + /** + * Returns the value of the 'Conversation Links' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ConversationLink}. + * + * + * @return the value of the 'Conversation Links' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCollaboration_ConversationLinks() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='conversationLink' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getConversationLinks(); + + /** + * Returns the value of the 'Is Closed' attribute. + * + * + * @return the value of the 'Is Closed' attribute. + * @see #setIsClosed(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getCollaboration_IsClosed() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='isClosed'" + * @generated + */ + boolean isIsClosed(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Collaboration#isIsClosed Is Closed}' attribute. + * + * + * @param value the new value of the 'Is Closed' attribute. + * @see #isIsClosed() + * @generated + */ + void setIsClosed(boolean value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getCollaboration_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Collaboration#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // Collaboration diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CompensateEventDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CompensateEventDefinition.java new file mode 100644 index 00000000000..e4dddd51441 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CompensateEventDefinition.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Compensate Event Definition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.CompensateEventDefinition#getActivityRef Activity Ref}
  • + *
  • {@link org.eclipse.bpmn2.CompensateEventDefinition#isWaitForCompletion Wait For Completion}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCompensateEventDefinition() + * @model extendedMetaData="name='tCompensateEventDefinition' kind='elementOnly'" + * @generated + */ +public interface CompensateEventDefinition extends EventDefinition { + /** + * Returns the value of the 'Activity Ref' reference. + * + * + * @return the value of the 'Activity Ref' reference. + * @see #setActivityRef(Activity) + * @see org.eclipse.bpmn2.Bpmn2Package#getCompensateEventDefinition_ActivityRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='activityRef'" + * @generated + */ + Activity getActivityRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CompensateEventDefinition#getActivityRef Activity Ref}' reference. + * + * + * @param value the new value of the 'Activity Ref' reference. + * @see #getActivityRef() + * @generated + */ + void setActivityRef(Activity value); + + /** + * Returns the value of the 'Wait For Completion' attribute. + * + * + * @return the value of the 'Wait For Completion' attribute. + * @see #setWaitForCompletion(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getCompensateEventDefinition_WaitForCompletion() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='waitForCompletion'" + * @generated + */ + boolean isWaitForCompletion(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CompensateEventDefinition#isWaitForCompletion Wait For Completion}' attribute. + * + * + * @param value the new value of the 'Wait For Completion' attribute. + * @see #isWaitForCompletion() + * @generated + */ + void setWaitForCompletion(boolean value); + +} // CompensateEventDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ComplexBehaviorDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ComplexBehaviorDefinition.java new file mode 100644 index 00000000000..e2c7d208261 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ComplexBehaviorDefinition.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Complex Behavior Definition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ComplexBehaviorDefinition#getCondition Condition}
  • + *
  • {@link org.eclipse.bpmn2.ComplexBehaviorDefinition#getEvent Event}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getComplexBehaviorDefinition() + * @model extendedMetaData="name='tComplexBehaviorDefinition' kind='elementOnly'" + * @generated + */ +public interface ComplexBehaviorDefinition extends BaseElement { + /** + * Returns the value of the 'Condition' containment reference. + * + * + * @return the value of the 'Condition' containment reference. + * @see #setCondition(FormalExpression) + * @see org.eclipse.bpmn2.Bpmn2Package#getComplexBehaviorDefinition_Condition() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='condition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + FormalExpression getCondition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ComplexBehaviorDefinition#getCondition Condition}' containment reference. + * + * + * @param value the new value of the 'Condition' containment reference. + * @see #getCondition() + * @generated + */ + void setCondition(FormalExpression value); + + /** + * Returns the value of the 'Event' containment reference. + * + * + * @return the value of the 'Event' containment reference. + * @see #setEvent(ImplicitThrowEvent) + * @see org.eclipse.bpmn2.Bpmn2Package#getComplexBehaviorDefinition_Event() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='event' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ImplicitThrowEvent getEvent(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ComplexBehaviorDefinition#getEvent Event}' containment reference. + * + * + * @param value the new value of the 'Event' containment reference. + * @see #getEvent() + * @generated + */ + void setEvent(ImplicitThrowEvent value); + +} // ComplexBehaviorDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ComplexGateway.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ComplexGateway.java new file mode 100644 index 00000000000..ad7199db592 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ComplexGateway.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Complex Gateway'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ComplexGateway#getActivationCondition Activation Condition}
  • + *
  • {@link org.eclipse.bpmn2.ComplexGateway#getDefault Default}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getComplexGateway() + * @model extendedMetaData="name='tComplexGateway' kind='elementOnly'" + * @generated + */ +public interface ComplexGateway extends Gateway { + /** + * Returns the value of the 'Activation Condition' containment reference. + * + * + * @return the value of the 'Activation Condition' containment reference. + * @see #setActivationCondition(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getComplexGateway_ActivationCondition() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='activationCondition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Expression getActivationCondition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ComplexGateway#getActivationCondition Activation Condition}' containment reference. + * + * + * @param value the new value of the 'Activation Condition' containment reference. + * @see #getActivationCondition() + * @generated + */ + void setActivationCondition(Expression value); + + /** + * Returns the value of the 'Default' reference. + * + * + * @return the value of the 'Default' reference. + * @see #setDefault(SequenceFlow) + * @see org.eclipse.bpmn2.Bpmn2Package#getComplexGateway_Default() + * @model resolveProxies="false" ordered="false" + * extendedMetaData="kind='attribute' name='default'" + * @generated + */ + SequenceFlow getDefault(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ComplexGateway#getDefault Default}' reference. + * + * + * @param value the new value of the 'Default' reference. + * @see #getDefault() + * @generated + */ + void setDefault(SequenceFlow value); + +} // ComplexGateway diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ConditionalEventDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ConditionalEventDefinition.java new file mode 100644 index 00000000000..2659990f901 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ConditionalEventDefinition.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Conditional Event Definition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ConditionalEventDefinition#getCondition Condition}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getConditionalEventDefinition() + * @model extendedMetaData="name='tConditionalEventDefinition' kind='elementOnly'" + * @generated + */ +public interface ConditionalEventDefinition extends EventDefinition { + /** + * Returns the value of the 'Condition' containment reference. + * + * + * @return the value of the 'Condition' containment reference. + * @see #setCondition(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getConditionalEventDefinition_Condition() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='condition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Expression getCondition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ConditionalEventDefinition#getCondition Condition}' containment reference. + * + * + * @param value the new value of the 'Condition' containment reference. + * @see #getCondition() + * @generated + */ + void setCondition(Expression value); + +} // ConditionalEventDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Conversation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Conversation.java new file mode 100644 index 00000000000..f70495f54e3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Conversation.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Conversation'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getConversation() + * @model extendedMetaData="name='tConversation' kind='elementOnly'" + * @generated + */ +public interface Conversation extends ConversationNode { +} // Conversation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ConversationAssociation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ConversationAssociation.java new file mode 100644 index 00000000000..8beb196c96d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ConversationAssociation.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Conversation Association'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ConversationAssociation#getInnerConversationNodeRef Inner Conversation Node Ref}
  • + *
  • {@link org.eclipse.bpmn2.ConversationAssociation#getOuterConversationNodeRef Outer Conversation Node Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getConversationAssociation() + * @model extendedMetaData="name='tConversationAssociation' kind='elementOnly'" + * @generated + */ +public interface ConversationAssociation extends BaseElement { + /** + * Returns the value of the 'Inner Conversation Node Ref' reference. + * + * + * @return the value of the 'Inner Conversation Node Ref' reference. + * @see #setInnerConversationNodeRef(ConversationNode) + * @see org.eclipse.bpmn2.Bpmn2Package#getConversationAssociation_InnerConversationNodeRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='innerConversationNodeRef'" + * @generated + */ + ConversationNode getInnerConversationNodeRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ConversationAssociation#getInnerConversationNodeRef Inner Conversation Node Ref}' reference. + * + * + * @param value the new value of the 'Inner Conversation Node Ref' reference. + * @see #getInnerConversationNodeRef() + * @generated + */ + void setInnerConversationNodeRef(ConversationNode value); + + /** + * Returns the value of the 'Outer Conversation Node Ref' reference. + * + * + * @return the value of the 'Outer Conversation Node Ref' reference. + * @see #setOuterConversationNodeRef(ConversationNode) + * @see org.eclipse.bpmn2.Bpmn2Package#getConversationAssociation_OuterConversationNodeRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='outerConversationNodeRef'" + * @generated + */ + ConversationNode getOuterConversationNodeRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ConversationAssociation#getOuterConversationNodeRef Outer Conversation Node Ref}' reference. + * + * + * @param value the new value of the 'Outer Conversation Node Ref' reference. + * @see #getOuterConversationNodeRef() + * @generated + */ + void setOuterConversationNodeRef(ConversationNode value); + +} // ConversationAssociation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ConversationLink.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ConversationLink.java new file mode 100644 index 00000000000..de69bbfb8d6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ConversationLink.java @@ -0,0 +1,105 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Conversation Link'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ConversationLink#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.ConversationLink#getSourceRef Source Ref}
  • + *
  • {@link org.eclipse.bpmn2.ConversationLink#getTargetRef Target Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getConversationLink() + * @model extendedMetaData="name='tConversationLink' kind='elementOnly'" + * @generated + */ +public interface ConversationLink extends BaseElement { + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getConversationLink_Name() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ConversationLink#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Source Ref' reference. + * + * + * @return the value of the 'Source Ref' reference. + * @see #setSourceRef(InteractionNode) + * @see org.eclipse.bpmn2.Bpmn2Package#getConversationLink_SourceRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='sourceRef'" + * @generated + */ + InteractionNode getSourceRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ConversationLink#getSourceRef Source Ref}' reference. + * + * + * @param value the new value of the 'Source Ref' reference. + * @see #getSourceRef() + * @generated + */ + void setSourceRef(InteractionNode value); + + /** + * Returns the value of the 'Target Ref' reference. + * + * + * @return the value of the 'Target Ref' reference. + * @see #setTargetRef(InteractionNode) + * @see org.eclipse.bpmn2.Bpmn2Package#getConversationLink_TargetRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='targetRef'" + * @generated + */ + InteractionNode getTargetRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ConversationLink#getTargetRef Target Ref}' reference. + * + * + * @param value the new value of the 'Target Ref' reference. + * @see #getTargetRef() + * @generated + */ + void setTargetRef(InteractionNode value); + +} // ConversationLink diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ConversationNode.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ConversationNode.java new file mode 100644 index 00000000000..10f5c05bae8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ConversationNode.java @@ -0,0 +1,101 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Conversation Node'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ConversationNode#getParticipantRefs Participant Refs}
  • + *
  • {@link org.eclipse.bpmn2.ConversationNode#getMessageFlowRefs Message Flow Refs}
  • + *
  • {@link org.eclipse.bpmn2.ConversationNode#getCorrelationKeys Correlation Keys}
  • + *
  • {@link org.eclipse.bpmn2.ConversationNode#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getConversationNode() + * @model extendedMetaData="name='tConversationNode' kind='elementOnly' abstract='true'" + * @generated + */ +public interface ConversationNode extends BaseElement, InteractionNode { + /** + * Returns the value of the 'Participant Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Participant}. + * + * + * @return the value of the 'Participant Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getConversationNode_ParticipantRefs() + * @model lower="2" ordered="false" + * extendedMetaData="kind='element' name='participantRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getParticipantRefs(); + + /** + * Returns the value of the 'Message Flow Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.MessageFlow}. + * + * + * @return the value of the 'Message Flow Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getConversationNode_MessageFlowRefs() + * @model ordered="false" + * extendedMetaData="kind='element' name='messageFlowRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getMessageFlowRefs(); + + /** + * Returns the value of the 'Correlation Keys' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.CorrelationKey}. + * + * + * @return the value of the 'Correlation Keys' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getConversationNode_CorrelationKeys() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='correlationKey' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getCorrelationKeys(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getConversationNode_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ConversationNode#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // ConversationNode diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationKey.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationKey.java new file mode 100644 index 00000000000..cbc3e4442ce --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationKey.java @@ -0,0 +1,73 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Correlation Key'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.CorrelationKey#getCorrelationPropertyRef Correlation Property Ref}
  • + *
  • {@link org.eclipse.bpmn2.CorrelationKey#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationKey() + * @model extendedMetaData="name='tCorrelationKey' kind='elementOnly'" + * @generated + */ +public interface CorrelationKey extends BaseElement { + /** + * Returns the value of the 'Correlation Property Ref' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.CorrelationProperty}. + * + * + * @return the value of the 'Correlation Property Ref' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationKey_CorrelationPropertyRef() + * @model ordered="false" + * extendedMetaData="kind='element' name='correlationPropertyRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getCorrelationPropertyRef(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationKey_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CorrelationKey#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // CorrelationKey diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationProperty.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationProperty.java new file mode 100644 index 00000000000..da34a1b05a9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationProperty.java @@ -0,0 +1,97 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Correlation Property'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.CorrelationProperty#getCorrelationPropertyRetrievalExpression Correlation Property Retrieval Expression}
  • + *
  • {@link org.eclipse.bpmn2.CorrelationProperty#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.CorrelationProperty#getType Type}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationProperty() + * @model extendedMetaData="name='tCorrelationProperty' kind='elementOnly'" + * @generated + */ +public interface CorrelationProperty extends RootElement { + /** + * Returns the value of the 'Correlation Property Retrieval Expression' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression}. + * + * + * @return the value of the 'Correlation Property Retrieval Expression' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationProperty_CorrelationPropertyRetrievalExpression() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='correlationPropertyRetrievalExpression' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getCorrelationPropertyRetrievalExpression(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationProperty_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CorrelationProperty#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Type' reference. + * + * + * @return the value of the 'Type' reference. + * @see #setType(ItemDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationProperty_Type() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='type'" + * @generated + */ + ItemDefinition getType(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CorrelationProperty#getType Type}' reference. + * + * + * @param value the new value of the 'Type' reference. + * @see #getType() + * @generated + */ + void setType(ItemDefinition value); + +} // CorrelationProperty diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationPropertyBinding.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationPropertyBinding.java new file mode 100644 index 00000000000..5d92c70e268 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationPropertyBinding.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Correlation Property Binding'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.CorrelationPropertyBinding#getDataPath Data Path}
  • + *
  • {@link org.eclipse.bpmn2.CorrelationPropertyBinding#getCorrelationPropertyRef Correlation Property Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationPropertyBinding() + * @model extendedMetaData="name='tCorrelationPropertyBinding' kind='elementOnly'" + * @generated + */ +public interface CorrelationPropertyBinding extends BaseElement { + /** + * Returns the value of the 'Data Path' containment reference. + * + * + * @return the value of the 'Data Path' containment reference. + * @see #setDataPath(FormalExpression) + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationPropertyBinding_DataPath() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='dataPath' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + FormalExpression getDataPath(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CorrelationPropertyBinding#getDataPath Data Path}' containment reference. + * + * + * @param value the new value of the 'Data Path' containment reference. + * @see #getDataPath() + * @generated + */ + void setDataPath(FormalExpression value); + + /** + * Returns the value of the 'Correlation Property Ref' reference. + * + * + * @return the value of the 'Correlation Property Ref' reference. + * @see #setCorrelationPropertyRef(CorrelationProperty) + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationPropertyBinding_CorrelationPropertyRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='correlationPropertyRef'" + * @generated + */ + CorrelationProperty getCorrelationPropertyRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CorrelationPropertyBinding#getCorrelationPropertyRef Correlation Property Ref}' reference. + * + * + * @param value the new value of the 'Correlation Property Ref' reference. + * @see #getCorrelationPropertyRef() + * @generated + */ + void setCorrelationPropertyRef(CorrelationProperty value); + +} // CorrelationPropertyBinding diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationPropertyRetrievalExpression.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationPropertyRetrievalExpression.java new file mode 100644 index 00000000000..825e0c41325 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationPropertyRetrievalExpression.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Correlation Property Retrieval Expression'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression#getMessagePath Message Path}
  • + *
  • {@link org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression#getMessageRef Message Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationPropertyRetrievalExpression() + * @model extendedMetaData="name='tCorrelationPropertyRetrievalExpression' kind='elementOnly'" + * @generated + */ +public interface CorrelationPropertyRetrievalExpression extends BaseElement { + /** + * Returns the value of the 'Message Path' containment reference. + * + * + * @return the value of the 'Message Path' containment reference. + * @see #setMessagePath(FormalExpression) + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationPropertyRetrievalExpression_MessagePath() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='messagePath' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + FormalExpression getMessagePath(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression#getMessagePath Message Path}' containment reference. + * + * + * @param value the new value of the 'Message Path' containment reference. + * @see #getMessagePath() + * @generated + */ + void setMessagePath(FormalExpression value); + + /** + * Returns the value of the 'Message Ref' reference. + * + * + * @return the value of the 'Message Ref' reference. + * @see #setMessageRef(Message) + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationPropertyRetrievalExpression_MessageRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='messageRef'" + * @generated + */ + Message getMessageRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression#getMessageRef Message Ref}' reference. + * + * + * @param value the new value of the 'Message Ref' reference. + * @see #getMessageRef() + * @generated + */ + void setMessageRef(Message value); + +} // CorrelationPropertyRetrievalExpression diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationSubscription.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationSubscription.java new file mode 100644 index 00000000000..551b16a3592 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/CorrelationSubscription.java @@ -0,0 +1,73 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Correlation Subscription'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.CorrelationSubscription#getCorrelationPropertyBinding Correlation Property Binding}
  • + *
  • {@link org.eclipse.bpmn2.CorrelationSubscription#getCorrelationKeyRef Correlation Key Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationSubscription() + * @model extendedMetaData="name='tCorrelationSubscription' kind='elementOnly'" + * @generated + */ +public interface CorrelationSubscription extends BaseElement { + /** + * Returns the value of the 'Correlation Property Binding' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.CorrelationPropertyBinding}. + * + * + * @return the value of the 'Correlation Property Binding' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationSubscription_CorrelationPropertyBinding() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='correlationPropertyBinding' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getCorrelationPropertyBinding(); + + /** + * Returns the value of the 'Correlation Key Ref' reference. + * + * + * @return the value of the 'Correlation Key Ref' reference. + * @see #setCorrelationKeyRef(CorrelationKey) + * @see org.eclipse.bpmn2.Bpmn2Package#getCorrelationSubscription_CorrelationKeyRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='correlationKeyRef'" + * @generated + */ + CorrelationKey getCorrelationKeyRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.CorrelationSubscription#getCorrelationKeyRef Correlation Key Ref}' reference. + * + * + * @param value the new value of the 'Correlation Key Ref' reference. + * @see #getCorrelationKeyRef() + * @generated + */ + void setCorrelationKeyRef(CorrelationKey value); + +} // CorrelationSubscription diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataAssociation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataAssociation.java new file mode 100644 index 00000000000..71f08d7a5ab --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataAssociation.java @@ -0,0 +1,111 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Data Association'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.DataAssociation#getSourceRef Source Ref}
  • + *
  • {@link org.eclipse.bpmn2.DataAssociation#getTargetRef Target Ref}
  • + *
  • {@link org.eclipse.bpmn2.DataAssociation#getTransformation Transformation}
  • + *
  • {@link org.eclipse.bpmn2.DataAssociation#getAssignment Assignment}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getDataAssociation() + * @model extendedMetaData="name='tDataAssociation' kind='elementOnly'" + * @generated + */ +public interface DataAssociation extends BaseElement { + /** + * Returns the value of the 'Source Ref' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ItemAwareElement}. + * + * + * @return the value of the 'Source Ref' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDataAssociation_SourceRef() + * @model resolveProxies="false" ordered="false" + * extendedMetaData="kind='element' name='sourceRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getSourceRef(); + + /** + * Returns the value of the 'Target Ref' reference. + * + * + * @return the value of the 'Target Ref' reference. + * @see #setTargetRef(ItemAwareElement) + * @see org.eclipse.bpmn2.Bpmn2Package#getDataAssociation_TargetRef() + * @model resolveProxies="false" required="true" ordered="false" + * extendedMetaData="kind='element' name='targetRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ItemAwareElement getTargetRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DataAssociation#getTargetRef Target Ref}' reference. + * + * + * @param value the new value of the 'Target Ref' reference. + * @see #getTargetRef() + * @generated + */ + void setTargetRef(ItemAwareElement value); + + /** + * Returns the value of the 'Transformation' containment reference. + * + * + * @return the value of the 'Transformation' containment reference. + * @see #setTransformation(FormalExpression) + * @see org.eclipse.bpmn2.Bpmn2Package#getDataAssociation_Transformation() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='transformation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + FormalExpression getTransformation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DataAssociation#getTransformation Transformation}' containment reference. + * + * + * @param value the new value of the 'Transformation' containment reference. + * @see #getTransformation() + * @generated + */ + void setTransformation(FormalExpression value); + + /** + * Returns the value of the 'Assignment' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Assignment}. + * + * + * @return the value of the 'Assignment' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDataAssociation_Assignment() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='assignment' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getAssignment(); + +} // DataAssociation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataInput.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataInput.java new file mode 100644 index 00000000000..fe06a071611 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataInput.java @@ -0,0 +1,129 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Data Input'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.DataInput#getInputSetWithOptional Input Set With Optional}
  • + *
  • {@link org.eclipse.bpmn2.DataInput#getInputSetWithWhileExecuting Input Set With While Executing}
  • + *
  • {@link org.eclipse.bpmn2.DataInput#getInputSetRefs Input Set Refs}
  • + *
  • {@link org.eclipse.bpmn2.DataInput#isIsCollection Is Collection}
  • + *
  • {@link org.eclipse.bpmn2.DataInput#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getDataInput() + * @model extendedMetaData="name='tDataInput' kind='elementOnly'" + * @generated + */ +public interface DataInput extends ItemAwareElement { + /** + * Returns the value of the 'Input Set With Optional' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.InputSet}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.InputSet#getOptionalInputRefs Optional Input Refs}'. + * + * + * @return the value of the 'Input Set With Optional' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDataInput_InputSetWithOptional() + * @see org.eclipse.bpmn2.InputSet#getOptionalInputRefs + * @model opposite="optionalInputRefs" transient="true" derived="true" ordered="false" + * @generated + */ + EList getInputSetWithOptional(); + + /** + * Returns the value of the 'Input Set With While Executing' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.InputSet}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.InputSet#getWhileExecutingInputRefs While Executing Input Refs}'. + * + * + * @return the value of the 'Input Set With While Executing' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDataInput_InputSetWithWhileExecuting() + * @see org.eclipse.bpmn2.InputSet#getWhileExecutingInputRefs + * @model opposite="whileExecutingInputRefs" transient="true" derived="true" ordered="false" + * @generated + */ + EList getInputSetWithWhileExecuting(); + + /** + * Returns the value of the 'Input Set Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.InputSet}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.InputSet#getDataInputRefs Data Input Refs}'. + * + * + * @return the value of the 'Input Set Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDataInput_InputSetRefs() + * @see org.eclipse.bpmn2.InputSet#getDataInputRefs + * @model opposite="dataInputRefs" required="true" transient="true" derived="true" ordered="false" + * @generated + */ + EList getInputSetRefs(); + + /** + * Returns the value of the 'Is Collection' attribute. + * The default value is "false". + * + * + * @return the value of the 'Is Collection' attribute. + * @see #setIsCollection(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getDataInput_IsCollection() + * @model default="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='isCollection'" + * @generated + */ + boolean isIsCollection(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DataInput#isIsCollection Is Collection}' attribute. + * + * + * @param value the new value of the 'Is Collection' attribute. + * @see #isIsCollection() + * @generated + */ + void setIsCollection(boolean value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getDataInput_Name() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DataInput#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // DataInput diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataInputAssociation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataInputAssociation.java new file mode 100644 index 00000000000..ba87be05483 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataInputAssociation.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Data Input Association'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getDataInputAssociation() + * @model extendedMetaData="name='tDataInputAssociation' kind='elementOnly'" + * @generated + */ +public interface DataInputAssociation extends DataAssociation { +} // DataInputAssociation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataObject.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataObject.java new file mode 100644 index 00000000000..a83c30d47ed --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataObject.java @@ -0,0 +1,58 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Data Object'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.DataObject#isIsCollection Is Collection}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getDataObject() + * @model extendedMetaData="name='tDataObject' kind='elementOnly'" + * @generated + */ +public interface DataObject extends FlowElement, ItemAwareElement { + /** + * Returns the value of the 'Is Collection' attribute. + * The default value is "false". + * + * + * @return the value of the 'Is Collection' attribute. + * @see #setIsCollection(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getDataObject_IsCollection() + * @model default="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='isCollection'" + * @generated + */ + boolean isIsCollection(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DataObject#isIsCollection Is Collection}' attribute. + * + * + * @param value the new value of the 'Is Collection' attribute. + * @see #isIsCollection() + * @generated + */ + void setIsCollection(boolean value); + +} // DataObject diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataObjectReference.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataObjectReference.java new file mode 100644 index 00000000000..3dc8abe4cea --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataObjectReference.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Data Object Reference'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.DataObjectReference#getDataObjectRef Data Object Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getDataObjectReference() + * @model extendedMetaData="name='tDataObjectReference' kind='elementOnly'" + * @generated + */ +public interface DataObjectReference extends FlowElement, ItemAwareElement { + /** + * Returns the value of the 'Data Object Ref' reference. + * + * + * @return the value of the 'Data Object Ref' reference. + * @see #setDataObjectRef(DataObject) + * @see org.eclipse.bpmn2.Bpmn2Package#getDataObjectReference_DataObjectRef() + * @model resolveProxies="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='dataObjectRef'" + * @generated + */ + DataObject getDataObjectRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DataObjectReference#getDataObjectRef Data Object Ref}' reference. + * + * + * @param value the new value of the 'Data Object Ref' reference. + * @see #getDataObjectRef() + * @generated + */ + void setDataObjectRef(DataObject value); + +} // DataObjectReference diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataOutput.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataOutput.java new file mode 100644 index 00000000000..e0acab7d961 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataOutput.java @@ -0,0 +1,129 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Data Output'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.DataOutput#getOutputSetWithOptional Output Set With Optional}
  • + *
  • {@link org.eclipse.bpmn2.DataOutput#getOutputSetWithWhileExecuting Output Set With While Executing}
  • + *
  • {@link org.eclipse.bpmn2.DataOutput#getOutputSetRefs Output Set Refs}
  • + *
  • {@link org.eclipse.bpmn2.DataOutput#isIsCollection Is Collection}
  • + *
  • {@link org.eclipse.bpmn2.DataOutput#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getDataOutput() + * @model extendedMetaData="name='tDataOutput' kind='elementOnly'" + * @generated + */ +public interface DataOutput extends ItemAwareElement { + /** + * Returns the value of the 'Output Set With Optional' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.OutputSet}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.OutputSet#getOptionalOutputRefs Optional Output Refs}'. + * + * + * @return the value of the 'Output Set With Optional' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDataOutput_OutputSetWithOptional() + * @see org.eclipse.bpmn2.OutputSet#getOptionalOutputRefs + * @model opposite="optionalOutputRefs" transient="true" derived="true" ordered="false" + * @generated + */ + EList getOutputSetWithOptional(); + + /** + * Returns the value of the 'Output Set With While Executing' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.OutputSet}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.OutputSet#getWhileExecutingOutputRefs While Executing Output Refs}'. + * + * + * @return the value of the 'Output Set With While Executing' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDataOutput_OutputSetWithWhileExecuting() + * @see org.eclipse.bpmn2.OutputSet#getWhileExecutingOutputRefs + * @model opposite="whileExecutingOutputRefs" transient="true" derived="true" ordered="false" + * @generated + */ + EList getOutputSetWithWhileExecuting(); + + /** + * Returns the value of the 'Output Set Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.OutputSet}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.OutputSet#getDataOutputRefs Data Output Refs}'. + * + * + * @return the value of the 'Output Set Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDataOutput_OutputSetRefs() + * @see org.eclipse.bpmn2.OutputSet#getDataOutputRefs + * @model opposite="dataOutputRefs" required="true" transient="true" derived="true" ordered="false" + * @generated + */ + EList getOutputSetRefs(); + + /** + * Returns the value of the 'Is Collection' attribute. + * The default value is "false". + * + * + * @return the value of the 'Is Collection' attribute. + * @see #setIsCollection(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getDataOutput_IsCollection() + * @model default="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='isCollection'" + * @generated + */ + boolean isIsCollection(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DataOutput#isIsCollection Is Collection}' attribute. + * + * + * @param value the new value of the 'Is Collection' attribute. + * @see #isIsCollection() + * @generated + */ + void setIsCollection(boolean value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getDataOutput_Name() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DataOutput#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // DataOutput diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataOutputAssociation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataOutputAssociation.java new file mode 100644 index 00000000000..8e72a34c237 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataOutputAssociation.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Data Output Association'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getDataOutputAssociation() + * @model extendedMetaData="name='tDataOutputAssociation' kind='elementOnly'" + * @generated + */ +public interface DataOutputAssociation extends DataAssociation { +} // DataOutputAssociation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataState.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataState.java new file mode 100644 index 00000000000..444a383114d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataState.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Data State'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.DataState#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getDataState() + * @model extendedMetaData="name='tDataState' kind='elementOnly'" + * @generated + */ +public interface DataState extends BaseElement { + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getDataState_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DataState#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // DataState diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataStore.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataStore.java new file mode 100644 index 00000000000..7c98bf1e6ef --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataStore.java @@ -0,0 +1,106 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Data Store'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.DataStore#getCapacity Capacity}
  • + *
  • {@link org.eclipse.bpmn2.DataStore#isIsUnlimited Is Unlimited}
  • + *
  • {@link org.eclipse.bpmn2.DataStore#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getDataStore() + * @model extendedMetaData="name='tDataStore' kind='elementOnly'" + * @generated + */ +public interface DataStore extends ItemAwareElement, RootElement { + /** + * Returns the value of the 'Capacity' attribute. + * + * + * @return the value of the 'Capacity' attribute. + * @see #setCapacity(int) + * @see org.eclipse.bpmn2.Bpmn2Package#getDataStore_Capacity() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='capacity'" + * @generated + */ + int getCapacity(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DataStore#getCapacity Capacity}' attribute. + * + * + * @param value the new value of the 'Capacity' attribute. + * @see #getCapacity() + * @generated + */ + void setCapacity(int value); + + /** + * Returns the value of the 'Is Unlimited' attribute. + * The default value is "true". + * + * + * @return the value of the 'Is Unlimited' attribute. + * @see #setIsUnlimited(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getDataStore_IsUnlimited() + * @model default="true" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='isUnlimited'" + * @generated + */ + boolean isIsUnlimited(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DataStore#isIsUnlimited Is Unlimited}' attribute. + * + * + * @param value the new value of the 'Is Unlimited' attribute. + * @see #isIsUnlimited() + * @generated + */ + void setIsUnlimited(boolean value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getDataStore_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DataStore#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // DataStore diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataStoreReference.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataStoreReference.java new file mode 100644 index 00000000000..292ba1ef33e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DataStoreReference.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Data Store Reference'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.DataStoreReference#getDataStoreRef Data Store Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getDataStoreReference() + * @model extendedMetaData="name='tDataStoreReference' kind='elementOnly'" + * @generated + */ +public interface DataStoreReference extends FlowElement, ItemAwareElement { + /** + * Returns the value of the 'Data Store Ref' reference. + * + * + * @return the value of the 'Data Store Ref' reference. + * @see #setDataStoreRef(DataStore) + * @see org.eclipse.bpmn2.Bpmn2Package#getDataStoreReference_DataStoreRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='dataStoreRef'" + * @generated + */ + DataStore getDataStoreRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DataStoreReference#getDataStoreRef Data Store Ref}' reference. + * + * + * @param value the new value of the 'Data Store Ref' reference. + * @see #getDataStoreRef() + * @generated + */ + void setDataStoreRef(DataStore value); + +} // DataStoreReference diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Definitions.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Definitions.java new file mode 100644 index 00000000000..3b437df7695 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Definitions.java @@ -0,0 +1,253 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.bpmn2.di.BPMNDiagram; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Definitions'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Definitions#getImports Imports}
  • + *
  • {@link org.eclipse.bpmn2.Definitions#getExtensions Extensions}
  • + *
  • {@link org.eclipse.bpmn2.Definitions#getRootElements Root Elements}
  • + *
  • {@link org.eclipse.bpmn2.Definitions#getDiagrams Diagrams}
  • + *
  • {@link org.eclipse.bpmn2.Definitions#getRelationships Relationships}
  • + *
  • {@link org.eclipse.bpmn2.Definitions#getExporter Exporter}
  • + *
  • {@link org.eclipse.bpmn2.Definitions#getExporterVersion Exporter Version}
  • + *
  • {@link org.eclipse.bpmn2.Definitions#getExpressionLanguage Expression Language}
  • + *
  • {@link org.eclipse.bpmn2.Definitions#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.Definitions#getTargetNamespace Target Namespace}
  • + *
  • {@link org.eclipse.bpmn2.Definitions#getTypeLanguage Type Language}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getDefinitions() + * @model extendedMetaData="name='tDefinitions' kind='elementOnly'" + * @generated + */ +public interface Definitions extends BaseElement { + /** + * Returns the value of the 'Imports' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Import}. + * + * + * @return the value of the 'Imports' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDefinitions_Imports() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='import' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getImports(); + + /** + * Returns the value of the 'Extensions' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Extension}. + * + * + * @return the value of the 'Extensions' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDefinitions_Extensions() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='extension' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getExtensions(); + + /** + * Returns the value of the 'Root Elements' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.RootElement}. + * + * + * @return the value of the 'Root Elements' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDefinitions_RootElements() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='rootElement' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + EList getRootElements(); + + /** + * Returns the value of the 'Diagrams' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.di.BPMNDiagram}. + * + * + * @return the value of the 'Diagrams' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDefinitions_Diagrams() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='BPMNDiagram' namespace='http://www.omg.org/spec/BPMN/20100524/DI'" + * @generated + */ + EList getDiagrams(); + + /** + * Returns the value of the 'Relationships' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Relationship}. + * + * + * @return the value of the 'Relationships' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDefinitions_Relationships() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='relationship' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getRelationships(); + + /** + * Returns the value of the 'Exporter' attribute. + * + * + * @return the value of the 'Exporter' attribute. + * @see #setExporter(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getDefinitions_Exporter() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='exporter'" + * @generated + */ + String getExporter(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Definitions#getExporter Exporter}' attribute. + * + * + * @param value the new value of the 'Exporter' attribute. + * @see #getExporter() + * @generated + */ + void setExporter(String value); + + /** + * Returns the value of the 'Exporter Version' attribute. + * + * + * @return the value of the 'Exporter Version' attribute. + * @see #setExporterVersion(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getDefinitions_ExporterVersion() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='exporterVersion'" + * @generated + */ + String getExporterVersion(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Definitions#getExporterVersion Exporter Version}' attribute. + * + * + * @param value the new value of the 'Exporter Version' attribute. + * @see #getExporterVersion() + * @generated + */ + void setExporterVersion(String value); + + /** + * Returns the value of the 'Expression Language' attribute. + * The default value is "http://www.w3.org/1999/XPath". + * + * + * @return the value of the 'Expression Language' attribute. + * @see #setExpressionLanguage(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getDefinitions_ExpressionLanguage() + * @model default="http://www.w3.org/1999/XPath" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='expressionLanguage'" + * @generated + */ + String getExpressionLanguage(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Definitions#getExpressionLanguage Expression Language}' attribute. + * + * + * @param value the new value of the 'Expression Language' attribute. + * @see #getExpressionLanguage() + * @generated + */ + void setExpressionLanguage(String value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getDefinitions_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Definitions#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Target Namespace' attribute. + * + * + * @return the value of the 'Target Namespace' attribute. + * @see #setTargetNamespace(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getDefinitions_TargetNamespace() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='targetNamespace'" + * @generated + */ + String getTargetNamespace(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Definitions#getTargetNamespace Target Namespace}' attribute. + * + * + * @param value the new value of the 'Target Namespace' attribute. + * @see #getTargetNamespace() + * @generated + */ + void setTargetNamespace(String value); + + /** + * Returns the value of the 'Type Language' attribute. + * The default value is "http://www.w3.org/2001/XMLSchema". + * + * + * @return the value of the 'Type Language' attribute. + * @see #setTypeLanguage(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getDefinitions_TypeLanguage() + * @model default="http://www.w3.org/2001/XMLSchema" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='typeLanguage'" + * @generated + */ + String getTypeLanguage(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Definitions#getTypeLanguage Type Language}' attribute. + * + * + * @param value the new value of the 'Type Language' attribute. + * @see #getTypeLanguage() + * @generated + */ + void setTypeLanguage(String value); + +} // Definitions diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DocumentRoot.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DocumentRoot.java new file mode 100644 index 00000000000..85c2fb35979 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/DocumentRoot.java @@ -0,0 +1,3336 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EMap; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'Document Root'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getMixed Mixed}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getXMLNSPrefixMap XMLNS Prefix Map}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getXSISchemaLocation XSI Schema Location}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getActivity Activity}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getAdHocSubProcess Ad Hoc Sub Process}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getFlowElement Flow Element}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getArtifact Artifact}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getAssignment Assignment}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getAssociation Association}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getAuditing Auditing}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getBaseElement Base Element}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getBaseElementWithMixedContent Base Element With Mixed Content}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getBoundaryEvent Boundary Event}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getBusinessRuleTask Business Rule Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCallableElement Callable Element}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCallActivity Call Activity}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCallChoreography Call Choreography}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCallConversation Call Conversation}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getConversationNode Conversation Node}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCancelEventDefinition Cancel Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getEventDefinition Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getRootElement Root Element}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCatchEvent Catch Event}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCategory Category}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCategoryValue Category Value}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getChoreography Choreography}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCollaboration Collaboration}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getChoreographyActivity Choreography Activity}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getChoreographyTask Choreography Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCompensateEventDefinition Compensate Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getComplexBehaviorDefinition Complex Behavior Definition}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getComplexGateway Complex Gateway}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getConditionalEventDefinition Conditional Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getConversation Conversation}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getConversationAssociation Conversation Association}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getConversationLink Conversation Link}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCorrelationKey Correlation Key}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCorrelationProperty Correlation Property}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCorrelationPropertyBinding Correlation Property Binding}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCorrelationPropertyRetrievalExpression Correlation Property Retrieval Expression}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getCorrelationSubscription Correlation Subscription}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getDataAssociation Data Association}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getDataInput Data Input}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getDataInputAssociation Data Input Association}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getDataObject Data Object}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getDataObjectReference Data Object Reference}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getDataOutput Data Output}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getDataOutputAssociation Data Output Association}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getDataState Data State}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getDataStore Data Store}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getDataStoreReference Data Store Reference}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getDefinitions Definitions}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getDocumentation Documentation}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getEndEvent End Event}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getEndPoint End Point}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getError Error}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getErrorEventDefinition Error Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getEscalation Escalation}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getEscalationEventDefinition Escalation Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getEvent Event}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getEventBasedGateway Event Based Gateway}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getExclusiveGateway Exclusive Gateway}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getExpression Expression}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getExtension Extension}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getExtensionElements Extension Elements}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getFlowNode Flow Node}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getFormalExpression Formal Expression}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getGateway Gateway}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getGlobalBusinessRuleTask Global Business Rule Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getGlobalChoreographyTask Global Choreography Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getGlobalConversation Global Conversation}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getGlobalManualTask Global Manual Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getGlobalScriptTask Global Script Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getGlobalTask Global Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getGlobalUserTask Global User Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getGroup Group}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getHumanPerformer Human Performer}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getPerformer Performer}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getResourceRole Resource Role}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getImplicitThrowEvent Implicit Throw Event}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getImport Import}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getInclusiveGateway Inclusive Gateway}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getInputSet Input Set}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getInterface Interface}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getIntermediateCatchEvent Intermediate Catch Event}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getIntermediateThrowEvent Intermediate Throw Event}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getIoBinding Io Binding}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getIoSpecification Io Specification}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getItemDefinition Item Definition}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getLane Lane}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getLaneSet Lane Set}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getLinkEventDefinition Link Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getLoopCharacteristics Loop Characteristics}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getManualTask Manual Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getMessage Message}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getMessageEventDefinition Message Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getMessageFlow Message Flow}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getMessageFlowAssociation Message Flow Association}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getMonitoring Monitoring}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getMultiInstanceLoopCharacteristics Multi Instance Loop Characteristics}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getOperation Operation}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getOutputSet Output Set}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getParallelGateway Parallel Gateway}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getParticipant Participant}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getParticipantAssociation Participant Association}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getParticipantMultiplicity Participant Multiplicity}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getPartnerEntity Partner Entity}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getPartnerRole Partner Role}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getPotentialOwner Potential Owner}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getProcess Process}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getProperty Property}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getReceiveTask Receive Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getRelationship Relationship}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getRendering Rendering}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getResource Resource}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getResourceAssignmentExpression Resource Assignment Expression}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getResourceParameter Resource Parameter}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getResourceParameterBinding Resource Parameter Binding}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getScript Script}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getScriptTask Script Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getSendTask Send Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getSequenceFlow Sequence Flow}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getServiceTask Service Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getSignal Signal}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getSignalEventDefinition Signal Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getStandardLoopCharacteristics Standard Loop Characteristics}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getStartEvent Start Event}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getSubChoreography Sub Choreography}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getSubConversation Sub Conversation}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getSubProcess Sub Process}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getTask Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getTerminateEventDefinition Terminate Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getText Text}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getTextAnnotation Text Annotation}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getThrowEvent Throw Event}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getTimerEventDefinition Timer Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getTransaction Transaction}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getUserTask User Task}
  • + *
  • {@link org.eclipse.bpmn2.DocumentRoot#getEventSubProcess Event Sub Process}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot() + * @model extendedMetaData="name='' kind='mixed'" + * @generated + */ +public interface DocumentRoot extends EObject { + /** + * Returns the value of the 'Mixed' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Mixed' attribute list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Mixed() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='elementWildcard' name=':mixed'" + * @generated + */ + FeatureMap getMixed(); + + /** + * Returns the value of the 'XMLNS Prefix Map' map. + * The key is of type {@link java.lang.String}, + * and the value is of type {@link java.lang.String}, + * + * + * @return the value of the 'XMLNS Prefix Map' map. + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_XMLNSPrefixMap() + * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>" transient="true" + * extendedMetaData="kind='attribute' name='xmlns:prefix'" + * @generated + */ + EMap getXMLNSPrefixMap(); + + /** + * Returns the value of the 'XSI Schema Location' map. + * The key is of type {@link java.lang.String}, + * and the value is of type {@link java.lang.String}, + * + * + * @return the value of the 'XSI Schema Location' map. + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_XSISchemaLocation() + * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>" transient="true" + * extendedMetaData="kind='attribute' name='xsi:schemaLocation'" + * @generated + */ + EMap getXSISchemaLocation(); + + /** + * Returns the value of the 'Activity' containment reference. + * + * + * @return the value of the 'Activity' containment reference. + * @see #setActivity(Activity) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Activity() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='activity' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Activity getActivity(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getActivity Activity}' containment reference. + * + * + * @param value the new value of the 'Activity' containment reference. + * @see #getActivity() + * @generated + */ + void setActivity(Activity value); + + /** + * Returns the value of the 'Ad Hoc Sub Process' containment reference. + * + * + * @return the value of the 'Ad Hoc Sub Process' containment reference. + * @see #setAdHocSubProcess(AdHocSubProcess) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_AdHocSubProcess() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='adHocSubProcess' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + AdHocSubProcess getAdHocSubProcess(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getAdHocSubProcess Ad Hoc Sub Process}' containment reference. + * + * + * @param value the new value of the 'Ad Hoc Sub Process' containment reference. + * @see #getAdHocSubProcess() + * @generated + */ + void setAdHocSubProcess(AdHocSubProcess value); + + /** + * Returns the value of the 'Flow Element' containment reference. + * + * + * @return the value of the 'Flow Element' containment reference. + * @see #setFlowElement(FlowElement) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_FlowElement() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='flowElement' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + FlowElement getFlowElement(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getFlowElement Flow Element}' containment reference. + * + * + * @param value the new value of the 'Flow Element' containment reference. + * @see #getFlowElement() + * @generated + */ + void setFlowElement(FlowElement value); + + /** + * Returns the value of the 'Artifact' containment reference. + * + * + * @return the value of the 'Artifact' containment reference. + * @see #setArtifact(Artifact) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Artifact() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='artifact' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Artifact getArtifact(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getArtifact Artifact}' containment reference. + * + * + * @param value the new value of the 'Artifact' containment reference. + * @see #getArtifact() + * @generated + */ + void setArtifact(Artifact value); + + /** + * Returns the value of the 'Assignment' containment reference. + * + * + * @return the value of the 'Assignment' containment reference. + * @see #setAssignment(Assignment) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Assignment() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='assignment' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Assignment getAssignment(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getAssignment Assignment}' containment reference. + * + * + * @param value the new value of the 'Assignment' containment reference. + * @see #getAssignment() + * @generated + */ + void setAssignment(Assignment value); + + /** + * Returns the value of the 'Association' containment reference. + * + * + * @return the value of the 'Association' containment reference. + * @see #setAssociation(Association) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Association() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='association' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#artifact'" + * @generated + */ + Association getAssociation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getAssociation Association}' containment reference. + * + * + * @param value the new value of the 'Association' containment reference. + * @see #getAssociation() + * @generated + */ + void setAssociation(Association value); + + /** + * Returns the value of the 'Auditing' containment reference. + * + * + * @return the value of the 'Auditing' containment reference. + * @see #setAuditing(Auditing) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Auditing() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='auditing' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Auditing getAuditing(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getAuditing Auditing}' containment reference. + * + * + * @param value the new value of the 'Auditing' containment reference. + * @see #getAuditing() + * @generated + */ + void setAuditing(Auditing value); + + /** + * Returns the value of the 'Base Element' containment reference. + * + * + * @return the value of the 'Base Element' containment reference. + * @see #setBaseElement(BaseElement) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_BaseElement() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='baseElement' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + BaseElement getBaseElement(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getBaseElement Base Element}' containment reference. + * + * + * @param value the new value of the 'Base Element' containment reference. + * @see #getBaseElement() + * @generated + */ + void setBaseElement(BaseElement value); + + /** + * Returns the value of the 'Base Element With Mixed Content' containment reference. + * + * + * @return the value of the 'Base Element With Mixed Content' containment reference. + * @see #setBaseElementWithMixedContent(BaseElement) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_BaseElementWithMixedContent() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='baseElementWithMixedContent' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + BaseElement getBaseElementWithMixedContent(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getBaseElementWithMixedContent Base Element With Mixed Content}' containment reference. + * + * + * @param value the new value of the 'Base Element With Mixed Content' containment reference. + * @see #getBaseElementWithMixedContent() + * @generated + */ + void setBaseElementWithMixedContent(BaseElement value); + + /** + * Returns the value of the 'Boundary Event' containment reference. + * + * + * @return the value of the 'Boundary Event' containment reference. + * @see #setBoundaryEvent(BoundaryEvent) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_BoundaryEvent() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='boundaryEvent' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + BoundaryEvent getBoundaryEvent(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getBoundaryEvent Boundary Event}' containment reference. + * + * + * @param value the new value of the 'Boundary Event' containment reference. + * @see #getBoundaryEvent() + * @generated + */ + void setBoundaryEvent(BoundaryEvent value); + + /** + * Returns the value of the 'Business Rule Task' containment reference. + * + * + * @return the value of the 'Business Rule Task' containment reference. + * @see #setBusinessRuleTask(BusinessRuleTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_BusinessRuleTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='businessRuleTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + BusinessRuleTask getBusinessRuleTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getBusinessRuleTask Business Rule Task}' containment reference. + * + * + * @param value the new value of the 'Business Rule Task' containment reference. + * @see #getBusinessRuleTask() + * @generated + */ + void setBusinessRuleTask(BusinessRuleTask value); + + /** + * Returns the value of the 'Callable Element' containment reference. + * + * + * @return the value of the 'Callable Element' containment reference. + * @see #setCallableElement(CallableElement) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_CallableElement() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='callableElement' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + CallableElement getCallableElement(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCallableElement Callable Element}' containment reference. + * + * + * @param value the new value of the 'Callable Element' containment reference. + * @see #getCallableElement() + * @generated + */ + void setCallableElement(CallableElement value); + + /** + * Returns the value of the 'Call Activity' containment reference. + * + * + * @return the value of the 'Call Activity' containment reference. + * @see #setCallActivity(CallActivity) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_CallActivity() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='callActivity' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + CallActivity getCallActivity(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCallActivity Call Activity}' containment reference. + * + * + * @param value the new value of the 'Call Activity' containment reference. + * @see #getCallActivity() + * @generated + */ + void setCallActivity(CallActivity value); + + /** + * Returns the value of the 'Call Choreography' containment reference. + * + * + * @return the value of the 'Call Choreography' containment reference. + * @see #setCallChoreography(CallChoreography) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_CallChoreography() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='callChoreography' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + CallChoreography getCallChoreography(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCallChoreography Call Choreography}' containment reference. + * + * + * @param value the new value of the 'Call Choreography' containment reference. + * @see #getCallChoreography() + * @generated + */ + void setCallChoreography(CallChoreography value); + + /** + * Returns the value of the 'Call Conversation' containment reference. + * + * + * @return the value of the 'Call Conversation' containment reference. + * @see #setCallConversation(CallConversation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_CallConversation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='callConversation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#conversationNode'" + * @generated + */ + CallConversation getCallConversation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCallConversation Call Conversation}' containment reference. + * + * + * @param value the new value of the 'Call Conversation' containment reference. + * @see #getCallConversation() + * @generated + */ + void setCallConversation(CallConversation value); + + /** + * Returns the value of the 'Conversation Node' containment reference. + * + * + * @return the value of the 'Conversation Node' containment reference. + * @see #setConversationNode(ConversationNode) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ConversationNode() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='conversationNode' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ConversationNode getConversationNode(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getConversationNode Conversation Node}' containment reference. + * + * + * @param value the new value of the 'Conversation Node' containment reference. + * @see #getConversationNode() + * @generated + */ + void setConversationNode(ConversationNode value); + + /** + * Returns the value of the 'Cancel Event Definition' containment reference. + * + * + * @return the value of the 'Cancel Event Definition' containment reference. + * @see #setCancelEventDefinition(CancelEventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_CancelEventDefinition() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='cancelEventDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition'" + * @generated + */ + CancelEventDefinition getCancelEventDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCancelEventDefinition Cancel Event Definition}' containment reference. + * + * + * @param value the new value of the 'Cancel Event Definition' containment reference. + * @see #getCancelEventDefinition() + * @generated + */ + void setCancelEventDefinition(CancelEventDefinition value); + + /** + * Returns the value of the 'Event Definition' containment reference. + * + * + * @return the value of the 'Event Definition' containment reference. + * @see #setEventDefinition(EventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_EventDefinition() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='eventDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + EventDefinition getEventDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getEventDefinition Event Definition}' containment reference. + * + * + * @param value the new value of the 'Event Definition' containment reference. + * @see #getEventDefinition() + * @generated + */ + void setEventDefinition(EventDefinition value); + + /** + * Returns the value of the 'Root Element' containment reference. + * + * + * @return the value of the 'Root Element' containment reference. + * @see #setRootElement(RootElement) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_RootElement() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='rootElement' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + RootElement getRootElement(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getRootElement Root Element}' containment reference. + * + * + * @param value the new value of the 'Root Element' containment reference. + * @see #getRootElement() + * @generated + */ + void setRootElement(RootElement value); + + /** + * Returns the value of the 'Catch Event' containment reference. + * + * + * @return the value of the 'Catch Event' containment reference. + * @see #setCatchEvent(CatchEvent) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_CatchEvent() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='catchEvent' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + CatchEvent getCatchEvent(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCatchEvent Catch Event}' containment reference. + * + * + * @param value the new value of the 'Catch Event' containment reference. + * @see #getCatchEvent() + * @generated + */ + void setCatchEvent(CatchEvent value); + + /** + * Returns the value of the 'Category' containment reference. + * + * + * @return the value of the 'Category' containment reference. + * @see #setCategory(Category) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Category() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='category' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + Category getCategory(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCategory Category}' containment reference. + * + * + * @param value the new value of the 'Category' containment reference. + * @see #getCategory() + * @generated + */ + void setCategory(Category value); + + /** + * Returns the value of the 'Category Value' containment reference. + * + * + * @return the value of the 'Category Value' containment reference. + * @see #setCategoryValue(CategoryValue) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_CategoryValue() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='categoryValue' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + CategoryValue getCategoryValue(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCategoryValue Category Value}' containment reference. + * + * + * @param value the new value of the 'Category Value' containment reference. + * @see #getCategoryValue() + * @generated + */ + void setCategoryValue(CategoryValue value); + + /** + * Returns the value of the 'Choreography' containment reference. + * + * + * @return the value of the 'Choreography' containment reference. + * @see #setChoreography(Choreography) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Choreography() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='choreography' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#collaboration'" + * @generated + */ + Choreography getChoreography(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getChoreography Choreography}' containment reference. + * + * + * @param value the new value of the 'Choreography' containment reference. + * @see #getChoreography() + * @generated + */ + void setChoreography(Choreography value); + + /** + * Returns the value of the 'Collaboration' containment reference. + * + * + * @return the value of the 'Collaboration' containment reference. + * @see #setCollaboration(Collaboration) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Collaboration() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='collaboration' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + Collaboration getCollaboration(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCollaboration Collaboration}' containment reference. + * + * + * @param value the new value of the 'Collaboration' containment reference. + * @see #getCollaboration() + * @generated + */ + void setCollaboration(Collaboration value); + + /** + * Returns the value of the 'Choreography Activity' containment reference. + * + * + * @return the value of the 'Choreography Activity' containment reference. + * @see #setChoreographyActivity(ChoreographyActivity) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ChoreographyActivity() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='choreographyActivity' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ChoreographyActivity getChoreographyActivity(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getChoreographyActivity Choreography Activity}' containment reference. + * + * + * @param value the new value of the 'Choreography Activity' containment reference. + * @see #getChoreographyActivity() + * @generated + */ + void setChoreographyActivity(ChoreographyActivity value); + + /** + * Returns the value of the 'Choreography Task' containment reference. + * + * + * @return the value of the 'Choreography Task' containment reference. + * @see #setChoreographyTask(ChoreographyTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ChoreographyTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='choreographyTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + ChoreographyTask getChoreographyTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getChoreographyTask Choreography Task}' containment reference. + * + * + * @param value the new value of the 'Choreography Task' containment reference. + * @see #getChoreographyTask() + * @generated + */ + void setChoreographyTask(ChoreographyTask value); + + /** + * Returns the value of the 'Compensate Event Definition' containment reference. + * + * + * @return the value of the 'Compensate Event Definition' containment reference. + * @see #setCompensateEventDefinition(CompensateEventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_CompensateEventDefinition() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='compensateEventDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition'" + * @generated + */ + CompensateEventDefinition getCompensateEventDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCompensateEventDefinition Compensate Event Definition}' containment reference. + * + * + * @param value the new value of the 'Compensate Event Definition' containment reference. + * @see #getCompensateEventDefinition() + * @generated + */ + void setCompensateEventDefinition(CompensateEventDefinition value); + + /** + * Returns the value of the 'Complex Behavior Definition' containment reference. + * + * + * @return the value of the 'Complex Behavior Definition' containment reference. + * @see #setComplexBehaviorDefinition(ComplexBehaviorDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ComplexBehaviorDefinition() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='complexBehaviorDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ComplexBehaviorDefinition getComplexBehaviorDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getComplexBehaviorDefinition Complex Behavior Definition}' containment reference. + * + * + * @param value the new value of the 'Complex Behavior Definition' containment reference. + * @see #getComplexBehaviorDefinition() + * @generated + */ + void setComplexBehaviorDefinition(ComplexBehaviorDefinition value); + + /** + * Returns the value of the 'Complex Gateway' containment reference. + * + * + * @return the value of the 'Complex Gateway' containment reference. + * @see #setComplexGateway(ComplexGateway) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ComplexGateway() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='complexGateway' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + ComplexGateway getComplexGateway(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getComplexGateway Complex Gateway}' containment reference. + * + * + * @param value the new value of the 'Complex Gateway' containment reference. + * @see #getComplexGateway() + * @generated + */ + void setComplexGateway(ComplexGateway value); + + /** + * Returns the value of the 'Conditional Event Definition' containment reference. + * + * + * @return the value of the 'Conditional Event Definition' containment reference. + * @see #setConditionalEventDefinition(ConditionalEventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ConditionalEventDefinition() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='conditionalEventDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition'" + * @generated + */ + ConditionalEventDefinition getConditionalEventDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getConditionalEventDefinition Conditional Event Definition}' containment reference. + * + * + * @param value the new value of the 'Conditional Event Definition' containment reference. + * @see #getConditionalEventDefinition() + * @generated + */ + void setConditionalEventDefinition(ConditionalEventDefinition value); + + /** + * Returns the value of the 'Conversation' containment reference. + * + * + * @return the value of the 'Conversation' containment reference. + * @see #setConversation(Conversation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Conversation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='conversation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#conversationNode'" + * @generated + */ + Conversation getConversation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getConversation Conversation}' containment reference. + * + * + * @param value the new value of the 'Conversation' containment reference. + * @see #getConversation() + * @generated + */ + void setConversation(Conversation value); + + /** + * Returns the value of the 'Conversation Association' containment reference. + * + * + * @return the value of the 'Conversation Association' containment reference. + * @see #setConversationAssociation(ConversationAssociation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ConversationAssociation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='conversationAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ConversationAssociation getConversationAssociation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getConversationAssociation Conversation Association}' containment reference. + * + * + * @param value the new value of the 'Conversation Association' containment reference. + * @see #getConversationAssociation() + * @generated + */ + void setConversationAssociation(ConversationAssociation value); + + /** + * Returns the value of the 'Conversation Link' containment reference. + * + * + * @return the value of the 'Conversation Link' containment reference. + * @see #setConversationLink(ConversationLink) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ConversationLink() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='conversationLink' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ConversationLink getConversationLink(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getConversationLink Conversation Link}' containment reference. + * + * + * @param value the new value of the 'Conversation Link' containment reference. + * @see #getConversationLink() + * @generated + */ + void setConversationLink(ConversationLink value); + + /** + * Returns the value of the 'Correlation Key' containment reference. + * + * + * @return the value of the 'Correlation Key' containment reference. + * @see #setCorrelationKey(CorrelationKey) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_CorrelationKey() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='correlationKey' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + CorrelationKey getCorrelationKey(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCorrelationKey Correlation Key}' containment reference. + * + * + * @param value the new value of the 'Correlation Key' containment reference. + * @see #getCorrelationKey() + * @generated + */ + void setCorrelationKey(CorrelationKey value); + + /** + * Returns the value of the 'Correlation Property' containment reference. + * + * + * @return the value of the 'Correlation Property' containment reference. + * @see #setCorrelationProperty(CorrelationProperty) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_CorrelationProperty() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='correlationProperty' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + CorrelationProperty getCorrelationProperty(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCorrelationProperty Correlation Property}' containment reference. + * + * + * @param value the new value of the 'Correlation Property' containment reference. + * @see #getCorrelationProperty() + * @generated + */ + void setCorrelationProperty(CorrelationProperty value); + + /** + * Returns the value of the 'Correlation Property Binding' containment reference. + * + * + * @return the value of the 'Correlation Property Binding' containment reference. + * @see #setCorrelationPropertyBinding(CorrelationPropertyBinding) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_CorrelationPropertyBinding() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='correlationPropertyBinding' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + CorrelationPropertyBinding getCorrelationPropertyBinding(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCorrelationPropertyBinding Correlation Property Binding}' containment reference. + * + * + * @param value the new value of the 'Correlation Property Binding' containment reference. + * @see #getCorrelationPropertyBinding() + * @generated + */ + void setCorrelationPropertyBinding(CorrelationPropertyBinding value); + + /** + * Returns the value of the 'Correlation Property Retrieval Expression' containment reference. + * + * + * @return the value of the 'Correlation Property Retrieval Expression' containment reference. + * @see #setCorrelationPropertyRetrievalExpression(CorrelationPropertyRetrievalExpression) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_CorrelationPropertyRetrievalExpression() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='correlationPropertyRetrievalExpression' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + CorrelationPropertyRetrievalExpression getCorrelationPropertyRetrievalExpression(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCorrelationPropertyRetrievalExpression Correlation Property Retrieval Expression}' containment reference. + * + * + * @param value the new value of the 'Correlation Property Retrieval Expression' containment reference. + * @see #getCorrelationPropertyRetrievalExpression() + * @generated + */ + void setCorrelationPropertyRetrievalExpression(CorrelationPropertyRetrievalExpression value); + + /** + * Returns the value of the 'Correlation Subscription' containment reference. + * + * + * @return the value of the 'Correlation Subscription' containment reference. + * @see #setCorrelationSubscription(CorrelationSubscription) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_CorrelationSubscription() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='correlationSubscription' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + CorrelationSubscription getCorrelationSubscription(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getCorrelationSubscription Correlation Subscription}' containment reference. + * + * + * @param value the new value of the 'Correlation Subscription' containment reference. + * @see #getCorrelationSubscription() + * @generated + */ + void setCorrelationSubscription(CorrelationSubscription value); + + /** + * Returns the value of the 'Data Association' containment reference. + * + * + * @return the value of the 'Data Association' containment reference. + * @see #setDataAssociation(DataAssociation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_DataAssociation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='dataAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + DataAssociation getDataAssociation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getDataAssociation Data Association}' containment reference. + * + * + * @param value the new value of the 'Data Association' containment reference. + * @see #getDataAssociation() + * @generated + */ + void setDataAssociation(DataAssociation value); + + /** + * Returns the value of the 'Data Input' containment reference. + * + * + * @return the value of the 'Data Input' containment reference. + * @see #setDataInput(DataInput) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_DataInput() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='dataInput' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + DataInput getDataInput(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getDataInput Data Input}' containment reference. + * + * + * @param value the new value of the 'Data Input' containment reference. + * @see #getDataInput() + * @generated + */ + void setDataInput(DataInput value); + + /** + * Returns the value of the 'Data Input Association' containment reference. + * + * + * @return the value of the 'Data Input Association' containment reference. + * @see #setDataInputAssociation(DataInputAssociation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_DataInputAssociation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='dataInputAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + DataInputAssociation getDataInputAssociation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getDataInputAssociation Data Input Association}' containment reference. + * + * + * @param value the new value of the 'Data Input Association' containment reference. + * @see #getDataInputAssociation() + * @generated + */ + void setDataInputAssociation(DataInputAssociation value); + + /** + * Returns the value of the 'Data Object' containment reference. + * + * + * @return the value of the 'Data Object' containment reference. + * @see #setDataObject(DataObject) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_DataObject() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='dataObject' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + DataObject getDataObject(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getDataObject Data Object}' containment reference. + * + * + * @param value the new value of the 'Data Object' containment reference. + * @see #getDataObject() + * @generated + */ + void setDataObject(DataObject value); + + /** + * Returns the value of the 'Data Object Reference' containment reference. + * + * + * @return the value of the 'Data Object Reference' containment reference. + * @see #setDataObjectReference(DataObjectReference) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_DataObjectReference() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='dataObjectReference' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + DataObjectReference getDataObjectReference(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getDataObjectReference Data Object Reference}' containment reference. + * + * + * @param value the new value of the 'Data Object Reference' containment reference. + * @see #getDataObjectReference() + * @generated + */ + void setDataObjectReference(DataObjectReference value); + + /** + * Returns the value of the 'Data Output' containment reference. + * + * + * @return the value of the 'Data Output' containment reference. + * @see #setDataOutput(DataOutput) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_DataOutput() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='dataOutput' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + DataOutput getDataOutput(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getDataOutput Data Output}' containment reference. + * + * + * @param value the new value of the 'Data Output' containment reference. + * @see #getDataOutput() + * @generated + */ + void setDataOutput(DataOutput value); + + /** + * Returns the value of the 'Data Output Association' containment reference. + * + * + * @return the value of the 'Data Output Association' containment reference. + * @see #setDataOutputAssociation(DataOutputAssociation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_DataOutputAssociation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='dataOutputAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + DataOutputAssociation getDataOutputAssociation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getDataOutputAssociation Data Output Association}' containment reference. + * + * + * @param value the new value of the 'Data Output Association' containment reference. + * @see #getDataOutputAssociation() + * @generated + */ + void setDataOutputAssociation(DataOutputAssociation value); + + /** + * Returns the value of the 'Data State' containment reference. + * + * + * @return the value of the 'Data State' containment reference. + * @see #setDataState(DataState) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_DataState() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='dataState' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + DataState getDataState(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getDataState Data State}' containment reference. + * + * + * @param value the new value of the 'Data State' containment reference. + * @see #getDataState() + * @generated + */ + void setDataState(DataState value); + + /** + * Returns the value of the 'Data Store' containment reference. + * + * + * @return the value of the 'Data Store' containment reference. + * @see #setDataStore(DataStore) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_DataStore() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='dataStore' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + DataStore getDataStore(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getDataStore Data Store}' containment reference. + * + * + * @param value the new value of the 'Data Store' containment reference. + * @see #getDataStore() + * @generated + */ + void setDataStore(DataStore value); + + /** + * Returns the value of the 'Data Store Reference' containment reference. + * + * + * @return the value of the 'Data Store Reference' containment reference. + * @see #setDataStoreReference(DataStoreReference) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_DataStoreReference() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='dataStoreReference' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + DataStoreReference getDataStoreReference(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getDataStoreReference Data Store Reference}' containment reference. + * + * + * @param value the new value of the 'Data Store Reference' containment reference. + * @see #getDataStoreReference() + * @generated + */ + void setDataStoreReference(DataStoreReference value); + + /** + * Returns the value of the 'Definitions' containment reference. + * + * + * @return the value of the 'Definitions' containment reference. + * @see #setDefinitions(Definitions) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Definitions() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='definitions' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Definitions getDefinitions(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getDefinitions Definitions}' containment reference. + * + * + * @param value the new value of the 'Definitions' containment reference. + * @see #getDefinitions() + * @generated + */ + void setDefinitions(Definitions value); + + /** + * Returns the value of the 'Documentation' containment reference. + * + * + * @return the value of the 'Documentation' containment reference. + * @see #setDocumentation(Documentation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Documentation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='documentation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Documentation getDocumentation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getDocumentation Documentation}' containment reference. + * + * + * @param value the new value of the 'Documentation' containment reference. + * @see #getDocumentation() + * @generated + */ + void setDocumentation(Documentation value); + + /** + * Returns the value of the 'End Event' containment reference. + * + * + * @return the value of the 'End Event' containment reference. + * @see #setEndEvent(EndEvent) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_EndEvent() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='endEvent' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + EndEvent getEndEvent(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getEndEvent End Event}' containment reference. + * + * + * @param value the new value of the 'End Event' containment reference. + * @see #getEndEvent() + * @generated + */ + void setEndEvent(EndEvent value); + + /** + * Returns the value of the 'End Point' containment reference. + * + * + * @return the value of the 'End Point' containment reference. + * @see #setEndPoint(EndPoint) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_EndPoint() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='endPoint' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + EndPoint getEndPoint(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getEndPoint End Point}' containment reference. + * + * + * @param value the new value of the 'End Point' containment reference. + * @see #getEndPoint() + * @generated + */ + void setEndPoint(EndPoint value); + + /** + * Returns the value of the 'Error' containment reference. + * + * + * @return the value of the 'Error' containment reference. + * @see #setError(org.eclipse.bpmn2.Error) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Error() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='error' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + org.eclipse.bpmn2.Error getError(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getError Error}' containment reference. + * + * + * @param value the new value of the 'Error' containment reference. + * @see #getError() + * @generated + */ + void setError(org.eclipse.bpmn2.Error value); + + /** + * Returns the value of the 'Error Event Definition' containment reference. + * + * + * @return the value of the 'Error Event Definition' containment reference. + * @see #setErrorEventDefinition(ErrorEventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ErrorEventDefinition() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='errorEventDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition'" + * @generated + */ + ErrorEventDefinition getErrorEventDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getErrorEventDefinition Error Event Definition}' containment reference. + * + * + * @param value the new value of the 'Error Event Definition' containment reference. + * @see #getErrorEventDefinition() + * @generated + */ + void setErrorEventDefinition(ErrorEventDefinition value); + + /** + * Returns the value of the 'Escalation' containment reference. + * + * + * @return the value of the 'Escalation' containment reference. + * @see #setEscalation(Escalation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Escalation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='escalation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + Escalation getEscalation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getEscalation Escalation}' containment reference. + * + * + * @param value the new value of the 'Escalation' containment reference. + * @see #getEscalation() + * @generated + */ + void setEscalation(Escalation value); + + /** + * Returns the value of the 'Escalation Event Definition' containment reference. + * + * + * @return the value of the 'Escalation Event Definition' containment reference. + * @see #setEscalationEventDefinition(EscalationEventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_EscalationEventDefinition() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='escalationEventDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition'" + * @generated + */ + EscalationEventDefinition getEscalationEventDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getEscalationEventDefinition Escalation Event Definition}' containment reference. + * + * + * @param value the new value of the 'Escalation Event Definition' containment reference. + * @see #getEscalationEventDefinition() + * @generated + */ + void setEscalationEventDefinition(EscalationEventDefinition value); + + /** + * Returns the value of the 'Event' containment reference. + * + * + * @return the value of the 'Event' containment reference. + * @see #setEvent(Event) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Event() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='event' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + Event getEvent(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getEvent Event}' containment reference. + * + * + * @param value the new value of the 'Event' containment reference. + * @see #getEvent() + * @generated + */ + void setEvent(Event value); + + /** + * Returns the value of the 'Event Based Gateway' containment reference. + * + * + * @return the value of the 'Event Based Gateway' containment reference. + * @see #setEventBasedGateway(EventBasedGateway) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_EventBasedGateway() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='eventBasedGateway' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + EventBasedGateway getEventBasedGateway(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getEventBasedGateway Event Based Gateway}' containment reference. + * + * + * @param value the new value of the 'Event Based Gateway' containment reference. + * @see #getEventBasedGateway() + * @generated + */ + void setEventBasedGateway(EventBasedGateway value); + + /** + * Returns the value of the 'Exclusive Gateway' containment reference. + * + * + * @return the value of the 'Exclusive Gateway' containment reference. + * @see #setExclusiveGateway(ExclusiveGateway) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ExclusiveGateway() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='exclusiveGateway' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + ExclusiveGateway getExclusiveGateway(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getExclusiveGateway Exclusive Gateway}' containment reference. + * + * + * @param value the new value of the 'Exclusive Gateway' containment reference. + * @see #getExclusiveGateway() + * @generated + */ + void setExclusiveGateway(ExclusiveGateway value); + + /** + * Returns the value of the 'Expression' containment reference. + * + * + * @return the value of the 'Expression' containment reference. + * @see #setExpression(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Expression() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='expression' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Expression getExpression(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getExpression Expression}' containment reference. + * + * + * @param value the new value of the 'Expression' containment reference. + * @see #getExpression() + * @generated + */ + void setExpression(Expression value); + + /** + * Returns the value of the 'Extension' containment reference. + * + * + * @return the value of the 'Extension' containment reference. + * @see #setExtension(Extension) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Extension() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='extension' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Extension getExtension(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getExtension Extension}' containment reference. + * + * + * @param value the new value of the 'Extension' containment reference. + * @see #getExtension() + * @generated + */ + void setExtension(Extension value); + + /** + * Returns the value of the 'Extension Elements' containment reference. + * + * + * @return the value of the 'Extension Elements' containment reference. + * @see #setExtensionElements(ExtensionAttributeValue) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ExtensionElements() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='extensionElements' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ExtensionAttributeValue getExtensionElements(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getExtensionElements Extension Elements}' containment reference. + * + * + * @param value the new value of the 'Extension Elements' containment reference. + * @see #getExtensionElements() + * @generated + */ + void setExtensionElements(ExtensionAttributeValue value); + + /** + * Returns the value of the 'Flow Node' containment reference. + * + * + * @return the value of the 'Flow Node' containment reference. + * @see #setFlowNode(FlowNode) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_FlowNode() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='flowNode' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + FlowNode getFlowNode(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getFlowNode Flow Node}' containment reference. + * + * + * @param value the new value of the 'Flow Node' containment reference. + * @see #getFlowNode() + * @generated + */ + void setFlowNode(FlowNode value); + + /** + * Returns the value of the 'Formal Expression' containment reference. + * + * + * @return the value of the 'Formal Expression' containment reference. + * @see #setFormalExpression(FormalExpression) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_FormalExpression() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='formalExpression' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#expression'" + * @generated + */ + FormalExpression getFormalExpression(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getFormalExpression Formal Expression}' containment reference. + * + * + * @param value the new value of the 'Formal Expression' containment reference. + * @see #getFormalExpression() + * @generated + */ + void setFormalExpression(FormalExpression value); + + /** + * Returns the value of the 'Gateway' containment reference. + * + * + * @return the value of the 'Gateway' containment reference. + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Gateway() + * @model containment="true" upper="-2" transient="true" changeable="false" volatile="true" derived="true" + * extendedMetaData="kind='element' name='gateway' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Gateway getGateway(); + + /** + * Returns the value of the 'Global Business Rule Task' containment reference. + * + * + * @return the value of the 'Global Business Rule Task' containment reference. + * @see #setGlobalBusinessRuleTask(GlobalBusinessRuleTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_GlobalBusinessRuleTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='globalBusinessRuleTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + GlobalBusinessRuleTask getGlobalBusinessRuleTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalBusinessRuleTask Global Business Rule Task}' containment reference. + * + * + * @param value the new value of the 'Global Business Rule Task' containment reference. + * @see #getGlobalBusinessRuleTask() + * @generated + */ + void setGlobalBusinessRuleTask(GlobalBusinessRuleTask value); + + /** + * Returns the value of the 'Global Choreography Task' containment reference. + * + * + * @return the value of the 'Global Choreography Task' containment reference. + * @see #setGlobalChoreographyTask(GlobalChoreographyTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_GlobalChoreographyTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='globalChoreographyTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#choreography'" + * @generated + */ + GlobalChoreographyTask getGlobalChoreographyTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalChoreographyTask Global Choreography Task}' containment reference. + * + * + * @param value the new value of the 'Global Choreography Task' containment reference. + * @see #getGlobalChoreographyTask() + * @generated + */ + void setGlobalChoreographyTask(GlobalChoreographyTask value); + + /** + * Returns the value of the 'Global Conversation' containment reference. + * + * + * @return the value of the 'Global Conversation' containment reference. + * @see #setGlobalConversation(GlobalConversation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_GlobalConversation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='globalConversation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#collaboration'" + * @generated + */ + GlobalConversation getGlobalConversation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalConversation Global Conversation}' containment reference. + * + * + * @param value the new value of the 'Global Conversation' containment reference. + * @see #getGlobalConversation() + * @generated + */ + void setGlobalConversation(GlobalConversation value); + + /** + * Returns the value of the 'Global Manual Task' containment reference. + * + * + * @return the value of the 'Global Manual Task' containment reference. + * @see #setGlobalManualTask(GlobalManualTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_GlobalManualTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='globalManualTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + GlobalManualTask getGlobalManualTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalManualTask Global Manual Task}' containment reference. + * + * + * @param value the new value of the 'Global Manual Task' containment reference. + * @see #getGlobalManualTask() + * @generated + */ + void setGlobalManualTask(GlobalManualTask value); + + /** + * Returns the value of the 'Global Script Task' containment reference. + * + * + * @return the value of the 'Global Script Task' containment reference. + * @see #setGlobalScriptTask(GlobalScriptTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_GlobalScriptTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='globalScriptTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + GlobalScriptTask getGlobalScriptTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalScriptTask Global Script Task}' containment reference. + * + * + * @param value the new value of the 'Global Script Task' containment reference. + * @see #getGlobalScriptTask() + * @generated + */ + void setGlobalScriptTask(GlobalScriptTask value); + + /** + * Returns the value of the 'Global Task' containment reference. + * + * + * @return the value of the 'Global Task' containment reference. + * @see #setGlobalTask(GlobalTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_GlobalTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='globalTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + GlobalTask getGlobalTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalTask Global Task}' containment reference. + * + * + * @param value the new value of the 'Global Task' containment reference. + * @see #getGlobalTask() + * @generated + */ + void setGlobalTask(GlobalTask value); + + /** + * Returns the value of the 'Global User Task' containment reference. + * + * + * @return the value of the 'Global User Task' containment reference. + * @see #setGlobalUserTask(GlobalUserTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_GlobalUserTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='globalUserTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + GlobalUserTask getGlobalUserTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getGlobalUserTask Global User Task}' containment reference. + * + * + * @param value the new value of the 'Global User Task' containment reference. + * @see #getGlobalUserTask() + * @generated + */ + void setGlobalUserTask(GlobalUserTask value); + + /** + * Returns the value of the 'Group' containment reference. + * + * + * @return the value of the 'Group' containment reference. + * @see #setGroup(Group) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Group() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='group' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#artifact'" + * @generated + */ + Group getGroup(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getGroup Group}' containment reference. + * + * + * @param value the new value of the 'Group' containment reference. + * @see #getGroup() + * @generated + */ + void setGroup(Group value); + + /** + * Returns the value of the 'Human Performer' containment reference. + * + * + * @return the value of the 'Human Performer' containment reference. + * @see #setHumanPerformer(HumanPerformer) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_HumanPerformer() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='humanPerformer' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#performer'" + * @generated + */ + HumanPerformer getHumanPerformer(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getHumanPerformer Human Performer}' containment reference. + * + * + * @param value the new value of the 'Human Performer' containment reference. + * @see #getHumanPerformer() + * @generated + */ + void setHumanPerformer(HumanPerformer value); + + /** + * Returns the value of the 'Performer' containment reference. + * + * + * @return the value of the 'Performer' containment reference. + * @see #setPerformer(Performer) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Performer() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='performer' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#resourceRole'" + * @generated + */ + Performer getPerformer(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getPerformer Performer}' containment reference. + * + * + * @param value the new value of the 'Performer' containment reference. + * @see #getPerformer() + * @generated + */ + void setPerformer(Performer value); + + /** + * Returns the value of the 'Resource Role' containment reference. + * + * + * @return the value of the 'Resource Role' containment reference. + * @see #setResourceRole(ResourceRole) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ResourceRole() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='resourceRole' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ResourceRole getResourceRole(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getResourceRole Resource Role}' containment reference. + * + * + * @param value the new value of the 'Resource Role' containment reference. + * @see #getResourceRole() + * @generated + */ + void setResourceRole(ResourceRole value); + + /** + * Returns the value of the 'Implicit Throw Event' containment reference. + * + * + * @return the value of the 'Implicit Throw Event' containment reference. + * @see #setImplicitThrowEvent(ImplicitThrowEvent) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ImplicitThrowEvent() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='implicitThrowEvent' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + ImplicitThrowEvent getImplicitThrowEvent(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getImplicitThrowEvent Implicit Throw Event}' containment reference. + * + * + * @param value the new value of the 'Implicit Throw Event' containment reference. + * @see #getImplicitThrowEvent() + * @generated + */ + void setImplicitThrowEvent(ImplicitThrowEvent value); + + /** + * Returns the value of the 'Import' containment reference. + * + * + * @return the value of the 'Import' containment reference. + * @see #setImport(Import) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Import() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='import' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Import getImport(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getImport Import}' containment reference. + * + * + * @param value the new value of the 'Import' containment reference. + * @see #getImport() + * @generated + */ + void setImport(Import value); + + /** + * Returns the value of the 'Inclusive Gateway' containment reference. + * + * + * @return the value of the 'Inclusive Gateway' containment reference. + * @see #setInclusiveGateway(InclusiveGateway) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_InclusiveGateway() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='inclusiveGateway' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + InclusiveGateway getInclusiveGateway(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getInclusiveGateway Inclusive Gateway}' containment reference. + * + * + * @param value the new value of the 'Inclusive Gateway' containment reference. + * @see #getInclusiveGateway() + * @generated + */ + void setInclusiveGateway(InclusiveGateway value); + + /** + * Returns the value of the 'Input Set' containment reference. + * + * + * @return the value of the 'Input Set' containment reference. + * @see #setInputSet(InputSet) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_InputSet() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='inputSet' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + InputSet getInputSet(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getInputSet Input Set}' containment reference. + * + * + * @param value the new value of the 'Input Set' containment reference. + * @see #getInputSet() + * @generated + */ + void setInputSet(InputSet value); + + /** + * Returns the value of the 'Interface' containment reference. + * + * + * @return the value of the 'Interface' containment reference. + * @see #setInterface(Interface) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Interface() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='interface' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + Interface getInterface(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getInterface Interface}' containment reference. + * + * + * @param value the new value of the 'Interface' containment reference. + * @see #getInterface() + * @generated + */ + void setInterface(Interface value); + + /** + * Returns the value of the 'Intermediate Catch Event' containment reference. + * + * + * @return the value of the 'Intermediate Catch Event' containment reference. + * @see #setIntermediateCatchEvent(IntermediateCatchEvent) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_IntermediateCatchEvent() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='intermediateCatchEvent' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + IntermediateCatchEvent getIntermediateCatchEvent(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getIntermediateCatchEvent Intermediate Catch Event}' containment reference. + * + * + * @param value the new value of the 'Intermediate Catch Event' containment reference. + * @see #getIntermediateCatchEvent() + * @generated + */ + void setIntermediateCatchEvent(IntermediateCatchEvent value); + + /** + * Returns the value of the 'Intermediate Throw Event' containment reference. + * + * + * @return the value of the 'Intermediate Throw Event' containment reference. + * @see #setIntermediateThrowEvent(IntermediateThrowEvent) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_IntermediateThrowEvent() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='intermediateThrowEvent' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + IntermediateThrowEvent getIntermediateThrowEvent(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getIntermediateThrowEvent Intermediate Throw Event}' containment reference. + * + * + * @param value the new value of the 'Intermediate Throw Event' containment reference. + * @see #getIntermediateThrowEvent() + * @generated + */ + void setIntermediateThrowEvent(IntermediateThrowEvent value); + + /** + * Returns the value of the 'Io Binding' containment reference. + * + * + * @return the value of the 'Io Binding' containment reference. + * @see #setIoBinding(InputOutputBinding) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_IoBinding() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='ioBinding' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + InputOutputBinding getIoBinding(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getIoBinding Io Binding}' containment reference. + * + * + * @param value the new value of the 'Io Binding' containment reference. + * @see #getIoBinding() + * @generated + */ + void setIoBinding(InputOutputBinding value); + + /** + * Returns the value of the 'Io Specification' containment reference. + * + * + * @return the value of the 'Io Specification' containment reference. + * @see #setIoSpecification(InputOutputSpecification) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_IoSpecification() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='ioSpecification' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + InputOutputSpecification getIoSpecification(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getIoSpecification Io Specification}' containment reference. + * + * + * @param value the new value of the 'Io Specification' containment reference. + * @see #getIoSpecification() + * @generated + */ + void setIoSpecification(InputOutputSpecification value); + + /** + * Returns the value of the 'Item Definition' containment reference. + * + * + * @return the value of the 'Item Definition' containment reference. + * @see #setItemDefinition(ItemDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ItemDefinition() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='itemDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + ItemDefinition getItemDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getItemDefinition Item Definition}' containment reference. + * + * + * @param value the new value of the 'Item Definition' containment reference. + * @see #getItemDefinition() + * @generated + */ + void setItemDefinition(ItemDefinition value); + + /** + * Returns the value of the 'Lane' containment reference. + * + * + * @return the value of the 'Lane' containment reference. + * @see #setLane(Lane) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Lane() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='lane' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Lane getLane(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getLane Lane}' containment reference. + * + * + * @param value the new value of the 'Lane' containment reference. + * @see #getLane() + * @generated + */ + void setLane(Lane value); + + /** + * Returns the value of the 'Lane Set' containment reference. + * + * + * @return the value of the 'Lane Set' containment reference. + * @see #setLaneSet(LaneSet) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_LaneSet() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='laneSet' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + LaneSet getLaneSet(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getLaneSet Lane Set}' containment reference. + * + * + * @param value the new value of the 'Lane Set' containment reference. + * @see #getLaneSet() + * @generated + */ + void setLaneSet(LaneSet value); + + /** + * Returns the value of the 'Link Event Definition' containment reference. + * + * + * @return the value of the 'Link Event Definition' containment reference. + * @see #setLinkEventDefinition(LinkEventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_LinkEventDefinition() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='linkEventDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition'" + * @generated + */ + LinkEventDefinition getLinkEventDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getLinkEventDefinition Link Event Definition}' containment reference. + * + * + * @param value the new value of the 'Link Event Definition' containment reference. + * @see #getLinkEventDefinition() + * @generated + */ + void setLinkEventDefinition(LinkEventDefinition value); + + /** + * Returns the value of the 'Loop Characteristics' containment reference. + * + * + * @return the value of the 'Loop Characteristics' containment reference. + * @see #setLoopCharacteristics(LoopCharacteristics) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_LoopCharacteristics() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='loopCharacteristics' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + LoopCharacteristics getLoopCharacteristics(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getLoopCharacteristics Loop Characteristics}' containment reference. + * + * + * @param value the new value of the 'Loop Characteristics' containment reference. + * @see #getLoopCharacteristics() + * @generated + */ + void setLoopCharacteristics(LoopCharacteristics value); + + /** + * Returns the value of the 'Manual Task' containment reference. + * + * + * @return the value of the 'Manual Task' containment reference. + * @see #setManualTask(ManualTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ManualTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='manualTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + ManualTask getManualTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getManualTask Manual Task}' containment reference. + * + * + * @param value the new value of the 'Manual Task' containment reference. + * @see #getManualTask() + * @generated + */ + void setManualTask(ManualTask value); + + /** + * Returns the value of the 'Message' containment reference. + * + * + * @return the value of the 'Message' containment reference. + * @see #setMessage(Message) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Message() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='message' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + Message getMessage(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getMessage Message}' containment reference. + * + * + * @param value the new value of the 'Message' containment reference. + * @see #getMessage() + * @generated + */ + void setMessage(Message value); + + /** + * Returns the value of the 'Message Event Definition' containment reference. + * + * + * @return the value of the 'Message Event Definition' containment reference. + * @see #setMessageEventDefinition(MessageEventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_MessageEventDefinition() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='messageEventDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition'" + * @generated + */ + MessageEventDefinition getMessageEventDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getMessageEventDefinition Message Event Definition}' containment reference. + * + * + * @param value the new value of the 'Message Event Definition' containment reference. + * @see #getMessageEventDefinition() + * @generated + */ + void setMessageEventDefinition(MessageEventDefinition value); + + /** + * Returns the value of the 'Message Flow' containment reference. + * + * + * @return the value of the 'Message Flow' containment reference. + * @see #setMessageFlow(MessageFlow) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_MessageFlow() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='messageFlow' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + MessageFlow getMessageFlow(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getMessageFlow Message Flow}' containment reference. + * + * + * @param value the new value of the 'Message Flow' containment reference. + * @see #getMessageFlow() + * @generated + */ + void setMessageFlow(MessageFlow value); + + /** + * Returns the value of the 'Message Flow Association' containment reference. + * + * + * @return the value of the 'Message Flow Association' containment reference. + * @see #setMessageFlowAssociation(MessageFlowAssociation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_MessageFlowAssociation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='messageFlowAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + MessageFlowAssociation getMessageFlowAssociation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getMessageFlowAssociation Message Flow Association}' containment reference. + * + * + * @param value the new value of the 'Message Flow Association' containment reference. + * @see #getMessageFlowAssociation() + * @generated + */ + void setMessageFlowAssociation(MessageFlowAssociation value); + + /** + * Returns the value of the 'Monitoring' containment reference. + * + * + * @return the value of the 'Monitoring' containment reference. + * @see #setMonitoring(Monitoring) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Monitoring() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='monitoring' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Monitoring getMonitoring(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getMonitoring Monitoring}' containment reference. + * + * + * @param value the new value of the 'Monitoring' containment reference. + * @see #getMonitoring() + * @generated + */ + void setMonitoring(Monitoring value); + + /** + * Returns the value of the 'Multi Instance Loop Characteristics' containment reference. + * + * + * @return the value of the 'Multi Instance Loop Characteristics' containment reference. + * @see #setMultiInstanceLoopCharacteristics(MultiInstanceLoopCharacteristics) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_MultiInstanceLoopCharacteristics() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='multiInstanceLoopCharacteristics' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#loopCharacteristics'" + * @generated + */ + MultiInstanceLoopCharacteristics getMultiInstanceLoopCharacteristics(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getMultiInstanceLoopCharacteristics Multi Instance Loop Characteristics}' containment reference. + * + * + * @param value the new value of the 'Multi Instance Loop Characteristics' containment reference. + * @see #getMultiInstanceLoopCharacteristics() + * @generated + */ + void setMultiInstanceLoopCharacteristics(MultiInstanceLoopCharacteristics value); + + /** + * Returns the value of the 'Operation' containment reference. + * + * + * @return the value of the 'Operation' containment reference. + * @see #setOperation(Operation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Operation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='operation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Operation getOperation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getOperation Operation}' containment reference. + * + * + * @param value the new value of the 'Operation' containment reference. + * @see #getOperation() + * @generated + */ + void setOperation(Operation value); + + /** + * Returns the value of the 'Output Set' containment reference. + * + * + * @return the value of the 'Output Set' containment reference. + * @see #setOutputSet(OutputSet) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_OutputSet() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='outputSet' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + OutputSet getOutputSet(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getOutputSet Output Set}' containment reference. + * + * + * @param value the new value of the 'Output Set' containment reference. + * @see #getOutputSet() + * @generated + */ + void setOutputSet(OutputSet value); + + /** + * Returns the value of the 'Parallel Gateway' containment reference. + * + * + * @return the value of the 'Parallel Gateway' containment reference. + * @see #setParallelGateway(ParallelGateway) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ParallelGateway() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='parallelGateway' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + ParallelGateway getParallelGateway(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getParallelGateway Parallel Gateway}' containment reference. + * + * + * @param value the new value of the 'Parallel Gateway' containment reference. + * @see #getParallelGateway() + * @generated + */ + void setParallelGateway(ParallelGateway value); + + /** + * Returns the value of the 'Participant' containment reference. + * + * + * @return the value of the 'Participant' containment reference. + * @see #setParticipant(Participant) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Participant() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='participant' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Participant getParticipant(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getParticipant Participant}' containment reference. + * + * + * @param value the new value of the 'Participant' containment reference. + * @see #getParticipant() + * @generated + */ + void setParticipant(Participant value); + + /** + * Returns the value of the 'Participant Association' containment reference. + * + * + * @return the value of the 'Participant Association' containment reference. + * @see #setParticipantAssociation(ParticipantAssociation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ParticipantAssociation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='participantAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ParticipantAssociation getParticipantAssociation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getParticipantAssociation Participant Association}' containment reference. + * + * + * @param value the new value of the 'Participant Association' containment reference. + * @see #getParticipantAssociation() + * @generated + */ + void setParticipantAssociation(ParticipantAssociation value); + + /** + * Returns the value of the 'Participant Multiplicity' containment reference. + * + * + * @return the value of the 'Participant Multiplicity' containment reference. + * @see #setParticipantMultiplicity(ParticipantMultiplicity) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ParticipantMultiplicity() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='participantMultiplicity' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ParticipantMultiplicity getParticipantMultiplicity(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getParticipantMultiplicity Participant Multiplicity}' containment reference. + * + * + * @param value the new value of the 'Participant Multiplicity' containment reference. + * @see #getParticipantMultiplicity() + * @generated + */ + void setParticipantMultiplicity(ParticipantMultiplicity value); + + /** + * Returns the value of the 'Partner Entity' containment reference. + * + * + * @return the value of the 'Partner Entity' containment reference. + * @see #setPartnerEntity(PartnerEntity) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_PartnerEntity() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='partnerEntity' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + PartnerEntity getPartnerEntity(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getPartnerEntity Partner Entity}' containment reference. + * + * + * @param value the new value of the 'Partner Entity' containment reference. + * @see #getPartnerEntity() + * @generated + */ + void setPartnerEntity(PartnerEntity value); + + /** + * Returns the value of the 'Partner Role' containment reference. + * + * + * @return the value of the 'Partner Role' containment reference. + * @see #setPartnerRole(PartnerRole) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_PartnerRole() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='partnerRole' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + PartnerRole getPartnerRole(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getPartnerRole Partner Role}' containment reference. + * + * + * @param value the new value of the 'Partner Role' containment reference. + * @see #getPartnerRole() + * @generated + */ + void setPartnerRole(PartnerRole value); + + /** + * Returns the value of the 'Potential Owner' containment reference. + * + * + * @return the value of the 'Potential Owner' containment reference. + * @see #setPotentialOwner(PotentialOwner) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_PotentialOwner() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='potentialOwner' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#performer'" + * @generated + */ + PotentialOwner getPotentialOwner(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getPotentialOwner Potential Owner}' containment reference. + * + * + * @param value the new value of the 'Potential Owner' containment reference. + * @see #getPotentialOwner() + * @generated + */ + void setPotentialOwner(PotentialOwner value); + + /** + * Returns the value of the 'Process' containment reference. + * + * + * @return the value of the 'Process' containment reference. + * @see #setProcess(org.eclipse.bpmn2.Process) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Process() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='process' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + org.eclipse.bpmn2.Process getProcess(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getProcess Process}' containment reference. + * + * + * @param value the new value of the 'Process' containment reference. + * @see #getProcess() + * @generated + */ + void setProcess(org.eclipse.bpmn2.Process value); + + /** + * Returns the value of the 'Property' containment reference. + * + * + * @return the value of the 'Property' containment reference. + * @see #setProperty(Property) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Property() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='property' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Property getProperty(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getProperty Property}' containment reference. + * + * + * @param value the new value of the 'Property' containment reference. + * @see #getProperty() + * @generated + */ + void setProperty(Property value); + + /** + * Returns the value of the 'Receive Task' containment reference. + * + * + * @return the value of the 'Receive Task' containment reference. + * @see #setReceiveTask(ReceiveTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ReceiveTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='receiveTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + ReceiveTask getReceiveTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getReceiveTask Receive Task}' containment reference. + * + * + * @param value the new value of the 'Receive Task' containment reference. + * @see #getReceiveTask() + * @generated + */ + void setReceiveTask(ReceiveTask value); + + /** + * Returns the value of the 'Relationship' containment reference. + * + * + * @return the value of the 'Relationship' containment reference. + * @see #setRelationship(Relationship) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Relationship() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='relationship' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Relationship getRelationship(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getRelationship Relationship}' containment reference. + * + * + * @param value the new value of the 'Relationship' containment reference. + * @see #getRelationship() + * @generated + */ + void setRelationship(Relationship value); + + /** + * Returns the value of the 'Rendering' containment reference. + * + * + * @return the value of the 'Rendering' containment reference. + * @see #setRendering(Rendering) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Rendering() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='rendering' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Rendering getRendering(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getRendering Rendering}' containment reference. + * + * + * @param value the new value of the 'Rendering' containment reference. + * @see #getRendering() + * @generated + */ + void setRendering(Rendering value); + + /** + * Returns the value of the 'Resource' containment reference. + * + * + * @return the value of the 'Resource' containment reference. + * @see #setResource(Resource) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Resource() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='resource' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + Resource getResource(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getResource Resource}' containment reference. + * + * + * @param value the new value of the 'Resource' containment reference. + * @see #getResource() + * @generated + */ + void setResource(Resource value); + + /** + * Returns the value of the 'Resource Assignment Expression' containment reference. + * + * + * @return the value of the 'Resource Assignment Expression' containment reference. + * @see #setResourceAssignmentExpression(ResourceAssignmentExpression) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ResourceAssignmentExpression() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='resourceAssignmentExpression' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ResourceAssignmentExpression getResourceAssignmentExpression(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getResourceAssignmentExpression Resource Assignment Expression}' containment reference. + * + * + * @param value the new value of the 'Resource Assignment Expression' containment reference. + * @see #getResourceAssignmentExpression() + * @generated + */ + void setResourceAssignmentExpression(ResourceAssignmentExpression value); + + /** + * Returns the value of the 'Resource Parameter' containment reference. + * + * + * @return the value of the 'Resource Parameter' containment reference. + * @see #setResourceParameter(ResourceParameter) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ResourceParameter() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='resourceParameter' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ResourceParameter getResourceParameter(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getResourceParameter Resource Parameter}' containment reference. + * + * + * @param value the new value of the 'Resource Parameter' containment reference. + * @see #getResourceParameter() + * @generated + */ + void setResourceParameter(ResourceParameter value); + + /** + * Returns the value of the 'Resource Parameter Binding' containment reference. + * + * + * @return the value of the 'Resource Parameter Binding' containment reference. + * @see #setResourceParameterBinding(ResourceParameterBinding) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ResourceParameterBinding() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='resourceParameterBinding' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ResourceParameterBinding getResourceParameterBinding(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getResourceParameterBinding Resource Parameter Binding}' containment reference. + * + * + * @param value the new value of the 'Resource Parameter Binding' containment reference. + * @see #getResourceParameterBinding() + * @generated + */ + void setResourceParameterBinding(ResourceParameterBinding value); + + /** + * Returns the value of the 'Script' containment reference. + * + * + * @return the value of the 'Script' containment reference. + * @see #setScript(EObject) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Script() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='script' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EObject getScript(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getScript Script}' containment reference. + * + * + * @param value the new value of the 'Script' containment reference. + * @see #getScript() + * @generated + */ + void setScript(EObject value); + + /** + * Returns the value of the 'Script Task' containment reference. + * + * + * @return the value of the 'Script Task' containment reference. + * @see #setScriptTask(ScriptTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ScriptTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='scriptTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + ScriptTask getScriptTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getScriptTask Script Task}' containment reference. + * + * + * @param value the new value of the 'Script Task' containment reference. + * @see #getScriptTask() + * @generated + */ + void setScriptTask(ScriptTask value); + + /** + * Returns the value of the 'Send Task' containment reference. + * + * + * @return the value of the 'Send Task' containment reference. + * @see #setSendTask(SendTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_SendTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='sendTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + SendTask getSendTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getSendTask Send Task}' containment reference. + * + * + * @param value the new value of the 'Send Task' containment reference. + * @see #getSendTask() + * @generated + */ + void setSendTask(SendTask value); + + /** + * Returns the value of the 'Sequence Flow' containment reference. + * + * + * @return the value of the 'Sequence Flow' containment reference. + * @see #setSequenceFlow(SequenceFlow) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_SequenceFlow() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='sequenceFlow' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + SequenceFlow getSequenceFlow(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getSequenceFlow Sequence Flow}' containment reference. + * + * + * @param value the new value of the 'Sequence Flow' containment reference. + * @see #getSequenceFlow() + * @generated + */ + void setSequenceFlow(SequenceFlow value); + + /** + * Returns the value of the 'Service Task' containment reference. + * + * + * @return the value of the 'Service Task' containment reference. + * @see #setServiceTask(ServiceTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ServiceTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='serviceTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + ServiceTask getServiceTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getServiceTask Service Task}' containment reference. + * + * + * @param value the new value of the 'Service Task' containment reference. + * @see #getServiceTask() + * @generated + */ + void setServiceTask(ServiceTask value); + + /** + * Returns the value of the 'Signal' containment reference. + * + * + * @return the value of the 'Signal' containment reference. + * @see #setSignal(Signal) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Signal() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='signal' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement'" + * @generated + */ + Signal getSignal(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getSignal Signal}' containment reference. + * + * + * @param value the new value of the 'Signal' containment reference. + * @see #getSignal() + * @generated + */ + void setSignal(Signal value); + + /** + * Returns the value of the 'Signal Event Definition' containment reference. + * + * + * @return the value of the 'Signal Event Definition' containment reference. + * @see #setSignalEventDefinition(SignalEventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_SignalEventDefinition() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='signalEventDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition'" + * @generated + */ + SignalEventDefinition getSignalEventDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getSignalEventDefinition Signal Event Definition}' containment reference. + * + * + * @param value the new value of the 'Signal Event Definition' containment reference. + * @see #getSignalEventDefinition() + * @generated + */ + void setSignalEventDefinition(SignalEventDefinition value); + + /** + * Returns the value of the 'Standard Loop Characteristics' containment reference. + * + * + * @return the value of the 'Standard Loop Characteristics' containment reference. + * @see #setStandardLoopCharacteristics(StandardLoopCharacteristics) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_StandardLoopCharacteristics() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='standardLoopCharacteristics' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#loopCharacteristics'" + * @generated + */ + StandardLoopCharacteristics getStandardLoopCharacteristics(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getStandardLoopCharacteristics Standard Loop Characteristics}' containment reference. + * + * + * @param value the new value of the 'Standard Loop Characteristics' containment reference. + * @see #getStandardLoopCharacteristics() + * @generated + */ + void setStandardLoopCharacteristics(StandardLoopCharacteristics value); + + /** + * Returns the value of the 'Start Event' containment reference. + * + * + * @return the value of the 'Start Event' containment reference. + * @see #setStartEvent(StartEvent) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_StartEvent() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='startEvent' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + StartEvent getStartEvent(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getStartEvent Start Event}' containment reference. + * + * + * @param value the new value of the 'Start Event' containment reference. + * @see #getStartEvent() + * @generated + */ + void setStartEvent(StartEvent value); + + /** + * Returns the value of the 'Sub Choreography' containment reference. + * + * + * @return the value of the 'Sub Choreography' containment reference. + * @see #setSubChoreography(SubChoreography) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_SubChoreography() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='subChoreography' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + SubChoreography getSubChoreography(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getSubChoreography Sub Choreography}' containment reference. + * + * + * @param value the new value of the 'Sub Choreography' containment reference. + * @see #getSubChoreography() + * @generated + */ + void setSubChoreography(SubChoreography value); + + /** + * Returns the value of the 'Sub Conversation' containment reference. + * + * + * @return the value of the 'Sub Conversation' containment reference. + * @see #setSubConversation(SubConversation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_SubConversation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='subConversation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#conversationNode'" + * @generated + */ + SubConversation getSubConversation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getSubConversation Sub Conversation}' containment reference. + * + * + * @param value the new value of the 'Sub Conversation' containment reference. + * @see #getSubConversation() + * @generated + */ + void setSubConversation(SubConversation value); + + /** + * Returns the value of the 'Sub Process' containment reference. + * + * + * @return the value of the 'Sub Process' containment reference. + * @see #setSubProcess(SubProcess) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_SubProcess() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='subProcess' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + SubProcess getSubProcess(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getSubProcess Sub Process}' containment reference. + * + * + * @param value the new value of the 'Sub Process' containment reference. + * @see #getSubProcess() + * @generated + */ + void setSubProcess(SubProcess value); + + /** + * Returns the value of the 'Task' containment reference. + * + * + * @return the value of the 'Task' containment reference. + * @see #setTask(Task) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Task() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='task' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + Task getTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getTask Task}' containment reference. + * + * + * @param value the new value of the 'Task' containment reference. + * @see #getTask() + * @generated + */ + void setTask(Task value); + + /** + * Returns the value of the 'Terminate Event Definition' containment reference. + * + * + * @return the value of the 'Terminate Event Definition' containment reference. + * @see #setTerminateEventDefinition(TerminateEventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_TerminateEventDefinition() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='terminateEventDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition'" + * @generated + */ + TerminateEventDefinition getTerminateEventDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getTerminateEventDefinition Terminate Event Definition}' containment reference. + * + * + * @param value the new value of the 'Terminate Event Definition' containment reference. + * @see #getTerminateEventDefinition() + * @generated + */ + void setTerminateEventDefinition(TerminateEventDefinition value); + + /** + * Returns the value of the 'Text' containment reference. + * + * + * @return the value of the 'Text' containment reference. + * @see #setText(EObject) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Text() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='text' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EObject getText(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getText Text}' containment reference. + * + * + * @param value the new value of the 'Text' containment reference. + * @see #getText() + * @generated + */ + void setText(EObject value); + + /** + * Returns the value of the 'Text Annotation' containment reference. + * + * + * @return the value of the 'Text Annotation' containment reference. + * @see #setTextAnnotation(TextAnnotation) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_TextAnnotation() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='textAnnotation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + TextAnnotation getTextAnnotation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getTextAnnotation Text Annotation}' containment reference. + * + * + * @param value the new value of the 'Text Annotation' containment reference. + * @see #getTextAnnotation() + * @generated + */ + void setTextAnnotation(TextAnnotation value); + + /** + * Returns the value of the 'Throw Event' containment reference. + * + * + * @return the value of the 'Throw Event' containment reference. + * @see #setThrowEvent(ThrowEvent) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_ThrowEvent() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='throwEvent' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ThrowEvent getThrowEvent(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getThrowEvent Throw Event}' containment reference. + * + * + * @param value the new value of the 'Throw Event' containment reference. + * @see #getThrowEvent() + * @generated + */ + void setThrowEvent(ThrowEvent value); + + /** + * Returns the value of the 'Timer Event Definition' containment reference. + * + * + * @return the value of the 'Timer Event Definition' containment reference. + * @see #setTimerEventDefinition(TimerEventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_TimerEventDefinition() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='timerEventDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition'" + * @generated + */ + TimerEventDefinition getTimerEventDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getTimerEventDefinition Timer Event Definition}' containment reference. + * + * + * @param value the new value of the 'Timer Event Definition' containment reference. + * @see #getTimerEventDefinition() + * @generated + */ + void setTimerEventDefinition(TimerEventDefinition value); + + /** + * Returns the value of the 'Transaction' containment reference. + * + * + * @return the value of the 'Transaction' containment reference. + * @see #setTransaction(Transaction) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_Transaction() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='transaction' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + Transaction getTransaction(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getTransaction Transaction}' containment reference. + * + * + * @param value the new value of the 'Transaction' containment reference. + * @see #getTransaction() + * @generated + */ + void setTransaction(Transaction value); + + /** + * Returns the value of the 'User Task' containment reference. + * + * + * @return the value of the 'User Task' containment reference. + * @see #setUserTask(UserTask) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_UserTask() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='userTask' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + UserTask getUserTask(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getUserTask User Task}' containment reference. + * + * + * @param value the new value of the 'User Task' containment reference. + * @see #getUserTask() + * @generated + */ + void setUserTask(UserTask value); + + /** + * Returns the value of the 'Event Sub Process' containment reference. + * + * + * @return the value of the 'Event Sub Process' containment reference. + * @see #setEventSubProcess(EventSubprocess) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentRoot_EventSubProcess() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='subProcess' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' affiliation='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + EventSubprocess getEventSubProcess(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.DocumentRoot#getEventSubProcess Event Sub Process}' containment reference. + * + * + * @param value the new value of the 'Event Sub Process' containment reference. + * @see #getEventSubProcess() + * @generated + */ + void setEventSubProcess(EventSubprocess value); + +} // DocumentRoot diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Documentation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Documentation.java new file mode 100644 index 00000000000..997032cf0d5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Documentation.java @@ -0,0 +1,97 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'Documentation'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Documentation#getMixed Mixed}
  • + *
  • {@link org.eclipse.bpmn2.Documentation#getText Text}
  • + *
  • {@link org.eclipse.bpmn2.Documentation#getTextFormat Text Format}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentation() + * @model extendedMetaData="name='tDocumentation' kind='mixed'" + * @generated + */ +public interface Documentation extends BaseElement { + /** + * Returns the value of the 'Mixed' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Mixed' attribute list. + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentation_Mixed() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='elementWildcard' name=':mixed'" + * @generated + */ + FeatureMap getMixed(); + + /** + * Returns the value of the 'Text' attribute. + * + * + * @return the value of the 'Text' attribute. + * @see #setText(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentation_Text() + * @model required="true" volatile="true" derived="true" ordered="false" + * @generated + */ + String getText(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Documentation#getText Text}' attribute. + * + * + * @param value the new value of the 'Text' attribute. + * @see #getText() + * @generated + */ + void setText(String value); + + /** + * Returns the value of the 'Text Format' attribute. + * The default value is "text/plain". + * + * + * @return the value of the 'Text Format' attribute. + * @see #setTextFormat(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getDocumentation_TextFormat() + * @model default="text/plain" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='textFormat'" + * @generated + */ + String getTextFormat(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Documentation#getTextFormat Text Format}' attribute. + * + * + * @param value the new value of the 'Text Format' attribute. + * @see #getTextFormat() + * @generated + */ + void setTextFormat(String value); + +} // Documentation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EndEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EndEvent.java new file mode 100644 index 00000000000..1aac3db7a59 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EndEvent.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'End Event'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getEndEvent() + * @model extendedMetaData="name='tEndEvent' kind='elementOnly'" + * @generated + */ +public interface EndEvent extends ThrowEvent { +} // EndEvent diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EndPoint.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EndPoint.java new file mode 100644 index 00000000000..80bfe4f7bc2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EndPoint.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'End Point'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getEndPoint() + * @model extendedMetaData="name='tEndPoint' kind='elementOnly'" + * @generated + */ +public interface EndPoint extends RootElement { +} // EndPoint diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Error.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Error.java new file mode 100644 index 00000000000..ab9981f6460 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Error.java @@ -0,0 +1,105 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Error'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Error#getErrorCode Error Code}
  • + *
  • {@link org.eclipse.bpmn2.Error#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.Error#getStructureRef Structure Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getError() + * @model extendedMetaData="name='tError' kind='elementOnly'" + * @generated + */ +public interface Error extends RootElement { + /** + * Returns the value of the 'Error Code' attribute. + * + * + * @return the value of the 'Error Code' attribute. + * @see #setErrorCode(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getError_ErrorCode() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='errorCode'" + * @generated + */ + String getErrorCode(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Error#getErrorCode Error Code}' attribute. + * + * + * @param value the new value of the 'Error Code' attribute. + * @see #getErrorCode() + * @generated + */ + void setErrorCode(String value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getError_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Error#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Structure Ref' reference. + * + * + * @return the value of the 'Structure Ref' reference. + * @see #setStructureRef(ItemDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getError_StructureRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='structureRef'" + * @generated + */ + ItemDefinition getStructureRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Error#getStructureRef Structure Ref}' reference. + * + * + * @param value the new value of the 'Structure Ref' reference. + * @see #getStructureRef() + * @generated + */ + void setStructureRef(ItemDefinition value); + +} // Error diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ErrorEventDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ErrorEventDefinition.java new file mode 100644 index 00000000000..b1fbdbfc2bb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ErrorEventDefinition.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Error Event Definition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ErrorEventDefinition#getErrorRef Error Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getErrorEventDefinition() + * @model extendedMetaData="name='tErrorEventDefinition' kind='elementOnly'" + * @generated + */ +public interface ErrorEventDefinition extends EventDefinition { + /** + * Returns the value of the 'Error Ref' reference. + * + * + * @return the value of the 'Error Ref' reference. + * @see #setErrorRef(org.eclipse.bpmn2.Error) + * @see org.eclipse.bpmn2.Bpmn2Package#getErrorEventDefinition_ErrorRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='errorRef'" + * @generated + */ + org.eclipse.bpmn2.Error getErrorRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ErrorEventDefinition#getErrorRef Error Ref}' reference. + * + * + * @param value the new value of the 'Error Ref' reference. + * @see #getErrorRef() + * @generated + */ + void setErrorRef(org.eclipse.bpmn2.Error value); + +} // ErrorEventDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Escalation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Escalation.java new file mode 100644 index 00000000000..e8ad7fa6966 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Escalation.java @@ -0,0 +1,105 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Escalation'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Escalation#getEscalationCode Escalation Code}
  • + *
  • {@link org.eclipse.bpmn2.Escalation#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.Escalation#getStructureRef Structure Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getEscalation() + * @model extendedMetaData="name='tEscalation' kind='elementOnly'" + * @generated + */ +public interface Escalation extends RootElement { + /** + * Returns the value of the 'Escalation Code' attribute. + * + * + * @return the value of the 'Escalation Code' attribute. + * @see #setEscalationCode(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getEscalation_EscalationCode() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='escalationCode'" + * @generated + */ + String getEscalationCode(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Escalation#getEscalationCode Escalation Code}' attribute. + * + * + * @param value the new value of the 'Escalation Code' attribute. + * @see #getEscalationCode() + * @generated + */ + void setEscalationCode(String value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getEscalation_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Escalation#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Structure Ref' reference. + * + * + * @return the value of the 'Structure Ref' reference. + * @see #setStructureRef(ItemDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getEscalation_StructureRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='structureRef'" + * @generated + */ + ItemDefinition getStructureRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Escalation#getStructureRef Structure Ref}' reference. + * + * + * @param value the new value of the 'Structure Ref' reference. + * @see #getStructureRef() + * @generated + */ + void setStructureRef(ItemDefinition value); + +} // Escalation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EscalationEventDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EscalationEventDefinition.java new file mode 100644 index 00000000000..95d7e592085 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EscalationEventDefinition.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Escalation Event Definition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.EscalationEventDefinition#getEscalationRef Escalation Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getEscalationEventDefinition() + * @model extendedMetaData="name='tEscalationEventDefinition' kind='elementOnly'" + * @generated + */ +public interface EscalationEventDefinition extends EventDefinition { + /** + * Returns the value of the 'Escalation Ref' reference. + * + * + * @return the value of the 'Escalation Ref' reference. + * @see #setEscalationRef(Escalation) + * @see org.eclipse.bpmn2.Bpmn2Package#getEscalationEventDefinition_EscalationRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='escalationRef'" + * @generated + */ + Escalation getEscalationRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.EscalationEventDefinition#getEscalationRef Escalation Ref}' reference. + * + * + * @param value the new value of the 'Escalation Ref' reference. + * @see #getEscalationRef() + * @generated + */ + void setEscalationRef(Escalation value); + +} // EscalationEventDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Event.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Event.java new file mode 100644 index 00000000000..dc74a086ee1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Event.java @@ -0,0 +1,50 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Event'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Event#getProperties Properties}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getEvent() + * @model abstract="true" + * extendedMetaData="name='tEvent' kind='elementOnly'" + * @generated + */ +public interface Event extends FlowNode, InteractionNode { + /** + * Returns the value of the 'Properties' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Property}. + * + * + * @return the value of the 'Properties' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getEvent_Properties() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='property' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getProperties(); + +} // Event diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EventBasedGateway.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EventBasedGateway.java new file mode 100644 index 00000000000..af15fefc9b1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EventBasedGateway.java @@ -0,0 +1,85 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Event Based Gateway'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.EventBasedGateway#getEventGatewayType Event Gateway Type}
  • + *
  • {@link org.eclipse.bpmn2.EventBasedGateway#isInstantiate Instantiate}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getEventBasedGateway() + * @model extendedMetaData="name='tEventBasedGateway' kind='elementOnly'" + * @generated + */ +public interface EventBasedGateway extends Gateway { + /** + * Returns the value of the 'Event Gateway Type' attribute. + * The literals are from the enumeration {@link org.eclipse.bpmn2.EventBasedGatewayType}. + * + * + * @return the value of the 'Event Gateway Type' attribute. + * @see org.eclipse.bpmn2.EventBasedGatewayType + * @see #setEventGatewayType(EventBasedGatewayType) + * @see org.eclipse.bpmn2.Bpmn2Package#getEventBasedGateway_EventGatewayType() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='eventGatewayType'" + * @generated + */ + EventBasedGatewayType getEventGatewayType(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.EventBasedGateway#getEventGatewayType Event Gateway Type}' attribute. + * + * + * @param value the new value of the 'Event Gateway Type' attribute. + * @see org.eclipse.bpmn2.EventBasedGatewayType + * @see #getEventGatewayType() + * @generated + */ + void setEventGatewayType(EventBasedGatewayType value); + + /** + * Returns the value of the 'Instantiate' attribute. + * The default value is "false". + * + * + * @return the value of the 'Instantiate' attribute. + * @see #setInstantiate(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getEventBasedGateway_Instantiate() + * @model default="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='instantiate'" + * @generated + */ + boolean isInstantiate(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.EventBasedGateway#isInstantiate Instantiate}' attribute. + * + * + * @param value the new value of the 'Instantiate' attribute. + * @see #isInstantiate() + * @generated + */ + void setInstantiate(boolean value); + +} // EventBasedGateway diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EventBasedGatewayType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EventBasedGatewayType.java new file mode 100644 index 00000000000..231752f6e57 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EventBasedGatewayType.java @@ -0,0 +1,219 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Event Based Gateway Type', + * and utility methods for working with them. + * + * @see org.eclipse.bpmn2.Bpmn2Package#getEventBasedGatewayType() + * @model extendedMetaData="name='tEventBasedGatewayType'" + * @generated + */ +public enum EventBasedGatewayType implements Enumerator { + /** + * The 'Parallel' literal object. + * + * + * @see #PARALLEL_VALUE + * @generated + * @ordered + */ + PARALLEL(0, "Parallel", "Parallel"), + + /** + * The 'Exclusive' literal object. + * + * + * @see #EXCLUSIVE_VALUE + * @generated + * @ordered + */ + EXCLUSIVE(1, "Exclusive", "Exclusive"); + + /** + * The 'Parallel' literal value. + * + * + * @see #PARALLEL + * @model name="Parallel" + * @generated + * @ordered + */ + public static final int PARALLEL_VALUE = 0; + + /** + * The 'Exclusive' literal value. + * + * + * @see #EXCLUSIVE + * @model name="Exclusive" + * @generated + * @ordered + */ + public static final int EXCLUSIVE_VALUE = 1; + + /** + * An array of all the 'Event Based Gateway Type' enumerators. + * + * + * @generated + */ + private static final EventBasedGatewayType[] VALUES_ARRAY = new EventBasedGatewayType[] { PARALLEL, EXCLUSIVE, }; + + /** + * A public read-only list of all the 'Event Based Gateway Type' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Event Based Gateway Type' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static EventBasedGatewayType get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + EventBasedGatewayType result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Event Based Gateway Type' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static EventBasedGatewayType getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + EventBasedGatewayType result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Event Based Gateway Type' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static EventBasedGatewayType get(int value) { + switch (value) { + case PARALLEL_VALUE: + return PARALLEL; + case EXCLUSIVE_VALUE: + return EXCLUSIVE; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private EventBasedGatewayType(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //EventBasedGatewayType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EventDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EventDefinition.java new file mode 100644 index 00000000000..ab9fad0df17 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EventDefinition.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Event Definition'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getEventDefinition() + * @model extendedMetaData="name='tEventDefinition' kind='elementOnly' abstract='true'" + * @generated + */ +public interface EventDefinition extends RootElement { +} // EventDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EventSubprocess.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EventSubprocess.java new file mode 100644 index 00000000000..b2fc5d7ff5c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/EventSubprocess.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Event Subprocess'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getEventSubprocess() + * @model extendedMetaData="name='tSubProcess' kind='elementOnly'" + * @generated + */ +public interface EventSubprocess extends SubProcess { +} // EventSubprocess diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ExclusiveGateway.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ExclusiveGateway.java new file mode 100644 index 00000000000..3decf2292b5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ExclusiveGateway.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Exclusive Gateway'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ExclusiveGateway#getDefault Default}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getExclusiveGateway() + * @model extendedMetaData="name='tExclusiveGateway' kind='elementOnly'" + * @generated + */ +public interface ExclusiveGateway extends Gateway { + /** + * Returns the value of the 'Default' reference. + * + * + * @return the value of the 'Default' reference. + * @see #setDefault(SequenceFlow) + * @see org.eclipse.bpmn2.Bpmn2Package#getExclusiveGateway_Default() + * @model resolveProxies="false" ordered="false" + * extendedMetaData="kind='attribute' name='default'" + * @generated + */ + SequenceFlow getDefault(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ExclusiveGateway#getDefault Default}' reference. + * + * + * @param value the new value of the 'Default' reference. + * @see #getDefault() + * @generated + */ + void setDefault(SequenceFlow value); + +} // ExclusiveGateway diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Expression.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Expression.java new file mode 100644 index 00000000000..4af94e3e2b8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Expression.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Expression'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getExpression() + * @model extendedMetaData="name='tExpression' kind='mixed'" + * @generated + */ +public interface Expression extends BaseElement { +} // Expression diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Extension.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Extension.java new file mode 100644 index 00000000000..a8991c1f78d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Extension.java @@ -0,0 +1,109 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import javax.xml.namespace.QName; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Extension'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Extension#getDefinition Definition}
  • + *
  • {@link org.eclipse.bpmn2.Extension#isMustUnderstand Must Understand}
  • + *
  • {@link org.eclipse.bpmn2.Extension#getXsdDefinition Xsd Definition}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getExtension() + * @model extendedMetaData="name='tExtension' kind='elementOnly'" + * @generated + */ +public interface Extension extends EObject { + /** + * Returns the value of the 'Definition' containment reference. + * + * + * @return the value of the 'Definition' containment reference. + * @see #setDefinition(ExtensionDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getExtension_Definition() + * @model containment="true" required="true" ordered="false" + * @generated + */ + ExtensionDefinition getDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Extension#getDefinition Definition}' containment reference. + * + * + * @param value the new value of the 'Definition' containment reference. + * @see #getDefinition() + * @generated + */ + void setDefinition(ExtensionDefinition value); + + /** + * Returns the value of the 'Must Understand' attribute. + * The default value is "false". + * + * + * @return the value of the 'Must Understand' attribute. + * @see #setMustUnderstand(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getExtension_MustUnderstand() + * @model default="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='mustUnderstand'" + * @generated + */ + boolean isMustUnderstand(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Extension#isMustUnderstand Must Understand}' attribute. + * + * + * @param value the new value of the 'Must Understand' attribute. + * @see #isMustUnderstand() + * @generated + */ + void setMustUnderstand(boolean value); + + /** + * Returns the value of the 'Xsd Definition' attribute. + * + * + * @return the value of the 'Xsd Definition' attribute. + * @see #setXsdDefinition(QName) + * @see org.eclipse.bpmn2.Bpmn2Package#getExtension_XsdDefinition() + * @model dataType="org.eclipse.emf.ecore.xml.type.QName" + * extendedMetaData="kind='attribute' name='definition'" + * @generated + */ + QName getXsdDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Extension#getXsdDefinition Xsd Definition}' attribute. + * + * + * @param value the new value of the 'Xsd Definition' attribute. + * @see #getXsdDefinition() + * @generated + */ + void setXsdDefinition(QName value); + +} // Extension diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ExtensionAttributeDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ExtensionAttributeDefinition.java new file mode 100644 index 00000000000..12360eac8ce --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ExtensionAttributeDefinition.java @@ -0,0 +1,130 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Extension Attribute Definition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ExtensionAttributeDefinition#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.ExtensionAttributeDefinition#getType Type}
  • + *
  • {@link org.eclipse.bpmn2.ExtensionAttributeDefinition#isIsReference Is Reference}
  • + *
  • {@link org.eclipse.bpmn2.ExtensionAttributeDefinition#getExtensionDefinition Extension Definition}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getExtensionAttributeDefinition() + * @model + * @generated + */ +public interface ExtensionAttributeDefinition extends EObject { + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getExtensionAttributeDefinition_Name() + * @model required="true" ordered="false" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ExtensionAttributeDefinition#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Type' attribute. + * + * + * @return the value of the 'Type' attribute. + * @see #setType(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getExtensionAttributeDefinition_Type() + * @model required="true" ordered="false" + * @generated + */ + String getType(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ExtensionAttributeDefinition#getType Type}' attribute. + * + * + * @param value the new value of the 'Type' attribute. + * @see #getType() + * @generated + */ + void setType(String value); + + /** + * Returns the value of the 'Is Reference' attribute. + * The default value is "false". + * + * + * @return the value of the 'Is Reference' attribute. + * @see #setIsReference(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getExtensionAttributeDefinition_IsReference() + * @model default="false" required="true" ordered="false" + * @generated + */ + boolean isIsReference(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ExtensionAttributeDefinition#isIsReference Is Reference}' attribute. + * + * + * @param value the new value of the 'Is Reference' attribute. + * @see #isIsReference() + * @generated + */ + void setIsReference(boolean value); + + /** + * Returns the value of the 'Extension Definition' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.ExtensionDefinition#getExtensionAttributeDefinitions Extension Attribute Definitions}'. + * + * + * @return the value of the 'Extension Definition' container reference. + * @see #setExtensionDefinition(ExtensionDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getExtensionAttributeDefinition_ExtensionDefinition() + * @see org.eclipse.bpmn2.ExtensionDefinition#getExtensionAttributeDefinitions + * @model opposite="extensionAttributeDefinitions" resolveProxies="false" required="true" derived="true" ordered="false" + * @generated + */ + ExtensionDefinition getExtensionDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ExtensionAttributeDefinition#getExtensionDefinition Extension Definition}' container reference. + * + * + * @param value the new value of the 'Extension Definition' container reference. + * @see #getExtensionDefinition() + * @generated + */ + void setExtensionDefinition(ExtensionDefinition value); + +} // ExtensionAttributeDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ExtensionAttributeValue.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ExtensionAttributeValue.java new file mode 100644 index 00000000000..5d5d58ba2c5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ExtensionAttributeValue.java @@ -0,0 +1,97 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'Extension Attribute Value'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ExtensionAttributeValue#getValueRef Value Ref}
  • + *
  • {@link org.eclipse.bpmn2.ExtensionAttributeValue#getValue Value}
  • + *
  • {@link org.eclipse.bpmn2.ExtensionAttributeValue#getExtensionAttributeDefinition Extension Attribute Definition}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getExtensionAttributeValue() + * @model extendedMetaData="name='tExtensionElements' kind='elementOnly'" + * @generated + */ +public interface ExtensionAttributeValue extends EObject { + /** + * Returns the value of the 'Value Ref' reference. + * + * + * @return the value of the 'Value Ref' reference. + * @see #setValueRef(EObject) + * @see org.eclipse.bpmn2.Bpmn2Package#getExtensionAttributeValue_ValueRef() + * @model transient="true" derived="true" ordered="false" + * @generated + */ + EObject getValueRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ExtensionAttributeValue#getValueRef Value Ref}' reference. + * + * + * @param value the new value of the 'Value Ref' reference. + * @see #getValueRef() + * @generated + */ + void setValueRef(EObject value); + + /** + * Returns the value of the 'Value' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Value' attribute list. + * @see org.eclipse.bpmn2.Bpmn2Package#getExtensionAttributeValue_Value() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='elementWildcard' wildcards='##other' name=':0' processing='lax'" + * @generated + */ + FeatureMap getValue(); + + /** + * Returns the value of the 'Extension Attribute Definition' reference. + * + * + * @return the value of the 'Extension Attribute Definition' reference. + * @see #setExtensionAttributeDefinition(ExtensionAttributeDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getExtensionAttributeValue_ExtensionAttributeDefinition() + * @model required="true" transient="true" derived="true" ordered="false" + * @generated + */ + ExtensionAttributeDefinition getExtensionAttributeDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ExtensionAttributeValue#getExtensionAttributeDefinition Extension Attribute Definition}' reference. + * + * + * @param value the new value of the 'Extension Attribute Definition' reference. + * @see #getExtensionAttributeDefinition() + * @generated + */ + void setExtensionAttributeDefinition(ExtensionAttributeDefinition value); + +} // ExtensionAttributeValue diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ExtensionDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ExtensionDefinition.java new file mode 100644 index 00000000000..bab55a1df4c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ExtensionDefinition.java @@ -0,0 +1,75 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Extension Definition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ExtensionDefinition#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.ExtensionDefinition#getExtensionAttributeDefinitions Extension Attribute Definitions}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getExtensionDefinition() + * @model + * @generated + */ +public interface ExtensionDefinition extends EObject { + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getExtensionDefinition_Name() + * @model required="true" ordered="false" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ExtensionDefinition#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Extension Attribute Definitions' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ExtensionAttributeDefinition}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.ExtensionAttributeDefinition#getExtensionDefinition Extension Definition}'. + * + * + * @return the value of the 'Extension Attribute Definitions' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getExtensionDefinition_ExtensionAttributeDefinitions() + * @see org.eclipse.bpmn2.ExtensionAttributeDefinition#getExtensionDefinition + * @model opposite="extensionDefinition" containment="true" transient="true" derived="true" ordered="false" + * @generated + */ + EList getExtensionAttributeDefinitions(); + +} // ExtensionDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/FlowElement.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/FlowElement.java new file mode 100644 index 00000000000..6d4d29fb9fa --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/FlowElement.java @@ -0,0 +1,122 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Flow Element'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.FlowElement#getAuditing Auditing}
  • + *
  • {@link org.eclipse.bpmn2.FlowElement#getMonitoring Monitoring}
  • + *
  • {@link org.eclipse.bpmn2.FlowElement#getCategoryValueRef Category Value Ref}
  • + *
  • {@link org.eclipse.bpmn2.FlowElement#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getFlowElement() + * @model abstract="true" + * extendedMetaData="name='tFlowElement' kind='elementOnly'" + * @generated + */ +public interface FlowElement extends BaseElement { + /** + * Returns the value of the 'Auditing' containment reference. + * + * + * @return the value of the 'Auditing' containment reference. + * @see #setAuditing(Auditing) + * @see org.eclipse.bpmn2.Bpmn2Package#getFlowElement_Auditing() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='auditing' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Auditing getAuditing(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.FlowElement#getAuditing Auditing}' containment reference. + * + * + * @param value the new value of the 'Auditing' containment reference. + * @see #getAuditing() + * @generated + */ + void setAuditing(Auditing value); + + /** + * Returns the value of the 'Monitoring' containment reference. + * + * + * @return the value of the 'Monitoring' containment reference. + * @see #setMonitoring(Monitoring) + * @see org.eclipse.bpmn2.Bpmn2Package#getFlowElement_Monitoring() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='monitoring' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Monitoring getMonitoring(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.FlowElement#getMonitoring Monitoring}' containment reference. + * + * + * @param value the new value of the 'Monitoring' containment reference. + * @see #getMonitoring() + * @generated + */ + void setMonitoring(Monitoring value); + + /** + * Returns the value of the 'Category Value Ref' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.CategoryValue}. + * + * + * @return the value of the 'Category Value Ref' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getFlowElement_CategoryValueRef() + * @model ordered="false" + * extendedMetaData="kind='element' name='categoryValueRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getCategoryValueRef(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getFlowElement_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.FlowElement#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // FlowElement diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/FlowElementsContainer.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/FlowElementsContainer.java new file mode 100644 index 00000000000..67a713ae93a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/FlowElementsContainer.java @@ -0,0 +1,63 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Flow Elements Container'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.FlowElementsContainer#getLaneSets Lane Sets}
  • + *
  • {@link org.eclipse.bpmn2.FlowElementsContainer#getFlowElements Flow Elements}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getFlowElementsContainer() + * @model abstract="true" + * @generated + */ +public interface FlowElementsContainer extends BaseElement { + /** + * Returns the value of the 'Lane Sets' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.LaneSet}. + * + * + * @return the value of the 'Lane Sets' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getFlowElementsContainer_LaneSets() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='laneSet' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getLaneSets(); + + /** + * Returns the value of the 'Flow Elements' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.FlowElement}. + * + * + * @return the value of the 'Flow Elements' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getFlowElementsContainer_FlowElements() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='flowElement' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement'" + * @generated + */ + EList getFlowElements(); + +} // FlowElementsContainer diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/FlowNode.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/FlowNode.java new file mode 100644 index 00000000000..cad6755fef6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/FlowNode.java @@ -0,0 +1,83 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Flow Node'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.FlowNode#getIncoming Incoming}
  • + *
  • {@link org.eclipse.bpmn2.FlowNode#getLanes Lanes}
  • + *
  • {@link org.eclipse.bpmn2.FlowNode#getOutgoing Outgoing}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getFlowNode() + * @model abstract="true" + * extendedMetaData="name='tFlowNode' kind='elementOnly'" + * @generated + */ +public interface FlowNode extends FlowElement { + /** + * Returns the value of the 'Incoming' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.SequenceFlow}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.SequenceFlow#getTargetRef Target Ref}'. + * + * + * @return the value of the 'Incoming' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getFlowNode_Incoming() + * @see org.eclipse.bpmn2.SequenceFlow#getTargetRef + * @model opposite="targetRef" resolveProxies="false" ordered="false" + * extendedMetaData="kind='element' name='incoming' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getIncoming(); + + /** + * Returns the value of the 'Lanes' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Lane}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.Lane#getFlowNodeRefs Flow Node Refs}'. + * + * + * @return the value of the 'Lanes' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getFlowNode_Lanes() + * @see org.eclipse.bpmn2.Lane#getFlowNodeRefs + * @model opposite="flowNodeRefs" transient="true" derived="true" ordered="false" + * @generated + */ + EList getLanes(); + + /** + * Returns the value of the 'Outgoing' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.SequenceFlow}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.SequenceFlow#getSourceRef Source Ref}'. + * + * + * @return the value of the 'Outgoing' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getFlowNode_Outgoing() + * @see org.eclipse.bpmn2.SequenceFlow#getSourceRef + * @model opposite="sourceRef" resolveProxies="false" + * extendedMetaData="kind='element' name='outgoing' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getOutgoing(); + +} // FlowNode diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/FormalExpression.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/FormalExpression.java new file mode 100644 index 00000000000..b5f2f836986 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/FormalExpression.java @@ -0,0 +1,120 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'Formal Expression'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.FormalExpression#getMixed Mixed}
  • + *
  • {@link org.eclipse.bpmn2.FormalExpression#getBody Body}
  • + *
  • {@link org.eclipse.bpmn2.FormalExpression#getEvaluatesToTypeRef Evaluates To Type Ref}
  • + *
  • {@link org.eclipse.bpmn2.FormalExpression#getLanguage Language}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getFormalExpression() + * @model extendedMetaData="name='tFormalExpression' kind='mixed'" + * @generated + */ +public interface FormalExpression extends Expression { + /** + * Returns the value of the 'Mixed' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Mixed' attribute list. + * @see org.eclipse.bpmn2.Bpmn2Package#getFormalExpression_Mixed() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='elementWildcard' name=':mixed'" + * @generated + */ + FeatureMap getMixed(); + + /** + * Returns the value of the 'Body' attribute. + * + * + * @return the value of the 'Body' attribute. + * @see #setBody(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getFormalExpression_Body() + * @model required="true" volatile="true" derived="true" ordered="false" + * @generated + */ + String getBody(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.FormalExpression#getBody Body}' attribute. + * + * + * @param value the new value of the 'Body' attribute. + * @see #getBody() + * @generated + */ + void setBody(String value); + + /** + * Returns the value of the 'Evaluates To Type Ref' reference. + * + * + * @return the value of the 'Evaluates To Type Ref' reference. + * @see #setEvaluatesToTypeRef(ItemDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getFormalExpression_EvaluatesToTypeRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='evaluatesToTypeRef'" + * @generated + */ + ItemDefinition getEvaluatesToTypeRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.FormalExpression#getEvaluatesToTypeRef Evaluates To Type Ref}' reference. + * + * + * @param value the new value of the 'Evaluates To Type Ref' reference. + * @see #getEvaluatesToTypeRef() + * @generated + */ + void setEvaluatesToTypeRef(ItemDefinition value); + + /** + * Returns the value of the 'Language' attribute. + * + * + * @return the value of the 'Language' attribute. + * @see #setLanguage(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getFormalExpression_Language() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='language'" + * @generated + */ + String getLanguage(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.FormalExpression#getLanguage Language}' attribute. + * + * + * @param value the new value of the 'Language' attribute. + * @see #getLanguage() + * @generated + */ + void setLanguage(String value); + +} // FormalExpression diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Gateway.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Gateway.java new file mode 100644 index 00000000000..fc4a5e2b3fd --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Gateway.java @@ -0,0 +1,62 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Gateway'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Gateway#getGatewayDirection Gateway Direction}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getGateway() + * @model abstract="true" + * extendedMetaData="name='tGateway' kind='elementOnly'" + * @generated + */ +public interface Gateway extends FlowNode { + /** + * Returns the value of the 'Gateway Direction' attribute. + * The default value is "unspecified". + * The literals are from the enumeration {@link org.eclipse.bpmn2.GatewayDirection}. + * + * + * @return the value of the 'Gateway Direction' attribute. + * @see org.eclipse.bpmn2.GatewayDirection + * @see #setGatewayDirection(GatewayDirection) + * @see org.eclipse.bpmn2.Bpmn2Package#getGateway_GatewayDirection() + * @model default="unspecified" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='gatewayDirection'" + * @generated + */ + GatewayDirection getGatewayDirection(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Gateway#getGatewayDirection Gateway Direction}' attribute. + * + * + * @param value the new value of the 'Gateway Direction' attribute. + * @see org.eclipse.bpmn2.GatewayDirection + * @see #getGatewayDirection() + * @generated + */ + void setGatewayDirection(GatewayDirection value); + +} // Gateway diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GatewayDirection.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GatewayDirection.java new file mode 100644 index 00000000000..8788e57c1cb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GatewayDirection.java @@ -0,0 +1,266 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Gateway Direction', + * and utility methods for working with them. + * + * @see org.eclipse.bpmn2.Bpmn2Package#getGatewayDirection() + * @model extendedMetaData="name='tGatewayDirection'" + * @generated + */ +public enum GatewayDirection implements Enumerator { + /** + * The 'Unspecified' literal object. + * + * + * @see #UNSPECIFIED_VALUE + * @generated + * @ordered + */ + UNSPECIFIED(0, "Unspecified", "Unspecified"), + + /** + * The 'Converging' literal object. + * + * + * @see #CONVERGING_VALUE + * @generated + * @ordered + */ + CONVERGING(1, "Converging", "Converging"), + + /** + * The 'Diverging' literal object. + * + * + * @see #DIVERGING_VALUE + * @generated + * @ordered + */ + DIVERGING(2, "Diverging", "Diverging"), + + /** + * The 'Mixed' literal object. + * + * + * @see #MIXED_VALUE + * @generated + * @ordered + */ + MIXED(3, "Mixed", "Mixed"); + + /** + * The 'Unspecified' literal value. + * + * + * @see #UNSPECIFIED + * @model name="Unspecified" + * @generated + * @ordered + */ + public static final int UNSPECIFIED_VALUE = 0; + + /** + * The 'Converging' literal value. + * + * + * @see #CONVERGING + * @model name="Converging" + * @generated + * @ordered + */ + public static final int CONVERGING_VALUE = 1; + + /** + * The 'Diverging' literal value. + * + * + * @see #DIVERGING + * @model name="Diverging" + * @generated + * @ordered + */ + public static final int DIVERGING_VALUE = 2; + + /** + * The 'Mixed' literal value. + * + * + * @see #MIXED + * @model name="Mixed" + * @generated + * @ordered + */ + public static final int MIXED_VALUE = 3; + + /** + * An array of all the 'Gateway Direction' enumerators. + * + * + * @generated + */ + private static final GatewayDirection[] VALUES_ARRAY = new GatewayDirection[] { UNSPECIFIED, CONVERGING, DIVERGING, + MIXED, }; + + /** + * A public read-only list of all the 'Gateway Direction' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Gateway Direction' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static GatewayDirection get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + GatewayDirection result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Gateway Direction' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static GatewayDirection getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + GatewayDirection result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Gateway Direction' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static GatewayDirection get(int value) { + switch (value) { + case UNSPECIFIED_VALUE: + return UNSPECIFIED; + case CONVERGING_VALUE: + return CONVERGING; + case DIVERGING_VALUE: + return DIVERGING; + case MIXED_VALUE: + return MIXED; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private GatewayDirection(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //GatewayDirection diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalBusinessRuleTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalBusinessRuleTask.java new file mode 100644 index 00000000000..40a07f2a914 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalBusinessRuleTask.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Global Business Rule Task'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.GlobalBusinessRuleTask#getImplementation Implementation}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalBusinessRuleTask() + * @model extendedMetaData="name='tGlobalBusinessRuleTask' kind='elementOnly'" + * @generated + */ +public interface GlobalBusinessRuleTask extends GlobalTask { + /** + * Returns the value of the 'Implementation' attribute. + * + * + * @return the value of the 'Implementation' attribute. + * @see #setImplementation(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalBusinessRuleTask_Implementation() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='implementation'" + * @generated + */ + String getImplementation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.GlobalBusinessRuleTask#getImplementation Implementation}' attribute. + * + * + * @param value the new value of the 'Implementation' attribute. + * @see #getImplementation() + * @generated + */ + void setImplementation(String value); + +} // GlobalBusinessRuleTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalChoreographyTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalChoreographyTask.java new file mode 100644 index 00000000000..cab544b84c2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalChoreographyTask.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Global Choreography Task'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.GlobalChoreographyTask#getInitiatingParticipantRef Initiating Participant Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalChoreographyTask() + * @model extendedMetaData="name='tGlobalChoreographyTask' kind='elementOnly'" + * @generated + */ +public interface GlobalChoreographyTask extends Choreography { + /** + * Returns the value of the 'Initiating Participant Ref' reference. + * + * + * @return the value of the 'Initiating Participant Ref' reference. + * @see #setInitiatingParticipantRef(Participant) + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalChoreographyTask_InitiatingParticipantRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='initiatingParticipantRef'" + * @generated + */ + Participant getInitiatingParticipantRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.GlobalChoreographyTask#getInitiatingParticipantRef Initiating Participant Ref}' reference. + * + * + * @param value the new value of the 'Initiating Participant Ref' reference. + * @see #getInitiatingParticipantRef() + * @generated + */ + void setInitiatingParticipantRef(Participant value); + +} // GlobalChoreographyTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalConversation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalConversation.java new file mode 100644 index 00000000000..6b374ab2a11 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalConversation.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Global Conversation'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalConversation() + * @model extendedMetaData="name='tGlobalConversation' kind='elementOnly'" + * @generated + */ +public interface GlobalConversation extends Collaboration { +} // GlobalConversation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalManualTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalManualTask.java new file mode 100644 index 00000000000..6f66c566aea --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalManualTask.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Global Manual Task'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalManualTask() + * @model extendedMetaData="name='tGlobalManualTask' kind='elementOnly'" + * @generated + */ +public interface GlobalManualTask extends GlobalTask { +} // GlobalManualTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalScriptTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalScriptTask.java new file mode 100644 index 00000000000..d114c6dda81 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalScriptTask.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Global Script Task'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.GlobalScriptTask#getScript Script}
  • + *
  • {@link org.eclipse.bpmn2.GlobalScriptTask#getScriptLanguage Script Language}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalScriptTask() + * @model extendedMetaData="name='tGlobalScriptTask' kind='elementOnly'" + * @generated + */ +public interface GlobalScriptTask extends GlobalTask { + /** + * Returns the value of the 'Script' attribute. + * + * + * @return the value of the 'Script' attribute. + * @see #setScript(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalScriptTask_Script() + * @model required="true" ordered="false" + * extendedMetaData="kind='element' name='script' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + String getScript(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.GlobalScriptTask#getScript Script}' attribute. + * + * + * @param value the new value of the 'Script' attribute. + * @see #getScript() + * @generated + */ + void setScript(String value); + + /** + * Returns the value of the 'Script Language' attribute. + * + * + * @return the value of the 'Script Language' attribute. + * @see #setScriptLanguage(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalScriptTask_ScriptLanguage() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='scriptLanguage'" + * @generated + */ + String getScriptLanguage(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.GlobalScriptTask#getScriptLanguage Script Language}' attribute. + * + * + * @param value the new value of the 'Script Language' attribute. + * @see #getScriptLanguage() + * @generated + */ + void setScriptLanguage(String value); + +} // GlobalScriptTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalTask.java new file mode 100644 index 00000000000..fc33313097b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalTask.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Global Task'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.GlobalTask#getResources Resources}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalTask() + * @model extendedMetaData="name='tGlobalTask' kind='elementOnly'" + * @generated + */ +public interface GlobalTask extends CallableElement { + /** + * Returns the value of the 'Resources' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ResourceRole}. + * + * + * @return the value of the 'Resources' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalTask_Resources() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='resourceRole' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#resourceRole'" + * @generated + */ + EList getResources(); + +} // GlobalTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalUserTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalUserTask.java new file mode 100644 index 00000000000..8130b08d2d8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/GlobalUserTask.java @@ -0,0 +1,73 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Global User Task'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.GlobalUserTask#getRenderings Renderings}
  • + *
  • {@link org.eclipse.bpmn2.GlobalUserTask#getImplementation Implementation}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalUserTask() + * @model extendedMetaData="name='tGlobalUserTask' kind='elementOnly'" + * @generated + */ +public interface GlobalUserTask extends GlobalTask { + /** + * Returns the value of the 'Renderings' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Rendering}. + * + * + * @return the value of the 'Renderings' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalUserTask_Renderings() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='rendering' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getRenderings(); + + /** + * Returns the value of the 'Implementation' attribute. + * + * + * @return the value of the 'Implementation' attribute. + * @see #setImplementation(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getGlobalUserTask_Implementation() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='implementation'" + * @generated + */ + String getImplementation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.GlobalUserTask#getImplementation Implementation}' attribute. + * + * + * @param value the new value of the 'Implementation' attribute. + * @see #getImplementation() + * @generated + */ + void setImplementation(String value); + +} // GlobalUserTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Group.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Group.java new file mode 100644 index 00000000000..b7b1fc57616 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Group.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Group'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Group#getCategoryValueRef Category Value Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getGroup() + * @model extendedMetaData="name='tGroup' kind='elementOnly'" + * @generated + */ +public interface Group extends Artifact { + /** + * Returns the value of the 'Category Value Ref' reference. + * + * + * @return the value of the 'Category Value Ref' reference. + * @see #setCategoryValueRef(CategoryValue) + * @see org.eclipse.bpmn2.Bpmn2Package#getGroup_CategoryValueRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='categoryValueRef'" + * @generated + */ + CategoryValue getCategoryValueRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Group#getCategoryValueRef Category Value Ref}' reference. + * + * + * @param value the new value of the 'Category Value Ref' reference. + * @see #getCategoryValueRef() + * @generated + */ + void setCategoryValueRef(CategoryValue value); + +} // Group diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/HumanPerformer.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/HumanPerformer.java new file mode 100644 index 00000000000..51935f5a867 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/HumanPerformer.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Human Performer'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getHumanPerformer() + * @model extendedMetaData="name='tHumanPerformer' kind='elementOnly'" + * @generated + */ +public interface HumanPerformer extends Performer { +} // HumanPerformer diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ImplicitThrowEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ImplicitThrowEvent.java new file mode 100644 index 00000000000..d3947430098 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ImplicitThrowEvent.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Implicit Throw Event'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getImplicitThrowEvent() + * @model extendedMetaData="name='tImplicitThrowEvent' kind='elementOnly'" + * @generated + */ +public interface ImplicitThrowEvent extends ThrowEvent { +} // ImplicitThrowEvent diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Import.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Import.java new file mode 100644 index 00000000000..67f6bb95612 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Import.java @@ -0,0 +1,107 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Import'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Import#getImportType Import Type}
  • + *
  • {@link org.eclipse.bpmn2.Import#getLocation Location}
  • + *
  • {@link org.eclipse.bpmn2.Import#getNamespace Namespace}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getImport() + * @model extendedMetaData="name='tImport' kind='empty'" + * @generated + */ +public interface Import extends EObject { + /** + * Returns the value of the 'Import Type' attribute. + * + * + * @return the value of the 'Import Type' attribute. + * @see #setImportType(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getImport_ImportType() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='importType'" + * @generated + */ + String getImportType(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Import#getImportType Import Type}' attribute. + * + * + * @param value the new value of the 'Import Type' attribute. + * @see #getImportType() + * @generated + */ + void setImportType(String value); + + /** + * Returns the value of the 'Location' attribute. + * + * + * @return the value of the 'Location' attribute. + * @see #setLocation(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getImport_Location() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='location'" + * @generated + */ + String getLocation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Import#getLocation Location}' attribute. + * + * + * @param value the new value of the 'Location' attribute. + * @see #getLocation() + * @generated + */ + void setLocation(String value); + + /** + * Returns the value of the 'Namespace' attribute. + * + * + * @return the value of the 'Namespace' attribute. + * @see #setNamespace(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getImport_Namespace() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='namespace'" + * @generated + */ + String getNamespace(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Import#getNamespace Namespace}' attribute. + * + * + * @param value the new value of the 'Namespace' attribute. + * @see #getNamespace() + * @generated + */ + void setNamespace(String value); + +} // Import diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InclusiveGateway.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InclusiveGateway.java new file mode 100644 index 00000000000..844954f42cc --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InclusiveGateway.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Inclusive Gateway'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.InclusiveGateway#getDefault Default}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getInclusiveGateway() + * @model extendedMetaData="name='tInclusiveGateway' kind='elementOnly'" + * @generated + */ +public interface InclusiveGateway extends Gateway { + /** + * Returns the value of the 'Default' reference. + * + * + * @return the value of the 'Default' reference. + * @see #setDefault(SequenceFlow) + * @see org.eclipse.bpmn2.Bpmn2Package#getInclusiveGateway_Default() + * @model resolveProxies="false" ordered="false" + * extendedMetaData="kind='attribute' name='default'" + * @generated + */ + SequenceFlow getDefault(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.InclusiveGateway#getDefault Default}' reference. + * + * + * @param value the new value of the 'Default' reference. + * @see #getDefault() + * @generated + */ + void setDefault(SequenceFlow value); + +} // InclusiveGateway diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InputOutputBinding.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InputOutputBinding.java new file mode 100644 index 00000000000..5c88fef19f3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InputOutputBinding.java @@ -0,0 +1,105 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Input Output Binding'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.InputOutputBinding#getInputDataRef Input Data Ref}
  • + *
  • {@link org.eclipse.bpmn2.InputOutputBinding#getOperationRef Operation Ref}
  • + *
  • {@link org.eclipse.bpmn2.InputOutputBinding#getOutputDataRef Output Data Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getInputOutputBinding() + * @model extendedMetaData="name='tInputOutputBinding' kind='elementOnly'" + * @generated + */ +public interface InputOutputBinding extends BaseElement { + /** + * Returns the value of the 'Input Data Ref' reference. + * + * + * @return the value of the 'Input Data Ref' reference. + * @see #setInputDataRef(InputSet) + * @see org.eclipse.bpmn2.Bpmn2Package#getInputOutputBinding_InputDataRef() + * @model resolveProxies="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='inputDataRef'" + * @generated + */ + InputSet getInputDataRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.InputOutputBinding#getInputDataRef Input Data Ref}' reference. + * + * + * @param value the new value of the 'Input Data Ref' reference. + * @see #getInputDataRef() + * @generated + */ + void setInputDataRef(InputSet value); + + /** + * Returns the value of the 'Operation Ref' reference. + * + * + * @return the value of the 'Operation Ref' reference. + * @see #setOperationRef(Operation) + * @see org.eclipse.bpmn2.Bpmn2Package#getInputOutputBinding_OperationRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='operationRef'" + * @generated + */ + Operation getOperationRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.InputOutputBinding#getOperationRef Operation Ref}' reference. + * + * + * @param value the new value of the 'Operation Ref' reference. + * @see #getOperationRef() + * @generated + */ + void setOperationRef(Operation value); + + /** + * Returns the value of the 'Output Data Ref' reference. + * + * + * @return the value of the 'Output Data Ref' reference. + * @see #setOutputDataRef(OutputSet) + * @see org.eclipse.bpmn2.Bpmn2Package#getInputOutputBinding_OutputDataRef() + * @model resolveProxies="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='outputDataRef'" + * @generated + */ + OutputSet getOutputDataRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.InputOutputBinding#getOutputDataRef Output Data Ref}' reference. + * + * + * @param value the new value of the 'Output Data Ref' reference. + * @see #getOutputDataRef() + * @generated + */ + void setOutputDataRef(OutputSet value); + +} // InputOutputBinding diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InputOutputSpecification.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InputOutputSpecification.java new file mode 100644 index 00000000000..d658af29357 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InputOutputSpecification.java @@ -0,0 +1,91 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Input Output Specification'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.InputOutputSpecification#getDataInputs Data Inputs}
  • + *
  • {@link org.eclipse.bpmn2.InputOutputSpecification#getDataOutputs Data Outputs}
  • + *
  • {@link org.eclipse.bpmn2.InputOutputSpecification#getInputSets Input Sets}
  • + *
  • {@link org.eclipse.bpmn2.InputOutputSpecification#getOutputSets Output Sets}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getInputOutputSpecification() + * @model extendedMetaData="name='tInputOutputSpecification' kind='elementOnly'" + * @generated + */ +public interface InputOutputSpecification extends BaseElement { + /** + * Returns the value of the 'Data Inputs' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataInput}. + * + * + * @return the value of the 'Data Inputs' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getInputOutputSpecification_DataInputs() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='dataInput' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getDataInputs(); + + /** + * Returns the value of the 'Data Outputs' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataOutput}. + * + * + * @return the value of the 'Data Outputs' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getInputOutputSpecification_DataOutputs() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='dataOutput' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getDataOutputs(); + + /** + * Returns the value of the 'Input Sets' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.InputSet}. + * + * + * @return the value of the 'Input Sets' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getInputOutputSpecification_InputSets() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='inputSet' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getInputSets(); + + /** + * Returns the value of the 'Output Sets' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.OutputSet}. + * + * + * @return the value of the 'Output Sets' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getInputOutputSpecification_OutputSets() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='outputSet' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getOutputSets(); + +} // InputOutputSpecification diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InputSet.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InputSet.java new file mode 100644 index 00000000000..e77ba6f9d16 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InputSet.java @@ -0,0 +1,123 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Input Set'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.InputSet#getDataInputRefs Data Input Refs}
  • + *
  • {@link org.eclipse.bpmn2.InputSet#getOptionalInputRefs Optional Input Refs}
  • + *
  • {@link org.eclipse.bpmn2.InputSet#getWhileExecutingInputRefs While Executing Input Refs}
  • + *
  • {@link org.eclipse.bpmn2.InputSet#getOutputSetRefs Output Set Refs}
  • + *
  • {@link org.eclipse.bpmn2.InputSet#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getInputSet() + * @model extendedMetaData="name='tInputSet' kind='elementOnly'" + * @generated + */ +public interface InputSet extends BaseElement { + /** + * Returns the value of the 'Data Input Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataInput}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.DataInput#getInputSetRefs Input Set Refs}'. + * + * + * @return the value of the 'Data Input Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getInputSet_DataInputRefs() + * @see org.eclipse.bpmn2.DataInput#getInputSetRefs + * @model opposite="inputSetRefs" resolveProxies="false" ordered="false" + * extendedMetaData="kind='element' name='dataInputRefs' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getDataInputRefs(); + + /** + * Returns the value of the 'Optional Input Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataInput}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.DataInput#getInputSetWithOptional Input Set With Optional}'. + * + * + * @return the value of the 'Optional Input Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getInputSet_OptionalInputRefs() + * @see org.eclipse.bpmn2.DataInput#getInputSetWithOptional + * @model opposite="inputSetWithOptional" resolveProxies="false" ordered="false" + * extendedMetaData="kind='element' name='optionalInputRefs' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getOptionalInputRefs(); + + /** + * Returns the value of the 'While Executing Input Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataInput}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.DataInput#getInputSetWithWhileExecuting Input Set With While Executing}'. + * + * + * @return the value of the 'While Executing Input Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getInputSet_WhileExecutingInputRefs() + * @see org.eclipse.bpmn2.DataInput#getInputSetWithWhileExecuting + * @model opposite="inputSetWithWhileExecuting" resolveProxies="false" ordered="false" + * extendedMetaData="kind='element' name='whileExecutingInputRefs' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getWhileExecutingInputRefs(); + + /** + * Returns the value of the 'Output Set Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.OutputSet}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.OutputSet#getInputSetRefs Input Set Refs}'. + * + * + * @return the value of the 'Output Set Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getInputSet_OutputSetRefs() + * @see org.eclipse.bpmn2.OutputSet#getInputSetRefs + * @model opposite="inputSetRefs" resolveProxies="false" ordered="false" + * extendedMetaData="kind='element' name='outputSetRefs' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getOutputSetRefs(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getInputSet_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.InputSet#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // InputSet diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InteractionNode.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InteractionNode.java new file mode 100644 index 00000000000..2cd3eb0a34a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/InteractionNode.java @@ -0,0 +1,63 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Interaction Node'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.InteractionNode#getIncomingConversationLinks Incoming Conversation Links}
  • + *
  • {@link org.eclipse.bpmn2.InteractionNode#getOutgoingConversationLinks Outgoing Conversation Links}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getInteractionNode() + * @model extendedMetaData="abstract='true'" + * @generated + */ +public interface InteractionNode extends EObject { + /** + * Returns the value of the 'Incoming Conversation Links' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ConversationLink}. + * + * + * @return the value of the 'Incoming Conversation Links' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getInteractionNode_IncomingConversationLinks() + * @model resolveProxies="false" transient="true" changeable="false" volatile="true" derived="true" ordered="false" + * @generated + */ + EList getIncomingConversationLinks(); + + /** + * Returns the value of the 'Outgoing Conversation Links' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ConversationLink}. + * + * + * @return the value of the 'Outgoing Conversation Links' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getInteractionNode_OutgoingConversationLinks() + * @model transient="true" changeable="false" volatile="true" derived="true" ordered="false" + * @generated + */ + EList getOutgoingConversationLinks(); + +} // InteractionNode diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Interface.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Interface.java new file mode 100644 index 00000000000..b05254544b6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Interface.java @@ -0,0 +1,97 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Interface'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Interface#getOperations Operations}
  • + *
  • {@link org.eclipse.bpmn2.Interface#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.Interface#getImplementationRef Implementation Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getInterface() + * @model extendedMetaData="name='tInterface' kind='elementOnly'" + * @generated + */ +public interface Interface extends RootElement { + /** + * Returns the value of the 'Operations' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Operation}. + * + * + * @return the value of the 'Operations' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getInterface_Operations() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='operation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getOperations(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getInterface_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Interface#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Implementation Ref' attribute. + * + * + * @return the value of the 'Implementation Ref' attribute. + * @see #setImplementationRef(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getInterface_ImplementationRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='implementationRef'" + * @generated + */ + String getImplementationRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Interface#getImplementationRef Implementation Ref}' attribute. + * + * + * @param value the new value of the 'Implementation Ref' attribute. + * @see #getImplementationRef() + * @generated + */ + void setImplementationRef(String value); + +} // Interface diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/IntermediateCatchEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/IntermediateCatchEvent.java new file mode 100644 index 00000000000..61f618e4dd2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/IntermediateCatchEvent.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Intermediate Catch Event'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getIntermediateCatchEvent() + * @model extendedMetaData="name='tIntermediateCatchEvent' kind='elementOnly'" + * @generated + */ +public interface IntermediateCatchEvent extends CatchEvent { +} // IntermediateCatchEvent diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/IntermediateThrowEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/IntermediateThrowEvent.java new file mode 100644 index 00000000000..f77b731b474 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/IntermediateThrowEvent.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Intermediate Throw Event'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getIntermediateThrowEvent() + * @model extendedMetaData="name='tIntermediateThrowEvent' kind='elementOnly'" + * @generated + */ +public interface IntermediateThrowEvent extends ThrowEvent { +} // IntermediateThrowEvent diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ItemAwareElement.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ItemAwareElement.java new file mode 100644 index 00000000000..0c6b5fe56c5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ItemAwareElement.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Item Aware Element'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ItemAwareElement#getDataState Data State}
  • + *
  • {@link org.eclipse.bpmn2.ItemAwareElement#getItemSubjectRef Item Subject Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getItemAwareElement() + * @model + * @generated + */ +public interface ItemAwareElement extends BaseElement { + /** + * Returns the value of the 'Data State' containment reference. + * + * + * @return the value of the 'Data State' containment reference. + * @see #setDataState(DataState) + * @see org.eclipse.bpmn2.Bpmn2Package#getItemAwareElement_DataState() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='dataState' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + DataState getDataState(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ItemAwareElement#getDataState Data State}' containment reference. + * + * + * @param value the new value of the 'Data State' containment reference. + * @see #getDataState() + * @generated + */ + void setDataState(DataState value); + + /** + * Returns the value of the 'Item Subject Ref' reference. + * + * + * @return the value of the 'Item Subject Ref' reference. + * @see #setItemSubjectRef(ItemDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getItemAwareElement_ItemSubjectRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='itemSubjectRef'" + * @generated + */ + ItemDefinition getItemSubjectRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ItemAwareElement#getItemSubjectRef Item Subject Ref}' reference. + * + * + * @param value the new value of the 'Item Subject Ref' reference. + * @see #getItemSubjectRef() + * @generated + */ + void setItemSubjectRef(ItemDefinition value); + +} // ItemAwareElement diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ItemDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ItemDefinition.java new file mode 100644 index 00000000000..8b508a4a534 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ItemDefinition.java @@ -0,0 +1,132 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Item Definition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ItemDefinition#isIsCollection Is Collection}
  • + *
  • {@link org.eclipse.bpmn2.ItemDefinition#getImport Import}
  • + *
  • {@link org.eclipse.bpmn2.ItemDefinition#getItemKind Item Kind}
  • + *
  • {@link org.eclipse.bpmn2.ItemDefinition#getStructureRef Structure Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getItemDefinition() + * @model extendedMetaData="name='tItemDefinition' kind='elementOnly'" + * @generated + */ +public interface ItemDefinition extends RootElement { + /** + * Returns the value of the 'Is Collection' attribute. + * The default value is "false". + * + * + * @return the value of the 'Is Collection' attribute. + * @see #setIsCollection(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getItemDefinition_IsCollection() + * @model default="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='isCollection'" + * @generated + */ + boolean isIsCollection(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ItemDefinition#isIsCollection Is Collection}' attribute. + * + * + * @param value the new value of the 'Is Collection' attribute. + * @see #isIsCollection() + * @generated + */ + void setIsCollection(boolean value); + + /** + * Returns the value of the 'Import' reference. + * + * + * @return the value of the 'Import' reference. + * @see #setImport(Import) + * @see org.eclipse.bpmn2.Bpmn2Package#getItemDefinition_Import() + * @model transient="true" derived="true" ordered="false" + * @generated + */ + Import getImport(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ItemDefinition#getImport Import}' reference. + * + * + * @param value the new value of the 'Import' reference. + * @see #getImport() + * @generated + */ + void setImport(Import value); + + /** + * Returns the value of the 'Item Kind' attribute. + * The literals are from the enumeration {@link org.eclipse.bpmn2.ItemKind}. + * + * + * @return the value of the 'Item Kind' attribute. + * @see org.eclipse.bpmn2.ItemKind + * @see #setItemKind(ItemKind) + * @see org.eclipse.bpmn2.Bpmn2Package#getItemDefinition_ItemKind() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='itemKind'" + * @generated + */ + ItemKind getItemKind(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ItemDefinition#getItemKind Item Kind}' attribute. + * + * + * @param value the new value of the 'Item Kind' attribute. + * @see org.eclipse.bpmn2.ItemKind + * @see #getItemKind() + * @generated + */ + void setItemKind(ItemKind value); + + /** + * Returns the value of the 'Structure Ref' attribute. + * + * + * @return the value of the 'Structure Ref' attribute. + * @see #setStructureRef(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getItemDefinition_StructureRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='structureRef'" + * @generated + */ + String getStructureRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ItemDefinition#getStructureRef Structure Ref}' attribute. + * + * + * @param value the new value of the 'Structure Ref' attribute. + * @see #getStructureRef() + * @generated + */ + void setStructureRef(String value); + +} // ItemDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ItemKind.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ItemKind.java new file mode 100644 index 00000000000..a55c50b8786 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ItemKind.java @@ -0,0 +1,219 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Item Kind', + * and utility methods for working with them. + * + * @see org.eclipse.bpmn2.Bpmn2Package#getItemKind() + * @model extendedMetaData="name='tItemKind'" + * @generated + */ +public enum ItemKind implements Enumerator { + /** + * The 'Physical' literal object. + * + * + * @see #PHYSICAL_VALUE + * @generated + * @ordered + */ + PHYSICAL(0, "Physical", "Physical"), + + /** + * The 'Information' literal object. + * + * + * @see #INFORMATION_VALUE + * @generated + * @ordered + */ + INFORMATION(1, "Information", "Information"); + + /** + * The 'Physical' literal value. + * + * + * @see #PHYSICAL + * @model name="Physical" + * @generated + * @ordered + */ + public static final int PHYSICAL_VALUE = 0; + + /** + * The 'Information' literal value. + * + * + * @see #INFORMATION + * @model name="Information" + * @generated + * @ordered + */ + public static final int INFORMATION_VALUE = 1; + + /** + * An array of all the 'Item Kind' enumerators. + * + * + * @generated + */ + private static final ItemKind[] VALUES_ARRAY = new ItemKind[] { PHYSICAL, INFORMATION, }; + + /** + * A public read-only list of all the 'Item Kind' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Item Kind' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static ItemKind get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ItemKind result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Item Kind' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static ItemKind getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ItemKind result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Item Kind' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static ItemKind get(int value) { + switch (value) { + case PHYSICAL_VALUE: + return PHYSICAL; + case INFORMATION_VALUE: + return INFORMATION; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private ItemKind(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //ItemKind diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Lane.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Lane.java new file mode 100644 index 00000000000..9cfaa89a0d6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Lane.java @@ -0,0 +1,147 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Lane'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Lane#getPartitionElement Partition Element}
  • + *
  • {@link org.eclipse.bpmn2.Lane#getFlowNodeRefs Flow Node Refs}
  • + *
  • {@link org.eclipse.bpmn2.Lane#getChildLaneSet Child Lane Set}
  • + *
  • {@link org.eclipse.bpmn2.Lane#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.Lane#getPartitionElementRef Partition Element Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getLane() + * @model extendedMetaData="name='tLane' kind='elementOnly'" + * @generated + */ +public interface Lane extends BaseElement { + /** + * Returns the value of the 'Partition Element' containment reference. + * + * + * @return the value of the 'Partition Element' containment reference. + * @see #setPartitionElement(BaseElement) + * @see org.eclipse.bpmn2.Bpmn2Package#getLane_PartitionElement() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='partitionElement' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + BaseElement getPartitionElement(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Lane#getPartitionElement Partition Element}' containment reference. + * + * + * @param value the new value of the 'Partition Element' containment reference. + * @see #getPartitionElement() + * @generated + */ + void setPartitionElement(BaseElement value); + + /** + * Returns the value of the 'Flow Node Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.FlowNode}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.FlowNode#getLanes Lanes}'. + * + * + * @return the value of the 'Flow Node Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getLane_FlowNodeRefs() + * @see org.eclipse.bpmn2.FlowNode#getLanes + * @model opposite="lanes" resolveProxies="false" ordered="false" + * extendedMetaData="kind='element' name='flowNodeRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getFlowNodeRefs(); + + /** + * Returns the value of the 'Child Lane Set' containment reference. + * + * + * @return the value of the 'Child Lane Set' containment reference. + * @see #setChildLaneSet(LaneSet) + * @see org.eclipse.bpmn2.Bpmn2Package#getLane_ChildLaneSet() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='childLaneSet' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + LaneSet getChildLaneSet(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Lane#getChildLaneSet Child Lane Set}' containment reference. + * + * + * @param value the new value of the 'Child Lane Set' containment reference. + * @see #getChildLaneSet() + * @generated + */ + void setChildLaneSet(LaneSet value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getLane_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Lane#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Partition Element Ref' reference. + * + * + * @return the value of the 'Partition Element Ref' reference. + * @see #setPartitionElementRef(BaseElement) + * @see org.eclipse.bpmn2.Bpmn2Package#getLane_PartitionElementRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='partitionElementRef'" + * @generated + */ + BaseElement getPartitionElementRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Lane#getPartitionElementRef Partition Element Ref}' reference. + * + * + * @param value the new value of the 'Partition Element Ref' reference. + * @see #getPartitionElementRef() + * @generated + */ + void setPartitionElementRef(BaseElement value); + +} // Lane diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/LaneSet.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/LaneSet.java new file mode 100644 index 00000000000..0493946db2f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/LaneSet.java @@ -0,0 +1,73 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Lane Set'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.LaneSet#getLanes Lanes}
  • + *
  • {@link org.eclipse.bpmn2.LaneSet#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getLaneSet() + * @model extendedMetaData="name='tLaneSet' kind='elementOnly'" + * @generated + */ +public interface LaneSet extends BaseElement { + /** + * Returns the value of the 'Lanes' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Lane}. + * + * + * @return the value of the 'Lanes' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getLaneSet_Lanes() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='lane' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getLanes(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getLaneSet_Name() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.LaneSet#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // LaneSet diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/LinkEventDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/LinkEventDefinition.java new file mode 100644 index 00000000000..6699edb3779 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/LinkEventDefinition.java @@ -0,0 +1,101 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Link Event Definition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.LinkEventDefinition#getSource Source}
  • + *
  • {@link org.eclipse.bpmn2.LinkEventDefinition#getTarget Target}
  • + *
  • {@link org.eclipse.bpmn2.LinkEventDefinition#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getLinkEventDefinition() + * @model extendedMetaData="name='tLinkEventDefinition' kind='elementOnly'" + * @generated + */ +public interface LinkEventDefinition extends EventDefinition { + /** + * Returns the value of the 'Source' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.LinkEventDefinition}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.LinkEventDefinition#getTarget Target}'. + * + * + * @return the value of the 'Source' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getLinkEventDefinition_Source() + * @see org.eclipse.bpmn2.LinkEventDefinition#getTarget + * @model opposite="target" ordered="false" + * extendedMetaData="kind='element' name='source' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getSource(); + + /** + * Returns the value of the 'Target' reference. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.LinkEventDefinition#getSource Source}'. + * + * + * @return the value of the 'Target' reference. + * @see #setTarget(LinkEventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getLinkEventDefinition_Target() + * @see org.eclipse.bpmn2.LinkEventDefinition#getSource + * @model opposite="source" ordered="false" + * extendedMetaData="kind='element' name='target' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + LinkEventDefinition getTarget(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.LinkEventDefinition#getTarget Target}' reference. + * + * + * @param value the new value of the 'Target' reference. + * @see #getTarget() + * @generated + */ + void setTarget(LinkEventDefinition value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getLinkEventDefinition_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.LinkEventDefinition#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // LinkEventDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/LoopCharacteristics.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/LoopCharacteristics.java new file mode 100644 index 00000000000..0e89a14d126 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/LoopCharacteristics.java @@ -0,0 +1,29 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Loop Characteristics'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getLoopCharacteristics() + * @model abstract="true" + * extendedMetaData="name='tLoopCharacteristics' kind='elementOnly'" + * @generated + */ +public interface LoopCharacteristics extends BaseElement { +} // LoopCharacteristics diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ManualTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ManualTask.java new file mode 100644 index 00000000000..2de7575217a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ManualTask.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Manual Task'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getManualTask() + * @model extendedMetaData="name='tManualTask' kind='elementOnly'" + * @generated + */ +public interface ManualTask extends Task { +} // ManualTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Message.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Message.java new file mode 100644 index 00000000000..3d8389a8942 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Message.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Message'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Message#getItemRef Item Ref}
  • + *
  • {@link org.eclipse.bpmn2.Message#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getMessage() + * @model extendedMetaData="name='tMessage' kind='elementOnly'" + * @generated + */ +public interface Message extends RootElement { + /** + * Returns the value of the 'Item Ref' reference. + * + * + * @return the value of the 'Item Ref' reference. + * @see #setItemRef(ItemDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getMessage_ItemRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='itemRef'" + * @generated + */ + ItemDefinition getItemRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Message#getItemRef Item Ref}' reference. + * + * + * @param value the new value of the 'Item Ref' reference. + * @see #getItemRef() + * @generated + */ + void setItemRef(ItemDefinition value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getMessage_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Message#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // Message diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MessageEventDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MessageEventDefinition.java new file mode 100644 index 00000000000..33027ea56c8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MessageEventDefinition.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Message Event Definition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.MessageEventDefinition#getOperationRef Operation Ref}
  • + *
  • {@link org.eclipse.bpmn2.MessageEventDefinition#getMessageRef Message Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getMessageEventDefinition() + * @model extendedMetaData="name='tMessageEventDefinition' kind='elementOnly'" + * @generated + */ +public interface MessageEventDefinition extends EventDefinition { + /** + * Returns the value of the 'Operation Ref' reference. + * + * + * @return the value of the 'Operation Ref' reference. + * @see #setOperationRef(Operation) + * @see org.eclipse.bpmn2.Bpmn2Package#getMessageEventDefinition_OperationRef() + * @model ordered="false" + * extendedMetaData="kind='element' name='operationRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Operation getOperationRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MessageEventDefinition#getOperationRef Operation Ref}' reference. + * + * + * @param value the new value of the 'Operation Ref' reference. + * @see #getOperationRef() + * @generated + */ + void setOperationRef(Operation value); + + /** + * Returns the value of the 'Message Ref' reference. + * + * + * @return the value of the 'Message Ref' reference. + * @see #setMessageRef(Message) + * @see org.eclipse.bpmn2.Bpmn2Package#getMessageEventDefinition_MessageRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='messageRef'" + * @generated + */ + Message getMessageRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MessageEventDefinition#getMessageRef Message Ref}' reference. + * + * + * @param value the new value of the 'Message Ref' reference. + * @see #getMessageRef() + * @generated + */ + void setMessageRef(Message value); + +} // MessageEventDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MessageFlow.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MessageFlow.java new file mode 100644 index 00000000000..8fdcf772904 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MessageFlow.java @@ -0,0 +1,129 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Message Flow'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.MessageFlow#getMessageRef Message Ref}
  • + *
  • {@link org.eclipse.bpmn2.MessageFlow#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.MessageFlow#getSourceRef Source Ref}
  • + *
  • {@link org.eclipse.bpmn2.MessageFlow#getTargetRef Target Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getMessageFlow() + * @model extendedMetaData="name='tMessageFlow' kind='elementOnly'" + * @generated + */ +public interface MessageFlow extends BaseElement { + /** + * Returns the value of the 'Message Ref' reference. + * + * + * @return the value of the 'Message Ref' reference. + * @see #setMessageRef(Message) + * @see org.eclipse.bpmn2.Bpmn2Package#getMessageFlow_MessageRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='messageRef'" + * @generated + */ + Message getMessageRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MessageFlow#getMessageRef Message Ref}' reference. + * + * + * @param value the new value of the 'Message Ref' reference. + * @see #getMessageRef() + * @generated + */ + void setMessageRef(Message value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getMessageFlow_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MessageFlow#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Source Ref' reference. + * + * + * @return the value of the 'Source Ref' reference. + * @see #setSourceRef(InteractionNode) + * @see org.eclipse.bpmn2.Bpmn2Package#getMessageFlow_SourceRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='sourceRef'" + * @generated + */ + InteractionNode getSourceRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MessageFlow#getSourceRef Source Ref}' reference. + * + * + * @param value the new value of the 'Source Ref' reference. + * @see #getSourceRef() + * @generated + */ + void setSourceRef(InteractionNode value); + + /** + * Returns the value of the 'Target Ref' reference. + * + * + * @return the value of the 'Target Ref' reference. + * @see #setTargetRef(InteractionNode) + * @see org.eclipse.bpmn2.Bpmn2Package#getMessageFlow_TargetRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='targetRef'" + * @generated + */ + InteractionNode getTargetRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MessageFlow#getTargetRef Target Ref}' reference. + * + * + * @param value the new value of the 'Target Ref' reference. + * @see #getTargetRef() + * @generated + */ + void setTargetRef(InteractionNode value); + +} // MessageFlow diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MessageFlowAssociation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MessageFlowAssociation.java new file mode 100644 index 00000000000..295f962b285 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MessageFlowAssociation.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Message Flow Association'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.MessageFlowAssociation#getInnerMessageFlowRef Inner Message Flow Ref}
  • + *
  • {@link org.eclipse.bpmn2.MessageFlowAssociation#getOuterMessageFlowRef Outer Message Flow Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getMessageFlowAssociation() + * @model extendedMetaData="name='tMessageFlowAssociation' kind='elementOnly'" + * @generated + */ +public interface MessageFlowAssociation extends BaseElement { + /** + * Returns the value of the 'Inner Message Flow Ref' reference. + * + * + * @return the value of the 'Inner Message Flow Ref' reference. + * @see #setInnerMessageFlowRef(MessageFlow) + * @see org.eclipse.bpmn2.Bpmn2Package#getMessageFlowAssociation_InnerMessageFlowRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='innerMessageFlowRef'" + * @generated + */ + MessageFlow getInnerMessageFlowRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MessageFlowAssociation#getInnerMessageFlowRef Inner Message Flow Ref}' reference. + * + * + * @param value the new value of the 'Inner Message Flow Ref' reference. + * @see #getInnerMessageFlowRef() + * @generated + */ + void setInnerMessageFlowRef(MessageFlow value); + + /** + * Returns the value of the 'Outer Message Flow Ref' reference. + * + * + * @return the value of the 'Outer Message Flow Ref' reference. + * @see #setOuterMessageFlowRef(MessageFlow) + * @see org.eclipse.bpmn2.Bpmn2Package#getMessageFlowAssociation_OuterMessageFlowRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='outerMessageFlowRef'" + * @generated + */ + MessageFlow getOuterMessageFlowRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MessageFlowAssociation#getOuterMessageFlowRef Outer Message Flow Ref}' reference. + * + * + * @param value the new value of the 'Outer Message Flow Ref' reference. + * @see #getOuterMessageFlowRef() + * @generated + */ + void setOuterMessageFlowRef(MessageFlow value); + +} // MessageFlowAssociation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Monitoring.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Monitoring.java new file mode 100644 index 00000000000..f81864d2a18 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Monitoring.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Monitoring'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getMonitoring() + * @model extendedMetaData="name='tMonitoring' kind='elementOnly'" + * @generated + */ +public interface Monitoring extends BaseElement { +} // Monitoring diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MultiInstanceBehavior.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MultiInstanceBehavior.java new file mode 100644 index 00000000000..bd8e46a65bb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MultiInstanceBehavior.java @@ -0,0 +1,266 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Multi Instance Behavior', + * and utility methods for working with them. + * + * @see org.eclipse.bpmn2.Bpmn2Package#getMultiInstanceBehavior() + * @model extendedMetaData="name='tMultiInstanceFlowCondition'" + * @generated + */ +public enum MultiInstanceBehavior implements Enumerator { + /** + * The 'None' literal object. + * + * + * @see #NONE_VALUE + * @generated + * @ordered + */ + NONE(0, "None", "None"), + + /** + * The 'One' literal object. + * + * + * @see #ONE_VALUE + * @generated + * @ordered + */ + ONE(1, "One", "One"), + + /** + * The 'All' literal object. + * + * + * @see #ALL_VALUE + * @generated + * @ordered + */ + ALL(2, "All", "All"), + + /** + * The 'Complex' literal object. + * + * + * @see #COMPLEX_VALUE + * @generated + * @ordered + */ + COMPLEX(3, "Complex", "Complex"); + + /** + * The 'None' literal value. + * + * + * @see #NONE + * @model name="None" + * @generated + * @ordered + */ + public static final int NONE_VALUE = 0; + + /** + * The 'One' literal value. + * + * + * @see #ONE + * @model name="One" + * @generated + * @ordered + */ + public static final int ONE_VALUE = 1; + + /** + * The 'All' literal value. + * + * + * @see #ALL + * @model name="All" + * @generated + * @ordered + */ + public static final int ALL_VALUE = 2; + + /** + * The 'Complex' literal value. + * + * + * @see #COMPLEX + * @model name="Complex" + * @generated + * @ordered + */ + public static final int COMPLEX_VALUE = 3; + + /** + * An array of all the 'Multi Instance Behavior' enumerators. + * + * + * @generated + */ + private static final MultiInstanceBehavior[] VALUES_ARRAY = new MultiInstanceBehavior[] { NONE, ONE, ALL, + COMPLEX, }; + + /** + * A public read-only list of all the 'Multi Instance Behavior' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Multi Instance Behavior' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static MultiInstanceBehavior get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + MultiInstanceBehavior result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Multi Instance Behavior' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static MultiInstanceBehavior getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + MultiInstanceBehavior result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Multi Instance Behavior' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static MultiInstanceBehavior get(int value) { + switch (value) { + case NONE_VALUE: + return NONE; + case ONE_VALUE: + return ONE; + case ALL_VALUE: + return ALL; + case COMPLEX_VALUE: + return COMPLEX; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private MultiInstanceBehavior(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //MultiInstanceBehavior diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MultiInstanceLoopCharacteristics.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MultiInstanceLoopCharacteristics.java new file mode 100644 index 00000000000..ad1460cf0a8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/MultiInstanceLoopCharacteristics.java @@ -0,0 +1,294 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Multi Instance Loop Characteristics'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getLoopCardinality Loop Cardinality}
  • + *
  • {@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getLoopDataInputRef Loop Data Input Ref}
  • + *
  • {@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getLoopDataOutputRef Loop Data Output Ref}
  • + *
  • {@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getInputDataItem Input Data Item}
  • + *
  • {@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getOutputDataItem Output Data Item}
  • + *
  • {@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getComplexBehaviorDefinition Complex Behavior Definition}
  • + *
  • {@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getCompletionCondition Completion Condition}
  • + *
  • {@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getBehavior Behavior}
  • + *
  • {@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#isIsSequential Is Sequential}
  • + *
  • {@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getNoneBehaviorEventRef None Behavior Event Ref}
  • + *
  • {@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getOneBehaviorEventRef One Behavior Event Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getMultiInstanceLoopCharacteristics() + * @model extendedMetaData="name='tMultiInstanceLoopCharacteristics' kind='elementOnly'" + * @generated + */ +public interface MultiInstanceLoopCharacteristics extends LoopCharacteristics { + /** + * Returns the value of the 'Loop Cardinality' containment reference. + * + * + * @return the value of the 'Loop Cardinality' containment reference. + * @see #setLoopCardinality(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getMultiInstanceLoopCharacteristics_LoopCardinality() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='loopCardinality' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Expression getLoopCardinality(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getLoopCardinality Loop Cardinality}' containment reference. + * + * + * @param value the new value of the 'Loop Cardinality' containment reference. + * @see #getLoopCardinality() + * @generated + */ + void setLoopCardinality(Expression value); + + /** + * Returns the value of the 'Loop Data Input Ref' reference. + * + * + * @return the value of the 'Loop Data Input Ref' reference. + * @see #setLoopDataInputRef(ItemAwareElement) + * @see org.eclipse.bpmn2.Bpmn2Package#getMultiInstanceLoopCharacteristics_LoopDataInputRef() + * @model ordered="false" + * extendedMetaData="kind='element' name='loopDataInputRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ItemAwareElement getLoopDataInputRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getLoopDataInputRef Loop Data Input Ref}' reference. + * + * + * @param value the new value of the 'Loop Data Input Ref' reference. + * @see #getLoopDataInputRef() + * @generated + */ + void setLoopDataInputRef(ItemAwareElement value); + + /** + * Returns the value of the 'Loop Data Output Ref' reference. + * + * + * @return the value of the 'Loop Data Output Ref' reference. + * @see #setLoopDataOutputRef(ItemAwareElement) + * @see org.eclipse.bpmn2.Bpmn2Package#getMultiInstanceLoopCharacteristics_LoopDataOutputRef() + * @model ordered="false" + * extendedMetaData="kind='element' name='loopDataOutputRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ItemAwareElement getLoopDataOutputRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getLoopDataOutputRef Loop Data Output Ref}' reference. + * + * + * @param value the new value of the 'Loop Data Output Ref' reference. + * @see #getLoopDataOutputRef() + * @generated + */ + void setLoopDataOutputRef(ItemAwareElement value); + + /** + * Returns the value of the 'Input Data Item' containment reference. + * + * + * @return the value of the 'Input Data Item' containment reference. + * @see #setInputDataItem(DataInput) + * @see org.eclipse.bpmn2.Bpmn2Package#getMultiInstanceLoopCharacteristics_InputDataItem() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='inputDataItem' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + DataInput getInputDataItem(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getInputDataItem Input Data Item}' containment reference. + * + * + * @param value the new value of the 'Input Data Item' containment reference. + * @see #getInputDataItem() + * @generated + */ + void setInputDataItem(DataInput value); + + /** + * Returns the value of the 'Output Data Item' containment reference. + * + * + * @return the value of the 'Output Data Item' containment reference. + * @see #setOutputDataItem(DataOutput) + * @see org.eclipse.bpmn2.Bpmn2Package#getMultiInstanceLoopCharacteristics_OutputDataItem() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='outputDataItem' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + DataOutput getOutputDataItem(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getOutputDataItem Output Data Item}' containment reference. + * + * + * @param value the new value of the 'Output Data Item' containment reference. + * @see #getOutputDataItem() + * @generated + */ + void setOutputDataItem(DataOutput value); + + /** + * Returns the value of the 'Complex Behavior Definition' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ComplexBehaviorDefinition}. + * + * + * @return the value of the 'Complex Behavior Definition' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getMultiInstanceLoopCharacteristics_ComplexBehaviorDefinition() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='complexBehaviorDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getComplexBehaviorDefinition(); + + /** + * Returns the value of the 'Completion Condition' containment reference. + * + * + * @return the value of the 'Completion Condition' containment reference. + * @see #setCompletionCondition(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getMultiInstanceLoopCharacteristics_CompletionCondition() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='completionCondition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Expression getCompletionCondition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getCompletionCondition Completion Condition}' containment reference. + * + * + * @param value the new value of the 'Completion Condition' containment reference. + * @see #getCompletionCondition() + * @generated + */ + void setCompletionCondition(Expression value); + + /** + * Returns the value of the 'Behavior' attribute. + * The default value is "All". + * The literals are from the enumeration {@link org.eclipse.bpmn2.MultiInstanceBehavior}. + * + * + * @return the value of the 'Behavior' attribute. + * @see org.eclipse.bpmn2.MultiInstanceBehavior + * @see #setBehavior(MultiInstanceBehavior) + * @see org.eclipse.bpmn2.Bpmn2Package#getMultiInstanceLoopCharacteristics_Behavior() + * @model default="All" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='behavior'" + * @generated + */ + MultiInstanceBehavior getBehavior(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getBehavior Behavior}' attribute. + * + * + * @param value the new value of the 'Behavior' attribute. + * @see org.eclipse.bpmn2.MultiInstanceBehavior + * @see #getBehavior() + * @generated + */ + void setBehavior(MultiInstanceBehavior value); + + /** + * Returns the value of the 'Is Sequential' attribute. + * The default value is "false". + * + * + * @return the value of the 'Is Sequential' attribute. + * @see #setIsSequential(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getMultiInstanceLoopCharacteristics_IsSequential() + * @model default="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='isSequential'" + * @generated + */ + boolean isIsSequential(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#isIsSequential Is Sequential}' attribute. + * + * + * @param value the new value of the 'Is Sequential' attribute. + * @see #isIsSequential() + * @generated + */ + void setIsSequential(boolean value); + + /** + * Returns the value of the 'None Behavior Event Ref' reference. + * + * + * @return the value of the 'None Behavior Event Ref' reference. + * @see #setNoneBehaviorEventRef(EventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getMultiInstanceLoopCharacteristics_NoneBehaviorEventRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='noneBehaviorEventRef'" + * @generated + */ + EventDefinition getNoneBehaviorEventRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getNoneBehaviorEventRef None Behavior Event Ref}' reference. + * + * + * @param value the new value of the 'None Behavior Event Ref' reference. + * @see #getNoneBehaviorEventRef() + * @generated + */ + void setNoneBehaviorEventRef(EventDefinition value); + + /** + * Returns the value of the 'One Behavior Event Ref' reference. + * + * + * @return the value of the 'One Behavior Event Ref' reference. + * @see #setOneBehaviorEventRef(EventDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getMultiInstanceLoopCharacteristics_OneBehaviorEventRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='oneBehaviorEventRef'" + * @generated + */ + EventDefinition getOneBehaviorEventRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics#getOneBehaviorEventRef One Behavior Event Ref}' reference. + * + * + * @param value the new value of the 'One Behavior Event Ref' reference. + * @see #getOneBehaviorEventRef() + * @generated + */ + void setOneBehaviorEventRef(EventDefinition value); + +} // MultiInstanceLoopCharacteristics diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Operation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Operation.java new file mode 100644 index 00000000000..12edaee56ad --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Operation.java @@ -0,0 +1,145 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Operation'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Operation#getInMessageRef In Message Ref}
  • + *
  • {@link org.eclipse.bpmn2.Operation#getOutMessageRef Out Message Ref}
  • + *
  • {@link org.eclipse.bpmn2.Operation#getErrorRefs Error Refs}
  • + *
  • {@link org.eclipse.bpmn2.Operation#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.Operation#getImplementationRef Implementation Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getOperation() + * @model extendedMetaData="name='tOperation' kind='elementOnly'" + * @generated + */ +public interface Operation extends BaseElement { + /** + * Returns the value of the 'In Message Ref' reference. + * + * + * @return the value of the 'In Message Ref' reference. + * @see #setInMessageRef(Message) + * @see org.eclipse.bpmn2.Bpmn2Package#getOperation_InMessageRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='element' name='inMessageRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Message getInMessageRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Operation#getInMessageRef In Message Ref}' reference. + * + * + * @param value the new value of the 'In Message Ref' reference. + * @see #getInMessageRef() + * @generated + */ + void setInMessageRef(Message value); + + /** + * Returns the value of the 'Out Message Ref' reference. + * + * + * @return the value of the 'Out Message Ref' reference. + * @see #setOutMessageRef(Message) + * @see org.eclipse.bpmn2.Bpmn2Package#getOperation_OutMessageRef() + * @model ordered="false" + * extendedMetaData="kind='element' name='outMessageRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Message getOutMessageRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Operation#getOutMessageRef Out Message Ref}' reference. + * + * + * @param value the new value of the 'Out Message Ref' reference. + * @see #getOutMessageRef() + * @generated + */ + void setOutMessageRef(Message value); + + /** + * Returns the value of the 'Error Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Error}. + * + * + * @return the value of the 'Error Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getOperation_ErrorRefs() + * @model ordered="false" + * extendedMetaData="kind='element' name='errorRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getErrorRefs(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getOperation_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Operation#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Implementation Ref' attribute. + * + * + * @return the value of the 'Implementation Ref' attribute. + * @see #setImplementationRef(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getOperation_ImplementationRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='implementationRef'" + * @generated + */ + String getImplementationRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Operation#getImplementationRef Implementation Ref}' attribute. + * + * + * @param value the new value of the 'Implementation Ref' attribute. + * @see #getImplementationRef() + * @generated + */ + void setImplementationRef(String value); + +} // Operation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/OutputSet.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/OutputSet.java new file mode 100644 index 00000000000..e4ce8d47e06 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/OutputSet.java @@ -0,0 +1,123 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Output Set'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.OutputSet#getDataOutputRefs Data Output Refs}
  • + *
  • {@link org.eclipse.bpmn2.OutputSet#getOptionalOutputRefs Optional Output Refs}
  • + *
  • {@link org.eclipse.bpmn2.OutputSet#getWhileExecutingOutputRefs While Executing Output Refs}
  • + *
  • {@link org.eclipse.bpmn2.OutputSet#getInputSetRefs Input Set Refs}
  • + *
  • {@link org.eclipse.bpmn2.OutputSet#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getOutputSet() + * @model extendedMetaData="name='tOutputSet' kind='elementOnly'" + * @generated + */ +public interface OutputSet extends BaseElement { + /** + * Returns the value of the 'Data Output Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataOutput}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.DataOutput#getOutputSetRefs Output Set Refs}'. + * + * + * @return the value of the 'Data Output Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getOutputSet_DataOutputRefs() + * @see org.eclipse.bpmn2.DataOutput#getOutputSetRefs + * @model opposite="outputSetRefs" resolveProxies="false" ordered="false" + * extendedMetaData="kind='element' name='dataOutputRefs' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getDataOutputRefs(); + + /** + * Returns the value of the 'Optional Output Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataOutput}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.DataOutput#getOutputSetWithOptional Output Set With Optional}'. + * + * + * @return the value of the 'Optional Output Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getOutputSet_OptionalOutputRefs() + * @see org.eclipse.bpmn2.DataOutput#getOutputSetWithOptional + * @model opposite="outputSetWithOptional" resolveProxies="false" ordered="false" + * extendedMetaData="kind='element' name='optionalOutputRefs' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getOptionalOutputRefs(); + + /** + * Returns the value of the 'While Executing Output Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataOutput}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.DataOutput#getOutputSetWithWhileExecuting Output Set With While Executing}'. + * + * + * @return the value of the 'While Executing Output Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getOutputSet_WhileExecutingOutputRefs() + * @see org.eclipse.bpmn2.DataOutput#getOutputSetWithWhileExecuting + * @model opposite="outputSetWithWhileExecuting" resolveProxies="false" ordered="false" + * extendedMetaData="kind='element' name='whileExecutingOutputRefs' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getWhileExecutingOutputRefs(); + + /** + * Returns the value of the 'Input Set Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.InputSet}. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.InputSet#getOutputSetRefs Output Set Refs}'. + * + * + * @return the value of the 'Input Set Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getOutputSet_InputSetRefs() + * @see org.eclipse.bpmn2.InputSet#getOutputSetRefs + * @model opposite="outputSetRefs" resolveProxies="false" ordered="false" + * extendedMetaData="kind='element' name='inputSetRefs' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getInputSetRefs(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getOutputSet_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.OutputSet#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // OutputSet diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ParallelGateway.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ParallelGateway.java new file mode 100644 index 00000000000..35a970261ad --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ParallelGateway.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Parallel Gateway'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getParallelGateway() + * @model extendedMetaData="name='tParallelGateway' kind='elementOnly'" + * @generated + */ +public interface ParallelGateway extends Gateway { +} // ParallelGateway diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Participant.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Participant.java new file mode 100644 index 00000000000..934571b7623 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Participant.java @@ -0,0 +1,135 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Participant'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Participant#getInterfaceRefs Interface Refs}
  • + *
  • {@link org.eclipse.bpmn2.Participant#getEndPointRefs End Point Refs}
  • + *
  • {@link org.eclipse.bpmn2.Participant#getParticipantMultiplicity Participant Multiplicity}
  • + *
  • {@link org.eclipse.bpmn2.Participant#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.Participant#getProcessRef Process Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getParticipant() + * @model extendedMetaData="name='tParticipant' kind='elementOnly'" + * @generated + */ +public interface Participant extends BaseElement, InteractionNode { + /** + * Returns the value of the 'Interface Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Interface}. + * + * + * @return the value of the 'Interface Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getParticipant_InterfaceRefs() + * @model ordered="false" + * extendedMetaData="kind='element' name='interfaceRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getInterfaceRefs(); + + /** + * Returns the value of the 'End Point Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.EndPoint}. + * + * + * @return the value of the 'End Point Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getParticipant_EndPointRefs() + * @model ordered="false" + * extendedMetaData="kind='element' name='endPointRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getEndPointRefs(); + + /** + * Returns the value of the 'Participant Multiplicity' containment reference. + * + * + * @return the value of the 'Participant Multiplicity' containment reference. + * @see #setParticipantMultiplicity(ParticipantMultiplicity) + * @see org.eclipse.bpmn2.Bpmn2Package#getParticipant_ParticipantMultiplicity() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='participantMultiplicity' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ParticipantMultiplicity getParticipantMultiplicity(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Participant#getParticipantMultiplicity Participant Multiplicity}' containment reference. + * + * + * @param value the new value of the 'Participant Multiplicity' containment reference. + * @see #getParticipantMultiplicity() + * @generated + */ + void setParticipantMultiplicity(ParticipantMultiplicity value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getParticipant_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Participant#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Process Ref' reference. + * + * + * @return the value of the 'Process Ref' reference. + * @see #setProcessRef(org.eclipse.bpmn2.Process) + * @see org.eclipse.bpmn2.Bpmn2Package#getParticipant_ProcessRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='processRef'" + * @generated + */ + org.eclipse.bpmn2.Process getProcessRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Participant#getProcessRef Process Ref}' reference. + * + * + * @param value the new value of the 'Process Ref' reference. + * @see #getProcessRef() + * @generated + */ + void setProcessRef(org.eclipse.bpmn2.Process value); + +} // Participant diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ParticipantAssociation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ParticipantAssociation.java new file mode 100644 index 00000000000..b2f629f83bd --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ParticipantAssociation.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Participant Association'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ParticipantAssociation#getInnerParticipantRef Inner Participant Ref}
  • + *
  • {@link org.eclipse.bpmn2.ParticipantAssociation#getOuterParticipantRef Outer Participant Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getParticipantAssociation() + * @model extendedMetaData="name='tParticipantAssociation' kind='elementOnly'" + * @generated + */ +public interface ParticipantAssociation extends BaseElement { + /** + * Returns the value of the 'Inner Participant Ref' reference. + * + * + * @return the value of the 'Inner Participant Ref' reference. + * @see #setInnerParticipantRef(Participant) + * @see org.eclipse.bpmn2.Bpmn2Package#getParticipantAssociation_InnerParticipantRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='element' name='innerParticipantRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Participant getInnerParticipantRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ParticipantAssociation#getInnerParticipantRef Inner Participant Ref}' reference. + * + * + * @param value the new value of the 'Inner Participant Ref' reference. + * @see #getInnerParticipantRef() + * @generated + */ + void setInnerParticipantRef(Participant value); + + /** + * Returns the value of the 'Outer Participant Ref' reference. + * + * + * @return the value of the 'Outer Participant Ref' reference. + * @see #setOuterParticipantRef(Participant) + * @see org.eclipse.bpmn2.Bpmn2Package#getParticipantAssociation_OuterParticipantRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='element' name='outerParticipantRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Participant getOuterParticipantRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ParticipantAssociation#getOuterParticipantRef Outer Participant Ref}' reference. + * + * + * @param value the new value of the 'Outer Participant Ref' reference. + * @see #getOuterParticipantRef() + * @generated + */ + void setOuterParticipantRef(Participant value); + +} // ParticipantAssociation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ParticipantMultiplicity.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ParticipantMultiplicity.java new file mode 100644 index 00000000000..e70bef9743a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ParticipantMultiplicity.java @@ -0,0 +1,83 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Participant Multiplicity'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ParticipantMultiplicity#getMaximum Maximum}
  • + *
  • {@link org.eclipse.bpmn2.ParticipantMultiplicity#getMinimum Minimum}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getParticipantMultiplicity() + * @model extendedMetaData="name='tParticipantMultiplicity' kind='elementOnly'" + * @generated + */ +public interface ParticipantMultiplicity extends BaseElement { + /** + * Returns the value of the 'Maximum' attribute. + * The default value is "1". + * + * + * @return the value of the 'Maximum' attribute. + * @see #setMaximum(int) + * @see org.eclipse.bpmn2.Bpmn2Package#getParticipantMultiplicity_Maximum() + * @model default="1" ordered="false" + * extendedMetaData="kind='attribute' name='maximum'" + * @generated + */ + int getMaximum(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ParticipantMultiplicity#getMaximum Maximum}' attribute. + * + * + * @param value the new value of the 'Maximum' attribute. + * @see #getMaximum() + * @generated + */ + void setMaximum(int value); + + /** + * Returns the value of the 'Minimum' attribute. + * The default value is "0". + * + * + * @return the value of the 'Minimum' attribute. + * @see #setMinimum(int) + * @see org.eclipse.bpmn2.Bpmn2Package#getParticipantMultiplicity_Minimum() + * @model default="0" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='minimum'" + * @generated + */ + int getMinimum(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ParticipantMultiplicity#getMinimum Minimum}' attribute. + * + * + * @param value the new value of the 'Minimum' attribute. + * @see #getMinimum() + * @generated + */ + void setMinimum(int value); + +} // ParticipantMultiplicity diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/PartnerEntity.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/PartnerEntity.java new file mode 100644 index 00000000000..de4047ae177 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/PartnerEntity.java @@ -0,0 +1,73 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Partner Entity'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.PartnerEntity#getParticipantRef Participant Ref}
  • + *
  • {@link org.eclipse.bpmn2.PartnerEntity#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getPartnerEntity() + * @model extendedMetaData="name='tPartnerEntity' kind='elementOnly'" + * @generated + */ +public interface PartnerEntity extends RootElement { + /** + * Returns the value of the 'Participant Ref' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Participant}. + * + * + * @return the value of the 'Participant Ref' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getPartnerEntity_ParticipantRef() + * @model ordered="false" + * extendedMetaData="kind='element' name='participantRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getParticipantRef(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getPartnerEntity_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.PartnerEntity#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // PartnerEntity diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/PartnerRole.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/PartnerRole.java new file mode 100644 index 00000000000..f9fa0a34c2e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/PartnerRole.java @@ -0,0 +1,73 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Partner Role'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.PartnerRole#getParticipantRef Participant Ref}
  • + *
  • {@link org.eclipse.bpmn2.PartnerRole#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getPartnerRole() + * @model extendedMetaData="name='tPartnerRole' kind='elementOnly'" + * @generated + */ +public interface PartnerRole extends RootElement { + /** + * Returns the value of the 'Participant Ref' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Participant}. + * + * + * @return the value of the 'Participant Ref' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getPartnerRole_ParticipantRef() + * @model ordered="false" + * extendedMetaData="kind='element' name='participantRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getParticipantRef(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getPartnerRole_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.PartnerRole#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // PartnerRole diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Performer.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Performer.java new file mode 100644 index 00000000000..d6d59cd77cf --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Performer.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Performer'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getPerformer() + * @model extendedMetaData="name='tPerformer' kind='elementOnly'" + * @generated + */ +public interface Performer extends ResourceRole { +} // Performer diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/PotentialOwner.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/PotentialOwner.java new file mode 100644 index 00000000000..6a7bb5bf3d1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/PotentialOwner.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Potential Owner'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getPotentialOwner() + * @model extendedMetaData="name='tPotentialOwner' kind='elementOnly'" + * @generated + */ +public interface PotentialOwner extends HumanPerformer { +} // PotentialOwner diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Process.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Process.java new file mode 100644 index 00000000000..0db66813446 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Process.java @@ -0,0 +1,252 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Process'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Process#getAuditing Auditing}
  • + *
  • {@link org.eclipse.bpmn2.Process#getMonitoring Monitoring}
  • + *
  • {@link org.eclipse.bpmn2.Process#getProperties Properties}
  • + *
  • {@link org.eclipse.bpmn2.Process#getArtifacts Artifacts}
  • + *
  • {@link org.eclipse.bpmn2.Process#getResources Resources}
  • + *
  • {@link org.eclipse.bpmn2.Process#getCorrelationSubscriptions Correlation Subscriptions}
  • + *
  • {@link org.eclipse.bpmn2.Process#getSupports Supports}
  • + *
  • {@link org.eclipse.bpmn2.Process#getDefinitionalCollaborationRef Definitional Collaboration Ref}
  • + *
  • {@link org.eclipse.bpmn2.Process#isIsClosed Is Closed}
  • + *
  • {@link org.eclipse.bpmn2.Process#isIsExecutable Is Executable}
  • + *
  • {@link org.eclipse.bpmn2.Process#getProcessType Process Type}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getProcess() + * @model extendedMetaData="name='tProcess' kind='elementOnly'" + * @generated + */ +public interface Process extends CallableElement, FlowElementsContainer { + /** + * Returns the value of the 'Auditing' containment reference. + * + * + * @return the value of the 'Auditing' containment reference. + * @see #setAuditing(Auditing) + * @see org.eclipse.bpmn2.Bpmn2Package#getProcess_Auditing() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='auditing' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Auditing getAuditing(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Process#getAuditing Auditing}' containment reference. + * + * + * @param value the new value of the 'Auditing' containment reference. + * @see #getAuditing() + * @generated + */ + void setAuditing(Auditing value); + + /** + * Returns the value of the 'Monitoring' containment reference. + * + * + * @return the value of the 'Monitoring' containment reference. + * @see #setMonitoring(Monitoring) + * @see org.eclipse.bpmn2.Bpmn2Package#getProcess_Monitoring() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='monitoring' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Monitoring getMonitoring(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Process#getMonitoring Monitoring}' containment reference. + * + * + * @param value the new value of the 'Monitoring' containment reference. + * @see #getMonitoring() + * @generated + */ + void setMonitoring(Monitoring value); + + /** + * Returns the value of the 'Properties' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Property}. + * + * + * @return the value of the 'Properties' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getProcess_Properties() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='property' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getProperties(); + + /** + * Returns the value of the 'Artifacts' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Artifact}. + * + * + * @return the value of the 'Artifacts' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getProcess_Artifacts() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='artifact' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#artifact'" + * @generated + */ + EList getArtifacts(); + + /** + * Returns the value of the 'Resources' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ResourceRole}. + * + * + * @return the value of the 'Resources' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getProcess_Resources() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='resourceRole' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#resourceRole'" + * @generated + */ + EList getResources(); + + /** + * Returns the value of the 'Correlation Subscriptions' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.CorrelationSubscription}. + * + * + * @return the value of the 'Correlation Subscriptions' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getProcess_CorrelationSubscriptions() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='correlationSubscription' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getCorrelationSubscriptions(); + + /** + * Returns the value of the 'Supports' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Process}. + * + * + * @return the value of the 'Supports' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getProcess_Supports() + * @model ordered="false" + * extendedMetaData="kind='element' name='supports' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getSupports(); + + /** + * Returns the value of the 'Definitional Collaboration Ref' reference. + * + * + * @return the value of the 'Definitional Collaboration Ref' reference. + * @see #setDefinitionalCollaborationRef(Collaboration) + * @see org.eclipse.bpmn2.Bpmn2Package#getProcess_DefinitionalCollaborationRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='definitionalCollaborationRef'" + * @generated + */ + Collaboration getDefinitionalCollaborationRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Process#getDefinitionalCollaborationRef Definitional Collaboration Ref}' reference. + * + * + * @param value the new value of the 'Definitional Collaboration Ref' reference. + * @see #getDefinitionalCollaborationRef() + * @generated + */ + void setDefinitionalCollaborationRef(Collaboration value); + + /** + * Returns the value of the 'Is Closed' attribute. + * + * + * @return the value of the 'Is Closed' attribute. + * @see #setIsClosed(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getProcess_IsClosed() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='isClosed'" + * @generated + */ + boolean isIsClosed(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Process#isIsClosed Is Closed}' attribute. + * + * + * @param value the new value of the 'Is Closed' attribute. + * @see #isIsClosed() + * @generated + */ + void setIsClosed(boolean value); + + /** + * Returns the value of the 'Is Executable' attribute. + * + * + * @return the value of the 'Is Executable' attribute. + * @see #setIsExecutable(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getProcess_IsExecutable() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='isExecutable'" + * @generated + */ + boolean isIsExecutable(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Process#isIsExecutable Is Executable}' attribute. + * + * + * @param value the new value of the 'Is Executable' attribute. + * @see #isIsExecutable() + * @generated + */ + void setIsExecutable(boolean value); + + /** + * Returns the value of the 'Process Type' attribute. + * The literals are from the enumeration {@link org.eclipse.bpmn2.ProcessType}. + * + * + * @return the value of the 'Process Type' attribute. + * @see org.eclipse.bpmn2.ProcessType + * @see #setProcessType(ProcessType) + * @see org.eclipse.bpmn2.Bpmn2Package#getProcess_ProcessType() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='processType'" + * @generated + */ + ProcessType getProcessType(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Process#getProcessType Process Type}' attribute. + * + * + * @param value the new value of the 'Process Type' attribute. + * @see org.eclipse.bpmn2.ProcessType + * @see #getProcessType() + * @generated + */ + void setProcessType(ProcessType value); + +} // Process diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ProcessType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ProcessType.java new file mode 100644 index 00000000000..2355f6da420 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ProcessType.java @@ -0,0 +1,242 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Process Type', + * and utility methods for working with them. + * + * @see org.eclipse.bpmn2.Bpmn2Package#getProcessType() + * @model extendedMetaData="name='tProcessType'" + * @generated + */ +public enum ProcessType implements Enumerator { + /** + * The 'None' literal object. + * + * + * @see #NONE_VALUE + * @generated + * @ordered + */ + NONE(0, "None", "None"), + + /** + * The 'Public' literal object. + * + * + * @see #PUBLIC_VALUE + * @generated + * @ordered + */ + PUBLIC(1, "Public", "Public"), + + /** + * The 'Private' literal object. + * + * + * @see #PRIVATE_VALUE + * @generated + * @ordered + */ + PRIVATE(2, "Private", "Private"); + + /** + * The 'None' literal value. + * + * + * @see #NONE + * @model name="None" + * @generated + * @ordered + */ + public static final int NONE_VALUE = 0; + + /** + * The 'Public' literal value. + * + * + * @see #PUBLIC + * @model name="Public" + * @generated + * @ordered + */ + public static final int PUBLIC_VALUE = 1; + + /** + * The 'Private' literal value. + * + * + * @see #PRIVATE + * @model name="Private" + * @generated + * @ordered + */ + public static final int PRIVATE_VALUE = 2; + + /** + * An array of all the 'Process Type' enumerators. + * + * + * @generated + */ + private static final ProcessType[] VALUES_ARRAY = new ProcessType[] { NONE, PUBLIC, PRIVATE, }; + + /** + * A public read-only list of all the 'Process Type' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Process Type' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static ProcessType get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ProcessType result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Process Type' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static ProcessType getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ProcessType result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Process Type' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static ProcessType get(int value) { + switch (value) { + case NONE_VALUE: + return NONE; + case PUBLIC_VALUE: + return PUBLIC; + case PRIVATE_VALUE: + return PRIVATE; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private ProcessType(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //ProcessType diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Property.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Property.java new file mode 100644 index 00000000000..e00acb8e243 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Property.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Property'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Property#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getProperty() + * @model extendedMetaData="name='tProperty' kind='elementOnly'" + * @generated + */ +public interface Property extends ItemAwareElement { + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getProperty_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Property#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // Property diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ReceiveTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ReceiveTask.java new file mode 100644 index 00000000000..5b1b0217e53 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ReceiveTask.java @@ -0,0 +1,130 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Receive Task'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ReceiveTask#getImplementation Implementation}
  • + *
  • {@link org.eclipse.bpmn2.ReceiveTask#isInstantiate Instantiate}
  • + *
  • {@link org.eclipse.bpmn2.ReceiveTask#getMessageRef Message Ref}
  • + *
  • {@link org.eclipse.bpmn2.ReceiveTask#getOperationRef Operation Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getReceiveTask() + * @model extendedMetaData="name='tReceiveTask' kind='elementOnly'" + * @generated + */ +public interface ReceiveTask extends Task { + /** + * Returns the value of the 'Implementation' attribute. + * + * + * @return the value of the 'Implementation' attribute. + * @see #setImplementation(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getReceiveTask_Implementation() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='implementation'" + * @generated + */ + String getImplementation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ReceiveTask#getImplementation Implementation}' attribute. + * + * + * @param value the new value of the 'Implementation' attribute. + * @see #getImplementation() + * @generated + */ + void setImplementation(String value); + + /** + * Returns the value of the 'Instantiate' attribute. + * The default value is "false". + * + * + * @return the value of the 'Instantiate' attribute. + * @see #setInstantiate(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getReceiveTask_Instantiate() + * @model default="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='instantiate'" + * @generated + */ + boolean isInstantiate(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ReceiveTask#isInstantiate Instantiate}' attribute. + * + * + * @param value the new value of the 'Instantiate' attribute. + * @see #isInstantiate() + * @generated + */ + void setInstantiate(boolean value); + + /** + * Returns the value of the 'Message Ref' reference. + * + * + * @return the value of the 'Message Ref' reference. + * @see #setMessageRef(Message) + * @see org.eclipse.bpmn2.Bpmn2Package#getReceiveTask_MessageRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='messageRef'" + * @generated + */ + Message getMessageRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ReceiveTask#getMessageRef Message Ref}' reference. + * + * + * @param value the new value of the 'Message Ref' reference. + * @see #getMessageRef() + * @generated + */ + void setMessageRef(Message value); + + /** + * Returns the value of the 'Operation Ref' reference. + * + * + * @return the value of the 'Operation Ref' reference. + * @see #setOperationRef(Operation) + * @see org.eclipse.bpmn2.Bpmn2Package#getReceiveTask_OperationRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='operationRef'" + * @generated + */ + Operation getOperationRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ReceiveTask#getOperationRef Operation Ref}' reference. + * + * + * @param value the new value of the 'Operation Ref' reference. + * @see #getOperationRef() + * @generated + */ + void setOperationRef(Operation value); + +} // ReceiveTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Relationship.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Relationship.java new file mode 100644 index 00000000000..d9152dfbbef --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Relationship.java @@ -0,0 +1,116 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Relationship'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Relationship#getSources Sources}
  • + *
  • {@link org.eclipse.bpmn2.Relationship#getTargets Targets}
  • + *
  • {@link org.eclipse.bpmn2.Relationship#getDirection Direction}
  • + *
  • {@link org.eclipse.bpmn2.Relationship#getType Type}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getRelationship() + * @model extendedMetaData="name='tRelationship' kind='elementOnly'" + * @generated + */ +public interface Relationship extends BaseElement { + /** + * Returns the value of the 'Sources' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EObject}. + * + * + * @return the value of the 'Sources' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getRelationship_Sources() + * @model required="true" ordered="false" + * extendedMetaData="kind='element' name='source' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getSources(); + + /** + * Returns the value of the 'Targets' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EObject}. + * + * + * @return the value of the 'Targets' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getRelationship_Targets() + * @model required="true" ordered="false" + * extendedMetaData="kind='element' name='target' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getTargets(); + + /** + * Returns the value of the 'Direction' attribute. + * The literals are from the enumeration {@link org.eclipse.bpmn2.RelationshipDirection}. + * + * + * @return the value of the 'Direction' attribute. + * @see org.eclipse.bpmn2.RelationshipDirection + * @see #setDirection(RelationshipDirection) + * @see org.eclipse.bpmn2.Bpmn2Package#getRelationship_Direction() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='direction'" + * @generated + */ + RelationshipDirection getDirection(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Relationship#getDirection Direction}' attribute. + * + * + * @param value the new value of the 'Direction' attribute. + * @see org.eclipse.bpmn2.RelationshipDirection + * @see #getDirection() + * @generated + */ + void setDirection(RelationshipDirection value); + + /** + * Returns the value of the 'Type' attribute. + * + * + * @return the value of the 'Type' attribute. + * @see #setType(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getRelationship_Type() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='type'" + * @generated + */ + String getType(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Relationship#getType Type}' attribute. + * + * + * @param value the new value of the 'Type' attribute. + * @see #getType() + * @generated + */ + void setType(String value); + +} // Relationship diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/RelationshipDirection.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/RelationshipDirection.java new file mode 100644 index 00000000000..6ab98bad050 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/RelationshipDirection.java @@ -0,0 +1,266 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Relationship Direction', + * and utility methods for working with them. + * + * @see org.eclipse.bpmn2.Bpmn2Package#getRelationshipDirection() + * @model extendedMetaData="name='tRelationshipDirection'" + * @generated + */ +public enum RelationshipDirection implements Enumerator { + /** + * The 'None' literal object. + * + * + * @see #NONE_VALUE + * @generated + * @ordered + */ + NONE(0, "None", "None"), + + /** + * The 'Forward' literal object. + * + * + * @see #FORWARD_VALUE + * @generated + * @ordered + */ + FORWARD(1, "Forward", "Forward"), + + /** + * The 'Backward' literal object. + * + * + * @see #BACKWARD_VALUE + * @generated + * @ordered + */ + BACKWARD(2, "Backward", "Backward"), + + /** + * The 'Both' literal object. + * + * + * @see #BOTH_VALUE + * @generated + * @ordered + */ + BOTH(3, "Both", "Both"); + + /** + * The 'None' literal value. + * + * + * @see #NONE + * @model name="None" + * @generated + * @ordered + */ + public static final int NONE_VALUE = 0; + + /** + * The 'Forward' literal value. + * + * + * @see #FORWARD + * @model name="Forward" + * @generated + * @ordered + */ + public static final int FORWARD_VALUE = 1; + + /** + * The 'Backward' literal value. + * + * + * @see #BACKWARD + * @model name="Backward" + * @generated + * @ordered + */ + public static final int BACKWARD_VALUE = 2; + + /** + * The 'Both' literal value. + * + * + * @see #BOTH + * @model name="Both" + * @generated + * @ordered + */ + public static final int BOTH_VALUE = 3; + + /** + * An array of all the 'Relationship Direction' enumerators. + * + * + * @generated + */ + private static final RelationshipDirection[] VALUES_ARRAY = new RelationshipDirection[] { NONE, FORWARD, BACKWARD, + BOTH, }; + + /** + * A public read-only list of all the 'Relationship Direction' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Relationship Direction' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static RelationshipDirection get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + RelationshipDirection result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Relationship Direction' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static RelationshipDirection getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + RelationshipDirection result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Relationship Direction' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static RelationshipDirection get(int value) { + switch (value) { + case NONE_VALUE: + return NONE; + case FORWARD_VALUE: + return FORWARD; + case BACKWARD_VALUE: + return BACKWARD; + case BOTH_VALUE: + return BOTH; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private RelationshipDirection(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //RelationshipDirection diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Rendering.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Rendering.java new file mode 100644 index 00000000000..a93e773eb26 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Rendering.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Rendering'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getRendering() + * @model extendedMetaData="name='tRendering' kind='elementOnly'" + * @generated + */ +public interface Rendering extends BaseElement { +} // Rendering diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Resource.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Resource.java new file mode 100644 index 00000000000..efe4eaec042 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Resource.java @@ -0,0 +1,73 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Resource'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Resource#getResourceParameters Resource Parameters}
  • + *
  • {@link org.eclipse.bpmn2.Resource#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getResource() + * @model extendedMetaData="name='tResource' kind='elementOnly'" + * @generated + */ +public interface Resource extends RootElement { + /** + * Returns the value of the 'Resource Parameters' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ResourceParameter}. + * + * + * @return the value of the 'Resource Parameters' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getResource_ResourceParameters() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='resourceParameter' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getResourceParameters(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getResource_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Resource#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // Resource diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ResourceAssignmentExpression.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ResourceAssignmentExpression.java new file mode 100644 index 00000000000..d3c32184f78 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ResourceAssignmentExpression.java @@ -0,0 +1,57 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Resource Assignment Expression'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ResourceAssignmentExpression#getExpression Expression}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceAssignmentExpression() + * @model extendedMetaData="name='tResourceAssignmentExpression' kind='elementOnly'" + * @generated + */ +public interface ResourceAssignmentExpression extends BaseElement { + /** + * Returns the value of the 'Expression' containment reference. + * + * + * @return the value of the 'Expression' containment reference. + * @see #setExpression(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceAssignmentExpression_Expression() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='expression' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#expression'" + * @generated + */ + Expression getExpression(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ResourceAssignmentExpression#getExpression Expression}' containment reference. + * + * + * @param value the new value of the 'Expression' containment reference. + * @see #getExpression() + * @generated + */ + void setExpression(Expression value); + +} // ResourceAssignmentExpression diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ResourceParameter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ResourceParameter.java new file mode 100644 index 00000000000..27bb83ad260 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ResourceParameter.java @@ -0,0 +1,105 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Resource Parameter'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ResourceParameter#isIsRequired Is Required}
  • + *
  • {@link org.eclipse.bpmn2.ResourceParameter#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.ResourceParameter#getType Type}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceParameter() + * @model extendedMetaData="name='tResourceParameter' kind='elementOnly'" + * @generated + */ +public interface ResourceParameter extends BaseElement { + /** + * Returns the value of the 'Is Required' attribute. + * + * + * @return the value of the 'Is Required' attribute. + * @see #setIsRequired(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceParameter_IsRequired() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='isRequired'" + * @generated + */ + boolean isIsRequired(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ResourceParameter#isIsRequired Is Required}' attribute. + * + * + * @param value the new value of the 'Is Required' attribute. + * @see #isIsRequired() + * @generated + */ + void setIsRequired(boolean value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceParameter_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ResourceParameter#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Type' reference. + * + * + * @return the value of the 'Type' reference. + * @see #setType(ItemDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceParameter_Type() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='type'" + * @generated + */ + ItemDefinition getType(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ResourceParameter#getType Type}' reference. + * + * + * @param value the new value of the 'Type' reference. + * @see #getType() + * @generated + */ + void setType(ItemDefinition value); + +} // ResourceParameter diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ResourceParameterBinding.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ResourceParameterBinding.java new file mode 100644 index 00000000000..627f2135bfa --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ResourceParameterBinding.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Resource Parameter Binding'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ResourceParameterBinding#getExpression Expression}
  • + *
  • {@link org.eclipse.bpmn2.ResourceParameterBinding#getParameterRef Parameter Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceParameterBinding() + * @model extendedMetaData="name='tResourceParameterBinding' kind='elementOnly'" + * @generated + */ +public interface ResourceParameterBinding extends BaseElement { + /** + * Returns the value of the 'Expression' containment reference. + * + * + * @return the value of the 'Expression' containment reference. + * @see #setExpression(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceParameterBinding_Expression() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='expression' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#expression'" + * @generated + */ + Expression getExpression(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ResourceParameterBinding#getExpression Expression}' containment reference. + * + * + * @param value the new value of the 'Expression' containment reference. + * @see #getExpression() + * @generated + */ + void setExpression(Expression value); + + /** + * Returns the value of the 'Parameter Ref' reference. + * + * + * @return the value of the 'Parameter Ref' reference. + * @see #setParameterRef(ResourceParameter) + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceParameterBinding_ParameterRef() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='parameterRef'" + * @generated + */ + ResourceParameter getParameterRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ResourceParameterBinding#getParameterRef Parameter Ref}' reference. + * + * + * @param value the new value of the 'Parameter Ref' reference. + * @see #getParameterRef() + * @generated + */ + void setParameterRef(ResourceParameter value); + +} // ResourceParameterBinding diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ResourceRole.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ResourceRole.java new file mode 100644 index 00000000000..6ed7d3fe923 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ResourceRole.java @@ -0,0 +1,121 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Resource Role'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ResourceRole#getResourceRef Resource Ref}
  • + *
  • {@link org.eclipse.bpmn2.ResourceRole#getResourceParameterBindings Resource Parameter Bindings}
  • + *
  • {@link org.eclipse.bpmn2.ResourceRole#getResourceAssignmentExpression Resource Assignment Expression}
  • + *
  • {@link org.eclipse.bpmn2.ResourceRole#getName Name}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceRole() + * @model extendedMetaData="name='tResourceRole' kind='elementOnly'" + * @generated + */ +public interface ResourceRole extends BaseElement { + /** + * Returns the value of the 'Resource Ref' reference. + * + * + * @return the value of the 'Resource Ref' reference. + * @see #setResourceRef(Resource) + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceRole_ResourceRef() + * @model ordered="false" + * extendedMetaData="kind='element' name='resourceRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Resource getResourceRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ResourceRole#getResourceRef Resource Ref}' reference. + * + * + * @param value the new value of the 'Resource Ref' reference. + * @see #getResourceRef() + * @generated + */ + void setResourceRef(Resource value); + + /** + * Returns the value of the 'Resource Parameter Bindings' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ResourceParameterBinding}. + * + * + * @return the value of the 'Resource Parameter Bindings' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceRole_ResourceParameterBindings() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='resourceParameterBinding' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getResourceParameterBindings(); + + /** + * Returns the value of the 'Resource Assignment Expression' containment reference. + * + * + * @return the value of the 'Resource Assignment Expression' containment reference. + * @see #setResourceAssignmentExpression(ResourceAssignmentExpression) + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceRole_ResourceAssignmentExpression() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='resourceAssignmentExpression' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + ResourceAssignmentExpression getResourceAssignmentExpression(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ResourceRole#getResourceAssignmentExpression Resource Assignment Expression}' containment reference. + * + * + * @param value the new value of the 'Resource Assignment Expression' containment reference. + * @see #getResourceAssignmentExpression() + * @generated + */ + void setResourceAssignmentExpression(ResourceAssignmentExpression value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getResourceRole_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ResourceRole#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // ResourceRole diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/RootElement.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/RootElement.java new file mode 100644 index 00000000000..12f9d40fd33 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/RootElement.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Root Element'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getRootElement() + * @model extendedMetaData="name='tRootElement' kind='elementOnly' abstract='true'" + * @generated + */ +public interface RootElement extends BaseElement { +} // RootElement diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ScriptTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ScriptTask.java new file mode 100644 index 00000000000..d88cb00b379 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ScriptTask.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Script Task'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ScriptTask#getScript Script}
  • + *
  • {@link org.eclipse.bpmn2.ScriptTask#getScriptFormat Script Format}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getScriptTask() + * @model extendedMetaData="name='tScriptTask' kind='elementOnly'" + * @generated + */ +public interface ScriptTask extends Task { + /** + * Returns the value of the 'Script' attribute. + * + * + * @return the value of the 'Script' attribute. + * @see #setScript(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getScriptTask_Script() + * @model required="true" ordered="false" + * extendedMetaData="kind='element' name='script' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + String getScript(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ScriptTask#getScript Script}' attribute. + * + * + * @param value the new value of the 'Script' attribute. + * @see #getScript() + * @generated + */ + void setScript(String value); + + /** + * Returns the value of the 'Script Format' attribute. + * + * + * @return the value of the 'Script Format' attribute. + * @see #setScriptFormat(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getScriptTask_ScriptFormat() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='scriptFormat'" + * @generated + */ + String getScriptFormat(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ScriptTask#getScriptFormat Script Format}' attribute. + * + * + * @param value the new value of the 'Script Format' attribute. + * @see #getScriptFormat() + * @generated + */ + void setScriptFormat(String value); + +} // ScriptTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SendTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SendTask.java new file mode 100644 index 00000000000..22dd93c5e8b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SendTask.java @@ -0,0 +1,105 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Send Task'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.SendTask#getImplementation Implementation}
  • + *
  • {@link org.eclipse.bpmn2.SendTask#getMessageRef Message Ref}
  • + *
  • {@link org.eclipse.bpmn2.SendTask#getOperationRef Operation Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getSendTask() + * @model extendedMetaData="name='tSendTask' kind='elementOnly'" + * @generated + */ +public interface SendTask extends Task { + /** + * Returns the value of the 'Implementation' attribute. + * + * + * @return the value of the 'Implementation' attribute. + * @see #setImplementation(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getSendTask_Implementation() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='implementation'" + * @generated + */ + String getImplementation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.SendTask#getImplementation Implementation}' attribute. + * + * + * @param value the new value of the 'Implementation' attribute. + * @see #getImplementation() + * @generated + */ + void setImplementation(String value); + + /** + * Returns the value of the 'Message Ref' reference. + * + * + * @return the value of the 'Message Ref' reference. + * @see #setMessageRef(Message) + * @see org.eclipse.bpmn2.Bpmn2Package#getSendTask_MessageRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='messageRef'" + * @generated + */ + Message getMessageRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.SendTask#getMessageRef Message Ref}' reference. + * + * + * @param value the new value of the 'Message Ref' reference. + * @see #getMessageRef() + * @generated + */ + void setMessageRef(Message value); + + /** + * Returns the value of the 'Operation Ref' reference. + * + * + * @return the value of the 'Operation Ref' reference. + * @see #setOperationRef(Operation) + * @see org.eclipse.bpmn2.Bpmn2Package#getSendTask_OperationRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='operationRef'" + * @generated + */ + Operation getOperationRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.SendTask#getOperationRef Operation Ref}' reference. + * + * + * @param value the new value of the 'Operation Ref' reference. + * @see #getOperationRef() + * @generated + */ + void setOperationRef(Operation value); + +} // SendTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SequenceFlow.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SequenceFlow.java new file mode 100644 index 00000000000..cda9b901bc3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SequenceFlow.java @@ -0,0 +1,133 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Sequence Flow'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.SequenceFlow#getConditionExpression Condition Expression}
  • + *
  • {@link org.eclipse.bpmn2.SequenceFlow#isIsImmediate Is Immediate}
  • + *
  • {@link org.eclipse.bpmn2.SequenceFlow#getSourceRef Source Ref}
  • + *
  • {@link org.eclipse.bpmn2.SequenceFlow#getTargetRef Target Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getSequenceFlow() + * @model extendedMetaData="name='tSequenceFlow' kind='elementOnly'" + * @generated + */ +public interface SequenceFlow extends FlowElement { + /** + * Returns the value of the 'Condition Expression' containment reference. + * + * + * @return the value of the 'Condition Expression' containment reference. + * @see #setConditionExpression(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getSequenceFlow_ConditionExpression() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='conditionExpression' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Expression getConditionExpression(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.SequenceFlow#getConditionExpression Condition Expression}' containment reference. + * + * + * @param value the new value of the 'Condition Expression' containment reference. + * @see #getConditionExpression() + * @generated + */ + void setConditionExpression(Expression value); + + /** + * Returns the value of the 'Is Immediate' attribute. + * + * + * @return the value of the 'Is Immediate' attribute. + * @see #setIsImmediate(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getSequenceFlow_IsImmediate() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='isImmediate'" + * @generated + */ + boolean isIsImmediate(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.SequenceFlow#isIsImmediate Is Immediate}' attribute. + * + * + * @param value the new value of the 'Is Immediate' attribute. + * @see #isIsImmediate() + * @generated + */ + void setIsImmediate(boolean value); + + /** + * Returns the value of the 'Source Ref' reference. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.FlowNode#getOutgoing Outgoing}'. + * + * + * @return the value of the 'Source Ref' reference. + * @see #setSourceRef(FlowNode) + * @see org.eclipse.bpmn2.Bpmn2Package#getSequenceFlow_SourceRef() + * @see org.eclipse.bpmn2.FlowNode#getOutgoing + * @model opposite="outgoing" resolveProxies="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='sourceRef'" + * @generated + */ + FlowNode getSourceRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.SequenceFlow#getSourceRef Source Ref}' reference. + * + * + * @param value the new value of the 'Source Ref' reference. + * @see #getSourceRef() + * @generated + */ + void setSourceRef(FlowNode value); + + /** + * Returns the value of the 'Target Ref' reference. + * It is bidirectional and its opposite is '{@link org.eclipse.bpmn2.FlowNode#getIncoming Incoming}'. + * + * + * @return the value of the 'Target Ref' reference. + * @see #setTargetRef(FlowNode) + * @see org.eclipse.bpmn2.Bpmn2Package#getSequenceFlow_TargetRef() + * @see org.eclipse.bpmn2.FlowNode#getIncoming + * @model opposite="incoming" resolveProxies="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='targetRef'" + * @generated + */ + FlowNode getTargetRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.SequenceFlow#getTargetRef Target Ref}' reference. + * + * + * @param value the new value of the 'Target Ref' reference. + * @see #getTargetRef() + * @generated + */ + void setTargetRef(FlowNode value); + +} // SequenceFlow diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ServiceTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ServiceTask.java new file mode 100644 index 00000000000..1b5a29297b7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ServiceTask.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Service Task'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ServiceTask#getImplementation Implementation}
  • + *
  • {@link org.eclipse.bpmn2.ServiceTask#getOperationRef Operation Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getServiceTask() + * @model extendedMetaData="name='tServiceTask' kind='elementOnly'" + * @generated + */ +public interface ServiceTask extends Task { + /** + * Returns the value of the 'Implementation' attribute. + * + * + * @return the value of the 'Implementation' attribute. + * @see #setImplementation(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getServiceTask_Implementation() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='implementation'" + * @generated + */ + String getImplementation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ServiceTask#getImplementation Implementation}' attribute. + * + * + * @param value the new value of the 'Implementation' attribute. + * @see #getImplementation() + * @generated + */ + void setImplementation(String value); + + /** + * Returns the value of the 'Operation Ref' reference. + * + * + * @return the value of the 'Operation Ref' reference. + * @see #setOperationRef(Operation) + * @see org.eclipse.bpmn2.Bpmn2Package#getServiceTask_OperationRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='operationRef'" + * @generated + */ + Operation getOperationRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ServiceTask#getOperationRef Operation Ref}' reference. + * + * + * @param value the new value of the 'Operation Ref' reference. + * @see #getOperationRef() + * @generated + */ + void setOperationRef(Operation value); + +} // ServiceTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Signal.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Signal.java new file mode 100644 index 00000000000..bacebb9c938 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Signal.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Signal'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Signal#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.Signal#getStructureRef Structure Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getSignal() + * @model extendedMetaData="name='tSignal' kind='elementOnly'" + * @generated + */ +public interface Signal extends RootElement { + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getSignal_Name() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Signal#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Structure Ref' reference. + * + * + * @return the value of the 'Structure Ref' reference. + * @see #setStructureRef(ItemDefinition) + * @see org.eclipse.bpmn2.Bpmn2Package#getSignal_StructureRef() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='structureRef'" + * @generated + */ + ItemDefinition getStructureRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Signal#getStructureRef Structure Ref}' reference. + * + * + * @param value the new value of the 'Structure Ref' reference. + * @see #getStructureRef() + * @generated + */ + void setStructureRef(ItemDefinition value); + +} // Signal diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SignalEventDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SignalEventDefinition.java new file mode 100644 index 00000000000..d4eb68f4e63 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SignalEventDefinition.java @@ -0,0 +1,56 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Signal Event Definition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.SignalEventDefinition#getSignalRef Signal Ref}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getSignalEventDefinition() + * @model extendedMetaData="name='tSignalEventDefinition' kind='elementOnly'" + * @generated + */ +public interface SignalEventDefinition extends EventDefinition { + /** + * Returns the value of the 'Signal Ref' attribute. + * + * + * @return the value of the 'Signal Ref' attribute. + * @see #setSignalRef(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getSignalEventDefinition_SignalRef() + * @model dataType="org.eclipse.emf.ecore.xml.type.NCName" required="true" ordered="false" + * @generated + */ + String getSignalRef(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.SignalEventDefinition#getSignalRef Signal Ref}' attribute. + * + * + * @param value the new value of the 'Signal Ref' attribute. + * @see #getSignalRef() + * @generated + */ + void setSignalRef(String value); + +} // SignalEventDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/StandardLoopCharacteristics.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/StandardLoopCharacteristics.java new file mode 100644 index 00000000000..c8b6bc58bae --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/StandardLoopCharacteristics.java @@ -0,0 +1,106 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Standard Loop Characteristics'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.StandardLoopCharacteristics#getLoopCondition Loop Condition}
  • + *
  • {@link org.eclipse.bpmn2.StandardLoopCharacteristics#getLoopMaximum Loop Maximum}
  • + *
  • {@link org.eclipse.bpmn2.StandardLoopCharacteristics#isTestBefore Test Before}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getStandardLoopCharacteristics() + * @model extendedMetaData="name='tStandardLoopCharacteristics' kind='elementOnly'" + * @generated + */ +public interface StandardLoopCharacteristics extends LoopCharacteristics { + /** + * Returns the value of the 'Loop Condition' containment reference. + * + * + * @return the value of the 'Loop Condition' containment reference. + * @see #setLoopCondition(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getStandardLoopCharacteristics_LoopCondition() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='loopCondition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Expression getLoopCondition(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.StandardLoopCharacteristics#getLoopCondition Loop Condition}' containment reference. + * + * + * @param value the new value of the 'Loop Condition' containment reference. + * @see #getLoopCondition() + * @generated + */ + void setLoopCondition(Expression value); + + /** + * Returns the value of the 'Loop Maximum' containment reference. + * + * + * @return the value of the 'Loop Maximum' containment reference. + * @see #setLoopMaximum(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getStandardLoopCharacteristics_LoopMaximum() + * @model containment="true" ordered="false" + * extendedMetaData="kind='attribute' name='loopMaximum'" + * @generated + */ + Expression getLoopMaximum(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.StandardLoopCharacteristics#getLoopMaximum Loop Maximum}' containment reference. + * + * + * @param value the new value of the 'Loop Maximum' containment reference. + * @see #getLoopMaximum() + * @generated + */ + void setLoopMaximum(Expression value); + + /** + * Returns the value of the 'Test Before' attribute. + * The default value is "false". + * + * + * @return the value of the 'Test Before' attribute. + * @see #setTestBefore(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getStandardLoopCharacteristics_TestBefore() + * @model default="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='testBefore'" + * @generated + */ + boolean isTestBefore(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.StandardLoopCharacteristics#isTestBefore Test Before}' attribute. + * + * + * @param value the new value of the 'Test Before' attribute. + * @see #isTestBefore() + * @generated + */ + void setTestBefore(boolean value); + +} // StandardLoopCharacteristics diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/StartEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/StartEvent.java new file mode 100644 index 00000000000..6f482972708 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/StartEvent.java @@ -0,0 +1,58 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Start Event'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.StartEvent#isIsInterrupting Is Interrupting}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getStartEvent() + * @model extendedMetaData="name='tStartEvent' kind='elementOnly'" + * @generated + */ +public interface StartEvent extends CatchEvent { + /** + * Returns the value of the 'Is Interrupting' attribute. + * The default value is "true". + * + * + * @return the value of the 'Is Interrupting' attribute. + * @see #setIsInterrupting(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getStartEvent_IsInterrupting() + * @model default="true" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='isInterrupting'" + * @generated + */ + boolean isIsInterrupting(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.StartEvent#isIsInterrupting Is Interrupting}' attribute. + * + * + * @param value the new value of the 'Is Interrupting' attribute. + * @see #isIsInterrupting() + * @generated + */ + void setIsInterrupting(boolean value); + +} // StartEvent diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SubChoreography.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SubChoreography.java new file mode 100644 index 00000000000..c7bc1a4d828 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SubChoreography.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Sub Choreography'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.SubChoreography#getArtifacts Artifacts}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getSubChoreography() + * @model extendedMetaData="name='tSubChoreography' kind='elementOnly'" + * @generated + */ +public interface SubChoreography extends ChoreographyActivity, FlowElementsContainer { + /** + * Returns the value of the 'Artifacts' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Artifact}. + * + * + * @return the value of the 'Artifacts' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getSubChoreography_Artifacts() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='artifact' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#artifact'" + * @generated + */ + EList getArtifacts(); + +} // SubChoreography diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SubConversation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SubConversation.java new file mode 100644 index 00000000000..f56dc0c5de6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SubConversation.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Sub Conversation'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.SubConversation#getConversationNodes Conversation Nodes}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getSubConversation() + * @model extendedMetaData="name='tSubConversation' kind='elementOnly'" + * @generated + */ +public interface SubConversation extends ConversationNode { + /** + * Returns the value of the 'Conversation Nodes' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.ConversationNode}. + * + * + * @return the value of the 'Conversation Nodes' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getSubConversation_ConversationNodes() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='conversationNode' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#conversationNode'" + * @generated + */ + EList getConversationNodes(); + +} // SubConversation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SubProcess.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SubProcess.java new file mode 100644 index 00000000000..70b33f30ef9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/SubProcess.java @@ -0,0 +1,74 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Sub Process'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.SubProcess#getArtifacts Artifacts}
  • + *
  • {@link org.eclipse.bpmn2.SubProcess#isTriggeredByEvent Triggered By Event}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getSubProcess() + * @model extendedMetaData="name='tSubProcess' kind='elementOnly'" + * @generated + */ +public interface SubProcess extends Activity, FlowElementsContainer { + /** + * Returns the value of the 'Artifacts' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Artifact}. + * + * + * @return the value of the 'Artifacts' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getSubProcess_Artifacts() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='artifact' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#artifact'" + * @generated + */ + EList getArtifacts(); + + /** + * Returns the value of the 'Triggered By Event' attribute. + * The default value is "false". + * + * + * @return the value of the 'Triggered By Event' attribute. + * @see #setTriggeredByEvent(boolean) + * @see org.eclipse.bpmn2.Bpmn2Package#getSubProcess_TriggeredByEvent() + * @model default="false" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='triggeredByEvent'" + * @generated + */ + boolean isTriggeredByEvent(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.SubProcess#isTriggeredByEvent Triggered By Event}' attribute. + * + * + * @param value the new value of the 'Triggered By Event' attribute. + * @see #isTriggeredByEvent() + * @generated + */ + void setTriggeredByEvent(boolean value); + +} // SubProcess diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Task.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Task.java new file mode 100644 index 00000000000..2c9f5f8479f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Task.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Task'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getTask() + * @model extendedMetaData="name='tTask' kind='elementOnly'" + * @generated + */ +public interface Task extends Activity, InteractionNode { +} // Task diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/TerminateEventDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/TerminateEventDefinition.java new file mode 100644 index 00000000000..3606576c013 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/TerminateEventDefinition.java @@ -0,0 +1,28 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Terminate Event Definition'. + * + * + * + * @see org.eclipse.bpmn2.Bpmn2Package#getTerminateEventDefinition() + * @model extendedMetaData="name='tTerminateEventDefinition' kind='elementOnly'" + * @generated + */ +public interface TerminateEventDefinition extends EventDefinition { +} // TerminateEventDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/TextAnnotation.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/TextAnnotation.java new file mode 100644 index 00000000000..47d7374300f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/TextAnnotation.java @@ -0,0 +1,82 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Text Annotation'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.TextAnnotation#getText Text}
  • + *
  • {@link org.eclipse.bpmn2.TextAnnotation#getTextFormat Text Format}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getTextAnnotation() + * @model extendedMetaData="name='tTextAnnotation' kind='elementOnly'" + * @generated + */ +public interface TextAnnotation extends FlowNode { + /** + * Returns the value of the 'Text' attribute. + * + * + * @return the value of the 'Text' attribute. + * @see #setText(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getTextAnnotation_Text() + * @model required="true" ordered="false" + * extendedMetaData="kind='element' name='text' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + String getText(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.TextAnnotation#getText Text}' attribute. + * + * + * @param value the new value of the 'Text' attribute. + * @see #getText() + * @generated + */ + void setText(String value); + + /** + * Returns the value of the 'Text Format' attribute. + * The default value is "text/plain". + * + * + * @return the value of the 'Text Format' attribute. + * @see #setTextFormat(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getTextAnnotation_TextFormat() + * @model default="text/plain" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='textFormat'" + * @generated + */ + String getTextFormat(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.TextAnnotation#getTextFormat Text Format}' attribute. + * + * + * @param value the new value of the 'Text Format' attribute. + * @see #getTextFormat() + * @generated + */ + void setTextFormat(String value); + +} // TextAnnotation diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ThrowEvent.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ThrowEvent.java new file mode 100644 index 00000000000..ce662e56f82 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/ThrowEvent.java @@ -0,0 +1,116 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Throw Event'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.ThrowEvent#getDataInputs Data Inputs}
  • + *
  • {@link org.eclipse.bpmn2.ThrowEvent#getDataInputAssociation Data Input Association}
  • + *
  • {@link org.eclipse.bpmn2.ThrowEvent#getInputSet Input Set}
  • + *
  • {@link org.eclipse.bpmn2.ThrowEvent#getEventDefinitions Event Definitions}
  • + *
  • {@link org.eclipse.bpmn2.ThrowEvent#getEventDefinitionRefs Event Definition Refs}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getThrowEvent() + * @model abstract="true" + * extendedMetaData="name='tThrowEvent' kind='elementOnly'" + * @generated + */ +public interface ThrowEvent extends Event { + /** + * Returns the value of the 'Data Inputs' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataInput}. + * + * + * @return the value of the 'Data Inputs' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getThrowEvent_DataInputs() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='dataInput' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getDataInputs(); + + /** + * Returns the value of the 'Data Input Association' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.DataInputAssociation}. + * + * + * @return the value of the 'Data Input Association' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getThrowEvent_DataInputAssociation() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='dataInputAssociation' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getDataInputAssociation(); + + /** + * Returns the value of the 'Input Set' containment reference. + * + * + * @return the value of the 'Input Set' containment reference. + * @see #setInputSet(InputSet) + * @see org.eclipse.bpmn2.Bpmn2Package#getThrowEvent_InputSet() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='inputSet' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + InputSet getInputSet(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.ThrowEvent#getInputSet Input Set}' containment reference. + * + * + * @param value the new value of the 'Input Set' containment reference. + * @see #getInputSet() + * @generated + */ + void setInputSet(InputSet value); + + /** + * Returns the value of the 'Event Definitions' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.EventDefinition}. + * + * + * @return the value of the 'Event Definitions' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getThrowEvent_EventDefinitions() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='eventDefinition' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL' group='http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition'" + * @generated + */ + EList getEventDefinitions(); + + /** + * Returns the value of the 'Event Definition Refs' reference list. + * The list contents are of type {@link org.eclipse.bpmn2.EventDefinition}. + * + * + * @return the value of the 'Event Definition Refs' reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getThrowEvent_EventDefinitionRefs() + * @model ordered="false" + * extendedMetaData="kind='element' name='eventDefinitionRef' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getEventDefinitionRefs(); + +} // ThrowEvent diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/TimerEventDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/TimerEventDefinition.java new file mode 100644 index 00000000000..26f10fad392 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/TimerEventDefinition.java @@ -0,0 +1,105 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Timer Event Definition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.TimerEventDefinition#getTimeDate Time Date}
  • + *
  • {@link org.eclipse.bpmn2.TimerEventDefinition#getTimeDuration Time Duration}
  • + *
  • {@link org.eclipse.bpmn2.TimerEventDefinition#getTimeCycle Time Cycle}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getTimerEventDefinition() + * @model extendedMetaData="name='tTimerEventDefinition' kind='elementOnly'" + * @generated + */ +public interface TimerEventDefinition extends EventDefinition { + /** + * Returns the value of the 'Time Date' containment reference. + * + * + * @return the value of the 'Time Date' containment reference. + * @see #setTimeDate(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getTimerEventDefinition_TimeDate() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='timeDate' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Expression getTimeDate(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.TimerEventDefinition#getTimeDate Time Date}' containment reference. + * + * + * @param value the new value of the 'Time Date' containment reference. + * @see #getTimeDate() + * @generated + */ + void setTimeDate(Expression value); + + /** + * Returns the value of the 'Time Duration' containment reference. + * + * + * @return the value of the 'Time Duration' containment reference. + * @see #setTimeDuration(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getTimerEventDefinition_TimeDuration() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='timeDuration' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Expression getTimeDuration(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.TimerEventDefinition#getTimeDuration Time Duration}' containment reference. + * + * + * @param value the new value of the 'Time Duration' containment reference. + * @see #getTimeDuration() + * @generated + */ + void setTimeDuration(Expression value); + + /** + * Returns the value of the 'Time Cycle' containment reference. + * + * + * @return the value of the 'Time Cycle' containment reference. + * @see #setTimeCycle(Expression) + * @see org.eclipse.bpmn2.Bpmn2Package#getTimerEventDefinition_TimeCycle() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='timeCycle' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + Expression getTimeCycle(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.TimerEventDefinition#getTimeCycle Time Cycle}' containment reference. + * + * + * @param value the new value of the 'Time Cycle' containment reference. + * @see #getTimeCycle() + * @generated + */ + void setTimeCycle(Expression value); + +} // TimerEventDefinition diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Transaction.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Transaction.java new file mode 100644 index 00000000000..8948cbc3901 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Transaction.java @@ -0,0 +1,80 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +/** + * + * A representation of the model object 'Transaction'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.Transaction#getProtocol Protocol}
  • + *
  • {@link org.eclipse.bpmn2.Transaction#getMethod Method}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getTransaction() + * @model extendedMetaData="name='tTransaction' kind='elementOnly'" + * @generated + */ +public interface Transaction extends SubProcess { + /** + * Returns the value of the 'Protocol' attribute. + * + * + * @return the value of the 'Protocol' attribute. + * @see #setProtocol(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getTransaction_Protocol() + * @model ordered="false" + * @generated + */ + String getProtocol(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Transaction#getProtocol Protocol}' attribute. + * + * + * @param value the new value of the 'Protocol' attribute. + * @see #getProtocol() + * @generated + */ + void setProtocol(String value); + + /** + * Returns the value of the 'Method' attribute. + * + * + * @return the value of the 'Method' attribute. + * @see #setMethod(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getTransaction_Method() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='method'" + * @generated + */ + String getMethod(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.Transaction#getMethod Method}' attribute. + * + * + * @param value the new value of the 'Method' attribute. + * @see #getMethod() + * @generated + */ + void setMethod(String value); + +} // Transaction diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/UserTask.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/UserTask.java new file mode 100644 index 00000000000..622baa4d6bb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/UserTask.java @@ -0,0 +1,73 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'User Task'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.UserTask#getRenderings Renderings}
  • + *
  • {@link org.eclipse.bpmn2.UserTask#getImplementation Implementation}
  • + *
+ * + * @see org.eclipse.bpmn2.Bpmn2Package#getUserTask() + * @model extendedMetaData="name='tUserTask' kind='elementOnly'" + * @generated + */ +public interface UserTask extends Task { + /** + * Returns the value of the 'Renderings' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.Rendering}. + * + * + * @return the value of the 'Renderings' containment reference list. + * @see org.eclipse.bpmn2.Bpmn2Package#getUserTask_Renderings() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='rendering' namespace='http://www.omg.org/spec/BPMN/20100524/MODEL'" + * @generated + */ + EList getRenderings(); + + /** + * Returns the value of the 'Implementation' attribute. + * + * + * @return the value of the 'Implementation' attribute. + * @see #setImplementation(String) + * @see org.eclipse.bpmn2.Bpmn2Package#getUserTask_Implementation() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='implementation'" + * @generated + */ + String getImplementation(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.UserTask#getImplementation Implementation}' attribute. + * + * + * @param value the new value of the 'Implementation' attribute. + * @see #getImplementation() + * @generated + */ + void setImplementation(String value); + +} // UserTask diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNDiagram.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNDiagram.java new file mode 100644 index 00000000000..3b496f5e4e9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNDiagram.java @@ -0,0 +1,75 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di; + +import org.eclipse.dd.di.Diagram; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'BPMN Diagram'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.BPMNDiagram#getPlane Plane}
  • + *
  • {@link org.eclipse.bpmn2.di.BPMNDiagram#getLabelStyle Label Style}
  • + *
+ * + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNDiagram() + * @model extendedMetaData="name='BPMNDiagram' kind='elementOnly'" + * @generated + */ +public interface BPMNDiagram extends Diagram { + /** + * Returns the value of the 'Plane' containment reference. + * + * + * @return the value of the 'Plane' containment reference. + * @see #setPlane(BPMNPlane) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNDiagram_Plane() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='BPMNPlane' namespace='http://www.omg.org/spec/BPMN/20100524/DI'" + * @generated + */ + BPMNPlane getPlane(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNDiagram#getPlane Plane}' containment reference. + * + * + * @param value the new value of the 'Plane' containment reference. + * @see #getPlane() + * @generated + */ + void setPlane(BPMNPlane value); + + /** + * Returns the value of the 'Label Style' containment reference list. + * The list contents are of type {@link org.eclipse.bpmn2.di.BPMNLabelStyle}. + * + * + * @return the value of the 'Label Style' containment reference list. + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNDiagram_LabelStyle() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='BPMNLabelStyle' namespace='http://www.omg.org/spec/BPMN/20100524/DI'" + * @generated + */ + EList getLabelStyle(); + +} // BPMNDiagram diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNEdge.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNEdge.java new file mode 100644 index 00000000000..43cb83ac453 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNEdge.java @@ -0,0 +1,161 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di; + +import org.eclipse.bpmn2.BaseElement; + +import org.eclipse.dd.di.DiagramElement; +import org.eclipse.dd.di.LabeledEdge; + +/** + * + * A representation of the model object 'BPMN Edge'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.BPMNEdge#getLabel Label}
  • + *
  • {@link org.eclipse.bpmn2.di.BPMNEdge#getBpmnElement Bpmn Element}
  • + *
  • {@link org.eclipse.bpmn2.di.BPMNEdge#getMessageVisibleKind Message Visible Kind}
  • + *
  • {@link org.eclipse.bpmn2.di.BPMNEdge#getSourceElement Source Element}
  • + *
  • {@link org.eclipse.bpmn2.di.BPMNEdge#getTargetElement Target Element}
  • + *
+ * + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNEdge() + * @model extendedMetaData="name='BPMNEdge' kind='elementOnly'" + * @generated + */ +public interface BPMNEdge extends LabeledEdge { + /** + * Returns the value of the 'Label' containment reference. + * + * + * @return the value of the 'Label' containment reference. + * @see #setLabel(BPMNLabel) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNEdge_Label() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='BPMNLabel' namespace='http://www.omg.org/spec/BPMN/20100524/DI'" + * @generated + */ + BPMNLabel getLabel(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNEdge#getLabel Label}' containment reference. + * + * + * @param value the new value of the 'Label' containment reference. + * @see #getLabel() + * @generated + */ + void setLabel(BPMNLabel value); + + /** + * Returns the value of the 'Bpmn Element' reference. + * + * + * @return the value of the 'Bpmn Element' reference. + * @see #setBpmnElement(BaseElement) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNEdge_BpmnElement() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='bpmnElement'" + * @generated + */ + BaseElement getBpmnElement(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNEdge#getBpmnElement Bpmn Element}' reference. + * + * + * @param value the new value of the 'Bpmn Element' reference. + * @see #getBpmnElement() + * @generated + */ + void setBpmnElement(BaseElement value); + + /** + * Returns the value of the 'Message Visible Kind' attribute. + * The literals are from the enumeration {@link org.eclipse.bpmn2.di.MessageVisibleKind}. + * + * + * @return the value of the 'Message Visible Kind' attribute. + * @see org.eclipse.bpmn2.di.MessageVisibleKind + * @see #setMessageVisibleKind(MessageVisibleKind) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNEdge_MessageVisibleKind() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='messageVisibleKind'" + * @generated + */ + MessageVisibleKind getMessageVisibleKind(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNEdge#getMessageVisibleKind Message Visible Kind}' attribute. + * + * + * @param value the new value of the 'Message Visible Kind' attribute. + * @see org.eclipse.bpmn2.di.MessageVisibleKind + * @see #getMessageVisibleKind() + * @generated + */ + void setMessageVisibleKind(MessageVisibleKind value); + + /** + * Returns the value of the 'Source Element' reference. + * + * + * @return the value of the 'Source Element' reference. + * @see #setSourceElement(DiagramElement) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNEdge_SourceElement() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='sourceElement'" + * @generated + */ + DiagramElement getSourceElement(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNEdge#getSourceElement Source Element}' reference. + * + * + * @param value the new value of the 'Source Element' reference. + * @see #getSourceElement() + * @generated + */ + void setSourceElement(DiagramElement value); + + /** + * Returns the value of the 'Target Element' reference. + * + * + * @return the value of the 'Target Element' reference. + * @see #setTargetElement(DiagramElement) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNEdge_TargetElement() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='targetElement'" + * @generated + */ + DiagramElement getTargetElement(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNEdge#getTargetElement Target Element}' reference. + * + * + * @param value the new value of the 'Target Element' reference. + * @see #getTargetElement() + * @generated + */ + void setTargetElement(DiagramElement value); + +} // BPMNEdge diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNLabel.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNLabel.java new file mode 100644 index 00000000000..5a6374957c3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNLabel.java @@ -0,0 +1,59 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di; + +import org.eclipse.dd.di.Label; + +/** + * + * A representation of the model object 'BPMN Label'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.BPMNLabel#getLabelStyle Label Style}
  • + *
+ * + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNLabel() + * @model extendedMetaData="name='BPMNLabel' kind='elementOnly'" + * @generated + */ +public interface BPMNLabel extends Label { + /** + * Returns the value of the 'Label Style' reference. + * + * + * @return the value of the 'Label Style' reference. + * @see #setLabelStyle(BPMNLabelStyle) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNLabel_LabelStyle() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='labelStyle'" + * @generated + */ + BPMNLabelStyle getLabelStyle(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNLabel#getLabelStyle Label Style}' reference. + * + * + * @param value the new value of the 'Label Style' reference. + * @see #getLabelStyle() + * @generated + */ + void setLabelStyle(BPMNLabelStyle value); + +} // BPMNLabel diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNLabelStyle.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNLabelStyle.java new file mode 100644 index 00000000000..1c18c2e8621 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNLabelStyle.java @@ -0,0 +1,61 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di; + +import org.eclipse.dd.dc.Font; + +import org.eclipse.dd.di.Style; + +/** + * + * A representation of the model object 'BPMN Label Style'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.BPMNLabelStyle#getFont Font}
  • + *
+ * + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNLabelStyle() + * @model extendedMetaData="name='BPMNLabelStyle' kind='elementOnly'" + * @generated + */ +public interface BPMNLabelStyle extends Style { + /** + * Returns the value of the 'Font' containment reference. + * + * + * @return the value of the 'Font' containment reference. + * @see #setFont(Font) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNLabelStyle_Font() + * @model containment="true" required="true" ordered="false" + * extendedMetaData="kind='element' name='Font' namespace='http://www.omg.org/spec/DD/20100524/DC'" + * @generated + */ + Font getFont(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNLabelStyle#getFont Font}' containment reference. + * + * + * @param value the new value of the 'Font' containment reference. + * @see #getFont() + * @generated + */ + void setFont(Font value); + +} // BPMNLabelStyle diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNPlane.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNPlane.java new file mode 100644 index 00000000000..4d3b29e19f8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNPlane.java @@ -0,0 +1,61 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di; + +import org.eclipse.bpmn2.BaseElement; + +import org.eclipse.dd.di.Plane; + +/** + * + * A representation of the model object 'BPMN Plane'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.BPMNPlane#getBpmnElement Bpmn Element}
  • + *
+ * + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNPlane() + * @model extendedMetaData="name='BPMNPlane' kind='elementOnly'" + * @generated + */ +public interface BPMNPlane extends Plane { + /** + * Returns the value of the 'Bpmn Element' reference. + * + * + * @return the value of the 'Bpmn Element' reference. + * @see #setBpmnElement(BaseElement) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNPlane_BpmnElement() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='bpmnElement'" + * @generated + */ + BaseElement getBpmnElement(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNPlane#getBpmnElement Bpmn Element}' reference. + * + * + * @param value the new value of the 'Bpmn Element' reference. + * @see #getBpmnElement() + * @generated + */ + void setBpmnElement(BaseElement value); + +} // BPMNPlane diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNShape.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNShape.java new file mode 100644 index 00000000000..f72ad8b6a0b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BPMNShape.java @@ -0,0 +1,232 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di; + +import org.eclipse.bpmn2.BaseElement; + +import org.eclipse.dd.di.LabeledShape; + +/** + * + * A representation of the model object 'BPMN Shape'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.BPMNShape#getLabel Label}
  • + *
  • {@link org.eclipse.bpmn2.di.BPMNShape#getBpmnElement Bpmn Element}
  • + *
  • {@link org.eclipse.bpmn2.di.BPMNShape#getChoreographyActivityShape Choreography Activity Shape}
  • + *
  • {@link org.eclipse.bpmn2.di.BPMNShape#isIsExpanded Is Expanded}
  • + *
  • {@link org.eclipse.bpmn2.di.BPMNShape#isIsHorizontal Is Horizontal}
  • + *
  • {@link org.eclipse.bpmn2.di.BPMNShape#isIsMarkerVisible Is Marker Visible}
  • + *
  • {@link org.eclipse.bpmn2.di.BPMNShape#isIsMessageVisible Is Message Visible}
  • + *
  • {@link org.eclipse.bpmn2.di.BPMNShape#getParticipantBandKind Participant Band Kind}
  • + *
+ * + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNShape() + * @model extendedMetaData="name='BPMNShape' kind='elementOnly'" + * @generated + */ +public interface BPMNShape extends LabeledShape { + /** + * Returns the value of the 'Label' containment reference. + * + * + * @return the value of the 'Label' containment reference. + * @see #setLabel(BPMNLabel) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNShape_Label() + * @model containment="true" ordered="false" + * extendedMetaData="kind='element' name='BPMNLabel' namespace='http://www.omg.org/spec/BPMN/20100524/DI'" + * @generated + */ + BPMNLabel getLabel(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNShape#getLabel Label}' containment reference. + * + * + * @param value the new value of the 'Label' containment reference. + * @see #getLabel() + * @generated + */ + void setLabel(BPMNLabel value); + + /** + * Returns the value of the 'Bpmn Element' reference. + * + * + * @return the value of the 'Bpmn Element' reference. + * @see #setBpmnElement(BaseElement) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNShape_BpmnElement() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='bpmnElement'" + * @generated + */ + BaseElement getBpmnElement(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNShape#getBpmnElement Bpmn Element}' reference. + * + * + * @param value the new value of the 'Bpmn Element' reference. + * @see #getBpmnElement() + * @generated + */ + void setBpmnElement(BaseElement value); + + /** + * Returns the value of the 'Choreography Activity Shape' reference. + * + * + * @return the value of the 'Choreography Activity Shape' reference. + * @see #setChoreographyActivityShape(BPMNShape) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNShape_ChoreographyActivityShape() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='choreographyActivityShape'" + * @generated + */ + BPMNShape getChoreographyActivityShape(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNShape#getChoreographyActivityShape Choreography Activity Shape}' reference. + * + * + * @param value the new value of the 'Choreography Activity Shape' reference. + * @see #getChoreographyActivityShape() + * @generated + */ + void setChoreographyActivityShape(BPMNShape value); + + /** + * Returns the value of the 'Is Expanded' attribute. + * + * + * @return the value of the 'Is Expanded' attribute. + * @see #setIsExpanded(boolean) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNShape_IsExpanded() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='isExpanded'" + * @generated + */ + boolean isIsExpanded(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNShape#isIsExpanded Is Expanded}' attribute. + * + * + * @param value the new value of the 'Is Expanded' attribute. + * @see #isIsExpanded() + * @generated + */ + void setIsExpanded(boolean value); + + /** + * Returns the value of the 'Is Horizontal' attribute. + * + * + * @return the value of the 'Is Horizontal' attribute. + * @see #setIsHorizontal(boolean) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNShape_IsHorizontal() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='isHorizontal'" + * @generated + */ + boolean isIsHorizontal(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNShape#isIsHorizontal Is Horizontal}' attribute. + * + * + * @param value the new value of the 'Is Horizontal' attribute. + * @see #isIsHorizontal() + * @generated + */ + void setIsHorizontal(boolean value); + + /** + * Returns the value of the 'Is Marker Visible' attribute. + * + * + * @return the value of the 'Is Marker Visible' attribute. + * @see #setIsMarkerVisible(boolean) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNShape_IsMarkerVisible() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='isMarkerVisible'" + * @generated + */ + boolean isIsMarkerVisible(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNShape#isIsMarkerVisible Is Marker Visible}' attribute. + * + * + * @param value the new value of the 'Is Marker Visible' attribute. + * @see #isIsMarkerVisible() + * @generated + */ + void setIsMarkerVisible(boolean value); + + /** + * Returns the value of the 'Is Message Visible' attribute. + * + * + * @return the value of the 'Is Message Visible' attribute. + * @see #setIsMessageVisible(boolean) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNShape_IsMessageVisible() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='isMessageVisible'" + * @generated + */ + boolean isIsMessageVisible(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNShape#isIsMessageVisible Is Message Visible}' attribute. + * + * + * @param value the new value of the 'Is Message Visible' attribute. + * @see #isIsMessageVisible() + * @generated + */ + void setIsMessageVisible(boolean value); + + /** + * Returns the value of the 'Participant Band Kind' attribute. + * The literals are from the enumeration {@link org.eclipse.bpmn2.di.ParticipantBandKind}. + * + * + * @return the value of the 'Participant Band Kind' attribute. + * @see org.eclipse.bpmn2.di.ParticipantBandKind + * @see #setParticipantBandKind(ParticipantBandKind) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getBPMNShape_ParticipantBandKind() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='participantBandKind'" + * @generated + */ + ParticipantBandKind getParticipantBandKind(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.BPMNShape#getParticipantBandKind Participant Band Kind}' attribute. + * + * + * @param value the new value of the 'Participant Band Kind' attribute. + * @see org.eclipse.bpmn2.di.ParticipantBandKind + * @see #getParticipantBandKind() + * @generated + */ + void setParticipantBandKind(ParticipantBandKind value); + +} // BPMNShape diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BpmnDiFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BpmnDiFactory.java new file mode 100644 index 00000000000..302c900cef2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BpmnDiFactory.java @@ -0,0 +1,108 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see org.eclipse.bpmn2.di.BpmnDiPackage + * @generated + */ +public interface BpmnDiFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + BpmnDiFactory eINSTANCE = org.eclipse.bpmn2.di.impl.BpmnDiFactoryImpl.init(); + + /** + * Returns a new object of class 'Document Root'. + * + * + * @return a new object of class 'Document Root'. + * @generated + */ + DocumentRoot createDocumentRoot(); + + /** + * Returns a new object of class 'BPMN Diagram'. + * + * + * @return a new object of class 'BPMN Diagram'. + * @generated + */ + BPMNDiagram createBPMNDiagram(); + + /** + * Returns a new object of class 'BPMN Edge'. + * + * + * @return a new object of class 'BPMN Edge'. + * @generated + */ + BPMNEdge createBPMNEdge(); + + /** + * Returns a new object of class 'BPMN Label'. + * + * + * @return a new object of class 'BPMN Label'. + * @generated + */ + BPMNLabel createBPMNLabel(); + + /** + * Returns a new object of class 'BPMN Label Style'. + * + * + * @return a new object of class 'BPMN Label Style'. + * @generated + */ + BPMNLabelStyle createBPMNLabelStyle(); + + /** + * Returns a new object of class 'BPMN Plane'. + * + * + * @return a new object of class 'BPMN Plane'. + * @generated + */ + BPMNPlane createBPMNPlane(); + + /** + * Returns a new object of class 'BPMN Shape'. + * + * + * @return a new object of class 'BPMN Shape'. + * @generated + */ + BPMNShape createBPMNShape(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + BpmnDiPackage getBpmnDiPackage(); + +} //BpmnDiFactory diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BpmnDiPackage.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BpmnDiPackage.java new file mode 100644 index 00000000000..57a09356b04 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/BpmnDiPackage.java @@ -0,0 +1,1537 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di; + +import org.eclipse.dd.di.DiPackage; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see org.eclipse.bpmn2.di.BpmnDiFactory + * @model kind="package" + * @generated + */ +public interface BpmnDiPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "di"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.omg.org/spec/BPMN/20100524/DI-XMI"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "bpmndi"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + BpmnDiPackage eINSTANCE = org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.di.impl.DocumentRootImpl Document Root}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.DocumentRootImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getDocumentRoot() + * @generated + */ + int DOCUMENT_ROOT = 0; + + /** + * The feature id for the 'Mixed' attribute list. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__MIXED = 0; + + /** + * The feature id for the 'XMLNS Prefix Map' map. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1; + + /** + * The feature id for the 'XSI Schema Location' map. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2; + + /** + * The feature id for the 'BPMN Diagram' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BPMN_DIAGRAM = 3; + + /** + * The feature id for the 'BPMN Edge' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BPMN_EDGE = 4; + + /** + * The feature id for the 'BPMN Label' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BPMN_LABEL = 5; + + /** + * The feature id for the 'BPMN Label Style' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BPMN_LABEL_STYLE = 6; + + /** + * The feature id for the 'BPMN Plane' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BPMN_PLANE = 7; + + /** + * The feature id for the 'BPMN Shape' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BPMN_SHAPE = 8; + + /** + * The number of structural features of the 'Document Root' class. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT_FEATURE_COUNT = 9; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.di.impl.BPMNDiagramImpl BPMN Diagram}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.BPMNDiagramImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getBPMNDiagram() + * @generated + */ + int BPMN_DIAGRAM = 1; + + /** + * The feature id for the 'Documentation' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_DIAGRAM__DOCUMENTATION = DiPackage.DIAGRAM__DOCUMENTATION; + + /** + * The feature id for the 'Owned Style' reference list. + * + * + * @generated + * @ordered + */ + int BPMN_DIAGRAM__OWNED_STYLE = DiPackage.DIAGRAM__OWNED_STYLE; + + /** + * The feature id for the 'Root Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_DIAGRAM__ROOT_ELEMENT = DiPackage.DIAGRAM__ROOT_ELEMENT; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_DIAGRAM__ID = DiPackage.DIAGRAM__ID; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_DIAGRAM__NAME = DiPackage.DIAGRAM__NAME; + + /** + * The feature id for the 'Resolution' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_DIAGRAM__RESOLUTION = DiPackage.DIAGRAM__RESOLUTION; + + /** + * The feature id for the 'Plane' containment reference. + * + * + * @generated + * @ordered + */ + int BPMN_DIAGRAM__PLANE = DiPackage.DIAGRAM_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Label Style' containment reference list. + * + * + * @generated + * @ordered + */ + int BPMN_DIAGRAM__LABEL_STYLE = DiPackage.DIAGRAM_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'BPMN Diagram' class. + * + * + * @generated + * @ordered + */ + int BPMN_DIAGRAM_FEATURE_COUNT = DiPackage.DIAGRAM_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.di.impl.BPMNEdgeImpl BPMN Edge}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.BPMNEdgeImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getBPMNEdge() + * @generated + */ + int BPMN_EDGE = 2; + + /** + * The feature id for the 'Owning Diagram' reference. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__OWNING_DIAGRAM = DiPackage.LABELED_EDGE__OWNING_DIAGRAM; + + /** + * The feature id for the 'Owning Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__OWNING_ELEMENT = DiPackage.LABELED_EDGE__OWNING_ELEMENT; + + /** + * The feature id for the 'Owned Element' reference list. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__OWNED_ELEMENT = DiPackage.LABELED_EDGE__OWNED_ELEMENT; + + /** + * The feature id for the 'Model Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__MODEL_ELEMENT = DiPackage.LABELED_EDGE__MODEL_ELEMENT; + + /** + * The feature id for the 'Style' reference. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__STYLE = DiPackage.LABELED_EDGE__STYLE; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__ID = DiPackage.LABELED_EDGE__ID; + + /** + * The feature id for the 'Source' reference. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__SOURCE = DiPackage.LABELED_EDGE__SOURCE; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__TARGET = DiPackage.LABELED_EDGE__TARGET; + + /** + * The feature id for the 'Waypoint' containment reference list. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__WAYPOINT = DiPackage.LABELED_EDGE__WAYPOINT; + + /** + * The feature id for the 'Owned Label' reference list. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__OWNED_LABEL = DiPackage.LABELED_EDGE__OWNED_LABEL; + + /** + * The feature id for the 'Label' containment reference. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__LABEL = DiPackage.LABELED_EDGE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Bpmn Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__BPMN_ELEMENT = DiPackage.LABELED_EDGE_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Message Visible Kind' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__MESSAGE_VISIBLE_KIND = DiPackage.LABELED_EDGE_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Source Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__SOURCE_ELEMENT = DiPackage.LABELED_EDGE_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Target Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE__TARGET_ELEMENT = DiPackage.LABELED_EDGE_FEATURE_COUNT + 4; + + /** + * The number of structural features of the 'BPMN Edge' class. + * + * + * @generated + * @ordered + */ + int BPMN_EDGE_FEATURE_COUNT = DiPackage.LABELED_EDGE_FEATURE_COUNT + 5; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.di.impl.BPMNLabelImpl BPMN Label}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.BPMNLabelImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getBPMNLabel() + * @generated + */ + int BPMN_LABEL = 3; + + /** + * The feature id for the 'Owning Diagram' reference. + * + * + * @generated + * @ordered + */ + int BPMN_LABEL__OWNING_DIAGRAM = DiPackage.LABEL__OWNING_DIAGRAM; + + /** + * The feature id for the 'Owning Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_LABEL__OWNING_ELEMENT = DiPackage.LABEL__OWNING_ELEMENT; + + /** + * The feature id for the 'Owned Element' reference list. + * + * + * @generated + * @ordered + */ + int BPMN_LABEL__OWNED_ELEMENT = DiPackage.LABEL__OWNED_ELEMENT; + + /** + * The feature id for the 'Model Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_LABEL__MODEL_ELEMENT = DiPackage.LABEL__MODEL_ELEMENT; + + /** + * The feature id for the 'Style' reference. + * + * + * @generated + * @ordered + */ + int BPMN_LABEL__STYLE = DiPackage.LABEL__STYLE; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_LABEL__ID = DiPackage.LABEL__ID; + + /** + * The feature id for the 'Bounds' containment reference. + * + * + * @generated + * @ordered + */ + int BPMN_LABEL__BOUNDS = DiPackage.LABEL__BOUNDS; + + /** + * The feature id for the 'Label Style' reference. + * + * + * @generated + * @ordered + */ + int BPMN_LABEL__LABEL_STYLE = DiPackage.LABEL_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'BPMN Label' class. + * + * + * @generated + * @ordered + */ + int BPMN_LABEL_FEATURE_COUNT = DiPackage.LABEL_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.di.impl.BPMNLabelStyleImpl BPMN Label Style}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.BPMNLabelStyleImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getBPMNLabelStyle() + * @generated + */ + int BPMN_LABEL_STYLE = 4; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_LABEL_STYLE__ID = DiPackage.STYLE__ID; + + /** + * The feature id for the 'Font' containment reference. + * + * + * @generated + * @ordered + */ + int BPMN_LABEL_STYLE__FONT = DiPackage.STYLE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'BPMN Label Style' class. + * + * + * @generated + * @ordered + */ + int BPMN_LABEL_STYLE_FEATURE_COUNT = DiPackage.STYLE_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.di.impl.BPMNPlaneImpl BPMN Plane}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.BPMNPlaneImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getBPMNPlane() + * @generated + */ + int BPMN_PLANE = 5; + + /** + * The feature id for the 'Owning Diagram' reference. + * + * + * @generated + * @ordered + */ + int BPMN_PLANE__OWNING_DIAGRAM = DiPackage.PLANE__OWNING_DIAGRAM; + + /** + * The feature id for the 'Owning Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_PLANE__OWNING_ELEMENT = DiPackage.PLANE__OWNING_ELEMENT; + + /** + * The feature id for the 'Owned Element' reference list. + * + * + * @generated + * @ordered + */ + int BPMN_PLANE__OWNED_ELEMENT = DiPackage.PLANE__OWNED_ELEMENT; + + /** + * The feature id for the 'Model Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_PLANE__MODEL_ELEMENT = DiPackage.PLANE__MODEL_ELEMENT; + + /** + * The feature id for the 'Style' reference. + * + * + * @generated + * @ordered + */ + int BPMN_PLANE__STYLE = DiPackage.PLANE__STYLE; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_PLANE__ID = DiPackage.PLANE__ID; + + /** + * The feature id for the 'Plane Element' containment reference list. + * + * + * @generated + * @ordered + */ + int BPMN_PLANE__PLANE_ELEMENT = DiPackage.PLANE__PLANE_ELEMENT; + + /** + * The feature id for the 'Bpmn Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_PLANE__BPMN_ELEMENT = DiPackage.PLANE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'BPMN Plane' class. + * + * + * @generated + * @ordered + */ + int BPMN_PLANE_FEATURE_COUNT = DiPackage.PLANE_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.di.impl.BPMNShapeImpl BPMN Shape}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.BPMNShapeImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getBPMNShape() + * @generated + */ + int BPMN_SHAPE = 6; + + /** + * The feature id for the 'Owning Diagram' reference. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__OWNING_DIAGRAM = DiPackage.LABELED_SHAPE__OWNING_DIAGRAM; + + /** + * The feature id for the 'Owning Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__OWNING_ELEMENT = DiPackage.LABELED_SHAPE__OWNING_ELEMENT; + + /** + * The feature id for the 'Owned Element' reference list. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__OWNED_ELEMENT = DiPackage.LABELED_SHAPE__OWNED_ELEMENT; + + /** + * The feature id for the 'Model Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__MODEL_ELEMENT = DiPackage.LABELED_SHAPE__MODEL_ELEMENT; + + /** + * The feature id for the 'Style' reference. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__STYLE = DiPackage.LABELED_SHAPE__STYLE; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__ID = DiPackage.LABELED_SHAPE__ID; + + /** + * The feature id for the 'Bounds' containment reference. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__BOUNDS = DiPackage.LABELED_SHAPE__BOUNDS; + + /** + * The feature id for the 'Owned Label' reference list. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__OWNED_LABEL = DiPackage.LABELED_SHAPE__OWNED_LABEL; + + /** + * The feature id for the 'Label' containment reference. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__LABEL = DiPackage.LABELED_SHAPE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Bpmn Element' reference. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__BPMN_ELEMENT = DiPackage.LABELED_SHAPE_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Choreography Activity Shape' reference. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__CHOREOGRAPHY_ACTIVITY_SHAPE = DiPackage.LABELED_SHAPE_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Is Expanded' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__IS_EXPANDED = DiPackage.LABELED_SHAPE_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Is Horizontal' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__IS_HORIZONTAL = DiPackage.LABELED_SHAPE_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Is Marker Visible' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__IS_MARKER_VISIBLE = DiPackage.LABELED_SHAPE_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Is Message Visible' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__IS_MESSAGE_VISIBLE = DiPackage.LABELED_SHAPE_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Participant Band Kind' attribute. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE__PARTICIPANT_BAND_KIND = DiPackage.LABELED_SHAPE_FEATURE_COUNT + 7; + + /** + * The number of structural features of the 'BPMN Shape' class. + * + * + * @generated + * @ordered + */ + int BPMN_SHAPE_FEATURE_COUNT = DiPackage.LABELED_SHAPE_FEATURE_COUNT + 8; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.di.MessageVisibleKind Message Visible Kind}' enum. + * + * + * @see org.eclipse.bpmn2.di.MessageVisibleKind + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getMessageVisibleKind() + * @generated + */ + int MESSAGE_VISIBLE_KIND = 7; + + /** + * The meta object id for the '{@link org.eclipse.bpmn2.di.ParticipantBandKind Participant Band Kind}' enum. + * + * + * @see org.eclipse.bpmn2.di.ParticipantBandKind + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getParticipantBandKind() + * @generated + */ + int PARTICIPANT_BAND_KIND = 8; + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.di.DocumentRoot Document Root}'. + * + * + * @return the meta object for class 'Document Root'. + * @see org.eclipse.bpmn2.di.DocumentRoot + * @generated + */ + EClass getDocumentRoot(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.bpmn2.di.DocumentRoot#getMixed Mixed}'. + * + * + * @return the meta object for the attribute list 'Mixed'. + * @see org.eclipse.bpmn2.di.DocumentRoot#getMixed() + * @see #getDocumentRoot() + * @generated + */ + EAttribute getDocumentRoot_Mixed(); + + /** + * Returns the meta object for the map '{@link org.eclipse.bpmn2.di.DocumentRoot#getXMLNSPrefixMap XMLNS Prefix Map}'. + * + * + * @return the meta object for the map 'XMLNS Prefix Map'. + * @see org.eclipse.bpmn2.di.DocumentRoot#getXMLNSPrefixMap() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_XMLNSPrefixMap(); + + /** + * Returns the meta object for the map '{@link org.eclipse.bpmn2.di.DocumentRoot#getXSISchemaLocation XSI Schema Location}'. + * + * + * @return the meta object for the map 'XSI Schema Location'. + * @see org.eclipse.bpmn2.di.DocumentRoot#getXSISchemaLocation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_XSISchemaLocation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNDiagram BPMN Diagram}'. + * + * + * @return the meta object for the containment reference 'BPMN Diagram'. + * @see org.eclipse.bpmn2.di.DocumentRoot#getBPMNDiagram() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BPMNDiagram(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNEdge BPMN Edge}'. + * + * + * @return the meta object for the containment reference 'BPMN Edge'. + * @see org.eclipse.bpmn2.di.DocumentRoot#getBPMNEdge() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BPMNEdge(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNLabel BPMN Label}'. + * + * + * @return the meta object for the containment reference 'BPMN Label'. + * @see org.eclipse.bpmn2.di.DocumentRoot#getBPMNLabel() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BPMNLabel(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNLabelStyle BPMN Label Style}'. + * + * + * @return the meta object for the containment reference 'BPMN Label Style'. + * @see org.eclipse.bpmn2.di.DocumentRoot#getBPMNLabelStyle() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BPMNLabelStyle(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNPlane BPMN Plane}'. + * + * + * @return the meta object for the containment reference 'BPMN Plane'. + * @see org.eclipse.bpmn2.di.DocumentRoot#getBPMNPlane() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BPMNPlane(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNShape BPMN Shape}'. + * + * + * @return the meta object for the containment reference 'BPMN Shape'. + * @see org.eclipse.bpmn2.di.DocumentRoot#getBPMNShape() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_BPMNShape(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.di.BPMNDiagram BPMN Diagram}'. + * + * + * @return the meta object for class 'BPMN Diagram'. + * @see org.eclipse.bpmn2.di.BPMNDiagram + * @generated + */ + EClass getBPMNDiagram(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.di.BPMNDiagram#getPlane Plane}'. + * + * + * @return the meta object for the containment reference 'Plane'. + * @see org.eclipse.bpmn2.di.BPMNDiagram#getPlane() + * @see #getBPMNDiagram() + * @generated + */ + EReference getBPMNDiagram_Plane(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.di.BPMNDiagram#getLabelStyle Label Style}'. + * + * + * @return the meta object for the containment reference list 'Label Style'. + * @see org.eclipse.bpmn2.di.BPMNDiagram#getLabelStyle() + * @see #getBPMNDiagram() + * @generated + */ + EReference getBPMNDiagram_LabelStyle(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.di.BPMNEdge BPMN Edge}'. + * + * + * @return the meta object for class 'BPMN Edge'. + * @see org.eclipse.bpmn2.di.BPMNEdge + * @generated + */ + EClass getBPMNEdge(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.di.BPMNEdge#getLabel Label}'. + * + * + * @return the meta object for the containment reference 'Label'. + * @see org.eclipse.bpmn2.di.BPMNEdge#getLabel() + * @see #getBPMNEdge() + * @generated + */ + EReference getBPMNEdge_Label(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.di.BPMNEdge#getBpmnElement Bpmn Element}'. + * + * + * @return the meta object for the reference 'Bpmn Element'. + * @see org.eclipse.bpmn2.di.BPMNEdge#getBpmnElement() + * @see #getBPMNEdge() + * @generated + */ + EReference getBPMNEdge_BpmnElement(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.di.BPMNEdge#getMessageVisibleKind Message Visible Kind}'. + * + * + * @return the meta object for the attribute 'Message Visible Kind'. + * @see org.eclipse.bpmn2.di.BPMNEdge#getMessageVisibleKind() + * @see #getBPMNEdge() + * @generated + */ + EAttribute getBPMNEdge_MessageVisibleKind(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.di.BPMNEdge#getSourceElement Source Element}'. + * + * + * @return the meta object for the reference 'Source Element'. + * @see org.eclipse.bpmn2.di.BPMNEdge#getSourceElement() + * @see #getBPMNEdge() + * @generated + */ + EReference getBPMNEdge_SourceElement(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.di.BPMNEdge#getTargetElement Target Element}'. + * + * + * @return the meta object for the reference 'Target Element'. + * @see org.eclipse.bpmn2.di.BPMNEdge#getTargetElement() + * @see #getBPMNEdge() + * @generated + */ + EReference getBPMNEdge_TargetElement(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.di.BPMNLabel BPMN Label}'. + * + * + * @return the meta object for class 'BPMN Label'. + * @see org.eclipse.bpmn2.di.BPMNLabel + * @generated + */ + EClass getBPMNLabel(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.di.BPMNLabel#getLabelStyle Label Style}'. + * + * + * @return the meta object for the reference 'Label Style'. + * @see org.eclipse.bpmn2.di.BPMNLabel#getLabelStyle() + * @see #getBPMNLabel() + * @generated + */ + EReference getBPMNLabel_LabelStyle(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.di.BPMNLabelStyle BPMN Label Style}'. + * + * + * @return the meta object for class 'BPMN Label Style'. + * @see org.eclipse.bpmn2.di.BPMNLabelStyle + * @generated + */ + EClass getBPMNLabelStyle(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.di.BPMNLabelStyle#getFont Font}'. + * + * + * @return the meta object for the containment reference 'Font'. + * @see org.eclipse.bpmn2.di.BPMNLabelStyle#getFont() + * @see #getBPMNLabelStyle() + * @generated + */ + EReference getBPMNLabelStyle_Font(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.di.BPMNPlane BPMN Plane}'. + * + * + * @return the meta object for class 'BPMN Plane'. + * @see org.eclipse.bpmn2.di.BPMNPlane + * @generated + */ + EClass getBPMNPlane(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.di.BPMNPlane#getBpmnElement Bpmn Element}'. + * + * + * @return the meta object for the reference 'Bpmn Element'. + * @see org.eclipse.bpmn2.di.BPMNPlane#getBpmnElement() + * @see #getBPMNPlane() + * @generated + */ + EReference getBPMNPlane_BpmnElement(); + + /** + * Returns the meta object for class '{@link org.eclipse.bpmn2.di.BPMNShape BPMN Shape}'. + * + * + * @return the meta object for class 'BPMN Shape'. + * @see org.eclipse.bpmn2.di.BPMNShape + * @generated + */ + EClass getBPMNShape(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.di.BPMNShape#getLabel Label}'. + * + * + * @return the meta object for the containment reference 'Label'. + * @see org.eclipse.bpmn2.di.BPMNShape#getLabel() + * @see #getBPMNShape() + * @generated + */ + EReference getBPMNShape_Label(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.di.BPMNShape#getBpmnElement Bpmn Element}'. + * + * + * @return the meta object for the reference 'Bpmn Element'. + * @see org.eclipse.bpmn2.di.BPMNShape#getBpmnElement() + * @see #getBPMNShape() + * @generated + */ + EReference getBPMNShape_BpmnElement(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.bpmn2.di.BPMNShape#getChoreographyActivityShape Choreography Activity Shape}'. + * + * + * @return the meta object for the reference 'Choreography Activity Shape'. + * @see org.eclipse.bpmn2.di.BPMNShape#getChoreographyActivityShape() + * @see #getBPMNShape() + * @generated + */ + EReference getBPMNShape_ChoreographyActivityShape(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.di.BPMNShape#isIsExpanded Is Expanded}'. + * + * + * @return the meta object for the attribute 'Is Expanded'. + * @see org.eclipse.bpmn2.di.BPMNShape#isIsExpanded() + * @see #getBPMNShape() + * @generated + */ + EAttribute getBPMNShape_IsExpanded(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.di.BPMNShape#isIsHorizontal Is Horizontal}'. + * + * + * @return the meta object for the attribute 'Is Horizontal'. + * @see org.eclipse.bpmn2.di.BPMNShape#isIsHorizontal() + * @see #getBPMNShape() + * @generated + */ + EAttribute getBPMNShape_IsHorizontal(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.di.BPMNShape#isIsMarkerVisible Is Marker Visible}'. + * + * + * @return the meta object for the attribute 'Is Marker Visible'. + * @see org.eclipse.bpmn2.di.BPMNShape#isIsMarkerVisible() + * @see #getBPMNShape() + * @generated + */ + EAttribute getBPMNShape_IsMarkerVisible(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.di.BPMNShape#isIsMessageVisible Is Message Visible}'. + * + * + * @return the meta object for the attribute 'Is Message Visible'. + * @see org.eclipse.bpmn2.di.BPMNShape#isIsMessageVisible() + * @see #getBPMNShape() + * @generated + */ + EAttribute getBPMNShape_IsMessageVisible(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.di.BPMNShape#getParticipantBandKind Participant Band Kind}'. + * + * + * @return the meta object for the attribute 'Participant Band Kind'. + * @see org.eclipse.bpmn2.di.BPMNShape#getParticipantBandKind() + * @see #getBPMNShape() + * @generated + */ + EAttribute getBPMNShape_ParticipantBandKind(); + + /** + * Returns the meta object for enum '{@link org.eclipse.bpmn2.di.MessageVisibleKind Message Visible Kind}'. + * + * + * @return the meta object for enum 'Message Visible Kind'. + * @see org.eclipse.bpmn2.di.MessageVisibleKind + * @generated + */ + EEnum getMessageVisibleKind(); + + /** + * Returns the meta object for enum '{@link org.eclipse.bpmn2.di.ParticipantBandKind Participant Band Kind}'. + * + * + * @return the meta object for enum 'Participant Band Kind'. + * @see org.eclipse.bpmn2.di.ParticipantBandKind + * @generated + */ + EEnum getParticipantBandKind(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + BpmnDiFactory getBpmnDiFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.di.impl.DocumentRootImpl Document Root}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.DocumentRootImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getDocumentRoot() + * @generated + */ + EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot(); + + /** + * The meta object literal for the 'Mixed' attribute list feature. + * + * + * @generated + */ + EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed(); + + /** + * The meta object literal for the 'XMLNS Prefix Map' map feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap(); + + /** + * The meta object literal for the 'XSI Schema Location' map feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation(); + + /** + * The meta object literal for the 'BPMN Diagram' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BPMN_DIAGRAM = eINSTANCE.getDocumentRoot_BPMNDiagram(); + + /** + * The meta object literal for the 'BPMN Edge' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BPMN_EDGE = eINSTANCE.getDocumentRoot_BPMNEdge(); + + /** + * The meta object literal for the 'BPMN Label' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BPMN_LABEL = eINSTANCE.getDocumentRoot_BPMNLabel(); + + /** + * The meta object literal for the 'BPMN Label Style' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BPMN_LABEL_STYLE = eINSTANCE.getDocumentRoot_BPMNLabelStyle(); + + /** + * The meta object literal for the 'BPMN Plane' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BPMN_PLANE = eINSTANCE.getDocumentRoot_BPMNPlane(); + + /** + * The meta object literal for the 'BPMN Shape' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BPMN_SHAPE = eINSTANCE.getDocumentRoot_BPMNShape(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.di.impl.BPMNDiagramImpl BPMN Diagram}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.BPMNDiagramImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getBPMNDiagram() + * @generated + */ + EClass BPMN_DIAGRAM = eINSTANCE.getBPMNDiagram(); + + /** + * The meta object literal for the 'Plane' containment reference feature. + * + * + * @generated + */ + EReference BPMN_DIAGRAM__PLANE = eINSTANCE.getBPMNDiagram_Plane(); + + /** + * The meta object literal for the 'Label Style' containment reference list feature. + * + * + * @generated + */ + EReference BPMN_DIAGRAM__LABEL_STYLE = eINSTANCE.getBPMNDiagram_LabelStyle(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.di.impl.BPMNEdgeImpl BPMN Edge}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.BPMNEdgeImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getBPMNEdge() + * @generated + */ + EClass BPMN_EDGE = eINSTANCE.getBPMNEdge(); + + /** + * The meta object literal for the 'Label' containment reference feature. + * + * + * @generated + */ + EReference BPMN_EDGE__LABEL = eINSTANCE.getBPMNEdge_Label(); + + /** + * The meta object literal for the 'Bpmn Element' reference feature. + * + * + * @generated + */ + EReference BPMN_EDGE__BPMN_ELEMENT = eINSTANCE.getBPMNEdge_BpmnElement(); + + /** + * The meta object literal for the 'Message Visible Kind' attribute feature. + * + * + * @generated + */ + EAttribute BPMN_EDGE__MESSAGE_VISIBLE_KIND = eINSTANCE.getBPMNEdge_MessageVisibleKind(); + + /** + * The meta object literal for the 'Source Element' reference feature. + * + * + * @generated + */ + EReference BPMN_EDGE__SOURCE_ELEMENT = eINSTANCE.getBPMNEdge_SourceElement(); + + /** + * The meta object literal for the 'Target Element' reference feature. + * + * + * @generated + */ + EReference BPMN_EDGE__TARGET_ELEMENT = eINSTANCE.getBPMNEdge_TargetElement(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.di.impl.BPMNLabelImpl BPMN Label}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.BPMNLabelImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getBPMNLabel() + * @generated + */ + EClass BPMN_LABEL = eINSTANCE.getBPMNLabel(); + + /** + * The meta object literal for the 'Label Style' reference feature. + * + * + * @generated + */ + EReference BPMN_LABEL__LABEL_STYLE = eINSTANCE.getBPMNLabel_LabelStyle(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.di.impl.BPMNLabelStyleImpl BPMN Label Style}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.BPMNLabelStyleImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getBPMNLabelStyle() + * @generated + */ + EClass BPMN_LABEL_STYLE = eINSTANCE.getBPMNLabelStyle(); + + /** + * The meta object literal for the 'Font' containment reference feature. + * + * + * @generated + */ + EReference BPMN_LABEL_STYLE__FONT = eINSTANCE.getBPMNLabelStyle_Font(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.di.impl.BPMNPlaneImpl BPMN Plane}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.BPMNPlaneImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getBPMNPlane() + * @generated + */ + EClass BPMN_PLANE = eINSTANCE.getBPMNPlane(); + + /** + * The meta object literal for the 'Bpmn Element' reference feature. + * + * + * @generated + */ + EReference BPMN_PLANE__BPMN_ELEMENT = eINSTANCE.getBPMNPlane_BpmnElement(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.di.impl.BPMNShapeImpl BPMN Shape}' class. + * + * + * @see org.eclipse.bpmn2.di.impl.BPMNShapeImpl + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getBPMNShape() + * @generated + */ + EClass BPMN_SHAPE = eINSTANCE.getBPMNShape(); + + /** + * The meta object literal for the 'Label' containment reference feature. + * + * + * @generated + */ + EReference BPMN_SHAPE__LABEL = eINSTANCE.getBPMNShape_Label(); + + /** + * The meta object literal for the 'Bpmn Element' reference feature. + * + * + * @generated + */ + EReference BPMN_SHAPE__BPMN_ELEMENT = eINSTANCE.getBPMNShape_BpmnElement(); + + /** + * The meta object literal for the 'Choreography Activity Shape' reference feature. + * + * + * @generated + */ + EReference BPMN_SHAPE__CHOREOGRAPHY_ACTIVITY_SHAPE = eINSTANCE.getBPMNShape_ChoreographyActivityShape(); + + /** + * The meta object literal for the 'Is Expanded' attribute feature. + * + * + * @generated + */ + EAttribute BPMN_SHAPE__IS_EXPANDED = eINSTANCE.getBPMNShape_IsExpanded(); + + /** + * The meta object literal for the 'Is Horizontal' attribute feature. + * + * + * @generated + */ + EAttribute BPMN_SHAPE__IS_HORIZONTAL = eINSTANCE.getBPMNShape_IsHorizontal(); + + /** + * The meta object literal for the 'Is Marker Visible' attribute feature. + * + * + * @generated + */ + EAttribute BPMN_SHAPE__IS_MARKER_VISIBLE = eINSTANCE.getBPMNShape_IsMarkerVisible(); + + /** + * The meta object literal for the 'Is Message Visible' attribute feature. + * + * + * @generated + */ + EAttribute BPMN_SHAPE__IS_MESSAGE_VISIBLE = eINSTANCE.getBPMNShape_IsMessageVisible(); + + /** + * The meta object literal for the 'Participant Band Kind' attribute feature. + * + * + * @generated + */ + EAttribute BPMN_SHAPE__PARTICIPANT_BAND_KIND = eINSTANCE.getBPMNShape_ParticipantBandKind(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.di.MessageVisibleKind Message Visible Kind}' enum. + * + * + * @see org.eclipse.bpmn2.di.MessageVisibleKind + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getMessageVisibleKind() + * @generated + */ + EEnum MESSAGE_VISIBLE_KIND = eINSTANCE.getMessageVisibleKind(); + + /** + * The meta object literal for the '{@link org.eclipse.bpmn2.di.ParticipantBandKind Participant Band Kind}' enum. + * + * + * @see org.eclipse.bpmn2.di.ParticipantBandKind + * @see org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl#getParticipantBandKind() + * @generated + */ + EEnum PARTICIPANT_BAND_KIND = eINSTANCE.getParticipantBandKind(); + + } + +} //BpmnDiPackage diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/DocumentRoot.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/DocumentRoot.java new file mode 100644 index 00000000000..981fa2fdab0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/DocumentRoot.java @@ -0,0 +1,227 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di; + +import org.eclipse.emf.common.util.EMap; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'Document Root'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.DocumentRoot#getMixed Mixed}
  • + *
  • {@link org.eclipse.bpmn2.di.DocumentRoot#getXMLNSPrefixMap XMLNS Prefix Map}
  • + *
  • {@link org.eclipse.bpmn2.di.DocumentRoot#getXSISchemaLocation XSI Schema Location}
  • + *
  • {@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNDiagram BPMN Diagram}
  • + *
  • {@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNEdge BPMN Edge}
  • + *
  • {@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNLabel BPMN Label}
  • + *
  • {@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNLabelStyle BPMN Label Style}
  • + *
  • {@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNPlane BPMN Plane}
  • + *
  • {@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNShape BPMN Shape}
  • + *
+ * + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getDocumentRoot() + * @model extendedMetaData="name='' kind='mixed'" + * @generated + */ +public interface DocumentRoot extends EObject { + /** + * Returns the value of the 'Mixed' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Mixed' attribute list. + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getDocumentRoot_Mixed() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='elementWildcard' name=':mixed'" + * @generated + */ + FeatureMap getMixed(); + + /** + * Returns the value of the 'XMLNS Prefix Map' map. + * The key is of type {@link java.lang.String}, + * and the value is of type {@link java.lang.String}, + * + * + * @return the value of the 'XMLNS Prefix Map' map. + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getDocumentRoot_XMLNSPrefixMap() + * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>" transient="true" + * extendedMetaData="kind='attribute' name='xmlns:prefix'" + * @generated + */ + EMap getXMLNSPrefixMap(); + + /** + * Returns the value of the 'XSI Schema Location' map. + * The key is of type {@link java.lang.String}, + * and the value is of type {@link java.lang.String}, + * + * + * @return the value of the 'XSI Schema Location' map. + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getDocumentRoot_XSISchemaLocation() + * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>" transient="true" + * extendedMetaData="kind='attribute' name='xsi:schemaLocation'" + * @generated + */ + EMap getXSISchemaLocation(); + + /** + * Returns the value of the 'BPMN Diagram' containment reference. + * + * + * @return the value of the 'BPMN Diagram' containment reference. + * @see #setBPMNDiagram(BPMNDiagram) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getDocumentRoot_BPMNDiagram() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='BPMNDiagram' namespace='http://www.omg.org/spec/BPMN/20100524/DI'" + * @generated + */ + BPMNDiagram getBPMNDiagram(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNDiagram BPMN Diagram}' containment reference. + * + * + * @param value the new value of the 'BPMN Diagram' containment reference. + * @see #getBPMNDiagram() + * @generated + */ + void setBPMNDiagram(BPMNDiagram value); + + /** + * Returns the value of the 'BPMN Edge' containment reference. + * + * + * @return the value of the 'BPMN Edge' containment reference. + * @see #setBPMNEdge(BPMNEdge) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getDocumentRoot_BPMNEdge() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='BPMNEdge' namespace='http://www.omg.org/spec/BPMN/20100524/DI' affiliation='http://www.omg.org/spec/DD/20100524/DI#DiagramElement'" + * @generated + */ + BPMNEdge getBPMNEdge(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNEdge BPMN Edge}' containment reference. + * + * + * @param value the new value of the 'BPMN Edge' containment reference. + * @see #getBPMNEdge() + * @generated + */ + void setBPMNEdge(BPMNEdge value); + + /** + * Returns the value of the 'BPMN Label' containment reference. + * + * + * @return the value of the 'BPMN Label' containment reference. + * @see #setBPMNLabel(BPMNLabel) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getDocumentRoot_BPMNLabel() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='BPMNLabel' namespace='http://www.omg.org/spec/BPMN/20100524/DI'" + * @generated + */ + BPMNLabel getBPMNLabel(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNLabel BPMN Label}' containment reference. + * + * + * @param value the new value of the 'BPMN Label' containment reference. + * @see #getBPMNLabel() + * @generated + */ + void setBPMNLabel(BPMNLabel value); + + /** + * Returns the value of the 'BPMN Label Style' containment reference. + * + * + * @return the value of the 'BPMN Label Style' containment reference. + * @see #setBPMNLabelStyle(BPMNLabelStyle) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getDocumentRoot_BPMNLabelStyle() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='BPMNLabelStyle' namespace='http://www.omg.org/spec/BPMN/20100524/DI'" + * @generated + */ + BPMNLabelStyle getBPMNLabelStyle(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNLabelStyle BPMN Label Style}' containment reference. + * + * + * @param value the new value of the 'BPMN Label Style' containment reference. + * @see #getBPMNLabelStyle() + * @generated + */ + void setBPMNLabelStyle(BPMNLabelStyle value); + + /** + * Returns the value of the 'BPMN Plane' containment reference. + * + * + * @return the value of the 'BPMN Plane' containment reference. + * @see #setBPMNPlane(BPMNPlane) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getDocumentRoot_BPMNPlane() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='BPMNPlane' namespace='http://www.omg.org/spec/BPMN/20100524/DI'" + * @generated + */ + BPMNPlane getBPMNPlane(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNPlane BPMN Plane}' containment reference. + * + * + * @param value the new value of the 'BPMN Plane' containment reference. + * @see #getBPMNPlane() + * @generated + */ + void setBPMNPlane(BPMNPlane value); + + /** + * Returns the value of the 'BPMN Shape' containment reference. + * + * + * @return the value of the 'BPMN Shape' containment reference. + * @see #setBPMNShape(BPMNShape) + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getDocumentRoot_BPMNShape() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='BPMNShape' namespace='http://www.omg.org/spec/BPMN/20100524/DI' affiliation='http://www.omg.org/spec/DD/20100524/DI#DiagramElement'" + * @generated + */ + BPMNShape getBPMNShape(); + + /** + * Sets the value of the '{@link org.eclipse.bpmn2.di.DocumentRoot#getBPMNShape BPMN Shape}' containment reference. + * + * + * @param value the new value of the 'BPMN Shape' containment reference. + * @see #getBPMNShape() + * @generated + */ + void setBPMNShape(BPMNShape value); + +} // DocumentRoot diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/MessageVisibleKind.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/MessageVisibleKind.java new file mode 100644 index 00000000000..b3f594ceb68 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/MessageVisibleKind.java @@ -0,0 +1,219 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Message Visible Kind', + * and utility methods for working with them. + * + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getMessageVisibleKind() + * @model + * @generated + */ +public enum MessageVisibleKind implements Enumerator { + /** + * The 'Initiating' literal object. + * + * + * @see #INITIATING_VALUE + * @generated + * @ordered + */ + INITIATING(0, "initiating", "initiating"), + + /** + * The 'Non initiating' literal object. + * + * + * @see #NON_INITIATING_VALUE + * @generated + * @ordered + */ + NON_INITIATING(1, "non_initiating", "non_initiating"); + + /** + * The 'Initiating' literal value. + * + * + * @see #INITIATING + * @model name="initiating" + * @generated + * @ordered + */ + public static final int INITIATING_VALUE = 0; + + /** + * The 'Non initiating' literal value. + * + * + * @see #NON_INITIATING + * @model name="non_initiating" + * @generated + * @ordered + */ + public static final int NON_INITIATING_VALUE = 1; + + /** + * An array of all the 'Message Visible Kind' enumerators. + * + * + * @generated + */ + private static final MessageVisibleKind[] VALUES_ARRAY = new MessageVisibleKind[] { INITIATING, NON_INITIATING, }; + + /** + * A public read-only list of all the 'Message Visible Kind' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Message Visible Kind' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static MessageVisibleKind get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + MessageVisibleKind result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Message Visible Kind' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static MessageVisibleKind getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + MessageVisibleKind result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Message Visible Kind' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static MessageVisibleKind get(int value) { + switch (value) { + case INITIATING_VALUE: + return INITIATING; + case NON_INITIATING_VALUE: + return NON_INITIATING; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private MessageVisibleKind(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //MessageVisibleKind diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/ParticipantBandKind.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/ParticipantBandKind.java new file mode 100644 index 00000000000..19166c753a7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/ParticipantBandKind.java @@ -0,0 +1,312 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Participant Band Kind', + * and utility methods for working with them. + * + * @see org.eclipse.bpmn2.di.BpmnDiPackage#getParticipantBandKind() + * @model + * @generated + */ +public enum ParticipantBandKind implements Enumerator { + /** + * The 'Top initiating' literal object. + * + * + * @see #TOP_INITIATING_VALUE + * @generated + * @ordered + */ + TOP_INITIATING(0, "top_initiating", "top_initiating"), + + /** + * The 'Middle initiating' literal object. + * + * + * @see #MIDDLE_INITIATING_VALUE + * @generated + * @ordered + */ + MIDDLE_INITIATING(1, "middle_initiating", "middle_initiating"), + + /** + * The 'Bottom initiating' literal object. + * + * + * @see #BOTTOM_INITIATING_VALUE + * @generated + * @ordered + */ + BOTTOM_INITIATING(2, "bottom_initiating", "bottom_initiating"), + + /** + * The 'Top non initiating' literal object. + * + * + * @see #TOP_NON_INITIATING_VALUE + * @generated + * @ordered + */ + TOP_NON_INITIATING(3, "top_non_initiating", "top_non_initiating"), + + /** + * The 'Middle non initiating' literal object. + * + * + * @see #MIDDLE_NON_INITIATING_VALUE + * @generated + * @ordered + */ + MIDDLE_NON_INITIATING(4, "middle_non_initiating", "middle_non_initiating"), + + /** + * The 'Bottom non initiating' literal object. + * + * + * @see #BOTTOM_NON_INITIATING_VALUE + * @generated + * @ordered + */ + BOTTOM_NON_INITIATING(5, "bottom_non_initiating", "bottom_non_initiating"); + + /** + * The 'Top initiating' literal value. + * + * + * @see #TOP_INITIATING + * @model name="top_initiating" + * @generated + * @ordered + */ + public static final int TOP_INITIATING_VALUE = 0; + + /** + * The 'Middle initiating' literal value. + * + * + * @see #MIDDLE_INITIATING + * @model name="middle_initiating" + * @generated + * @ordered + */ + public static final int MIDDLE_INITIATING_VALUE = 1; + + /** + * The 'Bottom initiating' literal value. + * + * + * @see #BOTTOM_INITIATING + * @model name="bottom_initiating" + * @generated + * @ordered + */ + public static final int BOTTOM_INITIATING_VALUE = 2; + + /** + * The 'Top non initiating' literal value. + * + * + * @see #TOP_NON_INITIATING + * @model name="top_non_initiating" + * @generated + * @ordered + */ + public static final int TOP_NON_INITIATING_VALUE = 3; + + /** + * The 'Middle non initiating' literal value. + * + * + * @see #MIDDLE_NON_INITIATING + * @model name="middle_non_initiating" + * @generated + * @ordered + */ + public static final int MIDDLE_NON_INITIATING_VALUE = 4; + + /** + * The 'Bottom non initiating' literal value. + * + * + * @see #BOTTOM_NON_INITIATING + * @model name="bottom_non_initiating" + * @generated + * @ordered + */ + public static final int BOTTOM_NON_INITIATING_VALUE = 5; + + /** + * An array of all the 'Participant Band Kind' enumerators. + * + * + * @generated + */ + private static final ParticipantBandKind[] VALUES_ARRAY = new ParticipantBandKind[] { TOP_INITIATING, + MIDDLE_INITIATING, BOTTOM_INITIATING, TOP_NON_INITIATING, MIDDLE_NON_INITIATING, BOTTOM_NON_INITIATING, }; + + /** + * A public read-only list of all the 'Participant Band Kind' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Participant Band Kind' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static ParticipantBandKind get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ParticipantBandKind result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Participant Band Kind' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static ParticipantBandKind getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ParticipantBandKind result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Participant Band Kind' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static ParticipantBandKind get(int value) { + switch (value) { + case TOP_INITIATING_VALUE: + return TOP_INITIATING; + case MIDDLE_INITIATING_VALUE: + return MIDDLE_INITIATING; + case BOTTOM_INITIATING_VALUE: + return BOTTOM_INITIATING; + case TOP_NON_INITIATING_VALUE: + return TOP_NON_INITIATING; + case MIDDLE_NON_INITIATING_VALUE: + return MIDDLE_NON_INITIATING; + case BOTTOM_NON_INITIATING_VALUE: + return BOTTOM_NON_INITIATING; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private ParticipantBandKind(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //ParticipantBandKind diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNDiagramImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNDiagramImpl.java new file mode 100644 index 00000000000..47c1c6fff3c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNDiagramImpl.java @@ -0,0 +1,249 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNLabelStyle; +import org.eclipse.bpmn2.di.BPMNPlane; +import org.eclipse.bpmn2.di.BpmnDiPackage; + +import org.eclipse.dd.di.impl.DiagramImpl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'BPMN Diagram'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNDiagramImpl#getPlane Plane}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNDiagramImpl#getLabelStyle Label Style}
  • + *
+ * + * @generated + */ +public class BPMNDiagramImpl extends DiagramImpl implements BPMNDiagram { + /** + * The cached value of the '{@link #getPlane() Plane}' containment reference. + * + * + * @see #getPlane() + * @generated + * @ordered + */ + @GwtTransient + protected BPMNPlane plane; + + /** + * The cached value of the '{@link #getLabelStyle() Label Style}' containment reference list. + * + * + * @see #getLabelStyle() + * @generated + * @ordered + */ + @GwtTransient + protected EList labelStyle; + + /** + * + * + * @generated + */ + protected BPMNDiagramImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpmnDiPackage.Literals.BPMN_DIAGRAM; + } + + /** + * + * + * @generated + */ + @Override + public BPMNPlane getPlane() { + return plane; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetPlane(BPMNPlane newPlane, NotificationChain msgs) { + BPMNPlane oldPlane = plane; + plane = newPlane; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + BpmnDiPackage.BPMN_DIAGRAM__PLANE, oldPlane, newPlane); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setPlane(BPMNPlane newPlane) { + if (newPlane != plane) { + NotificationChain msgs = null; + if (plane != null) + msgs = ((InternalEObject) plane).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - BpmnDiPackage.BPMN_DIAGRAM__PLANE, null, msgs); + if (newPlane != null) + msgs = ((InternalEObject) newPlane).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - BpmnDiPackage.BPMN_DIAGRAM__PLANE, null, msgs); + msgs = basicSetPlane(newPlane, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_DIAGRAM__PLANE, newPlane, + newPlane)); + } + + /** + * + * + * @generated + */ + @Override + public EList getLabelStyle() { + if (labelStyle == null) { + labelStyle = new EObjectContainmentEList(BPMNLabelStyle.class, this, + BpmnDiPackage.BPMN_DIAGRAM__LABEL_STYLE); + } + return labelStyle; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpmnDiPackage.BPMN_DIAGRAM__PLANE: + return basicSetPlane(null, msgs); + case BpmnDiPackage.BPMN_DIAGRAM__LABEL_STYLE: + return ((InternalEList) getLabelStyle()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpmnDiPackage.BPMN_DIAGRAM__PLANE: + return getPlane(); + case BpmnDiPackage.BPMN_DIAGRAM__LABEL_STYLE: + return getLabelStyle(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpmnDiPackage.BPMN_DIAGRAM__PLANE: + setPlane((BPMNPlane) newValue); + return; + case BpmnDiPackage.BPMN_DIAGRAM__LABEL_STYLE: + getLabelStyle().clear(); + getLabelStyle().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpmnDiPackage.BPMN_DIAGRAM__PLANE: + setPlane((BPMNPlane) null); + return; + case BpmnDiPackage.BPMN_DIAGRAM__LABEL_STYLE: + getLabelStyle().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpmnDiPackage.BPMN_DIAGRAM__PLANE: + return plane != null; + case BpmnDiPackage.BPMN_DIAGRAM__LABEL_STYLE: + return labelStyle != null && !labelStyle.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //BPMNDiagramImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNEdgeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNEdgeImpl.java new file mode 100644 index 00000000000..411e8c55be1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNEdgeImpl.java @@ -0,0 +1,476 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.BaseElement; + +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.di.BPMNLabel; +import org.eclipse.bpmn2.di.BpmnDiPackage; +import org.eclipse.bpmn2.di.MessageVisibleKind; + +import org.eclipse.dd.di.DiagramElement; + +import org.eclipse.dd.di.impl.LabeledEdgeImpl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'BPMN Edge'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNEdgeImpl#getLabel Label}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNEdgeImpl#getBpmnElement Bpmn Element}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNEdgeImpl#getMessageVisibleKind Message Visible Kind}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNEdgeImpl#getSourceElement Source Element}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNEdgeImpl#getTargetElement Target Element}
  • + *
+ * + * @generated + */ +public class BPMNEdgeImpl extends LabeledEdgeImpl implements BPMNEdge { + /** + * The cached value of the '{@link #getLabel() Label}' containment reference. + * + * + * @see #getLabel() + * @generated + * @ordered + */ + @GwtTransient + protected BPMNLabel label; + + /** + * The cached value of the '{@link #getBpmnElement() Bpmn Element}' reference. + * + * + * @see #getBpmnElement() + * @generated + * @ordered + */ + @GwtTransient + protected BaseElement bpmnElement; + + /** + * The default value of the '{@link #getMessageVisibleKind() Message Visible Kind}' attribute. + * + * + * @see #getMessageVisibleKind() + * @generated + * @ordered + */ + protected static final MessageVisibleKind MESSAGE_VISIBLE_KIND_EDEFAULT = MessageVisibleKind.INITIATING; + + /** + * The cached value of the '{@link #getMessageVisibleKind() Message Visible Kind}' attribute. + * + * + * @see #getMessageVisibleKind() + * @generated + * @ordered + */ + @GwtTransient + protected MessageVisibleKind messageVisibleKind = MESSAGE_VISIBLE_KIND_EDEFAULT; + + /** + * The cached value of the '{@link #getSourceElement() Source Element}' reference. + * + * + * @see #getSourceElement() + * @generated + * @ordered + */ + @GwtTransient + protected DiagramElement sourceElement; + + /** + * The cached value of the '{@link #getTargetElement() Target Element}' reference. + * + * + * @see #getTargetElement() + * @generated + * @ordered + */ + @GwtTransient + protected DiagramElement targetElement; + + /** + * + * + * @generated + */ + protected BPMNEdgeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpmnDiPackage.Literals.BPMN_EDGE; + } + + /** + * + * + * @generated + */ + @Override + public BPMNLabel getLabel() { + return label; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLabel(BPMNLabel newLabel, NotificationChain msgs) { + BPMNLabel oldLabel = label; + label = newLabel; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + BpmnDiPackage.BPMN_EDGE__LABEL, oldLabel, newLabel); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setLabel(BPMNLabel newLabel) { + if (newLabel != label) { + NotificationChain msgs = null; + if (label != null) + msgs = ((InternalEObject) label).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - BpmnDiPackage.BPMN_EDGE__LABEL, null, msgs); + if (newLabel != null) + msgs = ((InternalEObject) newLabel).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - BpmnDiPackage.BPMN_EDGE__LABEL, null, msgs); + msgs = basicSetLabel(newLabel, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_EDGE__LABEL, newLabel, newLabel)); + } + + /** + * + * + * @generated + */ + @Override + public BaseElement getBpmnElement() { + if (bpmnElement != null && bpmnElement.eIsProxy()) { + InternalEObject oldBpmnElement = (InternalEObject) bpmnElement; + bpmnElement = (BaseElement) eResolveProxy(oldBpmnElement); + if (bpmnElement != oldBpmnElement) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, BpmnDiPackage.BPMN_EDGE__BPMN_ELEMENT, + oldBpmnElement, bpmnElement)); + } + } + return bpmnElement; + } + + /** + * + * + * @generated + */ + public BaseElement basicGetBpmnElement() { + return bpmnElement; + } + + /** + * + * + * @generated + */ + @Override + public void setBpmnElement(BaseElement newBpmnElement) { + BaseElement oldBpmnElement = bpmnElement; + bpmnElement = newBpmnElement; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_EDGE__BPMN_ELEMENT, oldBpmnElement, + bpmnElement)); + } + + /** + * + * + * @generated + */ + @Override + public MessageVisibleKind getMessageVisibleKind() { + return messageVisibleKind; + } + + /** + * + * + * @generated + */ + @Override + public void setMessageVisibleKind(MessageVisibleKind newMessageVisibleKind) { + MessageVisibleKind oldMessageVisibleKind = messageVisibleKind; + messageVisibleKind = newMessageVisibleKind == null ? MESSAGE_VISIBLE_KIND_EDEFAULT : newMessageVisibleKind; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_EDGE__MESSAGE_VISIBLE_KIND, + oldMessageVisibleKind, messageVisibleKind)); + } + + /** + * + * + * @generated + */ + @Override + public DiagramElement getSourceElement() { + if (sourceElement != null && sourceElement.eIsProxy()) { + InternalEObject oldSourceElement = (InternalEObject) sourceElement; + sourceElement = (DiagramElement) eResolveProxy(oldSourceElement); + if (sourceElement != oldSourceElement) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, BpmnDiPackage.BPMN_EDGE__SOURCE_ELEMENT, + oldSourceElement, sourceElement)); + } + } + return sourceElement; + } + + /** + * + * + * @generated + */ + public DiagramElement basicGetSourceElement() { + return sourceElement; + } + + /** + * + * + * @generated + */ + @Override + public void setSourceElement(DiagramElement newSourceElement) { + DiagramElement oldSourceElement = sourceElement; + sourceElement = newSourceElement; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_EDGE__SOURCE_ELEMENT, + oldSourceElement, sourceElement)); + } + + /** + * + * + * @generated + */ + @Override + public DiagramElement getTargetElement() { + if (targetElement != null && targetElement.eIsProxy()) { + InternalEObject oldTargetElement = (InternalEObject) targetElement; + targetElement = (DiagramElement) eResolveProxy(oldTargetElement); + if (targetElement != oldTargetElement) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, BpmnDiPackage.BPMN_EDGE__TARGET_ELEMENT, + oldTargetElement, targetElement)); + } + } + return targetElement; + } + + /** + * + * + * @generated + */ + public DiagramElement basicGetTargetElement() { + return targetElement; + } + + /** + * + * + * @generated + */ + @Override + public void setTargetElement(DiagramElement newTargetElement) { + DiagramElement oldTargetElement = targetElement; + targetElement = newTargetElement; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_EDGE__TARGET_ELEMENT, + oldTargetElement, targetElement)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpmnDiPackage.BPMN_EDGE__LABEL: + return basicSetLabel(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpmnDiPackage.BPMN_EDGE__LABEL: + return getLabel(); + case BpmnDiPackage.BPMN_EDGE__BPMN_ELEMENT: + if (resolve) + return getBpmnElement(); + return basicGetBpmnElement(); + case BpmnDiPackage.BPMN_EDGE__MESSAGE_VISIBLE_KIND: + return getMessageVisibleKind(); + case BpmnDiPackage.BPMN_EDGE__SOURCE_ELEMENT: + if (resolve) + return getSourceElement(); + return basicGetSourceElement(); + case BpmnDiPackage.BPMN_EDGE__TARGET_ELEMENT: + if (resolve) + return getTargetElement(); + return basicGetTargetElement(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpmnDiPackage.BPMN_EDGE__LABEL: + setLabel((BPMNLabel) newValue); + return; + case BpmnDiPackage.BPMN_EDGE__BPMN_ELEMENT: + setBpmnElement((BaseElement) newValue); + return; + case BpmnDiPackage.BPMN_EDGE__MESSAGE_VISIBLE_KIND: + setMessageVisibleKind((MessageVisibleKind) newValue); + return; + case BpmnDiPackage.BPMN_EDGE__SOURCE_ELEMENT: + setSourceElement((DiagramElement) newValue); + return; + case BpmnDiPackage.BPMN_EDGE__TARGET_ELEMENT: + setTargetElement((DiagramElement) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpmnDiPackage.BPMN_EDGE__LABEL: + setLabel((BPMNLabel) null); + return; + case BpmnDiPackage.BPMN_EDGE__BPMN_ELEMENT: + setBpmnElement((BaseElement) null); + return; + case BpmnDiPackage.BPMN_EDGE__MESSAGE_VISIBLE_KIND: + setMessageVisibleKind(MESSAGE_VISIBLE_KIND_EDEFAULT); + return; + case BpmnDiPackage.BPMN_EDGE__SOURCE_ELEMENT: + setSourceElement((DiagramElement) null); + return; + case BpmnDiPackage.BPMN_EDGE__TARGET_ELEMENT: + setTargetElement((DiagramElement) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpmnDiPackage.BPMN_EDGE__LABEL: + return label != null; + case BpmnDiPackage.BPMN_EDGE__BPMN_ELEMENT: + return bpmnElement != null; + case BpmnDiPackage.BPMN_EDGE__MESSAGE_VISIBLE_KIND: + return messageVisibleKind != MESSAGE_VISIBLE_KIND_EDEFAULT; + case BpmnDiPackage.BPMN_EDGE__SOURCE_ELEMENT: + return sourceElement != null; + case BpmnDiPackage.BPMN_EDGE__TARGET_ELEMENT: + return targetElement != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (messageVisibleKind: "); + result.append(messageVisibleKind); + result.append(')'); + return result.toString(); + } + +} //BPMNEdgeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNLabelImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNLabelImpl.java new file mode 100644 index 00000000000..84b8b417443 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNLabelImpl.java @@ -0,0 +1,178 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.di.BPMNLabel; +import org.eclipse.bpmn2.di.BPMNLabelStyle; +import org.eclipse.bpmn2.di.BpmnDiPackage; + +import org.eclipse.dd.di.impl.LabelImpl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'BPMN Label'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNLabelImpl#getLabelStyle Label Style}
  • + *
+ * + * @generated + */ +public class BPMNLabelImpl extends LabelImpl implements BPMNLabel { + /** + * The cached value of the '{@link #getLabelStyle() Label Style}' reference. + * + * + * @see #getLabelStyle() + * @generated + * @ordered + */ + @GwtTransient + protected BPMNLabelStyle labelStyle; + + /** + * + * + * @generated + */ + protected BPMNLabelImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpmnDiPackage.Literals.BPMN_LABEL; + } + + /** + * + * + * @generated + */ + @Override + public BPMNLabelStyle getLabelStyle() { + if (labelStyle != null && labelStyle.eIsProxy()) { + InternalEObject oldLabelStyle = (InternalEObject) labelStyle; + labelStyle = (BPMNLabelStyle) eResolveProxy(oldLabelStyle); + if (labelStyle != oldLabelStyle) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, BpmnDiPackage.BPMN_LABEL__LABEL_STYLE, + oldLabelStyle, labelStyle)); + } + } + return labelStyle; + } + + /** + * + * + * @generated + */ + public BPMNLabelStyle basicGetLabelStyle() { + return labelStyle; + } + + /** + * + * + * @generated + */ + @Override + public void setLabelStyle(BPMNLabelStyle newLabelStyle) { + BPMNLabelStyle oldLabelStyle = labelStyle; + labelStyle = newLabelStyle; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_LABEL__LABEL_STYLE, oldLabelStyle, + labelStyle)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpmnDiPackage.BPMN_LABEL__LABEL_STYLE: + if (resolve) + return getLabelStyle(); + return basicGetLabelStyle(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpmnDiPackage.BPMN_LABEL__LABEL_STYLE: + setLabelStyle((BPMNLabelStyle) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpmnDiPackage.BPMN_LABEL__LABEL_STYLE: + setLabelStyle((BPMNLabelStyle) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpmnDiPackage.BPMN_LABEL__LABEL_STYLE: + return labelStyle != null; + } + return super.eIsSet(featureID); + } + +} //BPMNLabelImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNLabelStyleImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNLabelStyleImpl.java new file mode 100644 index 00000000000..ac91e2b880c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNLabelStyleImpl.java @@ -0,0 +1,202 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.di.BPMNLabelStyle; +import org.eclipse.bpmn2.di.BpmnDiPackage; + +import org.eclipse.dd.dc.Font; + +import org.eclipse.dd.di.impl.StyleImpl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'BPMN Label Style'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNLabelStyleImpl#getFont Font}
  • + *
+ * + * @generated + */ +public class BPMNLabelStyleImpl extends StyleImpl implements BPMNLabelStyle { + /** + * The cached value of the '{@link #getFont() Font}' containment reference. + * + * + * @see #getFont() + * @generated + * @ordered + */ + @GwtTransient + protected Font font; + + /** + * + * + * @generated + */ + protected BPMNLabelStyleImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpmnDiPackage.Literals.BPMN_LABEL_STYLE; + } + + /** + * + * + * @generated + */ + @Override + public Font getFont() { + return font; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFont(Font newFont, NotificationChain msgs) { + Font oldFont = font; + font = newFont; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + BpmnDiPackage.BPMN_LABEL_STYLE__FONT, oldFont, newFont); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setFont(Font newFont) { + if (newFont != font) { + NotificationChain msgs = null; + if (font != null) + msgs = ((InternalEObject) font).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - BpmnDiPackage.BPMN_LABEL_STYLE__FONT, null, msgs); + if (newFont != null) + msgs = ((InternalEObject) newFont).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - BpmnDiPackage.BPMN_LABEL_STYLE__FONT, null, msgs); + msgs = basicSetFont(newFont, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_LABEL_STYLE__FONT, newFont, + newFont)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpmnDiPackage.BPMN_LABEL_STYLE__FONT: + return basicSetFont(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpmnDiPackage.BPMN_LABEL_STYLE__FONT: + return getFont(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpmnDiPackage.BPMN_LABEL_STYLE__FONT: + setFont((Font) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpmnDiPackage.BPMN_LABEL_STYLE__FONT: + setFont((Font) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpmnDiPackage.BPMN_LABEL_STYLE__FONT: + return font != null; + } + return super.eIsSet(featureID); + } + +} //BPMNLabelStyleImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNPlaneImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNPlaneImpl.java new file mode 100644 index 00000000000..7e0a9b645da --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNPlaneImpl.java @@ -0,0 +1,179 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.BaseElement; + +import org.eclipse.bpmn2.di.BPMNPlane; +import org.eclipse.bpmn2.di.BpmnDiPackage; + +import org.eclipse.dd.di.impl.PlaneImpl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'BPMN Plane'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNPlaneImpl#getBpmnElement Bpmn Element}
  • + *
+ * + * @generated + */ +public class BPMNPlaneImpl extends PlaneImpl implements BPMNPlane { + /** + * The cached value of the '{@link #getBpmnElement() Bpmn Element}' reference. + * + * + * @see #getBpmnElement() + * @generated + * @ordered + */ + @GwtTransient + protected BaseElement bpmnElement; + + /** + * + * + * @generated + */ + protected BPMNPlaneImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpmnDiPackage.Literals.BPMN_PLANE; + } + + /** + * + * + * @generated + */ + @Override + public BaseElement getBpmnElement() { + if (bpmnElement != null && bpmnElement.eIsProxy()) { + InternalEObject oldBpmnElement = (InternalEObject) bpmnElement; + bpmnElement = (BaseElement) eResolveProxy(oldBpmnElement); + if (bpmnElement != oldBpmnElement) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, BpmnDiPackage.BPMN_PLANE__BPMN_ELEMENT, + oldBpmnElement, bpmnElement)); + } + } + return bpmnElement; + } + + /** + * + * + * @generated + */ + public BaseElement basicGetBpmnElement() { + return bpmnElement; + } + + /** + * + * + * @generated + */ + @Override + public void setBpmnElement(BaseElement newBpmnElement) { + BaseElement oldBpmnElement = bpmnElement; + bpmnElement = newBpmnElement; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_PLANE__BPMN_ELEMENT, + oldBpmnElement, bpmnElement)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpmnDiPackage.BPMN_PLANE__BPMN_ELEMENT: + if (resolve) + return getBpmnElement(); + return basicGetBpmnElement(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpmnDiPackage.BPMN_PLANE__BPMN_ELEMENT: + setBpmnElement((BaseElement) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpmnDiPackage.BPMN_PLANE__BPMN_ELEMENT: + setBpmnElement((BaseElement) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpmnDiPackage.BPMN_PLANE__BPMN_ELEMENT: + return bpmnElement != null; + } + return super.eIsSet(featureID); + } + +} //BPMNPlaneImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNShapeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNShapeImpl.java new file mode 100644 index 00000000000..7da4b84662d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BPMNShapeImpl.java @@ -0,0 +1,641 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.BaseElement; + +import org.eclipse.bpmn2.di.BPMNLabel; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.bpmn2.di.BpmnDiPackage; +import org.eclipse.bpmn2.di.ParticipantBandKind; + +import org.eclipse.dd.di.impl.LabeledShapeImpl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'BPMN Shape'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNShapeImpl#getLabel Label}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNShapeImpl#getBpmnElement Bpmn Element}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNShapeImpl#getChoreographyActivityShape Choreography Activity Shape}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNShapeImpl#isIsExpanded Is Expanded}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNShapeImpl#isIsHorizontal Is Horizontal}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNShapeImpl#isIsMarkerVisible Is Marker Visible}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNShapeImpl#isIsMessageVisible Is Message Visible}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.BPMNShapeImpl#getParticipantBandKind Participant Band Kind}
  • + *
+ * + * @generated + */ +public class BPMNShapeImpl extends LabeledShapeImpl implements BPMNShape { + /** + * The cached value of the '{@link #getLabel() Label}' containment reference. + * + * + * @see #getLabel() + * @generated + * @ordered + */ + @GwtTransient + protected BPMNLabel label; + + /** + * The cached value of the '{@link #getBpmnElement() Bpmn Element}' reference. + * + * + * @see #getBpmnElement() + * @generated + * @ordered + */ + @GwtTransient + protected BaseElement bpmnElement; + + /** + * The cached value of the '{@link #getChoreographyActivityShape() Choreography Activity Shape}' reference. + * + * + * @see #getChoreographyActivityShape() + * @generated + * @ordered + */ + @GwtTransient + protected BPMNShape choreographyActivityShape; + + /** + * The default value of the '{@link #isIsExpanded() Is Expanded}' attribute. + * + * + * @see #isIsExpanded() + * @generated + * @ordered + */ + protected static final boolean IS_EXPANDED_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsExpanded() Is Expanded}' attribute. + * + * + * @see #isIsExpanded() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isExpanded = IS_EXPANDED_EDEFAULT; + + /** + * The default value of the '{@link #isIsHorizontal() Is Horizontal}' attribute. + * + * + * @see #isIsHorizontal() + * @generated + * @ordered + */ + protected static final boolean IS_HORIZONTAL_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsHorizontal() Is Horizontal}' attribute. + * + * + * @see #isIsHorizontal() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isHorizontal = IS_HORIZONTAL_EDEFAULT; + + /** + * The default value of the '{@link #isIsMarkerVisible() Is Marker Visible}' attribute. + * + * + * @see #isIsMarkerVisible() + * @generated + * @ordered + */ + protected static final boolean IS_MARKER_VISIBLE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsMarkerVisible() Is Marker Visible}' attribute. + * + * + * @see #isIsMarkerVisible() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isMarkerVisible = IS_MARKER_VISIBLE_EDEFAULT; + + /** + * The default value of the '{@link #isIsMessageVisible() Is Message Visible}' attribute. + * + * + * @see #isIsMessageVisible() + * @generated + * @ordered + */ + protected static final boolean IS_MESSAGE_VISIBLE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsMessageVisible() Is Message Visible}' attribute. + * + * + * @see #isIsMessageVisible() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isMessageVisible = IS_MESSAGE_VISIBLE_EDEFAULT; + + /** + * The default value of the '{@link #getParticipantBandKind() Participant Band Kind}' attribute. + * + * + * @see #getParticipantBandKind() + * @generated + * @ordered + */ + protected static final ParticipantBandKind PARTICIPANT_BAND_KIND_EDEFAULT = ParticipantBandKind.TOP_INITIATING; + + /** + * The cached value of the '{@link #getParticipantBandKind() Participant Band Kind}' attribute. + * + * + * @see #getParticipantBandKind() + * @generated + * @ordered + */ + @GwtTransient + protected ParticipantBandKind participantBandKind = PARTICIPANT_BAND_KIND_EDEFAULT; + + /** + * + * + * @generated + */ + protected BPMNShapeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpmnDiPackage.Literals.BPMN_SHAPE; + } + + /** + * + * + * @generated + */ + @Override + public BPMNLabel getLabel() { + return label; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLabel(BPMNLabel newLabel, NotificationChain msgs) { + BPMNLabel oldLabel = label; + label = newLabel; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + BpmnDiPackage.BPMN_SHAPE__LABEL, oldLabel, newLabel); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setLabel(BPMNLabel newLabel) { + if (newLabel != label) { + NotificationChain msgs = null; + if (label != null) + msgs = ((InternalEObject) label).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - BpmnDiPackage.BPMN_SHAPE__LABEL, null, msgs); + if (newLabel != null) + msgs = ((InternalEObject) newLabel).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - BpmnDiPackage.BPMN_SHAPE__LABEL, null, msgs); + msgs = basicSetLabel(newLabel, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_SHAPE__LABEL, newLabel, newLabel)); + } + + /** + * + * + * @generated + */ + @Override + public BaseElement getBpmnElement() { + if (bpmnElement != null && bpmnElement.eIsProxy()) { + InternalEObject oldBpmnElement = (InternalEObject) bpmnElement; + bpmnElement = (BaseElement) eResolveProxy(oldBpmnElement); + if (bpmnElement != oldBpmnElement) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, BpmnDiPackage.BPMN_SHAPE__BPMN_ELEMENT, + oldBpmnElement, bpmnElement)); + } + } + return bpmnElement; + } + + /** + * + * + * @generated + */ + public BaseElement basicGetBpmnElement() { + return bpmnElement; + } + + /** + * + * + * @generated + */ + @Override + public void setBpmnElement(BaseElement newBpmnElement) { + BaseElement oldBpmnElement = bpmnElement; + bpmnElement = newBpmnElement; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_SHAPE__BPMN_ELEMENT, + oldBpmnElement, bpmnElement)); + } + + /** + * + * + * @generated + */ + @Override + public BPMNShape getChoreographyActivityShape() { + if (choreographyActivityShape != null && choreographyActivityShape.eIsProxy()) { + InternalEObject oldChoreographyActivityShape = (InternalEObject) choreographyActivityShape; + choreographyActivityShape = (BPMNShape) eResolveProxy(oldChoreographyActivityShape); + if (choreographyActivityShape != oldChoreographyActivityShape) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + BpmnDiPackage.BPMN_SHAPE__CHOREOGRAPHY_ACTIVITY_SHAPE, oldChoreographyActivityShape, + choreographyActivityShape)); + } + } + return choreographyActivityShape; + } + + /** + * + * + * @generated + */ + public BPMNShape basicGetChoreographyActivityShape() { + return choreographyActivityShape; + } + + /** + * + * + * @generated + */ + @Override + public void setChoreographyActivityShape(BPMNShape newChoreographyActivityShape) { + BPMNShape oldChoreographyActivityShape = choreographyActivityShape; + choreographyActivityShape = newChoreographyActivityShape; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_SHAPE__CHOREOGRAPHY_ACTIVITY_SHAPE, + oldChoreographyActivityShape, choreographyActivityShape)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsExpanded() { + return isExpanded; + } + + /** + * + * + * @generated + */ + @Override + public void setIsExpanded(boolean newIsExpanded) { + boolean oldIsExpanded = isExpanded; + isExpanded = newIsExpanded; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_SHAPE__IS_EXPANDED, oldIsExpanded, + isExpanded)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsHorizontal() { + return isHorizontal; + } + + /** + * + * + * @generated + */ + @Override + public void setIsHorizontal(boolean newIsHorizontal) { + boolean oldIsHorizontal = isHorizontal; + isHorizontal = newIsHorizontal; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_SHAPE__IS_HORIZONTAL, + oldIsHorizontal, isHorizontal)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsMarkerVisible() { + return isMarkerVisible; + } + + /** + * + * + * @generated + */ + @Override + public void setIsMarkerVisible(boolean newIsMarkerVisible) { + boolean oldIsMarkerVisible = isMarkerVisible; + isMarkerVisible = newIsMarkerVisible; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_SHAPE__IS_MARKER_VISIBLE, + oldIsMarkerVisible, isMarkerVisible)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsMessageVisible() { + return isMessageVisible; + } + + /** + * + * + * @generated + */ + @Override + public void setIsMessageVisible(boolean newIsMessageVisible) { + boolean oldIsMessageVisible = isMessageVisible; + isMessageVisible = newIsMessageVisible; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_SHAPE__IS_MESSAGE_VISIBLE, + oldIsMessageVisible, isMessageVisible)); + } + + /** + * + * + * @generated + */ + @Override + public ParticipantBandKind getParticipantBandKind() { + return participantBandKind; + } + + /** + * + * + * @generated + */ + @Override + public void setParticipantBandKind(ParticipantBandKind newParticipantBandKind) { + ParticipantBandKind oldParticipantBandKind = participantBandKind; + participantBandKind = newParticipantBandKind == null ? PARTICIPANT_BAND_KIND_EDEFAULT : newParticipantBandKind; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BpmnDiPackage.BPMN_SHAPE__PARTICIPANT_BAND_KIND, + oldParticipantBandKind, participantBandKind)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpmnDiPackage.BPMN_SHAPE__LABEL: + return basicSetLabel(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpmnDiPackage.BPMN_SHAPE__LABEL: + return getLabel(); + case BpmnDiPackage.BPMN_SHAPE__BPMN_ELEMENT: + if (resolve) + return getBpmnElement(); + return basicGetBpmnElement(); + case BpmnDiPackage.BPMN_SHAPE__CHOREOGRAPHY_ACTIVITY_SHAPE: + if (resolve) + return getChoreographyActivityShape(); + return basicGetChoreographyActivityShape(); + case BpmnDiPackage.BPMN_SHAPE__IS_EXPANDED: + return isIsExpanded(); + case BpmnDiPackage.BPMN_SHAPE__IS_HORIZONTAL: + return isIsHorizontal(); + case BpmnDiPackage.BPMN_SHAPE__IS_MARKER_VISIBLE: + return isIsMarkerVisible(); + case BpmnDiPackage.BPMN_SHAPE__IS_MESSAGE_VISIBLE: + return isIsMessageVisible(); + case BpmnDiPackage.BPMN_SHAPE__PARTICIPANT_BAND_KIND: + return getParticipantBandKind(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpmnDiPackage.BPMN_SHAPE__LABEL: + setLabel((BPMNLabel) newValue); + return; + case BpmnDiPackage.BPMN_SHAPE__BPMN_ELEMENT: + setBpmnElement((BaseElement) newValue); + return; + case BpmnDiPackage.BPMN_SHAPE__CHOREOGRAPHY_ACTIVITY_SHAPE: + setChoreographyActivityShape((BPMNShape) newValue); + return; + case BpmnDiPackage.BPMN_SHAPE__IS_EXPANDED: + setIsExpanded((Boolean) newValue); + return; + case BpmnDiPackage.BPMN_SHAPE__IS_HORIZONTAL: + setIsHorizontal((Boolean) newValue); + return; + case BpmnDiPackage.BPMN_SHAPE__IS_MARKER_VISIBLE: + setIsMarkerVisible((Boolean) newValue); + return; + case BpmnDiPackage.BPMN_SHAPE__IS_MESSAGE_VISIBLE: + setIsMessageVisible((Boolean) newValue); + return; + case BpmnDiPackage.BPMN_SHAPE__PARTICIPANT_BAND_KIND: + setParticipantBandKind((ParticipantBandKind) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpmnDiPackage.BPMN_SHAPE__LABEL: + setLabel((BPMNLabel) null); + return; + case BpmnDiPackage.BPMN_SHAPE__BPMN_ELEMENT: + setBpmnElement((BaseElement) null); + return; + case BpmnDiPackage.BPMN_SHAPE__CHOREOGRAPHY_ACTIVITY_SHAPE: + setChoreographyActivityShape((BPMNShape) null); + return; + case BpmnDiPackage.BPMN_SHAPE__IS_EXPANDED: + setIsExpanded(IS_EXPANDED_EDEFAULT); + return; + case BpmnDiPackage.BPMN_SHAPE__IS_HORIZONTAL: + setIsHorizontal(IS_HORIZONTAL_EDEFAULT); + return; + case BpmnDiPackage.BPMN_SHAPE__IS_MARKER_VISIBLE: + setIsMarkerVisible(IS_MARKER_VISIBLE_EDEFAULT); + return; + case BpmnDiPackage.BPMN_SHAPE__IS_MESSAGE_VISIBLE: + setIsMessageVisible(IS_MESSAGE_VISIBLE_EDEFAULT); + return; + case BpmnDiPackage.BPMN_SHAPE__PARTICIPANT_BAND_KIND: + setParticipantBandKind(PARTICIPANT_BAND_KIND_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpmnDiPackage.BPMN_SHAPE__LABEL: + return label != null; + case BpmnDiPackage.BPMN_SHAPE__BPMN_ELEMENT: + return bpmnElement != null; + case BpmnDiPackage.BPMN_SHAPE__CHOREOGRAPHY_ACTIVITY_SHAPE: + return choreographyActivityShape != null; + case BpmnDiPackage.BPMN_SHAPE__IS_EXPANDED: + return isExpanded != IS_EXPANDED_EDEFAULT; + case BpmnDiPackage.BPMN_SHAPE__IS_HORIZONTAL: + return isHorizontal != IS_HORIZONTAL_EDEFAULT; + case BpmnDiPackage.BPMN_SHAPE__IS_MARKER_VISIBLE: + return isMarkerVisible != IS_MARKER_VISIBLE_EDEFAULT; + case BpmnDiPackage.BPMN_SHAPE__IS_MESSAGE_VISIBLE: + return isMessageVisible != IS_MESSAGE_VISIBLE_EDEFAULT; + case BpmnDiPackage.BPMN_SHAPE__PARTICIPANT_BAND_KIND: + return participantBandKind != PARTICIPANT_BAND_KIND_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (isExpanded: "); + result.append(isExpanded); + result.append(", isHorizontal: "); + result.append(isHorizontal); + result.append(", isMarkerVisible: "); + result.append(isMarkerVisible); + result.append(", isMessageVisible: "); + result.append(isMessageVisible); + result.append(", participantBandKind: "); + result.append(participantBandKind); + result.append(')'); + return result.toString(); + } + +} //BPMNShapeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BpmnDiFactoryImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BpmnDiFactoryImpl.java new file mode 100644 index 00000000000..c94f886b755 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BpmnDiFactoryImpl.java @@ -0,0 +1,267 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di.impl; + +import org.eclipse.bpmn2.di.*; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class BpmnDiFactoryImpl extends EFactoryImpl implements BpmnDiFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static BpmnDiFactory init() { + try { + BpmnDiFactory theBpmnDiFactory = (BpmnDiFactory) EPackage.Registry.INSTANCE + .getEFactory(BpmnDiPackage.eNS_URI); + if (theBpmnDiFactory != null) { + return theBpmnDiFactory; + } + } catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new BpmnDiFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public BpmnDiFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case BpmnDiPackage.DOCUMENT_ROOT: + return createDocumentRoot(); + case BpmnDiPackage.BPMN_DIAGRAM: + return createBPMNDiagram(); + case BpmnDiPackage.BPMN_EDGE: + return createBPMNEdge(); + case BpmnDiPackage.BPMN_LABEL: + return createBPMNLabel(); + case BpmnDiPackage.BPMN_LABEL_STYLE: + return createBPMNLabelStyle(); + case BpmnDiPackage.BPMN_PLANE: + return createBPMNPlane(); + case BpmnDiPackage.BPMN_SHAPE: + return createBPMNShape(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public Object createFromString(EDataType eDataType, String initialValue) { + switch (eDataType.getClassifierID()) { + case BpmnDiPackage.MESSAGE_VISIBLE_KIND: + return createMessageVisibleKindFromString(eDataType, initialValue); + case BpmnDiPackage.PARTICIPANT_BAND_KIND: + return createParticipantBandKindFromString(eDataType, initialValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public String convertToString(EDataType eDataType, Object instanceValue) { + switch (eDataType.getClassifierID()) { + case BpmnDiPackage.MESSAGE_VISIBLE_KIND: + return convertMessageVisibleKindToString(eDataType, instanceValue); + case BpmnDiPackage.PARTICIPANT_BAND_KIND: + return convertParticipantBandKindToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public DocumentRoot createDocumentRoot() { + DocumentRootImpl documentRoot = new DocumentRootImpl(); + return documentRoot; + } + + /** + * + * + * @generated + */ + @Override + public BPMNDiagram createBPMNDiagram() { + BPMNDiagramImpl bpmnDiagram = new BPMNDiagramImpl(); + return bpmnDiagram; + } + + /** + * + * + * @generated + */ + @Override + public BPMNEdge createBPMNEdge() { + BPMNEdgeImpl bpmnEdge = new BPMNEdgeImpl(); + return bpmnEdge; + } + + /** + * + * + * @generated + */ + @Override + public BPMNLabel createBPMNLabel() { + BPMNLabelImpl bpmnLabel = new BPMNLabelImpl(); + return bpmnLabel; + } + + /** + * + * + * @generated + */ + @Override + public BPMNLabelStyle createBPMNLabelStyle() { + BPMNLabelStyleImpl bpmnLabelStyle = new BPMNLabelStyleImpl(); + return bpmnLabelStyle; + } + + /** + * + * + * @generated + */ + @Override + public BPMNPlane createBPMNPlane() { + BPMNPlaneImpl bpmnPlane = new BPMNPlaneImpl(); + return bpmnPlane; + } + + /** + * + * + * @generated + */ + @Override + public BPMNShape createBPMNShape() { + BPMNShapeImpl bpmnShape = new BPMNShapeImpl(); + return bpmnShape; + } + + /** + * + * + * @generated + */ + public MessageVisibleKind createMessageVisibleKindFromString(EDataType eDataType, String initialValue) { + MessageVisibleKind result = MessageVisibleKind.get(initialValue); + if (result == null) + throw new IllegalArgumentException( + "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertMessageVisibleKindToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public ParticipantBandKind createParticipantBandKindFromString(EDataType eDataType, String initialValue) { + ParticipantBandKind result = ParticipantBandKind.get(initialValue); + if (result == null) + throw new IllegalArgumentException( + "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertParticipantBandKindToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + @Override + public BpmnDiPackage getBpmnDiPackage() { + return (BpmnDiPackage) getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static BpmnDiPackage getPackage() { + return BpmnDiPackage.eINSTANCE; + } + +} //BpmnDiFactoryImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BpmnDiPackageImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BpmnDiPackageImpl.java new file mode 100644 index 00000000000..c6db2f6ee96 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/BpmnDiPackageImpl.java @@ -0,0 +1,1037 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di.impl; + +import com.google.gwt.user.client.rpc.IsSerializable; + +import org.eclipse.bpmn2.Bpmn2Package; + +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.di.BPMNLabel; +import org.eclipse.bpmn2.di.BPMNLabelStyle; +import org.eclipse.bpmn2.di.BPMNPlane; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.bpmn2.di.BpmnDiFactory; +import org.eclipse.bpmn2.di.BpmnDiPackage; +import org.eclipse.bpmn2.di.DocumentRoot; +import org.eclipse.bpmn2.di.MessageVisibleKind; +import org.eclipse.bpmn2.di.ParticipantBandKind; + +import org.eclipse.bpmn2.impl.Bpmn2PackageImpl; + +import org.eclipse.dd.dc.DcPackage; + +import org.eclipse.dd.dc.impl.DcPackageImpl; + +import org.eclipse.dd.di.DiPackage; + +import org.eclipse.dd.di.impl.DiPackageImpl; + +import org.eclipse.emf.common.util.Reflect; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class BpmnDiPackageImpl extends EPackageImpl implements BpmnDiPackage { + /** + * + * + * @generated + */ + private EClass documentRootEClass = null; + + /** + * + * + * @generated + */ + private EClass bpmnDiagramEClass = null; + + /** + * + * + * @generated + */ + private EClass bpmnEdgeEClass = null; + + /** + * + * + * @generated + */ + private EClass bpmnLabelEClass = null; + + /** + * + * + * @generated + */ + private EClass bpmnLabelStyleEClass = null; + + /** + * + * + * @generated + */ + private EClass bpmnPlaneEClass = null; + + /** + * + * + * @generated + */ + private EClass bpmnShapeEClass = null; + + /** + * + * + * @generated + */ + private EEnum messageVisibleKindEEnum = null; + + /** + * + * + * @generated + */ + private EEnum participantBandKindEEnum = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.bpmn2.di.BpmnDiPackage#eNS_URI + * @see #init() + * @generated + */ + private BpmnDiPackageImpl() { + super(eNS_URI, BpmnDiFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link BpmnDiPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static BpmnDiPackage init() { + if (isInited) + return (BpmnDiPackage) EPackage.Registry.INSTANCE.getEPackage(BpmnDiPackage.eNS_URI); + + initializeRegistryHelpers(); + + // Obtain or create and register package + Object registeredBpmnDiPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + BpmnDiPackageImpl theBpmnDiPackage = registeredBpmnDiPackage instanceof BpmnDiPackageImpl + ? (BpmnDiPackageImpl) registeredBpmnDiPackage + : new BpmnDiPackageImpl(); + + isInited = true; + + // Obtain or create and register interdependencies + Object registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Bpmn2Package.eNS_URI); + Bpmn2PackageImpl theBpmn2Package = (Bpmn2PackageImpl) (registeredPackage instanceof Bpmn2PackageImpl + ? registeredPackage + : Bpmn2Package.eINSTANCE); + registeredPackage = EPackage.Registry.INSTANCE.getEPackage(DiPackage.eNS_URI); + DiPackageImpl theDiPackage = (DiPackageImpl) (registeredPackage instanceof DiPackageImpl ? registeredPackage + : DiPackage.eINSTANCE); + registeredPackage = EPackage.Registry.INSTANCE.getEPackage(DcPackage.eNS_URI); + DcPackageImpl theDcPackage = (DcPackageImpl) (registeredPackage instanceof DcPackageImpl ? registeredPackage + : DcPackage.eINSTANCE); + + // Create package meta-data objects + theBpmnDiPackage.createPackageContents(); + theBpmn2Package.createPackageContents(); + theDiPackage.createPackageContents(); + theDcPackage.createPackageContents(); + + // Initialize created meta-data + theBpmnDiPackage.initializePackageContents(); + theBpmn2Package.initializePackageContents(); + theDiPackage.initializePackageContents(); + theDcPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theBpmnDiPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(BpmnDiPackage.eNS_URI, theBpmnDiPackage); + return theBpmnDiPackage; + } + + /** + * + * + * @generated + */ + public static void initializeRegistryHelpers() { + Reflect.register(DocumentRoot.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DocumentRoot; + } + + public Object newArrayInstance(int size) { + return new DocumentRoot[size]; + } + }); + Reflect.register(BPMNDiagram.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof BPMNDiagram; + } + + public Object newArrayInstance(int size) { + return new BPMNDiagram[size]; + } + }); + Reflect.register(BPMNEdge.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof BPMNEdge; + } + + public Object newArrayInstance(int size) { + return new BPMNEdge[size]; + } + }); + Reflect.register(BPMNLabel.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof BPMNLabel; + } + + public Object newArrayInstance(int size) { + return new BPMNLabel[size]; + } + }); + Reflect.register(BPMNLabelStyle.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof BPMNLabelStyle; + } + + public Object newArrayInstance(int size) { + return new BPMNLabelStyle[size]; + } + }); + Reflect.register(BPMNPlane.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof BPMNPlane; + } + + public Object newArrayInstance(int size) { + return new BPMNPlane[size]; + } + }); + Reflect.register(BPMNShape.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof BPMNShape; + } + + public Object newArrayInstance(int size) { + return new BPMNShape[size]; + } + }); + Reflect.register(MessageVisibleKind.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof MessageVisibleKind; + } + + public Object newArrayInstance(int size) { + return new MessageVisibleKind[size]; + } + }); + Reflect.register(ParticipantBandKind.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ParticipantBandKind; + } + + public Object newArrayInstance(int size) { + return new ParticipantBandKind[size]; + } + }); + } + + /** + * + * + * @generated + */ + public static class WhiteList implements IsSerializable, EBasicWhiteList { + /** + * + * + * @generated + */ + protected DocumentRoot documentRoot; + + /** + * + * + * @generated + */ + protected BPMNDiagram bpmnDiagram; + + /** + * + * + * @generated + */ + protected BPMNEdge bpmnEdge; + + /** + * + * + * @generated + */ + protected BPMNLabel bpmnLabel; + + /** + * + * + * @generated + */ + protected BPMNLabelStyle bpmnLabelStyle; + + /** + * + * + * @generated + */ + protected BPMNPlane bpmnPlane; + + /** + * + * + * @generated + */ + protected BPMNShape bpmnShape; + + /** + * + * + * @generated + */ + protected MessageVisibleKind messageVisibleKind; + + /** + * + * + * @generated + */ + protected ParticipantBandKind participantBandKind; + + } + + /** + * + * + * @generated + */ + @Override + public EClass getDocumentRoot() { + return documentRootEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDocumentRoot_Mixed() { + return (EAttribute) documentRootEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_XMLNSPrefixMap() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_XSISchemaLocation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BPMNDiagram() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BPMNEdge() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BPMNLabel() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BPMNLabelStyle() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BPMNPlane() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BPMNShape() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBPMNDiagram() { + return bpmnDiagramEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getBPMNDiagram_Plane() { + return (EReference) bpmnDiagramEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getBPMNDiagram_LabelStyle() { + return (EReference) bpmnDiagramEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBPMNEdge() { + return bpmnEdgeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getBPMNEdge_Label() { + return (EReference) bpmnEdgeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getBPMNEdge_BpmnElement() { + return (EReference) bpmnEdgeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBPMNEdge_MessageVisibleKind() { + return (EAttribute) bpmnEdgeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getBPMNEdge_SourceElement() { + return (EReference) bpmnEdgeEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getBPMNEdge_TargetElement() { + return (EReference) bpmnEdgeEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBPMNLabel() { + return bpmnLabelEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getBPMNLabel_LabelStyle() { + return (EReference) bpmnLabelEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBPMNLabelStyle() { + return bpmnLabelStyleEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getBPMNLabelStyle_Font() { + return (EReference) bpmnLabelStyleEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBPMNPlane() { + return bpmnPlaneEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getBPMNPlane_BpmnElement() { + return (EReference) bpmnPlaneEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBPMNShape() { + return bpmnShapeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getBPMNShape_Label() { + return (EReference) bpmnShapeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getBPMNShape_BpmnElement() { + return (EReference) bpmnShapeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getBPMNShape_ChoreographyActivityShape() { + return (EReference) bpmnShapeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBPMNShape_IsExpanded() { + return (EAttribute) bpmnShapeEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBPMNShape_IsHorizontal() { + return (EAttribute) bpmnShapeEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBPMNShape_IsMarkerVisible() { + return (EAttribute) bpmnShapeEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBPMNShape_IsMessageVisible() { + return (EAttribute) bpmnShapeEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBPMNShape_ParticipantBandKind() { + return (EAttribute) bpmnShapeEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + @Override + public EEnum getMessageVisibleKind() { + return messageVisibleKindEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getParticipantBandKind() { + return participantBandKindEEnum; + } + + /** + * + * + * @generated + */ + @Override + public BpmnDiFactory getBpmnDiFactory() { + return (BpmnDiFactory) getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) + return; + isCreated = true; + + // Create classes and their features + documentRootEClass = createEClass(DOCUMENT_ROOT); + createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED); + createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP); + createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__BPMN_DIAGRAM); + createEReference(documentRootEClass, DOCUMENT_ROOT__BPMN_EDGE); + createEReference(documentRootEClass, DOCUMENT_ROOT__BPMN_LABEL); + createEReference(documentRootEClass, DOCUMENT_ROOT__BPMN_LABEL_STYLE); + createEReference(documentRootEClass, DOCUMENT_ROOT__BPMN_PLANE); + createEReference(documentRootEClass, DOCUMENT_ROOT__BPMN_SHAPE); + + bpmnDiagramEClass = createEClass(BPMN_DIAGRAM); + createEReference(bpmnDiagramEClass, BPMN_DIAGRAM__PLANE); + createEReference(bpmnDiagramEClass, BPMN_DIAGRAM__LABEL_STYLE); + + bpmnEdgeEClass = createEClass(BPMN_EDGE); + createEReference(bpmnEdgeEClass, BPMN_EDGE__LABEL); + createEReference(bpmnEdgeEClass, BPMN_EDGE__BPMN_ELEMENT); + createEAttribute(bpmnEdgeEClass, BPMN_EDGE__MESSAGE_VISIBLE_KIND); + createEReference(bpmnEdgeEClass, BPMN_EDGE__SOURCE_ELEMENT); + createEReference(bpmnEdgeEClass, BPMN_EDGE__TARGET_ELEMENT); + + bpmnLabelEClass = createEClass(BPMN_LABEL); + createEReference(bpmnLabelEClass, BPMN_LABEL__LABEL_STYLE); + + bpmnLabelStyleEClass = createEClass(BPMN_LABEL_STYLE); + createEReference(bpmnLabelStyleEClass, BPMN_LABEL_STYLE__FONT); + + bpmnPlaneEClass = createEClass(BPMN_PLANE); + createEReference(bpmnPlaneEClass, BPMN_PLANE__BPMN_ELEMENT); + + bpmnShapeEClass = createEClass(BPMN_SHAPE); + createEReference(bpmnShapeEClass, BPMN_SHAPE__LABEL); + createEReference(bpmnShapeEClass, BPMN_SHAPE__BPMN_ELEMENT); + createEReference(bpmnShapeEClass, BPMN_SHAPE__CHOREOGRAPHY_ACTIVITY_SHAPE); + createEAttribute(bpmnShapeEClass, BPMN_SHAPE__IS_EXPANDED); + createEAttribute(bpmnShapeEClass, BPMN_SHAPE__IS_HORIZONTAL); + createEAttribute(bpmnShapeEClass, BPMN_SHAPE__IS_MARKER_VISIBLE); + createEAttribute(bpmnShapeEClass, BPMN_SHAPE__IS_MESSAGE_VISIBLE); + createEAttribute(bpmnShapeEClass, BPMN_SHAPE__PARTICIPANT_BAND_KIND); + + // Create enums + messageVisibleKindEEnum = createEEnum(MESSAGE_VISIBLE_KIND); + participantBandKindEEnum = createEEnum(PARTICIPANT_BAND_KIND); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) + return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + DiPackage theDiPackage = (DiPackage) EPackage.Registry.INSTANCE.getEPackage(DiPackage.eNS_URI); + Bpmn2Package theBpmn2Package = (Bpmn2Package) EPackage.Registry.INSTANCE.getEPackage(Bpmn2Package.eNS_URI); + DcPackage theDcPackage = (DcPackage) EPackage.Registry.INSTANCE.getEPackage(DcPackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + bpmnDiagramEClass.getESuperTypes().add(theDiPackage.getDiagram()); + bpmnEdgeEClass.getESuperTypes().add(theDiPackage.getLabeledEdge()); + bpmnLabelEClass.getESuperTypes().add(theDiPackage.getLabel()); + bpmnLabelStyleEClass.getESuperTypes().add(theDiPackage.getStyle()); + bpmnPlaneEClass.getESuperTypes().add(theDiPackage.getPlane()); + bpmnShapeEClass.getESuperTypes().add(theDiPackage.getLabeledShape()); + + // Initialize classes and features; add operations and parameters + initEClass(documentRootEClass, DocumentRoot.class, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, + "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, + "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BPMNDiagram(), this.getBPMNDiagram(), null, "bPMNDiagram", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BPMNEdge(), this.getBPMNEdge(), null, "bPMNEdge", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BPMNLabel(), this.getBPMNLabel(), null, "bPMNLabel", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BPMNLabelStyle(), this.getBPMNLabelStyle(), null, "bPMNLabelStyle", null, 0, -2, + null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BPMNPlane(), this.getBPMNPlane(), null, "bPMNPlane", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BPMNShape(), this.getBPMNShape(), null, "bPMNShape", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + + initEClass(bpmnDiagramEClass, BPMNDiagram.class, "BPMNDiagram", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getBPMNDiagram_Plane(), this.getBPMNPlane(), null, "plane", null, 1, 1, BPMNDiagram.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getBPMNDiagram_LabelStyle(), this.getBPMNLabelStyle(), null, "labelStyle", null, 0, -1, + BPMNDiagram.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(bpmnEdgeEClass, BPMNEdge.class, "BPMNEdge", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getBPMNEdge_Label(), this.getBPMNLabel(), null, "label", null, 0, 1, BPMNEdge.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getBPMNEdge_BpmnElement(), theBpmn2Package.getBaseElement(), null, "bpmnElement", null, 0, 1, + BPMNEdge.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getBPMNEdge_MessageVisibleKind(), this.getMessageVisibleKind(), "messageVisibleKind", null, 0, 1, + BPMNEdge.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEReference(getBPMNEdge_SourceElement(), theDiPackage.getDiagramElement(), null, "sourceElement", null, 0, 1, + BPMNEdge.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getBPMNEdge_TargetElement(), theDiPackage.getDiagramElement(), null, "targetElement", null, 0, 1, + BPMNEdge.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(bpmnLabelEClass, BPMNLabel.class, "BPMNLabel", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getBPMNLabel_LabelStyle(), this.getBPMNLabelStyle(), null, "labelStyle", null, 0, 1, + BPMNLabel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(bpmnLabelStyleEClass, BPMNLabelStyle.class, "BPMNLabelStyle", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getBPMNLabelStyle_Font(), theDcPackage.getFont(), null, "font", null, 1, 1, BPMNLabelStyle.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(bpmnPlaneEClass, BPMNPlane.class, "BPMNPlane", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getBPMNPlane_BpmnElement(), theBpmn2Package.getBaseElement(), null, "bpmnElement", null, 0, 1, + BPMNPlane.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(bpmnShapeEClass, BPMNShape.class, "BPMNShape", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getBPMNShape_Label(), this.getBPMNLabel(), null, "label", null, 0, 1, BPMNShape.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getBPMNShape_BpmnElement(), theBpmn2Package.getBaseElement(), null, "bpmnElement", null, 0, 1, + BPMNShape.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getBPMNShape_ChoreographyActivityShape(), this.getBPMNShape(), null, "choreographyActivityShape", + null, 0, 1, BPMNShape.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getBPMNShape_IsExpanded(), ecorePackage.getEBoolean(), "isExpanded", null, 0, 1, BPMNShape.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getBPMNShape_IsHorizontal(), ecorePackage.getEBoolean(), "isHorizontal", null, 0, 1, + BPMNShape.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getBPMNShape_IsMarkerVisible(), ecorePackage.getEBoolean(), "isMarkerVisible", null, 0, 1, + BPMNShape.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getBPMNShape_IsMessageVisible(), ecorePackage.getEBoolean(), "isMessageVisible", null, 0, 1, + BPMNShape.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getBPMNShape_ParticipantBandKind(), this.getParticipantBandKind(), "participantBandKind", null, + 0, 1, BPMNShape.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + // Initialize enums and add enum literals + initEEnum(messageVisibleKindEEnum, MessageVisibleKind.class, "MessageVisibleKind"); + addEEnumLiteral(messageVisibleKindEEnum, MessageVisibleKind.INITIATING); + addEEnumLiteral(messageVisibleKindEEnum, MessageVisibleKind.NON_INITIATING); + + initEEnum(participantBandKindEEnum, ParticipantBandKind.class, "ParticipantBandKind"); + addEEnumLiteral(participantBandKindEEnum, ParticipantBandKind.TOP_INITIATING); + addEEnumLiteral(participantBandKindEEnum, ParticipantBandKind.MIDDLE_INITIATING); + addEEnumLiteral(participantBandKindEEnum, ParticipantBandKind.BOTTOM_INITIATING); + addEEnumLiteral(participantBandKindEEnum, ParticipantBandKind.TOP_NON_INITIATING); + addEEnumLiteral(participantBandKindEEnum, ParticipantBandKind.MIDDLE_NON_INITIATING); + addEEnumLiteral(participantBandKindEEnum, ParticipantBandKind.BOTTOM_NON_INITIATING); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http:///org/eclipse/emf/ecore/util/ExtendedMetaData + createExtendedMetaDataAnnotations(); + } + + /** + * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. + * + * + * @generated + */ + protected void createExtendedMetaDataAnnotations() { + String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; + addAnnotation(documentRootEClass, source, new String[] { "name", "", "kind", "mixed" }); + addAnnotation(getDocumentRoot_Mixed(), source, new String[] { "kind", "elementWildcard", "name", ":mixed" }); + addAnnotation(getDocumentRoot_XMLNSPrefixMap(), source, + new String[] { "kind", "attribute", "name", "xmlns:prefix" }); + addAnnotation(getDocumentRoot_XSISchemaLocation(), source, + new String[] { "kind", "attribute", "name", "xsi:schemaLocation" }); + addAnnotation(getDocumentRoot_BPMNDiagram(), source, new String[] { "kind", "element", "name", "BPMNDiagram", + "namespace", "http://www.omg.org/spec/BPMN/20100524/DI" }); + addAnnotation(getDocumentRoot_BPMNEdge(), source, + new String[] { "kind", "element", "name", "BPMNEdge", "namespace", + "http://www.omg.org/spec/BPMN/20100524/DI", "affiliation", + "http://www.omg.org/spec/DD/20100524/DI#DiagramElement" }); + addAnnotation(getDocumentRoot_BPMNLabel(), source, new String[] { "kind", "element", "name", "BPMNLabel", + "namespace", "http://www.omg.org/spec/BPMN/20100524/DI" }); + addAnnotation(getDocumentRoot_BPMNLabelStyle(), source, new String[] { "kind", "element", "name", + "BPMNLabelStyle", "namespace", "http://www.omg.org/spec/BPMN/20100524/DI" }); + addAnnotation(getDocumentRoot_BPMNPlane(), source, new String[] { "kind", "element", "name", "BPMNPlane", + "namespace", "http://www.omg.org/spec/BPMN/20100524/DI" }); + addAnnotation(getDocumentRoot_BPMNShape(), source, + new String[] { "kind", "element", "name", "BPMNShape", "namespace", + "http://www.omg.org/spec/BPMN/20100524/DI", "affiliation", + "http://www.omg.org/spec/DD/20100524/DI#DiagramElement" }); + addAnnotation(bpmnDiagramEClass, source, new String[] { "name", "BPMNDiagram", "kind", "elementOnly" }); + addAnnotation(getBPMNDiagram_Plane(), source, new String[] { "kind", "element", "name", "BPMNPlane", + "namespace", "http://www.omg.org/spec/BPMN/20100524/DI" }); + addAnnotation(getBPMNDiagram_LabelStyle(), source, new String[] { "kind", "element", "name", "BPMNLabelStyle", + "namespace", "http://www.omg.org/spec/BPMN/20100524/DI" }); + addAnnotation(bpmnEdgeEClass, source, new String[] { "name", "BPMNEdge", "kind", "elementOnly" }); + addAnnotation(getBPMNEdge_Label(), source, new String[] { "kind", "element", "name", "BPMNLabel", "namespace", + "http://www.omg.org/spec/BPMN/20100524/DI" }); + addAnnotation(getBPMNEdge_BpmnElement(), source, new String[] { "kind", "attribute", "name", "bpmnElement" }); + addAnnotation(getBPMNEdge_MessageVisibleKind(), source, + new String[] { "kind", "attribute", "name", "messageVisibleKind" }); + addAnnotation(getBPMNEdge_SourceElement(), source, + new String[] { "kind", "attribute", "name", "sourceElement" }); + addAnnotation(getBPMNEdge_TargetElement(), source, + new String[] { "kind", "attribute", "name", "targetElement" }); + addAnnotation(bpmnLabelEClass, source, new String[] { "name", "BPMNLabel", "kind", "elementOnly" }); + addAnnotation(getBPMNLabel_LabelStyle(), source, new String[] { "kind", "attribute", "name", "labelStyle" }); + addAnnotation(bpmnLabelStyleEClass, source, new String[] { "name", "BPMNLabelStyle", "kind", "elementOnly" }); + addAnnotation(getBPMNLabelStyle_Font(), source, new String[] { "kind", "element", "name", "Font", "namespace", + "http://www.omg.org/spec/DD/20100524/DC" }); + addAnnotation(bpmnPlaneEClass, source, new String[] { "name", "BPMNPlane", "kind", "elementOnly" }); + addAnnotation(getBPMNPlane_BpmnElement(), source, new String[] { "kind", "attribute", "name", "bpmnElement" }); + addAnnotation(bpmnShapeEClass, source, new String[] { "name", "BPMNShape", "kind", "elementOnly" }); + addAnnotation(getBPMNShape_Label(), source, new String[] { "kind", "element", "name", "BPMNLabel", "namespace", + "http://www.omg.org/spec/BPMN/20100524/DI" }); + addAnnotation(getBPMNShape_BpmnElement(), source, new String[] { "kind", "attribute", "name", "bpmnElement" }); + addAnnotation(getBPMNShape_ChoreographyActivityShape(), source, + new String[] { "kind", "attribute", "name", "choreographyActivityShape" }); + addAnnotation(getBPMNShape_IsExpanded(), source, new String[] { "kind", "attribute", "name", "isExpanded" }); + addAnnotation(getBPMNShape_IsHorizontal(), source, + new String[] { "kind", "attribute", "name", "isHorizontal" }); + addAnnotation(getBPMNShape_IsMarkerVisible(), source, + new String[] { "kind", "attribute", "name", "isMarkerVisible" }); + addAnnotation(getBPMNShape_IsMessageVisible(), source, + new String[] { "kind", "attribute", "name", "isMessageVisible" }); + addAnnotation(getBPMNShape_ParticipantBandKind(), source, + new String[] { "kind", "attribute", "name", "participantBandKind" }); + } + +} //BpmnDiPackageImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/DocumentRootImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/DocumentRootImpl.java new file mode 100644 index 00000000000..09ff988d283 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/impl/DocumentRootImpl.java @@ -0,0 +1,534 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.di.BPMNLabel; +import org.eclipse.bpmn2.di.BPMNLabelStyle; +import org.eclipse.bpmn2.di.BPMNPlane; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.bpmn2.di.BpmnDiPackage; +import org.eclipse.bpmn2.di.DocumentRoot; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EMap; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.EcoreEMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Document Root'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.di.impl.DocumentRootImpl#getMixed Mixed}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.DocumentRootImpl#getXMLNSPrefixMap XMLNS Prefix Map}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.DocumentRootImpl#getXSISchemaLocation XSI Schema Location}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.DocumentRootImpl#getBPMNDiagram BPMN Diagram}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.DocumentRootImpl#getBPMNEdge BPMN Edge}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.DocumentRootImpl#getBPMNLabel BPMN Label}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.DocumentRootImpl#getBPMNLabelStyle BPMN Label Style}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.DocumentRootImpl#getBPMNPlane BPMN Plane}
  • + *
  • {@link org.eclipse.bpmn2.di.impl.DocumentRootImpl#getBPMNShape BPMN Shape}
  • + *
+ * + * @generated + */ +public class DocumentRootImpl extends EObjectImpl implements DocumentRoot { + /** + * The cached value of the '{@link #getMixed() Mixed}' attribute list. + * + * + * @see #getMixed() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap mixed; + + /** + * The cached value of the '{@link #getXMLNSPrefixMap() XMLNS Prefix Map}' map. + * + * + * @see #getXMLNSPrefixMap() + * @generated + * @ordered + */ + @GwtTransient + protected EMap xMLNSPrefixMap; + + /** + * The cached value of the '{@link #getXSISchemaLocation() XSI Schema Location}' map. + * + * + * @see #getXSISchemaLocation() + * @generated + * @ordered + */ + @GwtTransient + protected EMap xSISchemaLocation; + + /** + * + * + * @generated + */ + protected DocumentRootImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return BpmnDiPackage.Literals.DOCUMENT_ROOT; + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getMixed() { + if (mixed == null) { + mixed = new BasicFeatureMap(this, BpmnDiPackage.DOCUMENT_ROOT__MIXED); + } + return mixed; + } + + /** + * + * + * @generated + */ + @Override + public EMap getXMLNSPrefixMap() { + if (xMLNSPrefixMap == null) { + xMLNSPrefixMap = new EcoreEMap(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, + EStringToStringMapEntryImpl.class, this, BpmnDiPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP); + } + return xMLNSPrefixMap; + } + + /** + * + * + * @generated + */ + @Override + public EMap getXSISchemaLocation() { + if (xSISchemaLocation == null) { + xSISchemaLocation = new EcoreEMap(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, + EStringToStringMapEntryImpl.class, this, BpmnDiPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); + } + return xSISchemaLocation; + } + + /** + * + * + * @generated + */ + @Override + public BPMNDiagram getBPMNDiagram() { + return (BPMNDiagram) getMixed().get(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_DIAGRAM, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBPMNDiagram(BPMNDiagram newBPMNDiagram, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_DIAGRAM, + newBPMNDiagram, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBPMNDiagram(BPMNDiagram newBPMNDiagram) { + ((FeatureMap.Internal) getMixed()).set(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_DIAGRAM, newBPMNDiagram); + } + + /** + * + * + * @generated + */ + @Override + public BPMNEdge getBPMNEdge() { + return (BPMNEdge) getMixed().get(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_EDGE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBPMNEdge(BPMNEdge newBPMNEdge, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_EDGE, newBPMNEdge, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBPMNEdge(BPMNEdge newBPMNEdge) { + ((FeatureMap.Internal) getMixed()).set(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_EDGE, newBPMNEdge); + } + + /** + * + * + * @generated + */ + @Override + public BPMNLabel getBPMNLabel() { + return (BPMNLabel) getMixed().get(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_LABEL, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBPMNLabel(BPMNLabel newBPMNLabel, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_LABEL, + newBPMNLabel, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBPMNLabel(BPMNLabel newBPMNLabel) { + ((FeatureMap.Internal) getMixed()).set(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_LABEL, newBPMNLabel); + } + + /** + * + * + * @generated + */ + @Override + public BPMNLabelStyle getBPMNLabelStyle() { + return (BPMNLabelStyle) getMixed().get(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_LABEL_STYLE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBPMNLabelStyle(BPMNLabelStyle newBPMNLabelStyle, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_LABEL_STYLE, + newBPMNLabelStyle, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBPMNLabelStyle(BPMNLabelStyle newBPMNLabelStyle) { + ((FeatureMap.Internal) getMixed()).set(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_LABEL_STYLE, + newBPMNLabelStyle); + } + + /** + * + * + * @generated + */ + @Override + public BPMNPlane getBPMNPlane() { + return (BPMNPlane) getMixed().get(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_PLANE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBPMNPlane(BPMNPlane newBPMNPlane, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_PLANE, + newBPMNPlane, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBPMNPlane(BPMNPlane newBPMNPlane) { + ((FeatureMap.Internal) getMixed()).set(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_PLANE, newBPMNPlane); + } + + /** + * + * + * @generated + */ + @Override + public BPMNShape getBPMNShape() { + return (BPMNShape) getMixed().get(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_SHAPE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBPMNShape(BPMNShape newBPMNShape, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_SHAPE, + newBPMNShape, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBPMNShape(BPMNShape newBPMNShape) { + ((FeatureMap.Internal) getMixed()).set(BpmnDiPackage.Literals.DOCUMENT_ROOT__BPMN_SHAPE, newBPMNShape); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BpmnDiPackage.DOCUMENT_ROOT__MIXED: + return ((InternalEList) getMixed()).basicRemove(otherEnd, msgs); + case BpmnDiPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + return ((InternalEList) getXMLNSPrefixMap()).basicRemove(otherEnd, msgs); + case BpmnDiPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + return ((InternalEList) getXSISchemaLocation()).basicRemove(otherEnd, msgs); + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_DIAGRAM: + return basicSetBPMNDiagram(null, msgs); + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_EDGE: + return basicSetBPMNEdge(null, msgs); + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_LABEL: + return basicSetBPMNLabel(null, msgs); + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_LABEL_STYLE: + return basicSetBPMNLabelStyle(null, msgs); + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_PLANE: + return basicSetBPMNPlane(null, msgs); + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_SHAPE: + return basicSetBPMNShape(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BpmnDiPackage.DOCUMENT_ROOT__MIXED: + if (coreType) + return getMixed(); + return ((FeatureMap.Internal) getMixed()).getWrapper(); + case BpmnDiPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + if (coreType) + return getXMLNSPrefixMap(); + else + return getXMLNSPrefixMap().map(); + case BpmnDiPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + if (coreType) + return getXSISchemaLocation(); + else + return getXSISchemaLocation().map(); + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_DIAGRAM: + return getBPMNDiagram(); + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_EDGE: + return getBPMNEdge(); + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_LABEL: + return getBPMNLabel(); + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_LABEL_STYLE: + return getBPMNLabelStyle(); + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_PLANE: + return getBPMNPlane(); + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_SHAPE: + return getBPMNShape(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BpmnDiPackage.DOCUMENT_ROOT__MIXED: + ((FeatureMap.Internal) getMixed()).set(newValue); + return; + case BpmnDiPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + ((EStructuralFeature.Setting) getXMLNSPrefixMap()).set(newValue); + return; + case BpmnDiPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + ((EStructuralFeature.Setting) getXSISchemaLocation()).set(newValue); + return; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_DIAGRAM: + setBPMNDiagram((BPMNDiagram) newValue); + return; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_EDGE: + setBPMNEdge((BPMNEdge) newValue); + return; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_LABEL: + setBPMNLabel((BPMNLabel) newValue); + return; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_LABEL_STYLE: + setBPMNLabelStyle((BPMNLabelStyle) newValue); + return; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_PLANE: + setBPMNPlane((BPMNPlane) newValue); + return; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_SHAPE: + setBPMNShape((BPMNShape) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BpmnDiPackage.DOCUMENT_ROOT__MIXED: + getMixed().clear(); + return; + case BpmnDiPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + getXMLNSPrefixMap().clear(); + return; + case BpmnDiPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + getXSISchemaLocation().clear(); + return; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_DIAGRAM: + setBPMNDiagram((BPMNDiagram) null); + return; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_EDGE: + setBPMNEdge((BPMNEdge) null); + return; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_LABEL: + setBPMNLabel((BPMNLabel) null); + return; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_LABEL_STYLE: + setBPMNLabelStyle((BPMNLabelStyle) null); + return; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_PLANE: + setBPMNPlane((BPMNPlane) null); + return; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_SHAPE: + setBPMNShape((BPMNShape) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BpmnDiPackage.DOCUMENT_ROOT__MIXED: + return mixed != null && !mixed.isEmpty(); + case BpmnDiPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty(); + case BpmnDiPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + return xSISchemaLocation != null && !xSISchemaLocation.isEmpty(); + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_DIAGRAM: + return getBPMNDiagram() != null; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_EDGE: + return getBPMNEdge() != null; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_LABEL: + return getBPMNLabel() != null; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_LABEL_STYLE: + return getBPMNLabelStyle() != null; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_PLANE: + return getBPMNPlane() != null; + case BpmnDiPackage.DOCUMENT_ROOT__BPMN_SHAPE: + return getBPMNShape() != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (mixed: "); + result.append(mixed); + result.append(')'); + return result.toString(); + } + +} //DocumentRootImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/util/BpmnDiAdapterFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/util/BpmnDiAdapterFactory.java new file mode 100644 index 00000000000..a303b302604 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/util/BpmnDiAdapterFactory.java @@ -0,0 +1,446 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di.util; + +import org.eclipse.bpmn2.di.*; + +import org.eclipse.dd.di.Diagram; +import org.eclipse.dd.di.DiagramElement; +import org.eclipse.dd.di.Edge; +import org.eclipse.dd.di.Label; +import org.eclipse.dd.di.LabeledEdge; +import org.eclipse.dd.di.LabeledShape; +import org.eclipse.dd.di.Node; +import org.eclipse.dd.di.Plane; +import org.eclipse.dd.di.Shape; +import org.eclipse.dd.di.Style; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see org.eclipse.bpmn2.di.BpmnDiPackage + * @generated + */ +public class BpmnDiAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static BpmnDiPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public BpmnDiAdapterFactory() { + if (modelPackage == null) { + modelPackage = BpmnDiPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject) object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected BpmnDiSwitch modelSwitch = new BpmnDiSwitch() { + @Override + public Adapter caseDocumentRoot(DocumentRoot object) { + return createDocumentRootAdapter(); + } + + @Override + public Adapter caseBPMNDiagram(BPMNDiagram object) { + return createBPMNDiagramAdapter(); + } + + @Override + public Adapter caseBPMNEdge(BPMNEdge object) { + return createBPMNEdgeAdapter(); + } + + @Override + public Adapter caseBPMNLabel(BPMNLabel object) { + return createBPMNLabelAdapter(); + } + + @Override + public Adapter caseBPMNLabelStyle(BPMNLabelStyle object) { + return createBPMNLabelStyleAdapter(); + } + + @Override + public Adapter caseBPMNPlane(BPMNPlane object) { + return createBPMNPlaneAdapter(); + } + + @Override + public Adapter caseBPMNShape(BPMNShape object) { + return createBPMNShapeAdapter(); + } + + @Override + public Adapter caseDiagram(Diagram object) { + return createDiagramAdapter(); + } + + @Override + public Adapter caseDiagramElement(DiagramElement object) { + return createDiagramElementAdapter(); + } + + @Override + public Adapter caseEdge(Edge object) { + return createEdgeAdapter(); + } + + @Override + public Adapter caseLabeledEdge(LabeledEdge object) { + return createLabeledEdgeAdapter(); + } + + @Override + public Adapter caseNode(Node object) { + return createNodeAdapter(); + } + + @Override + public Adapter caseLabel(Label object) { + return createLabelAdapter(); + } + + @Override + public Adapter caseStyle(Style object) { + return createStyleAdapter(); + } + + @Override + public Adapter casePlane(Plane object) { + return createPlaneAdapter(); + } + + @Override + public Adapter caseShape(Shape object) { + return createShapeAdapter(); + } + + @Override + public Adapter caseLabeledShape(LabeledShape object) { + return createLabeledShapeAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject) target); + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.di.DocumentRoot Document Root}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.di.DocumentRoot + * @generated + */ + public Adapter createDocumentRootAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.di.BPMNDiagram BPMN Diagram}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.di.BPMNDiagram + * @generated + */ + public Adapter createBPMNDiagramAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.di.BPMNEdge BPMN Edge}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.di.BPMNEdge + * @generated + */ + public Adapter createBPMNEdgeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.di.BPMNLabel BPMN Label}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.di.BPMNLabel + * @generated + */ + public Adapter createBPMNLabelAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.di.BPMNLabelStyle BPMN Label Style}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.di.BPMNLabelStyle + * @generated + */ + public Adapter createBPMNLabelStyleAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.di.BPMNPlane BPMN Plane}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.di.BPMNPlane + * @generated + */ + public Adapter createBPMNPlaneAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.di.BPMNShape BPMN Shape}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.di.BPMNShape + * @generated + */ + public Adapter createBPMNShapeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.di.Diagram Diagram}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.di.Diagram + * @generated + */ + public Adapter createDiagramAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.di.DiagramElement Diagram Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.di.DiagramElement + * @generated + */ + public Adapter createDiagramElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.di.Edge Edge}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.di.Edge + * @generated + */ + public Adapter createEdgeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.di.LabeledEdge Labeled Edge}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.di.LabeledEdge + * @generated + */ + public Adapter createLabeledEdgeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.di.Node Node}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.di.Node + * @generated + */ + public Adapter createNodeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.di.Label Label}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.di.Label + * @generated + */ + public Adapter createLabelAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.di.Style Style}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.di.Style + * @generated + */ + public Adapter createStyleAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.di.Plane Plane}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.di.Plane + * @generated + */ + public Adapter createPlaneAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.di.Shape Shape}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.di.Shape + * @generated + */ + public Adapter createShapeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.di.LabeledShape Labeled Shape}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.di.LabeledShape + * @generated + */ + public Adapter createLabeledShapeAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //BpmnDiAdapterFactory diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/util/BpmnDiSwitch.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/util/BpmnDiSwitch.java new file mode 100644 index 00000000000..400d74d0c43 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/di/util/BpmnDiSwitch.java @@ -0,0 +1,459 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.di.util; + +import java.util.List; + +import org.eclipse.bpmn2.di.*; + +import org.eclipse.dd.di.Diagram; +import org.eclipse.dd.di.DiagramElement; +import org.eclipse.dd.di.Edge; +import org.eclipse.dd.di.Label; +import org.eclipse.dd.di.LabeledEdge; +import org.eclipse.dd.di.LabeledShape; +import org.eclipse.dd.di.Node; +import org.eclipse.dd.di.Plane; +import org.eclipse.dd.di.Shape; +import org.eclipse.dd.di.Style; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see org.eclipse.bpmn2.di.BpmnDiPackage + * @generated + */ +public class BpmnDiSwitch { + /** + * The cached model package + * + * + * @generated + */ + protected static BpmnDiPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public BpmnDiSwitch() { + if (modelPackage == null) { + modelPackage = BpmnDiPackage.eINSTANCE; + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + public T doSwitch(EObject theEObject) { + return doSwitch(theEObject.eClass(), theEObject); + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected T doSwitch(EClass theEClass, EObject theEObject) { + if (theEClass.eContainer() == modelPackage) { + return doSwitch(theEClass.getClassifierID(), theEObject); + } else { + List eSuperTypes = theEClass.getESuperTypes(); + return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case BpmnDiPackage.DOCUMENT_ROOT: { + DocumentRoot documentRoot = (DocumentRoot) theEObject; + T result = caseDocumentRoot(documentRoot); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case BpmnDiPackage.BPMN_DIAGRAM: { + BPMNDiagram bpmnDiagram = (BPMNDiagram) theEObject; + T result = caseBPMNDiagram(bpmnDiagram); + if (result == null) + result = caseDiagram(bpmnDiagram); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case BpmnDiPackage.BPMN_EDGE: { + BPMNEdge bpmnEdge = (BPMNEdge) theEObject; + T result = caseBPMNEdge(bpmnEdge); + if (result == null) + result = caseLabeledEdge(bpmnEdge); + if (result == null) + result = caseEdge(bpmnEdge); + if (result == null) + result = caseDiagramElement(bpmnEdge); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case BpmnDiPackage.BPMN_LABEL: { + BPMNLabel bpmnLabel = (BPMNLabel) theEObject; + T result = caseBPMNLabel(bpmnLabel); + if (result == null) + result = caseLabel(bpmnLabel); + if (result == null) + result = caseNode(bpmnLabel); + if (result == null) + result = caseDiagramElement(bpmnLabel); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case BpmnDiPackage.BPMN_LABEL_STYLE: { + BPMNLabelStyle bpmnLabelStyle = (BPMNLabelStyle) theEObject; + T result = caseBPMNLabelStyle(bpmnLabelStyle); + if (result == null) + result = caseStyle(bpmnLabelStyle); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case BpmnDiPackage.BPMN_PLANE: { + BPMNPlane bpmnPlane = (BPMNPlane) theEObject; + T result = caseBPMNPlane(bpmnPlane); + if (result == null) + result = casePlane(bpmnPlane); + if (result == null) + result = caseNode(bpmnPlane); + if (result == null) + result = caseDiagramElement(bpmnPlane); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case BpmnDiPackage.BPMN_SHAPE: { + BPMNShape bpmnShape = (BPMNShape) theEObject; + T result = caseBPMNShape(bpmnShape); + if (result == null) + result = caseLabeledShape(bpmnShape); + if (result == null) + result = caseShape(bpmnShape); + if (result == null) + result = caseNode(bpmnShape); + if (result == null) + result = caseDiagramElement(bpmnShape); + if (result == null) + result = defaultCase(theEObject); + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Document Root'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Document Root'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDocumentRoot(DocumentRoot object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'BPMN Diagram'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'BPMN Diagram'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBPMNDiagram(BPMNDiagram object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'BPMN Edge'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'BPMN Edge'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBPMNEdge(BPMNEdge object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'BPMN Label'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'BPMN Label'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBPMNLabel(BPMNLabel object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'BPMN Label Style'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'BPMN Label Style'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBPMNLabelStyle(BPMNLabelStyle object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'BPMN Plane'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'BPMN Plane'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBPMNPlane(BPMNPlane object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'BPMN Shape'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'BPMN Shape'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBPMNShape(BPMNShape object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Diagram'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Diagram'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDiagram(Diagram object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Diagram Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Diagram Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDiagramElement(DiagramElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Edge'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Edge'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEdge(Edge object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Labeled Edge'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Labeled Edge'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseLabeledEdge(LabeledEdge object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Node'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Node'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseNode(Node object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Label'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Label'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseLabel(Label object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Style'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Style'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseStyle(Style object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Plane'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Plane'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePlane(Plane object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Shape'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Shape'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseShape(Shape object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Labeled Shape'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Labeled Shape'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseLabeledShape(LabeledShape object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + public T defaultCase(EObject object) { + return null; + } + +} //BpmnDiSwitch diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ActivityImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ActivityImpl.java new file mode 100644 index 00000000000..eaa4db8c034 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ActivityImpl.java @@ -0,0 +1,738 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.LoopCharacteristics; +import org.eclipse.bpmn2.Property; +import org.eclipse.bpmn2.ResourceRole; +import org.eclipse.bpmn2.SequenceFlow; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Activity'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ActivityImpl#getIoSpecification Io Specification}
  • + *
  • {@link org.eclipse.bpmn2.impl.ActivityImpl#getBoundaryEventRefs Boundary Event Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.ActivityImpl#getProperties Properties}
  • + *
  • {@link org.eclipse.bpmn2.impl.ActivityImpl#getDataInputAssociations Data Input Associations}
  • + *
  • {@link org.eclipse.bpmn2.impl.ActivityImpl#getDataOutputAssociations Data Output Associations}
  • + *
  • {@link org.eclipse.bpmn2.impl.ActivityImpl#getResources Resources}
  • + *
  • {@link org.eclipse.bpmn2.impl.ActivityImpl#getLoopCharacteristics Loop Characteristics}
  • + *
  • {@link org.eclipse.bpmn2.impl.ActivityImpl#getCompletionQuantity Completion Quantity}
  • + *
  • {@link org.eclipse.bpmn2.impl.ActivityImpl#getDefault Default}
  • + *
  • {@link org.eclipse.bpmn2.impl.ActivityImpl#isIsForCompensation Is For Compensation}
  • + *
  • {@link org.eclipse.bpmn2.impl.ActivityImpl#getStartQuantity Start Quantity}
  • + *
+ * + * @generated + */ +public class ActivityImpl extends FlowNodeImpl implements Activity { + /** + * The cached value of the '{@link #getIoSpecification() Io Specification}' containment reference. + * + * + * @see #getIoSpecification() + * @generated + * @ordered + */ + @GwtTransient + protected InputOutputSpecification ioSpecification; + + /** + * The cached value of the '{@link #getBoundaryEventRefs() Boundary Event Refs}' reference list. + * + * + * @see #getBoundaryEventRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList boundaryEventRefs; + + /** + * The cached value of the '{@link #getProperties() Properties}' containment reference list. + * + * + * @see #getProperties() + * @generated + * @ordered + */ + @GwtTransient + protected EList properties; + + /** + * The cached value of the '{@link #getDataInputAssociations() Data Input Associations}' containment reference list. + * + * + * @see #getDataInputAssociations() + * @generated + * @ordered + */ + @GwtTransient + protected EList dataInputAssociations; + + /** + * The cached value of the '{@link #getDataOutputAssociations() Data Output Associations}' containment reference list. + * + * + * @see #getDataOutputAssociations() + * @generated + * @ordered + */ + @GwtTransient + protected EList dataOutputAssociations; + + /** + * The cached value of the '{@link #getResources() Resources}' containment reference list. + * + * + * @see #getResources() + * @generated + * @ordered + */ + @GwtTransient + protected EList resources; + + /** + * The cached value of the '{@link #getLoopCharacteristics() Loop Characteristics}' containment reference. + * + * + * @see #getLoopCharacteristics() + * @generated + * @ordered + */ + @GwtTransient + protected LoopCharacteristics loopCharacteristics; + + /** + * The default value of the '{@link #getCompletionQuantity() Completion Quantity}' attribute. + * + * + * @see #getCompletionQuantity() + * @generated + * @ordered + */ + protected static final int COMPLETION_QUANTITY_EDEFAULT = 1; + + /** + * The cached value of the '{@link #getCompletionQuantity() Completion Quantity}' attribute. + * + * + * @see #getCompletionQuantity() + * @generated + * @ordered + */ + @GwtTransient + protected int completionQuantity = COMPLETION_QUANTITY_EDEFAULT; + + /** + * The cached value of the '{@link #getDefault() Default}' reference. + * + * + * @see #getDefault() + * @generated + * @ordered + */ + @GwtTransient + protected SequenceFlow default_; + + /** + * The default value of the '{@link #isIsForCompensation() Is For Compensation}' attribute. + * + * + * @see #isIsForCompensation() + * @generated + * @ordered + */ + protected static final boolean IS_FOR_COMPENSATION_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsForCompensation() Is For Compensation}' attribute. + * + * + * @see #isIsForCompensation() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isForCompensation = IS_FOR_COMPENSATION_EDEFAULT; + + /** + * The default value of the '{@link #getStartQuantity() Start Quantity}' attribute. + * + * + * @see #getStartQuantity() + * @generated + * @ordered + */ + protected static final int START_QUANTITY_EDEFAULT = 1; + + /** + * The cached value of the '{@link #getStartQuantity() Start Quantity}' attribute. + * + * + * @see #getStartQuantity() + * @generated + * @ordered + */ + @GwtTransient + protected int startQuantity = START_QUANTITY_EDEFAULT; + + /** + * + * + * @generated + */ + protected ActivityImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.ACTIVITY; + } + + /** + * + * + * @generated + */ + @Override + public InputOutputSpecification getIoSpecification() { + return ioSpecification; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetIoSpecification(InputOutputSpecification newIoSpecification, + NotificationChain msgs) { + InputOutputSpecification oldIoSpecification = ioSpecification; + ioSpecification = newIoSpecification; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.ACTIVITY__IO_SPECIFICATION, oldIoSpecification, newIoSpecification); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setIoSpecification(InputOutputSpecification newIoSpecification) { + if (newIoSpecification != ioSpecification) { + NotificationChain msgs = null; + if (ioSpecification != null) + msgs = ((InternalEObject) ioSpecification).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.ACTIVITY__IO_SPECIFICATION, null, msgs); + if (newIoSpecification != null) + msgs = ((InternalEObject) newIoSpecification).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.ACTIVITY__IO_SPECIFICATION, null, msgs); + msgs = basicSetIoSpecification(newIoSpecification, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ACTIVITY__IO_SPECIFICATION, + newIoSpecification, newIoSpecification)); + } + + /** + * + * + * @generated + */ + @Override + public EList getBoundaryEventRefs() { + if (boundaryEventRefs == null) { + boundaryEventRefs = new EObjectWithInverseEList(BoundaryEvent.class, this, + Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS, Bpmn2Package.BOUNDARY_EVENT__ATTACHED_TO_REF); + } + return boundaryEventRefs; + } + + /** + * + * + * @generated + */ + @Override + public EList getProperties() { + if (properties == null) { + properties = new EObjectContainmentEList(Property.class, this, Bpmn2Package.ACTIVITY__PROPERTIES); + } + return properties; + } + + /** + * + * + * @generated + */ + @Override + public EList getDataInputAssociations() { + if (dataInputAssociations == null) { + dataInputAssociations = new EObjectContainmentEList(DataInputAssociation.class, this, + Bpmn2Package.ACTIVITY__DATA_INPUT_ASSOCIATIONS); + } + return dataInputAssociations; + } + + /** + * + * + * @generated + */ + @Override + public EList getDataOutputAssociations() { + if (dataOutputAssociations == null) { + dataOutputAssociations = new EObjectContainmentEList(DataOutputAssociation.class, + this, Bpmn2Package.ACTIVITY__DATA_OUTPUT_ASSOCIATIONS); + } + return dataOutputAssociations; + } + + /** + * + * + * @generated + */ + @Override + public EList getResources() { + if (resources == null) { + resources = new EObjectContainmentEList(ResourceRole.class, this, + Bpmn2Package.ACTIVITY__RESOURCES); + } + return resources; + } + + /** + * + * + * @generated + */ + @Override + public LoopCharacteristics getLoopCharacteristics() { + return loopCharacteristics; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLoopCharacteristics(LoopCharacteristics newLoopCharacteristics, + NotificationChain msgs) { + LoopCharacteristics oldLoopCharacteristics = loopCharacteristics; + loopCharacteristics = newLoopCharacteristics; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS, oldLoopCharacteristics, newLoopCharacteristics); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setLoopCharacteristics(LoopCharacteristics newLoopCharacteristics) { + if (newLoopCharacteristics != loopCharacteristics) { + NotificationChain msgs = null; + if (loopCharacteristics != null) + msgs = ((InternalEObject) loopCharacteristics).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS, null, msgs); + if (newLoopCharacteristics != null) + msgs = ((InternalEObject) newLoopCharacteristics).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS, null, msgs); + msgs = basicSetLoopCharacteristics(newLoopCharacteristics, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS, + newLoopCharacteristics, newLoopCharacteristics)); + } + + /** + * + * + * @generated + */ + @Override + public int getCompletionQuantity() { + return completionQuantity; + } + + /** + * + * + * @generated + */ + @Override + public void setCompletionQuantity(int newCompletionQuantity) { + int oldCompletionQuantity = completionQuantity; + completionQuantity = newCompletionQuantity; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ACTIVITY__COMPLETION_QUANTITY, + oldCompletionQuantity, completionQuantity)); + } + + /** + * + * + * @generated + */ + @Override + public SequenceFlow getDefault() { + return default_; + } + + /** + * + * + * @generated + */ + @Override + public void setDefault(SequenceFlow newDefault) { + SequenceFlow oldDefault = default_; + default_ = newDefault; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ACTIVITY__DEFAULT, oldDefault, + default_)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsForCompensation() { + return isForCompensation; + } + + /** + * + * + * @generated + */ + @Override + public void setIsForCompensation(boolean newIsForCompensation) { + boolean oldIsForCompensation = isForCompensation; + isForCompensation = newIsForCompensation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ACTIVITY__IS_FOR_COMPENSATION, + oldIsForCompensation, isForCompensation)); + } + + /** + * + * + * @generated + */ + @Override + public int getStartQuantity() { + return startQuantity; + } + + /** + * + * + * @generated + */ + @Override + public void setStartQuantity(int newStartQuantity) { + int oldStartQuantity = startQuantity; + startQuantity = newStartQuantity; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ACTIVITY__START_QUANTITY, + oldStartQuantity, startQuantity)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS: + return ((InternalEList) (InternalEList) getBoundaryEventRefs()).basicAdd(otherEnd, + msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.ACTIVITY__IO_SPECIFICATION: + return basicSetIoSpecification(null, msgs); + case Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS: + return ((InternalEList) getBoundaryEventRefs()).basicRemove(otherEnd, msgs); + case Bpmn2Package.ACTIVITY__PROPERTIES: + return ((InternalEList) getProperties()).basicRemove(otherEnd, msgs); + case Bpmn2Package.ACTIVITY__DATA_INPUT_ASSOCIATIONS: + return ((InternalEList) getDataInputAssociations()).basicRemove(otherEnd, msgs); + case Bpmn2Package.ACTIVITY__DATA_OUTPUT_ASSOCIATIONS: + return ((InternalEList) getDataOutputAssociations()).basicRemove(otherEnd, msgs); + case Bpmn2Package.ACTIVITY__RESOURCES: + return ((InternalEList) getResources()).basicRemove(otherEnd, msgs); + case Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS: + return basicSetLoopCharacteristics(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.ACTIVITY__IO_SPECIFICATION: + return getIoSpecification(); + case Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS: + return getBoundaryEventRefs(); + case Bpmn2Package.ACTIVITY__PROPERTIES: + return getProperties(); + case Bpmn2Package.ACTIVITY__DATA_INPUT_ASSOCIATIONS: + return getDataInputAssociations(); + case Bpmn2Package.ACTIVITY__DATA_OUTPUT_ASSOCIATIONS: + return getDataOutputAssociations(); + case Bpmn2Package.ACTIVITY__RESOURCES: + return getResources(); + case Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS: + return getLoopCharacteristics(); + case Bpmn2Package.ACTIVITY__COMPLETION_QUANTITY: + return getCompletionQuantity(); + case Bpmn2Package.ACTIVITY__DEFAULT: + return getDefault(); + case Bpmn2Package.ACTIVITY__IS_FOR_COMPENSATION: + return isIsForCompensation(); + case Bpmn2Package.ACTIVITY__START_QUANTITY: + return getStartQuantity(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.ACTIVITY__IO_SPECIFICATION: + setIoSpecification((InputOutputSpecification) newValue); + return; + case Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS: + getBoundaryEventRefs().clear(); + getBoundaryEventRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.ACTIVITY__PROPERTIES: + getProperties().clear(); + getProperties().addAll((Collection) newValue); + return; + case Bpmn2Package.ACTIVITY__DATA_INPUT_ASSOCIATIONS: + getDataInputAssociations().clear(); + getDataInputAssociations().addAll((Collection) newValue); + return; + case Bpmn2Package.ACTIVITY__DATA_OUTPUT_ASSOCIATIONS: + getDataOutputAssociations().clear(); + getDataOutputAssociations().addAll((Collection) newValue); + return; + case Bpmn2Package.ACTIVITY__RESOURCES: + getResources().clear(); + getResources().addAll((Collection) newValue); + return; + case Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS: + setLoopCharacteristics((LoopCharacteristics) newValue); + return; + case Bpmn2Package.ACTIVITY__COMPLETION_QUANTITY: + setCompletionQuantity((Integer) newValue); + return; + case Bpmn2Package.ACTIVITY__DEFAULT: + setDefault((SequenceFlow) newValue); + return; + case Bpmn2Package.ACTIVITY__IS_FOR_COMPENSATION: + setIsForCompensation((Boolean) newValue); + return; + case Bpmn2Package.ACTIVITY__START_QUANTITY: + setStartQuantity((Integer) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.ACTIVITY__IO_SPECIFICATION: + setIoSpecification((InputOutputSpecification) null); + return; + case Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS: + getBoundaryEventRefs().clear(); + return; + case Bpmn2Package.ACTIVITY__PROPERTIES: + getProperties().clear(); + return; + case Bpmn2Package.ACTIVITY__DATA_INPUT_ASSOCIATIONS: + getDataInputAssociations().clear(); + return; + case Bpmn2Package.ACTIVITY__DATA_OUTPUT_ASSOCIATIONS: + getDataOutputAssociations().clear(); + return; + case Bpmn2Package.ACTIVITY__RESOURCES: + getResources().clear(); + return; + case Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS: + setLoopCharacteristics((LoopCharacteristics) null); + return; + case Bpmn2Package.ACTIVITY__COMPLETION_QUANTITY: + setCompletionQuantity(COMPLETION_QUANTITY_EDEFAULT); + return; + case Bpmn2Package.ACTIVITY__DEFAULT: + setDefault((SequenceFlow) null); + return; + case Bpmn2Package.ACTIVITY__IS_FOR_COMPENSATION: + setIsForCompensation(IS_FOR_COMPENSATION_EDEFAULT); + return; + case Bpmn2Package.ACTIVITY__START_QUANTITY: + setStartQuantity(START_QUANTITY_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.ACTIVITY__IO_SPECIFICATION: + return ioSpecification != null; + case Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS: + return boundaryEventRefs != null && !boundaryEventRefs.isEmpty(); + case Bpmn2Package.ACTIVITY__PROPERTIES: + return properties != null && !properties.isEmpty(); + case Bpmn2Package.ACTIVITY__DATA_INPUT_ASSOCIATIONS: + return dataInputAssociations != null && !dataInputAssociations.isEmpty(); + case Bpmn2Package.ACTIVITY__DATA_OUTPUT_ASSOCIATIONS: + return dataOutputAssociations != null && !dataOutputAssociations.isEmpty(); + case Bpmn2Package.ACTIVITY__RESOURCES: + return resources != null && !resources.isEmpty(); + case Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS: + return loopCharacteristics != null; + case Bpmn2Package.ACTIVITY__COMPLETION_QUANTITY: + return completionQuantity != COMPLETION_QUANTITY_EDEFAULT; + case Bpmn2Package.ACTIVITY__DEFAULT: + return default_ != null; + case Bpmn2Package.ACTIVITY__IS_FOR_COMPENSATION: + return isForCompensation != IS_FOR_COMPENSATION_EDEFAULT; + case Bpmn2Package.ACTIVITY__START_QUANTITY: + return startQuantity != START_QUANTITY_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (completionQuantity: "); + result.append(completionQuantity); + result.append(", isForCompensation: "); + result.append(isForCompensation); + result.append(", startQuantity: "); + result.append(startQuantity); + result.append(')'); + return result.toString(); + } + +} //ActivityImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/AdHocSubProcessImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/AdHocSubProcessImpl.java new file mode 100644 index 00000000000..cf551335322 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/AdHocSubProcessImpl.java @@ -0,0 +1,333 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.AdHocOrdering; +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Expression; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Ad Hoc Sub Process'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.AdHocSubProcessImpl#getCompletionCondition Completion Condition}
  • + *
  • {@link org.eclipse.bpmn2.impl.AdHocSubProcessImpl#isCancelRemainingInstances Cancel Remaining Instances}
  • + *
  • {@link org.eclipse.bpmn2.impl.AdHocSubProcessImpl#getOrdering Ordering}
  • + *
+ * + * @generated + */ +public class AdHocSubProcessImpl extends SubProcessImpl implements AdHocSubProcess { + /** + * The cached value of the '{@link #getCompletionCondition() Completion Condition}' containment reference. + * + * + * @see #getCompletionCondition() + * @generated + * @ordered + */ + @GwtTransient + protected Expression completionCondition; + + /** + * The default value of the '{@link #isCancelRemainingInstances() Cancel Remaining Instances}' attribute. + * + * + * @see #isCancelRemainingInstances() + * @generated + * @ordered + */ + protected static final boolean CANCEL_REMAINING_INSTANCES_EDEFAULT = true; + + /** + * The cached value of the '{@link #isCancelRemainingInstances() Cancel Remaining Instances}' attribute. + * + * + * @see #isCancelRemainingInstances() + * @generated + * @ordered + */ + @GwtTransient + protected boolean cancelRemainingInstances = CANCEL_REMAINING_INSTANCES_EDEFAULT; + + /** + * The default value of the '{@link #getOrdering() Ordering}' attribute. + * + * + * @see #getOrdering() + * @generated + * @ordered + */ + protected static final AdHocOrdering ORDERING_EDEFAULT = AdHocOrdering.PARALLEL; + + /** + * The cached value of the '{@link #getOrdering() Ordering}' attribute. + * + * + * @see #getOrdering() + * @generated + * @ordered + */ + @GwtTransient + protected AdHocOrdering ordering = ORDERING_EDEFAULT; + + /** + * + * + * @generated + */ + protected AdHocSubProcessImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.AD_HOC_SUB_PROCESS; + } + + /** + * + * + * @generated + */ + @Override + public Expression getCompletionCondition() { + return completionCondition; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCompletionCondition(Expression newCompletionCondition, NotificationChain msgs) { + Expression oldCompletionCondition = completionCondition; + completionCondition = newCompletionCondition; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.AD_HOC_SUB_PROCESS__COMPLETION_CONDITION, oldCompletionCondition, + newCompletionCondition); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setCompletionCondition(Expression newCompletionCondition) { + if (newCompletionCondition != completionCondition) { + NotificationChain msgs = null; + if (completionCondition != null) + msgs = ((InternalEObject) completionCondition).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.AD_HOC_SUB_PROCESS__COMPLETION_CONDITION, null, msgs); + if (newCompletionCondition != null) + msgs = ((InternalEObject) newCompletionCondition).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.AD_HOC_SUB_PROCESS__COMPLETION_CONDITION, null, msgs); + msgs = basicSetCompletionCondition(newCompletionCondition, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.AD_HOC_SUB_PROCESS__COMPLETION_CONDITION, + newCompletionCondition, newCompletionCondition)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isCancelRemainingInstances() { + return cancelRemainingInstances; + } + + /** + * + * + * @generated + */ + @Override + public void setCancelRemainingInstances(boolean newCancelRemainingInstances) { + boolean oldCancelRemainingInstances = cancelRemainingInstances; + cancelRemainingInstances = newCancelRemainingInstances; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.AD_HOC_SUB_PROCESS__CANCEL_REMAINING_INSTANCES, oldCancelRemainingInstances, + cancelRemainingInstances)); + } + + /** + * + * + * @generated + */ + @Override + public AdHocOrdering getOrdering() { + return ordering; + } + + /** + * + * + * @generated + */ + @Override + public void setOrdering(AdHocOrdering newOrdering) { + AdHocOrdering oldOrdering = ordering; + ordering = newOrdering == null ? ORDERING_EDEFAULT : newOrdering; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.AD_HOC_SUB_PROCESS__ORDERING, + oldOrdering, ordering)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.AD_HOC_SUB_PROCESS__COMPLETION_CONDITION: + return basicSetCompletionCondition(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.AD_HOC_SUB_PROCESS__COMPLETION_CONDITION: + return getCompletionCondition(); + case Bpmn2Package.AD_HOC_SUB_PROCESS__CANCEL_REMAINING_INSTANCES: + return isCancelRemainingInstances(); + case Bpmn2Package.AD_HOC_SUB_PROCESS__ORDERING: + return getOrdering(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.AD_HOC_SUB_PROCESS__COMPLETION_CONDITION: + setCompletionCondition((Expression) newValue); + return; + case Bpmn2Package.AD_HOC_SUB_PROCESS__CANCEL_REMAINING_INSTANCES: + setCancelRemainingInstances((Boolean) newValue); + return; + case Bpmn2Package.AD_HOC_SUB_PROCESS__ORDERING: + setOrdering((AdHocOrdering) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.AD_HOC_SUB_PROCESS__COMPLETION_CONDITION: + setCompletionCondition((Expression) null); + return; + case Bpmn2Package.AD_HOC_SUB_PROCESS__CANCEL_REMAINING_INSTANCES: + setCancelRemainingInstances(CANCEL_REMAINING_INSTANCES_EDEFAULT); + return; + case Bpmn2Package.AD_HOC_SUB_PROCESS__ORDERING: + setOrdering(ORDERING_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.AD_HOC_SUB_PROCESS__COMPLETION_CONDITION: + return completionCondition != null; + case Bpmn2Package.AD_HOC_SUB_PROCESS__CANCEL_REMAINING_INSTANCES: + return cancelRemainingInstances != CANCEL_REMAINING_INSTANCES_EDEFAULT; + case Bpmn2Package.AD_HOC_SUB_PROCESS__ORDERING: + return ordering != ORDERING_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (cancelRemainingInstances: "); + result.append(cancelRemainingInstances); + result.append(", ordering: "); + result.append(ordering); + result.append(')'); + return result.toString(); + } + +} //AdHocSubProcessImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ArtifactImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ArtifactImpl.java new file mode 100644 index 00000000000..267da8e9c08 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ArtifactImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Artifact; +import org.eclipse.bpmn2.Bpmn2Package; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Artifact'. + * + * + * @generated + */ +public class ArtifactImpl extends BaseElementImpl implements Artifact { + /** + * + * + * @generated + */ + protected ArtifactImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.ARTIFACT; + } + +} //ArtifactImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/AssignmentImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/AssignmentImpl.java new file mode 100644 index 00000000000..2ce1b440e7e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/AssignmentImpl.java @@ -0,0 +1,273 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Expression; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Assignment'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.AssignmentImpl#getFrom From}
  • + *
  • {@link org.eclipse.bpmn2.impl.AssignmentImpl#getTo To}
  • + *
+ * + * @generated + */ +public class AssignmentImpl extends BaseElementImpl implements Assignment { + /** + * The cached value of the '{@link #getFrom() From}' containment reference. + * + * + * @see #getFrom() + * @generated + * @ordered + */ + @GwtTransient + protected Expression from; + + /** + * The cached value of the '{@link #getTo() To}' containment reference. + * + * + * @see #getTo() + * @generated + * @ordered + */ + @GwtTransient + protected Expression to; + + /** + * + * + * @generated + */ + protected AssignmentImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.ASSIGNMENT; + } + + /** + * + * + * @generated + */ + @Override + public Expression getFrom() { + return from; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFrom(Expression newFrom, NotificationChain msgs) { + Expression oldFrom = from; + from = newFrom; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.ASSIGNMENT__FROM, oldFrom, newFrom); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setFrom(Expression newFrom) { + if (newFrom != from) { + NotificationChain msgs = null; + if (from != null) + msgs = ((InternalEObject) from).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.ASSIGNMENT__FROM, null, msgs); + if (newFrom != null) + msgs = ((InternalEObject) newFrom).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.ASSIGNMENT__FROM, null, msgs); + msgs = basicSetFrom(newFrom, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ASSIGNMENT__FROM, newFrom, newFrom)); + } + + /** + * + * + * @generated + */ + @Override + public Expression getTo() { + return to; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTo(Expression newTo, NotificationChain msgs) { + Expression oldTo = to; + to = newTo; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Bpmn2Package.ASSIGNMENT__TO, + oldTo, newTo); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setTo(Expression newTo) { + if (newTo != to) { + NotificationChain msgs = null; + if (to != null) + msgs = ((InternalEObject) to).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.ASSIGNMENT__TO, + null, msgs); + if (newTo != null) + msgs = ((InternalEObject) newTo).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.ASSIGNMENT__TO, + null, msgs); + msgs = basicSetTo(newTo, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ASSIGNMENT__TO, newTo, newTo)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.ASSIGNMENT__FROM: + return basicSetFrom(null, msgs); + case Bpmn2Package.ASSIGNMENT__TO: + return basicSetTo(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.ASSIGNMENT__FROM: + return getFrom(); + case Bpmn2Package.ASSIGNMENT__TO: + return getTo(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.ASSIGNMENT__FROM: + setFrom((Expression) newValue); + return; + case Bpmn2Package.ASSIGNMENT__TO: + setTo((Expression) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.ASSIGNMENT__FROM: + setFrom((Expression) null); + return; + case Bpmn2Package.ASSIGNMENT__TO: + setTo((Expression) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.ASSIGNMENT__FROM: + return from != null; + case Bpmn2Package.ASSIGNMENT__TO: + return to != null; + } + return super.eIsSet(featureID); + } + +} //AssignmentImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/AssociationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/AssociationImpl.java new file mode 100644 index 00000000000..513d223fc7e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/AssociationImpl.java @@ -0,0 +1,317 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Association; +import org.eclipse.bpmn2.AssociationDirection; +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.Bpmn2Package; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Association'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.AssociationImpl#getAssociationDirection Association Direction}
  • + *
  • {@link org.eclipse.bpmn2.impl.AssociationImpl#getSourceRef Source Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.AssociationImpl#getTargetRef Target Ref}
  • + *
+ * + * @generated + */ +public class AssociationImpl extends ArtifactImpl implements Association { + /** + * The default value of the '{@link #getAssociationDirection() Association Direction}' attribute. + * + * + * @see #getAssociationDirection() + * @generated + * @ordered + */ + protected static final AssociationDirection ASSOCIATION_DIRECTION_EDEFAULT = AssociationDirection.NONE; + + /** + * The cached value of the '{@link #getAssociationDirection() Association Direction}' attribute. + * + * + * @see #getAssociationDirection() + * @generated + * @ordered + */ + @GwtTransient + protected AssociationDirection associationDirection = ASSOCIATION_DIRECTION_EDEFAULT; + + /** + * The cached value of the '{@link #getSourceRef() Source Ref}' reference. + * + * + * @see #getSourceRef() + * @generated + * @ordered + */ + @GwtTransient + protected BaseElement sourceRef; + + /** + * The cached value of the '{@link #getTargetRef() Target Ref}' reference. + * + * + * @see #getTargetRef() + * @generated + * @ordered + */ + @GwtTransient + protected BaseElement targetRef; + + /** + * + * + * @generated + */ + protected AssociationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.ASSOCIATION; + } + + /** + * + * + * @generated + */ + @Override + public AssociationDirection getAssociationDirection() { + return associationDirection; + } + + /** + * + * + * @generated + */ + @Override + public void setAssociationDirection(AssociationDirection newAssociationDirection) { + AssociationDirection oldAssociationDirection = associationDirection; + associationDirection = newAssociationDirection == null ? ASSOCIATION_DIRECTION_EDEFAULT + : newAssociationDirection; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ASSOCIATION__ASSOCIATION_DIRECTION, + oldAssociationDirection, associationDirection)); + } + + /** + * + * + * @generated + */ + @Override + public BaseElement getSourceRef() { + if (sourceRef != null && sourceRef.eIsProxy()) { + InternalEObject oldSourceRef = (InternalEObject) sourceRef; + sourceRef = (BaseElement) eResolveProxy(oldSourceRef); + if (sourceRef != oldSourceRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.ASSOCIATION__SOURCE_REF, + oldSourceRef, sourceRef)); + } + } + return sourceRef; + } + + /** + * + * + * @generated + */ + public BaseElement basicGetSourceRef() { + return sourceRef; + } + + /** + * + * + * @generated + */ + @Override + public void setSourceRef(BaseElement newSourceRef) { + BaseElement oldSourceRef = sourceRef; + sourceRef = newSourceRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ASSOCIATION__SOURCE_REF, oldSourceRef, + sourceRef)); + } + + /** + * + * + * @generated + */ + @Override + public BaseElement getTargetRef() { + if (targetRef != null && targetRef.eIsProxy()) { + InternalEObject oldTargetRef = (InternalEObject) targetRef; + targetRef = (BaseElement) eResolveProxy(oldTargetRef); + if (targetRef != oldTargetRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.ASSOCIATION__TARGET_REF, + oldTargetRef, targetRef)); + } + } + return targetRef; + } + + /** + * + * + * @generated + */ + public BaseElement basicGetTargetRef() { + return targetRef; + } + + /** + * + * + * @generated + */ + @Override + public void setTargetRef(BaseElement newTargetRef) { + BaseElement oldTargetRef = targetRef; + targetRef = newTargetRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ASSOCIATION__TARGET_REF, oldTargetRef, + targetRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.ASSOCIATION__ASSOCIATION_DIRECTION: + return getAssociationDirection(); + case Bpmn2Package.ASSOCIATION__SOURCE_REF: + if (resolve) + return getSourceRef(); + return basicGetSourceRef(); + case Bpmn2Package.ASSOCIATION__TARGET_REF: + if (resolve) + return getTargetRef(); + return basicGetTargetRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.ASSOCIATION__ASSOCIATION_DIRECTION: + setAssociationDirection((AssociationDirection) newValue); + return; + case Bpmn2Package.ASSOCIATION__SOURCE_REF: + setSourceRef((BaseElement) newValue); + return; + case Bpmn2Package.ASSOCIATION__TARGET_REF: + setTargetRef((BaseElement) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.ASSOCIATION__ASSOCIATION_DIRECTION: + setAssociationDirection(ASSOCIATION_DIRECTION_EDEFAULT); + return; + case Bpmn2Package.ASSOCIATION__SOURCE_REF: + setSourceRef((BaseElement) null); + return; + case Bpmn2Package.ASSOCIATION__TARGET_REF: + setTargetRef((BaseElement) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.ASSOCIATION__ASSOCIATION_DIRECTION: + return associationDirection != ASSOCIATION_DIRECTION_EDEFAULT; + case Bpmn2Package.ASSOCIATION__SOURCE_REF: + return sourceRef != null; + case Bpmn2Package.ASSOCIATION__TARGET_REF: + return targetRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (associationDirection: "); + result.append(associationDirection); + result.append(')'); + return result.toString(); + } + +} //AssociationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/AuditingImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/AuditingImpl.java new file mode 100644 index 00000000000..db1161f8ee9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/AuditingImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Auditing; +import org.eclipse.bpmn2.Bpmn2Package; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Auditing'. + * + * + * @generated + */ +public class AuditingImpl extends BaseElementImpl implements Auditing { + /** + * + * + * @generated + */ + protected AuditingImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.AUDITING; + } + +} //AuditingImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/BaseElementImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/BaseElementImpl.java new file mode 100644 index 00000000000..91f7220cfbd --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/BaseElementImpl.java @@ -0,0 +1,365 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Documentation; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.ExtensionDefinition; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Base Element'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.BaseElementImpl#getDocumentation Documentation}
  • + *
  • {@link org.eclipse.bpmn2.impl.BaseElementImpl#getExtensionValues Extension Values}
  • + *
  • {@link org.eclipse.bpmn2.impl.BaseElementImpl#getExtensionDefinitions Extension Definitions}
  • + *
  • {@link org.eclipse.bpmn2.impl.BaseElementImpl#getId Id}
  • + *
  • {@link org.eclipse.bpmn2.impl.BaseElementImpl#getAnyAttribute Any Attribute}
  • + *
+ * + * @generated + */ +public class BaseElementImpl extends EObjectImpl implements BaseElement { + /** + * The cached value of the '{@link #getDocumentation() Documentation}' containment reference list. + * + * + * @see #getDocumentation() + * @generated + * @ordered + */ + @GwtTransient + protected EList documentation; + + /** + * The cached value of the '{@link #getExtensionValues() Extension Values}' containment reference list. + * + * + * @see #getExtensionValues() + * @generated + * @ordered + */ + @GwtTransient + protected EList extensionValues; + + /** + * The cached value of the '{@link #getExtensionDefinitions() Extension Definitions}' reference list. + * + * + * @see #getExtensionDefinitions() + * @generated + * @ordered + */ + @GwtTransient + protected EList extensionDefinitions; + + /** + * The default value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + protected static final String ID_EDEFAULT = null; + + /** + * The cached value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + @GwtTransient + protected String id = ID_EDEFAULT; + + /** + * The cached value of the '{@link #getAnyAttribute() Any Attribute}' attribute list. + * + * + * @see #getAnyAttribute() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap anyAttribute; + + /** + * + * + * @generated + */ + protected BaseElementImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.BASE_ELEMENT; + } + + /** + * + * + * @generated + */ + @Override + public EList getDocumentation() { + if (documentation == null) { + documentation = new EObjectContainmentEList(Documentation.class, this, + Bpmn2Package.BASE_ELEMENT__DOCUMENTATION); + } + return documentation; + } + + /** + * + * + * @generated + */ + @Override + public EList getExtensionValues() { + if (extensionValues == null) { + extensionValues = new EObjectContainmentEList(ExtensionAttributeValue.class, this, + Bpmn2Package.BASE_ELEMENT__EXTENSION_VALUES); + } + return extensionValues; + } + + /** + * + * + * @generated + */ + @Override + public EList getExtensionDefinitions() { + if (extensionDefinitions == null) { + extensionDefinitions = new EObjectResolvingEList(ExtensionDefinition.class, this, + Bpmn2Package.BASE_ELEMENT__EXTENSION_DEFINITIONS); + } + return extensionDefinitions; + } + + /** + * + * + * @generated + */ + @Override + public String getId() { + return id; + } + + /** + * + * + * @generated + */ + @Override + public void setId(String newId) { + String oldId = id; + id = newId; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.BASE_ELEMENT__ID, oldId, id)); + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getAnyAttribute() { + if (anyAttribute == null) { + anyAttribute = new BasicFeatureMap(this, Bpmn2Package.BASE_ELEMENT__ANY_ATTRIBUTE); + } + return anyAttribute; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.BASE_ELEMENT__DOCUMENTATION: + return ((InternalEList) getDocumentation()).basicRemove(otherEnd, msgs); + case Bpmn2Package.BASE_ELEMENT__EXTENSION_VALUES: + return ((InternalEList) getExtensionValues()).basicRemove(otherEnd, msgs); + case Bpmn2Package.BASE_ELEMENT__ANY_ATTRIBUTE: + return ((InternalEList) getAnyAttribute()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.BASE_ELEMENT__DOCUMENTATION: + return getDocumentation(); + case Bpmn2Package.BASE_ELEMENT__EXTENSION_VALUES: + return getExtensionValues(); + case Bpmn2Package.BASE_ELEMENT__EXTENSION_DEFINITIONS: + return getExtensionDefinitions(); + case Bpmn2Package.BASE_ELEMENT__ID: + return getId(); + case Bpmn2Package.BASE_ELEMENT__ANY_ATTRIBUTE: + if (coreType) + return getAnyAttribute(); + return ((FeatureMap.Internal) getAnyAttribute()).getWrapper(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.BASE_ELEMENT__DOCUMENTATION: + getDocumentation().clear(); + getDocumentation().addAll((Collection) newValue); + return; + case Bpmn2Package.BASE_ELEMENT__EXTENSION_VALUES: + getExtensionValues().clear(); + getExtensionValues().addAll((Collection) newValue); + return; + case Bpmn2Package.BASE_ELEMENT__EXTENSION_DEFINITIONS: + getExtensionDefinitions().clear(); + getExtensionDefinitions().addAll((Collection) newValue); + return; + case Bpmn2Package.BASE_ELEMENT__ID: + setId((String) newValue); + return; + case Bpmn2Package.BASE_ELEMENT__ANY_ATTRIBUTE: + ((FeatureMap.Internal) getAnyAttribute()).set(newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.BASE_ELEMENT__DOCUMENTATION: + getDocumentation().clear(); + return; + case Bpmn2Package.BASE_ELEMENT__EXTENSION_VALUES: + getExtensionValues().clear(); + return; + case Bpmn2Package.BASE_ELEMENT__EXTENSION_DEFINITIONS: + getExtensionDefinitions().clear(); + return; + case Bpmn2Package.BASE_ELEMENT__ID: + setId(ID_EDEFAULT); + return; + case Bpmn2Package.BASE_ELEMENT__ANY_ATTRIBUTE: + getAnyAttribute().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.BASE_ELEMENT__DOCUMENTATION: + return documentation != null && !documentation.isEmpty(); + case Bpmn2Package.BASE_ELEMENT__EXTENSION_VALUES: + return extensionValues != null && !extensionValues.isEmpty(); + case Bpmn2Package.BASE_ELEMENT__EXTENSION_DEFINITIONS: + return extensionDefinitions != null && !extensionDefinitions.isEmpty(); + case Bpmn2Package.BASE_ELEMENT__ID: + return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); + case Bpmn2Package.BASE_ELEMENT__ANY_ATTRIBUTE: + return anyAttribute != null && !anyAttribute.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (id: "); + result.append(id); + result.append(", anyAttribute: "); + result.append(anyAttribute); + result.append(')'); + return result.toString(); + } + +} //BaseElementImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/BoundaryEventImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/BoundaryEventImpl.java new file mode 100644 index 00000000000..d7a93dc351c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/BoundaryEventImpl.java @@ -0,0 +1,289 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.Bpmn2Package; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Boundary Event'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.BoundaryEventImpl#getAttachedToRef Attached To Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.BoundaryEventImpl#isCancelActivity Cancel Activity}
  • + *
+ * + * @generated + */ +public class BoundaryEventImpl extends CatchEventImpl implements BoundaryEvent { + /** + * The cached value of the '{@link #getAttachedToRef() Attached To Ref}' reference. + * + * + * @see #getAttachedToRef() + * @generated + * @ordered + */ + @GwtTransient + protected Activity attachedToRef; + + /** + * The default value of the '{@link #isCancelActivity() Cancel Activity}' attribute. + * + * + * @see #isCancelActivity() + * @generated + * @ordered + */ + protected static final boolean CANCEL_ACTIVITY_EDEFAULT = true; + + /** + * The cached value of the '{@link #isCancelActivity() Cancel Activity}' attribute. + * + * + * @see #isCancelActivity() + * @generated + * @ordered + */ + @GwtTransient + protected boolean cancelActivity = CANCEL_ACTIVITY_EDEFAULT; + + /** + * + * + * @generated + */ + protected BoundaryEventImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.BOUNDARY_EVENT; + } + + /** + * + * + * @generated + */ + @Override + public Activity getAttachedToRef() { + return attachedToRef; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetAttachedToRef(Activity newAttachedToRef, NotificationChain msgs) { + Activity oldAttachedToRef = attachedToRef; + attachedToRef = newAttachedToRef; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.BOUNDARY_EVENT__ATTACHED_TO_REF, oldAttachedToRef, newAttachedToRef); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setAttachedToRef(Activity newAttachedToRef) { + if (newAttachedToRef != attachedToRef) { + NotificationChain msgs = null; + if (attachedToRef != null) + msgs = ((InternalEObject) attachedToRef).eInverseRemove(this, + Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS, Activity.class, msgs); + if (newAttachedToRef != null) + msgs = ((InternalEObject) newAttachedToRef).eInverseAdd(this, + Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS, Activity.class, msgs); + msgs = basicSetAttachedToRef(newAttachedToRef, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.BOUNDARY_EVENT__ATTACHED_TO_REF, + newAttachedToRef, newAttachedToRef)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isCancelActivity() { + return cancelActivity; + } + + /** + * + * + * @generated + */ + @Override + public void setCancelActivity(boolean newCancelActivity) { + boolean oldCancelActivity = cancelActivity; + cancelActivity = newCancelActivity; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.BOUNDARY_EVENT__CANCEL_ACTIVITY, + oldCancelActivity, cancelActivity)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.BOUNDARY_EVENT__ATTACHED_TO_REF: + if (attachedToRef != null) + msgs = ((InternalEObject) attachedToRef).eInverseRemove(this, + Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS, Activity.class, msgs); + return basicSetAttachedToRef((Activity) otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.BOUNDARY_EVENT__ATTACHED_TO_REF: + return basicSetAttachedToRef(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.BOUNDARY_EVENT__ATTACHED_TO_REF: + return getAttachedToRef(); + case Bpmn2Package.BOUNDARY_EVENT__CANCEL_ACTIVITY: + return isCancelActivity(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.BOUNDARY_EVENT__ATTACHED_TO_REF: + setAttachedToRef((Activity) newValue); + return; + case Bpmn2Package.BOUNDARY_EVENT__CANCEL_ACTIVITY: + setCancelActivity((Boolean) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.BOUNDARY_EVENT__ATTACHED_TO_REF: + setAttachedToRef((Activity) null); + return; + case Bpmn2Package.BOUNDARY_EVENT__CANCEL_ACTIVITY: + setCancelActivity(CANCEL_ACTIVITY_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.BOUNDARY_EVENT__ATTACHED_TO_REF: + return attachedToRef != null; + case Bpmn2Package.BOUNDARY_EVENT__CANCEL_ACTIVITY: + return cancelActivity != CANCEL_ACTIVITY_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (cancelActivity: "); + result.append(cancelActivity); + result.append(')'); + return result.toString(); + } + +} //BoundaryEventImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/Bpmn2FactoryImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/Bpmn2FactoryImpl.java new file mode 100644 index 00000000000..b247cc2edf7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/Bpmn2FactoryImpl.java @@ -0,0 +1,2185 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.AdHocOrdering; +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.Artifact; +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.Association; +import org.eclipse.bpmn2.AssociationDirection; +import org.eclipse.bpmn2.Auditing; +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.Bpmn2Factory; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.BusinessRuleTask; +import org.eclipse.bpmn2.CallActivity; +import org.eclipse.bpmn2.CallChoreography; +import org.eclipse.bpmn2.CallConversation; +import org.eclipse.bpmn2.CallableElement; +import org.eclipse.bpmn2.CancelEventDefinition; +import org.eclipse.bpmn2.Category; +import org.eclipse.bpmn2.CategoryValue; +import org.eclipse.bpmn2.Choreography; +import org.eclipse.bpmn2.ChoreographyLoopType; +import org.eclipse.bpmn2.ChoreographyTask; +import org.eclipse.bpmn2.Collaboration; +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.ComplexBehaviorDefinition; +import org.eclipse.bpmn2.ComplexGateway; +import org.eclipse.bpmn2.ConditionalEventDefinition; +import org.eclipse.bpmn2.Conversation; +import org.eclipse.bpmn2.ConversationAssociation; +import org.eclipse.bpmn2.ConversationLink; +import org.eclipse.bpmn2.ConversationNode; +import org.eclipse.bpmn2.CorrelationKey; +import org.eclipse.bpmn2.CorrelationProperty; +import org.eclipse.bpmn2.CorrelationPropertyBinding; +import org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression; +import org.eclipse.bpmn2.CorrelationSubscription; +import org.eclipse.bpmn2.DataAssociation; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataObject; +import org.eclipse.bpmn2.DataObjectReference; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.DataState; +import org.eclipse.bpmn2.DataStore; +import org.eclipse.bpmn2.DataStoreReference; +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.DocumentRoot; +import org.eclipse.bpmn2.Documentation; +import org.eclipse.bpmn2.EndEvent; +import org.eclipse.bpmn2.EndPoint; +import org.eclipse.bpmn2.ErrorEventDefinition; +import org.eclipse.bpmn2.Escalation; +import org.eclipse.bpmn2.EscalationEventDefinition; +import org.eclipse.bpmn2.EventBasedGateway; +import org.eclipse.bpmn2.EventBasedGatewayType; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.EventSubprocess; +import org.eclipse.bpmn2.ExclusiveGateway; +import org.eclipse.bpmn2.Expression; +import org.eclipse.bpmn2.Extension; +import org.eclipse.bpmn2.ExtensionAttributeDefinition; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.ExtensionDefinition; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.GatewayDirection; +import org.eclipse.bpmn2.GlobalBusinessRuleTask; +import org.eclipse.bpmn2.GlobalChoreographyTask; +import org.eclipse.bpmn2.GlobalConversation; +import org.eclipse.bpmn2.GlobalManualTask; +import org.eclipse.bpmn2.GlobalScriptTask; +import org.eclipse.bpmn2.GlobalTask; +import org.eclipse.bpmn2.GlobalUserTask; +import org.eclipse.bpmn2.Group; +import org.eclipse.bpmn2.HumanPerformer; +import org.eclipse.bpmn2.ImplicitThrowEvent; +import org.eclipse.bpmn2.Import; +import org.eclipse.bpmn2.InclusiveGateway; +import org.eclipse.bpmn2.InputOutputBinding; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.InteractionNode; +import org.eclipse.bpmn2.Interface; +import org.eclipse.bpmn2.IntermediateCatchEvent; +import org.eclipse.bpmn2.IntermediateThrowEvent; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.ItemKind; +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.LaneSet; +import org.eclipse.bpmn2.LinkEventDefinition; +import org.eclipse.bpmn2.ManualTask; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.MessageEventDefinition; +import org.eclipse.bpmn2.MessageFlow; +import org.eclipse.bpmn2.MessageFlowAssociation; +import org.eclipse.bpmn2.Monitoring; +import org.eclipse.bpmn2.MultiInstanceBehavior; +import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics; +import org.eclipse.bpmn2.Operation; +import org.eclipse.bpmn2.OutputSet; +import org.eclipse.bpmn2.ParallelGateway; +import org.eclipse.bpmn2.Participant; +import org.eclipse.bpmn2.ParticipantAssociation; +import org.eclipse.bpmn2.ParticipantMultiplicity; +import org.eclipse.bpmn2.PartnerEntity; +import org.eclipse.bpmn2.PartnerRole; +import org.eclipse.bpmn2.Performer; +import org.eclipse.bpmn2.PotentialOwner; +import org.eclipse.bpmn2.ProcessType; +import org.eclipse.bpmn2.Property; +import org.eclipse.bpmn2.ReceiveTask; +import org.eclipse.bpmn2.Relationship; +import org.eclipse.bpmn2.RelationshipDirection; +import org.eclipse.bpmn2.Rendering; +import org.eclipse.bpmn2.Resource; +import org.eclipse.bpmn2.ResourceAssignmentExpression; +import org.eclipse.bpmn2.ResourceParameter; +import org.eclipse.bpmn2.ResourceParameterBinding; +import org.eclipse.bpmn2.ResourceRole; +import org.eclipse.bpmn2.RootElement; +import org.eclipse.bpmn2.ScriptTask; +import org.eclipse.bpmn2.SendTask; +import org.eclipse.bpmn2.SequenceFlow; +import org.eclipse.bpmn2.ServiceTask; +import org.eclipse.bpmn2.Signal; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.bpmn2.StandardLoopCharacteristics; +import org.eclipse.bpmn2.StartEvent; +import org.eclipse.bpmn2.SubChoreography; +import org.eclipse.bpmn2.SubConversation; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.TerminateEventDefinition; +import org.eclipse.bpmn2.TextAnnotation; +import org.eclipse.bpmn2.TimerEventDefinition; +import org.eclipse.bpmn2.Transaction; +import org.eclipse.bpmn2.UserTask; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class Bpmn2FactoryImpl extends EFactoryImpl implements Bpmn2Factory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static Bpmn2Factory init() { + try { + Bpmn2Factory theBpmn2Factory = (Bpmn2Factory) EPackage.Registry.INSTANCE.getEFactory(Bpmn2Package.eNS_URI); + if (theBpmn2Factory != null) { + return theBpmn2Factory; + } + } catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new Bpmn2FactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public Bpmn2FactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case Bpmn2Package.DOCUMENT_ROOT: + return createDocumentRoot(); + case Bpmn2Package.ACTIVITY: + return createActivity(); + case Bpmn2Package.AD_HOC_SUB_PROCESS: + return createAdHocSubProcess(); + case Bpmn2Package.ARTIFACT: + return createArtifact(); + case Bpmn2Package.ASSIGNMENT: + return createAssignment(); + case Bpmn2Package.ASSOCIATION: + return createAssociation(); + case Bpmn2Package.AUDITING: + return createAuditing(); + case Bpmn2Package.BASE_ELEMENT: + return createBaseElement(); + case Bpmn2Package.BOUNDARY_EVENT: + return createBoundaryEvent(); + case Bpmn2Package.BUSINESS_RULE_TASK: + return createBusinessRuleTask(); + case Bpmn2Package.CALL_ACTIVITY: + return createCallActivity(); + case Bpmn2Package.CALL_CHOREOGRAPHY: + return createCallChoreography(); + case Bpmn2Package.CALL_CONVERSATION: + return createCallConversation(); + case Bpmn2Package.CALLABLE_ELEMENT: + return createCallableElement(); + case Bpmn2Package.CANCEL_EVENT_DEFINITION: + return createCancelEventDefinition(); + case Bpmn2Package.CATEGORY: + return createCategory(); + case Bpmn2Package.CATEGORY_VALUE: + return createCategoryValue(); + case Bpmn2Package.CHOREOGRAPHY: + return createChoreography(); + case Bpmn2Package.CHOREOGRAPHY_TASK: + return createChoreographyTask(); + case Bpmn2Package.COLLABORATION: + return createCollaboration(); + case Bpmn2Package.COMPENSATE_EVENT_DEFINITION: + return createCompensateEventDefinition(); + case Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION: + return createComplexBehaviorDefinition(); + case Bpmn2Package.COMPLEX_GATEWAY: + return createComplexGateway(); + case Bpmn2Package.CONDITIONAL_EVENT_DEFINITION: + return createConditionalEventDefinition(); + case Bpmn2Package.CONVERSATION: + return createConversation(); + case Bpmn2Package.CONVERSATION_ASSOCIATION: + return createConversationAssociation(); + case Bpmn2Package.CONVERSATION_LINK: + return createConversationLink(); + case Bpmn2Package.CONVERSATION_NODE: + return createConversationNode(); + case Bpmn2Package.CORRELATION_KEY: + return createCorrelationKey(); + case Bpmn2Package.CORRELATION_PROPERTY: + return createCorrelationProperty(); + case Bpmn2Package.CORRELATION_PROPERTY_BINDING: + return createCorrelationPropertyBinding(); + case Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION: + return createCorrelationPropertyRetrievalExpression(); + case Bpmn2Package.CORRELATION_SUBSCRIPTION: + return createCorrelationSubscription(); + case Bpmn2Package.DATA_ASSOCIATION: + return createDataAssociation(); + case Bpmn2Package.DATA_INPUT: + return createDataInput(); + case Bpmn2Package.DATA_INPUT_ASSOCIATION: + return createDataInputAssociation(); + case Bpmn2Package.DATA_OBJECT: + return createDataObject(); + case Bpmn2Package.DATA_OBJECT_REFERENCE: + return createDataObjectReference(); + case Bpmn2Package.DATA_OUTPUT: + return createDataOutput(); + case Bpmn2Package.DATA_OUTPUT_ASSOCIATION: + return createDataOutputAssociation(); + case Bpmn2Package.DATA_STATE: + return createDataState(); + case Bpmn2Package.DATA_STORE: + return createDataStore(); + case Bpmn2Package.DATA_STORE_REFERENCE: + return createDataStoreReference(); + case Bpmn2Package.DEFINITIONS: + return createDefinitions(); + case Bpmn2Package.DOCUMENTATION: + return createDocumentation(); + case Bpmn2Package.END_EVENT: + return createEndEvent(); + case Bpmn2Package.END_POINT: + return createEndPoint(); + case Bpmn2Package.ERROR: + return createError(); + case Bpmn2Package.ERROR_EVENT_DEFINITION: + return createErrorEventDefinition(); + case Bpmn2Package.ESCALATION: + return createEscalation(); + case Bpmn2Package.ESCALATION_EVENT_DEFINITION: + return createEscalationEventDefinition(); + case Bpmn2Package.EVENT_BASED_GATEWAY: + return createEventBasedGateway(); + case Bpmn2Package.EVENT_DEFINITION: + return createEventDefinition(); + case Bpmn2Package.EXCLUSIVE_GATEWAY: + return createExclusiveGateway(); + case Bpmn2Package.EXPRESSION: + return createExpression(); + case Bpmn2Package.EXTENSION: + return createExtension(); + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION: + return createExtensionAttributeDefinition(); + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE: + return createExtensionAttributeValue(); + case Bpmn2Package.EXTENSION_DEFINITION: + return createExtensionDefinition(); + case Bpmn2Package.FORMAL_EXPRESSION: + return createFormalExpression(); + case Bpmn2Package.GLOBAL_BUSINESS_RULE_TASK: + return createGlobalBusinessRuleTask(); + case Bpmn2Package.GLOBAL_CHOREOGRAPHY_TASK: + return createGlobalChoreographyTask(); + case Bpmn2Package.GLOBAL_CONVERSATION: + return createGlobalConversation(); + case Bpmn2Package.GLOBAL_MANUAL_TASK: + return createGlobalManualTask(); + case Bpmn2Package.GLOBAL_SCRIPT_TASK: + return createGlobalScriptTask(); + case Bpmn2Package.GLOBAL_TASK: + return createGlobalTask(); + case Bpmn2Package.GLOBAL_USER_TASK: + return createGlobalUserTask(); + case Bpmn2Package.GROUP: + return createGroup(); + case Bpmn2Package.HUMAN_PERFORMER: + return createHumanPerformer(); + case Bpmn2Package.IMPLICIT_THROW_EVENT: + return createImplicitThrowEvent(); + case Bpmn2Package.IMPORT: + return createImport(); + case Bpmn2Package.INCLUSIVE_GATEWAY: + return createInclusiveGateway(); + case Bpmn2Package.INPUT_OUTPUT_BINDING: + return createInputOutputBinding(); + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION: + return createInputOutputSpecification(); + case Bpmn2Package.INPUT_SET: + return createInputSet(); + case Bpmn2Package.INTERACTION_NODE: + return createInteractionNode(); + case Bpmn2Package.INTERFACE: + return createInterface(); + case Bpmn2Package.INTERMEDIATE_CATCH_EVENT: + return createIntermediateCatchEvent(); + case Bpmn2Package.INTERMEDIATE_THROW_EVENT: + return createIntermediateThrowEvent(); + case Bpmn2Package.ITEM_AWARE_ELEMENT: + return createItemAwareElement(); + case Bpmn2Package.ITEM_DEFINITION: + return createItemDefinition(); + case Bpmn2Package.LANE: + return createLane(); + case Bpmn2Package.LANE_SET: + return createLaneSet(); + case Bpmn2Package.LINK_EVENT_DEFINITION: + return createLinkEventDefinition(); + case Bpmn2Package.MANUAL_TASK: + return createManualTask(); + case Bpmn2Package.MESSAGE: + return createMessage(); + case Bpmn2Package.MESSAGE_EVENT_DEFINITION: + return createMessageEventDefinition(); + case Bpmn2Package.MESSAGE_FLOW: + return createMessageFlow(); + case Bpmn2Package.MESSAGE_FLOW_ASSOCIATION: + return createMessageFlowAssociation(); + case Bpmn2Package.MONITORING: + return createMonitoring(); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS: + return createMultiInstanceLoopCharacteristics(); + case Bpmn2Package.OPERATION: + return createOperation(); + case Bpmn2Package.OUTPUT_SET: + return createOutputSet(); + case Bpmn2Package.PARALLEL_GATEWAY: + return createParallelGateway(); + case Bpmn2Package.PARTICIPANT: + return createParticipant(); + case Bpmn2Package.PARTICIPANT_ASSOCIATION: + return createParticipantAssociation(); + case Bpmn2Package.PARTICIPANT_MULTIPLICITY: + return createParticipantMultiplicity(); + case Bpmn2Package.PARTNER_ENTITY: + return createPartnerEntity(); + case Bpmn2Package.PARTNER_ROLE: + return createPartnerRole(); + case Bpmn2Package.PERFORMER: + return createPerformer(); + case Bpmn2Package.POTENTIAL_OWNER: + return createPotentialOwner(); + case Bpmn2Package.PROCESS: + return createProcess(); + case Bpmn2Package.PROPERTY: + return createProperty(); + case Bpmn2Package.RECEIVE_TASK: + return createReceiveTask(); + case Bpmn2Package.RELATIONSHIP: + return createRelationship(); + case Bpmn2Package.RENDERING: + return createRendering(); + case Bpmn2Package.RESOURCE: + return createResource(); + case Bpmn2Package.RESOURCE_ASSIGNMENT_EXPRESSION: + return createResourceAssignmentExpression(); + case Bpmn2Package.RESOURCE_PARAMETER: + return createResourceParameter(); + case Bpmn2Package.RESOURCE_PARAMETER_BINDING: + return createResourceParameterBinding(); + case Bpmn2Package.RESOURCE_ROLE: + return createResourceRole(); + case Bpmn2Package.ROOT_ELEMENT: + return createRootElement(); + case Bpmn2Package.SCRIPT_TASK: + return createScriptTask(); + case Bpmn2Package.SEND_TASK: + return createSendTask(); + case Bpmn2Package.SEQUENCE_FLOW: + return createSequenceFlow(); + case Bpmn2Package.SERVICE_TASK: + return createServiceTask(); + case Bpmn2Package.SIGNAL: + return createSignal(); + case Bpmn2Package.SIGNAL_EVENT_DEFINITION: + return createSignalEventDefinition(); + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS: + return createStandardLoopCharacteristics(); + case Bpmn2Package.START_EVENT: + return createStartEvent(); + case Bpmn2Package.SUB_CHOREOGRAPHY: + return createSubChoreography(); + case Bpmn2Package.SUB_CONVERSATION: + return createSubConversation(); + case Bpmn2Package.SUB_PROCESS: + return createSubProcess(); + case Bpmn2Package.TASK: + return createTask(); + case Bpmn2Package.TERMINATE_EVENT_DEFINITION: + return createTerminateEventDefinition(); + case Bpmn2Package.TEXT_ANNOTATION: + return createTextAnnotation(); + case Bpmn2Package.TIMER_EVENT_DEFINITION: + return createTimerEventDefinition(); + case Bpmn2Package.TRANSACTION: + return createTransaction(); + case Bpmn2Package.USER_TASK: + return createUserTask(); + case Bpmn2Package.EVENT_SUBPROCESS: + return createEventSubprocess(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public Object createFromString(EDataType eDataType, String initialValue) { + switch (eDataType.getClassifierID()) { + case Bpmn2Package.AD_HOC_ORDERING: + return createAdHocOrderingFromString(eDataType, initialValue); + case Bpmn2Package.ASSOCIATION_DIRECTION: + return createAssociationDirectionFromString(eDataType, initialValue); + case Bpmn2Package.CHOREOGRAPHY_LOOP_TYPE: + return createChoreographyLoopTypeFromString(eDataType, initialValue); + case Bpmn2Package.EVENT_BASED_GATEWAY_TYPE: + return createEventBasedGatewayTypeFromString(eDataType, initialValue); + case Bpmn2Package.GATEWAY_DIRECTION: + return createGatewayDirectionFromString(eDataType, initialValue); + case Bpmn2Package.ITEM_KIND: + return createItemKindFromString(eDataType, initialValue); + case Bpmn2Package.MULTI_INSTANCE_BEHAVIOR: + return createMultiInstanceBehaviorFromString(eDataType, initialValue); + case Bpmn2Package.PROCESS_TYPE: + return createProcessTypeFromString(eDataType, initialValue); + case Bpmn2Package.RELATIONSHIP_DIRECTION: + return createRelationshipDirectionFromString(eDataType, initialValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public String convertToString(EDataType eDataType, Object instanceValue) { + switch (eDataType.getClassifierID()) { + case Bpmn2Package.AD_HOC_ORDERING: + return convertAdHocOrderingToString(eDataType, instanceValue); + case Bpmn2Package.ASSOCIATION_DIRECTION: + return convertAssociationDirectionToString(eDataType, instanceValue); + case Bpmn2Package.CHOREOGRAPHY_LOOP_TYPE: + return convertChoreographyLoopTypeToString(eDataType, instanceValue); + case Bpmn2Package.EVENT_BASED_GATEWAY_TYPE: + return convertEventBasedGatewayTypeToString(eDataType, instanceValue); + case Bpmn2Package.GATEWAY_DIRECTION: + return convertGatewayDirectionToString(eDataType, instanceValue); + case Bpmn2Package.ITEM_KIND: + return convertItemKindToString(eDataType, instanceValue); + case Bpmn2Package.MULTI_INSTANCE_BEHAVIOR: + return convertMultiInstanceBehaviorToString(eDataType, instanceValue); + case Bpmn2Package.PROCESS_TYPE: + return convertProcessTypeToString(eDataType, instanceValue); + case Bpmn2Package.RELATIONSHIP_DIRECTION: + return convertRelationshipDirectionToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public DocumentRoot createDocumentRoot() { + DocumentRootImpl documentRoot = new DocumentRootImpl(); + return documentRoot; + } + + /** + * + * + * @generated + */ + @Override + public Activity createActivity() { + ActivityImpl activity = new ActivityImpl(); + return activity; + } + + /** + * + * + * @generated + */ + @Override + public AdHocSubProcess createAdHocSubProcess() { + AdHocSubProcessImpl adHocSubProcess = new AdHocSubProcessImpl(); + return adHocSubProcess; + } + + /** + * + * + * @generated + */ + @Override + public Artifact createArtifact() { + ArtifactImpl artifact = new ArtifactImpl(); + return artifact; + } + + /** + * + * + * @generated + */ + @Override + public Assignment createAssignment() { + AssignmentImpl assignment = new AssignmentImpl(); + return assignment; + } + + /** + * + * + * @generated + */ + @Override + public Association createAssociation() { + AssociationImpl association = new AssociationImpl(); + return association; + } + + /** + * + * + * @generated + */ + @Override + public Auditing createAuditing() { + AuditingImpl auditing = new AuditingImpl(); + return auditing; + } + + /** + * + * + * @generated + */ + @Override + public BaseElement createBaseElement() { + BaseElementImpl baseElement = new BaseElementImpl(); + return baseElement; + } + + /** + * + * + * @generated + */ + @Override + public BoundaryEvent createBoundaryEvent() { + BoundaryEventImpl boundaryEvent = new BoundaryEventImpl(); + return boundaryEvent; + } + + /** + * + * + * @generated + */ + @Override + public BusinessRuleTask createBusinessRuleTask() { + BusinessRuleTaskImpl businessRuleTask = new BusinessRuleTaskImpl(); + return businessRuleTask; + } + + /** + * + * + * @generated + */ + @Override + public CallActivity createCallActivity() { + CallActivityImpl callActivity = new CallActivityImpl(); + return callActivity; + } + + /** + * + * + * @generated + */ + @Override + public CallChoreography createCallChoreography() { + CallChoreographyImpl callChoreography = new CallChoreographyImpl(); + return callChoreography; + } + + /** + * + * + * @generated + */ + @Override + public CallConversation createCallConversation() { + CallConversationImpl callConversation = new CallConversationImpl(); + return callConversation; + } + + /** + * + * + * @generated + */ + @Override + public CallableElement createCallableElement() { + CallableElementImpl callableElement = new CallableElementImpl(); + return callableElement; + } + + /** + * + * + * @generated + */ + @Override + public CancelEventDefinition createCancelEventDefinition() { + CancelEventDefinitionImpl cancelEventDefinition = new CancelEventDefinitionImpl(); + return cancelEventDefinition; + } + + /** + * + * + * @generated + */ + @Override + public Category createCategory() { + CategoryImpl category = new CategoryImpl(); + return category; + } + + /** + * + * + * @generated + */ + @Override + public CategoryValue createCategoryValue() { + CategoryValueImpl categoryValue = new CategoryValueImpl(); + return categoryValue; + } + + /** + * + * + * @generated + */ + @Override + public Choreography createChoreography() { + ChoreographyImpl choreography = new ChoreographyImpl(); + return choreography; + } + + /** + * + * + * @generated + */ + @Override + public ChoreographyTask createChoreographyTask() { + ChoreographyTaskImpl choreographyTask = new ChoreographyTaskImpl(); + return choreographyTask; + } + + /** + * + * + * @generated + */ + @Override + public Collaboration createCollaboration() { + CollaborationImpl collaboration = new CollaborationImpl(); + return collaboration; + } + + /** + * + * + * @generated + */ + @Override + public CompensateEventDefinition createCompensateEventDefinition() { + CompensateEventDefinitionImpl compensateEventDefinition = new CompensateEventDefinitionImpl(); + return compensateEventDefinition; + } + + /** + * + * + * @generated + */ + @Override + public ComplexBehaviorDefinition createComplexBehaviorDefinition() { + ComplexBehaviorDefinitionImpl complexBehaviorDefinition = new ComplexBehaviorDefinitionImpl(); + return complexBehaviorDefinition; + } + + /** + * + * + * @generated + */ + @Override + public ComplexGateway createComplexGateway() { + ComplexGatewayImpl complexGateway = new ComplexGatewayImpl(); + return complexGateway; + } + + /** + * + * + * @generated + */ + @Override + public ConditionalEventDefinition createConditionalEventDefinition() { + ConditionalEventDefinitionImpl conditionalEventDefinition = new ConditionalEventDefinitionImpl(); + return conditionalEventDefinition; + } + + /** + * + * + * @generated + */ + @Override + public Conversation createConversation() { + ConversationImpl conversation = new ConversationImpl(); + return conversation; + } + + /** + * + * + * @generated + */ + @Override + public ConversationAssociation createConversationAssociation() { + ConversationAssociationImpl conversationAssociation = new ConversationAssociationImpl(); + return conversationAssociation; + } + + /** + * + * + * @generated + */ + @Override + public ConversationLink createConversationLink() { + ConversationLinkImpl conversationLink = new ConversationLinkImpl(); + return conversationLink; + } + + /** + * + * + * @generated + */ + @Override + public ConversationNode createConversationNode() { + ConversationNodeImpl conversationNode = new ConversationNodeImpl(); + return conversationNode; + } + + /** + * + * + * @generated + */ + @Override + public CorrelationKey createCorrelationKey() { + CorrelationKeyImpl correlationKey = new CorrelationKeyImpl(); + return correlationKey; + } + + /** + * + * + * @generated + */ + @Override + public CorrelationProperty createCorrelationProperty() { + CorrelationPropertyImpl correlationProperty = new CorrelationPropertyImpl(); + return correlationProperty; + } + + /** + * + * + * @generated + */ + @Override + public CorrelationPropertyBinding createCorrelationPropertyBinding() { + CorrelationPropertyBindingImpl correlationPropertyBinding = new CorrelationPropertyBindingImpl(); + return correlationPropertyBinding; + } + + /** + * + * + * @generated + */ + @Override + public CorrelationPropertyRetrievalExpression createCorrelationPropertyRetrievalExpression() { + CorrelationPropertyRetrievalExpressionImpl correlationPropertyRetrievalExpression = new CorrelationPropertyRetrievalExpressionImpl(); + return correlationPropertyRetrievalExpression; + } + + /** + * + * + * @generated + */ + @Override + public CorrelationSubscription createCorrelationSubscription() { + CorrelationSubscriptionImpl correlationSubscription = new CorrelationSubscriptionImpl(); + return correlationSubscription; + } + + /** + * + * + * @generated + */ + @Override + public DataAssociation createDataAssociation() { + DataAssociationImpl dataAssociation = new DataAssociationImpl(); + return dataAssociation; + } + + /** + * + * + * @generated + */ + @Override + public DataInput createDataInput() { + DataInputImpl dataInput = new DataInputImpl(); + return dataInput; + } + + /** + * + * + * @generated + */ + @Override + public DataInputAssociation createDataInputAssociation() { + DataInputAssociationImpl dataInputAssociation = new DataInputAssociationImpl(); + return dataInputAssociation; + } + + /** + * + * + * @generated + */ + @Override + public DataObject createDataObject() { + DataObjectImpl dataObject = new DataObjectImpl(); + return dataObject; + } + + /** + * + * + * @generated + */ + @Override + public DataObjectReference createDataObjectReference() { + DataObjectReferenceImpl dataObjectReference = new DataObjectReferenceImpl(); + return dataObjectReference; + } + + /** + * + * + * @generated + */ + @Override + public DataOutput createDataOutput() { + DataOutputImpl dataOutput = new DataOutputImpl(); + return dataOutput; + } + + /** + * + * + * @generated + */ + @Override + public DataOutputAssociation createDataOutputAssociation() { + DataOutputAssociationImpl dataOutputAssociation = new DataOutputAssociationImpl(); + return dataOutputAssociation; + } + + /** + * + * + * @generated + */ + @Override + public DataState createDataState() { + DataStateImpl dataState = new DataStateImpl(); + return dataState; + } + + /** + * + * + * @generated + */ + @Override + public DataStore createDataStore() { + DataStoreImpl dataStore = new DataStoreImpl(); + return dataStore; + } + + /** + * + * + * @generated + */ + @Override + public DataStoreReference createDataStoreReference() { + DataStoreReferenceImpl dataStoreReference = new DataStoreReferenceImpl(); + return dataStoreReference; + } + + /** + * + * + * @generated + */ + @Override + public Definitions createDefinitions() { + DefinitionsImpl definitions = new DefinitionsImpl(); + return definitions; + } + + /** + * + * + * @generated + */ + @Override + public Documentation createDocumentation() { + DocumentationImpl documentation = new DocumentationImpl(); + return documentation; + } + + /** + * + * + * @generated + */ + @Override + public EndEvent createEndEvent() { + EndEventImpl endEvent = new EndEventImpl(); + return endEvent; + } + + /** + * + * + * @generated + */ + @Override + public EndPoint createEndPoint() { + EndPointImpl endPoint = new EndPointImpl(); + return endPoint; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.bpmn2.Error createError() { + ErrorImpl error = new ErrorImpl(); + return error; + } + + /** + * + * + * @generated + */ + @Override + public ErrorEventDefinition createErrorEventDefinition() { + ErrorEventDefinitionImpl errorEventDefinition = new ErrorEventDefinitionImpl(); + return errorEventDefinition; + } + + /** + * + * + * @generated + */ + @Override + public Escalation createEscalation() { + EscalationImpl escalation = new EscalationImpl(); + return escalation; + } + + /** + * + * + * @generated + */ + @Override + public EscalationEventDefinition createEscalationEventDefinition() { + EscalationEventDefinitionImpl escalationEventDefinition = new EscalationEventDefinitionImpl(); + return escalationEventDefinition; + } + + /** + * + * + * @generated + */ + @Override + public EventBasedGateway createEventBasedGateway() { + EventBasedGatewayImpl eventBasedGateway = new EventBasedGatewayImpl(); + return eventBasedGateway; + } + + /** + * + * + * @generated + */ + @Override + public EventDefinition createEventDefinition() { + EventDefinitionImpl eventDefinition = new EventDefinitionImpl(); + return eventDefinition; + } + + /** + * + * + * @generated + */ + @Override + public ExclusiveGateway createExclusiveGateway() { + ExclusiveGatewayImpl exclusiveGateway = new ExclusiveGatewayImpl(); + return exclusiveGateway; + } + + /** + * + * + * @generated + */ + @Override + public Expression createExpression() { + ExpressionImpl expression = new ExpressionImpl(); + return expression; + } + + /** + * + * + * @generated + */ + @Override + public Extension createExtension() { + ExtensionImpl extension = new ExtensionImpl(); + return extension; + } + + /** + * + * + * @generated + */ + @Override + public ExtensionAttributeDefinition createExtensionAttributeDefinition() { + ExtensionAttributeDefinitionImpl extensionAttributeDefinition = new ExtensionAttributeDefinitionImpl(); + return extensionAttributeDefinition; + } + + /** + * + * + * @generated + */ + @Override + public ExtensionAttributeValue createExtensionAttributeValue() { + ExtensionAttributeValueImpl extensionAttributeValue = new ExtensionAttributeValueImpl(); + return extensionAttributeValue; + } + + /** + * + * + * @generated + */ + @Override + public ExtensionDefinition createExtensionDefinition() { + ExtensionDefinitionImpl extensionDefinition = new ExtensionDefinitionImpl(); + return extensionDefinition; + } + + /** + * + * + * @generated + */ + @Override + public FormalExpression createFormalExpression() { + FormalExpressionImpl formalExpression = new FormalExpressionImpl(); + return formalExpression; + } + + /** + * + * + * @generated + */ + @Override + public GlobalBusinessRuleTask createGlobalBusinessRuleTask() { + GlobalBusinessRuleTaskImpl globalBusinessRuleTask = new GlobalBusinessRuleTaskImpl(); + return globalBusinessRuleTask; + } + + /** + * + * + * @generated + */ + @Override + public GlobalChoreographyTask createGlobalChoreographyTask() { + GlobalChoreographyTaskImpl globalChoreographyTask = new GlobalChoreographyTaskImpl(); + return globalChoreographyTask; + } + + /** + * + * + * @generated + */ + @Override + public GlobalConversation createGlobalConversation() { + GlobalConversationImpl globalConversation = new GlobalConversationImpl(); + return globalConversation; + } + + /** + * + * + * @generated + */ + @Override + public GlobalManualTask createGlobalManualTask() { + GlobalManualTaskImpl globalManualTask = new GlobalManualTaskImpl(); + return globalManualTask; + } + + /** + * + * + * @generated + */ + @Override + public GlobalScriptTask createGlobalScriptTask() { + GlobalScriptTaskImpl globalScriptTask = new GlobalScriptTaskImpl(); + return globalScriptTask; + } + + /** + * + * + * @generated + */ + @Override + public GlobalTask createGlobalTask() { + GlobalTaskImpl globalTask = new GlobalTaskImpl(); + return globalTask; + } + + /** + * + * + * @generated + */ + @Override + public GlobalUserTask createGlobalUserTask() { + GlobalUserTaskImpl globalUserTask = new GlobalUserTaskImpl(); + return globalUserTask; + } + + /** + * + * + * @generated + */ + @Override + public Group createGroup() { + GroupImpl group = new GroupImpl(); + return group; + } + + /** + * + * + * @generated + */ + @Override + public HumanPerformer createHumanPerformer() { + HumanPerformerImpl humanPerformer = new HumanPerformerImpl(); + return humanPerformer; + } + + /** + * + * + * @generated + */ + @Override + public ImplicitThrowEvent createImplicitThrowEvent() { + ImplicitThrowEventImpl implicitThrowEvent = new ImplicitThrowEventImpl(); + return implicitThrowEvent; + } + + /** + * + * + * @generated + */ + @Override + public Import createImport() { + ImportImpl import_ = new ImportImpl(); + return import_; + } + + /** + * + * + * @generated + */ + @Override + public InclusiveGateway createInclusiveGateway() { + InclusiveGatewayImpl inclusiveGateway = new InclusiveGatewayImpl(); + return inclusiveGateway; + } + + /** + * + * + * @generated + */ + @Override + public InputOutputBinding createInputOutputBinding() { + InputOutputBindingImpl inputOutputBinding = new InputOutputBindingImpl(); + return inputOutputBinding; + } + + /** + * + * + * @generated + */ + @Override + public InputOutputSpecification createInputOutputSpecification() { + InputOutputSpecificationImpl inputOutputSpecification = new InputOutputSpecificationImpl(); + return inputOutputSpecification; + } + + /** + * + * + * @generated + */ + @Override + public InputSet createInputSet() { + InputSetImpl inputSet = new InputSetImpl(); + return inputSet; + } + + /** + * + * + * @generated + */ + @Override + public InteractionNode createInteractionNode() { + InteractionNodeImpl interactionNode = new InteractionNodeImpl(); + return interactionNode; + } + + /** + * + * + * @generated + */ + @Override + public Interface createInterface() { + InterfaceImpl interface_ = new InterfaceImpl(); + return interface_; + } + + /** + * + * + * @generated + */ + @Override + public IntermediateCatchEvent createIntermediateCatchEvent() { + IntermediateCatchEventImpl intermediateCatchEvent = new IntermediateCatchEventImpl(); + return intermediateCatchEvent; + } + + /** + * + * + * @generated + */ + @Override + public IntermediateThrowEvent createIntermediateThrowEvent() { + IntermediateThrowEventImpl intermediateThrowEvent = new IntermediateThrowEventImpl(); + return intermediateThrowEvent; + } + + /** + * + * + * @generated + */ + @Override + public ItemAwareElement createItemAwareElement() { + ItemAwareElementImpl itemAwareElement = new ItemAwareElementImpl(); + return itemAwareElement; + } + + /** + * + * + * @generated + */ + @Override + public ItemDefinition createItemDefinition() { + ItemDefinitionImpl itemDefinition = new ItemDefinitionImpl(); + return itemDefinition; + } + + /** + * + * + * @generated + */ + @Override + public Lane createLane() { + LaneImpl lane = new LaneImpl(); + return lane; + } + + /** + * + * + * @generated + */ + @Override + public LaneSet createLaneSet() { + LaneSetImpl laneSet = new LaneSetImpl(); + return laneSet; + } + + /** + * + * + * @generated + */ + @Override + public LinkEventDefinition createLinkEventDefinition() { + LinkEventDefinitionImpl linkEventDefinition = new LinkEventDefinitionImpl(); + return linkEventDefinition; + } + + /** + * + * + * @generated + */ + @Override + public ManualTask createManualTask() { + ManualTaskImpl manualTask = new ManualTaskImpl(); + return manualTask; + } + + /** + * + * + * @generated + */ + @Override + public Message createMessage() { + MessageImpl message = new MessageImpl(); + return message; + } + + /** + * + * + * @generated + */ + @Override + public MessageEventDefinition createMessageEventDefinition() { + MessageEventDefinitionImpl messageEventDefinition = new MessageEventDefinitionImpl(); + return messageEventDefinition; + } + + /** + * + * + * @generated + */ + @Override + public MessageFlow createMessageFlow() { + MessageFlowImpl messageFlow = new MessageFlowImpl(); + return messageFlow; + } + + /** + * + * + * @generated + */ + @Override + public MessageFlowAssociation createMessageFlowAssociation() { + MessageFlowAssociationImpl messageFlowAssociation = new MessageFlowAssociationImpl(); + return messageFlowAssociation; + } + + /** + * + * + * @generated + */ + @Override + public Monitoring createMonitoring() { + MonitoringImpl monitoring = new MonitoringImpl(); + return monitoring; + } + + /** + * + * + * @generated + */ + @Override + public MultiInstanceLoopCharacteristics createMultiInstanceLoopCharacteristics() { + MultiInstanceLoopCharacteristicsImpl multiInstanceLoopCharacteristics = new MultiInstanceLoopCharacteristicsImpl(); + return multiInstanceLoopCharacteristics; + } + + /** + * + * + * @generated + */ + @Override + public Operation createOperation() { + OperationImpl operation = new OperationImpl(); + return operation; + } + + /** + * + * + * @generated + */ + @Override + public OutputSet createOutputSet() { + OutputSetImpl outputSet = new OutputSetImpl(); + return outputSet; + } + + /** + * + * + * @generated + */ + @Override + public ParallelGateway createParallelGateway() { + ParallelGatewayImpl parallelGateway = new ParallelGatewayImpl(); + return parallelGateway; + } + + /** + * + * + * @generated + */ + @Override + public Participant createParticipant() { + ParticipantImpl participant = new ParticipantImpl(); + return participant; + } + + /** + * + * + * @generated + */ + @Override + public ParticipantAssociation createParticipantAssociation() { + ParticipantAssociationImpl participantAssociation = new ParticipantAssociationImpl(); + return participantAssociation; + } + + /** + * + * + * @generated + */ + @Override + public ParticipantMultiplicity createParticipantMultiplicity() { + ParticipantMultiplicityImpl participantMultiplicity = new ParticipantMultiplicityImpl(); + return participantMultiplicity; + } + + /** + * + * + * @generated + */ + @Override + public PartnerEntity createPartnerEntity() { + PartnerEntityImpl partnerEntity = new PartnerEntityImpl(); + return partnerEntity; + } + + /** + * + * + * @generated + */ + @Override + public PartnerRole createPartnerRole() { + PartnerRoleImpl partnerRole = new PartnerRoleImpl(); + return partnerRole; + } + + /** + * + * + * @generated + */ + @Override + public Performer createPerformer() { + PerformerImpl performer = new PerformerImpl(); + return performer; + } + + /** + * + * + * @generated + */ + @Override + public PotentialOwner createPotentialOwner() { + PotentialOwnerImpl potentialOwner = new PotentialOwnerImpl(); + return potentialOwner; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.bpmn2.Process createProcess() { + ProcessImpl process = new ProcessImpl(); + return process; + } + + /** + * + * + * @generated + */ + @Override + public Property createProperty() { + PropertyImpl property = new PropertyImpl(); + return property; + } + + /** + * + * + * @generated + */ + @Override + public ReceiveTask createReceiveTask() { + ReceiveTaskImpl receiveTask = new ReceiveTaskImpl(); + return receiveTask; + } + + /** + * + * + * @generated + */ + @Override + public Relationship createRelationship() { + RelationshipImpl relationship = new RelationshipImpl(); + return relationship; + } + + /** + * + * + * @generated + */ + @Override + public Rendering createRendering() { + RenderingImpl rendering = new RenderingImpl(); + return rendering; + } + + /** + * + * + * @generated + */ + @Override + public Resource createResource() { + ResourceImpl resource = new ResourceImpl(); + return resource; + } + + /** + * + * + * @generated + */ + @Override + public ResourceAssignmentExpression createResourceAssignmentExpression() { + ResourceAssignmentExpressionImpl resourceAssignmentExpression = new ResourceAssignmentExpressionImpl(); + return resourceAssignmentExpression; + } + + /** + * + * + * @generated + */ + @Override + public ResourceParameter createResourceParameter() { + ResourceParameterImpl resourceParameter = new ResourceParameterImpl(); + return resourceParameter; + } + + /** + * + * + * @generated + */ + @Override + public ResourceParameterBinding createResourceParameterBinding() { + ResourceParameterBindingImpl resourceParameterBinding = new ResourceParameterBindingImpl(); + return resourceParameterBinding; + } + + /** + * + * + * @generated + */ + @Override + public ResourceRole createResourceRole() { + ResourceRoleImpl resourceRole = new ResourceRoleImpl(); + return resourceRole; + } + + /** + * + * + * @generated + */ + @Override + public RootElement createRootElement() { + RootElementImpl rootElement = new RootElementImpl(); + return rootElement; + } + + /** + * + * + * @generated + */ + @Override + public ScriptTask createScriptTask() { + ScriptTaskImpl scriptTask = new ScriptTaskImpl(); + return scriptTask; + } + + /** + * + * + * @generated + */ + @Override + public SendTask createSendTask() { + SendTaskImpl sendTask = new SendTaskImpl(); + return sendTask; + } + + /** + * + * + * @generated + */ + @Override + public SequenceFlow createSequenceFlow() { + SequenceFlowImpl sequenceFlow = new SequenceFlowImpl(); + return sequenceFlow; + } + + /** + * + * + * @generated + */ + @Override + public ServiceTask createServiceTask() { + ServiceTaskImpl serviceTask = new ServiceTaskImpl(); + return serviceTask; + } + + /** + * + * + * @generated + */ + @Override + public Signal createSignal() { + SignalImpl signal = new SignalImpl(); + return signal; + } + + /** + * + * + * @generated + */ + @Override + public SignalEventDefinition createSignalEventDefinition() { + SignalEventDefinitionImpl signalEventDefinition = new SignalEventDefinitionImpl(); + return signalEventDefinition; + } + + /** + * + * + * @generated + */ + @Override + public StandardLoopCharacteristics createStandardLoopCharacteristics() { + StandardLoopCharacteristicsImpl standardLoopCharacteristics = new StandardLoopCharacteristicsImpl(); + return standardLoopCharacteristics; + } + + /** + * + * + * @generated + */ + @Override + public StartEvent createStartEvent() { + StartEventImpl startEvent = new StartEventImpl(); + return startEvent; + } + + /** + * + * + * @generated + */ + @Override + public SubChoreography createSubChoreography() { + SubChoreographyImpl subChoreography = new SubChoreographyImpl(); + return subChoreography; + } + + /** + * + * + * @generated + */ + @Override + public SubConversation createSubConversation() { + SubConversationImpl subConversation = new SubConversationImpl(); + return subConversation; + } + + /** + * + * + * @generated + */ + @Override + public SubProcess createSubProcess() { + SubProcessImpl subProcess = new SubProcessImpl(); + return subProcess; + } + + /** + * + * + * @generated + */ + @Override + public Task createTask() { + TaskImpl task = new TaskImpl(); + return task; + } + + /** + * + * + * @generated + */ + @Override + public TerminateEventDefinition createTerminateEventDefinition() { + TerminateEventDefinitionImpl terminateEventDefinition = new TerminateEventDefinitionImpl(); + return terminateEventDefinition; + } + + /** + * + * + * @generated + */ + @Override + public TextAnnotation createTextAnnotation() { + TextAnnotationImpl textAnnotation = new TextAnnotationImpl(); + return textAnnotation; + } + + /** + * + * + * @generated + */ + @Override + public TimerEventDefinition createTimerEventDefinition() { + TimerEventDefinitionImpl timerEventDefinition = new TimerEventDefinitionImpl(); + return timerEventDefinition; + } + + /** + * + * + * @generated + */ + @Override + public Transaction createTransaction() { + TransactionImpl transaction = new TransactionImpl(); + return transaction; + } + + /** + * + * + * @generated + */ + @Override + public UserTask createUserTask() { + UserTaskImpl userTask = new UserTaskImpl(); + return userTask; + } + + /** + * + * + * @generated + */ + @Override + public EventSubprocess createEventSubprocess() { + EventSubprocessImpl eventSubprocess = new EventSubprocessImpl(); + return eventSubprocess; + } + + /** + * + * + * @generated + */ + public AdHocOrdering createAdHocOrderingFromString(EDataType eDataType, String initialValue) { + AdHocOrdering result = AdHocOrdering.get(initialValue); + if (result == null) + throw new IllegalArgumentException( + "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertAdHocOrderingToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public AssociationDirection createAssociationDirectionFromString(EDataType eDataType, String initialValue) { + AssociationDirection result = AssociationDirection.get(initialValue); + if (result == null) + throw new IllegalArgumentException( + "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertAssociationDirectionToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public ChoreographyLoopType createChoreographyLoopTypeFromString(EDataType eDataType, String initialValue) { + ChoreographyLoopType result = ChoreographyLoopType.get(initialValue); + if (result == null) + throw new IllegalArgumentException( + "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertChoreographyLoopTypeToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public EventBasedGatewayType createEventBasedGatewayTypeFromString(EDataType eDataType, String initialValue) { + EventBasedGatewayType result = EventBasedGatewayType.get(initialValue); + if (result == null) + throw new IllegalArgumentException( + "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertEventBasedGatewayTypeToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public GatewayDirection createGatewayDirectionFromString(EDataType eDataType, String initialValue) { + GatewayDirection result = GatewayDirection.get(initialValue); + if (result == null) + throw new IllegalArgumentException( + "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertGatewayDirectionToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public ItemKind createItemKindFromString(EDataType eDataType, String initialValue) { + ItemKind result = ItemKind.get(initialValue); + if (result == null) + throw new IllegalArgumentException( + "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertItemKindToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public MultiInstanceBehavior createMultiInstanceBehaviorFromString(EDataType eDataType, String initialValue) { + MultiInstanceBehavior result = MultiInstanceBehavior.get(initialValue); + if (result == null) + throw new IllegalArgumentException( + "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertMultiInstanceBehaviorToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public ProcessType createProcessTypeFromString(EDataType eDataType, String initialValue) { + ProcessType result = ProcessType.get(initialValue); + if (result == null) + throw new IllegalArgumentException( + "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertProcessTypeToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public RelationshipDirection createRelationshipDirectionFromString(EDataType eDataType, String initialValue) { + RelationshipDirection result = RelationshipDirection.get(initialValue); + if (result == null) + throw new IllegalArgumentException( + "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertRelationshipDirectionToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + @Override + public Bpmn2Package getBpmn2Package() { + return (Bpmn2Package) getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static Bpmn2Package getPackage() { + return Bpmn2Package.eINSTANCE; + } + +} //Bpmn2FactoryImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/Bpmn2PackageImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/Bpmn2PackageImpl.java new file mode 100644 index 00000000000..0b621afe194 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/Bpmn2PackageImpl.java @@ -0,0 +1,13783 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.IsSerializable; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.AdHocOrdering; +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.Artifact; +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.Association; +import org.eclipse.bpmn2.AssociationDirection; +import org.eclipse.bpmn2.Auditing; +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.Bpmn2Factory; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.BusinessRuleTask; +import org.eclipse.bpmn2.CallActivity; +import org.eclipse.bpmn2.CallChoreography; +import org.eclipse.bpmn2.CallConversation; +import org.eclipse.bpmn2.CallableElement; +import org.eclipse.bpmn2.CancelEventDefinition; +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.Category; +import org.eclipse.bpmn2.CategoryValue; +import org.eclipse.bpmn2.Choreography; +import org.eclipse.bpmn2.ChoreographyActivity; +import org.eclipse.bpmn2.ChoreographyLoopType; +import org.eclipse.bpmn2.ChoreographyTask; +import org.eclipse.bpmn2.Collaboration; +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.ComplexBehaviorDefinition; +import org.eclipse.bpmn2.ComplexGateway; +import org.eclipse.bpmn2.ConditionalEventDefinition; +import org.eclipse.bpmn2.Conversation; +import org.eclipse.bpmn2.ConversationAssociation; +import org.eclipse.bpmn2.ConversationLink; +import org.eclipse.bpmn2.ConversationNode; +import org.eclipse.bpmn2.CorrelationKey; +import org.eclipse.bpmn2.CorrelationProperty; +import org.eclipse.bpmn2.CorrelationPropertyBinding; +import org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression; +import org.eclipse.bpmn2.CorrelationSubscription; +import org.eclipse.bpmn2.DataAssociation; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataObject; +import org.eclipse.bpmn2.DataObjectReference; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.DataState; +import org.eclipse.bpmn2.DataStore; +import org.eclipse.bpmn2.DataStoreReference; +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.DocumentRoot; +import org.eclipse.bpmn2.Documentation; +import org.eclipse.bpmn2.EndEvent; +import org.eclipse.bpmn2.EndPoint; +import org.eclipse.bpmn2.ErrorEventDefinition; +import org.eclipse.bpmn2.Escalation; +import org.eclipse.bpmn2.EscalationEventDefinition; +import org.eclipse.bpmn2.Event; +import org.eclipse.bpmn2.EventBasedGateway; +import org.eclipse.bpmn2.EventBasedGatewayType; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.EventSubprocess; +import org.eclipse.bpmn2.ExclusiveGateway; +import org.eclipse.bpmn2.Expression; +import org.eclipse.bpmn2.Extension; +import org.eclipse.bpmn2.ExtensionAttributeDefinition; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.ExtensionDefinition; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.FlowElementsContainer; +import org.eclipse.bpmn2.FlowNode; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.Gateway; +import org.eclipse.bpmn2.GatewayDirection; +import org.eclipse.bpmn2.GlobalBusinessRuleTask; +import org.eclipse.bpmn2.GlobalChoreographyTask; +import org.eclipse.bpmn2.GlobalConversation; +import org.eclipse.bpmn2.GlobalManualTask; +import org.eclipse.bpmn2.GlobalScriptTask; +import org.eclipse.bpmn2.GlobalTask; +import org.eclipse.bpmn2.GlobalUserTask; +import org.eclipse.bpmn2.Group; +import org.eclipse.bpmn2.HumanPerformer; +import org.eclipse.bpmn2.ImplicitThrowEvent; +import org.eclipse.bpmn2.Import; +import org.eclipse.bpmn2.InclusiveGateway; +import org.eclipse.bpmn2.InputOutputBinding; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.InteractionNode; +import org.eclipse.bpmn2.Interface; +import org.eclipse.bpmn2.IntermediateCatchEvent; +import org.eclipse.bpmn2.IntermediateThrowEvent; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.ItemKind; +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.LaneSet; +import org.eclipse.bpmn2.LinkEventDefinition; +import org.eclipse.bpmn2.LoopCharacteristics; +import org.eclipse.bpmn2.ManualTask; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.MessageEventDefinition; +import org.eclipse.bpmn2.MessageFlow; +import org.eclipse.bpmn2.MessageFlowAssociation; +import org.eclipse.bpmn2.Monitoring; +import org.eclipse.bpmn2.MultiInstanceBehavior; +import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics; +import org.eclipse.bpmn2.Operation; +import org.eclipse.bpmn2.OutputSet; +import org.eclipse.bpmn2.ParallelGateway; +import org.eclipse.bpmn2.Participant; +import org.eclipse.bpmn2.ParticipantAssociation; +import org.eclipse.bpmn2.ParticipantMultiplicity; +import org.eclipse.bpmn2.PartnerEntity; +import org.eclipse.bpmn2.PartnerRole; +import org.eclipse.bpmn2.Performer; +import org.eclipse.bpmn2.PotentialOwner; +import org.eclipse.bpmn2.ProcessType; +import org.eclipse.bpmn2.Property; +import org.eclipse.bpmn2.ReceiveTask; +import org.eclipse.bpmn2.Relationship; +import org.eclipse.bpmn2.RelationshipDirection; +import org.eclipse.bpmn2.Rendering; +import org.eclipse.bpmn2.Resource; +import org.eclipse.bpmn2.ResourceAssignmentExpression; +import org.eclipse.bpmn2.ResourceParameter; +import org.eclipse.bpmn2.ResourceParameterBinding; +import org.eclipse.bpmn2.ResourceRole; +import org.eclipse.bpmn2.RootElement; +import org.eclipse.bpmn2.ScriptTask; +import org.eclipse.bpmn2.SendTask; +import org.eclipse.bpmn2.SequenceFlow; +import org.eclipse.bpmn2.ServiceTask; +import org.eclipse.bpmn2.Signal; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.bpmn2.StandardLoopCharacteristics; +import org.eclipse.bpmn2.StartEvent; +import org.eclipse.bpmn2.SubChoreography; +import org.eclipse.bpmn2.SubConversation; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.TerminateEventDefinition; +import org.eclipse.bpmn2.TextAnnotation; +import org.eclipse.bpmn2.ThrowEvent; +import org.eclipse.bpmn2.TimerEventDefinition; +import org.eclipse.bpmn2.Transaction; +import org.eclipse.bpmn2.UserTask; + +import org.eclipse.bpmn2.di.BpmnDiPackage; + +import org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl; + +import org.eclipse.dd.dc.DcPackage; + +import org.eclipse.dd.dc.impl.DcPackageImpl; + +import org.eclipse.dd.di.DiPackage; + +import org.eclipse.dd.di.impl.DiPackageImpl; + +import org.eclipse.emf.common.util.Reflect; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +import org.eclipse.emf.ecore.xml.type.XMLTypePackage; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class Bpmn2PackageImpl extends EPackageImpl implements Bpmn2Package { + /** + * + * + * @generated + */ + private EClass documentRootEClass = null; + + /** + * + * + * @generated + */ + private EClass activityEClass = null; + + /** + * + * + * @generated + */ + private EClass adHocSubProcessEClass = null; + + /** + * + * + * @generated + */ + private EClass artifactEClass = null; + + /** + * + * + * @generated + */ + private EClass assignmentEClass = null; + + /** + * + * + * @generated + */ + private EClass associationEClass = null; + + /** + * + * + * @generated + */ + private EClass auditingEClass = null; + + /** + * + * + * @generated + */ + private EClass baseElementEClass = null; + + /** + * + * + * @generated + */ + private EClass boundaryEventEClass = null; + + /** + * + * + * @generated + */ + private EClass businessRuleTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass callActivityEClass = null; + + /** + * + * + * @generated + */ + private EClass callChoreographyEClass = null; + + /** + * + * + * @generated + */ + private EClass callConversationEClass = null; + + /** + * + * + * @generated + */ + private EClass callableElementEClass = null; + + /** + * + * + * @generated + */ + private EClass cancelEventDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass catchEventEClass = null; + + /** + * + * + * @generated + */ + private EClass categoryEClass = null; + + /** + * + * + * @generated + */ + private EClass categoryValueEClass = null; + + /** + * + * + * @generated + */ + private EClass choreographyEClass = null; + + /** + * + * + * @generated + */ + private EClass choreographyActivityEClass = null; + + /** + * + * + * @generated + */ + private EClass choreographyTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass collaborationEClass = null; + + /** + * + * + * @generated + */ + private EClass compensateEventDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass complexBehaviorDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass complexGatewayEClass = null; + + /** + * + * + * @generated + */ + private EClass conditionalEventDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass conversationEClass = null; + + /** + * + * + * @generated + */ + private EClass conversationAssociationEClass = null; + + /** + * + * + * @generated + */ + private EClass conversationLinkEClass = null; + + /** + * + * + * @generated + */ + private EClass conversationNodeEClass = null; + + /** + * + * + * @generated + */ + private EClass correlationKeyEClass = null; + + /** + * + * + * @generated + */ + private EClass correlationPropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass correlationPropertyBindingEClass = null; + + /** + * + * + * @generated + */ + private EClass correlationPropertyRetrievalExpressionEClass = null; + + /** + * + * + * @generated + */ + private EClass correlationSubscriptionEClass = null; + + /** + * + * + * @generated + */ + private EClass dataAssociationEClass = null; + + /** + * + * + * @generated + */ + private EClass dataInputEClass = null; + + /** + * + * + * @generated + */ + private EClass dataInputAssociationEClass = null; + + /** + * + * + * @generated + */ + private EClass dataObjectEClass = null; + + /** + * + * + * @generated + */ + private EClass dataObjectReferenceEClass = null; + + /** + * + * + * @generated + */ + private EClass dataOutputEClass = null; + + /** + * + * + * @generated + */ + private EClass dataOutputAssociationEClass = null; + + /** + * + * + * @generated + */ + private EClass dataStateEClass = null; + + /** + * + * + * @generated + */ + private EClass dataStoreEClass = null; + + /** + * + * + * @generated + */ + private EClass dataStoreReferenceEClass = null; + + /** + * + * + * @generated + */ + private EClass definitionsEClass = null; + + /** + * + * + * @generated + */ + private EClass documentationEClass = null; + + /** + * + * + * @generated + */ + private EClass endEventEClass = null; + + /** + * + * + * @generated + */ + private EClass endPointEClass = null; + + /** + * + * + * @generated + */ + private EClass errorEClass = null; + + /** + * + * + * @generated + */ + private EClass errorEventDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass escalationEClass = null; + + /** + * + * + * @generated + */ + private EClass escalationEventDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass eventEClass = null; + + /** + * + * + * @generated + */ + private EClass eventBasedGatewayEClass = null; + + /** + * + * + * @generated + */ + private EClass eventDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass exclusiveGatewayEClass = null; + + /** + * + * + * @generated + */ + private EClass expressionEClass = null; + + /** + * + * + * @generated + */ + private EClass extensionEClass = null; + + /** + * + * + * @generated + */ + private EClass extensionAttributeDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass extensionAttributeValueEClass = null; + + /** + * + * + * @generated + */ + private EClass extensionDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass flowElementEClass = null; + + /** + * + * + * @generated + */ + private EClass flowElementsContainerEClass = null; + + /** + * + * + * @generated + */ + private EClass flowNodeEClass = null; + + /** + * + * + * @generated + */ + private EClass formalExpressionEClass = null; + + /** + * + * + * @generated + */ + private EClass gatewayEClass = null; + + /** + * + * + * @generated + */ + private EClass globalBusinessRuleTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass globalChoreographyTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass globalConversationEClass = null; + + /** + * + * + * @generated + */ + private EClass globalManualTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass globalScriptTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass globalTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass globalUserTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass groupEClass = null; + + /** + * + * + * @generated + */ + private EClass humanPerformerEClass = null; + + /** + * + * + * @generated + */ + private EClass implicitThrowEventEClass = null; + + /** + * + * + * @generated + */ + private EClass importEClass = null; + + /** + * + * + * @generated + */ + private EClass inclusiveGatewayEClass = null; + + /** + * + * + * @generated + */ + private EClass inputOutputBindingEClass = null; + + /** + * + * + * @generated + */ + private EClass inputOutputSpecificationEClass = null; + + /** + * + * + * @generated + */ + private EClass inputSetEClass = null; + + /** + * + * + * @generated + */ + private EClass interactionNodeEClass = null; + + /** + * + * + * @generated + */ + private EClass interfaceEClass = null; + + /** + * + * + * @generated + */ + private EClass intermediateCatchEventEClass = null; + + /** + * + * + * @generated + */ + private EClass intermediateThrowEventEClass = null; + + /** + * + * + * @generated + */ + private EClass itemAwareElementEClass = null; + + /** + * + * + * @generated + */ + private EClass itemDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass laneEClass = null; + + /** + * + * + * @generated + */ + private EClass laneSetEClass = null; + + /** + * + * + * @generated + */ + private EClass linkEventDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass loopCharacteristicsEClass = null; + + /** + * + * + * @generated + */ + private EClass manualTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass messageEClass = null; + + /** + * + * + * @generated + */ + private EClass messageEventDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass messageFlowEClass = null; + + /** + * + * + * @generated + */ + private EClass messageFlowAssociationEClass = null; + + /** + * + * + * @generated + */ + private EClass monitoringEClass = null; + + /** + * + * + * @generated + */ + private EClass multiInstanceLoopCharacteristicsEClass = null; + + /** + * + * + * @generated + */ + private EClass operationEClass = null; + + /** + * + * + * @generated + */ + private EClass outputSetEClass = null; + + /** + * + * + * @generated + */ + private EClass parallelGatewayEClass = null; + + /** + * + * + * @generated + */ + private EClass participantEClass = null; + + /** + * + * + * @generated + */ + private EClass participantAssociationEClass = null; + + /** + * + * + * @generated + */ + private EClass participantMultiplicityEClass = null; + + /** + * + * + * @generated + */ + private EClass partnerEntityEClass = null; + + /** + * + * + * @generated + */ + private EClass partnerRoleEClass = null; + + /** + * + * + * @generated + */ + private EClass performerEClass = null; + + /** + * + * + * @generated + */ + private EClass potentialOwnerEClass = null; + + /** + * + * + * @generated + */ + private EClass processEClass = null; + + /** + * + * + * @generated + */ + private EClass propertyEClass = null; + + /** + * + * + * @generated + */ + private EClass receiveTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass relationshipEClass = null; + + /** + * + * + * @generated + */ + private EClass renderingEClass = null; + + /** + * + * + * @generated + */ + private EClass resourceEClass = null; + + /** + * + * + * @generated + */ + private EClass resourceAssignmentExpressionEClass = null; + + /** + * + * + * @generated + */ + private EClass resourceParameterEClass = null; + + /** + * + * + * @generated + */ + private EClass resourceParameterBindingEClass = null; + + /** + * + * + * @generated + */ + private EClass resourceRoleEClass = null; + + /** + * + * + * @generated + */ + private EClass rootElementEClass = null; + + /** + * + * + * @generated + */ + private EClass scriptTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass sendTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass sequenceFlowEClass = null; + + /** + * + * + * @generated + */ + private EClass serviceTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass signalEClass = null; + + /** + * + * + * @generated + */ + private EClass signalEventDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass standardLoopCharacteristicsEClass = null; + + /** + * + * + * @generated + */ + private EClass startEventEClass = null; + + /** + * + * + * @generated + */ + private EClass subChoreographyEClass = null; + + /** + * + * + * @generated + */ + private EClass subConversationEClass = null; + + /** + * + * + * @generated + */ + private EClass subProcessEClass = null; + + /** + * + * + * @generated + */ + private EClass taskEClass = null; + + /** + * + * + * @generated + */ + private EClass terminateEventDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass textAnnotationEClass = null; + + /** + * + * + * @generated + */ + private EClass throwEventEClass = null; + + /** + * + * + * @generated + */ + private EClass timerEventDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass transactionEClass = null; + + /** + * + * + * @generated + */ + private EClass userTaskEClass = null; + + /** + * + * + * @generated + */ + private EClass eventSubprocessEClass = null; + + /** + * + * + * @generated + */ + private EEnum adHocOrderingEEnum = null; + + /** + * + * + * @generated + */ + private EEnum associationDirectionEEnum = null; + + /** + * + * + * @generated + */ + private EEnum choreographyLoopTypeEEnum = null; + + /** + * + * + * @generated + */ + private EEnum eventBasedGatewayTypeEEnum = null; + + /** + * + * + * @generated + */ + private EEnum gatewayDirectionEEnum = null; + + /** + * + * + * @generated + */ + private EEnum itemKindEEnum = null; + + /** + * + * + * @generated + */ + private EEnum multiInstanceBehaviorEEnum = null; + + /** + * + * + * @generated + */ + private EEnum processTypeEEnum = null; + + /** + * + * + * @generated + */ + private EEnum relationshipDirectionEEnum = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.bpmn2.Bpmn2Package#eNS_URI + * @see #init() + * @generated + */ + private Bpmn2PackageImpl() { + super(eNS_URI, Bpmn2Factory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link Bpmn2Package#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static Bpmn2Package init() { + if (isInited) + return (Bpmn2Package) EPackage.Registry.INSTANCE.getEPackage(Bpmn2Package.eNS_URI); + + initializeRegistryHelpers(); + + // Obtain or create and register package + Object registeredBpmn2Package = EPackage.Registry.INSTANCE.get(eNS_URI); + Bpmn2PackageImpl theBpmn2Package = registeredBpmn2Package instanceof Bpmn2PackageImpl + ? (Bpmn2PackageImpl) registeredBpmn2Package + : new Bpmn2PackageImpl(); + + isInited = true; + + // Initialize simple dependencies + XMLTypePackage.eINSTANCE.eClass(); + + // Obtain or create and register interdependencies + Object registeredPackage = EPackage.Registry.INSTANCE.getEPackage(BpmnDiPackage.eNS_URI); + BpmnDiPackageImpl theBpmnDiPackage = (BpmnDiPackageImpl) (registeredPackage instanceof BpmnDiPackageImpl + ? registeredPackage + : BpmnDiPackage.eINSTANCE); + registeredPackage = EPackage.Registry.INSTANCE.getEPackage(DiPackage.eNS_URI); + DiPackageImpl theDiPackage = (DiPackageImpl) (registeredPackage instanceof DiPackageImpl ? registeredPackage + : DiPackage.eINSTANCE); + registeredPackage = EPackage.Registry.INSTANCE.getEPackage(DcPackage.eNS_URI); + DcPackageImpl theDcPackage = (DcPackageImpl) (registeredPackage instanceof DcPackageImpl ? registeredPackage + : DcPackage.eINSTANCE); + + // Create package meta-data objects + theBpmn2Package.createPackageContents(); + theBpmnDiPackage.createPackageContents(); + theDiPackage.createPackageContents(); + theDcPackage.createPackageContents(); + + // Initialize created meta-data + theBpmn2Package.initializePackageContents(); + theBpmnDiPackage.initializePackageContents(); + theDiPackage.initializePackageContents(); + theDcPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theBpmn2Package.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(Bpmn2Package.eNS_URI, theBpmn2Package); + return theBpmn2Package; + } + + /** + * + * + * @generated + */ + public static void initializeRegistryHelpers() { + Reflect.register(DocumentRoot.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DocumentRoot; + } + + public Object newArrayInstance(int size) { + return new DocumentRoot[size]; + } + }); + Reflect.register(Activity.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Activity; + } + + public Object newArrayInstance(int size) { + return new Activity[size]; + } + }); + Reflect.register(AdHocSubProcess.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof AdHocSubProcess; + } + + public Object newArrayInstance(int size) { + return new AdHocSubProcess[size]; + } + }); + Reflect.register(Artifact.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Artifact; + } + + public Object newArrayInstance(int size) { + return new Artifact[size]; + } + }); + Reflect.register(Assignment.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Assignment; + } + + public Object newArrayInstance(int size) { + return new Assignment[size]; + } + }); + Reflect.register(Association.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Association; + } + + public Object newArrayInstance(int size) { + return new Association[size]; + } + }); + Reflect.register(Auditing.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Auditing; + } + + public Object newArrayInstance(int size) { + return new Auditing[size]; + } + }); + Reflect.register(BaseElement.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof BaseElement; + } + + public Object newArrayInstance(int size) { + return new BaseElement[size]; + } + }); + Reflect.register(BoundaryEvent.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof BoundaryEvent; + } + + public Object newArrayInstance(int size) { + return new BoundaryEvent[size]; + } + }); + Reflect.register(BusinessRuleTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof BusinessRuleTask; + } + + public Object newArrayInstance(int size) { + return new BusinessRuleTask[size]; + } + }); + Reflect.register(CallActivity.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CallActivity; + } + + public Object newArrayInstance(int size) { + return new CallActivity[size]; + } + }); + Reflect.register(CallChoreography.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CallChoreography; + } + + public Object newArrayInstance(int size) { + return new CallChoreography[size]; + } + }); + Reflect.register(CallConversation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CallConversation; + } + + public Object newArrayInstance(int size) { + return new CallConversation[size]; + } + }); + Reflect.register(CallableElement.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CallableElement; + } + + public Object newArrayInstance(int size) { + return new CallableElement[size]; + } + }); + Reflect.register(CancelEventDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CancelEventDefinition; + } + + public Object newArrayInstance(int size) { + return new CancelEventDefinition[size]; + } + }); + Reflect.register(CatchEvent.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CatchEvent; + } + + public Object newArrayInstance(int size) { + return new CatchEvent[size]; + } + }); + Reflect.register(Category.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Category; + } + + public Object newArrayInstance(int size) { + return new Category[size]; + } + }); + Reflect.register(CategoryValue.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CategoryValue; + } + + public Object newArrayInstance(int size) { + return new CategoryValue[size]; + } + }); + Reflect.register(Choreography.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Choreography; + } + + public Object newArrayInstance(int size) { + return new Choreography[size]; + } + }); + Reflect.register(ChoreographyActivity.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ChoreographyActivity; + } + + public Object newArrayInstance(int size) { + return new ChoreographyActivity[size]; + } + }); + Reflect.register(ChoreographyTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ChoreographyTask; + } + + public Object newArrayInstance(int size) { + return new ChoreographyTask[size]; + } + }); + Reflect.register(Collaboration.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Collaboration; + } + + public Object newArrayInstance(int size) { + return new Collaboration[size]; + } + }); + Reflect.register(CompensateEventDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CompensateEventDefinition; + } + + public Object newArrayInstance(int size) { + return new CompensateEventDefinition[size]; + } + }); + Reflect.register(ComplexBehaviorDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ComplexBehaviorDefinition; + } + + public Object newArrayInstance(int size) { + return new ComplexBehaviorDefinition[size]; + } + }); + Reflect.register(ComplexGateway.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ComplexGateway; + } + + public Object newArrayInstance(int size) { + return new ComplexGateway[size]; + } + }); + Reflect.register(ConditionalEventDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ConditionalEventDefinition; + } + + public Object newArrayInstance(int size) { + return new ConditionalEventDefinition[size]; + } + }); + Reflect.register(Conversation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Conversation; + } + + public Object newArrayInstance(int size) { + return new Conversation[size]; + } + }); + Reflect.register(ConversationAssociation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ConversationAssociation; + } + + public Object newArrayInstance(int size) { + return new ConversationAssociation[size]; + } + }); + Reflect.register(ConversationLink.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ConversationLink; + } + + public Object newArrayInstance(int size) { + return new ConversationLink[size]; + } + }); + Reflect.register(ConversationNode.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ConversationNode; + } + + public Object newArrayInstance(int size) { + return new ConversationNode[size]; + } + }); + Reflect.register(CorrelationKey.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CorrelationKey; + } + + public Object newArrayInstance(int size) { + return new CorrelationKey[size]; + } + }); + Reflect.register(CorrelationProperty.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CorrelationProperty; + } + + public Object newArrayInstance(int size) { + return new CorrelationProperty[size]; + } + }); + Reflect.register(CorrelationPropertyBinding.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CorrelationPropertyBinding; + } + + public Object newArrayInstance(int size) { + return new CorrelationPropertyBinding[size]; + } + }); + Reflect.register(CorrelationPropertyRetrievalExpression.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CorrelationPropertyRetrievalExpression; + } + + public Object newArrayInstance(int size) { + return new CorrelationPropertyRetrievalExpression[size]; + } + }); + Reflect.register(CorrelationSubscription.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof CorrelationSubscription; + } + + public Object newArrayInstance(int size) { + return new CorrelationSubscription[size]; + } + }); + Reflect.register(DataAssociation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DataAssociation; + } + + public Object newArrayInstance(int size) { + return new DataAssociation[size]; + } + }); + Reflect.register(DataInput.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DataInput; + } + + public Object newArrayInstance(int size) { + return new DataInput[size]; + } + }); + Reflect.register(DataInputAssociation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DataInputAssociation; + } + + public Object newArrayInstance(int size) { + return new DataInputAssociation[size]; + } + }); + Reflect.register(DataObject.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DataObject; + } + + public Object newArrayInstance(int size) { + return new DataObject[size]; + } + }); + Reflect.register(DataObjectReference.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DataObjectReference; + } + + public Object newArrayInstance(int size) { + return new DataObjectReference[size]; + } + }); + Reflect.register(DataOutput.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DataOutput; + } + + public Object newArrayInstance(int size) { + return new DataOutput[size]; + } + }); + Reflect.register(DataOutputAssociation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DataOutputAssociation; + } + + public Object newArrayInstance(int size) { + return new DataOutputAssociation[size]; + } + }); + Reflect.register(DataState.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DataState; + } + + public Object newArrayInstance(int size) { + return new DataState[size]; + } + }); + Reflect.register(DataStore.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DataStore; + } + + public Object newArrayInstance(int size) { + return new DataStore[size]; + } + }); + Reflect.register(DataStoreReference.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DataStoreReference; + } + + public Object newArrayInstance(int size) { + return new DataStoreReference[size]; + } + }); + Reflect.register(Definitions.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Definitions; + } + + public Object newArrayInstance(int size) { + return new Definitions[size]; + } + }); + Reflect.register(Documentation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Documentation; + } + + public Object newArrayInstance(int size) { + return new Documentation[size]; + } + }); + Reflect.register(EndEvent.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof EndEvent; + } + + public Object newArrayInstance(int size) { + return new EndEvent[size]; + } + }); + Reflect.register(EndPoint.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof EndPoint; + } + + public Object newArrayInstance(int size) { + return new EndPoint[size]; + } + }); + Reflect.register(org.eclipse.bpmn2.Error.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof org.eclipse.bpmn2.Error; + } + + public Object newArrayInstance(int size) { + return new org.eclipse.bpmn2.Error[size]; + } + }); + Reflect.register(ErrorEventDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ErrorEventDefinition; + } + + public Object newArrayInstance(int size) { + return new ErrorEventDefinition[size]; + } + }); + Reflect.register(Escalation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Escalation; + } + + public Object newArrayInstance(int size) { + return new Escalation[size]; + } + }); + Reflect.register(EscalationEventDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof EscalationEventDefinition; + } + + public Object newArrayInstance(int size) { + return new EscalationEventDefinition[size]; + } + }); + Reflect.register(Event.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Event; + } + + public Object newArrayInstance(int size) { + return new Event[size]; + } + }); + Reflect.register(EventBasedGateway.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof EventBasedGateway; + } + + public Object newArrayInstance(int size) { + return new EventBasedGateway[size]; + } + }); + Reflect.register(EventDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof EventDefinition; + } + + public Object newArrayInstance(int size) { + return new EventDefinition[size]; + } + }); + Reflect.register(ExclusiveGateway.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ExclusiveGateway; + } + + public Object newArrayInstance(int size) { + return new ExclusiveGateway[size]; + } + }); + Reflect.register(Expression.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Expression; + } + + public Object newArrayInstance(int size) { + return new Expression[size]; + } + }); + Reflect.register(Extension.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Extension; + } + + public Object newArrayInstance(int size) { + return new Extension[size]; + } + }); + Reflect.register(ExtensionAttributeDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ExtensionAttributeDefinition; + } + + public Object newArrayInstance(int size) { + return new ExtensionAttributeDefinition[size]; + } + }); + Reflect.register(ExtensionAttributeValue.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ExtensionAttributeValue; + } + + public Object newArrayInstance(int size) { + return new ExtensionAttributeValue[size]; + } + }); + Reflect.register(ExtensionDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ExtensionDefinition; + } + + public Object newArrayInstance(int size) { + return new ExtensionDefinition[size]; + } + }); + Reflect.register(FlowElement.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof FlowElement; + } + + public Object newArrayInstance(int size) { + return new FlowElement[size]; + } + }); + Reflect.register(FlowElementsContainer.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof FlowElementsContainer; + } + + public Object newArrayInstance(int size) { + return new FlowElementsContainer[size]; + } + }); + Reflect.register(FlowNode.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof FlowNode; + } + + public Object newArrayInstance(int size) { + return new FlowNode[size]; + } + }); + Reflect.register(FormalExpression.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof FormalExpression; + } + + public Object newArrayInstance(int size) { + return new FormalExpression[size]; + } + }); + Reflect.register(Gateway.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Gateway; + } + + public Object newArrayInstance(int size) { + return new Gateway[size]; + } + }); + Reflect.register(GlobalBusinessRuleTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof GlobalBusinessRuleTask; + } + + public Object newArrayInstance(int size) { + return new GlobalBusinessRuleTask[size]; + } + }); + Reflect.register(GlobalChoreographyTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof GlobalChoreographyTask; + } + + public Object newArrayInstance(int size) { + return new GlobalChoreographyTask[size]; + } + }); + Reflect.register(GlobalConversation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof GlobalConversation; + } + + public Object newArrayInstance(int size) { + return new GlobalConversation[size]; + } + }); + Reflect.register(GlobalManualTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof GlobalManualTask; + } + + public Object newArrayInstance(int size) { + return new GlobalManualTask[size]; + } + }); + Reflect.register(GlobalScriptTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof GlobalScriptTask; + } + + public Object newArrayInstance(int size) { + return new GlobalScriptTask[size]; + } + }); + Reflect.register(GlobalTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof GlobalTask; + } + + public Object newArrayInstance(int size) { + return new GlobalTask[size]; + } + }); + Reflect.register(GlobalUserTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof GlobalUserTask; + } + + public Object newArrayInstance(int size) { + return new GlobalUserTask[size]; + } + }); + Reflect.register(Group.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Group; + } + + public Object newArrayInstance(int size) { + return new Group[size]; + } + }); + Reflect.register(HumanPerformer.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof HumanPerformer; + } + + public Object newArrayInstance(int size) { + return new HumanPerformer[size]; + } + }); + Reflect.register(ImplicitThrowEvent.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ImplicitThrowEvent; + } + + public Object newArrayInstance(int size) { + return new ImplicitThrowEvent[size]; + } + }); + Reflect.register(Import.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Import; + } + + public Object newArrayInstance(int size) { + return new Import[size]; + } + }); + Reflect.register(InclusiveGateway.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof InclusiveGateway; + } + + public Object newArrayInstance(int size) { + return new InclusiveGateway[size]; + } + }); + Reflect.register(InputOutputBinding.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof InputOutputBinding; + } + + public Object newArrayInstance(int size) { + return new InputOutputBinding[size]; + } + }); + Reflect.register(InputOutputSpecification.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof InputOutputSpecification; + } + + public Object newArrayInstance(int size) { + return new InputOutputSpecification[size]; + } + }); + Reflect.register(InputSet.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof InputSet; + } + + public Object newArrayInstance(int size) { + return new InputSet[size]; + } + }); + Reflect.register(InteractionNode.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof InteractionNode; + } + + public Object newArrayInstance(int size) { + return new InteractionNode[size]; + } + }); + Reflect.register(Interface.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Interface; + } + + public Object newArrayInstance(int size) { + return new Interface[size]; + } + }); + Reflect.register(IntermediateCatchEvent.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof IntermediateCatchEvent; + } + + public Object newArrayInstance(int size) { + return new IntermediateCatchEvent[size]; + } + }); + Reflect.register(IntermediateThrowEvent.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof IntermediateThrowEvent; + } + + public Object newArrayInstance(int size) { + return new IntermediateThrowEvent[size]; + } + }); + Reflect.register(ItemAwareElement.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ItemAwareElement; + } + + public Object newArrayInstance(int size) { + return new ItemAwareElement[size]; + } + }); + Reflect.register(ItemDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ItemDefinition; + } + + public Object newArrayInstance(int size) { + return new ItemDefinition[size]; + } + }); + Reflect.register(Lane.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Lane; + } + + public Object newArrayInstance(int size) { + return new Lane[size]; + } + }); + Reflect.register(LaneSet.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof LaneSet; + } + + public Object newArrayInstance(int size) { + return new LaneSet[size]; + } + }); + Reflect.register(LinkEventDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof LinkEventDefinition; + } + + public Object newArrayInstance(int size) { + return new LinkEventDefinition[size]; + } + }); + Reflect.register(LoopCharacteristics.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof LoopCharacteristics; + } + + public Object newArrayInstance(int size) { + return new LoopCharacteristics[size]; + } + }); + Reflect.register(ManualTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ManualTask; + } + + public Object newArrayInstance(int size) { + return new ManualTask[size]; + } + }); + Reflect.register(Message.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Message; + } + + public Object newArrayInstance(int size) { + return new Message[size]; + } + }); + Reflect.register(MessageEventDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof MessageEventDefinition; + } + + public Object newArrayInstance(int size) { + return new MessageEventDefinition[size]; + } + }); + Reflect.register(MessageFlow.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof MessageFlow; + } + + public Object newArrayInstance(int size) { + return new MessageFlow[size]; + } + }); + Reflect.register(MessageFlowAssociation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof MessageFlowAssociation; + } + + public Object newArrayInstance(int size) { + return new MessageFlowAssociation[size]; + } + }); + Reflect.register(Monitoring.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Monitoring; + } + + public Object newArrayInstance(int size) { + return new Monitoring[size]; + } + }); + Reflect.register(MultiInstanceLoopCharacteristics.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof MultiInstanceLoopCharacteristics; + } + + public Object newArrayInstance(int size) { + return new MultiInstanceLoopCharacteristics[size]; + } + }); + Reflect.register(Operation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Operation; + } + + public Object newArrayInstance(int size) { + return new Operation[size]; + } + }); + Reflect.register(OutputSet.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof OutputSet; + } + + public Object newArrayInstance(int size) { + return new OutputSet[size]; + } + }); + Reflect.register(ParallelGateway.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ParallelGateway; + } + + public Object newArrayInstance(int size) { + return new ParallelGateway[size]; + } + }); + Reflect.register(Participant.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Participant; + } + + public Object newArrayInstance(int size) { + return new Participant[size]; + } + }); + Reflect.register(ParticipantAssociation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ParticipantAssociation; + } + + public Object newArrayInstance(int size) { + return new ParticipantAssociation[size]; + } + }); + Reflect.register(ParticipantMultiplicity.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ParticipantMultiplicity; + } + + public Object newArrayInstance(int size) { + return new ParticipantMultiplicity[size]; + } + }); + Reflect.register(PartnerEntity.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof PartnerEntity; + } + + public Object newArrayInstance(int size) { + return new PartnerEntity[size]; + } + }); + Reflect.register(PartnerRole.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof PartnerRole; + } + + public Object newArrayInstance(int size) { + return new PartnerRole[size]; + } + }); + Reflect.register(Performer.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Performer; + } + + public Object newArrayInstance(int size) { + return new Performer[size]; + } + }); + Reflect.register(PotentialOwner.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof PotentialOwner; + } + + public Object newArrayInstance(int size) { + return new PotentialOwner[size]; + } + }); + Reflect.register(org.eclipse.bpmn2.Process.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof org.eclipse.bpmn2.Process; + } + + public Object newArrayInstance(int size) { + return new org.eclipse.bpmn2.Process[size]; + } + }); + Reflect.register(Property.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Property; + } + + public Object newArrayInstance(int size) { + return new Property[size]; + } + }); + Reflect.register(ReceiveTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ReceiveTask; + } + + public Object newArrayInstance(int size) { + return new ReceiveTask[size]; + } + }); + Reflect.register(Relationship.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Relationship; + } + + public Object newArrayInstance(int size) { + return new Relationship[size]; + } + }); + Reflect.register(Rendering.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Rendering; + } + + public Object newArrayInstance(int size) { + return new Rendering[size]; + } + }); + Reflect.register(Resource.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Resource; + } + + public Object newArrayInstance(int size) { + return new Resource[size]; + } + }); + Reflect.register(ResourceAssignmentExpression.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ResourceAssignmentExpression; + } + + public Object newArrayInstance(int size) { + return new ResourceAssignmentExpression[size]; + } + }); + Reflect.register(ResourceParameter.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ResourceParameter; + } + + public Object newArrayInstance(int size) { + return new ResourceParameter[size]; + } + }); + Reflect.register(ResourceParameterBinding.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ResourceParameterBinding; + } + + public Object newArrayInstance(int size) { + return new ResourceParameterBinding[size]; + } + }); + Reflect.register(ResourceRole.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ResourceRole; + } + + public Object newArrayInstance(int size) { + return new ResourceRole[size]; + } + }); + Reflect.register(RootElement.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof RootElement; + } + + public Object newArrayInstance(int size) { + return new RootElement[size]; + } + }); + Reflect.register(ScriptTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ScriptTask; + } + + public Object newArrayInstance(int size) { + return new ScriptTask[size]; + } + }); + Reflect.register(SendTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof SendTask; + } + + public Object newArrayInstance(int size) { + return new SendTask[size]; + } + }); + Reflect.register(SequenceFlow.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof SequenceFlow; + } + + public Object newArrayInstance(int size) { + return new SequenceFlow[size]; + } + }); + Reflect.register(ServiceTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ServiceTask; + } + + public Object newArrayInstance(int size) { + return new ServiceTask[size]; + } + }); + Reflect.register(Signal.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Signal; + } + + public Object newArrayInstance(int size) { + return new Signal[size]; + } + }); + Reflect.register(SignalEventDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof SignalEventDefinition; + } + + public Object newArrayInstance(int size) { + return new SignalEventDefinition[size]; + } + }); + Reflect.register(StandardLoopCharacteristics.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof StandardLoopCharacteristics; + } + + public Object newArrayInstance(int size) { + return new StandardLoopCharacteristics[size]; + } + }); + Reflect.register(StartEvent.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof StartEvent; + } + + public Object newArrayInstance(int size) { + return new StartEvent[size]; + } + }); + Reflect.register(SubChoreography.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof SubChoreography; + } + + public Object newArrayInstance(int size) { + return new SubChoreography[size]; + } + }); + Reflect.register(SubConversation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof SubConversation; + } + + public Object newArrayInstance(int size) { + return new SubConversation[size]; + } + }); + Reflect.register(SubProcess.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof SubProcess; + } + + public Object newArrayInstance(int size) { + return new SubProcess[size]; + } + }); + Reflect.register(Task.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Task; + } + + public Object newArrayInstance(int size) { + return new Task[size]; + } + }); + Reflect.register(TerminateEventDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof TerminateEventDefinition; + } + + public Object newArrayInstance(int size) { + return new TerminateEventDefinition[size]; + } + }); + Reflect.register(TextAnnotation.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof TextAnnotation; + } + + public Object newArrayInstance(int size) { + return new TextAnnotation[size]; + } + }); + Reflect.register(ThrowEvent.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ThrowEvent; + } + + public Object newArrayInstance(int size) { + return new ThrowEvent[size]; + } + }); + Reflect.register(TimerEventDefinition.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof TimerEventDefinition; + } + + public Object newArrayInstance(int size) { + return new TimerEventDefinition[size]; + } + }); + Reflect.register(Transaction.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Transaction; + } + + public Object newArrayInstance(int size) { + return new Transaction[size]; + } + }); + Reflect.register(UserTask.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof UserTask; + } + + public Object newArrayInstance(int size) { + return new UserTask[size]; + } + }); + Reflect.register(EventSubprocess.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof EventSubprocess; + } + + public Object newArrayInstance(int size) { + return new EventSubprocess[size]; + } + }); + Reflect.register(AdHocOrdering.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof AdHocOrdering; + } + + public Object newArrayInstance(int size) { + return new AdHocOrdering[size]; + } + }); + Reflect.register(AssociationDirection.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof AssociationDirection; + } + + public Object newArrayInstance(int size) { + return new AssociationDirection[size]; + } + }); + Reflect.register(ChoreographyLoopType.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ChoreographyLoopType; + } + + public Object newArrayInstance(int size) { + return new ChoreographyLoopType[size]; + } + }); + Reflect.register(EventBasedGatewayType.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof EventBasedGatewayType; + } + + public Object newArrayInstance(int size) { + return new EventBasedGatewayType[size]; + } + }); + Reflect.register(GatewayDirection.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof GatewayDirection; + } + + public Object newArrayInstance(int size) { + return new GatewayDirection[size]; + } + }); + Reflect.register(ItemKind.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ItemKind; + } + + public Object newArrayInstance(int size) { + return new ItemKind[size]; + } + }); + Reflect.register(MultiInstanceBehavior.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof MultiInstanceBehavior; + } + + public Object newArrayInstance(int size) { + return new MultiInstanceBehavior[size]; + } + }); + Reflect.register(ProcessType.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof ProcessType; + } + + public Object newArrayInstance(int size) { + return new ProcessType[size]; + } + }); + Reflect.register(RelationshipDirection.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof RelationshipDirection; + } + + public Object newArrayInstance(int size) { + return new RelationshipDirection[size]; + } + }); + } + + /** + * + * + * @generated + */ + public static class WhiteList implements IsSerializable, EBasicWhiteList { + /** + * + * + * @generated + */ + protected DocumentRoot documentRoot; + + /** + * + * + * @generated + */ + protected Activity activity; + + /** + * + * + * @generated + */ + protected AdHocSubProcess adHocSubProcess; + + /** + * + * + * @generated + */ + protected Artifact artifact; + + /** + * + * + * @generated + */ + protected Assignment assignment; + + /** + * + * + * @generated + */ + protected Association association; + + /** + * + * + * @generated + */ + protected Auditing auditing; + + /** + * + * + * @generated + */ + protected BaseElement baseElement; + + /** + * + * + * @generated + */ + protected BoundaryEvent boundaryEvent; + + /** + * + * + * @generated + */ + protected BusinessRuleTask businessRuleTask; + + /** + * + * + * @generated + */ + protected CallActivity callActivity; + + /** + * + * + * @generated + */ + protected CallChoreography callChoreography; + + /** + * + * + * @generated + */ + protected CallConversation callConversation; + + /** + * + * + * @generated + */ + protected CallableElement callableElement; + + /** + * + * + * @generated + */ + protected CancelEventDefinition cancelEventDefinition; + + /** + * + * + * @generated + */ + protected CatchEvent catchEvent; + + /** + * + * + * @generated + */ + protected Category category; + + /** + * + * + * @generated + */ + protected CategoryValue categoryValue; + + /** + * + * + * @generated + */ + protected Choreography choreography; + + /** + * + * + * @generated + */ + protected ChoreographyActivity choreographyActivity; + + /** + * + * + * @generated + */ + protected ChoreographyTask choreographyTask; + + /** + * + * + * @generated + */ + protected Collaboration collaboration; + + /** + * + * + * @generated + */ + protected CompensateEventDefinition compensateEventDefinition; + + /** + * + * + * @generated + */ + protected ComplexBehaviorDefinition complexBehaviorDefinition; + + /** + * + * + * @generated + */ + protected ComplexGateway complexGateway; + + /** + * + * + * @generated + */ + protected ConditionalEventDefinition conditionalEventDefinition; + + /** + * + * + * @generated + */ + protected Conversation conversation; + + /** + * + * + * @generated + */ + protected ConversationAssociation conversationAssociation; + + /** + * + * + * @generated + */ + protected ConversationLink conversationLink; + + /** + * + * + * @generated + */ + protected ConversationNode conversationNode; + + /** + * + * + * @generated + */ + protected CorrelationKey correlationKey; + + /** + * + * + * @generated + */ + protected CorrelationProperty correlationProperty; + + /** + * + * + * @generated + */ + protected CorrelationPropertyBinding correlationPropertyBinding; + + /** + * + * + * @generated + */ + protected CorrelationPropertyRetrievalExpression correlationPropertyRetrievalExpression; + + /** + * + * + * @generated + */ + protected CorrelationSubscription correlationSubscription; + + /** + * + * + * @generated + */ + protected DataAssociation dataAssociation; + + /** + * + * + * @generated + */ + protected DataInput dataInput; + + /** + * + * + * @generated + */ + protected DataInputAssociation dataInputAssociation; + + /** + * + * + * @generated + */ + protected DataObject dataObject; + + /** + * + * + * @generated + */ + protected DataObjectReference dataObjectReference; + + /** + * + * + * @generated + */ + protected DataOutput dataOutput; + + /** + * + * + * @generated + */ + protected DataOutputAssociation dataOutputAssociation; + + /** + * + * + * @generated + */ + protected DataState dataState; + + /** + * + * + * @generated + */ + protected DataStore dataStore; + + /** + * + * + * @generated + */ + protected DataStoreReference dataStoreReference; + + /** + * + * + * @generated + */ + protected Definitions definitions; + + /** + * + * + * @generated + */ + protected Documentation documentation; + + /** + * + * + * @generated + */ + protected EndEvent endEvent; + + /** + * + * + * @generated + */ + protected EndPoint endPoint; + + /** + * + * + * @generated + */ + protected org.eclipse.bpmn2.Error error; + + /** + * + * + * @generated + */ + protected ErrorEventDefinition errorEventDefinition; + + /** + * + * + * @generated + */ + protected Escalation escalation; + + /** + * + * + * @generated + */ + protected EscalationEventDefinition escalationEventDefinition; + + /** + * + * + * @generated + */ + protected Event event; + + /** + * + * + * @generated + */ + protected EventBasedGateway eventBasedGateway; + + /** + * + * + * @generated + */ + protected EventDefinition eventDefinition; + + /** + * + * + * @generated + */ + protected ExclusiveGateway exclusiveGateway; + + /** + * + * + * @generated + */ + protected Expression expression; + + /** + * + * + * @generated + */ + protected Extension extension; + + /** + * + * + * @generated + */ + protected ExtensionAttributeDefinition extensionAttributeDefinition; + + /** + * + * + * @generated + */ + protected ExtensionAttributeValue extensionAttributeValue; + + /** + * + * + * @generated + */ + protected ExtensionDefinition extensionDefinition; + + /** + * + * + * @generated + */ + protected FlowElement flowElement; + + /** + * + * + * @generated + */ + protected FlowElementsContainer flowElementsContainer; + + /** + * + * + * @generated + */ + protected FlowNode flowNode; + + /** + * + * + * @generated + */ + protected FormalExpression formalExpression; + + /** + * + * + * @generated + */ + protected Gateway gateway; + + /** + * + * + * @generated + */ + protected GlobalBusinessRuleTask globalBusinessRuleTask; + + /** + * + * + * @generated + */ + protected GlobalChoreographyTask globalChoreographyTask; + + /** + * + * + * @generated + */ + protected GlobalConversation globalConversation; + + /** + * + * + * @generated + */ + protected GlobalManualTask globalManualTask; + + /** + * + * + * @generated + */ + protected GlobalScriptTask globalScriptTask; + + /** + * + * + * @generated + */ + protected GlobalTask globalTask; + + /** + * + * + * @generated + */ + protected GlobalUserTask globalUserTask; + + /** + * + * + * @generated + */ + protected Group group; + + /** + * + * + * @generated + */ + protected HumanPerformer humanPerformer; + + /** + * + * + * @generated + */ + protected ImplicitThrowEvent implicitThrowEvent; + + /** + * + * + * @generated + */ + protected Import import_; + + /** + * + * + * @generated + */ + protected InclusiveGateway inclusiveGateway; + + /** + * + * + * @generated + */ + protected InputOutputBinding inputOutputBinding; + + /** + * + * + * @generated + */ + protected InputOutputSpecification inputOutputSpecification; + + /** + * + * + * @generated + */ + protected InputSet inputSet; + + /** + * + * + * @generated + */ + protected InteractionNode interactionNode; + + /** + * + * + * @generated + */ + protected Interface interface_; + + /** + * + * + * @generated + */ + protected IntermediateCatchEvent intermediateCatchEvent; + + /** + * + * + * @generated + */ + protected IntermediateThrowEvent intermediateThrowEvent; + + /** + * + * + * @generated + */ + protected ItemAwareElement itemAwareElement; + + /** + * + * + * @generated + */ + protected ItemDefinition itemDefinition; + + /** + * + * + * @generated + */ + protected Lane lane; + + /** + * + * + * @generated + */ + protected LaneSet laneSet; + + /** + * + * + * @generated + */ + protected LinkEventDefinition linkEventDefinition; + + /** + * + * + * @generated + */ + protected LoopCharacteristics loopCharacteristics; + + /** + * + * + * @generated + */ + protected ManualTask manualTask; + + /** + * + * + * @generated + */ + protected Message message; + + /** + * + * + * @generated + */ + protected MessageEventDefinition messageEventDefinition; + + /** + * + * + * @generated + */ + protected MessageFlow messageFlow; + + /** + * + * + * @generated + */ + protected MessageFlowAssociation messageFlowAssociation; + + /** + * + * + * @generated + */ + protected Monitoring monitoring; + + /** + * + * + * @generated + */ + protected MultiInstanceLoopCharacteristics multiInstanceLoopCharacteristics; + + /** + * + * + * @generated + */ + protected Operation operation; + + /** + * + * + * @generated + */ + protected OutputSet outputSet; + + /** + * + * + * @generated + */ + protected ParallelGateway parallelGateway; + + /** + * + * + * @generated + */ + protected Participant participant; + + /** + * + * + * @generated + */ + protected ParticipantAssociation participantAssociation; + + /** + * + * + * @generated + */ + protected ParticipantMultiplicity participantMultiplicity; + + /** + * + * + * @generated + */ + protected PartnerEntity partnerEntity; + + /** + * + * + * @generated + */ + protected PartnerRole partnerRole; + + /** + * + * + * @generated + */ + protected Performer performer; + + /** + * + * + * @generated + */ + protected PotentialOwner potentialOwner; + + /** + * + * + * @generated + */ + protected org.eclipse.bpmn2.Process process; + + /** + * + * + * @generated + */ + protected Property property; + + /** + * + * + * @generated + */ + protected ReceiveTask receiveTask; + + /** + * + * + * @generated + */ + protected Relationship relationship; + + /** + * + * + * @generated + */ + protected Rendering rendering; + + /** + * + * + * @generated + */ + protected Resource resource; + + /** + * + * + * @generated + */ + protected ResourceAssignmentExpression resourceAssignmentExpression; + + /** + * + * + * @generated + */ + protected ResourceParameter resourceParameter; + + /** + * + * + * @generated + */ + protected ResourceParameterBinding resourceParameterBinding; + + /** + * + * + * @generated + */ + protected ResourceRole resourceRole; + + /** + * + * + * @generated + */ + protected RootElement rootElement; + + /** + * + * + * @generated + */ + protected ScriptTask scriptTask; + + /** + * + * + * @generated + */ + protected SendTask sendTask; + + /** + * + * + * @generated + */ + protected SequenceFlow sequenceFlow; + + /** + * + * + * @generated + */ + protected ServiceTask serviceTask; + + /** + * + * + * @generated + */ + protected Signal signal; + + /** + * + * + * @generated + */ + protected SignalEventDefinition signalEventDefinition; + + /** + * + * + * @generated + */ + protected StandardLoopCharacteristics standardLoopCharacteristics; + + /** + * + * + * @generated + */ + protected StartEvent startEvent; + + /** + * + * + * @generated + */ + protected SubChoreography subChoreography; + + /** + * + * + * @generated + */ + protected SubConversation subConversation; + + /** + * + * + * @generated + */ + protected SubProcess subProcess; + + /** + * + * + * @generated + */ + protected Task task; + + /** + * + * + * @generated + */ + protected TerminateEventDefinition terminateEventDefinition; + + /** + * + * + * @generated + */ + protected TextAnnotation textAnnotation; + + /** + * + * + * @generated + */ + protected ThrowEvent throwEvent; + + /** + * + * + * @generated + */ + protected TimerEventDefinition timerEventDefinition; + + /** + * + * + * @generated + */ + protected Transaction transaction; + + /** + * + * + * @generated + */ + protected UserTask userTask; + + /** + * + * + * @generated + */ + protected EventSubprocess eventSubprocess; + + /** + * + * + * @generated + */ + protected AdHocOrdering adHocOrdering; + + /** + * + * + * @generated + */ + protected AssociationDirection associationDirection; + + /** + * + * + * @generated + */ + protected ChoreographyLoopType choreographyLoopType; + + /** + * + * + * @generated + */ + protected EventBasedGatewayType eventBasedGatewayType; + + /** + * + * + * @generated + */ + protected GatewayDirection gatewayDirection; + + /** + * + * + * @generated + */ + protected ItemKind itemKind; + + /** + * + * + * @generated + */ + protected MultiInstanceBehavior multiInstanceBehavior; + + /** + * + * + * @generated + */ + protected ProcessType processType; + + /** + * + * + * @generated + */ + protected RelationshipDirection relationshipDirection; + + } + + /** + * + * + * @generated + */ + @Override + public EClass getDocumentRoot() { + return documentRootEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDocumentRoot_Mixed() { + return (EAttribute) documentRootEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_XMLNSPrefixMap() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_XSISchemaLocation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Activity() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_AdHocSubProcess() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_FlowElement() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Artifact() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Assignment() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Association() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Auditing() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(9); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BaseElement() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(10); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BaseElementWithMixedContent() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(11); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BoundaryEvent() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(12); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_BusinessRuleTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(13); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_CallableElement() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(14); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_CallActivity() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(15); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_CallChoreography() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(16); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_CallConversation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(17); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ConversationNode() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(18); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_CancelEventDefinition() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(19); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_EventDefinition() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(20); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_RootElement() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(21); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_CatchEvent() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(22); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Category() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(23); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_CategoryValue() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(24); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Choreography() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(25); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Collaboration() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(26); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ChoreographyActivity() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(27); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ChoreographyTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(28); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_CompensateEventDefinition() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(29); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ComplexBehaviorDefinition() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(30); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ComplexGateway() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(31); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ConditionalEventDefinition() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(32); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Conversation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(33); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ConversationAssociation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(34); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ConversationLink() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(35); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_CorrelationKey() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(36); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_CorrelationProperty() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(37); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_CorrelationPropertyBinding() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(38); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_CorrelationPropertyRetrievalExpression() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(39); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_CorrelationSubscription() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(40); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_DataAssociation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(41); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_DataInput() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(42); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_DataInputAssociation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(43); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_DataObject() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(44); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_DataObjectReference() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(45); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_DataOutput() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(46); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_DataOutputAssociation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(47); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_DataState() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(48); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_DataStore() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(49); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_DataStoreReference() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(50); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Definitions() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(51); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Documentation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(52); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_EndEvent() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(53); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_EndPoint() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(54); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Error() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(55); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ErrorEventDefinition() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(56); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Escalation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(57); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_EscalationEventDefinition() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(58); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Event() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(59); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_EventBasedGateway() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(60); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ExclusiveGateway() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(61); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Expression() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(62); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Extension() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(63); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ExtensionElements() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(64); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_FlowNode() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(65); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_FormalExpression() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(66); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Gateway() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(67); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_GlobalBusinessRuleTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(68); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_GlobalChoreographyTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(69); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_GlobalConversation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(70); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_GlobalManualTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(71); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_GlobalScriptTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(72); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_GlobalTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(73); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_GlobalUserTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(74); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Group() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(75); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_HumanPerformer() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(76); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Performer() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(77); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ResourceRole() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(78); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ImplicitThrowEvent() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(79); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Import() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(80); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_InclusiveGateway() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(81); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_InputSet() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(82); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Interface() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(83); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_IntermediateCatchEvent() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(84); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_IntermediateThrowEvent() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(85); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_IoBinding() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(86); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_IoSpecification() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(87); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ItemDefinition() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(88); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Lane() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(89); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_LaneSet() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(90); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_LinkEventDefinition() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(91); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_LoopCharacteristics() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(92); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ManualTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(93); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Message() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(94); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_MessageEventDefinition() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(95); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_MessageFlow() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(96); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_MessageFlowAssociation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(97); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Monitoring() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(98); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_MultiInstanceLoopCharacteristics() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(99); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Operation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(100); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_OutputSet() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(101); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ParallelGateway() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(102); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Participant() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(103); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ParticipantAssociation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(104); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ParticipantMultiplicity() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(105); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_PartnerEntity() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(106); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_PartnerRole() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(107); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_PotentialOwner() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(108); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Process() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(109); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Property() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(110); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ReceiveTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(111); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Relationship() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(112); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Rendering() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(113); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Resource() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(114); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ResourceAssignmentExpression() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(115); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ResourceParameter() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(116); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ResourceParameterBinding() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(117); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Script() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(118); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ScriptTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(119); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_SendTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(120); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_SequenceFlow() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(121); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ServiceTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(122); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Signal() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(123); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_SignalEventDefinition() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(124); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_StandardLoopCharacteristics() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(125); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_StartEvent() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(126); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_SubChoreography() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(127); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_SubConversation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(128); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_SubProcess() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(129); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Task() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(130); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_TerminateEventDefinition() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(131); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Text() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(132); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_TextAnnotation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(133); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_ThrowEvent() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(134); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_TimerEventDefinition() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(135); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Transaction() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(136); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_UserTask() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(137); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_EventSubProcess() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(138); + } + + /** + * + * + * @generated + */ + @Override + public EClass getActivity() { + return activityEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getActivity_IoSpecification() { + return (EReference) activityEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getActivity_BoundaryEventRefs() { + return (EReference) activityEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getActivity_Properties() { + return (EReference) activityEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getActivity_DataInputAssociations() { + return (EReference) activityEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getActivity_DataOutputAssociations() { + return (EReference) activityEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getActivity_Resources() { + return (EReference) activityEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EReference getActivity_LoopCharacteristics() { + return (EReference) activityEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getActivity_CompletionQuantity() { + return (EAttribute) activityEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + @Override + public EReference getActivity_Default() { + return (EReference) activityEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getActivity_IsForCompensation() { + return (EAttribute) activityEClass.getEStructuralFeatures().get(9); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getActivity_StartQuantity() { + return (EAttribute) activityEClass.getEStructuralFeatures().get(10); + } + + /** + * + * + * @generated + */ + @Override + public EClass getAdHocSubProcess() { + return adHocSubProcessEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getAdHocSubProcess_CompletionCondition() { + return (EReference) adHocSubProcessEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getAdHocSubProcess_CancelRemainingInstances() { + return (EAttribute) adHocSubProcessEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getAdHocSubProcess_Ordering() { + return (EAttribute) adHocSubProcessEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getArtifact() { + return artifactEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getAssignment() { + return assignmentEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getAssignment_From() { + return (EReference) assignmentEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getAssignment_To() { + return (EReference) assignmentEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getAssociation() { + return associationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getAssociation_AssociationDirection() { + return (EAttribute) associationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getAssociation_SourceRef() { + return (EReference) associationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getAssociation_TargetRef() { + return (EReference) associationEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getAuditing() { + return auditingEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getBaseElement() { + return baseElementEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getBaseElement_Documentation() { + return (EReference) baseElementEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getBaseElement_ExtensionValues() { + return (EReference) baseElementEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getBaseElement_ExtensionDefinitions() { + return (EReference) baseElementEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBaseElement_Id() { + return (EAttribute) baseElementEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBaseElement_AnyAttribute() { + return (EAttribute) baseElementEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBoundaryEvent() { + return boundaryEventEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getBoundaryEvent_AttachedToRef() { + return (EReference) boundaryEventEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBoundaryEvent_CancelActivity() { + return (EAttribute) boundaryEventEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBusinessRuleTask() { + return businessRuleTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBusinessRuleTask_Implementation() { + return (EAttribute) businessRuleTaskEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCallActivity() { + return callActivityEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCallActivity_CalledElement() { + return (EAttribute) callActivityEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCallChoreography() { + return callChoreographyEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCallChoreography_ParticipantAssociations() { + return (EReference) callChoreographyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCallChoreography_CalledChoreographyRef() { + return (EReference) callChoreographyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCallConversation() { + return callConversationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCallConversation_ParticipantAssociations() { + return (EReference) callConversationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCallConversation_CalledCollaborationRef() { + return (EReference) callConversationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCallableElement() { + return callableElementEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCallableElement_SupportedInterfaceRefs() { + return (EReference) callableElementEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCallableElement_IoSpecification() { + return (EReference) callableElementEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCallableElement_IoBinding() { + return (EReference) callableElementEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCallableElement_Name() { + return (EAttribute) callableElementEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCancelEventDefinition() { + return cancelEventDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getCatchEvent() { + return catchEventEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCatchEvent_DataOutputs() { + return (EReference) catchEventEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCatchEvent_DataOutputAssociation() { + return (EReference) catchEventEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCatchEvent_OutputSet() { + return (EReference) catchEventEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCatchEvent_EventDefinitions() { + return (EReference) catchEventEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCatchEvent_EventDefinitionRefs() { + return (EReference) catchEventEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCatchEvent_ParallelMultiple() { + return (EAttribute) catchEventEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCategory() { + return categoryEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCategory_CategoryValue() { + return (EReference) categoryEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCategory_Name() { + return (EAttribute) categoryEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCategoryValue() { + return categoryValueEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCategoryValue_Value() { + return (EAttribute) categoryValueEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCategoryValue_CategorizedFlowElements() { + return (EReference) categoryValueEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getChoreography() { + return choreographyEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getChoreographyActivity() { + return choreographyActivityEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getChoreographyActivity_ParticipantRefs() { + return (EReference) choreographyActivityEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getChoreographyActivity_CorrelationKeys() { + return (EReference) choreographyActivityEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getChoreographyActivity_InitiatingParticipantRef() { + return (EReference) choreographyActivityEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getChoreographyActivity_LoopType() { + return (EAttribute) choreographyActivityEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getChoreographyTask() { + return choreographyTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getChoreographyTask_MessageFlowRef() { + return (EReference) choreographyTaskEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCollaboration() { + return collaborationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCollaboration_Participants() { + return (EReference) collaborationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCollaboration_MessageFlows() { + return (EReference) collaborationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCollaboration_Artifacts() { + return (EReference) collaborationEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCollaboration_Conversations() { + return (EReference) collaborationEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCollaboration_ConversationAssociations() { + return (EReference) collaborationEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCollaboration_ParticipantAssociations() { + return (EReference) collaborationEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCollaboration_MessageFlowAssociations() { + return (EReference) collaborationEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCollaboration_CorrelationKeys() { + return (EReference) collaborationEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCollaboration_ChoreographyRef() { + return (EReference) collaborationEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCollaboration_ConversationLinks() { + return (EReference) collaborationEClass.getEStructuralFeatures().get(9); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCollaboration_IsClosed() { + return (EAttribute) collaborationEClass.getEStructuralFeatures().get(10); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCollaboration_Name() { + return (EAttribute) collaborationEClass.getEStructuralFeatures().get(11); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCompensateEventDefinition() { + return compensateEventDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCompensateEventDefinition_ActivityRef() { + return (EReference) compensateEventDefinitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCompensateEventDefinition_WaitForCompletion() { + return (EAttribute) compensateEventDefinitionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getComplexBehaviorDefinition() { + return complexBehaviorDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getComplexBehaviorDefinition_Condition() { + return (EReference) complexBehaviorDefinitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getComplexBehaviorDefinition_Event() { + return (EReference) complexBehaviorDefinitionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getComplexGateway() { + return complexGatewayEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getComplexGateway_ActivationCondition() { + return (EReference) complexGatewayEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getComplexGateway_Default() { + return (EReference) complexGatewayEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getConditionalEventDefinition() { + return conditionalEventDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getConditionalEventDefinition_Condition() { + return (EReference) conditionalEventDefinitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getConversation() { + return conversationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getConversationAssociation() { + return conversationAssociationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getConversationAssociation_InnerConversationNodeRef() { + return (EReference) conversationAssociationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getConversationAssociation_OuterConversationNodeRef() { + return (EReference) conversationAssociationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getConversationLink() { + return conversationLinkEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getConversationLink_Name() { + return (EAttribute) conversationLinkEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getConversationLink_SourceRef() { + return (EReference) conversationLinkEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getConversationLink_TargetRef() { + return (EReference) conversationLinkEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getConversationNode() { + return conversationNodeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getConversationNode_ParticipantRefs() { + return (EReference) conversationNodeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getConversationNode_MessageFlowRefs() { + return (EReference) conversationNodeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getConversationNode_CorrelationKeys() { + return (EReference) conversationNodeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getConversationNode_Name() { + return (EAttribute) conversationNodeEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCorrelationKey() { + return correlationKeyEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCorrelationKey_CorrelationPropertyRef() { + return (EReference) correlationKeyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCorrelationKey_Name() { + return (EAttribute) correlationKeyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCorrelationProperty() { + return correlationPropertyEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCorrelationProperty_CorrelationPropertyRetrievalExpression() { + return (EReference) correlationPropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCorrelationProperty_Name() { + return (EAttribute) correlationPropertyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCorrelationProperty_Type() { + return (EReference) correlationPropertyEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCorrelationPropertyBinding() { + return correlationPropertyBindingEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCorrelationPropertyBinding_DataPath() { + return (EReference) correlationPropertyBindingEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCorrelationPropertyBinding_CorrelationPropertyRef() { + return (EReference) correlationPropertyBindingEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCorrelationPropertyRetrievalExpression() { + return correlationPropertyRetrievalExpressionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCorrelationPropertyRetrievalExpression_MessagePath() { + return (EReference) correlationPropertyRetrievalExpressionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCorrelationPropertyRetrievalExpression_MessageRef() { + return (EReference) correlationPropertyRetrievalExpressionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCorrelationSubscription() { + return correlationSubscriptionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCorrelationSubscription_CorrelationPropertyBinding() { + return (EReference) correlationSubscriptionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCorrelationSubscription_CorrelationKeyRef() { + return (EReference) correlationSubscriptionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDataAssociation() { + return dataAssociationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataAssociation_SourceRef() { + return (EReference) dataAssociationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataAssociation_TargetRef() { + return (EReference) dataAssociationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataAssociation_Transformation() { + return (EReference) dataAssociationEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataAssociation_Assignment() { + return (EReference) dataAssociationEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDataInput() { + return dataInputEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataInput_InputSetWithOptional() { + return (EReference) dataInputEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataInput_InputSetWithWhileExecuting() { + return (EReference) dataInputEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataInput_InputSetRefs() { + return (EReference) dataInputEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDataInput_IsCollection() { + return (EAttribute) dataInputEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDataInput_Name() { + return (EAttribute) dataInputEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDataInputAssociation() { + return dataInputAssociationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getDataObject() { + return dataObjectEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDataObject_IsCollection() { + return (EAttribute) dataObjectEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDataObjectReference() { + return dataObjectReferenceEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataObjectReference_DataObjectRef() { + return (EReference) dataObjectReferenceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDataOutput() { + return dataOutputEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataOutput_OutputSetWithOptional() { + return (EReference) dataOutputEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataOutput_OutputSetWithWhileExecuting() { + return (EReference) dataOutputEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataOutput_OutputSetRefs() { + return (EReference) dataOutputEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDataOutput_IsCollection() { + return (EAttribute) dataOutputEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDataOutput_Name() { + return (EAttribute) dataOutputEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDataOutputAssociation() { + return dataOutputAssociationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getDataState() { + return dataStateEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDataState_Name() { + return (EAttribute) dataStateEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDataStore() { + return dataStoreEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDataStore_Capacity() { + return (EAttribute) dataStoreEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDataStore_IsUnlimited() { + return (EAttribute) dataStoreEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDataStore_Name() { + return (EAttribute) dataStoreEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDataStoreReference() { + return dataStoreReferenceEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataStoreReference_DataStoreRef() { + return (EReference) dataStoreReferenceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDefinitions() { + return definitionsEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getDefinitions_Imports() { + return (EReference) definitionsEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDefinitions_Extensions() { + return (EReference) definitionsEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDefinitions_RootElements() { + return (EReference) definitionsEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDefinitions_Diagrams() { + return (EReference) definitionsEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDefinitions_Relationships() { + return (EReference) definitionsEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDefinitions_Exporter() { + return (EAttribute) definitionsEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDefinitions_ExporterVersion() { + return (EAttribute) definitionsEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDefinitions_ExpressionLanguage() { + return (EAttribute) definitionsEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDefinitions_Name() { + return (EAttribute) definitionsEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDefinitions_TargetNamespace() { + return (EAttribute) definitionsEClass.getEStructuralFeatures().get(9); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDefinitions_TypeLanguage() { + return (EAttribute) definitionsEClass.getEStructuralFeatures().get(10); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDocumentation() { + return documentationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDocumentation_Mixed() { + return (EAttribute) documentationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDocumentation_Text() { + return (EAttribute) documentationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDocumentation_TextFormat() { + return (EAttribute) documentationEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getEndEvent() { + return endEventEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getEndPoint() { + return endPointEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getError() { + return errorEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getError_ErrorCode() { + return (EAttribute) errorEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getError_Name() { + return (EAttribute) errorEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getError_StructureRef() { + return (EReference) errorEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getErrorEventDefinition() { + return errorEventDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getErrorEventDefinition_ErrorRef() { + return (EReference) errorEventDefinitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getEscalation() { + return escalationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getEscalation_EscalationCode() { + return (EAttribute) escalationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getEscalation_Name() { + return (EAttribute) escalationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getEscalation_StructureRef() { + return (EReference) escalationEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getEscalationEventDefinition() { + return escalationEventDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getEscalationEventDefinition_EscalationRef() { + return (EReference) escalationEventDefinitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getEvent() { + return eventEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getEvent_Properties() { + return (EReference) eventEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getEventBasedGateway() { + return eventBasedGatewayEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getEventBasedGateway_EventGatewayType() { + return (EAttribute) eventBasedGatewayEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getEventBasedGateway_Instantiate() { + return (EAttribute) eventBasedGatewayEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getEventDefinition() { + return eventDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getExclusiveGateway() { + return exclusiveGatewayEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getExclusiveGateway_Default() { + return (EReference) exclusiveGatewayEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getExpression() { + return expressionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getExtension() { + return extensionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getExtension_Definition() { + return (EReference) extensionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExtension_MustUnderstand() { + return (EAttribute) extensionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExtension_XsdDefinition() { + return (EAttribute) extensionEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getExtensionAttributeDefinition() { + return extensionAttributeDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExtensionAttributeDefinition_Name() { + return (EAttribute) extensionAttributeDefinitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExtensionAttributeDefinition_Type() { + return (EAttribute) extensionAttributeDefinitionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExtensionAttributeDefinition_IsReference() { + return (EAttribute) extensionAttributeDefinitionEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getExtensionAttributeDefinition_ExtensionDefinition() { + return (EReference) extensionAttributeDefinitionEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getExtensionAttributeValue() { + return extensionAttributeValueEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getExtensionAttributeValue_ValueRef() { + return (EReference) extensionAttributeValueEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExtensionAttributeValue_Value() { + return (EAttribute) extensionAttributeValueEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getExtensionAttributeValue_ExtensionAttributeDefinition() { + return (EReference) extensionAttributeValueEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getExtensionDefinition() { + return extensionDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExtensionDefinition_Name() { + return (EAttribute) extensionDefinitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getExtensionDefinition_ExtensionAttributeDefinitions() { + return (EReference) extensionDefinitionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getFlowElement() { + return flowElementEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getFlowElement_Auditing() { + return (EReference) flowElementEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getFlowElement_Monitoring() { + return (EReference) flowElementEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getFlowElement_CategoryValueRef() { + return (EReference) flowElementEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFlowElement_Name() { + return (EAttribute) flowElementEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getFlowElementsContainer() { + return flowElementsContainerEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getFlowElementsContainer_LaneSets() { + return (EReference) flowElementsContainerEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getFlowElementsContainer_FlowElements() { + return (EReference) flowElementsContainerEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getFlowNode() { + return flowNodeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getFlowNode_Incoming() { + return (EReference) flowNodeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getFlowNode_Lanes() { + return (EReference) flowNodeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getFlowNode_Outgoing() { + return (EReference) flowNodeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getFormalExpression() { + return formalExpressionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFormalExpression_Mixed() { + return (EAttribute) formalExpressionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFormalExpression_Body() { + return (EAttribute) formalExpressionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getFormalExpression_EvaluatesToTypeRef() { + return (EReference) formalExpressionEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFormalExpression_Language() { + return (EAttribute) formalExpressionEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getGateway() { + return gatewayEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getGateway_GatewayDirection() { + return (EAttribute) gatewayEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getGlobalBusinessRuleTask() { + return globalBusinessRuleTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getGlobalBusinessRuleTask_Implementation() { + return (EAttribute) globalBusinessRuleTaskEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getGlobalChoreographyTask() { + return globalChoreographyTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getGlobalChoreographyTask_InitiatingParticipantRef() { + return (EReference) globalChoreographyTaskEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getGlobalConversation() { + return globalConversationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getGlobalManualTask() { + return globalManualTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getGlobalScriptTask() { + return globalScriptTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getGlobalScriptTask_Script() { + return (EAttribute) globalScriptTaskEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getGlobalScriptTask_ScriptLanguage() { + return (EAttribute) globalScriptTaskEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getGlobalTask() { + return globalTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getGlobalTask_Resources() { + return (EReference) globalTaskEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getGlobalUserTask() { + return globalUserTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getGlobalUserTask_Renderings() { + return (EReference) globalUserTaskEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getGlobalUserTask_Implementation() { + return (EAttribute) globalUserTaskEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getGroup() { + return groupEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getGroup_CategoryValueRef() { + return (EReference) groupEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getHumanPerformer() { + return humanPerformerEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getImplicitThrowEvent() { + return implicitThrowEventEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getImport() { + return importEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getImport_ImportType() { + return (EAttribute) importEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getImport_Location() { + return (EAttribute) importEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getImport_Namespace() { + return (EAttribute) importEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getInclusiveGateway() { + return inclusiveGatewayEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getInclusiveGateway_Default() { + return (EReference) inclusiveGatewayEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getInputOutputBinding() { + return inputOutputBindingEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getInputOutputBinding_InputDataRef() { + return (EReference) inputOutputBindingEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInputOutputBinding_OperationRef() { + return (EReference) inputOutputBindingEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInputOutputBinding_OutputDataRef() { + return (EReference) inputOutputBindingEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getInputOutputSpecification() { + return inputOutputSpecificationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getInputOutputSpecification_DataInputs() { + return (EReference) inputOutputSpecificationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInputOutputSpecification_DataOutputs() { + return (EReference) inputOutputSpecificationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInputOutputSpecification_InputSets() { + return (EReference) inputOutputSpecificationEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInputOutputSpecification_OutputSets() { + return (EReference) inputOutputSpecificationEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getInputSet() { + return inputSetEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getInputSet_DataInputRefs() { + return (EReference) inputSetEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInputSet_OptionalInputRefs() { + return (EReference) inputSetEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInputSet_WhileExecutingInputRefs() { + return (EReference) inputSetEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInputSet_OutputSetRefs() { + return (EReference) inputSetEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getInputSet_Name() { + return (EAttribute) inputSetEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EClass getInteractionNode() { + return interactionNodeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getInteractionNode_IncomingConversationLinks() { + return (EReference) interactionNodeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInteractionNode_OutgoingConversationLinks() { + return (EReference) interactionNodeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getInterface() { + return interfaceEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getInterface_Operations() { + return (EReference) interfaceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getInterface_Name() { + return (EAttribute) interfaceEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getInterface_ImplementationRef() { + return (EAttribute) interfaceEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getIntermediateCatchEvent() { + return intermediateCatchEventEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getIntermediateThrowEvent() { + return intermediateThrowEventEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getItemAwareElement() { + return itemAwareElementEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getItemAwareElement_DataState() { + return (EReference) itemAwareElementEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getItemAwareElement_ItemSubjectRef() { + return (EReference) itemAwareElementEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getItemDefinition() { + return itemDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getItemDefinition_IsCollection() { + return (EAttribute) itemDefinitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getItemDefinition_Import() { + return (EReference) itemDefinitionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getItemDefinition_ItemKind() { + return (EAttribute) itemDefinitionEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getItemDefinition_StructureRef() { + return (EAttribute) itemDefinitionEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getLane() { + return laneEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getLane_PartitionElement() { + return (EReference) laneEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getLane_FlowNodeRefs() { + return (EReference) laneEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getLane_ChildLaneSet() { + return (EReference) laneEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getLane_Name() { + return (EAttribute) laneEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getLane_PartitionElementRef() { + return (EReference) laneEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EClass getLaneSet() { + return laneSetEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getLaneSet_Lanes() { + return (EReference) laneSetEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getLaneSet_Name() { + return (EAttribute) laneSetEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getLinkEventDefinition() { + return linkEventDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getLinkEventDefinition_Source() { + return (EReference) linkEventDefinitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getLinkEventDefinition_Target() { + return (EReference) linkEventDefinitionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getLinkEventDefinition_Name() { + return (EAttribute) linkEventDefinitionEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getLoopCharacteristics() { + return loopCharacteristicsEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getManualTask() { + return manualTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getMessage() { + return messageEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getMessage_ItemRef() { + return (EReference) messageEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getMessage_Name() { + return (EAttribute) messageEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getMessageEventDefinition() { + return messageEventDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getMessageEventDefinition_OperationRef() { + return (EReference) messageEventDefinitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMessageEventDefinition_MessageRef() { + return (EReference) messageEventDefinitionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getMessageFlow() { + return messageFlowEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getMessageFlow_MessageRef() { + return (EReference) messageFlowEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getMessageFlow_Name() { + return (EAttribute) messageFlowEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMessageFlow_SourceRef() { + return (EReference) messageFlowEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMessageFlow_TargetRef() { + return (EReference) messageFlowEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getMessageFlowAssociation() { + return messageFlowAssociationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getMessageFlowAssociation_InnerMessageFlowRef() { + return (EReference) messageFlowAssociationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMessageFlowAssociation_OuterMessageFlowRef() { + return (EReference) messageFlowAssociationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getMonitoring() { + return monitoringEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getMultiInstanceLoopCharacteristics() { + return multiInstanceLoopCharacteristicsEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getMultiInstanceLoopCharacteristics_LoopCardinality() { + return (EReference) multiInstanceLoopCharacteristicsEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMultiInstanceLoopCharacteristics_LoopDataInputRef() { + return (EReference) multiInstanceLoopCharacteristicsEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMultiInstanceLoopCharacteristics_LoopDataOutputRef() { + return (EReference) multiInstanceLoopCharacteristicsEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMultiInstanceLoopCharacteristics_InputDataItem() { + return (EReference) multiInstanceLoopCharacteristicsEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMultiInstanceLoopCharacteristics_OutputDataItem() { + return (EReference) multiInstanceLoopCharacteristicsEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMultiInstanceLoopCharacteristics_ComplexBehaviorDefinition() { + return (EReference) multiInstanceLoopCharacteristicsEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMultiInstanceLoopCharacteristics_CompletionCondition() { + return (EReference) multiInstanceLoopCharacteristicsEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getMultiInstanceLoopCharacteristics_Behavior() { + return (EAttribute) multiInstanceLoopCharacteristicsEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getMultiInstanceLoopCharacteristics_IsSequential() { + return (EAttribute) multiInstanceLoopCharacteristicsEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMultiInstanceLoopCharacteristics_NoneBehaviorEventRef() { + return (EReference) multiInstanceLoopCharacteristicsEClass.getEStructuralFeatures().get(9); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMultiInstanceLoopCharacteristics_OneBehaviorEventRef() { + return (EReference) multiInstanceLoopCharacteristicsEClass.getEStructuralFeatures().get(10); + } + + /** + * + * + * @generated + */ + @Override + public EClass getOperation() { + return operationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getOperation_InMessageRef() { + return (EReference) operationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getOperation_OutMessageRef() { + return (EReference) operationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getOperation_ErrorRefs() { + return (EReference) operationEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getOperation_Name() { + return (EAttribute) operationEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getOperation_ImplementationRef() { + return (EAttribute) operationEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EClass getOutputSet() { + return outputSetEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getOutputSet_DataOutputRefs() { + return (EReference) outputSetEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getOutputSet_OptionalOutputRefs() { + return (EReference) outputSetEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getOutputSet_WhileExecutingOutputRefs() { + return (EReference) outputSetEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getOutputSet_InputSetRefs() { + return (EReference) outputSetEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getOutputSet_Name() { + return (EAttribute) outputSetEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EClass getParallelGateway() { + return parallelGatewayEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getParticipant() { + return participantEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getParticipant_InterfaceRefs() { + return (EReference) participantEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getParticipant_EndPointRefs() { + return (EReference) participantEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getParticipant_ParticipantMultiplicity() { + return (EReference) participantEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getParticipant_Name() { + return (EAttribute) participantEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getParticipant_ProcessRef() { + return (EReference) participantEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EClass getParticipantAssociation() { + return participantAssociationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getParticipantAssociation_InnerParticipantRef() { + return (EReference) participantAssociationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getParticipantAssociation_OuterParticipantRef() { + return (EReference) participantAssociationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getParticipantMultiplicity() { + return participantMultiplicityEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getParticipantMultiplicity_Maximum() { + return (EAttribute) participantMultiplicityEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getParticipantMultiplicity_Minimum() { + return (EAttribute) participantMultiplicityEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPartnerEntity() { + return partnerEntityEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getPartnerEntity_ParticipantRef() { + return (EReference) partnerEntityEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getPartnerEntity_Name() { + return (EAttribute) partnerEntityEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPartnerRole() { + return partnerRoleEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getPartnerRole_ParticipantRef() { + return (EReference) partnerRoleEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getPartnerRole_Name() { + return (EAttribute) partnerRoleEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPerformer() { + return performerEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getPotentialOwner() { + return potentialOwnerEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getProcess() { + return processEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getProcess_Auditing() { + return (EReference) processEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getProcess_Monitoring() { + return (EReference) processEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getProcess_Properties() { + return (EReference) processEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getProcess_Artifacts() { + return (EReference) processEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getProcess_Resources() { + return (EReference) processEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getProcess_CorrelationSubscriptions() { + return (EReference) processEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EReference getProcess_Supports() { + return (EReference) processEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EReference getProcess_DefinitionalCollaborationRef() { + return (EReference) processEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getProcess_IsClosed() { + return (EAttribute) processEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getProcess_IsExecutable() { + return (EAttribute) processEClass.getEStructuralFeatures().get(9); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getProcess_ProcessType() { + return (EAttribute) processEClass.getEStructuralFeatures().get(10); + } + + /** + * + * + * @generated + */ + @Override + public EClass getProperty() { + return propertyEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getProperty_Name() { + return (EAttribute) propertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getReceiveTask() { + return receiveTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getReceiveTask_Implementation() { + return (EAttribute) receiveTaskEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getReceiveTask_Instantiate() { + return (EAttribute) receiveTaskEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getReceiveTask_MessageRef() { + return (EReference) receiveTaskEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getReceiveTask_OperationRef() { + return (EReference) receiveTaskEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getRelationship() { + return relationshipEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getRelationship_Sources() { + return (EReference) relationshipEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getRelationship_Targets() { + return (EReference) relationshipEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getRelationship_Direction() { + return (EAttribute) relationshipEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getRelationship_Type() { + return (EAttribute) relationshipEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getRendering() { + return renderingEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getResource() { + return resourceEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getResource_ResourceParameters() { + return (EReference) resourceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getResource_Name() { + return (EAttribute) resourceEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getResourceAssignmentExpression() { + return resourceAssignmentExpressionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getResourceAssignmentExpression_Expression() { + return (EReference) resourceAssignmentExpressionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getResourceParameter() { + return resourceParameterEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getResourceParameter_IsRequired() { + return (EAttribute) resourceParameterEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getResourceParameter_Name() { + return (EAttribute) resourceParameterEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getResourceParameter_Type() { + return (EReference) resourceParameterEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getResourceParameterBinding() { + return resourceParameterBindingEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getResourceParameterBinding_Expression() { + return (EReference) resourceParameterBindingEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getResourceParameterBinding_ParameterRef() { + return (EReference) resourceParameterBindingEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getResourceRole() { + return resourceRoleEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getResourceRole_ResourceRef() { + return (EReference) resourceRoleEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getResourceRole_ResourceParameterBindings() { + return (EReference) resourceRoleEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getResourceRole_ResourceAssignmentExpression() { + return (EReference) resourceRoleEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getResourceRole_Name() { + return (EAttribute) resourceRoleEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getRootElement() { + return rootElementEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getScriptTask() { + return scriptTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScriptTask_Script() { + return (EAttribute) scriptTaskEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getScriptTask_ScriptFormat() { + return (EAttribute) scriptTaskEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getSendTask() { + return sendTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getSendTask_Implementation() { + return (EAttribute) sendTaskEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getSendTask_MessageRef() { + return (EReference) sendTaskEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getSendTask_OperationRef() { + return (EReference) sendTaskEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getSequenceFlow() { + return sequenceFlowEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getSequenceFlow_ConditionExpression() { + return (EReference) sequenceFlowEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getSequenceFlow_IsImmediate() { + return (EAttribute) sequenceFlowEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getSequenceFlow_SourceRef() { + return (EReference) sequenceFlowEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getSequenceFlow_TargetRef() { + return (EReference) sequenceFlowEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getServiceTask() { + return serviceTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getServiceTask_Implementation() { + return (EAttribute) serviceTaskEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getServiceTask_OperationRef() { + return (EReference) serviceTaskEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getSignal() { + return signalEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getSignal_Name() { + return (EAttribute) signalEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getSignal_StructureRef() { + return (EReference) signalEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getSignalEventDefinition() { + return signalEventDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getSignalEventDefinition_SignalRef() { + return (EAttribute) signalEventDefinitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getStandardLoopCharacteristics() { + return standardLoopCharacteristicsEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getStandardLoopCharacteristics_LoopCondition() { + return (EReference) standardLoopCharacteristicsEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getStandardLoopCharacteristics_LoopMaximum() { + return (EReference) standardLoopCharacteristicsEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getStandardLoopCharacteristics_TestBefore() { + return (EAttribute) standardLoopCharacteristicsEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getStartEvent() { + return startEventEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getStartEvent_IsInterrupting() { + return (EAttribute) startEventEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getSubChoreography() { + return subChoreographyEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getSubChoreography_Artifacts() { + return (EReference) subChoreographyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getSubConversation() { + return subConversationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getSubConversation_ConversationNodes() { + return (EReference) subConversationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getSubProcess() { + return subProcessEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getSubProcess_Artifacts() { + return (EReference) subProcessEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getSubProcess_TriggeredByEvent() { + return (EAttribute) subProcessEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTask() { + return taskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getTerminateEventDefinition() { + return terminateEventDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getTextAnnotation() { + return textAnnotationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTextAnnotation_Text() { + return (EAttribute) textAnnotationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTextAnnotation_TextFormat() { + return (EAttribute) textAnnotationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getThrowEvent() { + return throwEventEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getThrowEvent_DataInputs() { + return (EReference) throwEventEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getThrowEvent_DataInputAssociation() { + return (EReference) throwEventEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getThrowEvent_InputSet() { + return (EReference) throwEventEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getThrowEvent_EventDefinitions() { + return (EReference) throwEventEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getThrowEvent_EventDefinitionRefs() { + return (EReference) throwEventEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTimerEventDefinition() { + return timerEventDefinitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getTimerEventDefinition_TimeDate() { + return (EReference) timerEventDefinitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTimerEventDefinition_TimeDuration() { + return (EReference) timerEventDefinitionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTimerEventDefinition_TimeCycle() { + return (EReference) timerEventDefinitionEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTransaction() { + return transactionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTransaction_Protocol() { + return (EAttribute) transactionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTransaction_Method() { + return (EAttribute) transactionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getUserTask() { + return userTaskEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getUserTask_Renderings() { + return (EReference) userTaskEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getUserTask_Implementation() { + return (EAttribute) userTaskEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getEventSubprocess() { + return eventSubprocessEClass; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getAdHocOrdering() { + return adHocOrderingEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getAssociationDirection() { + return associationDirectionEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getChoreographyLoopType() { + return choreographyLoopTypeEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getEventBasedGatewayType() { + return eventBasedGatewayTypeEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getGatewayDirection() { + return gatewayDirectionEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getItemKind() { + return itemKindEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getMultiInstanceBehavior() { + return multiInstanceBehaviorEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getProcessType() { + return processTypeEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getRelationshipDirection() { + return relationshipDirectionEEnum; + } + + /** + * + * + * @generated + */ + @Override + public Bpmn2Factory getBpmn2Factory() { + return (Bpmn2Factory) getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) + return; + isCreated = true; + + // Create classes and their features + documentRootEClass = createEClass(DOCUMENT_ROOT); + createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED); + createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP); + createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__ACTIVITY); + createEReference(documentRootEClass, DOCUMENT_ROOT__AD_HOC_SUB_PROCESS); + createEReference(documentRootEClass, DOCUMENT_ROOT__FLOW_ELEMENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__ARTIFACT); + createEReference(documentRootEClass, DOCUMENT_ROOT__ASSIGNMENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__ASSOCIATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__AUDITING); + createEReference(documentRootEClass, DOCUMENT_ROOT__BASE_ELEMENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__BASE_ELEMENT_WITH_MIXED_CONTENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__BOUNDARY_EVENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__BUSINESS_RULE_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__CALLABLE_ELEMENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__CALL_ACTIVITY); + createEReference(documentRootEClass, DOCUMENT_ROOT__CALL_CHOREOGRAPHY); + createEReference(documentRootEClass, DOCUMENT_ROOT__CALL_CONVERSATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__CONVERSATION_NODE); + createEReference(documentRootEClass, DOCUMENT_ROOT__CANCEL_EVENT_DEFINITION); + createEReference(documentRootEClass, DOCUMENT_ROOT__EVENT_DEFINITION); + createEReference(documentRootEClass, DOCUMENT_ROOT__ROOT_ELEMENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__CATCH_EVENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__CATEGORY); + createEReference(documentRootEClass, DOCUMENT_ROOT__CATEGORY_VALUE); + createEReference(documentRootEClass, DOCUMENT_ROOT__CHOREOGRAPHY); + createEReference(documentRootEClass, DOCUMENT_ROOT__COLLABORATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__CHOREOGRAPHY_ACTIVITY); + createEReference(documentRootEClass, DOCUMENT_ROOT__CHOREOGRAPHY_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__COMPENSATE_EVENT_DEFINITION); + createEReference(documentRootEClass, DOCUMENT_ROOT__COMPLEX_BEHAVIOR_DEFINITION); + createEReference(documentRootEClass, DOCUMENT_ROOT__COMPLEX_GATEWAY); + createEReference(documentRootEClass, DOCUMENT_ROOT__CONDITIONAL_EVENT_DEFINITION); + createEReference(documentRootEClass, DOCUMENT_ROOT__CONVERSATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__CONVERSATION_ASSOCIATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__CONVERSATION_LINK); + createEReference(documentRootEClass, DOCUMENT_ROOT__CORRELATION_KEY); + createEReference(documentRootEClass, DOCUMENT_ROOT__CORRELATION_PROPERTY); + createEReference(documentRootEClass, DOCUMENT_ROOT__CORRELATION_PROPERTY_BINDING); + createEReference(documentRootEClass, DOCUMENT_ROOT__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION); + createEReference(documentRootEClass, DOCUMENT_ROOT__CORRELATION_SUBSCRIPTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__DATA_ASSOCIATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__DATA_INPUT); + createEReference(documentRootEClass, DOCUMENT_ROOT__DATA_INPUT_ASSOCIATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__DATA_OBJECT); + createEReference(documentRootEClass, DOCUMENT_ROOT__DATA_OBJECT_REFERENCE); + createEReference(documentRootEClass, DOCUMENT_ROOT__DATA_OUTPUT); + createEReference(documentRootEClass, DOCUMENT_ROOT__DATA_OUTPUT_ASSOCIATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__DATA_STATE); + createEReference(documentRootEClass, DOCUMENT_ROOT__DATA_STORE); + createEReference(documentRootEClass, DOCUMENT_ROOT__DATA_STORE_REFERENCE); + createEReference(documentRootEClass, DOCUMENT_ROOT__DEFINITIONS); + createEReference(documentRootEClass, DOCUMENT_ROOT__DOCUMENTATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__END_EVENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__END_POINT); + createEReference(documentRootEClass, DOCUMENT_ROOT__ERROR); + createEReference(documentRootEClass, DOCUMENT_ROOT__ERROR_EVENT_DEFINITION); + createEReference(documentRootEClass, DOCUMENT_ROOT__ESCALATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__ESCALATION_EVENT_DEFINITION); + createEReference(documentRootEClass, DOCUMENT_ROOT__EVENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__EVENT_BASED_GATEWAY); + createEReference(documentRootEClass, DOCUMENT_ROOT__EXCLUSIVE_GATEWAY); + createEReference(documentRootEClass, DOCUMENT_ROOT__EXPRESSION); + createEReference(documentRootEClass, DOCUMENT_ROOT__EXTENSION); + createEReference(documentRootEClass, DOCUMENT_ROOT__EXTENSION_ELEMENTS); + createEReference(documentRootEClass, DOCUMENT_ROOT__FLOW_NODE); + createEReference(documentRootEClass, DOCUMENT_ROOT__FORMAL_EXPRESSION); + createEReference(documentRootEClass, DOCUMENT_ROOT__GATEWAY); + createEReference(documentRootEClass, DOCUMENT_ROOT__GLOBAL_BUSINESS_RULE_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__GLOBAL_CHOREOGRAPHY_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__GLOBAL_CONVERSATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__GLOBAL_MANUAL_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__GLOBAL_SCRIPT_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__GLOBAL_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__GLOBAL_USER_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__GROUP); + createEReference(documentRootEClass, DOCUMENT_ROOT__HUMAN_PERFORMER); + createEReference(documentRootEClass, DOCUMENT_ROOT__PERFORMER); + createEReference(documentRootEClass, DOCUMENT_ROOT__RESOURCE_ROLE); + createEReference(documentRootEClass, DOCUMENT_ROOT__IMPLICIT_THROW_EVENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__IMPORT); + createEReference(documentRootEClass, DOCUMENT_ROOT__INCLUSIVE_GATEWAY); + createEReference(documentRootEClass, DOCUMENT_ROOT__INPUT_SET); + createEReference(documentRootEClass, DOCUMENT_ROOT__INTERFACE); + createEReference(documentRootEClass, DOCUMENT_ROOT__INTERMEDIATE_CATCH_EVENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__INTERMEDIATE_THROW_EVENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__IO_BINDING); + createEReference(documentRootEClass, DOCUMENT_ROOT__IO_SPECIFICATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__ITEM_DEFINITION); + createEReference(documentRootEClass, DOCUMENT_ROOT__LANE); + createEReference(documentRootEClass, DOCUMENT_ROOT__LANE_SET); + createEReference(documentRootEClass, DOCUMENT_ROOT__LINK_EVENT_DEFINITION); + createEReference(documentRootEClass, DOCUMENT_ROOT__LOOP_CHARACTERISTICS); + createEReference(documentRootEClass, DOCUMENT_ROOT__MANUAL_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__MESSAGE); + createEReference(documentRootEClass, DOCUMENT_ROOT__MESSAGE_EVENT_DEFINITION); + createEReference(documentRootEClass, DOCUMENT_ROOT__MESSAGE_FLOW); + createEReference(documentRootEClass, DOCUMENT_ROOT__MESSAGE_FLOW_ASSOCIATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__MONITORING); + createEReference(documentRootEClass, DOCUMENT_ROOT__MULTI_INSTANCE_LOOP_CHARACTERISTICS); + createEReference(documentRootEClass, DOCUMENT_ROOT__OPERATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__OUTPUT_SET); + createEReference(documentRootEClass, DOCUMENT_ROOT__PARALLEL_GATEWAY); + createEReference(documentRootEClass, DOCUMENT_ROOT__PARTICIPANT); + createEReference(documentRootEClass, DOCUMENT_ROOT__PARTICIPANT_ASSOCIATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__PARTICIPANT_MULTIPLICITY); + createEReference(documentRootEClass, DOCUMENT_ROOT__PARTNER_ENTITY); + createEReference(documentRootEClass, DOCUMENT_ROOT__PARTNER_ROLE); + createEReference(documentRootEClass, DOCUMENT_ROOT__POTENTIAL_OWNER); + createEReference(documentRootEClass, DOCUMENT_ROOT__PROCESS); + createEReference(documentRootEClass, DOCUMENT_ROOT__PROPERTY); + createEReference(documentRootEClass, DOCUMENT_ROOT__RECEIVE_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__RELATIONSHIP); + createEReference(documentRootEClass, DOCUMENT_ROOT__RENDERING); + createEReference(documentRootEClass, DOCUMENT_ROOT__RESOURCE); + createEReference(documentRootEClass, DOCUMENT_ROOT__RESOURCE_ASSIGNMENT_EXPRESSION); + createEReference(documentRootEClass, DOCUMENT_ROOT__RESOURCE_PARAMETER); + createEReference(documentRootEClass, DOCUMENT_ROOT__RESOURCE_PARAMETER_BINDING); + createEReference(documentRootEClass, DOCUMENT_ROOT__SCRIPT); + createEReference(documentRootEClass, DOCUMENT_ROOT__SCRIPT_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__SEND_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__SEQUENCE_FLOW); + createEReference(documentRootEClass, DOCUMENT_ROOT__SERVICE_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__SIGNAL); + createEReference(documentRootEClass, DOCUMENT_ROOT__SIGNAL_EVENT_DEFINITION); + createEReference(documentRootEClass, DOCUMENT_ROOT__STANDARD_LOOP_CHARACTERISTICS); + createEReference(documentRootEClass, DOCUMENT_ROOT__START_EVENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__SUB_CHOREOGRAPHY); + createEReference(documentRootEClass, DOCUMENT_ROOT__SUB_CONVERSATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__SUB_PROCESS); + createEReference(documentRootEClass, DOCUMENT_ROOT__TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__TERMINATE_EVENT_DEFINITION); + createEReference(documentRootEClass, DOCUMENT_ROOT__TEXT); + createEReference(documentRootEClass, DOCUMENT_ROOT__TEXT_ANNOTATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__THROW_EVENT); + createEReference(documentRootEClass, DOCUMENT_ROOT__TIMER_EVENT_DEFINITION); + createEReference(documentRootEClass, DOCUMENT_ROOT__TRANSACTION); + createEReference(documentRootEClass, DOCUMENT_ROOT__USER_TASK); + createEReference(documentRootEClass, DOCUMENT_ROOT__EVENT_SUB_PROCESS); + + activityEClass = createEClass(ACTIVITY); + createEReference(activityEClass, ACTIVITY__IO_SPECIFICATION); + createEReference(activityEClass, ACTIVITY__BOUNDARY_EVENT_REFS); + createEReference(activityEClass, ACTIVITY__PROPERTIES); + createEReference(activityEClass, ACTIVITY__DATA_INPUT_ASSOCIATIONS); + createEReference(activityEClass, ACTIVITY__DATA_OUTPUT_ASSOCIATIONS); + createEReference(activityEClass, ACTIVITY__RESOURCES); + createEReference(activityEClass, ACTIVITY__LOOP_CHARACTERISTICS); + createEAttribute(activityEClass, ACTIVITY__COMPLETION_QUANTITY); + createEReference(activityEClass, ACTIVITY__DEFAULT); + createEAttribute(activityEClass, ACTIVITY__IS_FOR_COMPENSATION); + createEAttribute(activityEClass, ACTIVITY__START_QUANTITY); + + adHocSubProcessEClass = createEClass(AD_HOC_SUB_PROCESS); + createEReference(adHocSubProcessEClass, AD_HOC_SUB_PROCESS__COMPLETION_CONDITION); + createEAttribute(adHocSubProcessEClass, AD_HOC_SUB_PROCESS__CANCEL_REMAINING_INSTANCES); + createEAttribute(adHocSubProcessEClass, AD_HOC_SUB_PROCESS__ORDERING); + + artifactEClass = createEClass(ARTIFACT); + + assignmentEClass = createEClass(ASSIGNMENT); + createEReference(assignmentEClass, ASSIGNMENT__FROM); + createEReference(assignmentEClass, ASSIGNMENT__TO); + + associationEClass = createEClass(ASSOCIATION); + createEAttribute(associationEClass, ASSOCIATION__ASSOCIATION_DIRECTION); + createEReference(associationEClass, ASSOCIATION__SOURCE_REF); + createEReference(associationEClass, ASSOCIATION__TARGET_REF); + + auditingEClass = createEClass(AUDITING); + + baseElementEClass = createEClass(BASE_ELEMENT); + createEReference(baseElementEClass, BASE_ELEMENT__DOCUMENTATION); + createEReference(baseElementEClass, BASE_ELEMENT__EXTENSION_VALUES); + createEReference(baseElementEClass, BASE_ELEMENT__EXTENSION_DEFINITIONS); + createEAttribute(baseElementEClass, BASE_ELEMENT__ID); + createEAttribute(baseElementEClass, BASE_ELEMENT__ANY_ATTRIBUTE); + + boundaryEventEClass = createEClass(BOUNDARY_EVENT); + createEReference(boundaryEventEClass, BOUNDARY_EVENT__ATTACHED_TO_REF); + createEAttribute(boundaryEventEClass, BOUNDARY_EVENT__CANCEL_ACTIVITY); + + businessRuleTaskEClass = createEClass(BUSINESS_RULE_TASK); + createEAttribute(businessRuleTaskEClass, BUSINESS_RULE_TASK__IMPLEMENTATION); + + callActivityEClass = createEClass(CALL_ACTIVITY); + createEAttribute(callActivityEClass, CALL_ACTIVITY__CALLED_ELEMENT); + + callChoreographyEClass = createEClass(CALL_CHOREOGRAPHY); + createEReference(callChoreographyEClass, CALL_CHOREOGRAPHY__PARTICIPANT_ASSOCIATIONS); + createEReference(callChoreographyEClass, CALL_CHOREOGRAPHY__CALLED_CHOREOGRAPHY_REF); + + callConversationEClass = createEClass(CALL_CONVERSATION); + createEReference(callConversationEClass, CALL_CONVERSATION__PARTICIPANT_ASSOCIATIONS); + createEReference(callConversationEClass, CALL_CONVERSATION__CALLED_COLLABORATION_REF); + + callableElementEClass = createEClass(CALLABLE_ELEMENT); + createEReference(callableElementEClass, CALLABLE_ELEMENT__SUPPORTED_INTERFACE_REFS); + createEReference(callableElementEClass, CALLABLE_ELEMENT__IO_SPECIFICATION); + createEReference(callableElementEClass, CALLABLE_ELEMENT__IO_BINDING); + createEAttribute(callableElementEClass, CALLABLE_ELEMENT__NAME); + + cancelEventDefinitionEClass = createEClass(CANCEL_EVENT_DEFINITION); + + catchEventEClass = createEClass(CATCH_EVENT); + createEReference(catchEventEClass, CATCH_EVENT__DATA_OUTPUTS); + createEReference(catchEventEClass, CATCH_EVENT__DATA_OUTPUT_ASSOCIATION); + createEReference(catchEventEClass, CATCH_EVENT__OUTPUT_SET); + createEReference(catchEventEClass, CATCH_EVENT__EVENT_DEFINITIONS); + createEReference(catchEventEClass, CATCH_EVENT__EVENT_DEFINITION_REFS); + createEAttribute(catchEventEClass, CATCH_EVENT__PARALLEL_MULTIPLE); + + categoryEClass = createEClass(CATEGORY); + createEReference(categoryEClass, CATEGORY__CATEGORY_VALUE); + createEAttribute(categoryEClass, CATEGORY__NAME); + + categoryValueEClass = createEClass(CATEGORY_VALUE); + createEAttribute(categoryValueEClass, CATEGORY_VALUE__VALUE); + createEReference(categoryValueEClass, CATEGORY_VALUE__CATEGORIZED_FLOW_ELEMENTS); + + choreographyEClass = createEClass(CHOREOGRAPHY); + + choreographyActivityEClass = createEClass(CHOREOGRAPHY_ACTIVITY); + createEReference(choreographyActivityEClass, CHOREOGRAPHY_ACTIVITY__PARTICIPANT_REFS); + createEReference(choreographyActivityEClass, CHOREOGRAPHY_ACTIVITY__CORRELATION_KEYS); + createEReference(choreographyActivityEClass, CHOREOGRAPHY_ACTIVITY__INITIATING_PARTICIPANT_REF); + createEAttribute(choreographyActivityEClass, CHOREOGRAPHY_ACTIVITY__LOOP_TYPE); + + choreographyTaskEClass = createEClass(CHOREOGRAPHY_TASK); + createEReference(choreographyTaskEClass, CHOREOGRAPHY_TASK__MESSAGE_FLOW_REF); + + collaborationEClass = createEClass(COLLABORATION); + createEReference(collaborationEClass, COLLABORATION__PARTICIPANTS); + createEReference(collaborationEClass, COLLABORATION__MESSAGE_FLOWS); + createEReference(collaborationEClass, COLLABORATION__ARTIFACTS); + createEReference(collaborationEClass, COLLABORATION__CONVERSATIONS); + createEReference(collaborationEClass, COLLABORATION__CONVERSATION_ASSOCIATIONS); + createEReference(collaborationEClass, COLLABORATION__PARTICIPANT_ASSOCIATIONS); + createEReference(collaborationEClass, COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS); + createEReference(collaborationEClass, COLLABORATION__CORRELATION_KEYS); + createEReference(collaborationEClass, COLLABORATION__CHOREOGRAPHY_REF); + createEReference(collaborationEClass, COLLABORATION__CONVERSATION_LINKS); + createEAttribute(collaborationEClass, COLLABORATION__IS_CLOSED); + createEAttribute(collaborationEClass, COLLABORATION__NAME); + + compensateEventDefinitionEClass = createEClass(COMPENSATE_EVENT_DEFINITION); + createEReference(compensateEventDefinitionEClass, COMPENSATE_EVENT_DEFINITION__ACTIVITY_REF); + createEAttribute(compensateEventDefinitionEClass, COMPENSATE_EVENT_DEFINITION__WAIT_FOR_COMPLETION); + + complexBehaviorDefinitionEClass = createEClass(COMPLEX_BEHAVIOR_DEFINITION); + createEReference(complexBehaviorDefinitionEClass, COMPLEX_BEHAVIOR_DEFINITION__CONDITION); + createEReference(complexBehaviorDefinitionEClass, COMPLEX_BEHAVIOR_DEFINITION__EVENT); + + complexGatewayEClass = createEClass(COMPLEX_GATEWAY); + createEReference(complexGatewayEClass, COMPLEX_GATEWAY__ACTIVATION_CONDITION); + createEReference(complexGatewayEClass, COMPLEX_GATEWAY__DEFAULT); + + conditionalEventDefinitionEClass = createEClass(CONDITIONAL_EVENT_DEFINITION); + createEReference(conditionalEventDefinitionEClass, CONDITIONAL_EVENT_DEFINITION__CONDITION); + + conversationEClass = createEClass(CONVERSATION); + + conversationAssociationEClass = createEClass(CONVERSATION_ASSOCIATION); + createEReference(conversationAssociationEClass, CONVERSATION_ASSOCIATION__INNER_CONVERSATION_NODE_REF); + createEReference(conversationAssociationEClass, CONVERSATION_ASSOCIATION__OUTER_CONVERSATION_NODE_REF); + + conversationLinkEClass = createEClass(CONVERSATION_LINK); + createEAttribute(conversationLinkEClass, CONVERSATION_LINK__NAME); + createEReference(conversationLinkEClass, CONVERSATION_LINK__SOURCE_REF); + createEReference(conversationLinkEClass, CONVERSATION_LINK__TARGET_REF); + + conversationNodeEClass = createEClass(CONVERSATION_NODE); + createEReference(conversationNodeEClass, CONVERSATION_NODE__PARTICIPANT_REFS); + createEReference(conversationNodeEClass, CONVERSATION_NODE__MESSAGE_FLOW_REFS); + createEReference(conversationNodeEClass, CONVERSATION_NODE__CORRELATION_KEYS); + createEAttribute(conversationNodeEClass, CONVERSATION_NODE__NAME); + + correlationKeyEClass = createEClass(CORRELATION_KEY); + createEReference(correlationKeyEClass, CORRELATION_KEY__CORRELATION_PROPERTY_REF); + createEAttribute(correlationKeyEClass, CORRELATION_KEY__NAME); + + correlationPropertyEClass = createEClass(CORRELATION_PROPERTY); + createEReference(correlationPropertyEClass, CORRELATION_PROPERTY__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION); + createEAttribute(correlationPropertyEClass, CORRELATION_PROPERTY__NAME); + createEReference(correlationPropertyEClass, CORRELATION_PROPERTY__TYPE); + + correlationPropertyBindingEClass = createEClass(CORRELATION_PROPERTY_BINDING); + createEReference(correlationPropertyBindingEClass, CORRELATION_PROPERTY_BINDING__DATA_PATH); + createEReference(correlationPropertyBindingEClass, CORRELATION_PROPERTY_BINDING__CORRELATION_PROPERTY_REF); + + correlationPropertyRetrievalExpressionEClass = createEClass(CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION); + createEReference(correlationPropertyRetrievalExpressionEClass, + CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_PATH); + createEReference(correlationPropertyRetrievalExpressionEClass, + CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_REF); + + correlationSubscriptionEClass = createEClass(CORRELATION_SUBSCRIPTION); + createEReference(correlationSubscriptionEClass, CORRELATION_SUBSCRIPTION__CORRELATION_PROPERTY_BINDING); + createEReference(correlationSubscriptionEClass, CORRELATION_SUBSCRIPTION__CORRELATION_KEY_REF); + + dataAssociationEClass = createEClass(DATA_ASSOCIATION); + createEReference(dataAssociationEClass, DATA_ASSOCIATION__SOURCE_REF); + createEReference(dataAssociationEClass, DATA_ASSOCIATION__TARGET_REF); + createEReference(dataAssociationEClass, DATA_ASSOCIATION__TRANSFORMATION); + createEReference(dataAssociationEClass, DATA_ASSOCIATION__ASSIGNMENT); + + dataInputEClass = createEClass(DATA_INPUT); + createEReference(dataInputEClass, DATA_INPUT__INPUT_SET_WITH_OPTIONAL); + createEReference(dataInputEClass, DATA_INPUT__INPUT_SET_WITH_WHILE_EXECUTING); + createEReference(dataInputEClass, DATA_INPUT__INPUT_SET_REFS); + createEAttribute(dataInputEClass, DATA_INPUT__IS_COLLECTION); + createEAttribute(dataInputEClass, DATA_INPUT__NAME); + + dataInputAssociationEClass = createEClass(DATA_INPUT_ASSOCIATION); + + dataObjectEClass = createEClass(DATA_OBJECT); + createEAttribute(dataObjectEClass, DATA_OBJECT__IS_COLLECTION); + + dataObjectReferenceEClass = createEClass(DATA_OBJECT_REFERENCE); + createEReference(dataObjectReferenceEClass, DATA_OBJECT_REFERENCE__DATA_OBJECT_REF); + + dataOutputEClass = createEClass(DATA_OUTPUT); + createEReference(dataOutputEClass, DATA_OUTPUT__OUTPUT_SET_WITH_OPTIONAL); + createEReference(dataOutputEClass, DATA_OUTPUT__OUTPUT_SET_WITH_WHILE_EXECUTING); + createEReference(dataOutputEClass, DATA_OUTPUT__OUTPUT_SET_REFS); + createEAttribute(dataOutputEClass, DATA_OUTPUT__IS_COLLECTION); + createEAttribute(dataOutputEClass, DATA_OUTPUT__NAME); + + dataOutputAssociationEClass = createEClass(DATA_OUTPUT_ASSOCIATION); + + dataStateEClass = createEClass(DATA_STATE); + createEAttribute(dataStateEClass, DATA_STATE__NAME); + + dataStoreEClass = createEClass(DATA_STORE); + createEAttribute(dataStoreEClass, DATA_STORE__CAPACITY); + createEAttribute(dataStoreEClass, DATA_STORE__IS_UNLIMITED); + createEAttribute(dataStoreEClass, DATA_STORE__NAME); + + dataStoreReferenceEClass = createEClass(DATA_STORE_REFERENCE); + createEReference(dataStoreReferenceEClass, DATA_STORE_REFERENCE__DATA_STORE_REF); + + definitionsEClass = createEClass(DEFINITIONS); + createEReference(definitionsEClass, DEFINITIONS__IMPORTS); + createEReference(definitionsEClass, DEFINITIONS__EXTENSIONS); + createEReference(definitionsEClass, DEFINITIONS__ROOT_ELEMENTS); + createEReference(definitionsEClass, DEFINITIONS__DIAGRAMS); + createEReference(definitionsEClass, DEFINITIONS__RELATIONSHIPS); + createEAttribute(definitionsEClass, DEFINITIONS__EXPORTER); + createEAttribute(definitionsEClass, DEFINITIONS__EXPORTER_VERSION); + createEAttribute(definitionsEClass, DEFINITIONS__EXPRESSION_LANGUAGE); + createEAttribute(definitionsEClass, DEFINITIONS__NAME); + createEAttribute(definitionsEClass, DEFINITIONS__TARGET_NAMESPACE); + createEAttribute(definitionsEClass, DEFINITIONS__TYPE_LANGUAGE); + + documentationEClass = createEClass(DOCUMENTATION); + createEAttribute(documentationEClass, DOCUMENTATION__MIXED); + createEAttribute(documentationEClass, DOCUMENTATION__TEXT); + createEAttribute(documentationEClass, DOCUMENTATION__TEXT_FORMAT); + + endEventEClass = createEClass(END_EVENT); + + endPointEClass = createEClass(END_POINT); + + errorEClass = createEClass(ERROR); + createEAttribute(errorEClass, ERROR__ERROR_CODE); + createEAttribute(errorEClass, ERROR__NAME); + createEReference(errorEClass, ERROR__STRUCTURE_REF); + + errorEventDefinitionEClass = createEClass(ERROR_EVENT_DEFINITION); + createEReference(errorEventDefinitionEClass, ERROR_EVENT_DEFINITION__ERROR_REF); + + escalationEClass = createEClass(ESCALATION); + createEAttribute(escalationEClass, ESCALATION__ESCALATION_CODE); + createEAttribute(escalationEClass, ESCALATION__NAME); + createEReference(escalationEClass, ESCALATION__STRUCTURE_REF); + + escalationEventDefinitionEClass = createEClass(ESCALATION_EVENT_DEFINITION); + createEReference(escalationEventDefinitionEClass, ESCALATION_EVENT_DEFINITION__ESCALATION_REF); + + eventEClass = createEClass(EVENT); + createEReference(eventEClass, EVENT__PROPERTIES); + + eventBasedGatewayEClass = createEClass(EVENT_BASED_GATEWAY); + createEAttribute(eventBasedGatewayEClass, EVENT_BASED_GATEWAY__EVENT_GATEWAY_TYPE); + createEAttribute(eventBasedGatewayEClass, EVENT_BASED_GATEWAY__INSTANTIATE); + + eventDefinitionEClass = createEClass(EVENT_DEFINITION); + + exclusiveGatewayEClass = createEClass(EXCLUSIVE_GATEWAY); + createEReference(exclusiveGatewayEClass, EXCLUSIVE_GATEWAY__DEFAULT); + + expressionEClass = createEClass(EXPRESSION); + + extensionEClass = createEClass(EXTENSION); + createEReference(extensionEClass, EXTENSION__DEFINITION); + createEAttribute(extensionEClass, EXTENSION__MUST_UNDERSTAND); + createEAttribute(extensionEClass, EXTENSION__XSD_DEFINITION); + + extensionAttributeDefinitionEClass = createEClass(EXTENSION_ATTRIBUTE_DEFINITION); + createEAttribute(extensionAttributeDefinitionEClass, EXTENSION_ATTRIBUTE_DEFINITION__NAME); + createEAttribute(extensionAttributeDefinitionEClass, EXTENSION_ATTRIBUTE_DEFINITION__TYPE); + createEAttribute(extensionAttributeDefinitionEClass, EXTENSION_ATTRIBUTE_DEFINITION__IS_REFERENCE); + createEReference(extensionAttributeDefinitionEClass, EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION); + + extensionAttributeValueEClass = createEClass(EXTENSION_ATTRIBUTE_VALUE); + createEReference(extensionAttributeValueEClass, EXTENSION_ATTRIBUTE_VALUE__VALUE_REF); + createEAttribute(extensionAttributeValueEClass, EXTENSION_ATTRIBUTE_VALUE__VALUE); + createEReference(extensionAttributeValueEClass, EXTENSION_ATTRIBUTE_VALUE__EXTENSION_ATTRIBUTE_DEFINITION); + + extensionDefinitionEClass = createEClass(EXTENSION_DEFINITION); + createEAttribute(extensionDefinitionEClass, EXTENSION_DEFINITION__NAME); + createEReference(extensionDefinitionEClass, EXTENSION_DEFINITION__EXTENSION_ATTRIBUTE_DEFINITIONS); + + flowElementEClass = createEClass(FLOW_ELEMENT); + createEReference(flowElementEClass, FLOW_ELEMENT__AUDITING); + createEReference(flowElementEClass, FLOW_ELEMENT__MONITORING); + createEReference(flowElementEClass, FLOW_ELEMENT__CATEGORY_VALUE_REF); + createEAttribute(flowElementEClass, FLOW_ELEMENT__NAME); + + flowElementsContainerEClass = createEClass(FLOW_ELEMENTS_CONTAINER); + createEReference(flowElementsContainerEClass, FLOW_ELEMENTS_CONTAINER__LANE_SETS); + createEReference(flowElementsContainerEClass, FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS); + + flowNodeEClass = createEClass(FLOW_NODE); + createEReference(flowNodeEClass, FLOW_NODE__INCOMING); + createEReference(flowNodeEClass, FLOW_NODE__LANES); + createEReference(flowNodeEClass, FLOW_NODE__OUTGOING); + + formalExpressionEClass = createEClass(FORMAL_EXPRESSION); + createEAttribute(formalExpressionEClass, FORMAL_EXPRESSION__MIXED); + createEAttribute(formalExpressionEClass, FORMAL_EXPRESSION__BODY); + createEReference(formalExpressionEClass, FORMAL_EXPRESSION__EVALUATES_TO_TYPE_REF); + createEAttribute(formalExpressionEClass, FORMAL_EXPRESSION__LANGUAGE); + + gatewayEClass = createEClass(GATEWAY); + createEAttribute(gatewayEClass, GATEWAY__GATEWAY_DIRECTION); + + globalBusinessRuleTaskEClass = createEClass(GLOBAL_BUSINESS_RULE_TASK); + createEAttribute(globalBusinessRuleTaskEClass, GLOBAL_BUSINESS_RULE_TASK__IMPLEMENTATION); + + globalChoreographyTaskEClass = createEClass(GLOBAL_CHOREOGRAPHY_TASK); + createEReference(globalChoreographyTaskEClass, GLOBAL_CHOREOGRAPHY_TASK__INITIATING_PARTICIPANT_REF); + + globalConversationEClass = createEClass(GLOBAL_CONVERSATION); + + globalManualTaskEClass = createEClass(GLOBAL_MANUAL_TASK); + + globalScriptTaskEClass = createEClass(GLOBAL_SCRIPT_TASK); + createEAttribute(globalScriptTaskEClass, GLOBAL_SCRIPT_TASK__SCRIPT); + createEAttribute(globalScriptTaskEClass, GLOBAL_SCRIPT_TASK__SCRIPT_LANGUAGE); + + globalTaskEClass = createEClass(GLOBAL_TASK); + createEReference(globalTaskEClass, GLOBAL_TASK__RESOURCES); + + globalUserTaskEClass = createEClass(GLOBAL_USER_TASK); + createEReference(globalUserTaskEClass, GLOBAL_USER_TASK__RENDERINGS); + createEAttribute(globalUserTaskEClass, GLOBAL_USER_TASK__IMPLEMENTATION); + + groupEClass = createEClass(GROUP); + createEReference(groupEClass, GROUP__CATEGORY_VALUE_REF); + + humanPerformerEClass = createEClass(HUMAN_PERFORMER); + + implicitThrowEventEClass = createEClass(IMPLICIT_THROW_EVENT); + + importEClass = createEClass(IMPORT); + createEAttribute(importEClass, IMPORT__IMPORT_TYPE); + createEAttribute(importEClass, IMPORT__LOCATION); + createEAttribute(importEClass, IMPORT__NAMESPACE); + + inclusiveGatewayEClass = createEClass(INCLUSIVE_GATEWAY); + createEReference(inclusiveGatewayEClass, INCLUSIVE_GATEWAY__DEFAULT); + + inputOutputBindingEClass = createEClass(INPUT_OUTPUT_BINDING); + createEReference(inputOutputBindingEClass, INPUT_OUTPUT_BINDING__INPUT_DATA_REF); + createEReference(inputOutputBindingEClass, INPUT_OUTPUT_BINDING__OPERATION_REF); + createEReference(inputOutputBindingEClass, INPUT_OUTPUT_BINDING__OUTPUT_DATA_REF); + + inputOutputSpecificationEClass = createEClass(INPUT_OUTPUT_SPECIFICATION); + createEReference(inputOutputSpecificationEClass, INPUT_OUTPUT_SPECIFICATION__DATA_INPUTS); + createEReference(inputOutputSpecificationEClass, INPUT_OUTPUT_SPECIFICATION__DATA_OUTPUTS); + createEReference(inputOutputSpecificationEClass, INPUT_OUTPUT_SPECIFICATION__INPUT_SETS); + createEReference(inputOutputSpecificationEClass, INPUT_OUTPUT_SPECIFICATION__OUTPUT_SETS); + + inputSetEClass = createEClass(INPUT_SET); + createEReference(inputSetEClass, INPUT_SET__DATA_INPUT_REFS); + createEReference(inputSetEClass, INPUT_SET__OPTIONAL_INPUT_REFS); + createEReference(inputSetEClass, INPUT_SET__WHILE_EXECUTING_INPUT_REFS); + createEReference(inputSetEClass, INPUT_SET__OUTPUT_SET_REFS); + createEAttribute(inputSetEClass, INPUT_SET__NAME); + + interactionNodeEClass = createEClass(INTERACTION_NODE); + createEReference(interactionNodeEClass, INTERACTION_NODE__INCOMING_CONVERSATION_LINKS); + createEReference(interactionNodeEClass, INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS); + + interfaceEClass = createEClass(INTERFACE); + createEReference(interfaceEClass, INTERFACE__OPERATIONS); + createEAttribute(interfaceEClass, INTERFACE__NAME); + createEAttribute(interfaceEClass, INTERFACE__IMPLEMENTATION_REF); + + intermediateCatchEventEClass = createEClass(INTERMEDIATE_CATCH_EVENT); + + intermediateThrowEventEClass = createEClass(INTERMEDIATE_THROW_EVENT); + + itemAwareElementEClass = createEClass(ITEM_AWARE_ELEMENT); + createEReference(itemAwareElementEClass, ITEM_AWARE_ELEMENT__DATA_STATE); + createEReference(itemAwareElementEClass, ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF); + + itemDefinitionEClass = createEClass(ITEM_DEFINITION); + createEAttribute(itemDefinitionEClass, ITEM_DEFINITION__IS_COLLECTION); + createEReference(itemDefinitionEClass, ITEM_DEFINITION__IMPORT); + createEAttribute(itemDefinitionEClass, ITEM_DEFINITION__ITEM_KIND); + createEAttribute(itemDefinitionEClass, ITEM_DEFINITION__STRUCTURE_REF); + + laneEClass = createEClass(LANE); + createEReference(laneEClass, LANE__PARTITION_ELEMENT); + createEReference(laneEClass, LANE__FLOW_NODE_REFS); + createEReference(laneEClass, LANE__CHILD_LANE_SET); + createEAttribute(laneEClass, LANE__NAME); + createEReference(laneEClass, LANE__PARTITION_ELEMENT_REF); + + laneSetEClass = createEClass(LANE_SET); + createEReference(laneSetEClass, LANE_SET__LANES); + createEAttribute(laneSetEClass, LANE_SET__NAME); + + linkEventDefinitionEClass = createEClass(LINK_EVENT_DEFINITION); + createEReference(linkEventDefinitionEClass, LINK_EVENT_DEFINITION__SOURCE); + createEReference(linkEventDefinitionEClass, LINK_EVENT_DEFINITION__TARGET); + createEAttribute(linkEventDefinitionEClass, LINK_EVENT_DEFINITION__NAME); + + loopCharacteristicsEClass = createEClass(LOOP_CHARACTERISTICS); + + manualTaskEClass = createEClass(MANUAL_TASK); + + messageEClass = createEClass(MESSAGE); + createEReference(messageEClass, MESSAGE__ITEM_REF); + createEAttribute(messageEClass, MESSAGE__NAME); + + messageEventDefinitionEClass = createEClass(MESSAGE_EVENT_DEFINITION); + createEReference(messageEventDefinitionEClass, MESSAGE_EVENT_DEFINITION__OPERATION_REF); + createEReference(messageEventDefinitionEClass, MESSAGE_EVENT_DEFINITION__MESSAGE_REF); + + messageFlowEClass = createEClass(MESSAGE_FLOW); + createEReference(messageFlowEClass, MESSAGE_FLOW__MESSAGE_REF); + createEAttribute(messageFlowEClass, MESSAGE_FLOW__NAME); + createEReference(messageFlowEClass, MESSAGE_FLOW__SOURCE_REF); + createEReference(messageFlowEClass, MESSAGE_FLOW__TARGET_REF); + + messageFlowAssociationEClass = createEClass(MESSAGE_FLOW_ASSOCIATION); + createEReference(messageFlowAssociationEClass, MESSAGE_FLOW_ASSOCIATION__INNER_MESSAGE_FLOW_REF); + createEReference(messageFlowAssociationEClass, MESSAGE_FLOW_ASSOCIATION__OUTER_MESSAGE_FLOW_REF); + + monitoringEClass = createEClass(MONITORING); + + multiInstanceLoopCharacteristicsEClass = createEClass(MULTI_INSTANCE_LOOP_CHARACTERISTICS); + createEReference(multiInstanceLoopCharacteristicsEClass, MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_CARDINALITY); + createEReference(multiInstanceLoopCharacteristicsEClass, + MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_INPUT_REF); + createEReference(multiInstanceLoopCharacteristicsEClass, + MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_OUTPUT_REF); + createEReference(multiInstanceLoopCharacteristicsEClass, MULTI_INSTANCE_LOOP_CHARACTERISTICS__INPUT_DATA_ITEM); + createEReference(multiInstanceLoopCharacteristicsEClass, MULTI_INSTANCE_LOOP_CHARACTERISTICS__OUTPUT_DATA_ITEM); + createEReference(multiInstanceLoopCharacteristicsEClass, + MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLEX_BEHAVIOR_DEFINITION); + createEReference(multiInstanceLoopCharacteristicsEClass, + MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLETION_CONDITION); + createEAttribute(multiInstanceLoopCharacteristicsEClass, MULTI_INSTANCE_LOOP_CHARACTERISTICS__BEHAVIOR); + createEAttribute(multiInstanceLoopCharacteristicsEClass, MULTI_INSTANCE_LOOP_CHARACTERISTICS__IS_SEQUENTIAL); + createEReference(multiInstanceLoopCharacteristicsEClass, + MULTI_INSTANCE_LOOP_CHARACTERISTICS__NONE_BEHAVIOR_EVENT_REF); + createEReference(multiInstanceLoopCharacteristicsEClass, + MULTI_INSTANCE_LOOP_CHARACTERISTICS__ONE_BEHAVIOR_EVENT_REF); + + operationEClass = createEClass(OPERATION); + createEReference(operationEClass, OPERATION__IN_MESSAGE_REF); + createEReference(operationEClass, OPERATION__OUT_MESSAGE_REF); + createEReference(operationEClass, OPERATION__ERROR_REFS); + createEAttribute(operationEClass, OPERATION__NAME); + createEAttribute(operationEClass, OPERATION__IMPLEMENTATION_REF); + + outputSetEClass = createEClass(OUTPUT_SET); + createEReference(outputSetEClass, OUTPUT_SET__DATA_OUTPUT_REFS); + createEReference(outputSetEClass, OUTPUT_SET__OPTIONAL_OUTPUT_REFS); + createEReference(outputSetEClass, OUTPUT_SET__WHILE_EXECUTING_OUTPUT_REFS); + createEReference(outputSetEClass, OUTPUT_SET__INPUT_SET_REFS); + createEAttribute(outputSetEClass, OUTPUT_SET__NAME); + + parallelGatewayEClass = createEClass(PARALLEL_GATEWAY); + + participantEClass = createEClass(PARTICIPANT); + createEReference(participantEClass, PARTICIPANT__INTERFACE_REFS); + createEReference(participantEClass, PARTICIPANT__END_POINT_REFS); + createEReference(participantEClass, PARTICIPANT__PARTICIPANT_MULTIPLICITY); + createEAttribute(participantEClass, PARTICIPANT__NAME); + createEReference(participantEClass, PARTICIPANT__PROCESS_REF); + + participantAssociationEClass = createEClass(PARTICIPANT_ASSOCIATION); + createEReference(participantAssociationEClass, PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF); + createEReference(participantAssociationEClass, PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF); + + participantMultiplicityEClass = createEClass(PARTICIPANT_MULTIPLICITY); + createEAttribute(participantMultiplicityEClass, PARTICIPANT_MULTIPLICITY__MAXIMUM); + createEAttribute(participantMultiplicityEClass, PARTICIPANT_MULTIPLICITY__MINIMUM); + + partnerEntityEClass = createEClass(PARTNER_ENTITY); + createEReference(partnerEntityEClass, PARTNER_ENTITY__PARTICIPANT_REF); + createEAttribute(partnerEntityEClass, PARTNER_ENTITY__NAME); + + partnerRoleEClass = createEClass(PARTNER_ROLE); + createEReference(partnerRoleEClass, PARTNER_ROLE__PARTICIPANT_REF); + createEAttribute(partnerRoleEClass, PARTNER_ROLE__NAME); + + performerEClass = createEClass(PERFORMER); + + potentialOwnerEClass = createEClass(POTENTIAL_OWNER); + + processEClass = createEClass(PROCESS); + createEReference(processEClass, PROCESS__AUDITING); + createEReference(processEClass, PROCESS__MONITORING); + createEReference(processEClass, PROCESS__PROPERTIES); + createEReference(processEClass, PROCESS__ARTIFACTS); + createEReference(processEClass, PROCESS__RESOURCES); + createEReference(processEClass, PROCESS__CORRELATION_SUBSCRIPTIONS); + createEReference(processEClass, PROCESS__SUPPORTS); + createEReference(processEClass, PROCESS__DEFINITIONAL_COLLABORATION_REF); + createEAttribute(processEClass, PROCESS__IS_CLOSED); + createEAttribute(processEClass, PROCESS__IS_EXECUTABLE); + createEAttribute(processEClass, PROCESS__PROCESS_TYPE); + + propertyEClass = createEClass(PROPERTY); + createEAttribute(propertyEClass, PROPERTY__NAME); + + receiveTaskEClass = createEClass(RECEIVE_TASK); + createEAttribute(receiveTaskEClass, RECEIVE_TASK__IMPLEMENTATION); + createEAttribute(receiveTaskEClass, RECEIVE_TASK__INSTANTIATE); + createEReference(receiveTaskEClass, RECEIVE_TASK__MESSAGE_REF); + createEReference(receiveTaskEClass, RECEIVE_TASK__OPERATION_REF); + + relationshipEClass = createEClass(RELATIONSHIP); + createEReference(relationshipEClass, RELATIONSHIP__SOURCES); + createEReference(relationshipEClass, RELATIONSHIP__TARGETS); + createEAttribute(relationshipEClass, RELATIONSHIP__DIRECTION); + createEAttribute(relationshipEClass, RELATIONSHIP__TYPE); + + renderingEClass = createEClass(RENDERING); + + resourceEClass = createEClass(RESOURCE); + createEReference(resourceEClass, RESOURCE__RESOURCE_PARAMETERS); + createEAttribute(resourceEClass, RESOURCE__NAME); + + resourceAssignmentExpressionEClass = createEClass(RESOURCE_ASSIGNMENT_EXPRESSION); + createEReference(resourceAssignmentExpressionEClass, RESOURCE_ASSIGNMENT_EXPRESSION__EXPRESSION); + + resourceParameterEClass = createEClass(RESOURCE_PARAMETER); + createEAttribute(resourceParameterEClass, RESOURCE_PARAMETER__IS_REQUIRED); + createEAttribute(resourceParameterEClass, RESOURCE_PARAMETER__NAME); + createEReference(resourceParameterEClass, RESOURCE_PARAMETER__TYPE); + + resourceParameterBindingEClass = createEClass(RESOURCE_PARAMETER_BINDING); + createEReference(resourceParameterBindingEClass, RESOURCE_PARAMETER_BINDING__EXPRESSION); + createEReference(resourceParameterBindingEClass, RESOURCE_PARAMETER_BINDING__PARAMETER_REF); + + resourceRoleEClass = createEClass(RESOURCE_ROLE); + createEReference(resourceRoleEClass, RESOURCE_ROLE__RESOURCE_REF); + createEReference(resourceRoleEClass, RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS); + createEReference(resourceRoleEClass, RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION); + createEAttribute(resourceRoleEClass, RESOURCE_ROLE__NAME); + + rootElementEClass = createEClass(ROOT_ELEMENT); + + scriptTaskEClass = createEClass(SCRIPT_TASK); + createEAttribute(scriptTaskEClass, SCRIPT_TASK__SCRIPT); + createEAttribute(scriptTaskEClass, SCRIPT_TASK__SCRIPT_FORMAT); + + sendTaskEClass = createEClass(SEND_TASK); + createEAttribute(sendTaskEClass, SEND_TASK__IMPLEMENTATION); + createEReference(sendTaskEClass, SEND_TASK__MESSAGE_REF); + createEReference(sendTaskEClass, SEND_TASK__OPERATION_REF); + + sequenceFlowEClass = createEClass(SEQUENCE_FLOW); + createEReference(sequenceFlowEClass, SEQUENCE_FLOW__CONDITION_EXPRESSION); + createEAttribute(sequenceFlowEClass, SEQUENCE_FLOW__IS_IMMEDIATE); + createEReference(sequenceFlowEClass, SEQUENCE_FLOW__SOURCE_REF); + createEReference(sequenceFlowEClass, SEQUENCE_FLOW__TARGET_REF); + + serviceTaskEClass = createEClass(SERVICE_TASK); + createEAttribute(serviceTaskEClass, SERVICE_TASK__IMPLEMENTATION); + createEReference(serviceTaskEClass, SERVICE_TASK__OPERATION_REF); + + signalEClass = createEClass(SIGNAL); + createEAttribute(signalEClass, SIGNAL__NAME); + createEReference(signalEClass, SIGNAL__STRUCTURE_REF); + + signalEventDefinitionEClass = createEClass(SIGNAL_EVENT_DEFINITION); + createEAttribute(signalEventDefinitionEClass, SIGNAL_EVENT_DEFINITION__SIGNAL_REF); + + standardLoopCharacteristicsEClass = createEClass(STANDARD_LOOP_CHARACTERISTICS); + createEReference(standardLoopCharacteristicsEClass, STANDARD_LOOP_CHARACTERISTICS__LOOP_CONDITION); + createEReference(standardLoopCharacteristicsEClass, STANDARD_LOOP_CHARACTERISTICS__LOOP_MAXIMUM); + createEAttribute(standardLoopCharacteristicsEClass, STANDARD_LOOP_CHARACTERISTICS__TEST_BEFORE); + + startEventEClass = createEClass(START_EVENT); + createEAttribute(startEventEClass, START_EVENT__IS_INTERRUPTING); + + subChoreographyEClass = createEClass(SUB_CHOREOGRAPHY); + createEReference(subChoreographyEClass, SUB_CHOREOGRAPHY__ARTIFACTS); + + subConversationEClass = createEClass(SUB_CONVERSATION); + createEReference(subConversationEClass, SUB_CONVERSATION__CONVERSATION_NODES); + + subProcessEClass = createEClass(SUB_PROCESS); + createEReference(subProcessEClass, SUB_PROCESS__ARTIFACTS); + createEAttribute(subProcessEClass, SUB_PROCESS__TRIGGERED_BY_EVENT); + + taskEClass = createEClass(TASK); + + terminateEventDefinitionEClass = createEClass(TERMINATE_EVENT_DEFINITION); + + textAnnotationEClass = createEClass(TEXT_ANNOTATION); + createEAttribute(textAnnotationEClass, TEXT_ANNOTATION__TEXT); + createEAttribute(textAnnotationEClass, TEXT_ANNOTATION__TEXT_FORMAT); + + throwEventEClass = createEClass(THROW_EVENT); + createEReference(throwEventEClass, THROW_EVENT__DATA_INPUTS); + createEReference(throwEventEClass, THROW_EVENT__DATA_INPUT_ASSOCIATION); + createEReference(throwEventEClass, THROW_EVENT__INPUT_SET); + createEReference(throwEventEClass, THROW_EVENT__EVENT_DEFINITIONS); + createEReference(throwEventEClass, THROW_EVENT__EVENT_DEFINITION_REFS); + + timerEventDefinitionEClass = createEClass(TIMER_EVENT_DEFINITION); + createEReference(timerEventDefinitionEClass, TIMER_EVENT_DEFINITION__TIME_DATE); + createEReference(timerEventDefinitionEClass, TIMER_EVENT_DEFINITION__TIME_DURATION); + createEReference(timerEventDefinitionEClass, TIMER_EVENT_DEFINITION__TIME_CYCLE); + + transactionEClass = createEClass(TRANSACTION); + createEAttribute(transactionEClass, TRANSACTION__PROTOCOL); + createEAttribute(transactionEClass, TRANSACTION__METHOD); + + userTaskEClass = createEClass(USER_TASK); + createEReference(userTaskEClass, USER_TASK__RENDERINGS); + createEAttribute(userTaskEClass, USER_TASK__IMPLEMENTATION); + + eventSubprocessEClass = createEClass(EVENT_SUBPROCESS); + + // Create enums + adHocOrderingEEnum = createEEnum(AD_HOC_ORDERING); + associationDirectionEEnum = createEEnum(ASSOCIATION_DIRECTION); + choreographyLoopTypeEEnum = createEEnum(CHOREOGRAPHY_LOOP_TYPE); + eventBasedGatewayTypeEEnum = createEEnum(EVENT_BASED_GATEWAY_TYPE); + gatewayDirectionEEnum = createEEnum(GATEWAY_DIRECTION); + itemKindEEnum = createEEnum(ITEM_KIND); + multiInstanceBehaviorEEnum = createEEnum(MULTI_INSTANCE_BEHAVIOR); + processTypeEEnum = createEEnum(PROCESS_TYPE); + relationshipDirectionEEnum = createEEnum(RELATIONSHIP_DIRECTION); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) + return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + XMLTypePackage theXMLTypePackage = (XMLTypePackage) EPackage.Registry.INSTANCE + .getEPackage(XMLTypePackage.eNS_URI); + BpmnDiPackage theBpmnDiPackage = (BpmnDiPackage) EPackage.Registry.INSTANCE.getEPackage(BpmnDiPackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + activityEClass.getESuperTypes().add(this.getFlowNode()); + adHocSubProcessEClass.getESuperTypes().add(this.getSubProcess()); + artifactEClass.getESuperTypes().add(this.getBaseElement()); + assignmentEClass.getESuperTypes().add(this.getBaseElement()); + associationEClass.getESuperTypes().add(this.getArtifact()); + auditingEClass.getESuperTypes().add(this.getBaseElement()); + boundaryEventEClass.getESuperTypes().add(this.getCatchEvent()); + businessRuleTaskEClass.getESuperTypes().add(this.getTask()); + callActivityEClass.getESuperTypes().add(this.getActivity()); + callChoreographyEClass.getESuperTypes().add(this.getChoreographyActivity()); + callConversationEClass.getESuperTypes().add(this.getConversationNode()); + callableElementEClass.getESuperTypes().add(this.getRootElement()); + cancelEventDefinitionEClass.getESuperTypes().add(this.getEventDefinition()); + catchEventEClass.getESuperTypes().add(this.getEvent()); + categoryEClass.getESuperTypes().add(this.getRootElement()); + categoryValueEClass.getESuperTypes().add(this.getBaseElement()); + choreographyEClass.getESuperTypes().add(this.getCollaboration()); + choreographyEClass.getESuperTypes().add(this.getFlowElementsContainer()); + choreographyActivityEClass.getESuperTypes().add(this.getFlowNode()); + choreographyTaskEClass.getESuperTypes().add(this.getChoreographyActivity()); + collaborationEClass.getESuperTypes().add(this.getRootElement()); + compensateEventDefinitionEClass.getESuperTypes().add(this.getEventDefinition()); + complexBehaviorDefinitionEClass.getESuperTypes().add(this.getBaseElement()); + complexGatewayEClass.getESuperTypes().add(this.getGateway()); + conditionalEventDefinitionEClass.getESuperTypes().add(this.getEventDefinition()); + conversationEClass.getESuperTypes().add(this.getConversationNode()); + conversationAssociationEClass.getESuperTypes().add(this.getBaseElement()); + conversationLinkEClass.getESuperTypes().add(this.getBaseElement()); + conversationNodeEClass.getESuperTypes().add(this.getBaseElement()); + conversationNodeEClass.getESuperTypes().add(this.getInteractionNode()); + correlationKeyEClass.getESuperTypes().add(this.getBaseElement()); + correlationPropertyEClass.getESuperTypes().add(this.getRootElement()); + correlationPropertyBindingEClass.getESuperTypes().add(this.getBaseElement()); + correlationPropertyRetrievalExpressionEClass.getESuperTypes().add(this.getBaseElement()); + correlationSubscriptionEClass.getESuperTypes().add(this.getBaseElement()); + dataAssociationEClass.getESuperTypes().add(this.getBaseElement()); + dataInputEClass.getESuperTypes().add(this.getItemAwareElement()); + dataInputAssociationEClass.getESuperTypes().add(this.getDataAssociation()); + dataObjectEClass.getESuperTypes().add(this.getFlowElement()); + dataObjectEClass.getESuperTypes().add(this.getItemAwareElement()); + dataObjectReferenceEClass.getESuperTypes().add(this.getFlowElement()); + dataObjectReferenceEClass.getESuperTypes().add(this.getItemAwareElement()); + dataOutputEClass.getESuperTypes().add(this.getItemAwareElement()); + dataOutputAssociationEClass.getESuperTypes().add(this.getDataAssociation()); + dataStateEClass.getESuperTypes().add(this.getBaseElement()); + dataStoreEClass.getESuperTypes().add(this.getItemAwareElement()); + dataStoreEClass.getESuperTypes().add(this.getRootElement()); + dataStoreReferenceEClass.getESuperTypes().add(this.getFlowElement()); + dataStoreReferenceEClass.getESuperTypes().add(this.getItemAwareElement()); + definitionsEClass.getESuperTypes().add(this.getBaseElement()); + documentationEClass.getESuperTypes().add(this.getBaseElement()); + endEventEClass.getESuperTypes().add(this.getThrowEvent()); + endPointEClass.getESuperTypes().add(this.getRootElement()); + errorEClass.getESuperTypes().add(this.getRootElement()); + errorEventDefinitionEClass.getESuperTypes().add(this.getEventDefinition()); + escalationEClass.getESuperTypes().add(this.getRootElement()); + escalationEventDefinitionEClass.getESuperTypes().add(this.getEventDefinition()); + eventEClass.getESuperTypes().add(this.getFlowNode()); + eventEClass.getESuperTypes().add(this.getInteractionNode()); + eventBasedGatewayEClass.getESuperTypes().add(this.getGateway()); + eventDefinitionEClass.getESuperTypes().add(this.getRootElement()); + exclusiveGatewayEClass.getESuperTypes().add(this.getGateway()); + expressionEClass.getESuperTypes().add(this.getBaseElement()); + flowElementEClass.getESuperTypes().add(this.getBaseElement()); + flowElementsContainerEClass.getESuperTypes().add(this.getBaseElement()); + flowNodeEClass.getESuperTypes().add(this.getFlowElement()); + formalExpressionEClass.getESuperTypes().add(this.getExpression()); + gatewayEClass.getESuperTypes().add(this.getFlowNode()); + globalBusinessRuleTaskEClass.getESuperTypes().add(this.getGlobalTask()); + globalChoreographyTaskEClass.getESuperTypes().add(this.getChoreography()); + globalConversationEClass.getESuperTypes().add(this.getCollaboration()); + globalManualTaskEClass.getESuperTypes().add(this.getGlobalTask()); + globalScriptTaskEClass.getESuperTypes().add(this.getGlobalTask()); + globalTaskEClass.getESuperTypes().add(this.getCallableElement()); + globalUserTaskEClass.getESuperTypes().add(this.getGlobalTask()); + groupEClass.getESuperTypes().add(this.getArtifact()); + humanPerformerEClass.getESuperTypes().add(this.getPerformer()); + implicitThrowEventEClass.getESuperTypes().add(this.getThrowEvent()); + inclusiveGatewayEClass.getESuperTypes().add(this.getGateway()); + inputOutputBindingEClass.getESuperTypes().add(this.getBaseElement()); + inputOutputSpecificationEClass.getESuperTypes().add(this.getBaseElement()); + inputSetEClass.getESuperTypes().add(this.getBaseElement()); + interfaceEClass.getESuperTypes().add(this.getRootElement()); + intermediateCatchEventEClass.getESuperTypes().add(this.getCatchEvent()); + intermediateThrowEventEClass.getESuperTypes().add(this.getThrowEvent()); + itemAwareElementEClass.getESuperTypes().add(this.getBaseElement()); + itemDefinitionEClass.getESuperTypes().add(this.getRootElement()); + laneEClass.getESuperTypes().add(this.getBaseElement()); + laneSetEClass.getESuperTypes().add(this.getBaseElement()); + linkEventDefinitionEClass.getESuperTypes().add(this.getEventDefinition()); + loopCharacteristicsEClass.getESuperTypes().add(this.getBaseElement()); + manualTaskEClass.getESuperTypes().add(this.getTask()); + messageEClass.getESuperTypes().add(this.getRootElement()); + messageEventDefinitionEClass.getESuperTypes().add(this.getEventDefinition()); + messageFlowEClass.getESuperTypes().add(this.getBaseElement()); + messageFlowAssociationEClass.getESuperTypes().add(this.getBaseElement()); + monitoringEClass.getESuperTypes().add(this.getBaseElement()); + multiInstanceLoopCharacteristicsEClass.getESuperTypes().add(this.getLoopCharacteristics()); + operationEClass.getESuperTypes().add(this.getBaseElement()); + outputSetEClass.getESuperTypes().add(this.getBaseElement()); + parallelGatewayEClass.getESuperTypes().add(this.getGateway()); + participantEClass.getESuperTypes().add(this.getBaseElement()); + participantEClass.getESuperTypes().add(this.getInteractionNode()); + participantAssociationEClass.getESuperTypes().add(this.getBaseElement()); + participantMultiplicityEClass.getESuperTypes().add(this.getBaseElement()); + partnerEntityEClass.getESuperTypes().add(this.getRootElement()); + partnerRoleEClass.getESuperTypes().add(this.getRootElement()); + performerEClass.getESuperTypes().add(this.getResourceRole()); + potentialOwnerEClass.getESuperTypes().add(this.getHumanPerformer()); + processEClass.getESuperTypes().add(this.getCallableElement()); + processEClass.getESuperTypes().add(this.getFlowElementsContainer()); + propertyEClass.getESuperTypes().add(this.getItemAwareElement()); + receiveTaskEClass.getESuperTypes().add(this.getTask()); + relationshipEClass.getESuperTypes().add(this.getBaseElement()); + renderingEClass.getESuperTypes().add(this.getBaseElement()); + resourceEClass.getESuperTypes().add(this.getRootElement()); + resourceAssignmentExpressionEClass.getESuperTypes().add(this.getBaseElement()); + resourceParameterEClass.getESuperTypes().add(this.getBaseElement()); + resourceParameterBindingEClass.getESuperTypes().add(this.getBaseElement()); + resourceRoleEClass.getESuperTypes().add(this.getBaseElement()); + rootElementEClass.getESuperTypes().add(this.getBaseElement()); + scriptTaskEClass.getESuperTypes().add(this.getTask()); + sendTaskEClass.getESuperTypes().add(this.getTask()); + sequenceFlowEClass.getESuperTypes().add(this.getFlowElement()); + serviceTaskEClass.getESuperTypes().add(this.getTask()); + signalEClass.getESuperTypes().add(this.getRootElement()); + signalEventDefinitionEClass.getESuperTypes().add(this.getEventDefinition()); + standardLoopCharacteristicsEClass.getESuperTypes().add(this.getLoopCharacteristics()); + startEventEClass.getESuperTypes().add(this.getCatchEvent()); + subChoreographyEClass.getESuperTypes().add(this.getChoreographyActivity()); + subChoreographyEClass.getESuperTypes().add(this.getFlowElementsContainer()); + subConversationEClass.getESuperTypes().add(this.getConversationNode()); + subProcessEClass.getESuperTypes().add(this.getActivity()); + subProcessEClass.getESuperTypes().add(this.getFlowElementsContainer()); + taskEClass.getESuperTypes().add(this.getActivity()); + taskEClass.getESuperTypes().add(this.getInteractionNode()); + terminateEventDefinitionEClass.getESuperTypes().add(this.getEventDefinition()); + textAnnotationEClass.getESuperTypes().add(this.getFlowNode()); + throwEventEClass.getESuperTypes().add(this.getEvent()); + timerEventDefinitionEClass.getESuperTypes().add(this.getEventDefinition()); + transactionEClass.getESuperTypes().add(this.getSubProcess()); + userTaskEClass.getESuperTypes().add(this.getTask()); + eventSubprocessEClass.getESuperTypes().add(this.getSubProcess()); + + // Initialize classes and features; add operations and parameters + initEClass(documentRootEClass, DocumentRoot.class, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, + "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, + "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Activity(), this.getActivity(), null, "activity", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_AdHocSubProcess(), this.getAdHocSubProcess(), null, "adHocSubProcess", null, 0, + -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_FlowElement(), this.getFlowElement(), null, "flowElement", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Artifact(), this.getArtifact(), null, "artifact", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Assignment(), this.getAssignment(), null, "assignment", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Association(), this.getAssociation(), null, "association", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Auditing(), this.getAuditing(), null, "auditing", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BaseElement(), this.getBaseElement(), null, "baseElement", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BaseElementWithMixedContent(), this.getBaseElement(), null, + "baseElementWithMixedContent", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BoundaryEvent(), this.getBoundaryEvent(), null, "boundaryEvent", null, 0, -2, + null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_BusinessRuleTask(), this.getBusinessRuleTask(), null, "businessRuleTask", null, + 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_CallableElement(), this.getCallableElement(), null, "callableElement", null, 0, + -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_CallActivity(), this.getCallActivity(), null, "callActivity", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_CallChoreography(), this.getCallChoreography(), null, "callChoreography", null, + 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_CallConversation(), this.getCallConversation(), null, "callConversation", null, + 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ConversationNode(), this.getConversationNode(), null, "conversationNode", null, + 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_CancelEventDefinition(), this.getCancelEventDefinition(), null, + "cancelEventDefinition", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_EventDefinition(), this.getEventDefinition(), null, "eventDefinition", null, 0, + -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_RootElement(), this.getRootElement(), null, "rootElement", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_CatchEvent(), this.getCatchEvent(), null, "catchEvent", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Category(), this.getCategory(), null, "category", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_CategoryValue(), this.getCategoryValue(), null, "categoryValue", null, 0, -2, + null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Choreography(), this.getChoreography(), null, "choreography", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Collaboration(), this.getCollaboration(), null, "collaboration", null, 0, -2, + null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ChoreographyActivity(), this.getChoreographyActivity(), null, + "choreographyActivity", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ChoreographyTask(), this.getChoreographyTask(), null, "choreographyTask", null, + 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_CompensateEventDefinition(), this.getCompensateEventDefinition(), null, + "compensateEventDefinition", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ComplexBehaviorDefinition(), this.getComplexBehaviorDefinition(), null, + "complexBehaviorDefinition", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ComplexGateway(), this.getComplexGateway(), null, "complexGateway", null, 0, -2, + null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ConditionalEventDefinition(), this.getConditionalEventDefinition(), null, + "conditionalEventDefinition", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Conversation(), this.getConversation(), null, "conversation", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ConversationAssociation(), this.getConversationAssociation(), null, + "conversationAssociation", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ConversationLink(), this.getConversationLink(), null, "conversationLink", null, + 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_CorrelationKey(), this.getCorrelationKey(), null, "correlationKey", null, 0, -2, + null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_CorrelationProperty(), this.getCorrelationProperty(), null, + "correlationProperty", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_CorrelationPropertyBinding(), this.getCorrelationPropertyBinding(), null, + "correlationPropertyBinding", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_CorrelationPropertyRetrievalExpression(), + this.getCorrelationPropertyRetrievalExpression(), null, "correlationPropertyRetrievalExpression", null, + 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_CorrelationSubscription(), this.getCorrelationSubscription(), null, + "correlationSubscription", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_DataAssociation(), this.getDataAssociation(), null, "dataAssociation", null, 0, + -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_DataInput(), this.getDataInput(), null, "dataInput", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_DataInputAssociation(), this.getDataInputAssociation(), null, + "dataInputAssociation", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_DataObject(), this.getDataObject(), null, "dataObject", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_DataObjectReference(), this.getDataObjectReference(), null, + "dataObjectReference", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_DataOutput(), this.getDataOutput(), null, "dataOutput", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_DataOutputAssociation(), this.getDataOutputAssociation(), null, + "dataOutputAssociation", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_DataState(), this.getDataState(), null, "dataState", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_DataStore(), this.getDataStore(), null, "dataStore", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_DataStoreReference(), this.getDataStoreReference(), null, "dataStoreReference", + null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Definitions(), this.getDefinitions(), null, "definitions", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Documentation(), this.getDocumentation(), null, "documentation", null, 0, -2, + null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_EndEvent(), this.getEndEvent(), null, "endEvent", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_EndPoint(), this.getEndPoint(), null, "endPoint", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Error(), this.getError(), null, "error", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_ErrorEventDefinition(), this.getErrorEventDefinition(), null, + "errorEventDefinition", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Escalation(), this.getEscalation(), null, "escalation", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_EscalationEventDefinition(), this.getEscalationEventDefinition(), null, + "escalationEventDefinition", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Event(), this.getEvent(), null, "event", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_EventBasedGateway(), this.getEventBasedGateway(), null, "eventBasedGateway", + null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ExclusiveGateway(), this.getExclusiveGateway(), null, "exclusiveGateway", null, + 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Expression(), this.getExpression(), null, "expression", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Extension(), this.getExtension(), null, "extension", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ExtensionElements(), this.getExtensionAttributeValue(), null, + "extensionElements", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_FlowNode(), this.getFlowNode(), null, "flowNode", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_FormalExpression(), this.getFormalExpression(), null, "formalExpression", null, + 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Gateway(), this.getGateway(), null, "gateway", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_GlobalBusinessRuleTask(), this.getGlobalBusinessRuleTask(), null, + "globalBusinessRuleTask", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_GlobalChoreographyTask(), this.getGlobalChoreographyTask(), null, + "globalChoreographyTask", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_GlobalConversation(), this.getGlobalConversation(), null, "globalConversation", + null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_GlobalManualTask(), this.getGlobalManualTask(), null, "globalManualTask", null, + 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_GlobalScriptTask(), this.getGlobalScriptTask(), null, "globalScriptTask", null, + 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_GlobalTask(), this.getGlobalTask(), null, "globalTask", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_GlobalUserTask(), this.getGlobalUserTask(), null, "globalUserTask", null, 0, -2, + null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Group(), this.getGroup(), null, "group", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_HumanPerformer(), this.getHumanPerformer(), null, "humanPerformer", null, 0, -2, + null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Performer(), this.getPerformer(), null, "performer", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ResourceRole(), this.getResourceRole(), null, "resourceRole", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ImplicitThrowEvent(), this.getImplicitThrowEvent(), null, "implicitThrowEvent", + null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Import(), this.getImport(), null, "import", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_InclusiveGateway(), this.getInclusiveGateway(), null, "inclusiveGateway", null, + 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_InputSet(), this.getInputSet(), null, "inputSet", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Interface(), this.getInterface(), null, "interface", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_IntermediateCatchEvent(), this.getIntermediateCatchEvent(), null, + "intermediateCatchEvent", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_IntermediateThrowEvent(), this.getIntermediateThrowEvent(), null, + "intermediateThrowEvent", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_IoBinding(), this.getInputOutputBinding(), null, "ioBinding", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_IoSpecification(), this.getInputOutputSpecification(), null, "ioSpecification", + null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ItemDefinition(), this.getItemDefinition(), null, "itemDefinition", null, 0, -2, + null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Lane(), this.getLane(), null, "lane", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_LaneSet(), this.getLaneSet(), null, "laneSet", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_LinkEventDefinition(), this.getLinkEventDefinition(), null, + "linkEventDefinition", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_LoopCharacteristics(), this.getLoopCharacteristics(), null, + "loopCharacteristics", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ManualTask(), this.getManualTask(), null, "manualTask", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Message(), this.getMessage(), null, "message", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_MessageEventDefinition(), this.getMessageEventDefinition(), null, + "messageEventDefinition", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_MessageFlow(), this.getMessageFlow(), null, "messageFlow", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_MessageFlowAssociation(), this.getMessageFlowAssociation(), null, + "messageFlowAssociation", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Monitoring(), this.getMonitoring(), null, "monitoring", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_MultiInstanceLoopCharacteristics(), this.getMultiInstanceLoopCharacteristics(), + null, "multiInstanceLoopCharacteristics", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Operation(), this.getOperation(), null, "operation", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_OutputSet(), this.getOutputSet(), null, "outputSet", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ParallelGateway(), this.getParallelGateway(), null, "parallelGateway", null, 0, + -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Participant(), this.getParticipant(), null, "participant", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ParticipantAssociation(), this.getParticipantAssociation(), null, + "participantAssociation", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ParticipantMultiplicity(), this.getParticipantMultiplicity(), null, + "participantMultiplicity", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_PartnerEntity(), this.getPartnerEntity(), null, "partnerEntity", null, 0, -2, + null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_PartnerRole(), this.getPartnerRole(), null, "partnerRole", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_PotentialOwner(), this.getPotentialOwner(), null, "potentialOwner", null, 0, -2, + null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Process(), this.getProcess(), null, "process", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_Property(), this.getProperty(), null, "property", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ReceiveTask(), this.getReceiveTask(), null, "receiveTask", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Relationship(), this.getRelationship(), null, "relationship", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Rendering(), this.getRendering(), null, "rendering", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Resource(), this.getResource(), null, "resource", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ResourceAssignmentExpression(), this.getResourceAssignmentExpression(), null, + "resourceAssignmentExpression", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ResourceParameter(), this.getResourceParameter(), null, "resourceParameter", + null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ResourceParameterBinding(), this.getResourceParameterBinding(), null, + "resourceParameterBinding", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Script(), ecorePackage.getEObject(), null, "script", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ScriptTask(), this.getScriptTask(), null, "scriptTask", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_SendTask(), this.getSendTask(), null, "sendTask", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_SequenceFlow(), this.getSequenceFlow(), null, "sequenceFlow", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ServiceTask(), this.getServiceTask(), null, "serviceTask", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Signal(), this.getSignal(), null, "signal", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_SignalEventDefinition(), this.getSignalEventDefinition(), null, + "signalEventDefinition", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_StandardLoopCharacteristics(), this.getStandardLoopCharacteristics(), null, + "standardLoopCharacteristics", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_StartEvent(), this.getStartEvent(), null, "startEvent", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_SubChoreography(), this.getSubChoreography(), null, "subChoreography", null, 0, + -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_SubConversation(), this.getSubConversation(), null, "subConversation", null, 0, + -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_SubProcess(), this.getSubProcess(), null, "subProcess", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Task(), this.getTask(), null, "task", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_TerminateEventDefinition(), this.getTerminateEventDefinition(), null, + "terminateEventDefinition", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Text(), ecorePackage.getEObject(), null, "text", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_TextAnnotation(), this.getTextAnnotation(), null, "textAnnotation", null, 0, -2, + null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_ThrowEvent(), this.getThrowEvent(), null, "throwEvent", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_TimerEventDefinition(), this.getTimerEventDefinition(), null, + "timerEventDefinition", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Transaction(), this.getTransaction(), null, "transaction", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_UserTask(), this.getUserTask(), null, "userTask", null, 0, -2, null, + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_EventSubProcess(), this.getEventSubprocess(), null, "eventSubProcess", null, 0, + -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + initEClass(activityEClass, Activity.class, "Activity", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getActivity_IoSpecification(), this.getInputOutputSpecification(), null, "ioSpecification", null, + 0, 1, Activity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getActivity_BoundaryEventRefs(), this.getBoundaryEvent(), this.getBoundaryEvent_AttachedToRef(), + "boundaryEventRefs", null, 0, -1, Activity.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEReference(getActivity_Properties(), this.getProperty(), null, "properties", null, 0, -1, Activity.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getActivity_DataInputAssociations(), this.getDataInputAssociation(), null, + "dataInputAssociations", null, 0, -1, Activity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getActivity_DataOutputAssociations(), this.getDataOutputAssociation(), null, + "dataOutputAssociations", null, 0, -1, Activity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getActivity_Resources(), this.getResourceRole(), null, "resources", null, 0, -1, Activity.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getActivity_LoopCharacteristics(), this.getLoopCharacteristics(), null, "loopCharacteristics", + null, 0, 1, Activity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getActivity_CompletionQuantity(), ecorePackage.getEInt(), "completionQuantity", "1", 1, 1, + Activity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEReference(getActivity_Default(), this.getSequenceFlow(), null, "default", null, 0, 1, Activity.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getActivity_IsForCompensation(), ecorePackage.getEBoolean(), "isForCompensation", "false", 1, 1, + Activity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getActivity_StartQuantity(), ecorePackage.getEInt(), "startQuantity", "1", 1, 1, Activity.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(adHocSubProcessEClass, AdHocSubProcess.class, "AdHocSubProcess", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getAdHocSubProcess_CompletionCondition(), this.getExpression(), null, "completionCondition", + null, 1, 1, AdHocSubProcess.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getAdHocSubProcess_CancelRemainingInstances(), ecorePackage.getEBoolean(), + "cancelRemainingInstances", "true", 1, 1, AdHocSubProcess.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getAdHocSubProcess_Ordering(), this.getAdHocOrdering(), "ordering", null, 1, 1, + AdHocSubProcess.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(artifactEClass, Artifact.class, "Artifact", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(assignmentEClass, Assignment.class, "Assignment", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getAssignment_From(), this.getExpression(), null, "from", null, 1, 1, Assignment.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getAssignment_To(), this.getExpression(), null, "to", null, 1, 1, Assignment.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(associationEClass, Association.class, "Association", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getAssociation_AssociationDirection(), this.getAssociationDirection(), "associationDirection", + null, 1, 1, Association.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getAssociation_SourceRef(), this.getBaseElement(), null, "sourceRef", null, 1, 1, + Association.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getAssociation_TargetRef(), this.getBaseElement(), null, "targetRef", null, 1, 1, + Association.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(auditingEClass, Auditing.class, "Auditing", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(baseElementEClass, BaseElement.class, "BaseElement", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getBaseElement_Documentation(), this.getDocumentation(), null, "documentation", null, 0, -1, + BaseElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getBaseElement_ExtensionValues(), this.getExtensionAttributeValue(), null, "extensionValues", + null, 0, -1, BaseElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getBaseElement_ExtensionDefinitions(), this.getExtensionDefinition(), null, + "extensionDefinitions", null, 0, -1, BaseElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getBaseElement_Id(), theXMLTypePackage.getNCName(), "id", null, 1, 1, BaseElement.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getBaseElement_AnyAttribute(), ecorePackage.getEFeatureMapEntry(), "anyAttribute", null, 0, -1, + BaseElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + + initEClass(boundaryEventEClass, BoundaryEvent.class, "BoundaryEvent", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getBoundaryEvent_AttachedToRef(), this.getActivity(), this.getActivity_BoundaryEventRefs(), + "attachedToRef", null, 1, 1, BoundaryEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getBoundaryEvent_CancelActivity(), ecorePackage.getEBoolean(), "cancelActivity", "true", 1, 1, + BoundaryEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(businessRuleTaskEClass, BusinessRuleTask.class, "BusinessRuleTask", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getBusinessRuleTask_Implementation(), ecorePackage.getEString(), "implementation", null, 1, 1, + BusinessRuleTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(callActivityEClass, CallActivity.class, "CallActivity", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getCallActivity_CalledElement(), theXMLTypePackage.getString(), "calledElement", null, 1, 1, + CallActivity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(callChoreographyEClass, CallChoreography.class, "CallChoreography", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getCallChoreography_ParticipantAssociations(), this.getParticipantAssociation(), null, + "participantAssociations", null, 0, -1, CallChoreography.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCallChoreography_CalledChoreographyRef(), this.getChoreography(), null, + "calledChoreographyRef", null, 0, 1, CallChoreography.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(callConversationEClass, CallConversation.class, "CallConversation", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getCallConversation_ParticipantAssociations(), this.getParticipantAssociation(), null, + "participantAssociations", null, 0, -1, CallConversation.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCallConversation_CalledCollaborationRef(), this.getCollaboration(), null, + "calledCollaborationRef", null, 0, 1, CallConversation.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(callableElementEClass, CallableElement.class, "CallableElement", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getCallableElement_SupportedInterfaceRefs(), this.getInterface(), null, "supportedInterfaceRefs", + null, 0, -1, CallableElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCallableElement_IoSpecification(), this.getInputOutputSpecification(), null, + "ioSpecification", null, 0, 1, CallableElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCallableElement_IoBinding(), this.getInputOutputBinding(), null, "ioBinding", null, 0, -1, + CallableElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getCallableElement_Name(), ecorePackage.getEString(), "name", null, 1, 1, CallableElement.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(cancelEventDefinitionEClass, CancelEventDefinition.class, "CancelEventDefinition", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(catchEventEClass, CatchEvent.class, "CatchEvent", IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getCatchEvent_DataOutputs(), this.getDataOutput(), null, "dataOutputs", null, 0, -1, + CatchEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCatchEvent_DataOutputAssociation(), this.getDataOutputAssociation(), null, + "dataOutputAssociation", null, 0, -1, CatchEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCatchEvent_OutputSet(), this.getOutputSet(), null, "outputSet", null, 0, 1, CatchEvent.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCatchEvent_EventDefinitions(), this.getEventDefinition(), null, "eventDefinitions", null, 0, + -1, CatchEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCatchEvent_EventDefinitionRefs(), this.getEventDefinition(), null, "eventDefinitionRefs", + null, 0, -1, CatchEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getCatchEvent_ParallelMultiple(), ecorePackage.getEBoolean(), "parallelMultiple", null, 1, 1, + CatchEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(categoryEClass, Category.class, "Category", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getCategory_CategoryValue(), this.getCategoryValue(), null, "categoryValue", null, 0, -1, + Category.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getCategory_Name(), ecorePackage.getEString(), "name", null, 1, 1, Category.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(categoryValueEClass, CategoryValue.class, "CategoryValue", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getCategoryValue_Value(), ecorePackage.getEString(), "value", null, 1, 1, CategoryValue.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEReference(getCategoryValue_CategorizedFlowElements(), this.getFlowElement(), null, + "categorizedFlowElements", null, 0, -1, CategoryValue.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, + !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + + initEClass(choreographyEClass, Choreography.class, "Choreography", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(choreographyActivityEClass, ChoreographyActivity.class, "ChoreographyActivity", IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getChoreographyActivity_ParticipantRefs(), this.getParticipant(), null, "participantRefs", null, + 2, -1, ChoreographyActivity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getChoreographyActivity_CorrelationKeys(), this.getCorrelationKey(), null, "correlationKeys", + null, 0, -1, ChoreographyActivity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getChoreographyActivity_InitiatingParticipantRef(), this.getParticipant(), null, + "initiatingParticipantRef", null, 1, 1, ChoreographyActivity.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getChoreographyActivity_LoopType(), this.getChoreographyLoopType(), "loopType", "None", 1, 1, + ChoreographyActivity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(choreographyTaskEClass, ChoreographyTask.class, "ChoreographyTask", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getChoreographyTask_MessageFlowRef(), this.getMessageFlow(), null, "messageFlowRef", null, 1, 2, + ChoreographyTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(collaborationEClass, Collaboration.class, "Collaboration", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getCollaboration_Participants(), this.getParticipant(), null, "participants", null, 0, -1, + Collaboration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCollaboration_MessageFlows(), this.getMessageFlow(), null, "messageFlows", null, 0, -1, + Collaboration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCollaboration_Artifacts(), this.getArtifact(), null, "artifacts", null, 0, -1, + Collaboration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCollaboration_Conversations(), this.getConversationNode(), null, "conversations", null, 0, -1, + Collaboration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCollaboration_ConversationAssociations(), this.getConversationAssociation(), null, + "conversationAssociations", null, 1, 1, Collaboration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCollaboration_ParticipantAssociations(), this.getParticipantAssociation(), null, + "participantAssociations", null, 0, -1, Collaboration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCollaboration_MessageFlowAssociations(), this.getMessageFlowAssociation(), null, + "messageFlowAssociations", null, 0, -1, Collaboration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCollaboration_CorrelationKeys(), this.getCorrelationKey(), null, "correlationKeys", null, 0, + -1, Collaboration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCollaboration_ChoreographyRef(), this.getChoreography(), null, "choreographyRef", null, 0, -1, + Collaboration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCollaboration_ConversationLinks(), this.getConversationLink(), null, "conversationLinks", + null, 0, -1, Collaboration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getCollaboration_IsClosed(), ecorePackage.getEBoolean(), "isClosed", null, 1, 1, + Collaboration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getCollaboration_Name(), ecorePackage.getEString(), "name", null, 1, 1, Collaboration.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(compensateEventDefinitionEClass, CompensateEventDefinition.class, "CompensateEventDefinition", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCompensateEventDefinition_ActivityRef(), this.getActivity(), null, "activityRef", null, 0, 1, + CompensateEventDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getCompensateEventDefinition_WaitForCompletion(), ecorePackage.getEBoolean(), + "waitForCompletion", null, 1, 1, CompensateEventDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(complexBehaviorDefinitionEClass, ComplexBehaviorDefinition.class, "ComplexBehaviorDefinition", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getComplexBehaviorDefinition_Condition(), this.getFormalExpression(), null, "condition", null, 1, + 1, ComplexBehaviorDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getComplexBehaviorDefinition_Event(), this.getImplicitThrowEvent(), null, "event", null, 0, 1, + ComplexBehaviorDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(complexGatewayEClass, ComplexGateway.class, "ComplexGateway", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getComplexGateway_ActivationCondition(), this.getExpression(), null, "activationCondition", null, + 0, 1, ComplexGateway.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getComplexGateway_Default(), this.getSequenceFlow(), null, "default", null, 0, 1, + ComplexGateway.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(conditionalEventDefinitionEClass, ConditionalEventDefinition.class, "ConditionalEventDefinition", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getConditionalEventDefinition_Condition(), this.getExpression(), null, "condition", null, 1, 1, + ConditionalEventDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(conversationEClass, Conversation.class, "Conversation", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(conversationAssociationEClass, ConversationAssociation.class, "ConversationAssociation", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getConversationAssociation_InnerConversationNodeRef(), this.getConversationNode(), null, + "innerConversationNodeRef", null, 1, 1, ConversationAssociation.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getConversationAssociation_OuterConversationNodeRef(), this.getConversationNode(), null, + "outerConversationNodeRef", null, 1, 1, ConversationAssociation.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(conversationLinkEClass, ConversationLink.class, "ConversationLink", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getConversationLink_Name(), ecorePackage.getEString(), "name", null, 0, 1, + ConversationLink.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEReference(getConversationLink_SourceRef(), this.getInteractionNode(), null, "sourceRef", null, 1, 1, + ConversationLink.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getConversationLink_TargetRef(), this.getInteractionNode(), null, "targetRef", null, 1, 1, + ConversationLink.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(conversationNodeEClass, ConversationNode.class, "ConversationNode", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getConversationNode_ParticipantRefs(), this.getParticipant(), null, "participantRefs", null, 2, + -1, ConversationNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getConversationNode_MessageFlowRefs(), this.getMessageFlow(), null, "messageFlowRefs", null, 0, + -1, ConversationNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getConversationNode_CorrelationKeys(), this.getCorrelationKey(), null, "correlationKeys", null, + 0, -1, ConversationNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getConversationNode_Name(), ecorePackage.getEString(), "name", null, 1, 1, + ConversationNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(correlationKeyEClass, CorrelationKey.class, "CorrelationKey", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getCorrelationKey_CorrelationPropertyRef(), this.getCorrelationProperty(), null, + "correlationPropertyRef", null, 0, -1, CorrelationKey.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getCorrelationKey_Name(), ecorePackage.getEString(), "name", null, 1, 1, CorrelationKey.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(correlationPropertyEClass, CorrelationProperty.class, "CorrelationProperty", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCorrelationProperty_CorrelationPropertyRetrievalExpression(), + this.getCorrelationPropertyRetrievalExpression(), null, "correlationPropertyRetrievalExpression", null, + 1, -1, CorrelationProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getCorrelationProperty_Name(), ecorePackage.getEString(), "name", null, 1, 1, + CorrelationProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCorrelationProperty_Type(), this.getItemDefinition(), null, "type", null, 0, 1, + CorrelationProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(correlationPropertyBindingEClass, CorrelationPropertyBinding.class, "CorrelationPropertyBinding", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCorrelationPropertyBinding_DataPath(), this.getFormalExpression(), null, "dataPath", null, 1, + 1, CorrelationPropertyBinding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCorrelationPropertyBinding_CorrelationPropertyRef(), this.getCorrelationProperty(), null, + "correlationPropertyRef", null, 1, 1, CorrelationPropertyBinding.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(correlationPropertyRetrievalExpressionEClass, CorrelationPropertyRetrievalExpression.class, + "CorrelationPropertyRetrievalExpression", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCorrelationPropertyRetrievalExpression_MessagePath(), this.getFormalExpression(), null, + "messagePath", null, 1, 1, CorrelationPropertyRetrievalExpression.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCorrelationPropertyRetrievalExpression_MessageRef(), this.getMessage(), null, "messageRef", + null, 1, 1, CorrelationPropertyRetrievalExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(correlationSubscriptionEClass, CorrelationSubscription.class, "CorrelationSubscription", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCorrelationSubscription_CorrelationPropertyBinding(), this.getCorrelationPropertyBinding(), + null, "correlationPropertyBinding", null, 0, -1, CorrelationSubscription.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEReference(getCorrelationSubscription_CorrelationKeyRef(), this.getCorrelationKey(), null, + "correlationKeyRef", null, 1, 1, CorrelationSubscription.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(dataAssociationEClass, DataAssociation.class, "DataAssociation", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getDataAssociation_SourceRef(), this.getItemAwareElement(), null, "sourceRef", null, 0, -1, + DataAssociation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getDataAssociation_TargetRef(), this.getItemAwareElement(), null, "targetRef", null, 1, 1, + DataAssociation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getDataAssociation_Transformation(), this.getFormalExpression(), null, "transformation", null, 0, + 1, DataAssociation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getDataAssociation_Assignment(), this.getAssignment(), null, "assignment", null, 0, -1, + DataAssociation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(dataInputEClass, DataInput.class, "DataInput", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getDataInput_InputSetWithOptional(), this.getInputSet(), this.getInputSet_OptionalInputRefs(), + "inputSetWithOptional", null, 0, -1, DataInput.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEReference(getDataInput_InputSetWithWhileExecuting(), this.getInputSet(), + this.getInputSet_WhileExecutingInputRefs(), "inputSetWithWhileExecuting", null, 0, -1, DataInput.class, + IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, !IS_ORDERED); + initEReference(getDataInput_InputSetRefs(), this.getInputSet(), this.getInputSet_DataInputRefs(), + "inputSetRefs", null, 1, -1, DataInput.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getDataInput_IsCollection(), ecorePackage.getEBoolean(), "isCollection", "false", 1, 1, + DataInput.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getDataInput_Name(), ecorePackage.getEString(), "name", null, 0, 1, DataInput.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(dataInputAssociationEClass, DataInputAssociation.class, "DataInputAssociation", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(dataObjectEClass, DataObject.class, "DataObject", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDataObject_IsCollection(), ecorePackage.getEBoolean(), "isCollection", "false", 1, 1, + DataObject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(dataObjectReferenceEClass, DataObjectReference.class, "DataObjectReference", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getDataObjectReference_DataObjectRef(), this.getDataObject(), null, "dataObjectRef", null, 1, 1, + DataObjectReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(dataOutputEClass, DataOutput.class, "DataOutput", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getDataOutput_OutputSetWithOptional(), this.getOutputSet(), + this.getOutputSet_OptionalOutputRefs(), "outputSetWithOptional", null, 0, -1, DataOutput.class, + IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, !IS_ORDERED); + initEReference(getDataOutput_OutputSetWithWhileExecuting(), this.getOutputSet(), + this.getOutputSet_WhileExecutingOutputRefs(), "outputSetWithWhileExecuting", null, 0, -1, + DataOutput.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEReference(getDataOutput_OutputSetRefs(), this.getOutputSet(), this.getOutputSet_DataOutputRefs(), + "outputSetRefs", null, 1, -1, DataOutput.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getDataOutput_IsCollection(), ecorePackage.getEBoolean(), "isCollection", "false", 1, 1, + DataOutput.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getDataOutput_Name(), ecorePackage.getEString(), "name", null, 0, 1, DataOutput.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(dataOutputAssociationEClass, DataOutputAssociation.class, "DataOutputAssociation", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(dataStateEClass, DataState.class, "DataState", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDataState_Name(), ecorePackage.getEString(), "name", null, 1, 1, DataState.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(dataStoreEClass, DataStore.class, "DataStore", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDataStore_Capacity(), ecorePackage.getEInt(), "capacity", null, 1, 1, DataStore.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getDataStore_IsUnlimited(), ecorePackage.getEBoolean(), "isUnlimited", "true", 1, 1, + DataStore.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getDataStore_Name(), ecorePackage.getEString(), "name", null, 1, 1, DataStore.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(dataStoreReferenceEClass, DataStoreReference.class, "DataStoreReference", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getDataStoreReference_DataStoreRef(), this.getDataStore(), null, "dataStoreRef", null, 0, 1, + DataStoreReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(definitionsEClass, Definitions.class, "Definitions", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getDefinitions_Imports(), this.getImport(), null, "imports", null, 0, -1, Definitions.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getDefinitions_Extensions(), this.getExtension(), null, "extensions", null, 0, -1, + Definitions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getDefinitions_RootElements(), this.getRootElement(), null, "rootElements", null, 0, -1, + Definitions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getDefinitions_Diagrams(), theBpmnDiPackage.getBPMNDiagram(), null, "diagrams", null, 0, -1, + Definitions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getDefinitions_Relationships(), this.getRelationship(), null, "relationships", null, 0, -1, + Definitions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getDefinitions_Exporter(), ecorePackage.getEString(), "exporter", null, 1, 1, Definitions.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getDefinitions_ExporterVersion(), ecorePackage.getEString(), "exporterVersion", null, 1, 1, + Definitions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getDefinitions_ExpressionLanguage(), ecorePackage.getEString(), "expressionLanguage", + "http://www.w3.org/1999/XPath", 1, 1, Definitions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getDefinitions_Name(), ecorePackage.getEString(), "name", null, 1, 1, Definitions.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getDefinitions_TargetNamespace(), ecorePackage.getEString(), "targetNamespace", null, 1, 1, + Definitions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getDefinitions_TypeLanguage(), ecorePackage.getEString(), "typeLanguage", + "http://www.w3.org/2001/XMLSchema", 1, 1, Definitions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(documentationEClass, Documentation.class, "Documentation", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDocumentation_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, + Documentation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEAttribute(getDocumentation_Text(), ecorePackage.getEString(), "text", null, 1, 1, Documentation.class, + !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getDocumentation_TextFormat(), ecorePackage.getEString(), "textFormat", "text/plain", 1, 1, + Documentation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(endEventEClass, EndEvent.class, "EndEvent", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(endPointEClass, EndPoint.class, "EndPoint", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(errorEClass, org.eclipse.bpmn2.Error.class, "Error", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getError_ErrorCode(), ecorePackage.getEString(), "errorCode", null, 1, 1, + org.eclipse.bpmn2.Error.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getError_Name(), ecorePackage.getEString(), "name", null, 1, 1, org.eclipse.bpmn2.Error.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEReference(getError_StructureRef(), this.getItemDefinition(), null, "structureRef", null, 0, 1, + org.eclipse.bpmn2.Error.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(errorEventDefinitionEClass, ErrorEventDefinition.class, "ErrorEventDefinition", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getErrorEventDefinition_ErrorRef(), this.getError(), null, "errorRef", null, 0, 1, + ErrorEventDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(escalationEClass, Escalation.class, "Escalation", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getEscalation_EscalationCode(), ecorePackage.getEString(), "escalationCode", null, 1, 1, + Escalation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getEscalation_Name(), ecorePackage.getEString(), "name", null, 1, 1, Escalation.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEReference(getEscalation_StructureRef(), this.getItemDefinition(), null, "structureRef", null, 0, 1, + Escalation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(escalationEventDefinitionEClass, EscalationEventDefinition.class, "EscalationEventDefinition", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getEscalationEventDefinition_EscalationRef(), this.getEscalation(), null, "escalationRef", null, + 0, 1, EscalationEventDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(eventEClass, Event.class, "Event", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getEvent_Properties(), this.getProperty(), null, "properties", null, 0, -1, Event.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(eventBasedGatewayEClass, EventBasedGateway.class, "EventBasedGateway", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getEventBasedGateway_EventGatewayType(), this.getEventBasedGatewayType(), "eventGatewayType", + null, 1, 1, EventBasedGateway.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getEventBasedGateway_Instantiate(), ecorePackage.getEBoolean(), "instantiate", "false", 1, 1, + EventBasedGateway.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(eventDefinitionEClass, EventDefinition.class, "EventDefinition", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(exclusiveGatewayEClass, ExclusiveGateway.class, "ExclusiveGateway", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getExclusiveGateway_Default(), this.getSequenceFlow(), null, "default", null, 0, 1, + ExclusiveGateway.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(expressionEClass, Expression.class, "Expression", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(extensionEClass, Extension.class, "Extension", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getExtension_Definition(), this.getExtensionDefinition(), null, "definition", null, 1, 1, + Extension.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getExtension_MustUnderstand(), ecorePackage.getEBoolean(), "mustUnderstand", "false", 1, 1, + Extension.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getExtension_XsdDefinition(), theXMLTypePackage.getQName(), "xsdDefinition", null, 0, 1, + Extension.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + + initEClass(extensionAttributeDefinitionEClass, ExtensionAttributeDefinition.class, + "ExtensionAttributeDefinition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getExtensionAttributeDefinition_Name(), ecorePackage.getEString(), "name", null, 1, 1, + ExtensionAttributeDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getExtensionAttributeDefinition_Type(), ecorePackage.getEString(), "type", null, 1, 1, + ExtensionAttributeDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getExtensionAttributeDefinition_IsReference(), ecorePackage.getEBoolean(), "isReference", + "false", 1, 1, ExtensionAttributeDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getExtensionAttributeDefinition_ExtensionDefinition(), this.getExtensionDefinition(), + this.getExtensionDefinition_ExtensionAttributeDefinitions(), "extensionDefinition", null, 1, 1, + ExtensionAttributeDefinition.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + + initEClass(extensionAttributeValueEClass, ExtensionAttributeValue.class, "ExtensionAttributeValue", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getExtensionAttributeValue_ValueRef(), ecorePackage.getEObject(), null, "valueRef", null, 0, 1, + ExtensionAttributeValue.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getExtensionAttributeValue_Value(), ecorePackage.getEFeatureMapEntry(), "value", null, 0, -1, + ExtensionAttributeValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getExtensionAttributeValue_ExtensionAttributeDefinition(), + this.getExtensionAttributeDefinition(), null, "extensionAttributeDefinition", null, 1, 1, + ExtensionAttributeValue.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + + initEClass(extensionDefinitionEClass, ExtensionDefinition.class, "ExtensionDefinition", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getExtensionDefinition_Name(), ecorePackage.getEString(), "name", null, 1, 1, + ExtensionDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getExtensionDefinition_ExtensionAttributeDefinitions(), this.getExtensionAttributeDefinition(), + this.getExtensionAttributeDefinition_ExtensionDefinition(), "extensionAttributeDefinitions", null, 0, + -1, ExtensionDefinition.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + + initEClass(flowElementEClass, FlowElement.class, "FlowElement", IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getFlowElement_Auditing(), this.getAuditing(), null, "auditing", null, 0, 1, FlowElement.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getFlowElement_Monitoring(), this.getMonitoring(), null, "monitoring", null, 0, 1, + FlowElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getFlowElement_CategoryValueRef(), this.getCategoryValue(), null, "categoryValueRef", null, 0, + -1, FlowElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getFlowElement_Name(), ecorePackage.getEString(), "name", null, 1, 1, FlowElement.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(flowElementsContainerEClass, FlowElementsContainer.class, "FlowElementsContainer", IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getFlowElementsContainer_LaneSets(), this.getLaneSet(), null, "laneSets", null, 0, -1, + FlowElementsContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getFlowElementsContainer_FlowElements(), this.getFlowElement(), null, "flowElements", null, 0, + -1, FlowElementsContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(flowNodeEClass, FlowNode.class, "FlowNode", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getFlowNode_Incoming(), this.getSequenceFlow(), this.getSequenceFlow_TargetRef(), "incoming", + null, 0, -1, FlowNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getFlowNode_Lanes(), this.getLane(), this.getLane_FlowNodeRefs(), "lanes", null, 0, -1, + FlowNode.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEReference(getFlowNode_Outgoing(), this.getSequenceFlow(), this.getSequenceFlow_SourceRef(), "outgoing", + null, 0, -1, FlowNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(formalExpressionEClass, FormalExpression.class, "FormalExpression", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getFormalExpression_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, + FormalExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEAttribute(getFormalExpression_Body(), ecorePackage.getEString(), "body", null, 1, 1, + FormalExpression.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + IS_DERIVED, !IS_ORDERED); + initEReference(getFormalExpression_EvaluatesToTypeRef(), this.getItemDefinition(), null, "evaluatesToTypeRef", + null, 1, 1, FormalExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getFormalExpression_Language(), ecorePackage.getEString(), "language", null, 1, 1, + FormalExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(gatewayEClass, Gateway.class, "Gateway", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getGateway_GatewayDirection(), this.getGatewayDirection(), "gatewayDirection", "unspecified", 1, + 1, Gateway.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(globalBusinessRuleTaskEClass, GlobalBusinessRuleTask.class, "GlobalBusinessRuleTask", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getGlobalBusinessRuleTask_Implementation(), ecorePackage.getEString(), "implementation", null, 1, + 1, GlobalBusinessRuleTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(globalChoreographyTaskEClass, GlobalChoreographyTask.class, "GlobalChoreographyTask", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getGlobalChoreographyTask_InitiatingParticipantRef(), this.getParticipant(), null, + "initiatingParticipantRef", null, 1, 1, GlobalChoreographyTask.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(globalConversationEClass, GlobalConversation.class, "GlobalConversation", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(globalManualTaskEClass, GlobalManualTask.class, "GlobalManualTask", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(globalScriptTaskEClass, GlobalScriptTask.class, "GlobalScriptTask", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getGlobalScriptTask_Script(), ecorePackage.getEString(), "script", null, 1, 1, + GlobalScriptTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getGlobalScriptTask_ScriptLanguage(), ecorePackage.getEString(), "scriptLanguage", null, 1, 1, + GlobalScriptTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(globalTaskEClass, GlobalTask.class, "GlobalTask", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getGlobalTask_Resources(), this.getResourceRole(), null, "resources", null, 0, -1, + GlobalTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(globalUserTaskEClass, GlobalUserTask.class, "GlobalUserTask", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getGlobalUserTask_Renderings(), this.getRendering(), null, "renderings", null, 0, -1, + GlobalUserTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getGlobalUserTask_Implementation(), ecorePackage.getEString(), "implementation", null, 1, 1, + GlobalUserTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(groupEClass, Group.class, "Group", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getGroup_CategoryValueRef(), this.getCategoryValue(), null, "categoryValueRef", null, 0, 1, + Group.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(humanPerformerEClass, HumanPerformer.class, "HumanPerformer", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(implicitThrowEventEClass, ImplicitThrowEvent.class, "ImplicitThrowEvent", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(importEClass, Import.class, "Import", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getImport_ImportType(), ecorePackage.getEString(), "importType", null, 1, 1, Import.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getImport_Location(), ecorePackage.getEString(), "location", null, 1, 1, Import.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getImport_Namespace(), ecorePackage.getEString(), "namespace", null, 1, 1, Import.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(inclusiveGatewayEClass, InclusiveGateway.class, "InclusiveGateway", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getInclusiveGateway_Default(), this.getSequenceFlow(), null, "default", null, 0, 1, + InclusiveGateway.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(inputOutputBindingEClass, InputOutputBinding.class, "InputOutputBinding", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getInputOutputBinding_InputDataRef(), this.getInputSet(), null, "inputDataRef", null, 1, 1, + InputOutputBinding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getInputOutputBinding_OperationRef(), this.getOperation(), null, "operationRef", null, 1, 1, + InputOutputBinding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getInputOutputBinding_OutputDataRef(), this.getOutputSet(), null, "outputDataRef", null, 1, 1, + InputOutputBinding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(inputOutputSpecificationEClass, InputOutputSpecification.class, "InputOutputSpecification", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getInputOutputSpecification_DataInputs(), this.getDataInput(), null, "dataInputs", null, 0, -1, + InputOutputSpecification.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getInputOutputSpecification_DataOutputs(), this.getDataOutput(), null, "dataOutputs", null, 0, + -1, InputOutputSpecification.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getInputOutputSpecification_InputSets(), this.getInputSet(), null, "inputSets", null, 1, -1, + InputOutputSpecification.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getInputOutputSpecification_OutputSets(), this.getOutputSet(), null, "outputSets", null, 1, -1, + InputOutputSpecification.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(inputSetEClass, InputSet.class, "InputSet", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getInputSet_DataInputRefs(), this.getDataInput(), this.getDataInput_InputSetRefs(), + "dataInputRefs", null, 0, -1, InputSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getInputSet_OptionalInputRefs(), this.getDataInput(), this.getDataInput_InputSetWithOptional(), + "optionalInputRefs", null, 0, -1, InputSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getInputSet_WhileExecutingInputRefs(), this.getDataInput(), + this.getDataInput_InputSetWithWhileExecuting(), "whileExecutingInputRefs", null, 0, -1, InputSet.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getInputSet_OutputSetRefs(), this.getOutputSet(), this.getOutputSet_InputSetRefs(), + "outputSetRefs", null, 0, -1, InputSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getInputSet_Name(), ecorePackage.getEString(), "name", null, 1, 1, InputSet.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(interactionNodeEClass, InteractionNode.class, "InteractionNode", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getInteractionNode_IncomingConversationLinks(), this.getConversationLink(), null, + "incomingConversationLinks", null, 0, -1, InteractionNode.class, IS_TRANSIENT, IS_VOLATILE, + !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEReference(getInteractionNode_OutgoingConversationLinks(), this.getConversationLink(), null, + "outgoingConversationLinks", null, 0, -1, InteractionNode.class, IS_TRANSIENT, IS_VOLATILE, + !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + + initEClass(interfaceEClass, Interface.class, "Interface", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getInterface_Operations(), this.getOperation(), null, "operations", null, 1, -1, Interface.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getInterface_Name(), ecorePackage.getEString(), "name", null, 1, 1, Interface.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getInterface_ImplementationRef(), ecorePackage.getEString(), "implementationRef", null, 1, 1, + Interface.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(intermediateCatchEventEClass, IntermediateCatchEvent.class, "IntermediateCatchEvent", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(intermediateThrowEventEClass, IntermediateThrowEvent.class, "IntermediateThrowEvent", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(itemAwareElementEClass, ItemAwareElement.class, "ItemAwareElement", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getItemAwareElement_DataState(), this.getDataState(), null, "dataState", null, 0, 1, + ItemAwareElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getItemAwareElement_ItemSubjectRef(), this.getItemDefinition(), null, "itemSubjectRef", null, 0, + 1, ItemAwareElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(itemDefinitionEClass, ItemDefinition.class, "ItemDefinition", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getItemDefinition_IsCollection(), ecorePackage.getEBoolean(), "isCollection", "false", 1, 1, + ItemDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEReference(getItemDefinition_Import(), this.getImport(), null, "import", null, 0, 1, ItemDefinition.class, + IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, !IS_ORDERED); + initEAttribute(getItemDefinition_ItemKind(), this.getItemKind(), "itemKind", null, 1, 1, ItemDefinition.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getItemDefinition_StructureRef(), ecorePackage.getEString(), "structureRef", null, 1, 1, + ItemDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(laneEClass, Lane.class, "Lane", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getLane_PartitionElement(), this.getBaseElement(), null, "partitionElement", null, 0, 1, + Lane.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getLane_FlowNodeRefs(), this.getFlowNode(), this.getFlowNode_Lanes(), "flowNodeRefs", null, 0, + -1, Lane.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getLane_ChildLaneSet(), this.getLaneSet(), null, "childLaneSet", null, 0, 1, Lane.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getLane_Name(), ecorePackage.getEString(), "name", null, 1, 1, Lane.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getLane_PartitionElementRef(), this.getBaseElement(), null, "partitionElementRef", null, 0, 1, + Lane.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(laneSetEClass, LaneSet.class, "LaneSet", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getLaneSet_Lanes(), this.getLane(), null, "lanes", null, 0, -1, LaneSet.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getLaneSet_Name(), ecorePackage.getEString(), "name", null, 0, 1, LaneSet.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(linkEventDefinitionEClass, LinkEventDefinition.class, "LinkEventDefinition", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getLinkEventDefinition_Source(), this.getLinkEventDefinition(), + this.getLinkEventDefinition_Target(), "source", null, 0, -1, LinkEventDefinition.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEReference(getLinkEventDefinition_Target(), this.getLinkEventDefinition(), + this.getLinkEventDefinition_Source(), "target", null, 0, 1, LinkEventDefinition.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getLinkEventDefinition_Name(), ecorePackage.getEString(), "name", null, 1, 1, + LinkEventDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(loopCharacteristicsEClass, LoopCharacteristics.class, "LoopCharacteristics", IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(manualTaskEClass, ManualTask.class, "ManualTask", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(messageEClass, Message.class, "Message", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getMessage_ItemRef(), this.getItemDefinition(), null, "itemRef", null, 0, 1, Message.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getMessage_Name(), ecorePackage.getEString(), "name", null, 1, 1, Message.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(messageEventDefinitionEClass, MessageEventDefinition.class, "MessageEventDefinition", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getMessageEventDefinition_OperationRef(), this.getOperation(), null, "operationRef", null, 0, 1, + MessageEventDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getMessageEventDefinition_MessageRef(), this.getMessage(), null, "messageRef", null, 0, 1, + MessageEventDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(messageFlowEClass, MessageFlow.class, "MessageFlow", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getMessageFlow_MessageRef(), this.getMessage(), null, "messageRef", null, 0, 1, + MessageFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getMessageFlow_Name(), ecorePackage.getEString(), "name", null, 1, 1, MessageFlow.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEReference(getMessageFlow_SourceRef(), this.getInteractionNode(), null, "sourceRef", null, 1, 1, + MessageFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getMessageFlow_TargetRef(), this.getInteractionNode(), null, "targetRef", null, 1, 1, + MessageFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(messageFlowAssociationEClass, MessageFlowAssociation.class, "MessageFlowAssociation", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getMessageFlowAssociation_InnerMessageFlowRef(), this.getMessageFlow(), null, + "innerMessageFlowRef", null, 1, 1, MessageFlowAssociation.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getMessageFlowAssociation_OuterMessageFlowRef(), this.getMessageFlow(), null, + "outerMessageFlowRef", null, 1, 1, MessageFlowAssociation.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(monitoringEClass, Monitoring.class, "Monitoring", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(multiInstanceLoopCharacteristicsEClass, MultiInstanceLoopCharacteristics.class, + "MultiInstanceLoopCharacteristics", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getMultiInstanceLoopCharacteristics_LoopCardinality(), this.getExpression(), null, + "loopCardinality", null, 0, 1, MultiInstanceLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getMultiInstanceLoopCharacteristics_LoopDataInputRef(), this.getItemAwareElement(), null, + "loopDataInputRef", null, 0, 1, MultiInstanceLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getMultiInstanceLoopCharacteristics_LoopDataOutputRef(), this.getItemAwareElement(), null, + "loopDataOutputRef", null, 0, 1, MultiInstanceLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getMultiInstanceLoopCharacteristics_InputDataItem(), this.getDataInput(), null, "inputDataItem", + null, 0, 1, MultiInstanceLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getMultiInstanceLoopCharacteristics_OutputDataItem(), this.getDataOutput(), null, + "outputDataItem", null, 0, 1, MultiInstanceLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getMultiInstanceLoopCharacteristics_ComplexBehaviorDefinition(), + this.getComplexBehaviorDefinition(), null, "complexBehaviorDefinition", null, 0, -1, + MultiInstanceLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getMultiInstanceLoopCharacteristics_CompletionCondition(), this.getExpression(), null, + "completionCondition", null, 0, 1, MultiInstanceLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getMultiInstanceLoopCharacteristics_Behavior(), this.getMultiInstanceBehavior(), "behavior", + "All", 1, 1, MultiInstanceLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getMultiInstanceLoopCharacteristics_IsSequential(), ecorePackage.getEBoolean(), "isSequential", + "false", 1, 1, MultiInstanceLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getMultiInstanceLoopCharacteristics_NoneBehaviorEventRef(), this.getEventDefinition(), null, + "noneBehaviorEventRef", null, 0, 1, MultiInstanceLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getMultiInstanceLoopCharacteristics_OneBehaviorEventRef(), this.getEventDefinition(), null, + "oneBehaviorEventRef", null, 0, 1, MultiInstanceLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(operationEClass, Operation.class, "Operation", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getOperation_InMessageRef(), this.getMessage(), null, "inMessageRef", null, 1, 1, + Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getOperation_OutMessageRef(), this.getMessage(), null, "outMessageRef", null, 0, 1, + Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getOperation_ErrorRefs(), this.getError(), null, "errorRefs", null, 0, -1, Operation.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getOperation_Name(), ecorePackage.getEString(), "name", null, 1, 1, Operation.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getOperation_ImplementationRef(), ecorePackage.getEString(), "implementationRef", null, 1, 1, + Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(outputSetEClass, OutputSet.class, "OutputSet", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getOutputSet_DataOutputRefs(), this.getDataOutput(), this.getDataOutput_OutputSetRefs(), + "dataOutputRefs", null, 0, -1, OutputSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getOutputSet_OptionalOutputRefs(), this.getDataOutput(), + this.getDataOutput_OutputSetWithOptional(), "optionalOutputRefs", null, 0, -1, OutputSet.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getOutputSet_WhileExecutingOutputRefs(), this.getDataOutput(), + this.getDataOutput_OutputSetWithWhileExecuting(), "whileExecutingOutputRefs", null, 0, -1, + OutputSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getOutputSet_InputSetRefs(), this.getInputSet(), this.getInputSet_OutputSetRefs(), + "inputSetRefs", null, 0, -1, OutputSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getOutputSet_Name(), ecorePackage.getEString(), "name", null, 1, 1, OutputSet.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(parallelGatewayEClass, ParallelGateway.class, "ParallelGateway", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(participantEClass, Participant.class, "Participant", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getParticipant_InterfaceRefs(), this.getInterface(), null, "interfaceRefs", null, 0, -1, + Participant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getParticipant_EndPointRefs(), this.getEndPoint(), null, "endPointRefs", null, 0, -1, + Participant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getParticipant_ParticipantMultiplicity(), this.getParticipantMultiplicity(), null, + "participantMultiplicity", null, 0, 1, Participant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getParticipant_Name(), ecorePackage.getEString(), "name", null, 1, 1, Participant.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEReference(getParticipant_ProcessRef(), this.getProcess(), null, "processRef", null, 0, 1, + Participant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(participantAssociationEClass, ParticipantAssociation.class, "ParticipantAssociation", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getParticipantAssociation_InnerParticipantRef(), this.getParticipant(), null, + "innerParticipantRef", null, 1, 1, ParticipantAssociation.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getParticipantAssociation_OuterParticipantRef(), this.getParticipant(), null, + "outerParticipantRef", null, 1, 1, ParticipantAssociation.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(participantMultiplicityEClass, ParticipantMultiplicity.class, "ParticipantMultiplicity", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getParticipantMultiplicity_Maximum(), ecorePackage.getEInt(), "maximum", "1", 0, 1, + ParticipantMultiplicity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getParticipantMultiplicity_Minimum(), ecorePackage.getEInt(), "minimum", "0", 1, 1, + ParticipantMultiplicity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(partnerEntityEClass, PartnerEntity.class, "PartnerEntity", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getPartnerEntity_ParticipantRef(), this.getParticipant(), null, "participantRef", null, 0, -1, + PartnerEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getPartnerEntity_Name(), ecorePackage.getEString(), "name", null, 1, 1, PartnerEntity.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(partnerRoleEClass, PartnerRole.class, "PartnerRole", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getPartnerRole_ParticipantRef(), this.getParticipant(), null, "participantRef", null, 0, -1, + PartnerRole.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getPartnerRole_Name(), ecorePackage.getEString(), "name", null, 1, 1, PartnerRole.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(performerEClass, Performer.class, "Performer", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(potentialOwnerEClass, PotentialOwner.class, "PotentialOwner", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(processEClass, org.eclipse.bpmn2.Process.class, "Process", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getProcess_Auditing(), this.getAuditing(), null, "auditing", null, 0, 1, + org.eclipse.bpmn2.Process.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getProcess_Monitoring(), this.getMonitoring(), null, "monitoring", null, 0, 1, + org.eclipse.bpmn2.Process.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getProcess_Properties(), this.getProperty(), null, "properties", null, 0, -1, + org.eclipse.bpmn2.Process.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getProcess_Artifacts(), this.getArtifact(), null, "artifacts", null, 0, -1, + org.eclipse.bpmn2.Process.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getProcess_Resources(), this.getResourceRole(), null, "resources", null, 0, -1, + org.eclipse.bpmn2.Process.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getProcess_CorrelationSubscriptions(), this.getCorrelationSubscription(), null, + "correlationSubscriptions", null, 0, -1, org.eclipse.bpmn2.Process.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getProcess_Supports(), this.getProcess(), null, "supports", null, 0, -1, + org.eclipse.bpmn2.Process.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getProcess_DefinitionalCollaborationRef(), this.getCollaboration(), null, + "definitionalCollaborationRef", null, 0, 1, org.eclipse.bpmn2.Process.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getProcess_IsClosed(), ecorePackage.getEBoolean(), "isClosed", null, 1, 1, + org.eclipse.bpmn2.Process.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getProcess_IsExecutable(), ecorePackage.getEBoolean(), "isExecutable", null, 1, 1, + org.eclipse.bpmn2.Process.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getProcess_ProcessType(), this.getProcessType(), "processType", null, 1, 1, + org.eclipse.bpmn2.Process.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(propertyEClass, Property.class, "Property", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getProperty_Name(), ecorePackage.getEString(), "name", null, 1, 1, Property.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(receiveTaskEClass, ReceiveTask.class, "ReceiveTask", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getReceiveTask_Implementation(), ecorePackage.getEString(), "implementation", null, 1, 1, + ReceiveTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getReceiveTask_Instantiate(), ecorePackage.getEBoolean(), "instantiate", "false", 1, 1, + ReceiveTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEReference(getReceiveTask_MessageRef(), this.getMessage(), null, "messageRef", null, 0, 1, + ReceiveTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getReceiveTask_OperationRef(), this.getOperation(), null, "operationRef", null, 0, 1, + ReceiveTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(relationshipEClass, Relationship.class, "Relationship", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getRelationship_Sources(), ecorePackage.getEObject(), null, "sources", null, 1, -1, + Relationship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getRelationship_Targets(), ecorePackage.getEObject(), null, "targets", null, 1, -1, + Relationship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getRelationship_Direction(), this.getRelationshipDirection(), "direction", null, 1, 1, + Relationship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getRelationship_Type(), ecorePackage.getEString(), "type", null, 1, 1, Relationship.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(renderingEClass, Rendering.class, "Rendering", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(resourceEClass, Resource.class, "Resource", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getResource_ResourceParameters(), this.getResourceParameter(), null, "resourceParameters", null, + 0, -1, Resource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getResource_Name(), ecorePackage.getEString(), "name", null, 1, 1, Resource.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(resourceAssignmentExpressionEClass, ResourceAssignmentExpression.class, + "ResourceAssignmentExpression", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getResourceAssignmentExpression_Expression(), this.getExpression(), null, "expression", null, 1, + 1, ResourceAssignmentExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(resourceParameterEClass, ResourceParameter.class, "ResourceParameter", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getResourceParameter_IsRequired(), ecorePackage.getEBoolean(), "isRequired", null, 1, 1, + ResourceParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getResourceParameter_Name(), ecorePackage.getEString(), "name", null, 1, 1, + ResourceParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEReference(getResourceParameter_Type(), this.getItemDefinition(), null, "type", null, 0, 1, + ResourceParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(resourceParameterBindingEClass, ResourceParameterBinding.class, "ResourceParameterBinding", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getResourceParameterBinding_Expression(), this.getExpression(), null, "expression", null, 1, 1, + ResourceParameterBinding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getResourceParameterBinding_ParameterRef(), this.getResourceParameter(), null, "parameterRef", + null, 1, 1, ResourceParameterBinding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(resourceRoleEClass, ResourceRole.class, "ResourceRole", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getResourceRole_ResourceRef(), this.getResource(), null, "resourceRef", null, 0, 1, + ResourceRole.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getResourceRole_ResourceParameterBindings(), this.getResourceParameterBinding(), null, + "resourceParameterBindings", null, 0, -1, ResourceRole.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getResourceRole_ResourceAssignmentExpression(), this.getResourceAssignmentExpression(), null, + "resourceAssignmentExpression", null, 0, 1, ResourceRole.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getResourceRole_Name(), ecorePackage.getEString(), "name", null, 1, 1, ResourceRole.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(rootElementEClass, RootElement.class, "RootElement", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(scriptTaskEClass, ScriptTask.class, "ScriptTask", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getScriptTask_Script(), ecorePackage.getEString(), "script", null, 1, 1, ScriptTask.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getScriptTask_ScriptFormat(), ecorePackage.getEString(), "scriptFormat", null, 1, 1, + ScriptTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(sendTaskEClass, SendTask.class, "SendTask", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getSendTask_Implementation(), ecorePackage.getEString(), "implementation", null, 1, 1, + SendTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEReference(getSendTask_MessageRef(), this.getMessage(), null, "messageRef", null, 0, 1, SendTask.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getSendTask_OperationRef(), this.getOperation(), null, "operationRef", null, 0, 1, + SendTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(sequenceFlowEClass, SequenceFlow.class, "SequenceFlow", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getSequenceFlow_ConditionExpression(), this.getExpression(), null, "conditionExpression", null, + 0, 1, SequenceFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getSequenceFlow_IsImmediate(), ecorePackage.getEBoolean(), "isImmediate", null, 0, 1, + SequenceFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEReference(getSequenceFlow_SourceRef(), this.getFlowNode(), this.getFlowNode_Outgoing(), "sourceRef", null, + 1, 1, SequenceFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getSequenceFlow_TargetRef(), this.getFlowNode(), this.getFlowNode_Incoming(), "targetRef", null, + 1, 1, SequenceFlow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(serviceTaskEClass, ServiceTask.class, "ServiceTask", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getServiceTask_Implementation(), ecorePackage.getEString(), "implementation", null, 1, 1, + ServiceTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEReference(getServiceTask_OperationRef(), this.getOperation(), null, "operationRef", null, 0, 1, + ServiceTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(signalEClass, Signal.class, "Signal", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getSignal_Name(), ecorePackage.getEString(), "name", null, 1, 1, Signal.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getSignal_StructureRef(), this.getItemDefinition(), null, "structureRef", null, 0, 1, + Signal.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(signalEventDefinitionEClass, SignalEventDefinition.class, "SignalEventDefinition", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getSignalEventDefinition_SignalRef(), theXMLTypePackage.getNCName(), "signalRef", null, 1, 1, + SignalEventDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(standardLoopCharacteristicsEClass, StandardLoopCharacteristics.class, "StandardLoopCharacteristics", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getStandardLoopCharacteristics_LoopCondition(), this.getExpression(), null, "loopCondition", + null, 0, 1, StandardLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getStandardLoopCharacteristics_LoopMaximum(), this.getExpression(), null, "loopMaximum", null, 0, + 1, StandardLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getStandardLoopCharacteristics_TestBefore(), ecorePackage.getEBoolean(), "testBefore", "false", + 1, 1, StandardLoopCharacteristics.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, + !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(startEventEClass, StartEvent.class, "StartEvent", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getStartEvent_IsInterrupting(), ecorePackage.getEBoolean(), "isInterrupting", "true", 1, 1, + StartEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(subChoreographyEClass, SubChoreography.class, "SubChoreography", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getSubChoreography_Artifacts(), this.getArtifact(), null, "artifacts", null, 0, -1, + SubChoreography.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(subConversationEClass, SubConversation.class, "SubConversation", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getSubConversation_ConversationNodes(), this.getConversationNode(), null, "conversationNodes", + null, 0, -1, SubConversation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(subProcessEClass, SubProcess.class, "SubProcess", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getSubProcess_Artifacts(), this.getArtifact(), null, "artifacts", null, 0, -1, SubProcess.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getSubProcess_TriggeredByEvent(), ecorePackage.getEBoolean(), "triggeredByEvent", "false", 1, 1, + SubProcess.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(taskEClass, Task.class, "Task", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(terminateEventDefinitionEClass, TerminateEventDefinition.class, "TerminateEventDefinition", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(textAnnotationEClass, TextAnnotation.class, "TextAnnotation", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getTextAnnotation_Text(), ecorePackage.getEString(), "text", null, 1, 1, TextAnnotation.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getTextAnnotation_TextFormat(), ecorePackage.getEString(), "textFormat", "text/plain", 1, 1, + TextAnnotation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(throwEventEClass, ThrowEvent.class, "ThrowEvent", IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getThrowEvent_DataInputs(), this.getDataInput(), null, "dataInputs", null, 0, -1, + ThrowEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getThrowEvent_DataInputAssociation(), this.getDataInputAssociation(), null, + "dataInputAssociation", null, 0, -1, ThrowEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getThrowEvent_InputSet(), this.getInputSet(), null, "inputSet", null, 0, 1, ThrowEvent.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getThrowEvent_EventDefinitions(), this.getEventDefinition(), null, "eventDefinitions", null, 0, + -1, ThrowEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getThrowEvent_EventDefinitionRefs(), this.getEventDefinition(), null, "eventDefinitionRefs", + null, 0, -1, ThrowEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(timerEventDefinitionEClass, TimerEventDefinition.class, "TimerEventDefinition", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getTimerEventDefinition_TimeDate(), this.getExpression(), null, "timeDate", null, 0, 1, + TimerEventDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getTimerEventDefinition_TimeDuration(), this.getExpression(), null, "timeDuration", null, 0, 1, + TimerEventDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getTimerEventDefinition_TimeCycle(), this.getExpression(), null, "timeCycle", null, 0, 1, + TimerEventDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(transactionEClass, Transaction.class, "Transaction", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getTransaction_Protocol(), ecorePackage.getEString(), "protocol", null, 0, 1, Transaction.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getTransaction_Method(), ecorePackage.getEString(), "method", null, 1, 1, Transaction.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(userTaskEClass, UserTask.class, "UserTask", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getUserTask_Renderings(), this.getRendering(), null, "renderings", null, 0, -1, UserTask.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getUserTask_Implementation(), ecorePackage.getEString(), "implementation", null, 1, 1, + UserTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(eventSubprocessEClass, EventSubprocess.class, "EventSubprocess", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + // Initialize enums and add enum literals + initEEnum(adHocOrderingEEnum, AdHocOrdering.class, "AdHocOrdering"); + addEEnumLiteral(adHocOrderingEEnum, AdHocOrdering.PARALLEL); + addEEnumLiteral(adHocOrderingEEnum, AdHocOrdering.SEQUENTIAL); + + initEEnum(associationDirectionEEnum, AssociationDirection.class, "AssociationDirection"); + addEEnumLiteral(associationDirectionEEnum, AssociationDirection.NONE); + addEEnumLiteral(associationDirectionEEnum, AssociationDirection.ONE); + addEEnumLiteral(associationDirectionEEnum, AssociationDirection.BOTH); + + initEEnum(choreographyLoopTypeEEnum, ChoreographyLoopType.class, "ChoreographyLoopType"); + addEEnumLiteral(choreographyLoopTypeEEnum, ChoreographyLoopType.NONE); + addEEnumLiteral(choreographyLoopTypeEEnum, ChoreographyLoopType.STANDARD); + addEEnumLiteral(choreographyLoopTypeEEnum, ChoreographyLoopType.MULTI_INSTANCE_SEQUENTIAL); + addEEnumLiteral(choreographyLoopTypeEEnum, ChoreographyLoopType.MULTI_INSTANCE_PARALLEL); + + initEEnum(eventBasedGatewayTypeEEnum, EventBasedGatewayType.class, "EventBasedGatewayType"); + addEEnumLiteral(eventBasedGatewayTypeEEnum, EventBasedGatewayType.PARALLEL); + addEEnumLiteral(eventBasedGatewayTypeEEnum, EventBasedGatewayType.EXCLUSIVE); + + initEEnum(gatewayDirectionEEnum, GatewayDirection.class, "GatewayDirection"); + addEEnumLiteral(gatewayDirectionEEnum, GatewayDirection.UNSPECIFIED); + addEEnumLiteral(gatewayDirectionEEnum, GatewayDirection.CONVERGING); + addEEnumLiteral(gatewayDirectionEEnum, GatewayDirection.DIVERGING); + addEEnumLiteral(gatewayDirectionEEnum, GatewayDirection.MIXED); + + initEEnum(itemKindEEnum, ItemKind.class, "ItemKind"); + addEEnumLiteral(itemKindEEnum, ItemKind.PHYSICAL); + addEEnumLiteral(itemKindEEnum, ItemKind.INFORMATION); + + initEEnum(multiInstanceBehaviorEEnum, MultiInstanceBehavior.class, "MultiInstanceBehavior"); + addEEnumLiteral(multiInstanceBehaviorEEnum, MultiInstanceBehavior.NONE); + addEEnumLiteral(multiInstanceBehaviorEEnum, MultiInstanceBehavior.ONE); + addEEnumLiteral(multiInstanceBehaviorEEnum, MultiInstanceBehavior.ALL); + addEEnumLiteral(multiInstanceBehaviorEEnum, MultiInstanceBehavior.COMPLEX); + + initEEnum(processTypeEEnum, ProcessType.class, "ProcessType"); + addEEnumLiteral(processTypeEEnum, ProcessType.NONE); + addEEnumLiteral(processTypeEEnum, ProcessType.PUBLIC); + addEEnumLiteral(processTypeEEnum, ProcessType.PRIVATE); + + initEEnum(relationshipDirectionEEnum, RelationshipDirection.class, "RelationshipDirection"); + addEEnumLiteral(relationshipDirectionEEnum, RelationshipDirection.NONE); + addEEnumLiteral(relationshipDirectionEEnum, RelationshipDirection.FORWARD); + addEEnumLiteral(relationshipDirectionEEnum, RelationshipDirection.BACKWARD); + addEEnumLiteral(relationshipDirectionEEnum, RelationshipDirection.BOTH); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http:///org/eclipse/emf/ecore/util/ExtendedMetaData + createExtendedMetaDataAnnotations(); + } + + /** + * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. + * + * + * @generated + */ + protected void createExtendedMetaDataAnnotations() { + String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; + addAnnotation(documentRootEClass, source, new String[] { "name", "", "kind", "mixed" }); + addAnnotation(getDocumentRoot_Mixed(), source, new String[] { "kind", "elementWildcard", "name", ":mixed" }); + addAnnotation(getDocumentRoot_XMLNSPrefixMap(), source, + new String[] { "kind", "attribute", "name", "xmlns:prefix" }); + addAnnotation(getDocumentRoot_XSISchemaLocation(), source, + new String[] { "kind", "attribute", "name", "xsi:schemaLocation" }); + addAnnotation(getDocumentRoot_Activity(), source, new String[] { "kind", "element", "name", "activity", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_AdHocSubProcess(), source, + new String[] { "kind", "element", "name", "adHocSubProcess", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_FlowElement(), source, new String[] { "kind", "element", "name", "flowElement", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_Artifact(), source, new String[] { "kind", "element", "name", "artifact", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_Assignment(), source, new String[] { "kind", "element", "name", "assignment", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_Association(), source, + new String[] { "kind", "element", "name", "association", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#artifact" }); + addAnnotation(getDocumentRoot_Auditing(), source, new String[] { "kind", "element", "name", "auditing", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_BaseElement(), source, new String[] { "kind", "element", "name", "baseElement", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_BaseElementWithMixedContent(), source, new String[] { "kind", "element", "name", + "baseElementWithMixedContent", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_BoundaryEvent(), source, + new String[] { "kind", "element", "name", "boundaryEvent", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_BusinessRuleTask(), source, + new String[] { "kind", "element", "name", "businessRuleTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_CallableElement(), source, new String[] { "kind", "element", "name", + "callableElement", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_CallActivity(), source, + new String[] { "kind", "element", "name", "callActivity", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_CallChoreography(), source, + new String[] { "kind", "element", "name", "callChoreography", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_CallConversation(), source, + new String[] { "kind", "element", "name", "callConversation", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#conversationNode" }); + addAnnotation(getDocumentRoot_ConversationNode(), source, new String[] { "kind", "element", "name", + "conversationNode", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_CancelEventDefinition(), source, + new String[] { "kind", "element", "name", "cancelEventDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition" }); + addAnnotation(getDocumentRoot_EventDefinition(), source, + new String[] { "kind", "element", "name", "eventDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_RootElement(), source, new String[] { "kind", "element", "name", "rootElement", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_CatchEvent(), source, new String[] { "kind", "element", "name", "catchEvent", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_Category(), source, + new String[] { "kind", "element", "name", "category", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_CategoryValue(), source, new String[] { "kind", "element", "name", + "categoryValue", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_Choreography(), source, + new String[] { "kind", "element", "name", "choreography", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#collaboration" }); + addAnnotation(getDocumentRoot_Collaboration(), source, + new String[] { "kind", "element", "name", "collaboration", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_ChoreographyActivity(), source, new String[] { "kind", "element", "name", + "choreographyActivity", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ChoreographyTask(), source, + new String[] { "kind", "element", "name", "choreographyTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_CompensateEventDefinition(), source, + new String[] { "kind", "element", "name", "compensateEventDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition" }); + addAnnotation(getDocumentRoot_ComplexBehaviorDefinition(), source, new String[] { "kind", "element", "name", + "complexBehaviorDefinition", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ComplexGateway(), source, + new String[] { "kind", "element", "name", "complexGateway", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_ConditionalEventDefinition(), source, + new String[] { "kind", "element", "name", "conditionalEventDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition" }); + addAnnotation(getDocumentRoot_Conversation(), source, + new String[] { "kind", "element", "name", "conversation", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#conversationNode" }); + addAnnotation(getDocumentRoot_ConversationAssociation(), source, new String[] { "kind", "element", "name", + "conversationAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ConversationLink(), source, new String[] { "kind", "element", "name", + "conversationLink", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_CorrelationKey(), source, new String[] { "kind", "element", "name", + "correlationKey", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_CorrelationProperty(), source, + new String[] { "kind", "element", "name", "correlationProperty", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_CorrelationPropertyBinding(), source, new String[] { "kind", "element", "name", + "correlationPropertyBinding", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_CorrelationPropertyRetrievalExpression(), source, + new String[] { "kind", "element", "name", "correlationPropertyRetrievalExpression", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_CorrelationSubscription(), source, new String[] { "kind", "element", "name", + "correlationSubscription", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_DataAssociation(), source, new String[] { "kind", "element", "name", + "dataAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_DataInput(), source, new String[] { "kind", "element", "name", "dataInput", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_DataInputAssociation(), source, new String[] { "kind", "element", "name", + "dataInputAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_DataObject(), source, + new String[] { "kind", "element", "name", "dataObject", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_DataObjectReference(), source, + new String[] { "kind", "element", "name", "dataObjectReference", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_DataOutput(), source, new String[] { "kind", "element", "name", "dataOutput", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_DataOutputAssociation(), source, new String[] { "kind", "element", "name", + "dataOutputAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_DataState(), source, new String[] { "kind", "element", "name", "dataState", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_DataStore(), source, + new String[] { "kind", "element", "name", "dataStore", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_DataStoreReference(), source, + new String[] { "kind", "element", "name", "dataStoreReference", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_Definitions(), source, new String[] { "kind", "element", "name", "definitions", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_Documentation(), source, new String[] { "kind", "element", "name", + "documentation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_EndEvent(), source, + new String[] { "kind", "element", "name", "endEvent", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_EndPoint(), source, + new String[] { "kind", "element", "name", "endPoint", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_Error(), source, + new String[] { "kind", "element", "name", "error", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_ErrorEventDefinition(), source, + new String[] { "kind", "element", "name", "errorEventDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition" }); + addAnnotation(getDocumentRoot_Escalation(), source, + new String[] { "kind", "element", "name", "escalation", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_EscalationEventDefinition(), source, + new String[] { "kind", "element", "name", "escalationEventDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition" }); + addAnnotation(getDocumentRoot_Event(), source, + new String[] { "kind", "element", "name", "event", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_EventBasedGateway(), source, + new String[] { "kind", "element", "name", "eventBasedGateway", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_ExclusiveGateway(), source, + new String[] { "kind", "element", "name", "exclusiveGateway", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_Expression(), source, new String[] { "kind", "element", "name", "expression", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_Extension(), source, new String[] { "kind", "element", "name", "extension", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ExtensionElements(), source, new String[] { "kind", "element", "name", + "extensionElements", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_FlowNode(), source, new String[] { "kind", "element", "name", "flowNode", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_FormalExpression(), source, + new String[] { "kind", "element", "name", "formalExpression", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#expression" }); + addAnnotation(getDocumentRoot_Gateway(), source, new String[] { "kind", "element", "name", "gateway", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_GlobalBusinessRuleTask(), source, + new String[] { "kind", "element", "name", "globalBusinessRuleTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_GlobalChoreographyTask(), source, + new String[] { "kind", "element", "name", "globalChoreographyTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#choreography" }); + addAnnotation(getDocumentRoot_GlobalConversation(), source, + new String[] { "kind", "element", "name", "globalConversation", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#collaboration" }); + addAnnotation(getDocumentRoot_GlobalManualTask(), source, + new String[] { "kind", "element", "name", "globalManualTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_GlobalScriptTask(), source, + new String[] { "kind", "element", "name", "globalScriptTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_GlobalTask(), source, + new String[] { "kind", "element", "name", "globalTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_GlobalUserTask(), source, + new String[] { "kind", "element", "name", "globalUserTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_Group(), source, + new String[] { "kind", "element", "name", "group", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#artifact" }); + addAnnotation(getDocumentRoot_HumanPerformer(), source, + new String[] { "kind", "element", "name", "humanPerformer", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#performer" }); + addAnnotation(getDocumentRoot_Performer(), source, + new String[] { "kind", "element", "name", "performer", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#resourceRole" }); + addAnnotation(getDocumentRoot_ResourceRole(), source, new String[] { "kind", "element", "name", "resourceRole", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ImplicitThrowEvent(), source, + new String[] { "kind", "element", "name", "implicitThrowEvent", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_Import(), source, new String[] { "kind", "element", "name", "import", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_InclusiveGateway(), source, + new String[] { "kind", "element", "name", "inclusiveGateway", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_InputSet(), source, new String[] { "kind", "element", "name", "inputSet", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_Interface(), source, + new String[] { "kind", "element", "name", "interface", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_IntermediateCatchEvent(), source, + new String[] { "kind", "element", "name", "intermediateCatchEvent", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_IntermediateThrowEvent(), source, + new String[] { "kind", "element", "name", "intermediateThrowEvent", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_IoBinding(), source, new String[] { "kind", "element", "name", "ioBinding", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_IoSpecification(), source, new String[] { "kind", "element", "name", + "ioSpecification", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ItemDefinition(), source, + new String[] { "kind", "element", "name", "itemDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_Lane(), source, new String[] { "kind", "element", "name", "lane", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_LaneSet(), source, new String[] { "kind", "element", "name", "laneSet", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_LinkEventDefinition(), source, + new String[] { "kind", "element", "name", "linkEventDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition" }); + addAnnotation(getDocumentRoot_LoopCharacteristics(), source, new String[] { "kind", "element", "name", + "loopCharacteristics", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ManualTask(), source, + new String[] { "kind", "element", "name", "manualTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_Message(), source, + new String[] { "kind", "element", "name", "message", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_MessageEventDefinition(), source, + new String[] { "kind", "element", "name", "messageEventDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition" }); + addAnnotation(getDocumentRoot_MessageFlow(), source, new String[] { "kind", "element", "name", "messageFlow", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_MessageFlowAssociation(), source, new String[] { "kind", "element", "name", + "messageFlowAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_Monitoring(), source, new String[] { "kind", "element", "name", "monitoring", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_MultiInstanceLoopCharacteristics(), source, + new String[] { "kind", "element", "name", "multiInstanceLoopCharacteristics", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#loopCharacteristics" }); + addAnnotation(getDocumentRoot_Operation(), source, new String[] { "kind", "element", "name", "operation", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_OutputSet(), source, new String[] { "kind", "element", "name", "outputSet", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ParallelGateway(), source, + new String[] { "kind", "element", "name", "parallelGateway", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_Participant(), source, new String[] { "kind", "element", "name", "participant", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ParticipantAssociation(), source, new String[] { "kind", "element", "name", + "participantAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ParticipantMultiplicity(), source, new String[] { "kind", "element", "name", + "participantMultiplicity", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_PartnerEntity(), source, + new String[] { "kind", "element", "name", "partnerEntity", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_PartnerRole(), source, + new String[] { "kind", "element", "name", "partnerRole", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_PotentialOwner(), source, + new String[] { "kind", "element", "name", "potentialOwner", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#performer" }); + addAnnotation(getDocumentRoot_Process(), source, + new String[] { "kind", "element", "name", "process", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_Property(), source, new String[] { "kind", "element", "name", "property", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ReceiveTask(), source, + new String[] { "kind", "element", "name", "receiveTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_Relationship(), source, new String[] { "kind", "element", "name", "relationship", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_Rendering(), source, new String[] { "kind", "element", "name", "rendering", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_Resource(), source, + new String[] { "kind", "element", "name", "resource", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_ResourceAssignmentExpression(), source, new String[] { "kind", "element", "name", + "resourceAssignmentExpression", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ResourceParameter(), source, new String[] { "kind", "element", "name", + "resourceParameter", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ResourceParameterBinding(), source, new String[] { "kind", "element", "name", + "resourceParameterBinding", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_Script(), source, new String[] { "kind", "element", "name", "script", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_ScriptTask(), source, + new String[] { "kind", "element", "name", "scriptTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_SendTask(), source, + new String[] { "kind", "element", "name", "sendTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_SequenceFlow(), source, + new String[] { "kind", "element", "name", "sequenceFlow", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_ServiceTask(), source, + new String[] { "kind", "element", "name", "serviceTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_Signal(), source, + new String[] { "kind", "element", "name", "signal", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDocumentRoot_SignalEventDefinition(), source, + new String[] { "kind", "element", "name", "signalEventDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition" }); + addAnnotation(getDocumentRoot_StandardLoopCharacteristics(), source, + new String[] { "kind", "element", "name", "standardLoopCharacteristics", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#loopCharacteristics" }); + addAnnotation(getDocumentRoot_StartEvent(), source, + new String[] { "kind", "element", "name", "startEvent", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_SubChoreography(), source, + new String[] { "kind", "element", "name", "subChoreography", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_SubConversation(), source, + new String[] { "kind", "element", "name", "subConversation", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#conversationNode" }); + addAnnotation(getDocumentRoot_SubProcess(), source, + new String[] { "kind", "element", "name", "subProcess", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_Task(), source, + new String[] { "kind", "element", "name", "task", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_TerminateEventDefinition(), source, + new String[] { "kind", "element", "name", "terminateEventDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition" }); + addAnnotation(getDocumentRoot_Text(), source, new String[] { "kind", "element", "name", "text", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_TextAnnotation(), source, + new String[] { "kind", "element", "name", "textAnnotation", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_ThrowEvent(), source, new String[] { "kind", "element", "name", "throwEvent", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDocumentRoot_TimerEventDefinition(), source, + new String[] { "kind", "element", "name", "timerEventDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition" }); + addAnnotation(getDocumentRoot_Transaction(), source, + new String[] { "kind", "element", "name", "transaction", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_UserTask(), source, + new String[] { "kind", "element", "name", "userTask", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(getDocumentRoot_EventSubProcess(), source, + new String[] { "kind", "element", "name", "subProcess", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "affiliation", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(activityEClass, source, + new String[] { "name", "tActivity", "kind", "elementOnly", "abstract", "true" }); + addAnnotation(getActivity_IoSpecification(), source, new String[] { "kind", "element", "name", + "ioSpecification", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getActivity_Properties(), source, new String[] { "kind", "element", "name", "property", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getActivity_DataInputAssociations(), source, new String[] { "kind", "element", "name", + "dataInputAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getActivity_DataOutputAssociations(), source, new String[] { "kind", "element", "name", + "dataOutputAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getActivity_Resources(), source, + new String[] { "kind", "element", "name", "resourceRole", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#resourceRole" }); + addAnnotation(getActivity_LoopCharacteristics(), source, + new String[] { "kind", "element", "name", "loopCharacteristics", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#loopCharacteristics" }); + addAnnotation(getActivity_CompletionQuantity(), source, + new String[] { "kind", "attribute", "name", "completionQuantity" }); + addAnnotation(getActivity_Default(), source, new String[] { "kind", "attribute", "name", "default" }); + addAnnotation(getActivity_IsForCompensation(), source, + new String[] { "kind", "attribute", "name", "isForCompensation" }); + addAnnotation(getActivity_StartQuantity(), source, + new String[] { "kind", "attribute", "name", "startQuantity" }); + addAnnotation(adHocOrderingEEnum, source, new String[] { "name", "tAdHocOrdering" }); + addAnnotation(adHocSubProcessEClass, source, + new String[] { "name", "tAdHocSubProcess", "kind", "elementOnly" }); + addAnnotation(getAdHocSubProcess_CompletionCondition(), source, new String[] { "kind", "element", "name", + "completionCondition", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getAdHocSubProcess_CancelRemainingInstances(), source, + new String[] { "kind", "attribute", "name", "cancelRemainingInstances" }); + addAnnotation(getAdHocSubProcess_Ordering(), source, new String[] { "kind", "attribute", "name", "ordering" }); + addAnnotation(artifactEClass, source, + new String[] { "name", "tArtifact", "kind", "elementOnly", "abstract", "true" }); + addAnnotation(assignmentEClass, source, new String[] { "name", "tAssignment", "kind", "elementOnly" }); + addAnnotation(getAssignment_From(), source, new String[] { "kind", "element", "name", "from", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getAssignment_To(), source, new String[] { "kind", "element", "name", "to", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(associationEClass, source, new String[] { "name", "tAssociation", "kind", "elementOnly" }); + addAnnotation(getAssociation_AssociationDirection(), source, + new String[] { "kind", "attribute", "name", "associationDirection" }); + addAnnotation(getAssociation_SourceRef(), source, new String[] { "kind", "attribute", "name", "sourceRef" }); + addAnnotation(getAssociation_TargetRef(), source, new String[] { "kind", "attribute", "name", "targetRef" }); + addAnnotation(associationDirectionEEnum, source, new String[] { "name", "tAssociationDirection" }); + addAnnotation(auditingEClass, source, new String[] { "name", "tAuditing", "kind", "elementOnly" }); + addAnnotation(baseElementEClass, source, + new String[] { "name", "tBaseElement", "kind", "elementOnly", "abstract", "true" }); + addAnnotation(getBaseElement_Documentation(), source, new String[] { "kind", "element", "name", "documentation", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getBaseElement_ExtensionValues(), source, new String[] { "kind", "element", "name", + "extensionElements", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getBaseElement_Id(), source, new String[] { "kind", "attribute", "name", "id" }); + addAnnotation(getBaseElement_AnyAttribute(), source, new String[] { "kind", "attributeWildcard", "wildcards", + "##other", "name", ":3", "processing", "lax" }); + addAnnotation(boundaryEventEClass, source, new String[] { "name", "tBoundaryEvent", "kind", "elementOnly" }); + addAnnotation(getBoundaryEvent_AttachedToRef(), source, + new String[] { "kind", "attribute", "name", "attachedToRef" }); + addAnnotation(getBoundaryEvent_CancelActivity(), source, + new String[] { "kind", "attribute", "name", "cancelActivity" }); + addAnnotation(businessRuleTaskEClass, source, + new String[] { "name", "tBusinessRuleTask", "kind", "elementOnly" }); + addAnnotation(getBusinessRuleTask_Implementation(), source, + new String[] { "kind", "attribute", "name", "implementation" }); + addAnnotation(callActivityEClass, source, new String[] { "name", "tCallActivity", "kind", "elementOnly" }); + addAnnotation(callChoreographyEClass, source, + new String[] { "name", "tCallChoreography", "kind", "elementOnly" }); + addAnnotation(getCallChoreography_ParticipantAssociations(), source, new String[] { "kind", "element", "name", + "participantAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCallChoreography_CalledChoreographyRef(), source, + new String[] { "kind", "attribute", "name", "calledChoreographyRef" }); + addAnnotation(callConversationEClass, source, + new String[] { "name", "tCallConversation", "kind", "elementOnly" }); + addAnnotation(getCallConversation_ParticipantAssociations(), source, new String[] { "kind", "element", "name", + "participantAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCallConversation_CalledCollaborationRef(), source, + new String[] { "kind", "attribute", "name", "calledCollaborationRef" }); + addAnnotation(callableElementEClass, source, + new String[] { "name", "tCallableElement", "kind", "elementOnly", "abstract", "true" }); + addAnnotation(getCallableElement_SupportedInterfaceRefs(), source, new String[] { "kind", "element", "name", + "supportedInterfaceRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCallableElement_IoSpecification(), source, new String[] { "kind", "element", "name", + "ioSpecification", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCallableElement_IoBinding(), source, new String[] { "kind", "element", "name", "ioBinding", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCallableElement_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(cancelEventDefinitionEClass, source, + new String[] { "name", "tCancelEventDefinition", "kind", "elementOnly" }); + addAnnotation(catchEventEClass, source, new String[] { "name", "tCatchEvent", "kind", "elementOnly" }); + addAnnotation(getCatchEvent_DataOutputs(), source, new String[] { "kind", "element", "name", "dataOutput", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCatchEvent_DataOutputAssociation(), source, new String[] { "kind", "element", "name", + "dataOutputAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCatchEvent_OutputSet(), source, new String[] { "kind", "element", "name", "outputSet", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCatchEvent_EventDefinitions(), source, + new String[] { "kind", "element", "name", "eventDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition" }); + addAnnotation(getCatchEvent_EventDefinitionRefs(), source, new String[] { "kind", "element", "name", + "eventDefinitionRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCatchEvent_ParallelMultiple(), source, + new String[] { "kind", "attribute", "name", "parallelMultiple" }); + addAnnotation(categoryEClass, source, new String[] { "name", "tCategory", "kind", "elementOnly" }); + addAnnotation(getCategory_CategoryValue(), source, new String[] { "kind", "element", "name", "categoryValue", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCategory_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(categoryValueEClass, source, new String[] { "name", "tCategoryValue", "kind", "elementOnly" }); + addAnnotation(getCategoryValue_Value(), source, new String[] { "kind", "attribute", "name", "value" }); + addAnnotation(choreographyEClass, source, new String[] { "name", "tChoreography", "kind", "elementOnly" }); + addAnnotation(choreographyActivityEClass, source, + new String[] { "name", "tChoreographyActivity", "kind", "elementOnly" }); + addAnnotation(getChoreographyActivity_ParticipantRefs(), source, new String[] { "kind", "element", "name", + "participantRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getChoreographyActivity_CorrelationKeys(), source, new String[] { "kind", "element", "name", + "correlationKey", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getChoreographyActivity_InitiatingParticipantRef(), source, + new String[] { "kind", "attribute", "name", "initiatingParticipantRef" }); + addAnnotation(getChoreographyActivity_LoopType(), source, + new String[] { "kind", "attribute", "name", "loopType" }); + addAnnotation(choreographyLoopTypeEEnum, source, new String[] { "name", "tChoreographyLoopType" }); + addAnnotation(choreographyTaskEClass, source, + new String[] { "name", "tChoreographyTask", "kind", "elementOnly" }); + addAnnotation(getChoreographyTask_MessageFlowRef(), source, new String[] { "kind", "element", "name", + "messageFlowRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(collaborationEClass, source, new String[] { "name", "tCollaboration", "kind", "elementOnly" }); + addAnnotation(getCollaboration_Participants(), source, new String[] { "kind", "element", "name", "participant", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCollaboration_MessageFlows(), source, new String[] { "kind", "element", "name", "messageFlow", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCollaboration_Artifacts(), source, + new String[] { "kind", "element", "name", "artifact", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#artifact" }); + addAnnotation(getCollaboration_Conversations(), source, + new String[] { "kind", "element", "name", "conversationNode", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#conversationNode" }); + addAnnotation(getCollaboration_ConversationAssociations(), source, new String[] { "kind", "element", "name", + "conversationAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCollaboration_ParticipantAssociations(), source, new String[] { "kind", "element", "name", + "participantAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCollaboration_MessageFlowAssociations(), source, new String[] { "kind", "element", "name", + "messageFlowAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCollaboration_CorrelationKeys(), source, new String[] { "kind", "element", "name", + "correlationKey", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCollaboration_ChoreographyRef(), source, new String[] { "kind", "element", "name", + "choreographyRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCollaboration_ConversationLinks(), source, new String[] { "kind", "element", "name", + "conversationLink", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCollaboration_IsClosed(), source, new String[] { "kind", "attribute", "name", "isClosed" }); + addAnnotation(getCollaboration_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(compensateEventDefinitionEClass, source, + new String[] { "name", "tCompensateEventDefinition", "kind", "elementOnly" }); + addAnnotation(getCompensateEventDefinition_ActivityRef(), source, + new String[] { "kind", "attribute", "name", "activityRef" }); + addAnnotation(getCompensateEventDefinition_WaitForCompletion(), source, + new String[] { "kind", "attribute", "name", "waitForCompletion" }); + addAnnotation(complexBehaviorDefinitionEClass, source, + new String[] { "name", "tComplexBehaviorDefinition", "kind", "elementOnly" }); + addAnnotation(getComplexBehaviorDefinition_Condition(), source, new String[] { "kind", "element", "name", + "condition", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getComplexBehaviorDefinition_Event(), source, new String[] { "kind", "element", "name", "event", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(complexGatewayEClass, source, new String[] { "name", "tComplexGateway", "kind", "elementOnly" }); + addAnnotation(getComplexGateway_ActivationCondition(), source, new String[] { "kind", "element", "name", + "activationCondition", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getComplexGateway_Default(), source, new String[] { "kind", "attribute", "name", "default" }); + addAnnotation(conditionalEventDefinitionEClass, source, + new String[] { "name", "tConditionalEventDefinition", "kind", "elementOnly" }); + addAnnotation(getConditionalEventDefinition_Condition(), source, new String[] { "kind", "element", "name", + "condition", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(conversationEClass, source, new String[] { "name", "tConversation", "kind", "elementOnly" }); + addAnnotation(conversationAssociationEClass, source, + new String[] { "name", "tConversationAssociation", "kind", "elementOnly" }); + addAnnotation(getConversationAssociation_InnerConversationNodeRef(), source, + new String[] { "kind", "attribute", "name", "innerConversationNodeRef" }); + addAnnotation(getConversationAssociation_OuterConversationNodeRef(), source, + new String[] { "kind", "attribute", "name", "outerConversationNodeRef" }); + addAnnotation(conversationLinkEClass, source, + new String[] { "name", "tConversationLink", "kind", "elementOnly" }); + addAnnotation(getConversationLink_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getConversationLink_SourceRef(), source, + new String[] { "kind", "attribute", "name", "sourceRef" }); + addAnnotation(getConversationLink_TargetRef(), source, + new String[] { "kind", "attribute", "name", "targetRef" }); + addAnnotation(conversationNodeEClass, source, + new String[] { "name", "tConversationNode", "kind", "elementOnly", "abstract", "true" }); + addAnnotation(getConversationNode_ParticipantRefs(), source, new String[] { "kind", "element", "name", + "participantRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getConversationNode_MessageFlowRefs(), source, new String[] { "kind", "element", "name", + "messageFlowRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getConversationNode_CorrelationKeys(), source, new String[] { "kind", "element", "name", + "correlationKey", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getConversationNode_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(correlationKeyEClass, source, new String[] { "name", "tCorrelationKey", "kind", "elementOnly" }); + addAnnotation(getCorrelationKey_CorrelationPropertyRef(), source, new String[] { "kind", "element", "name", + "correlationPropertyRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCorrelationKey_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(correlationPropertyEClass, source, + new String[] { "name", "tCorrelationProperty", "kind", "elementOnly" }); + addAnnotation(getCorrelationProperty_CorrelationPropertyRetrievalExpression(), source, + new String[] { "kind", "element", "name", "correlationPropertyRetrievalExpression", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCorrelationProperty_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getCorrelationProperty_Type(), source, new String[] { "kind", "attribute", "name", "type" }); + addAnnotation(correlationPropertyBindingEClass, source, + new String[] { "name", "tCorrelationPropertyBinding", "kind", "elementOnly" }); + addAnnotation(getCorrelationPropertyBinding_DataPath(), source, new String[] { "kind", "element", "name", + "dataPath", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCorrelationPropertyBinding_CorrelationPropertyRef(), source, + new String[] { "kind", "attribute", "name", "correlationPropertyRef" }); + addAnnotation(correlationPropertyRetrievalExpressionEClass, source, + new String[] { "name", "tCorrelationPropertyRetrievalExpression", "kind", "elementOnly" }); + addAnnotation(getCorrelationPropertyRetrievalExpression_MessagePath(), source, new String[] { "kind", "element", + "name", "messagePath", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCorrelationPropertyRetrievalExpression_MessageRef(), source, + new String[] { "kind", "attribute", "name", "messageRef" }); + addAnnotation(correlationSubscriptionEClass, source, + new String[] { "name", "tCorrelationSubscription", "kind", "elementOnly" }); + addAnnotation(getCorrelationSubscription_CorrelationPropertyBinding(), source, new String[] { "kind", "element", + "name", "correlationPropertyBinding", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getCorrelationSubscription_CorrelationKeyRef(), source, + new String[] { "kind", "attribute", "name", "correlationKeyRef" }); + addAnnotation(dataAssociationEClass, source, + new String[] { "name", "tDataAssociation", "kind", "elementOnly" }); + addAnnotation(getDataAssociation_SourceRef(), source, new String[] { "kind", "element", "name", "sourceRef", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDataAssociation_TargetRef(), source, new String[] { "kind", "element", "name", "targetRef", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDataAssociation_Transformation(), source, new String[] { "kind", "element", "name", + "transformation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDataAssociation_Assignment(), source, new String[] { "kind", "element", "name", "assignment", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(dataInputEClass, source, new String[] { "name", "tDataInput", "kind", "elementOnly" }); + addAnnotation(getDataInput_IsCollection(), source, + new String[] { "kind", "attribute", "name", "isCollection" }); + addAnnotation(getDataInput_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(dataInputAssociationEClass, source, + new String[] { "name", "tDataInputAssociation", "kind", "elementOnly" }); + addAnnotation(dataObjectEClass, source, new String[] { "name", "tDataObject", "kind", "elementOnly" }); + addAnnotation(getDataObject_IsCollection(), source, + new String[] { "kind", "attribute", "name", "isCollection" }); + addAnnotation(dataObjectReferenceEClass, source, + new String[] { "name", "tDataObjectReference", "kind", "elementOnly" }); + addAnnotation(getDataObjectReference_DataObjectRef(), source, + new String[] { "kind", "attribute", "name", "dataObjectRef" }); + addAnnotation(dataOutputEClass, source, new String[] { "name", "tDataOutput", "kind", "elementOnly" }); + addAnnotation(getDataOutput_IsCollection(), source, + new String[] { "kind", "attribute", "name", "isCollection" }); + addAnnotation(getDataOutput_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(dataOutputAssociationEClass, source, + new String[] { "name", "tDataOutputAssociation", "kind", "elementOnly" }); + addAnnotation(dataStateEClass, source, new String[] { "name", "tDataState", "kind", "elementOnly" }); + addAnnotation(getDataState_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(dataStoreEClass, source, new String[] { "name", "tDataStore", "kind", "elementOnly" }); + addAnnotation(getDataStore_Capacity(), source, new String[] { "kind", "attribute", "name", "capacity" }); + addAnnotation(getDataStore_IsUnlimited(), source, new String[] { "kind", "attribute", "name", "isUnlimited" }); + addAnnotation(getDataStore_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(dataStoreReferenceEClass, source, + new String[] { "name", "tDataStoreReference", "kind", "elementOnly" }); + addAnnotation(getDataStoreReference_DataStoreRef(), source, + new String[] { "kind", "attribute", "name", "dataStoreRef" }); + addAnnotation(definitionsEClass, source, new String[] { "name", "tDefinitions", "kind", "elementOnly" }); + addAnnotation(getDefinitions_Imports(), source, new String[] { "kind", "element", "name", "import", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDefinitions_Extensions(), source, new String[] { "kind", "element", "name", "extension", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDefinitions_RootElements(), source, + new String[] { "kind", "element", "name", "rootElement", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#rootElement" }); + addAnnotation(getDefinitions_Diagrams(), source, new String[] { "kind", "element", "name", "BPMNDiagram", + "namespace", "http://www.omg.org/spec/BPMN/20100524/DI" }); + addAnnotation(getDefinitions_Relationships(), source, new String[] { "kind", "element", "name", "relationship", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getDefinitions_Exporter(), source, new String[] { "kind", "attribute", "name", "exporter" }); + addAnnotation(getDefinitions_ExporterVersion(), source, + new String[] { "kind", "attribute", "name", "exporterVersion" }); + addAnnotation(getDefinitions_ExpressionLanguage(), source, + new String[] { "kind", "attribute", "name", "expressionLanguage" }); + addAnnotation(getDefinitions_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getDefinitions_TargetNamespace(), source, + new String[] { "kind", "attribute", "name", "targetNamespace" }); + addAnnotation(getDefinitions_TypeLanguage(), source, + new String[] { "kind", "attribute", "name", "typeLanguage" }); + addAnnotation(documentationEClass, source, new String[] { "name", "tDocumentation", "kind", "mixed" }); + addAnnotation(getDocumentation_Mixed(), source, new String[] { "kind", "elementWildcard", "name", ":mixed" }); + addAnnotation(getDocumentation_TextFormat(), source, + new String[] { "kind", "attribute", "name", "textFormat" }); + addAnnotation(endEventEClass, source, new String[] { "name", "tEndEvent", "kind", "elementOnly" }); + addAnnotation(endPointEClass, source, new String[] { "name", "tEndPoint", "kind", "elementOnly" }); + addAnnotation(errorEClass, source, new String[] { "name", "tError", "kind", "elementOnly" }); + addAnnotation(getError_ErrorCode(), source, new String[] { "kind", "attribute", "name", "errorCode" }); + addAnnotation(getError_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getError_StructureRef(), source, new String[] { "kind", "attribute", "name", "structureRef" }); + addAnnotation(errorEventDefinitionEClass, source, + new String[] { "name", "tErrorEventDefinition", "kind", "elementOnly" }); + addAnnotation(getErrorEventDefinition_ErrorRef(), source, + new String[] { "kind", "attribute", "name", "errorRef" }); + addAnnotation(escalationEClass, source, new String[] { "name", "tEscalation", "kind", "elementOnly" }); + addAnnotation(getEscalation_EscalationCode(), source, + new String[] { "kind", "attribute", "name", "escalationCode" }); + addAnnotation(getEscalation_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getEscalation_StructureRef(), source, + new String[] { "kind", "attribute", "name", "structureRef" }); + addAnnotation(escalationEventDefinitionEClass, source, + new String[] { "name", "tEscalationEventDefinition", "kind", "elementOnly" }); + addAnnotation(getEscalationEventDefinition_EscalationRef(), source, + new String[] { "kind", "attribute", "name", "escalationRef" }); + addAnnotation(eventEClass, source, new String[] { "name", "tEvent", "kind", "elementOnly" }); + addAnnotation(getEvent_Properties(), source, new String[] { "kind", "element", "name", "property", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(eventBasedGatewayEClass, source, + new String[] { "name", "tEventBasedGateway", "kind", "elementOnly" }); + addAnnotation(getEventBasedGateway_EventGatewayType(), source, + new String[] { "kind", "attribute", "name", "eventGatewayType" }); + addAnnotation(getEventBasedGateway_Instantiate(), source, + new String[] { "kind", "attribute", "name", "instantiate" }); + addAnnotation(eventBasedGatewayTypeEEnum, source, new String[] { "name", "tEventBasedGatewayType" }); + addAnnotation(eventDefinitionEClass, source, + new String[] { "name", "tEventDefinition", "kind", "elementOnly", "abstract", "true" }); + addAnnotation(exclusiveGatewayEClass, source, + new String[] { "name", "tExclusiveGateway", "kind", "elementOnly" }); + addAnnotation(getExclusiveGateway_Default(), source, new String[] { "kind", "attribute", "name", "default" }); + addAnnotation(expressionEClass, source, new String[] { "name", "tExpression", "kind", "mixed" }); + addAnnotation(extensionEClass, source, new String[] { "name", "tExtension", "kind", "elementOnly" }); + addAnnotation(getExtension_MustUnderstand(), source, + new String[] { "kind", "attribute", "name", "mustUnderstand" }); + addAnnotation(getExtension_XsdDefinition(), source, new String[] { "kind", "attribute", "name", "definition" }); + addAnnotation(extensionAttributeValueEClass, source, + new String[] { "name", "tExtensionElements", "kind", "elementOnly" }); + addAnnotation(getExtensionAttributeValue_Value(), source, + new String[] { "kind", "elementWildcard", "wildcards", "##other", "name", ":0", "processing", "lax" }); + addAnnotation(flowElementEClass, source, new String[] { "name", "tFlowElement", "kind", "elementOnly" }); + addAnnotation(getFlowElement_Auditing(), source, new String[] { "kind", "element", "name", "auditing", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getFlowElement_Monitoring(), source, new String[] { "kind", "element", "name", "monitoring", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getFlowElement_CategoryValueRef(), source, new String[] { "kind", "element", "name", + "categoryValueRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getFlowElement_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getFlowElementsContainer_LaneSets(), source, new String[] { "kind", "element", "name", "laneSet", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getFlowElementsContainer_FlowElements(), source, + new String[] { "kind", "element", "name", "flowElement", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#flowElement" }); + addAnnotation(flowNodeEClass, source, new String[] { "name", "tFlowNode", "kind", "elementOnly" }); + addAnnotation(getFlowNode_Incoming(), source, new String[] { "kind", "element", "name", "incoming", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getFlowNode_Outgoing(), source, new String[] { "kind", "element", "name", "outgoing", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(formalExpressionEClass, source, new String[] { "name", "tFormalExpression", "kind", "mixed" }); + addAnnotation(getFormalExpression_Mixed(), source, + new String[] { "kind", "elementWildcard", "name", ":mixed" }); + addAnnotation(getFormalExpression_EvaluatesToTypeRef(), source, + new String[] { "kind", "attribute", "name", "evaluatesToTypeRef" }); + addAnnotation(getFormalExpression_Language(), source, new String[] { "kind", "attribute", "name", "language" }); + addAnnotation(gatewayEClass, source, new String[] { "name", "tGateway", "kind", "elementOnly" }); + addAnnotation(getGateway_GatewayDirection(), source, + new String[] { "kind", "attribute", "name", "gatewayDirection" }); + addAnnotation(gatewayDirectionEEnum, source, new String[] { "name", "tGatewayDirection" }); + addAnnotation(globalBusinessRuleTaskEClass, source, + new String[] { "name", "tGlobalBusinessRuleTask", "kind", "elementOnly" }); + addAnnotation(getGlobalBusinessRuleTask_Implementation(), source, + new String[] { "kind", "attribute", "name", "implementation" }); + addAnnotation(globalChoreographyTaskEClass, source, + new String[] { "name", "tGlobalChoreographyTask", "kind", "elementOnly" }); + addAnnotation(getGlobalChoreographyTask_InitiatingParticipantRef(), source, + new String[] { "kind", "attribute", "name", "initiatingParticipantRef" }); + addAnnotation(globalConversationEClass, source, + new String[] { "name", "tGlobalConversation", "kind", "elementOnly" }); + addAnnotation(globalManualTaskEClass, source, + new String[] { "name", "tGlobalManualTask", "kind", "elementOnly" }); + addAnnotation(globalScriptTaskEClass, source, + new String[] { "name", "tGlobalScriptTask", "kind", "elementOnly" }); + addAnnotation(getGlobalScriptTask_Script(), source, new String[] { "kind", "element", "name", "script", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getGlobalScriptTask_ScriptLanguage(), source, + new String[] { "kind", "attribute", "name", "scriptLanguage" }); + addAnnotation(globalTaskEClass, source, new String[] { "name", "tGlobalTask", "kind", "elementOnly" }); + addAnnotation(getGlobalTask_Resources(), source, + new String[] { "kind", "element", "name", "resourceRole", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#resourceRole" }); + addAnnotation(globalUserTaskEClass, source, new String[] { "name", "tGlobalUserTask", "kind", "elementOnly" }); + addAnnotation(getGlobalUserTask_Renderings(), source, new String[] { "kind", "element", "name", "rendering", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getGlobalUserTask_Implementation(), source, + new String[] { "kind", "attribute", "name", "implementation" }); + addAnnotation(groupEClass, source, new String[] { "name", "tGroup", "kind", "elementOnly" }); + addAnnotation(getGroup_CategoryValueRef(), source, + new String[] { "kind", "attribute", "name", "categoryValueRef" }); + addAnnotation(humanPerformerEClass, source, new String[] { "name", "tHumanPerformer", "kind", "elementOnly" }); + addAnnotation(implicitThrowEventEClass, source, + new String[] { "name", "tImplicitThrowEvent", "kind", "elementOnly" }); + addAnnotation(importEClass, source, new String[] { "name", "tImport", "kind", "empty" }); + addAnnotation(getImport_ImportType(), source, new String[] { "kind", "attribute", "name", "importType" }); + addAnnotation(getImport_Location(), source, new String[] { "kind", "attribute", "name", "location" }); + addAnnotation(getImport_Namespace(), source, new String[] { "kind", "attribute", "name", "namespace" }); + addAnnotation(inclusiveGatewayEClass, source, + new String[] { "name", "tInclusiveGateway", "kind", "elementOnly" }); + addAnnotation(getInclusiveGateway_Default(), source, new String[] { "kind", "attribute", "name", "default" }); + addAnnotation(inputOutputBindingEClass, source, + new String[] { "name", "tInputOutputBinding", "kind", "elementOnly" }); + addAnnotation(getInputOutputBinding_InputDataRef(), source, + new String[] { "kind", "attribute", "name", "inputDataRef" }); + addAnnotation(getInputOutputBinding_OperationRef(), source, + new String[] { "kind", "attribute", "name", "operationRef" }); + addAnnotation(getInputOutputBinding_OutputDataRef(), source, + new String[] { "kind", "attribute", "name", "outputDataRef" }); + addAnnotation(inputOutputSpecificationEClass, source, + new String[] { "name", "tInputOutputSpecification", "kind", "elementOnly" }); + addAnnotation(getInputOutputSpecification_DataInputs(), source, new String[] { "kind", "element", "name", + "dataInput", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getInputOutputSpecification_DataOutputs(), source, new String[] { "kind", "element", "name", + "dataOutput", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getInputOutputSpecification_InputSets(), source, new String[] { "kind", "element", "name", + "inputSet", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getInputOutputSpecification_OutputSets(), source, new String[] { "kind", "element", "name", + "outputSet", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(inputSetEClass, source, new String[] { "name", "tInputSet", "kind", "elementOnly" }); + addAnnotation(getInputSet_DataInputRefs(), source, new String[] { "kind", "element", "name", "dataInputRefs", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getInputSet_OptionalInputRefs(), source, new String[] { "kind", "element", "name", + "optionalInputRefs", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getInputSet_WhileExecutingInputRefs(), source, new String[] { "kind", "element", "name", + "whileExecutingInputRefs", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getInputSet_OutputSetRefs(), source, new String[] { "kind", "element", "name", "outputSetRefs", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getInputSet_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(interactionNodeEClass, source, new String[] { "abstract", "true" }); + addAnnotation(interfaceEClass, source, new String[] { "name", "tInterface", "kind", "elementOnly" }); + addAnnotation(getInterface_Operations(), source, new String[] { "kind", "element", "name", "operation", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getInterface_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getInterface_ImplementationRef(), source, + new String[] { "kind", "attribute", "name", "implementationRef" }); + addAnnotation(intermediateCatchEventEClass, source, + new String[] { "name", "tIntermediateCatchEvent", "kind", "elementOnly" }); + addAnnotation(intermediateThrowEventEClass, source, + new String[] { "name", "tIntermediateThrowEvent", "kind", "elementOnly" }); + addAnnotation(getItemAwareElement_DataState(), source, new String[] { "kind", "element", "name", "dataState", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getItemAwareElement_ItemSubjectRef(), source, + new String[] { "kind", "attribute", "name", "itemSubjectRef" }); + addAnnotation(itemDefinitionEClass, source, new String[] { "name", "tItemDefinition", "kind", "elementOnly" }); + addAnnotation(getItemDefinition_IsCollection(), source, + new String[] { "kind", "attribute", "name", "isCollection" }); + addAnnotation(getItemDefinition_ItemKind(), source, new String[] { "kind", "attribute", "name", "itemKind" }); + addAnnotation(getItemDefinition_StructureRef(), source, + new String[] { "kind", "attribute", "name", "structureRef" }); + addAnnotation(itemKindEEnum, source, new String[] { "name", "tItemKind" }); + addAnnotation(laneEClass, source, new String[] { "name", "tLane", "kind", "elementOnly" }); + addAnnotation(getLane_PartitionElement(), source, new String[] { "kind", "element", "name", "partitionElement", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getLane_FlowNodeRefs(), source, new String[] { "kind", "element", "name", "flowNodeRef", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getLane_ChildLaneSet(), source, new String[] { "kind", "element", "name", "childLaneSet", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getLane_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getLane_PartitionElementRef(), source, + new String[] { "kind", "attribute", "name", "partitionElementRef" }); + addAnnotation(laneSetEClass, source, new String[] { "name", "tLaneSet", "kind", "elementOnly" }); + addAnnotation(getLaneSet_Lanes(), source, new String[] { "kind", "element", "name", "lane", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getLaneSet_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(linkEventDefinitionEClass, source, + new String[] { "name", "tLinkEventDefinition", "kind", "elementOnly" }); + addAnnotation(getLinkEventDefinition_Source(), source, new String[] { "kind", "element", "name", "source", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getLinkEventDefinition_Target(), source, new String[] { "kind", "element", "name", "target", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getLinkEventDefinition_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(loopCharacteristicsEClass, source, + new String[] { "name", "tLoopCharacteristics", "kind", "elementOnly" }); + addAnnotation(manualTaskEClass, source, new String[] { "name", "tManualTask", "kind", "elementOnly" }); + addAnnotation(messageEClass, source, new String[] { "name", "tMessage", "kind", "elementOnly" }); + addAnnotation(getMessage_ItemRef(), source, new String[] { "kind", "attribute", "name", "itemRef" }); + addAnnotation(getMessage_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(messageEventDefinitionEClass, source, + new String[] { "name", "tMessageEventDefinition", "kind", "elementOnly" }); + addAnnotation(getMessageEventDefinition_OperationRef(), source, new String[] { "kind", "element", "name", + "operationRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getMessageEventDefinition_MessageRef(), source, + new String[] { "kind", "attribute", "name", "messageRef" }); + addAnnotation(messageFlowEClass, source, new String[] { "name", "tMessageFlow", "kind", "elementOnly" }); + addAnnotation(getMessageFlow_MessageRef(), source, new String[] { "kind", "attribute", "name", "messageRef" }); + addAnnotation(getMessageFlow_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getMessageFlow_SourceRef(), source, new String[] { "kind", "attribute", "name", "sourceRef" }); + addAnnotation(getMessageFlow_TargetRef(), source, new String[] { "kind", "attribute", "name", "targetRef" }); + addAnnotation(messageFlowAssociationEClass, source, + new String[] { "name", "tMessageFlowAssociation", "kind", "elementOnly" }); + addAnnotation(getMessageFlowAssociation_InnerMessageFlowRef(), source, + new String[] { "kind", "attribute", "name", "innerMessageFlowRef" }); + addAnnotation(getMessageFlowAssociation_OuterMessageFlowRef(), source, + new String[] { "kind", "attribute", "name", "outerMessageFlowRef" }); + addAnnotation(monitoringEClass, source, new String[] { "name", "tMonitoring", "kind", "elementOnly" }); + addAnnotation(multiInstanceBehaviorEEnum, source, new String[] { "name", "tMultiInstanceFlowCondition" }); + addAnnotation(multiInstanceLoopCharacteristicsEClass, source, + new String[] { "name", "tMultiInstanceLoopCharacteristics", "kind", "elementOnly" }); + addAnnotation(getMultiInstanceLoopCharacteristics_LoopCardinality(), source, new String[] { "kind", "element", + "name", "loopCardinality", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getMultiInstanceLoopCharacteristics_LoopDataInputRef(), source, new String[] { "kind", "element", + "name", "loopDataInputRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getMultiInstanceLoopCharacteristics_LoopDataOutputRef(), source, new String[] { "kind", "element", + "name", "loopDataOutputRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getMultiInstanceLoopCharacteristics_InputDataItem(), source, new String[] { "kind", "element", + "name", "inputDataItem", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getMultiInstanceLoopCharacteristics_OutputDataItem(), source, new String[] { "kind", "element", + "name", "outputDataItem", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getMultiInstanceLoopCharacteristics_ComplexBehaviorDefinition(), source, + new String[] { "kind", "element", "name", "complexBehaviorDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getMultiInstanceLoopCharacteristics_CompletionCondition(), source, new String[] { "kind", + "element", "name", "completionCondition", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getMultiInstanceLoopCharacteristics_Behavior(), source, + new String[] { "kind", "attribute", "name", "behavior" }); + addAnnotation(getMultiInstanceLoopCharacteristics_IsSequential(), source, + new String[] { "kind", "attribute", "name", "isSequential" }); + addAnnotation(getMultiInstanceLoopCharacteristics_NoneBehaviorEventRef(), source, + new String[] { "kind", "attribute", "name", "noneBehaviorEventRef" }); + addAnnotation(getMultiInstanceLoopCharacteristics_OneBehaviorEventRef(), source, + new String[] { "kind", "attribute", "name", "oneBehaviorEventRef" }); + addAnnotation(operationEClass, source, new String[] { "name", "tOperation", "kind", "elementOnly" }); + addAnnotation(getOperation_InMessageRef(), source, new String[] { "kind", "element", "name", "inMessageRef", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getOperation_OutMessageRef(), source, new String[] { "kind", "element", "name", "outMessageRef", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getOperation_ErrorRefs(), source, new String[] { "kind", "element", "name", "errorRef", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getOperation_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getOperation_ImplementationRef(), source, + new String[] { "kind", "attribute", "name", "implementationRef" }); + addAnnotation(outputSetEClass, source, new String[] { "name", "tOutputSet", "kind", "elementOnly" }); + addAnnotation(getOutputSet_DataOutputRefs(), source, new String[] { "kind", "element", "name", "dataOutputRefs", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getOutputSet_OptionalOutputRefs(), source, new String[] { "kind", "element", "name", + "optionalOutputRefs", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getOutputSet_WhileExecutingOutputRefs(), source, new String[] { "kind", "element", "name", + "whileExecutingOutputRefs", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getOutputSet_InputSetRefs(), source, new String[] { "kind", "element", "name", "inputSetRefs", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getOutputSet_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(parallelGatewayEClass, source, + new String[] { "name", "tParallelGateway", "kind", "elementOnly" }); + addAnnotation(participantEClass, source, new String[] { "name", "tParticipant", "kind", "elementOnly" }); + addAnnotation(getParticipant_InterfaceRefs(), source, new String[] { "kind", "element", "name", "interfaceRef", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getParticipant_EndPointRefs(), source, new String[] { "kind", "element", "name", "endPointRef", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getParticipant_ParticipantMultiplicity(), source, new String[] { "kind", "element", "name", + "participantMultiplicity", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getParticipant_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getParticipant_ProcessRef(), source, new String[] { "kind", "attribute", "name", "processRef" }); + addAnnotation(participantAssociationEClass, source, + new String[] { "name", "tParticipantAssociation", "kind", "elementOnly" }); + addAnnotation(getParticipantAssociation_InnerParticipantRef(), source, new String[] { "kind", "element", "name", + "innerParticipantRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getParticipantAssociation_OuterParticipantRef(), source, new String[] { "kind", "element", "name", + "outerParticipantRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(participantMultiplicityEClass, source, + new String[] { "name", "tParticipantMultiplicity", "kind", "elementOnly" }); + addAnnotation(getParticipantMultiplicity_Maximum(), source, + new String[] { "kind", "attribute", "name", "maximum" }); + addAnnotation(getParticipantMultiplicity_Minimum(), source, + new String[] { "kind", "attribute", "name", "minimum" }); + addAnnotation(partnerEntityEClass, source, new String[] { "name", "tPartnerEntity", "kind", "elementOnly" }); + addAnnotation(getPartnerEntity_ParticipantRef(), source, new String[] { "kind", "element", "name", + "participantRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getPartnerEntity_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(partnerRoleEClass, source, new String[] { "name", "tPartnerRole", "kind", "elementOnly" }); + addAnnotation(getPartnerRole_ParticipantRef(), source, new String[] { "kind", "element", "name", + "participantRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getPartnerRole_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(performerEClass, source, new String[] { "name", "tPerformer", "kind", "elementOnly" }); + addAnnotation(potentialOwnerEClass, source, new String[] { "name", "tPotentialOwner", "kind", "elementOnly" }); + addAnnotation(processEClass, source, new String[] { "name", "tProcess", "kind", "elementOnly" }); + addAnnotation(getProcess_Auditing(), source, new String[] { "kind", "element", "name", "auditing", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getProcess_Monitoring(), source, new String[] { "kind", "element", "name", "monitoring", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getProcess_Properties(), source, new String[] { "kind", "element", "name", "property", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getProcess_Artifacts(), source, + new String[] { "kind", "element", "name", "artifact", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#artifact" }); + addAnnotation(getProcess_Resources(), source, + new String[] { "kind", "element", "name", "resourceRole", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#resourceRole" }); + addAnnotation(getProcess_CorrelationSubscriptions(), source, new String[] { "kind", "element", "name", + "correlationSubscription", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getProcess_Supports(), source, new String[] { "kind", "element", "name", "supports", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getProcess_DefinitionalCollaborationRef(), source, + new String[] { "kind", "attribute", "name", "definitionalCollaborationRef" }); + addAnnotation(getProcess_IsClosed(), source, new String[] { "kind", "attribute", "name", "isClosed" }); + addAnnotation(getProcess_IsExecutable(), source, new String[] { "kind", "attribute", "name", "isExecutable" }); + addAnnotation(getProcess_ProcessType(), source, new String[] { "kind", "attribute", "name", "processType" }); + addAnnotation(processTypeEEnum, source, new String[] { "name", "tProcessType" }); + addAnnotation(propertyEClass, source, new String[] { "name", "tProperty", "kind", "elementOnly" }); + addAnnotation(getProperty_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(receiveTaskEClass, source, new String[] { "name", "tReceiveTask", "kind", "elementOnly" }); + addAnnotation(getReceiveTask_Implementation(), source, + new String[] { "kind", "attribute", "name", "implementation" }); + addAnnotation(getReceiveTask_Instantiate(), source, + new String[] { "kind", "attribute", "name", "instantiate" }); + addAnnotation(getReceiveTask_MessageRef(), source, new String[] { "kind", "attribute", "name", "messageRef" }); + addAnnotation(getReceiveTask_OperationRef(), source, + new String[] { "kind", "attribute", "name", "operationRef" }); + addAnnotation(relationshipEClass, source, new String[] { "name", "tRelationship", "kind", "elementOnly" }); + addAnnotation(getRelationship_Sources(), source, new String[] { "kind", "element", "name", "source", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getRelationship_Targets(), source, new String[] { "kind", "element", "name", "target", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getRelationship_Direction(), source, new String[] { "kind", "attribute", "name", "direction" }); + addAnnotation(getRelationship_Type(), source, new String[] { "kind", "attribute", "name", "type" }); + addAnnotation(relationshipDirectionEEnum, source, new String[] { "name", "tRelationshipDirection" }); + addAnnotation(renderingEClass, source, new String[] { "name", "tRendering", "kind", "elementOnly" }); + addAnnotation(resourceEClass, source, new String[] { "name", "tResource", "kind", "elementOnly" }); + addAnnotation(getResource_ResourceParameters(), source, new String[] { "kind", "element", "name", + "resourceParameter", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getResource_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(resourceAssignmentExpressionEClass, source, + new String[] { "name", "tResourceAssignmentExpression", "kind", "elementOnly" }); + addAnnotation(getResourceAssignmentExpression_Expression(), source, + new String[] { "kind", "element", "name", "expression", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#expression" }); + addAnnotation(resourceParameterEClass, source, + new String[] { "name", "tResourceParameter", "kind", "elementOnly" }); + addAnnotation(getResourceParameter_IsRequired(), source, + new String[] { "kind", "attribute", "name", "isRequired" }); + addAnnotation(getResourceParameter_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getResourceParameter_Type(), source, new String[] { "kind", "attribute", "name", "type" }); + addAnnotation(resourceParameterBindingEClass, source, + new String[] { "name", "tResourceParameterBinding", "kind", "elementOnly" }); + addAnnotation(getResourceParameterBinding_Expression(), source, + new String[] { "kind", "element", "name", "expression", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#expression" }); + addAnnotation(getResourceParameterBinding_ParameterRef(), source, + new String[] { "kind", "attribute", "name", "parameterRef" }); + addAnnotation(resourceRoleEClass, source, new String[] { "name", "tResourceRole", "kind", "elementOnly" }); + addAnnotation(getResourceRole_ResourceRef(), source, new String[] { "kind", "element", "name", "resourceRef", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getResourceRole_ResourceParameterBindings(), source, new String[] { "kind", "element", "name", + "resourceParameterBinding", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getResourceRole_ResourceAssignmentExpression(), source, new String[] { "kind", "element", "name", + "resourceAssignmentExpression", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getResourceRole_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(rootElementEClass, source, + new String[] { "name", "tRootElement", "kind", "elementOnly", "abstract", "true" }); + addAnnotation(scriptTaskEClass, source, new String[] { "name", "tScriptTask", "kind", "elementOnly" }); + addAnnotation(getScriptTask_Script(), source, new String[] { "kind", "element", "name", "script", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getScriptTask_ScriptFormat(), source, + new String[] { "kind", "attribute", "name", "scriptFormat" }); + addAnnotation(sendTaskEClass, source, new String[] { "name", "tSendTask", "kind", "elementOnly" }); + addAnnotation(getSendTask_Implementation(), source, + new String[] { "kind", "attribute", "name", "implementation" }); + addAnnotation(getSendTask_MessageRef(), source, new String[] { "kind", "attribute", "name", "messageRef" }); + addAnnotation(getSendTask_OperationRef(), source, new String[] { "kind", "attribute", "name", "operationRef" }); + addAnnotation(sequenceFlowEClass, source, new String[] { "name", "tSequenceFlow", "kind", "elementOnly" }); + addAnnotation(getSequenceFlow_ConditionExpression(), source, new String[] { "kind", "element", "name", + "conditionExpression", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getSequenceFlow_IsImmediate(), source, + new String[] { "kind", "attribute", "name", "isImmediate" }); + addAnnotation(getSequenceFlow_SourceRef(), source, new String[] { "kind", "attribute", "name", "sourceRef" }); + addAnnotation(getSequenceFlow_TargetRef(), source, new String[] { "kind", "attribute", "name", "targetRef" }); + addAnnotation(serviceTaskEClass, source, new String[] { "name", "tServiceTask", "kind", "elementOnly" }); + addAnnotation(getServiceTask_Implementation(), source, + new String[] { "kind", "attribute", "name", "implementation" }); + addAnnotation(getServiceTask_OperationRef(), source, + new String[] { "kind", "attribute", "name", "operationRef" }); + addAnnotation(signalEClass, source, new String[] { "name", "tSignal", "kind", "elementOnly" }); + addAnnotation(getSignal_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getSignal_StructureRef(), source, new String[] { "kind", "attribute", "name", "structureRef" }); + addAnnotation(signalEventDefinitionEClass, source, + new String[] { "name", "tSignalEventDefinition", "kind", "elementOnly" }); + addAnnotation(standardLoopCharacteristicsEClass, source, + new String[] { "name", "tStandardLoopCharacteristics", "kind", "elementOnly" }); + addAnnotation(getStandardLoopCharacteristics_LoopCondition(), source, new String[] { "kind", "element", "name", + "loopCondition", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getStandardLoopCharacteristics_LoopMaximum(), source, + new String[] { "kind", "attribute", "name", "loopMaximum" }); + addAnnotation(getStandardLoopCharacteristics_TestBefore(), source, + new String[] { "kind", "attribute", "name", "testBefore" }); + addAnnotation(startEventEClass, source, new String[] { "name", "tStartEvent", "kind", "elementOnly" }); + addAnnotation(getStartEvent_IsInterrupting(), source, + new String[] { "kind", "attribute", "name", "isInterrupting" }); + addAnnotation(subChoreographyEClass, source, + new String[] { "name", "tSubChoreography", "kind", "elementOnly" }); + addAnnotation(getSubChoreography_Artifacts(), source, + new String[] { "kind", "element", "name", "artifact", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#artifact" }); + addAnnotation(subConversationEClass, source, + new String[] { "name", "tSubConversation", "kind", "elementOnly" }); + addAnnotation(getSubConversation_ConversationNodes(), source, + new String[] { "kind", "element", "name", "conversationNode", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#conversationNode" }); + addAnnotation(subProcessEClass, source, new String[] { "name", "tSubProcess", "kind", "elementOnly" }); + addAnnotation(getSubProcess_Artifacts(), source, + new String[] { "kind", "element", "name", "artifact", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#artifact" }); + addAnnotation(getSubProcess_TriggeredByEvent(), source, + new String[] { "kind", "attribute", "name", "triggeredByEvent" }); + addAnnotation(taskEClass, source, new String[] { "name", "tTask", "kind", "elementOnly" }); + addAnnotation(terminateEventDefinitionEClass, source, + new String[] { "name", "tTerminateEventDefinition", "kind", "elementOnly" }); + addAnnotation(textAnnotationEClass, source, new String[] { "name", "tTextAnnotation", "kind", "elementOnly" }); + addAnnotation(getTextAnnotation_Text(), source, new String[] { "kind", "element", "name", "text", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getTextAnnotation_TextFormat(), source, + new String[] { "kind", "attribute", "name", "textFormat" }); + addAnnotation(throwEventEClass, source, new String[] { "name", "tThrowEvent", "kind", "elementOnly" }); + addAnnotation(getThrowEvent_DataInputs(), source, new String[] { "kind", "element", "name", "dataInput", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getThrowEvent_DataInputAssociation(), source, new String[] { "kind", "element", "name", + "dataInputAssociation", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getThrowEvent_InputSet(), source, new String[] { "kind", "element", "name", "inputSet", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getThrowEvent_EventDefinitions(), source, + new String[] { "kind", "element", "name", "eventDefinition", "namespace", + "http://www.omg.org/spec/BPMN/20100524/MODEL", "group", + "http://www.omg.org/spec/BPMN/20100524/MODEL#eventDefinition" }); + addAnnotation(getThrowEvent_EventDefinitionRefs(), source, new String[] { "kind", "element", "name", + "eventDefinitionRef", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(timerEventDefinitionEClass, source, + new String[] { "name", "tTimerEventDefinition", "kind", "elementOnly" }); + addAnnotation(getTimerEventDefinition_TimeDate(), source, new String[] { "kind", "element", "name", "timeDate", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getTimerEventDefinition_TimeDuration(), source, new String[] { "kind", "element", "name", + "timeDuration", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getTimerEventDefinition_TimeCycle(), source, new String[] { "kind", "element", "name", + "timeCycle", "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(transactionEClass, source, new String[] { "name", "tTransaction", "kind", "elementOnly" }); + addAnnotation(getTransaction_Method(), source, new String[] { "kind", "attribute", "name", "method" }); + addAnnotation(userTaskEClass, source, new String[] { "name", "tUserTask", "kind", "elementOnly" }); + addAnnotation(getUserTask_Renderings(), source, new String[] { "kind", "element", "name", "rendering", + "namespace", "http://www.omg.org/spec/BPMN/20100524/MODEL" }); + addAnnotation(getUserTask_Implementation(), source, + new String[] { "kind", "attribute", "name", "implementation" }); + addAnnotation(eventSubprocessEClass, source, new String[] { "name", "tSubProcess", "kind", "elementOnly" }); + } + +} //Bpmn2PackageImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/BusinessRuleTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/BusinessRuleTaskImpl.java new file mode 100644 index 00000000000..5b2fbfd6b4d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/BusinessRuleTaskImpl.java @@ -0,0 +1,182 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.BusinessRuleTask; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Business Rule Task'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.BusinessRuleTaskImpl#getImplementation Implementation}
  • + *
+ * + * @generated + */ +public class BusinessRuleTaskImpl extends TaskImpl implements BusinessRuleTask { + /** + * The default value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + protected static final String IMPLEMENTATION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + @GwtTransient + protected String implementation = IMPLEMENTATION_EDEFAULT; + + /** + * + * + * @generated + */ + protected BusinessRuleTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.BUSINESS_RULE_TASK; + } + + /** + * + * + * @generated + */ + @Override + public String getImplementation() { + return implementation; + } + + /** + * + * + * @generated + */ + @Override + public void setImplementation(String newImplementation) { + String oldImplementation = implementation; + implementation = newImplementation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.BUSINESS_RULE_TASK__IMPLEMENTATION, + oldImplementation, implementation)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.BUSINESS_RULE_TASK__IMPLEMENTATION: + return getImplementation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.BUSINESS_RULE_TASK__IMPLEMENTATION: + setImplementation((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.BUSINESS_RULE_TASK__IMPLEMENTATION: + setImplementation(IMPLEMENTATION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.BUSINESS_RULE_TASK__IMPLEMENTATION: + return IMPLEMENTATION_EDEFAULT == null ? implementation != null + : !IMPLEMENTATION_EDEFAULT.equals(implementation); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (implementation: "); + result.append(implementation); + result.append(')'); + return result.toString(); + } + +} //BusinessRuleTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CallActivityImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CallActivityImpl.java new file mode 100644 index 00000000000..f4d1309e5a2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CallActivityImpl.java @@ -0,0 +1,182 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CallActivity; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Call Activity'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CallActivityImpl#getCalledElement Called Element}
  • + *
+ * + * @generated + */ +public class CallActivityImpl extends ActivityImpl implements CallActivity { + /** + * The default value of the '{@link #getCalledElement() Called Element}' attribute. + * + * + * @see #getCalledElement() + * @generated + * @ordered + */ + protected static final String CALLED_ELEMENT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getCalledElement() Called Element}' attribute. + * + * + * @see #getCalledElement() + * @generated + * @ordered + */ + @GwtTransient + protected String calledElement = CALLED_ELEMENT_EDEFAULT; + + /** + * + * + * @generated + */ + protected CallActivityImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CALL_ACTIVITY; + } + + /** + * + * + * @generated + */ + @Override + public String getCalledElement() { + return calledElement; + } + + /** + * + * + * @generated + */ + @Override + public void setCalledElement(String newCalledElement) { + String oldCalledElement = calledElement; + calledElement = newCalledElement; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CALL_ACTIVITY__CALLED_ELEMENT, + oldCalledElement, calledElement)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CALL_ACTIVITY__CALLED_ELEMENT: + return getCalledElement(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CALL_ACTIVITY__CALLED_ELEMENT: + setCalledElement((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CALL_ACTIVITY__CALLED_ELEMENT: + setCalledElement(CALLED_ELEMENT_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CALL_ACTIVITY__CALLED_ELEMENT: + return CALLED_ELEMENT_EDEFAULT == null ? calledElement != null + : !CALLED_ELEMENT_EDEFAULT.equals(calledElement); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (calledElement: "); + result.append(calledElement); + result.append(')'); + return result.toString(); + } + +} //CallActivityImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CallChoreographyImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CallChoreographyImpl.java new file mode 100644 index 00000000000..52a774d492a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CallChoreographyImpl.java @@ -0,0 +1,239 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CallChoreography; +import org.eclipse.bpmn2.Choreography; +import org.eclipse.bpmn2.ParticipantAssociation; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Call Choreography'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CallChoreographyImpl#getParticipantAssociations Participant Associations}
  • + *
  • {@link org.eclipse.bpmn2.impl.CallChoreographyImpl#getCalledChoreographyRef Called Choreography Ref}
  • + *
+ * + * @generated + */ +public class CallChoreographyImpl extends ChoreographyActivityImpl implements CallChoreography { + /** + * The cached value of the '{@link #getParticipantAssociations() Participant Associations}' containment reference list. + * + * + * @see #getParticipantAssociations() + * @generated + * @ordered + */ + @GwtTransient + protected EList participantAssociations; + + /** + * The cached value of the '{@link #getCalledChoreographyRef() Called Choreography Ref}' reference. + * + * + * @see #getCalledChoreographyRef() + * @generated + * @ordered + */ + @GwtTransient + protected Choreography calledChoreographyRef; + + /** + * + * + * @generated + */ + protected CallChoreographyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CALL_CHOREOGRAPHY; + } + + /** + * + * + * @generated + */ + @Override + public EList getParticipantAssociations() { + if (participantAssociations == null) { + participantAssociations = new EObjectContainmentEList(ParticipantAssociation.class, + this, Bpmn2Package.CALL_CHOREOGRAPHY__PARTICIPANT_ASSOCIATIONS); + } + return participantAssociations; + } + + /** + * + * + * @generated + */ + @Override + public Choreography getCalledChoreographyRef() { + if (calledChoreographyRef != null && calledChoreographyRef.eIsProxy()) { + InternalEObject oldCalledChoreographyRef = (InternalEObject) calledChoreographyRef; + calledChoreographyRef = (Choreography) eResolveProxy(oldCalledChoreographyRef); + if (calledChoreographyRef != oldCalledChoreographyRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.CALL_CHOREOGRAPHY__CALLED_CHOREOGRAPHY_REF, oldCalledChoreographyRef, + calledChoreographyRef)); + } + } + return calledChoreographyRef; + } + + /** + * + * + * @generated + */ + public Choreography basicGetCalledChoreographyRef() { + return calledChoreographyRef; + } + + /** + * + * + * @generated + */ + @Override + public void setCalledChoreographyRef(Choreography newCalledChoreographyRef) { + Choreography oldCalledChoreographyRef = calledChoreographyRef; + calledChoreographyRef = newCalledChoreographyRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CALL_CHOREOGRAPHY__CALLED_CHOREOGRAPHY_REF, oldCalledChoreographyRef, + calledChoreographyRef)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.CALL_CHOREOGRAPHY__PARTICIPANT_ASSOCIATIONS: + return ((InternalEList) getParticipantAssociations()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CALL_CHOREOGRAPHY__PARTICIPANT_ASSOCIATIONS: + return getParticipantAssociations(); + case Bpmn2Package.CALL_CHOREOGRAPHY__CALLED_CHOREOGRAPHY_REF: + if (resolve) + return getCalledChoreographyRef(); + return basicGetCalledChoreographyRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CALL_CHOREOGRAPHY__PARTICIPANT_ASSOCIATIONS: + getParticipantAssociations().clear(); + getParticipantAssociations().addAll((Collection) newValue); + return; + case Bpmn2Package.CALL_CHOREOGRAPHY__CALLED_CHOREOGRAPHY_REF: + setCalledChoreographyRef((Choreography) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CALL_CHOREOGRAPHY__PARTICIPANT_ASSOCIATIONS: + getParticipantAssociations().clear(); + return; + case Bpmn2Package.CALL_CHOREOGRAPHY__CALLED_CHOREOGRAPHY_REF: + setCalledChoreographyRef((Choreography) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CALL_CHOREOGRAPHY__PARTICIPANT_ASSOCIATIONS: + return participantAssociations != null && !participantAssociations.isEmpty(); + case Bpmn2Package.CALL_CHOREOGRAPHY__CALLED_CHOREOGRAPHY_REF: + return calledChoreographyRef != null; + } + return super.eIsSet(featureID); + } + +} //CallChoreographyImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CallConversationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CallConversationImpl.java new file mode 100644 index 00000000000..e1a225971e6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CallConversationImpl.java @@ -0,0 +1,239 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CallConversation; +import org.eclipse.bpmn2.Collaboration; +import org.eclipse.bpmn2.ParticipantAssociation; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Call Conversation'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CallConversationImpl#getParticipantAssociations Participant Associations}
  • + *
  • {@link org.eclipse.bpmn2.impl.CallConversationImpl#getCalledCollaborationRef Called Collaboration Ref}
  • + *
+ * + * @generated + */ +public class CallConversationImpl extends ConversationNodeImpl implements CallConversation { + /** + * The cached value of the '{@link #getParticipantAssociations() Participant Associations}' containment reference list. + * + * + * @see #getParticipantAssociations() + * @generated + * @ordered + */ + @GwtTransient + protected EList participantAssociations; + + /** + * The cached value of the '{@link #getCalledCollaborationRef() Called Collaboration Ref}' reference. + * + * + * @see #getCalledCollaborationRef() + * @generated + * @ordered + */ + @GwtTransient + protected Collaboration calledCollaborationRef; + + /** + * + * + * @generated + */ + protected CallConversationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CALL_CONVERSATION; + } + + /** + * + * + * @generated + */ + @Override + public EList getParticipantAssociations() { + if (participantAssociations == null) { + participantAssociations = new EObjectContainmentEList(ParticipantAssociation.class, + this, Bpmn2Package.CALL_CONVERSATION__PARTICIPANT_ASSOCIATIONS); + } + return participantAssociations; + } + + /** + * + * + * @generated + */ + @Override + public Collaboration getCalledCollaborationRef() { + if (calledCollaborationRef != null && calledCollaborationRef.eIsProxy()) { + InternalEObject oldCalledCollaborationRef = (InternalEObject) calledCollaborationRef; + calledCollaborationRef = (Collaboration) eResolveProxy(oldCalledCollaborationRef); + if (calledCollaborationRef != oldCalledCollaborationRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.CALL_CONVERSATION__CALLED_COLLABORATION_REF, oldCalledCollaborationRef, + calledCollaborationRef)); + } + } + return calledCollaborationRef; + } + + /** + * + * + * @generated + */ + public Collaboration basicGetCalledCollaborationRef() { + return calledCollaborationRef; + } + + /** + * + * + * @generated + */ + @Override + public void setCalledCollaborationRef(Collaboration newCalledCollaborationRef) { + Collaboration oldCalledCollaborationRef = calledCollaborationRef; + calledCollaborationRef = newCalledCollaborationRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CALL_CONVERSATION__CALLED_COLLABORATION_REF, oldCalledCollaborationRef, + calledCollaborationRef)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.CALL_CONVERSATION__PARTICIPANT_ASSOCIATIONS: + return ((InternalEList) getParticipantAssociations()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CALL_CONVERSATION__PARTICIPANT_ASSOCIATIONS: + return getParticipantAssociations(); + case Bpmn2Package.CALL_CONVERSATION__CALLED_COLLABORATION_REF: + if (resolve) + return getCalledCollaborationRef(); + return basicGetCalledCollaborationRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CALL_CONVERSATION__PARTICIPANT_ASSOCIATIONS: + getParticipantAssociations().clear(); + getParticipantAssociations().addAll((Collection) newValue); + return; + case Bpmn2Package.CALL_CONVERSATION__CALLED_COLLABORATION_REF: + setCalledCollaborationRef((Collaboration) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CALL_CONVERSATION__PARTICIPANT_ASSOCIATIONS: + getParticipantAssociations().clear(); + return; + case Bpmn2Package.CALL_CONVERSATION__CALLED_COLLABORATION_REF: + setCalledCollaborationRef((Collaboration) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CALL_CONVERSATION__PARTICIPANT_ASSOCIATIONS: + return participantAssociations != null && !participantAssociations.isEmpty(); + case Bpmn2Package.CALL_CONVERSATION__CALLED_COLLABORATION_REF: + return calledCollaborationRef != null; + } + return super.eIsSet(featureID); + } + +} //CallConversationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CallableElementImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CallableElementImpl.java new file mode 100644 index 00000000000..7b6d2ff1b6d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CallableElementImpl.java @@ -0,0 +1,359 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CallableElement; +import org.eclipse.bpmn2.InputOutputBinding; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.Interface; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Callable Element'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CallableElementImpl#getSupportedInterfaceRefs Supported Interface Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.CallableElementImpl#getIoSpecification Io Specification}
  • + *
  • {@link org.eclipse.bpmn2.impl.CallableElementImpl#getIoBinding Io Binding}
  • + *
  • {@link org.eclipse.bpmn2.impl.CallableElementImpl#getName Name}
  • + *
+ * + * @generated + */ +public class CallableElementImpl extends RootElementImpl implements CallableElement { + /** + * The cached value of the '{@link #getSupportedInterfaceRefs() Supported Interface Refs}' reference list. + * + * + * @see #getSupportedInterfaceRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList supportedInterfaceRefs; + + /** + * The cached value of the '{@link #getIoSpecification() Io Specification}' containment reference. + * + * + * @see #getIoSpecification() + * @generated + * @ordered + */ + @GwtTransient + protected InputOutputSpecification ioSpecification; + + /** + * The cached value of the '{@link #getIoBinding() Io Binding}' containment reference list. + * + * + * @see #getIoBinding() + * @generated + * @ordered + */ + @GwtTransient + protected EList ioBinding; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected CallableElementImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CALLABLE_ELEMENT; + } + + /** + * + * + * @generated + */ + @Override + public EList getSupportedInterfaceRefs() { + if (supportedInterfaceRefs == null) { + supportedInterfaceRefs = new EObjectResolvingEList(Interface.class, this, + Bpmn2Package.CALLABLE_ELEMENT__SUPPORTED_INTERFACE_REFS); + } + return supportedInterfaceRefs; + } + + /** + * + * + * @generated + */ + @Override + public InputOutputSpecification getIoSpecification() { + return ioSpecification; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetIoSpecification(InputOutputSpecification newIoSpecification, + NotificationChain msgs) { + InputOutputSpecification oldIoSpecification = ioSpecification; + ioSpecification = newIoSpecification; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CALLABLE_ELEMENT__IO_SPECIFICATION, oldIoSpecification, newIoSpecification); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setIoSpecification(InputOutputSpecification newIoSpecification) { + if (newIoSpecification != ioSpecification) { + NotificationChain msgs = null; + if (ioSpecification != null) + msgs = ((InternalEObject) ioSpecification).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.CALLABLE_ELEMENT__IO_SPECIFICATION, null, msgs); + if (newIoSpecification != null) + msgs = ((InternalEObject) newIoSpecification).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.CALLABLE_ELEMENT__IO_SPECIFICATION, null, msgs); + msgs = basicSetIoSpecification(newIoSpecification, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CALLABLE_ELEMENT__IO_SPECIFICATION, + newIoSpecification, newIoSpecification)); + } + + /** + * + * + * @generated + */ + @Override + public EList getIoBinding() { + if (ioBinding == null) { + ioBinding = new EObjectContainmentEList(InputOutputBinding.class, this, + Bpmn2Package.CALLABLE_ELEMENT__IO_BINDING); + } + return ioBinding; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CALLABLE_ELEMENT__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.CALLABLE_ELEMENT__IO_SPECIFICATION: + return basicSetIoSpecification(null, msgs); + case Bpmn2Package.CALLABLE_ELEMENT__IO_BINDING: + return ((InternalEList) getIoBinding()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CALLABLE_ELEMENT__SUPPORTED_INTERFACE_REFS: + return getSupportedInterfaceRefs(); + case Bpmn2Package.CALLABLE_ELEMENT__IO_SPECIFICATION: + return getIoSpecification(); + case Bpmn2Package.CALLABLE_ELEMENT__IO_BINDING: + return getIoBinding(); + case Bpmn2Package.CALLABLE_ELEMENT__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CALLABLE_ELEMENT__SUPPORTED_INTERFACE_REFS: + getSupportedInterfaceRefs().clear(); + getSupportedInterfaceRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.CALLABLE_ELEMENT__IO_SPECIFICATION: + setIoSpecification((InputOutputSpecification) newValue); + return; + case Bpmn2Package.CALLABLE_ELEMENT__IO_BINDING: + getIoBinding().clear(); + getIoBinding().addAll((Collection) newValue); + return; + case Bpmn2Package.CALLABLE_ELEMENT__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CALLABLE_ELEMENT__SUPPORTED_INTERFACE_REFS: + getSupportedInterfaceRefs().clear(); + return; + case Bpmn2Package.CALLABLE_ELEMENT__IO_SPECIFICATION: + setIoSpecification((InputOutputSpecification) null); + return; + case Bpmn2Package.CALLABLE_ELEMENT__IO_BINDING: + getIoBinding().clear(); + return; + case Bpmn2Package.CALLABLE_ELEMENT__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CALLABLE_ELEMENT__SUPPORTED_INTERFACE_REFS: + return supportedInterfaceRefs != null && !supportedInterfaceRefs.isEmpty(); + case Bpmn2Package.CALLABLE_ELEMENT__IO_SPECIFICATION: + return ioSpecification != null; + case Bpmn2Package.CALLABLE_ELEMENT__IO_BINDING: + return ioBinding != null && !ioBinding.isEmpty(); + case Bpmn2Package.CALLABLE_ELEMENT__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //CallableElementImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CancelEventDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CancelEventDefinitionImpl.java new file mode 100644 index 00000000000..1ff7b4fddb8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CancelEventDefinitionImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CancelEventDefinition; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Cancel Event Definition'. + * + * + * @generated + */ +public class CancelEventDefinitionImpl extends EventDefinitionImpl implements CancelEventDefinition { + /** + * + * + * @generated + */ + protected CancelEventDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CANCEL_EVENT_DEFINITION; + } + +} //CancelEventDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CatchEventImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CatchEventImpl.java new file mode 100644 index 00000000000..d008fafc489 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CatchEventImpl.java @@ -0,0 +1,438 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.OutputSet; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Catch Event'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CatchEventImpl#getDataOutputs Data Outputs}
  • + *
  • {@link org.eclipse.bpmn2.impl.CatchEventImpl#getDataOutputAssociation Data Output Association}
  • + *
  • {@link org.eclipse.bpmn2.impl.CatchEventImpl#getOutputSet Output Set}
  • + *
  • {@link org.eclipse.bpmn2.impl.CatchEventImpl#getEventDefinitions Event Definitions}
  • + *
  • {@link org.eclipse.bpmn2.impl.CatchEventImpl#getEventDefinitionRefs Event Definition Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.CatchEventImpl#isParallelMultiple Parallel Multiple}
  • + *
+ * + * @generated + */ +public abstract class CatchEventImpl extends EventImpl implements CatchEvent { + /** + * The cached value of the '{@link #getDataOutputs() Data Outputs}' containment reference list. + * + * + * @see #getDataOutputs() + * @generated + * @ordered + */ + @GwtTransient + protected EList dataOutputs; + + /** + * The cached value of the '{@link #getDataOutputAssociation() Data Output Association}' containment reference list. + * + * + * @see #getDataOutputAssociation() + * @generated + * @ordered + */ + @GwtTransient + protected EList dataOutputAssociation; + + /** + * The cached value of the '{@link #getOutputSet() Output Set}' containment reference. + * + * + * @see #getOutputSet() + * @generated + * @ordered + */ + @GwtTransient + protected OutputSet outputSet; + + /** + * The cached value of the '{@link #getEventDefinitions() Event Definitions}' containment reference list. + * + * + * @see #getEventDefinitions() + * @generated + * @ordered + */ + @GwtTransient + protected EList eventDefinitions; + + /** + * The cached value of the '{@link #getEventDefinitionRefs() Event Definition Refs}' reference list. + * + * + * @see #getEventDefinitionRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList eventDefinitionRefs; + + /** + * The default value of the '{@link #isParallelMultiple() Parallel Multiple}' attribute. + * + * + * @see #isParallelMultiple() + * @generated + * @ordered + */ + protected static final boolean PARALLEL_MULTIPLE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isParallelMultiple() Parallel Multiple}' attribute. + * + * + * @see #isParallelMultiple() + * @generated + * @ordered + */ + @GwtTransient + protected boolean parallelMultiple = PARALLEL_MULTIPLE_EDEFAULT; + + /** + * + * + * @generated + */ + protected CatchEventImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CATCH_EVENT; + } + + /** + * + * + * @generated + */ + @Override + public EList getDataOutputs() { + if (dataOutputs == null) { + dataOutputs = new EObjectContainmentEList(DataOutput.class, this, + Bpmn2Package.CATCH_EVENT__DATA_OUTPUTS); + } + return dataOutputs; + } + + /** + * + * + * @generated + */ + @Override + public EList getDataOutputAssociation() { + if (dataOutputAssociation == null) { + dataOutputAssociation = new EObjectContainmentEList(DataOutputAssociation.class, + this, Bpmn2Package.CATCH_EVENT__DATA_OUTPUT_ASSOCIATION); + } + return dataOutputAssociation; + } + + /** + * + * + * @generated + */ + @Override + public OutputSet getOutputSet() { + return outputSet; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetOutputSet(OutputSet newOutputSet, NotificationChain msgs) { + OutputSet oldOutputSet = outputSet; + outputSet = newOutputSet; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CATCH_EVENT__OUTPUT_SET, oldOutputSet, newOutputSet); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setOutputSet(OutputSet newOutputSet) { + if (newOutputSet != outputSet) { + NotificationChain msgs = null; + if (outputSet != null) + msgs = ((InternalEObject) outputSet).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.CATCH_EVENT__OUTPUT_SET, null, msgs); + if (newOutputSet != null) + msgs = ((InternalEObject) newOutputSet).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.CATCH_EVENT__OUTPUT_SET, null, msgs); + msgs = basicSetOutputSet(newOutputSet, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CATCH_EVENT__OUTPUT_SET, newOutputSet, + newOutputSet)); + } + + /** + * + * + * @generated + */ + @Override + public EList getEventDefinitions() { + if (eventDefinitions == null) { + eventDefinitions = new EObjectContainmentEList(EventDefinition.class, this, + Bpmn2Package.CATCH_EVENT__EVENT_DEFINITIONS); + } + return eventDefinitions; + } + + /** + * + * + * @generated + */ + @Override + public EList getEventDefinitionRefs() { + if (eventDefinitionRefs == null) { + eventDefinitionRefs = new EObjectResolvingEList(EventDefinition.class, this, + Bpmn2Package.CATCH_EVENT__EVENT_DEFINITION_REFS); + } + return eventDefinitionRefs; + } + + /** + * + * + * @generated + */ + @Override + public boolean isParallelMultiple() { + return parallelMultiple; + } + + /** + * + * + * @generated + */ + @Override + public void setParallelMultiple(boolean newParallelMultiple) { + boolean oldParallelMultiple = parallelMultiple; + parallelMultiple = newParallelMultiple; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CATCH_EVENT__PARALLEL_MULTIPLE, + oldParallelMultiple, parallelMultiple)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.CATCH_EVENT__DATA_OUTPUTS: + return ((InternalEList) getDataOutputs()).basicRemove(otherEnd, msgs); + case Bpmn2Package.CATCH_EVENT__DATA_OUTPUT_ASSOCIATION: + return ((InternalEList) getDataOutputAssociation()).basicRemove(otherEnd, msgs); + case Bpmn2Package.CATCH_EVENT__OUTPUT_SET: + return basicSetOutputSet(null, msgs); + case Bpmn2Package.CATCH_EVENT__EVENT_DEFINITIONS: + return ((InternalEList) getEventDefinitions()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CATCH_EVENT__DATA_OUTPUTS: + return getDataOutputs(); + case Bpmn2Package.CATCH_EVENT__DATA_OUTPUT_ASSOCIATION: + return getDataOutputAssociation(); + case Bpmn2Package.CATCH_EVENT__OUTPUT_SET: + return getOutputSet(); + case Bpmn2Package.CATCH_EVENT__EVENT_DEFINITIONS: + return getEventDefinitions(); + case Bpmn2Package.CATCH_EVENT__EVENT_DEFINITION_REFS: + return getEventDefinitionRefs(); + case Bpmn2Package.CATCH_EVENT__PARALLEL_MULTIPLE: + return isParallelMultiple(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CATCH_EVENT__DATA_OUTPUTS: + getDataOutputs().clear(); + getDataOutputs().addAll((Collection) newValue); + return; + case Bpmn2Package.CATCH_EVENT__DATA_OUTPUT_ASSOCIATION: + getDataOutputAssociation().clear(); + getDataOutputAssociation().addAll((Collection) newValue); + return; + case Bpmn2Package.CATCH_EVENT__OUTPUT_SET: + setOutputSet((OutputSet) newValue); + return; + case Bpmn2Package.CATCH_EVENT__EVENT_DEFINITIONS: + getEventDefinitions().clear(); + getEventDefinitions().addAll((Collection) newValue); + return; + case Bpmn2Package.CATCH_EVENT__EVENT_DEFINITION_REFS: + getEventDefinitionRefs().clear(); + getEventDefinitionRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.CATCH_EVENT__PARALLEL_MULTIPLE: + setParallelMultiple((Boolean) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CATCH_EVENT__DATA_OUTPUTS: + getDataOutputs().clear(); + return; + case Bpmn2Package.CATCH_EVENT__DATA_OUTPUT_ASSOCIATION: + getDataOutputAssociation().clear(); + return; + case Bpmn2Package.CATCH_EVENT__OUTPUT_SET: + setOutputSet((OutputSet) null); + return; + case Bpmn2Package.CATCH_EVENT__EVENT_DEFINITIONS: + getEventDefinitions().clear(); + return; + case Bpmn2Package.CATCH_EVENT__EVENT_DEFINITION_REFS: + getEventDefinitionRefs().clear(); + return; + case Bpmn2Package.CATCH_EVENT__PARALLEL_MULTIPLE: + setParallelMultiple(PARALLEL_MULTIPLE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CATCH_EVENT__DATA_OUTPUTS: + return dataOutputs != null && !dataOutputs.isEmpty(); + case Bpmn2Package.CATCH_EVENT__DATA_OUTPUT_ASSOCIATION: + return dataOutputAssociation != null && !dataOutputAssociation.isEmpty(); + case Bpmn2Package.CATCH_EVENT__OUTPUT_SET: + return outputSet != null; + case Bpmn2Package.CATCH_EVENT__EVENT_DEFINITIONS: + return eventDefinitions != null && !eventDefinitions.isEmpty(); + case Bpmn2Package.CATCH_EVENT__EVENT_DEFINITION_REFS: + return eventDefinitionRefs != null && !eventDefinitionRefs.isEmpty(); + case Bpmn2Package.CATCH_EVENT__PARALLEL_MULTIPLE: + return parallelMultiple != PARALLEL_MULTIPLE_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (parallelMultiple: "); + result.append(parallelMultiple); + result.append(')'); + return result.toString(); + } + +} //CatchEventImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CategoryImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CategoryImpl.java new file mode 100644 index 00000000000..adcfe634237 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CategoryImpl.java @@ -0,0 +1,242 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Category; +import org.eclipse.bpmn2.CategoryValue; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Category'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CategoryImpl#getCategoryValue Category Value}
  • + *
  • {@link org.eclipse.bpmn2.impl.CategoryImpl#getName Name}
  • + *
+ * + * @generated + */ +public class CategoryImpl extends RootElementImpl implements Category { + /** + * The cached value of the '{@link #getCategoryValue() Category Value}' containment reference list. + * + * + * @see #getCategoryValue() + * @generated + * @ordered + */ + @GwtTransient + protected EList categoryValue; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected CategoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CATEGORY; + } + + /** + * + * + * @generated + */ + @Override + public EList getCategoryValue() { + if (categoryValue == null) { + categoryValue = new EObjectContainmentEList(CategoryValue.class, this, + Bpmn2Package.CATEGORY__CATEGORY_VALUE); + } + return categoryValue; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CATEGORY__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.CATEGORY__CATEGORY_VALUE: + return ((InternalEList) getCategoryValue()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CATEGORY__CATEGORY_VALUE: + return getCategoryValue(); + case Bpmn2Package.CATEGORY__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CATEGORY__CATEGORY_VALUE: + getCategoryValue().clear(); + getCategoryValue().addAll((Collection) newValue); + return; + case Bpmn2Package.CATEGORY__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CATEGORY__CATEGORY_VALUE: + getCategoryValue().clear(); + return; + case Bpmn2Package.CATEGORY__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CATEGORY__CATEGORY_VALUE: + return categoryValue != null && !categoryValue.isEmpty(); + case Bpmn2Package.CATEGORY__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //CategoryImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CategoryValueImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CategoryValueImpl.java new file mode 100644 index 00000000000..4fb07f96d1a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CategoryValueImpl.java @@ -0,0 +1,202 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CategoryValue; +import org.eclipse.bpmn2.FlowElement; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Category Value'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CategoryValueImpl#getValue Value}
  • + *
  • {@link org.eclipse.bpmn2.impl.CategoryValueImpl#getCategorizedFlowElements Categorized Flow Elements}
  • + *
+ * + * @generated + */ +public class CategoryValueImpl extends BaseElementImpl implements CategoryValue { + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final String VALUE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + @GwtTransient + protected String value = VALUE_EDEFAULT; + + /** + * + * + * @generated + */ + protected CategoryValueImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CATEGORY_VALUE; + } + + /** + * + * + * @generated + */ + @Override + public String getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public void setValue(String newValue) { + String oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CATEGORY_VALUE__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + @Override + public EList getCategorizedFlowElements() { + // TODO: implement this method to return the 'Categorized Flow Elements' reference list + // Ensure that you remove @generated or mark it @generated NOT + // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting + // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CATEGORY_VALUE__VALUE: + return getValue(); + case Bpmn2Package.CATEGORY_VALUE__CATEGORIZED_FLOW_ELEMENTS: + return getCategorizedFlowElements(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CATEGORY_VALUE__VALUE: + setValue((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CATEGORY_VALUE__VALUE: + setValue(VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CATEGORY_VALUE__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + case Bpmn2Package.CATEGORY_VALUE__CATEGORIZED_FLOW_ELEMENTS: + return !getCategorizedFlowElements().isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (value: "); + result.append(value); + result.append(')'); + return result.toString(); + } + +} //CategoryValueImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ChoreographyActivityImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ChoreographyActivityImpl.java new file mode 100644 index 00000000000..d4433bf3eb9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ChoreographyActivityImpl.java @@ -0,0 +1,351 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ChoreographyActivity; +import org.eclipse.bpmn2.ChoreographyLoopType; +import org.eclipse.bpmn2.CorrelationKey; +import org.eclipse.bpmn2.Participant; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Choreography Activity'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ChoreographyActivityImpl#getParticipantRefs Participant Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.ChoreographyActivityImpl#getCorrelationKeys Correlation Keys}
  • + *
  • {@link org.eclipse.bpmn2.impl.ChoreographyActivityImpl#getInitiatingParticipantRef Initiating Participant Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.ChoreographyActivityImpl#getLoopType Loop Type}
  • + *
+ * + * @generated + */ +public abstract class ChoreographyActivityImpl extends FlowNodeImpl implements ChoreographyActivity { + /** + * The cached value of the '{@link #getParticipantRefs() Participant Refs}' reference list. + * + * + * @see #getParticipantRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList participantRefs; + + /** + * The cached value of the '{@link #getCorrelationKeys() Correlation Keys}' containment reference list. + * + * + * @see #getCorrelationKeys() + * @generated + * @ordered + */ + @GwtTransient + protected EList correlationKeys; + + /** + * The cached value of the '{@link #getInitiatingParticipantRef() Initiating Participant Ref}' reference. + * + * + * @see #getInitiatingParticipantRef() + * @generated + * @ordered + */ + @GwtTransient + protected Participant initiatingParticipantRef; + + /** + * The default value of the '{@link #getLoopType() Loop Type}' attribute. + * + * + * @see #getLoopType() + * @generated + * @ordered + */ + protected static final ChoreographyLoopType LOOP_TYPE_EDEFAULT = ChoreographyLoopType.NONE; + + /** + * The cached value of the '{@link #getLoopType() Loop Type}' attribute. + * + * + * @see #getLoopType() + * @generated + * @ordered + */ + @GwtTransient + protected ChoreographyLoopType loopType = LOOP_TYPE_EDEFAULT; + + /** + * + * + * @generated + */ + protected ChoreographyActivityImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CHOREOGRAPHY_ACTIVITY; + } + + /** + * + * + * @generated + */ + @Override + public EList getParticipantRefs() { + if (participantRefs == null) { + participantRefs = new EObjectResolvingEList(Participant.class, this, + Bpmn2Package.CHOREOGRAPHY_ACTIVITY__PARTICIPANT_REFS); + } + return participantRefs; + } + + /** + * + * + * @generated + */ + @Override + public EList getCorrelationKeys() { + if (correlationKeys == null) { + correlationKeys = new EObjectContainmentEList(CorrelationKey.class, this, + Bpmn2Package.CHOREOGRAPHY_ACTIVITY__CORRELATION_KEYS); + } + return correlationKeys; + } + + /** + * + * + * @generated + */ + @Override + public Participant getInitiatingParticipantRef() { + if (initiatingParticipantRef != null && initiatingParticipantRef.eIsProxy()) { + InternalEObject oldInitiatingParticipantRef = (InternalEObject) initiatingParticipantRef; + initiatingParticipantRef = (Participant) eResolveProxy(oldInitiatingParticipantRef); + if (initiatingParticipantRef != oldInitiatingParticipantRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.CHOREOGRAPHY_ACTIVITY__INITIATING_PARTICIPANT_REF, oldInitiatingParticipantRef, + initiatingParticipantRef)); + } + } + return initiatingParticipantRef; + } + + /** + * + * + * @generated + */ + public Participant basicGetInitiatingParticipantRef() { + return initiatingParticipantRef; + } + + /** + * + * + * @generated + */ + @Override + public void setInitiatingParticipantRef(Participant newInitiatingParticipantRef) { + Participant oldInitiatingParticipantRef = initiatingParticipantRef; + initiatingParticipantRef = newInitiatingParticipantRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CHOREOGRAPHY_ACTIVITY__INITIATING_PARTICIPANT_REF, oldInitiatingParticipantRef, + initiatingParticipantRef)); + } + + /** + * + * + * @generated + */ + @Override + public ChoreographyLoopType getLoopType() { + return loopType; + } + + /** + * + * + * @generated + */ + @Override + public void setLoopType(ChoreographyLoopType newLoopType) { + ChoreographyLoopType oldLoopType = loopType; + loopType = newLoopType == null ? LOOP_TYPE_EDEFAULT : newLoopType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CHOREOGRAPHY_ACTIVITY__LOOP_TYPE, + oldLoopType, loopType)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__CORRELATION_KEYS: + return ((InternalEList) getCorrelationKeys()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__PARTICIPANT_REFS: + return getParticipantRefs(); + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__CORRELATION_KEYS: + return getCorrelationKeys(); + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__INITIATING_PARTICIPANT_REF: + if (resolve) + return getInitiatingParticipantRef(); + return basicGetInitiatingParticipantRef(); + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__LOOP_TYPE: + return getLoopType(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__PARTICIPANT_REFS: + getParticipantRefs().clear(); + getParticipantRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__CORRELATION_KEYS: + getCorrelationKeys().clear(); + getCorrelationKeys().addAll((Collection) newValue); + return; + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__INITIATING_PARTICIPANT_REF: + setInitiatingParticipantRef((Participant) newValue); + return; + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__LOOP_TYPE: + setLoopType((ChoreographyLoopType) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__PARTICIPANT_REFS: + getParticipantRefs().clear(); + return; + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__CORRELATION_KEYS: + getCorrelationKeys().clear(); + return; + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__INITIATING_PARTICIPANT_REF: + setInitiatingParticipantRef((Participant) null); + return; + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__LOOP_TYPE: + setLoopType(LOOP_TYPE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__PARTICIPANT_REFS: + return participantRefs != null && !participantRefs.isEmpty(); + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__CORRELATION_KEYS: + return correlationKeys != null && !correlationKeys.isEmpty(); + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__INITIATING_PARTICIPANT_REF: + return initiatingParticipantRef != null; + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY__LOOP_TYPE: + return loopType != LOOP_TYPE_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (loopType: "); + result.append(loopType); + result.append(')'); + return result.toString(); + } + +} //ChoreographyActivityImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ChoreographyImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ChoreographyImpl.java new file mode 100644 index 00000000000..687b324d1bf --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ChoreographyImpl.java @@ -0,0 +1,247 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Choreography; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.FlowElementsContainer; +import org.eclipse.bpmn2.LaneSet; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Choreography'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ChoreographyImpl#getLaneSets Lane Sets}
  • + *
  • {@link org.eclipse.bpmn2.impl.ChoreographyImpl#getFlowElements Flow Elements}
  • + *
+ * + * @generated + */ +public class ChoreographyImpl extends CollaborationImpl implements Choreography { + /** + * The cached value of the '{@link #getLaneSets() Lane Sets}' containment reference list. + * + * + * @see #getLaneSets() + * @generated + * @ordered + */ + @GwtTransient + protected EList laneSets; + + /** + * The cached value of the '{@link #getFlowElements() Flow Elements}' containment reference list. + * + * + * @see #getFlowElements() + * @generated + * @ordered + */ + @GwtTransient + protected EList flowElements; + + /** + * + * + * @generated + */ + protected ChoreographyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CHOREOGRAPHY; + } + + /** + * + * + * @generated + */ + @Override + public EList getLaneSets() { + if (laneSets == null) { + laneSets = new EObjectContainmentEList(LaneSet.class, this, Bpmn2Package.CHOREOGRAPHY__LANE_SETS); + } + return laneSets; + } + + /** + * + * + * @generated + */ + @Override + public EList getFlowElements() { + if (flowElements == null) { + flowElements = new EObjectContainmentEList(FlowElement.class, this, + Bpmn2Package.CHOREOGRAPHY__FLOW_ELEMENTS); + } + return flowElements; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY__LANE_SETS: + return ((InternalEList) getLaneSets()).basicRemove(otherEnd, msgs); + case Bpmn2Package.CHOREOGRAPHY__FLOW_ELEMENTS: + return ((InternalEList) getFlowElements()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY__LANE_SETS: + return getLaneSets(); + case Bpmn2Package.CHOREOGRAPHY__FLOW_ELEMENTS: + return getFlowElements(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY__LANE_SETS: + getLaneSets().clear(); + getLaneSets().addAll((Collection) newValue); + return; + case Bpmn2Package.CHOREOGRAPHY__FLOW_ELEMENTS: + getFlowElements().clear(); + getFlowElements().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY__LANE_SETS: + getLaneSets().clear(); + return; + case Bpmn2Package.CHOREOGRAPHY__FLOW_ELEMENTS: + getFlowElements().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY__LANE_SETS: + return laneSets != null && !laneSets.isEmpty(); + case Bpmn2Package.CHOREOGRAPHY__FLOW_ELEMENTS: + return flowElements != null && !flowElements.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == FlowElementsContainer.class) { + switch (derivedFeatureID) { + case Bpmn2Package.CHOREOGRAPHY__LANE_SETS: + return Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS; + case Bpmn2Package.CHOREOGRAPHY__FLOW_ELEMENTS: + return Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == FlowElementsContainer.class) { + switch (baseFeatureID) { + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS: + return Bpmn2Package.CHOREOGRAPHY__LANE_SETS; + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS: + return Bpmn2Package.CHOREOGRAPHY__FLOW_ELEMENTS; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + +} //ChoreographyImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ChoreographyTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ChoreographyTaskImpl.java new file mode 100644 index 00000000000..5483645e15e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ChoreographyTaskImpl.java @@ -0,0 +1,149 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ChoreographyTask; +import org.eclipse.bpmn2.MessageFlow; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'Choreography Task'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ChoreographyTaskImpl#getMessageFlowRef Message Flow Ref}
  • + *
+ * + * @generated + */ +public class ChoreographyTaskImpl extends ChoreographyActivityImpl implements ChoreographyTask { + /** + * The cached value of the '{@link #getMessageFlowRef() Message Flow Ref}' reference list. + * + * + * @see #getMessageFlowRef() + * @generated + * @ordered + */ + @GwtTransient + protected EList messageFlowRef; + + /** + * + * + * @generated + */ + protected ChoreographyTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CHOREOGRAPHY_TASK; + } + + /** + * + * + * @generated + */ + @Override + public EList getMessageFlowRef() { + if (messageFlowRef == null) { + messageFlowRef = new EObjectResolvingEList(MessageFlow.class, this, + Bpmn2Package.CHOREOGRAPHY_TASK__MESSAGE_FLOW_REF); + } + return messageFlowRef; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY_TASK__MESSAGE_FLOW_REF: + return getMessageFlowRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY_TASK__MESSAGE_FLOW_REF: + getMessageFlowRef().clear(); + getMessageFlowRef().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY_TASK__MESSAGE_FLOW_REF: + getMessageFlowRef().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CHOREOGRAPHY_TASK__MESSAGE_FLOW_REF: + return messageFlowRef != null && !messageFlowRef.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //ChoreographyTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CollaborationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CollaborationImpl.java new file mode 100644 index 00000000000..1063ff26642 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CollaborationImpl.java @@ -0,0 +1,698 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Artifact; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Choreography; +import org.eclipse.bpmn2.Collaboration; +import org.eclipse.bpmn2.ConversationAssociation; +import org.eclipse.bpmn2.ConversationLink; +import org.eclipse.bpmn2.ConversationNode; +import org.eclipse.bpmn2.CorrelationKey; +import org.eclipse.bpmn2.MessageFlow; +import org.eclipse.bpmn2.MessageFlowAssociation; +import org.eclipse.bpmn2.Participant; +import org.eclipse.bpmn2.ParticipantAssociation; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Collaboration'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CollaborationImpl#getParticipants Participants}
  • + *
  • {@link org.eclipse.bpmn2.impl.CollaborationImpl#getMessageFlows Message Flows}
  • + *
  • {@link org.eclipse.bpmn2.impl.CollaborationImpl#getArtifacts Artifacts}
  • + *
  • {@link org.eclipse.bpmn2.impl.CollaborationImpl#getConversations Conversations}
  • + *
  • {@link org.eclipse.bpmn2.impl.CollaborationImpl#getConversationAssociations Conversation Associations}
  • + *
  • {@link org.eclipse.bpmn2.impl.CollaborationImpl#getParticipantAssociations Participant Associations}
  • + *
  • {@link org.eclipse.bpmn2.impl.CollaborationImpl#getMessageFlowAssociations Message Flow Associations}
  • + *
  • {@link org.eclipse.bpmn2.impl.CollaborationImpl#getCorrelationKeys Correlation Keys}
  • + *
  • {@link org.eclipse.bpmn2.impl.CollaborationImpl#getChoreographyRef Choreography Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.CollaborationImpl#getConversationLinks Conversation Links}
  • + *
  • {@link org.eclipse.bpmn2.impl.CollaborationImpl#isIsClosed Is Closed}
  • + *
  • {@link org.eclipse.bpmn2.impl.CollaborationImpl#getName Name}
  • + *
+ * + * @generated + */ +public class CollaborationImpl extends RootElementImpl implements Collaboration { + /** + * The cached value of the '{@link #getParticipants() Participants}' containment reference list. + * + * + * @see #getParticipants() + * @generated + * @ordered + */ + @GwtTransient + protected EList participants; + + /** + * The cached value of the '{@link #getMessageFlows() Message Flows}' containment reference list. + * + * + * @see #getMessageFlows() + * @generated + * @ordered + */ + @GwtTransient + protected EList messageFlows; + + /** + * The cached value of the '{@link #getArtifacts() Artifacts}' containment reference list. + * + * + * @see #getArtifacts() + * @generated + * @ordered + */ + @GwtTransient + protected EList artifacts; + + /** + * The cached value of the '{@link #getConversations() Conversations}' containment reference list. + * + * + * @see #getConversations() + * @generated + * @ordered + */ + @GwtTransient + protected EList conversations; + + /** + * The cached value of the '{@link #getConversationAssociations() Conversation Associations}' containment reference. + * + * + * @see #getConversationAssociations() + * @generated + * @ordered + */ + @GwtTransient + protected ConversationAssociation conversationAssociations; + + /** + * The cached value of the '{@link #getParticipantAssociations() Participant Associations}' containment reference list. + * + * + * @see #getParticipantAssociations() + * @generated + * @ordered + */ + @GwtTransient + protected EList participantAssociations; + + /** + * The cached value of the '{@link #getMessageFlowAssociations() Message Flow Associations}' containment reference list. + * + * + * @see #getMessageFlowAssociations() + * @generated + * @ordered + */ + @GwtTransient + protected EList messageFlowAssociations; + + /** + * The cached value of the '{@link #getCorrelationKeys() Correlation Keys}' containment reference list. + * + * + * @see #getCorrelationKeys() + * @generated + * @ordered + */ + @GwtTransient + protected EList correlationKeys; + + /** + * The cached value of the '{@link #getChoreographyRef() Choreography Ref}' reference list. + * + * + * @see #getChoreographyRef() + * @generated + * @ordered + */ + @GwtTransient + protected EList choreographyRef; + + /** + * The cached value of the '{@link #getConversationLinks() Conversation Links}' containment reference list. + * + * + * @see #getConversationLinks() + * @generated + * @ordered + */ + @GwtTransient + protected EList conversationLinks; + + /** + * The default value of the '{@link #isIsClosed() Is Closed}' attribute. + * + * + * @see #isIsClosed() + * @generated + * @ordered + */ + protected static final boolean IS_CLOSED_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsClosed() Is Closed}' attribute. + * + * + * @see #isIsClosed() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isClosed = IS_CLOSED_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected CollaborationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.COLLABORATION; + } + + /** + * + * + * @generated + */ + @Override + public EList getParticipants() { + if (participants == null) { + participants = new EObjectContainmentEList(Participant.class, this, + Bpmn2Package.COLLABORATION__PARTICIPANTS); + } + return participants; + } + + /** + * + * + * @generated + */ + @Override + public EList getMessageFlows() { + if (messageFlows == null) { + messageFlows = new EObjectContainmentEList(MessageFlow.class, this, + Bpmn2Package.COLLABORATION__MESSAGE_FLOWS); + } + return messageFlows; + } + + /** + * + * + * @generated + */ + @Override + public EList getArtifacts() { + if (artifacts == null) { + artifacts = new EObjectContainmentEList(Artifact.class, this, + Bpmn2Package.COLLABORATION__ARTIFACTS); + } + return artifacts; + } + + /** + * + * + * @generated + */ + @Override + public EList getConversations() { + if (conversations == null) { + conversations = new EObjectContainmentEList(ConversationNode.class, this, + Bpmn2Package.COLLABORATION__CONVERSATIONS); + } + return conversations; + } + + /** + * + * + * @generated + */ + @Override + public ConversationAssociation getConversationAssociations() { + return conversationAssociations; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetConversationAssociations(ConversationAssociation newConversationAssociations, + NotificationChain msgs) { + ConversationAssociation oldConversationAssociations = conversationAssociations; + conversationAssociations = newConversationAssociations; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS, oldConversationAssociations, + newConversationAssociations); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setConversationAssociations(ConversationAssociation newConversationAssociations) { + if (newConversationAssociations != conversationAssociations) { + NotificationChain msgs = null; + if (conversationAssociations != null) + msgs = ((InternalEObject) conversationAssociations).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS, null, msgs); + if (newConversationAssociations != null) + msgs = ((InternalEObject) newConversationAssociations).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS, null, msgs); + msgs = basicSetConversationAssociations(newConversationAssociations, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS, + newConversationAssociations, newConversationAssociations)); + } + + /** + * + * + * @generated + */ + @Override + public EList getParticipantAssociations() { + if (participantAssociations == null) { + participantAssociations = new EObjectContainmentEList(ParticipantAssociation.class, + this, Bpmn2Package.COLLABORATION__PARTICIPANT_ASSOCIATIONS); + } + return participantAssociations; + } + + /** + * + * + * @generated + */ + @Override + public EList getMessageFlowAssociations() { + if (messageFlowAssociations == null) { + messageFlowAssociations = new EObjectContainmentEList(MessageFlowAssociation.class, + this, Bpmn2Package.COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS); + } + return messageFlowAssociations; + } + + /** + * + * + * @generated + */ + @Override + public EList getCorrelationKeys() { + if (correlationKeys == null) { + correlationKeys = new EObjectContainmentEList(CorrelationKey.class, this, + Bpmn2Package.COLLABORATION__CORRELATION_KEYS); + } + return correlationKeys; + } + + /** + * + * + * @generated + */ + @Override + public EList getChoreographyRef() { + if (choreographyRef == null) { + choreographyRef = new EObjectResolvingEList(Choreography.class, this, + Bpmn2Package.COLLABORATION__CHOREOGRAPHY_REF); + } + return choreographyRef; + } + + /** + * + * + * @generated + */ + @Override + public EList getConversationLinks() { + if (conversationLinks == null) { + conversationLinks = new EObjectContainmentEList(ConversationLink.class, this, + Bpmn2Package.COLLABORATION__CONVERSATION_LINKS); + } + return conversationLinks; + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsClosed() { + return isClosed; + } + + /** + * + * + * @generated + */ + @Override + public void setIsClosed(boolean newIsClosed) { + boolean oldIsClosed = isClosed; + isClosed = newIsClosed; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.COLLABORATION__IS_CLOSED, oldIsClosed, + isClosed)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.COLLABORATION__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.COLLABORATION__PARTICIPANTS: + return ((InternalEList) getParticipants()).basicRemove(otherEnd, msgs); + case Bpmn2Package.COLLABORATION__MESSAGE_FLOWS: + return ((InternalEList) getMessageFlows()).basicRemove(otherEnd, msgs); + case Bpmn2Package.COLLABORATION__ARTIFACTS: + return ((InternalEList) getArtifacts()).basicRemove(otherEnd, msgs); + case Bpmn2Package.COLLABORATION__CONVERSATIONS: + return ((InternalEList) getConversations()).basicRemove(otherEnd, msgs); + case Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS: + return basicSetConversationAssociations(null, msgs); + case Bpmn2Package.COLLABORATION__PARTICIPANT_ASSOCIATIONS: + return ((InternalEList) getParticipantAssociations()).basicRemove(otherEnd, msgs); + case Bpmn2Package.COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS: + return ((InternalEList) getMessageFlowAssociations()).basicRemove(otherEnd, msgs); + case Bpmn2Package.COLLABORATION__CORRELATION_KEYS: + return ((InternalEList) getCorrelationKeys()).basicRemove(otherEnd, msgs); + case Bpmn2Package.COLLABORATION__CONVERSATION_LINKS: + return ((InternalEList) getConversationLinks()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.COLLABORATION__PARTICIPANTS: + return getParticipants(); + case Bpmn2Package.COLLABORATION__MESSAGE_FLOWS: + return getMessageFlows(); + case Bpmn2Package.COLLABORATION__ARTIFACTS: + return getArtifacts(); + case Bpmn2Package.COLLABORATION__CONVERSATIONS: + return getConversations(); + case Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS: + return getConversationAssociations(); + case Bpmn2Package.COLLABORATION__PARTICIPANT_ASSOCIATIONS: + return getParticipantAssociations(); + case Bpmn2Package.COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS: + return getMessageFlowAssociations(); + case Bpmn2Package.COLLABORATION__CORRELATION_KEYS: + return getCorrelationKeys(); + case Bpmn2Package.COLLABORATION__CHOREOGRAPHY_REF: + return getChoreographyRef(); + case Bpmn2Package.COLLABORATION__CONVERSATION_LINKS: + return getConversationLinks(); + case Bpmn2Package.COLLABORATION__IS_CLOSED: + return isIsClosed(); + case Bpmn2Package.COLLABORATION__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.COLLABORATION__PARTICIPANTS: + getParticipants().clear(); + getParticipants().addAll((Collection) newValue); + return; + case Bpmn2Package.COLLABORATION__MESSAGE_FLOWS: + getMessageFlows().clear(); + getMessageFlows().addAll((Collection) newValue); + return; + case Bpmn2Package.COLLABORATION__ARTIFACTS: + getArtifacts().clear(); + getArtifacts().addAll((Collection) newValue); + return; + case Bpmn2Package.COLLABORATION__CONVERSATIONS: + getConversations().clear(); + getConversations().addAll((Collection) newValue); + return; + case Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS: + setConversationAssociations((ConversationAssociation) newValue); + return; + case Bpmn2Package.COLLABORATION__PARTICIPANT_ASSOCIATIONS: + getParticipantAssociations().clear(); + getParticipantAssociations().addAll((Collection) newValue); + return; + case Bpmn2Package.COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS: + getMessageFlowAssociations().clear(); + getMessageFlowAssociations().addAll((Collection) newValue); + return; + case Bpmn2Package.COLLABORATION__CORRELATION_KEYS: + getCorrelationKeys().clear(); + getCorrelationKeys().addAll((Collection) newValue); + return; + case Bpmn2Package.COLLABORATION__CHOREOGRAPHY_REF: + getChoreographyRef().clear(); + getChoreographyRef().addAll((Collection) newValue); + return; + case Bpmn2Package.COLLABORATION__CONVERSATION_LINKS: + getConversationLinks().clear(); + getConversationLinks().addAll((Collection) newValue); + return; + case Bpmn2Package.COLLABORATION__IS_CLOSED: + setIsClosed((Boolean) newValue); + return; + case Bpmn2Package.COLLABORATION__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.COLLABORATION__PARTICIPANTS: + getParticipants().clear(); + return; + case Bpmn2Package.COLLABORATION__MESSAGE_FLOWS: + getMessageFlows().clear(); + return; + case Bpmn2Package.COLLABORATION__ARTIFACTS: + getArtifacts().clear(); + return; + case Bpmn2Package.COLLABORATION__CONVERSATIONS: + getConversations().clear(); + return; + case Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS: + setConversationAssociations((ConversationAssociation) null); + return; + case Bpmn2Package.COLLABORATION__PARTICIPANT_ASSOCIATIONS: + getParticipantAssociations().clear(); + return; + case Bpmn2Package.COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS: + getMessageFlowAssociations().clear(); + return; + case Bpmn2Package.COLLABORATION__CORRELATION_KEYS: + getCorrelationKeys().clear(); + return; + case Bpmn2Package.COLLABORATION__CHOREOGRAPHY_REF: + getChoreographyRef().clear(); + return; + case Bpmn2Package.COLLABORATION__CONVERSATION_LINKS: + getConversationLinks().clear(); + return; + case Bpmn2Package.COLLABORATION__IS_CLOSED: + setIsClosed(IS_CLOSED_EDEFAULT); + return; + case Bpmn2Package.COLLABORATION__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.COLLABORATION__PARTICIPANTS: + return participants != null && !participants.isEmpty(); + case Bpmn2Package.COLLABORATION__MESSAGE_FLOWS: + return messageFlows != null && !messageFlows.isEmpty(); + case Bpmn2Package.COLLABORATION__ARTIFACTS: + return artifacts != null && !artifacts.isEmpty(); + case Bpmn2Package.COLLABORATION__CONVERSATIONS: + return conversations != null && !conversations.isEmpty(); + case Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS: + return conversationAssociations != null; + case Bpmn2Package.COLLABORATION__PARTICIPANT_ASSOCIATIONS: + return participantAssociations != null && !participantAssociations.isEmpty(); + case Bpmn2Package.COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS: + return messageFlowAssociations != null && !messageFlowAssociations.isEmpty(); + case Bpmn2Package.COLLABORATION__CORRELATION_KEYS: + return correlationKeys != null && !correlationKeys.isEmpty(); + case Bpmn2Package.COLLABORATION__CHOREOGRAPHY_REF: + return choreographyRef != null && !choreographyRef.isEmpty(); + case Bpmn2Package.COLLABORATION__CONVERSATION_LINKS: + return conversationLinks != null && !conversationLinks.isEmpty(); + case Bpmn2Package.COLLABORATION__IS_CLOSED: + return isClosed != IS_CLOSED_EDEFAULT; + case Bpmn2Package.COLLABORATION__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (isClosed: "); + result.append(isClosed); + result.append(", name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //CollaborationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CompensateEventDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CompensateEventDefinitionImpl.java new file mode 100644 index 00000000000..cd14e69687a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CompensateEventDefinitionImpl.java @@ -0,0 +1,250 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CompensateEventDefinition; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Compensate Event Definition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CompensateEventDefinitionImpl#getActivityRef Activity Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.CompensateEventDefinitionImpl#isWaitForCompletion Wait For Completion}
  • + *
+ * + * @generated + */ +public class CompensateEventDefinitionImpl extends EventDefinitionImpl implements CompensateEventDefinition { + /** + * The cached value of the '{@link #getActivityRef() Activity Ref}' reference. + * + * + * @see #getActivityRef() + * @generated + * @ordered + */ + @GwtTransient + protected Activity activityRef; + + /** + * The default value of the '{@link #isWaitForCompletion() Wait For Completion}' attribute. + * + * + * @see #isWaitForCompletion() + * @generated + * @ordered + */ + protected static final boolean WAIT_FOR_COMPLETION_EDEFAULT = false; + + /** + * The cached value of the '{@link #isWaitForCompletion() Wait For Completion}' attribute. + * + * + * @see #isWaitForCompletion() + * @generated + * @ordered + */ + @GwtTransient + protected boolean waitForCompletion = WAIT_FOR_COMPLETION_EDEFAULT; + + /** + * + * + * @generated + */ + protected CompensateEventDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.COMPENSATE_EVENT_DEFINITION; + } + + /** + * + * + * @generated + */ + @Override + public Activity getActivityRef() { + if (activityRef != null && activityRef.eIsProxy()) { + InternalEObject oldActivityRef = (InternalEObject) activityRef; + activityRef = (Activity) eResolveProxy(oldActivityRef); + if (activityRef != oldActivityRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.COMPENSATE_EVENT_DEFINITION__ACTIVITY_REF, oldActivityRef, activityRef)); + } + } + return activityRef; + } + + /** + * + * + * @generated + */ + public Activity basicGetActivityRef() { + return activityRef; + } + + /** + * + * + * @generated + */ + @Override + public void setActivityRef(Activity newActivityRef) { + Activity oldActivityRef = activityRef; + activityRef = newActivityRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.COMPENSATE_EVENT_DEFINITION__ACTIVITY_REF, oldActivityRef, activityRef)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isWaitForCompletion() { + return waitForCompletion; + } + + /** + * + * + * @generated + */ + @Override + public void setWaitForCompletion(boolean newWaitForCompletion) { + boolean oldWaitForCompletion = waitForCompletion; + waitForCompletion = newWaitForCompletion; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.COMPENSATE_EVENT_DEFINITION__WAIT_FOR_COMPLETION, oldWaitForCompletion, + waitForCompletion)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.COMPENSATE_EVENT_DEFINITION__ACTIVITY_REF: + if (resolve) + return getActivityRef(); + return basicGetActivityRef(); + case Bpmn2Package.COMPENSATE_EVENT_DEFINITION__WAIT_FOR_COMPLETION: + return isWaitForCompletion(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.COMPENSATE_EVENT_DEFINITION__ACTIVITY_REF: + setActivityRef((Activity) newValue); + return; + case Bpmn2Package.COMPENSATE_EVENT_DEFINITION__WAIT_FOR_COMPLETION: + setWaitForCompletion((Boolean) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.COMPENSATE_EVENT_DEFINITION__ACTIVITY_REF: + setActivityRef((Activity) null); + return; + case Bpmn2Package.COMPENSATE_EVENT_DEFINITION__WAIT_FOR_COMPLETION: + setWaitForCompletion(WAIT_FOR_COMPLETION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.COMPENSATE_EVENT_DEFINITION__ACTIVITY_REF: + return activityRef != null; + case Bpmn2Package.COMPENSATE_EVENT_DEFINITION__WAIT_FOR_COMPLETION: + return waitForCompletion != WAIT_FOR_COMPLETION_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (waitForCompletion: "); + result.append(waitForCompletion); + result.append(')'); + return result.toString(); + } + +} //CompensateEventDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ComplexBehaviorDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ComplexBehaviorDefinitionImpl.java new file mode 100644 index 00000000000..316cc2a1073 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ComplexBehaviorDefinitionImpl.java @@ -0,0 +1,276 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ComplexBehaviorDefinition; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.ImplicitThrowEvent; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Complex Behavior Definition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ComplexBehaviorDefinitionImpl#getCondition Condition}
  • + *
  • {@link org.eclipse.bpmn2.impl.ComplexBehaviorDefinitionImpl#getEvent Event}
  • + *
+ * + * @generated + */ +public class ComplexBehaviorDefinitionImpl extends BaseElementImpl implements ComplexBehaviorDefinition { + /** + * The cached value of the '{@link #getCondition() Condition}' containment reference. + * + * + * @see #getCondition() + * @generated + * @ordered + */ + @GwtTransient + protected FormalExpression condition; + + /** + * The cached value of the '{@link #getEvent() Event}' containment reference. + * + * + * @see #getEvent() + * @generated + * @ordered + */ + @GwtTransient + protected ImplicitThrowEvent event; + + /** + * + * + * @generated + */ + protected ComplexBehaviorDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.COMPLEX_BEHAVIOR_DEFINITION; + } + + /** + * + * + * @generated + */ + @Override + public FormalExpression getCondition() { + return condition; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCondition(FormalExpression newCondition, NotificationChain msgs) { + FormalExpression oldCondition = condition; + condition = newCondition; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__CONDITION, oldCondition, newCondition); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setCondition(FormalExpression newCondition) { + if (newCondition != condition) { + NotificationChain msgs = null; + if (condition != null) + msgs = ((InternalEObject) condition).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__CONDITION, null, msgs); + if (newCondition != null) + msgs = ((InternalEObject) newCondition).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__CONDITION, null, msgs); + msgs = basicSetCondition(newCondition, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__CONDITION, + newCondition, newCondition)); + } + + /** + * + * + * @generated + */ + @Override + public ImplicitThrowEvent getEvent() { + return event; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEvent(ImplicitThrowEvent newEvent, NotificationChain msgs) { + ImplicitThrowEvent oldEvent = event; + event = newEvent; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__EVENT, oldEvent, newEvent); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setEvent(ImplicitThrowEvent newEvent) { + if (newEvent != event) { + NotificationChain msgs = null; + if (event != null) + msgs = ((InternalEObject) event).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__EVENT, null, msgs); + if (newEvent != null) + msgs = ((InternalEObject) newEvent).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__EVENT, null, msgs); + msgs = basicSetEvent(newEvent, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__EVENT, + newEvent, newEvent)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__CONDITION: + return basicSetCondition(null, msgs); + case Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__EVENT: + return basicSetEvent(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__CONDITION: + return getCondition(); + case Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__EVENT: + return getEvent(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__CONDITION: + setCondition((FormalExpression) newValue); + return; + case Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__EVENT: + setEvent((ImplicitThrowEvent) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__CONDITION: + setCondition((FormalExpression) null); + return; + case Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__EVENT: + setEvent((ImplicitThrowEvent) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__CONDITION: + return condition != null; + case Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION__EVENT: + return event != null; + } + return super.eIsSet(featureID); + } + +} //ComplexBehaviorDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ComplexGatewayImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ComplexGatewayImpl.java new file mode 100644 index 00000000000..f783c2f035a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ComplexGatewayImpl.java @@ -0,0 +1,246 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ComplexGateway; +import org.eclipse.bpmn2.Expression; +import org.eclipse.bpmn2.SequenceFlow; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Complex Gateway'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ComplexGatewayImpl#getActivationCondition Activation Condition}
  • + *
  • {@link org.eclipse.bpmn2.impl.ComplexGatewayImpl#getDefault Default}
  • + *
+ * + * @generated + */ +public class ComplexGatewayImpl extends GatewayImpl implements ComplexGateway { + /** + * The cached value of the '{@link #getActivationCondition() Activation Condition}' containment reference. + * + * + * @see #getActivationCondition() + * @generated + * @ordered + */ + @GwtTransient + protected Expression activationCondition; + + /** + * The cached value of the '{@link #getDefault() Default}' reference. + * + * + * @see #getDefault() + * @generated + * @ordered + */ + @GwtTransient + protected SequenceFlow default_; + + /** + * + * + * @generated + */ + protected ComplexGatewayImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.COMPLEX_GATEWAY; + } + + /** + * + * + * @generated + */ + @Override + public Expression getActivationCondition() { + return activationCondition; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetActivationCondition(Expression newActivationCondition, NotificationChain msgs) { + Expression oldActivationCondition = activationCondition; + activationCondition = newActivationCondition; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.COMPLEX_GATEWAY__ACTIVATION_CONDITION, oldActivationCondition, newActivationCondition); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setActivationCondition(Expression newActivationCondition) { + if (newActivationCondition != activationCondition) { + NotificationChain msgs = null; + if (activationCondition != null) + msgs = ((InternalEObject) activationCondition).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.COMPLEX_GATEWAY__ACTIVATION_CONDITION, null, msgs); + if (newActivationCondition != null) + msgs = ((InternalEObject) newActivationCondition).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.COMPLEX_GATEWAY__ACTIVATION_CONDITION, null, msgs); + msgs = basicSetActivationCondition(newActivationCondition, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.COMPLEX_GATEWAY__ACTIVATION_CONDITION, + newActivationCondition, newActivationCondition)); + } + + /** + * + * + * @generated + */ + @Override + public SequenceFlow getDefault() { + return default_; + } + + /** + * + * + * @generated + */ + @Override + public void setDefault(SequenceFlow newDefault) { + SequenceFlow oldDefault = default_; + default_ = newDefault; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.COMPLEX_GATEWAY__DEFAULT, oldDefault, + default_)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.COMPLEX_GATEWAY__ACTIVATION_CONDITION: + return basicSetActivationCondition(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.COMPLEX_GATEWAY__ACTIVATION_CONDITION: + return getActivationCondition(); + case Bpmn2Package.COMPLEX_GATEWAY__DEFAULT: + return getDefault(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.COMPLEX_GATEWAY__ACTIVATION_CONDITION: + setActivationCondition((Expression) newValue); + return; + case Bpmn2Package.COMPLEX_GATEWAY__DEFAULT: + setDefault((SequenceFlow) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.COMPLEX_GATEWAY__ACTIVATION_CONDITION: + setActivationCondition((Expression) null); + return; + case Bpmn2Package.COMPLEX_GATEWAY__DEFAULT: + setDefault((SequenceFlow) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.COMPLEX_GATEWAY__ACTIVATION_CONDITION: + return activationCondition != null; + case Bpmn2Package.COMPLEX_GATEWAY__DEFAULT: + return default_ != null; + } + return super.eIsSet(featureID); + } + +} //ComplexGatewayImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConditionalEventDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConditionalEventDefinitionImpl.java new file mode 100644 index 00000000000..98cbcb1a1be --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConditionalEventDefinitionImpl.java @@ -0,0 +1,199 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ConditionalEventDefinition; +import org.eclipse.bpmn2.Expression; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Conditional Event Definition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ConditionalEventDefinitionImpl#getCondition Condition}
  • + *
+ * + * @generated + */ +public class ConditionalEventDefinitionImpl extends EventDefinitionImpl implements ConditionalEventDefinition { + /** + * The cached value of the '{@link #getCondition() Condition}' containment reference. + * + * + * @see #getCondition() + * @generated + * @ordered + */ + @GwtTransient + protected Expression condition; + + /** + * + * + * @generated + */ + protected ConditionalEventDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CONDITIONAL_EVENT_DEFINITION; + } + + /** + * + * + * @generated + */ + @Override + public Expression getCondition() { + return condition; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCondition(Expression newCondition, NotificationChain msgs) { + Expression oldCondition = condition; + condition = newCondition; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CONDITIONAL_EVENT_DEFINITION__CONDITION, oldCondition, newCondition); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setCondition(Expression newCondition) { + if (newCondition != condition) { + NotificationChain msgs = null; + if (condition != null) + msgs = ((InternalEObject) condition).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.CONDITIONAL_EVENT_DEFINITION__CONDITION, null, msgs); + if (newCondition != null) + msgs = ((InternalEObject) newCondition).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.CONDITIONAL_EVENT_DEFINITION__CONDITION, null, msgs); + msgs = basicSetCondition(newCondition, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CONDITIONAL_EVENT_DEFINITION__CONDITION, + newCondition, newCondition)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.CONDITIONAL_EVENT_DEFINITION__CONDITION: + return basicSetCondition(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CONDITIONAL_EVENT_DEFINITION__CONDITION: + return getCondition(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CONDITIONAL_EVENT_DEFINITION__CONDITION: + setCondition((Expression) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CONDITIONAL_EVENT_DEFINITION__CONDITION: + setCondition((Expression) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CONDITIONAL_EVENT_DEFINITION__CONDITION: + return condition != null; + } + return super.eIsSet(featureID); + } + +} //ConditionalEventDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConversationAssociationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConversationAssociationImpl.java new file mode 100644 index 00000000000..942c4ad24d4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConversationAssociationImpl.java @@ -0,0 +1,246 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ConversationAssociation; +import org.eclipse.bpmn2.ConversationNode; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Conversation Association'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ConversationAssociationImpl#getInnerConversationNodeRef Inner Conversation Node Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.ConversationAssociationImpl#getOuterConversationNodeRef Outer Conversation Node Ref}
  • + *
+ * + * @generated + */ +public class ConversationAssociationImpl extends BaseElementImpl implements ConversationAssociation { + /** + * The cached value of the '{@link #getInnerConversationNodeRef() Inner Conversation Node Ref}' reference. + * + * + * @see #getInnerConversationNodeRef() + * @generated + * @ordered + */ + @GwtTransient + protected ConversationNode innerConversationNodeRef; + + /** + * The cached value of the '{@link #getOuterConversationNodeRef() Outer Conversation Node Ref}' reference. + * + * + * @see #getOuterConversationNodeRef() + * @generated + * @ordered + */ + @GwtTransient + protected ConversationNode outerConversationNodeRef; + + /** + * + * + * @generated + */ + protected ConversationAssociationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CONVERSATION_ASSOCIATION; + } + + /** + * + * + * @generated + */ + @Override + public ConversationNode getInnerConversationNodeRef() { + if (innerConversationNodeRef != null && innerConversationNodeRef.eIsProxy()) { + InternalEObject oldInnerConversationNodeRef = (InternalEObject) innerConversationNodeRef; + innerConversationNodeRef = (ConversationNode) eResolveProxy(oldInnerConversationNodeRef); + if (innerConversationNodeRef != oldInnerConversationNodeRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.CONVERSATION_ASSOCIATION__INNER_CONVERSATION_NODE_REF, + oldInnerConversationNodeRef, innerConversationNodeRef)); + } + } + return innerConversationNodeRef; + } + + /** + * + * + * @generated + */ + public ConversationNode basicGetInnerConversationNodeRef() { + return innerConversationNodeRef; + } + + /** + * + * + * @generated + */ + @Override + public void setInnerConversationNodeRef(ConversationNode newInnerConversationNodeRef) { + ConversationNode oldInnerConversationNodeRef = innerConversationNodeRef; + innerConversationNodeRef = newInnerConversationNodeRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CONVERSATION_ASSOCIATION__INNER_CONVERSATION_NODE_REF, oldInnerConversationNodeRef, + innerConversationNodeRef)); + } + + /** + * + * + * @generated + */ + @Override + public ConversationNode getOuterConversationNodeRef() { + if (outerConversationNodeRef != null && outerConversationNodeRef.eIsProxy()) { + InternalEObject oldOuterConversationNodeRef = (InternalEObject) outerConversationNodeRef; + outerConversationNodeRef = (ConversationNode) eResolveProxy(oldOuterConversationNodeRef); + if (outerConversationNodeRef != oldOuterConversationNodeRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.CONVERSATION_ASSOCIATION__OUTER_CONVERSATION_NODE_REF, + oldOuterConversationNodeRef, outerConversationNodeRef)); + } + } + return outerConversationNodeRef; + } + + /** + * + * + * @generated + */ + public ConversationNode basicGetOuterConversationNodeRef() { + return outerConversationNodeRef; + } + + /** + * + * + * @generated + */ + @Override + public void setOuterConversationNodeRef(ConversationNode newOuterConversationNodeRef) { + ConversationNode oldOuterConversationNodeRef = outerConversationNodeRef; + outerConversationNodeRef = newOuterConversationNodeRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CONVERSATION_ASSOCIATION__OUTER_CONVERSATION_NODE_REF, oldOuterConversationNodeRef, + outerConversationNodeRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CONVERSATION_ASSOCIATION__INNER_CONVERSATION_NODE_REF: + if (resolve) + return getInnerConversationNodeRef(); + return basicGetInnerConversationNodeRef(); + case Bpmn2Package.CONVERSATION_ASSOCIATION__OUTER_CONVERSATION_NODE_REF: + if (resolve) + return getOuterConversationNodeRef(); + return basicGetOuterConversationNodeRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CONVERSATION_ASSOCIATION__INNER_CONVERSATION_NODE_REF: + setInnerConversationNodeRef((ConversationNode) newValue); + return; + case Bpmn2Package.CONVERSATION_ASSOCIATION__OUTER_CONVERSATION_NODE_REF: + setOuterConversationNodeRef((ConversationNode) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CONVERSATION_ASSOCIATION__INNER_CONVERSATION_NODE_REF: + setInnerConversationNodeRef((ConversationNode) null); + return; + case Bpmn2Package.CONVERSATION_ASSOCIATION__OUTER_CONVERSATION_NODE_REF: + setOuterConversationNodeRef((ConversationNode) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CONVERSATION_ASSOCIATION__INNER_CONVERSATION_NODE_REF: + return innerConversationNodeRef != null; + case Bpmn2Package.CONVERSATION_ASSOCIATION__OUTER_CONVERSATION_NODE_REF: + return outerConversationNodeRef != null; + } + return super.eIsSet(featureID); + } + +} //ConversationAssociationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConversationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConversationImpl.java new file mode 100644 index 00000000000..edbdab4980e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConversationImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Conversation; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Conversation'. + * + * + * @generated + */ +public class ConversationImpl extends ConversationNodeImpl implements Conversation { + /** + * + * + * @generated + */ + protected ConversationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CONVERSATION; + } + +} //ConversationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConversationLinkImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConversationLinkImpl.java new file mode 100644 index 00000000000..107fa23352e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConversationLinkImpl.java @@ -0,0 +1,314 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ConversationLink; +import org.eclipse.bpmn2.InteractionNode; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Conversation Link'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ConversationLinkImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.ConversationLinkImpl#getSourceRef Source Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.ConversationLinkImpl#getTargetRef Target Ref}
  • + *
+ * + * @generated + */ +public class ConversationLinkImpl extends BaseElementImpl implements ConversationLink { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getSourceRef() Source Ref}' reference. + * + * + * @see #getSourceRef() + * @generated + * @ordered + */ + @GwtTransient + protected InteractionNode sourceRef; + + /** + * The cached value of the '{@link #getTargetRef() Target Ref}' reference. + * + * + * @see #getTargetRef() + * @generated + * @ordered + */ + @GwtTransient + protected InteractionNode targetRef; + + /** + * + * + * @generated + */ + protected ConversationLinkImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CONVERSATION_LINK; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CONVERSATION_LINK__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public InteractionNode getSourceRef() { + if (sourceRef != null && sourceRef.eIsProxy()) { + InternalEObject oldSourceRef = (InternalEObject) sourceRef; + sourceRef = (InteractionNode) eResolveProxy(oldSourceRef); + if (sourceRef != oldSourceRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.CONVERSATION_LINK__SOURCE_REF, oldSourceRef, sourceRef)); + } + } + return sourceRef; + } + + /** + * + * + * @generated + */ + public InteractionNode basicGetSourceRef() { + return sourceRef; + } + + /** + * + * + * @generated + */ + @Override + public void setSourceRef(InteractionNode newSourceRef) { + InteractionNode oldSourceRef = sourceRef; + sourceRef = newSourceRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CONVERSATION_LINK__SOURCE_REF, + oldSourceRef, sourceRef)); + } + + /** + * + * + * @generated + */ + @Override + public InteractionNode getTargetRef() { + if (targetRef != null && targetRef.eIsProxy()) { + InternalEObject oldTargetRef = (InternalEObject) targetRef; + targetRef = (InteractionNode) eResolveProxy(oldTargetRef); + if (targetRef != oldTargetRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.CONVERSATION_LINK__TARGET_REF, oldTargetRef, targetRef)); + } + } + return targetRef; + } + + /** + * + * + * @generated + */ + public InteractionNode basicGetTargetRef() { + return targetRef; + } + + /** + * + * + * @generated + */ + @Override + public void setTargetRef(InteractionNode newTargetRef) { + InteractionNode oldTargetRef = targetRef; + targetRef = newTargetRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CONVERSATION_LINK__TARGET_REF, + oldTargetRef, targetRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CONVERSATION_LINK__NAME: + return getName(); + case Bpmn2Package.CONVERSATION_LINK__SOURCE_REF: + if (resolve) + return getSourceRef(); + return basicGetSourceRef(); + case Bpmn2Package.CONVERSATION_LINK__TARGET_REF: + if (resolve) + return getTargetRef(); + return basicGetTargetRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CONVERSATION_LINK__NAME: + setName((String) newValue); + return; + case Bpmn2Package.CONVERSATION_LINK__SOURCE_REF: + setSourceRef((InteractionNode) newValue); + return; + case Bpmn2Package.CONVERSATION_LINK__TARGET_REF: + setTargetRef((InteractionNode) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CONVERSATION_LINK__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.CONVERSATION_LINK__SOURCE_REF: + setSourceRef((InteractionNode) null); + return; + case Bpmn2Package.CONVERSATION_LINK__TARGET_REF: + setTargetRef((InteractionNode) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CONVERSATION_LINK__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.CONVERSATION_LINK__SOURCE_REF: + return sourceRef != null; + case Bpmn2Package.CONVERSATION_LINK__TARGET_REF: + return targetRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //ConversationLinkImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConversationNodeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConversationNodeImpl.java new file mode 100644 index 00000000000..1cfea7b1e7f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ConversationNodeImpl.java @@ -0,0 +1,399 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ConversationLink; +import org.eclipse.bpmn2.ConversationNode; +import org.eclipse.bpmn2.CorrelationKey; +import org.eclipse.bpmn2.InteractionNode; +import org.eclipse.bpmn2.MessageFlow; +import org.eclipse.bpmn2.Participant; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Conversation Node'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ConversationNodeImpl#getIncomingConversationLinks Incoming Conversation Links}
  • + *
  • {@link org.eclipse.bpmn2.impl.ConversationNodeImpl#getOutgoingConversationLinks Outgoing Conversation Links}
  • + *
  • {@link org.eclipse.bpmn2.impl.ConversationNodeImpl#getParticipantRefs Participant Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.ConversationNodeImpl#getMessageFlowRefs Message Flow Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.ConversationNodeImpl#getCorrelationKeys Correlation Keys}
  • + *
  • {@link org.eclipse.bpmn2.impl.ConversationNodeImpl#getName Name}
  • + *
+ * + * @generated + */ +public class ConversationNodeImpl extends BaseElementImpl implements ConversationNode { + /** + * The cached value of the '{@link #getParticipantRefs() Participant Refs}' reference list. + * + * + * @see #getParticipantRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList participantRefs; + + /** + * The cached value of the '{@link #getMessageFlowRefs() Message Flow Refs}' reference list. + * + * + * @see #getMessageFlowRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList messageFlowRefs; + + /** + * The cached value of the '{@link #getCorrelationKeys() Correlation Keys}' containment reference list. + * + * + * @see #getCorrelationKeys() + * @generated + * @ordered + */ + @GwtTransient + protected EList correlationKeys; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected ConversationNodeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CONVERSATION_NODE; + } + + /** + * + * + * @generated + */ + @Override + public EList getIncomingConversationLinks() { + // TODO: implement this method to return the 'Incoming Conversation Links' reference list + // Ensure that you remove @generated or mark it @generated NOT + // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting + // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public EList getOutgoingConversationLinks() { + // TODO: implement this method to return the 'Outgoing Conversation Links' reference list + // Ensure that you remove @generated or mark it @generated NOT + // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting + // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public EList getParticipantRefs() { + if (participantRefs == null) { + participantRefs = new EObjectResolvingEList(Participant.class, this, + Bpmn2Package.CONVERSATION_NODE__PARTICIPANT_REFS); + } + return participantRefs; + } + + /** + * + * + * @generated + */ + @Override + public EList getMessageFlowRefs() { + if (messageFlowRefs == null) { + messageFlowRefs = new EObjectResolvingEList(MessageFlow.class, this, + Bpmn2Package.CONVERSATION_NODE__MESSAGE_FLOW_REFS); + } + return messageFlowRefs; + } + + /** + * + * + * @generated + */ + @Override + public EList getCorrelationKeys() { + if (correlationKeys == null) { + correlationKeys = new EObjectContainmentEList(CorrelationKey.class, this, + Bpmn2Package.CONVERSATION_NODE__CORRELATION_KEYS); + } + return correlationKeys; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CONVERSATION_NODE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.CONVERSATION_NODE__CORRELATION_KEYS: + return ((InternalEList) getCorrelationKeys()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CONVERSATION_NODE__INCOMING_CONVERSATION_LINKS: + return getIncomingConversationLinks(); + case Bpmn2Package.CONVERSATION_NODE__OUTGOING_CONVERSATION_LINKS: + return getOutgoingConversationLinks(); + case Bpmn2Package.CONVERSATION_NODE__PARTICIPANT_REFS: + return getParticipantRefs(); + case Bpmn2Package.CONVERSATION_NODE__MESSAGE_FLOW_REFS: + return getMessageFlowRefs(); + case Bpmn2Package.CONVERSATION_NODE__CORRELATION_KEYS: + return getCorrelationKeys(); + case Bpmn2Package.CONVERSATION_NODE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CONVERSATION_NODE__PARTICIPANT_REFS: + getParticipantRefs().clear(); + getParticipantRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.CONVERSATION_NODE__MESSAGE_FLOW_REFS: + getMessageFlowRefs().clear(); + getMessageFlowRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.CONVERSATION_NODE__CORRELATION_KEYS: + getCorrelationKeys().clear(); + getCorrelationKeys().addAll((Collection) newValue); + return; + case Bpmn2Package.CONVERSATION_NODE__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CONVERSATION_NODE__PARTICIPANT_REFS: + getParticipantRefs().clear(); + return; + case Bpmn2Package.CONVERSATION_NODE__MESSAGE_FLOW_REFS: + getMessageFlowRefs().clear(); + return; + case Bpmn2Package.CONVERSATION_NODE__CORRELATION_KEYS: + getCorrelationKeys().clear(); + return; + case Bpmn2Package.CONVERSATION_NODE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CONVERSATION_NODE__INCOMING_CONVERSATION_LINKS: + return !getIncomingConversationLinks().isEmpty(); + case Bpmn2Package.CONVERSATION_NODE__OUTGOING_CONVERSATION_LINKS: + return !getOutgoingConversationLinks().isEmpty(); + case Bpmn2Package.CONVERSATION_NODE__PARTICIPANT_REFS: + return participantRefs != null && !participantRefs.isEmpty(); + case Bpmn2Package.CONVERSATION_NODE__MESSAGE_FLOW_REFS: + return messageFlowRefs != null && !messageFlowRefs.isEmpty(); + case Bpmn2Package.CONVERSATION_NODE__CORRELATION_KEYS: + return correlationKeys != null && !correlationKeys.isEmpty(); + case Bpmn2Package.CONVERSATION_NODE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == InteractionNode.class) { + switch (derivedFeatureID) { + case Bpmn2Package.CONVERSATION_NODE__INCOMING_CONVERSATION_LINKS: + return Bpmn2Package.INTERACTION_NODE__INCOMING_CONVERSATION_LINKS; + case Bpmn2Package.CONVERSATION_NODE__OUTGOING_CONVERSATION_LINKS: + return Bpmn2Package.INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == InteractionNode.class) { + switch (baseFeatureID) { + case Bpmn2Package.INTERACTION_NODE__INCOMING_CONVERSATION_LINKS: + return Bpmn2Package.CONVERSATION_NODE__INCOMING_CONVERSATION_LINKS; + case Bpmn2Package.INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS: + return Bpmn2Package.CONVERSATION_NODE__OUTGOING_CONVERSATION_LINKS; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //ConversationNodeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationKeyImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationKeyImpl.java new file mode 100644 index 00000000000..8d318f08f91 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationKeyImpl.java @@ -0,0 +1,225 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CorrelationKey; +import org.eclipse.bpmn2.CorrelationProperty; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'Correlation Key'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CorrelationKeyImpl#getCorrelationPropertyRef Correlation Property Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.CorrelationKeyImpl#getName Name}
  • + *
+ * + * @generated + */ +public class CorrelationKeyImpl extends BaseElementImpl implements CorrelationKey { + /** + * The cached value of the '{@link #getCorrelationPropertyRef() Correlation Property Ref}' reference list. + * + * + * @see #getCorrelationPropertyRef() + * @generated + * @ordered + */ + @GwtTransient + protected EList correlationPropertyRef; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected CorrelationKeyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CORRELATION_KEY; + } + + /** + * + * + * @generated + */ + @Override + public EList getCorrelationPropertyRef() { + if (correlationPropertyRef == null) { + correlationPropertyRef = new EObjectResolvingEList(CorrelationProperty.class, this, + Bpmn2Package.CORRELATION_KEY__CORRELATION_PROPERTY_REF); + } + return correlationPropertyRef; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CORRELATION_KEY__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CORRELATION_KEY__CORRELATION_PROPERTY_REF: + return getCorrelationPropertyRef(); + case Bpmn2Package.CORRELATION_KEY__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CORRELATION_KEY__CORRELATION_PROPERTY_REF: + getCorrelationPropertyRef().clear(); + getCorrelationPropertyRef().addAll((Collection) newValue); + return; + case Bpmn2Package.CORRELATION_KEY__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CORRELATION_KEY__CORRELATION_PROPERTY_REF: + getCorrelationPropertyRef().clear(); + return; + case Bpmn2Package.CORRELATION_KEY__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CORRELATION_KEY__CORRELATION_PROPERTY_REF: + return correlationPropertyRef != null && !correlationPropertyRef.isEmpty(); + case Bpmn2Package.CORRELATION_KEY__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //CorrelationKeyImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationPropertyBindingImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationPropertyBindingImpl.java new file mode 100644 index 00000000000..204cd27a83e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationPropertyBindingImpl.java @@ -0,0 +1,268 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CorrelationProperty; +import org.eclipse.bpmn2.CorrelationPropertyBinding; +import org.eclipse.bpmn2.FormalExpression; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Correlation Property Binding'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CorrelationPropertyBindingImpl#getDataPath Data Path}
  • + *
  • {@link org.eclipse.bpmn2.impl.CorrelationPropertyBindingImpl#getCorrelationPropertyRef Correlation Property Ref}
  • + *
+ * + * @generated + */ +public class CorrelationPropertyBindingImpl extends BaseElementImpl implements CorrelationPropertyBinding { + /** + * The cached value of the '{@link #getDataPath() Data Path}' containment reference. + * + * + * @see #getDataPath() + * @generated + * @ordered + */ + @GwtTransient + protected FormalExpression dataPath; + + /** + * The cached value of the '{@link #getCorrelationPropertyRef() Correlation Property Ref}' reference. + * + * + * @see #getCorrelationPropertyRef() + * @generated + * @ordered + */ + @GwtTransient + protected CorrelationProperty correlationPropertyRef; + + /** + * + * + * @generated + */ + protected CorrelationPropertyBindingImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CORRELATION_PROPERTY_BINDING; + } + + /** + * + * + * @generated + */ + @Override + public FormalExpression getDataPath() { + return dataPath; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataPath(FormalExpression newDataPath, NotificationChain msgs) { + FormalExpression oldDataPath = dataPath; + dataPath = newDataPath; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CORRELATION_PROPERTY_BINDING__DATA_PATH, oldDataPath, newDataPath); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setDataPath(FormalExpression newDataPath) { + if (newDataPath != dataPath) { + NotificationChain msgs = null; + if (dataPath != null) + msgs = ((InternalEObject) dataPath).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.CORRELATION_PROPERTY_BINDING__DATA_PATH, null, msgs); + if (newDataPath != null) + msgs = ((InternalEObject) newDataPath).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.CORRELATION_PROPERTY_BINDING__DATA_PATH, null, msgs); + msgs = basicSetDataPath(newDataPath, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CORRELATION_PROPERTY_BINDING__DATA_PATH, + newDataPath, newDataPath)); + } + + /** + * + * + * @generated + */ + @Override + public CorrelationProperty getCorrelationPropertyRef() { + if (correlationPropertyRef != null && correlationPropertyRef.eIsProxy()) { + InternalEObject oldCorrelationPropertyRef = (InternalEObject) correlationPropertyRef; + correlationPropertyRef = (CorrelationProperty) eResolveProxy(oldCorrelationPropertyRef); + if (correlationPropertyRef != oldCorrelationPropertyRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.CORRELATION_PROPERTY_BINDING__CORRELATION_PROPERTY_REF, + oldCorrelationPropertyRef, correlationPropertyRef)); + } + } + return correlationPropertyRef; + } + + /** + * + * + * @generated + */ + public CorrelationProperty basicGetCorrelationPropertyRef() { + return correlationPropertyRef; + } + + /** + * + * + * @generated + */ + @Override + public void setCorrelationPropertyRef(CorrelationProperty newCorrelationPropertyRef) { + CorrelationProperty oldCorrelationPropertyRef = correlationPropertyRef; + correlationPropertyRef = newCorrelationPropertyRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CORRELATION_PROPERTY_BINDING__CORRELATION_PROPERTY_REF, oldCorrelationPropertyRef, + correlationPropertyRef)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY_BINDING__DATA_PATH: + return basicSetDataPath(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY_BINDING__DATA_PATH: + return getDataPath(); + case Bpmn2Package.CORRELATION_PROPERTY_BINDING__CORRELATION_PROPERTY_REF: + if (resolve) + return getCorrelationPropertyRef(); + return basicGetCorrelationPropertyRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY_BINDING__DATA_PATH: + setDataPath((FormalExpression) newValue); + return; + case Bpmn2Package.CORRELATION_PROPERTY_BINDING__CORRELATION_PROPERTY_REF: + setCorrelationPropertyRef((CorrelationProperty) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY_BINDING__DATA_PATH: + setDataPath((FormalExpression) null); + return; + case Bpmn2Package.CORRELATION_PROPERTY_BINDING__CORRELATION_PROPERTY_REF: + setCorrelationPropertyRef((CorrelationProperty) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY_BINDING__DATA_PATH: + return dataPath != null; + case Bpmn2Package.CORRELATION_PROPERTY_BINDING__CORRELATION_PROPERTY_REF: + return correlationPropertyRef != null; + } + return super.eIsSet(featureID); + } + +} //CorrelationPropertyBindingImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationPropertyImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationPropertyImpl.java new file mode 100644 index 00000000000..2e3d2f477d4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationPropertyImpl.java @@ -0,0 +1,312 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CorrelationProperty; +import org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression; +import org.eclipse.bpmn2.ItemDefinition; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Correlation Property'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CorrelationPropertyImpl#getCorrelationPropertyRetrievalExpression Correlation Property Retrieval Expression}
  • + *
  • {@link org.eclipse.bpmn2.impl.CorrelationPropertyImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.CorrelationPropertyImpl#getType Type}
  • + *
+ * + * @generated + */ +public class CorrelationPropertyImpl extends RootElementImpl implements CorrelationProperty { + /** + * The cached value of the '{@link #getCorrelationPropertyRetrievalExpression() Correlation Property Retrieval Expression}' containment reference list. + * + * + * @see #getCorrelationPropertyRetrievalExpression() + * @generated + * @ordered + */ + @GwtTransient + protected EList correlationPropertyRetrievalExpression; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getType() Type}' reference. + * + * + * @see #getType() + * @generated + * @ordered + */ + @GwtTransient + protected ItemDefinition type; + + /** + * + * + * @generated + */ + protected CorrelationPropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CORRELATION_PROPERTY; + } + + /** + * + * + * @generated + */ + @Override + public EList getCorrelationPropertyRetrievalExpression() { + if (correlationPropertyRetrievalExpression == null) { + correlationPropertyRetrievalExpression = new EObjectContainmentEList( + CorrelationPropertyRetrievalExpression.class, this, + Bpmn2Package.CORRELATION_PROPERTY__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION); + } + return correlationPropertyRetrievalExpression; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CORRELATION_PROPERTY__NAME, oldName, + name)); + } + + /** + * + * + * @generated + */ + @Override + public ItemDefinition getType() { + if (type != null && type.eIsProxy()) { + InternalEObject oldType = (InternalEObject) type; + type = (ItemDefinition) eResolveProxy(oldType); + if (type != oldType) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.CORRELATION_PROPERTY__TYPE, + oldType, type)); + } + } + return type; + } + + /** + * + * + * @generated + */ + public ItemDefinition basicGetType() { + return type; + } + + /** + * + * + * @generated + */ + @Override + public void setType(ItemDefinition newType) { + ItemDefinition oldType = type; + type = newType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.CORRELATION_PROPERTY__TYPE, oldType, + type)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION: + return ((InternalEList) getCorrelationPropertyRetrievalExpression()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION: + return getCorrelationPropertyRetrievalExpression(); + case Bpmn2Package.CORRELATION_PROPERTY__NAME: + return getName(); + case Bpmn2Package.CORRELATION_PROPERTY__TYPE: + if (resolve) + return getType(); + return basicGetType(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION: + getCorrelationPropertyRetrievalExpression().clear(); + getCorrelationPropertyRetrievalExpression() + .addAll((Collection) newValue); + return; + case Bpmn2Package.CORRELATION_PROPERTY__NAME: + setName((String) newValue); + return; + case Bpmn2Package.CORRELATION_PROPERTY__TYPE: + setType((ItemDefinition) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION: + getCorrelationPropertyRetrievalExpression().clear(); + return; + case Bpmn2Package.CORRELATION_PROPERTY__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.CORRELATION_PROPERTY__TYPE: + setType((ItemDefinition) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION: + return correlationPropertyRetrievalExpression != null && !correlationPropertyRetrievalExpression.isEmpty(); + case Bpmn2Package.CORRELATION_PROPERTY__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.CORRELATION_PROPERTY__TYPE: + return type != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //CorrelationPropertyImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationPropertyRetrievalExpressionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationPropertyRetrievalExpressionImpl.java new file mode 100644 index 00000000000..b0ae5f27d7e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationPropertyRetrievalExpressionImpl.java @@ -0,0 +1,272 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.Message; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Correlation Property Retrieval Expression'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CorrelationPropertyRetrievalExpressionImpl#getMessagePath Message Path}
  • + *
  • {@link org.eclipse.bpmn2.impl.CorrelationPropertyRetrievalExpressionImpl#getMessageRef Message Ref}
  • + *
+ * + * @generated + */ +public class CorrelationPropertyRetrievalExpressionImpl extends BaseElementImpl + implements CorrelationPropertyRetrievalExpression { + /** + * The cached value of the '{@link #getMessagePath() Message Path}' containment reference. + * + * + * @see #getMessagePath() + * @generated + * @ordered + */ + @GwtTransient + protected FormalExpression messagePath; + + /** + * The cached value of the '{@link #getMessageRef() Message Ref}' reference. + * + * + * @see #getMessageRef() + * @generated + * @ordered + */ + @GwtTransient + protected Message messageRef; + + /** + * + * + * @generated + */ + protected CorrelationPropertyRetrievalExpressionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION; + } + + /** + * + * + * @generated + */ + @Override + public FormalExpression getMessagePath() { + return messagePath; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetMessagePath(FormalExpression newMessagePath, NotificationChain msgs) { + FormalExpression oldMessagePath = messagePath; + messagePath = newMessagePath; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_PATH, oldMessagePath, + newMessagePath); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setMessagePath(FormalExpression newMessagePath) { + if (newMessagePath != messagePath) { + NotificationChain msgs = null; + if (messagePath != null) + msgs = ((InternalEObject) messagePath).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_PATH, + null, msgs); + if (newMessagePath != null) + msgs = ((InternalEObject) newMessagePath).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_PATH, + null, msgs); + msgs = basicSetMessagePath(newMessagePath, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_PATH, newMessagePath, + newMessagePath)); + } + + /** + * + * + * @generated + */ + @Override + public Message getMessageRef() { + if (messageRef != null && messageRef.eIsProxy()) { + InternalEObject oldMessageRef = (InternalEObject) messageRef; + messageRef = (Message) eResolveProxy(oldMessageRef); + if (messageRef != oldMessageRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_REF, oldMessageRef, + messageRef)); + } + } + return messageRef; + } + + /** + * + * + * @generated + */ + public Message basicGetMessageRef() { + return messageRef; + } + + /** + * + * + * @generated + */ + @Override + public void setMessageRef(Message newMessageRef) { + Message oldMessageRef = messageRef; + messageRef = newMessageRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_REF, oldMessageRef, messageRef)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_PATH: + return basicSetMessagePath(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_PATH: + return getMessagePath(); + case Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_REF: + if (resolve) + return getMessageRef(); + return basicGetMessageRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_PATH: + setMessagePath((FormalExpression) newValue); + return; + case Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_REF: + setMessageRef((Message) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_PATH: + setMessagePath((FormalExpression) null); + return; + case Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_REF: + setMessageRef((Message) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_PATH: + return messagePath != null; + case Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION__MESSAGE_REF: + return messageRef != null; + } + return super.eIsSet(featureID); + } + +} //CorrelationPropertyRetrievalExpressionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationSubscriptionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationSubscriptionImpl.java new file mode 100644 index 00000000000..01443f20e6a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/CorrelationSubscriptionImpl.java @@ -0,0 +1,240 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CorrelationKey; +import org.eclipse.bpmn2.CorrelationPropertyBinding; +import org.eclipse.bpmn2.CorrelationSubscription; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Correlation Subscription'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.CorrelationSubscriptionImpl#getCorrelationPropertyBinding Correlation Property Binding}
  • + *
  • {@link org.eclipse.bpmn2.impl.CorrelationSubscriptionImpl#getCorrelationKeyRef Correlation Key Ref}
  • + *
+ * + * @generated + */ +public class CorrelationSubscriptionImpl extends BaseElementImpl implements CorrelationSubscription { + /** + * The cached value of the '{@link #getCorrelationPropertyBinding() Correlation Property Binding}' containment reference list. + * + * + * @see #getCorrelationPropertyBinding() + * @generated + * @ordered + */ + @GwtTransient + protected EList correlationPropertyBinding; + + /** + * The cached value of the '{@link #getCorrelationKeyRef() Correlation Key Ref}' reference. + * + * + * @see #getCorrelationKeyRef() + * @generated + * @ordered + */ + @GwtTransient + protected CorrelationKey correlationKeyRef; + + /** + * + * + * @generated + */ + protected CorrelationSubscriptionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.CORRELATION_SUBSCRIPTION; + } + + /** + * + * + * @generated + */ + @Override + public EList getCorrelationPropertyBinding() { + if (correlationPropertyBinding == null) { + correlationPropertyBinding = new EObjectContainmentEList( + CorrelationPropertyBinding.class, this, + Bpmn2Package.CORRELATION_SUBSCRIPTION__CORRELATION_PROPERTY_BINDING); + } + return correlationPropertyBinding; + } + + /** + * + * + * @generated + */ + @Override + public CorrelationKey getCorrelationKeyRef() { + if (correlationKeyRef != null && correlationKeyRef.eIsProxy()) { + InternalEObject oldCorrelationKeyRef = (InternalEObject) correlationKeyRef; + correlationKeyRef = (CorrelationKey) eResolveProxy(oldCorrelationKeyRef); + if (correlationKeyRef != oldCorrelationKeyRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.CORRELATION_SUBSCRIPTION__CORRELATION_KEY_REF, oldCorrelationKeyRef, + correlationKeyRef)); + } + } + return correlationKeyRef; + } + + /** + * + * + * @generated + */ + public CorrelationKey basicGetCorrelationKeyRef() { + return correlationKeyRef; + } + + /** + * + * + * @generated + */ + @Override + public void setCorrelationKeyRef(CorrelationKey newCorrelationKeyRef) { + CorrelationKey oldCorrelationKeyRef = correlationKeyRef; + correlationKeyRef = newCorrelationKeyRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.CORRELATION_SUBSCRIPTION__CORRELATION_KEY_REF, oldCorrelationKeyRef, + correlationKeyRef)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.CORRELATION_SUBSCRIPTION__CORRELATION_PROPERTY_BINDING: + return ((InternalEList) getCorrelationPropertyBinding()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.CORRELATION_SUBSCRIPTION__CORRELATION_PROPERTY_BINDING: + return getCorrelationPropertyBinding(); + case Bpmn2Package.CORRELATION_SUBSCRIPTION__CORRELATION_KEY_REF: + if (resolve) + return getCorrelationKeyRef(); + return basicGetCorrelationKeyRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.CORRELATION_SUBSCRIPTION__CORRELATION_PROPERTY_BINDING: + getCorrelationPropertyBinding().clear(); + getCorrelationPropertyBinding().addAll((Collection) newValue); + return; + case Bpmn2Package.CORRELATION_SUBSCRIPTION__CORRELATION_KEY_REF: + setCorrelationKeyRef((CorrelationKey) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.CORRELATION_SUBSCRIPTION__CORRELATION_PROPERTY_BINDING: + getCorrelationPropertyBinding().clear(); + return; + case Bpmn2Package.CORRELATION_SUBSCRIPTION__CORRELATION_KEY_REF: + setCorrelationKeyRef((CorrelationKey) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.CORRELATION_SUBSCRIPTION__CORRELATION_PROPERTY_BINDING: + return correlationPropertyBinding != null && !correlationPropertyBinding.isEmpty(); + case Bpmn2Package.CORRELATION_SUBSCRIPTION__CORRELATION_KEY_REF: + return correlationKeyRef != null; + } + return super.eIsSet(featureID); + } + +} //CorrelationSubscriptionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataAssociationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataAssociationImpl.java new file mode 100644 index 00000000000..81fc512e588 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataAssociationImpl.java @@ -0,0 +1,332 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataAssociation; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.ItemAwareElement; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Data Association'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.DataAssociationImpl#getSourceRef Source Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataAssociationImpl#getTargetRef Target Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataAssociationImpl#getTransformation Transformation}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataAssociationImpl#getAssignment Assignment}
  • + *
+ * + * @generated + */ +public class DataAssociationImpl extends BaseElementImpl implements DataAssociation { + /** + * The cached value of the '{@link #getSourceRef() Source Ref}' reference list. + * + * + * @see #getSourceRef() + * @generated + * @ordered + */ + @GwtTransient + protected EList sourceRef; + + /** + * The cached value of the '{@link #getTargetRef() Target Ref}' reference. + * + * + * @see #getTargetRef() + * @generated + * @ordered + */ + @GwtTransient + protected ItemAwareElement targetRef; + + /** + * The cached value of the '{@link #getTransformation() Transformation}' containment reference. + * + * + * @see #getTransformation() + * @generated + * @ordered + */ + @GwtTransient + protected FormalExpression transformation; + + /** + * The cached value of the '{@link #getAssignment() Assignment}' containment reference list. + * + * + * @see #getAssignment() + * @generated + * @ordered + */ + @GwtTransient + protected EList assignment; + + /** + * + * + * @generated + */ + protected DataAssociationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.DATA_ASSOCIATION; + } + + /** + * + * + * @generated + */ + @Override + public EList getSourceRef() { + if (sourceRef == null) { + sourceRef = new EObjectEList(ItemAwareElement.class, this, + Bpmn2Package.DATA_ASSOCIATION__SOURCE_REF); + } + return sourceRef; + } + + /** + * + * + * @generated + */ + @Override + public ItemAwareElement getTargetRef() { + return targetRef; + } + + /** + * + * + * @generated + */ + @Override + public void setTargetRef(ItemAwareElement newTargetRef) { + ItemAwareElement oldTargetRef = targetRef; + targetRef = newTargetRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_ASSOCIATION__TARGET_REF, + oldTargetRef, targetRef)); + } + + /** + * + * + * @generated + */ + @Override + public FormalExpression getTransformation() { + return transformation; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTransformation(FormalExpression newTransformation, NotificationChain msgs) { + FormalExpression oldTransformation = transformation; + transformation = newTransformation; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.DATA_ASSOCIATION__TRANSFORMATION, oldTransformation, newTransformation); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setTransformation(FormalExpression newTransformation) { + if (newTransformation != transformation) { + NotificationChain msgs = null; + if (transformation != null) + msgs = ((InternalEObject) transformation).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.DATA_ASSOCIATION__TRANSFORMATION, null, msgs); + if (newTransformation != null) + msgs = ((InternalEObject) newTransformation).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.DATA_ASSOCIATION__TRANSFORMATION, null, msgs); + msgs = basicSetTransformation(newTransformation, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_ASSOCIATION__TRANSFORMATION, + newTransformation, newTransformation)); + } + + /** + * + * + * @generated + */ + @Override + public EList getAssignment() { + if (assignment == null) { + assignment = new EObjectContainmentEList(Assignment.class, this, + Bpmn2Package.DATA_ASSOCIATION__ASSIGNMENT); + } + return assignment; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.DATA_ASSOCIATION__TRANSFORMATION: + return basicSetTransformation(null, msgs); + case Bpmn2Package.DATA_ASSOCIATION__ASSIGNMENT: + return ((InternalEList) getAssignment()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.DATA_ASSOCIATION__SOURCE_REF: + return getSourceRef(); + case Bpmn2Package.DATA_ASSOCIATION__TARGET_REF: + return getTargetRef(); + case Bpmn2Package.DATA_ASSOCIATION__TRANSFORMATION: + return getTransformation(); + case Bpmn2Package.DATA_ASSOCIATION__ASSIGNMENT: + return getAssignment(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.DATA_ASSOCIATION__SOURCE_REF: + getSourceRef().clear(); + getSourceRef().addAll((Collection) newValue); + return; + case Bpmn2Package.DATA_ASSOCIATION__TARGET_REF: + setTargetRef((ItemAwareElement) newValue); + return; + case Bpmn2Package.DATA_ASSOCIATION__TRANSFORMATION: + setTransformation((FormalExpression) newValue); + return; + case Bpmn2Package.DATA_ASSOCIATION__ASSIGNMENT: + getAssignment().clear(); + getAssignment().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_ASSOCIATION__SOURCE_REF: + getSourceRef().clear(); + return; + case Bpmn2Package.DATA_ASSOCIATION__TARGET_REF: + setTargetRef((ItemAwareElement) null); + return; + case Bpmn2Package.DATA_ASSOCIATION__TRANSFORMATION: + setTransformation((FormalExpression) null); + return; + case Bpmn2Package.DATA_ASSOCIATION__ASSIGNMENT: + getAssignment().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_ASSOCIATION__SOURCE_REF: + return sourceRef != null && !sourceRef.isEmpty(); + case Bpmn2Package.DATA_ASSOCIATION__TARGET_REF: + return targetRef != null; + case Bpmn2Package.DATA_ASSOCIATION__TRANSFORMATION: + return transformation != null; + case Bpmn2Package.DATA_ASSOCIATION__ASSIGNMENT: + return assignment != null && !assignment.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //DataAssociationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataInputAssociationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataInputAssociationImpl.java new file mode 100644 index 00000000000..1924a606a26 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataInputAssociationImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataInputAssociation; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Data Input Association'. + * + * + * @generated + */ +public class DataInputAssociationImpl extends DataAssociationImpl implements DataInputAssociation { + /** + * + * + * @generated + */ + protected DataInputAssociationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.DATA_INPUT_ASSOCIATION; + } + +} //DataInputAssociationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataInputImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataInputImpl.java new file mode 100644 index 00000000000..0d116ff4875 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataInputImpl.java @@ -0,0 +1,400 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.InputSet; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Data Input'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.DataInputImpl#getInputSetWithOptional Input Set With Optional}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataInputImpl#getInputSetWithWhileExecuting Input Set With While Executing}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataInputImpl#getInputSetRefs Input Set Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataInputImpl#isIsCollection Is Collection}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataInputImpl#getName Name}
  • + *
+ * + * @generated + */ +public class DataInputImpl extends ItemAwareElementImpl implements DataInput { + /** + * The cached value of the '{@link #getInputSetWithOptional() Input Set With Optional}' reference list. + * + * + * @see #getInputSetWithOptional() + * @generated + * @ordered + */ + @GwtTransient + protected EList inputSetWithOptional; + + /** + * The cached value of the '{@link #getInputSetWithWhileExecuting() Input Set With While Executing}' reference list. + * + * + * @see #getInputSetWithWhileExecuting() + * @generated + * @ordered + */ + @GwtTransient + protected EList inputSetWithWhileExecuting; + + /** + * The cached value of the '{@link #getInputSetRefs() Input Set Refs}' reference list. + * + * + * @see #getInputSetRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList inputSetRefs; + + /** + * The default value of the '{@link #isIsCollection() Is Collection}' attribute. + * + * + * @see #isIsCollection() + * @generated + * @ordered + */ + protected static final boolean IS_COLLECTION_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsCollection() Is Collection}' attribute. + * + * + * @see #isIsCollection() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isCollection = IS_COLLECTION_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected DataInputImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.DATA_INPUT; + } + + /** + * + * + * @generated + */ + @Override + public EList getInputSetWithOptional() { + if (inputSetWithOptional == null) { + inputSetWithOptional = new EObjectWithInverseResolvingEList.ManyInverse(InputSet.class, this, + Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_OPTIONAL, Bpmn2Package.INPUT_SET__OPTIONAL_INPUT_REFS); + } + return inputSetWithOptional; + } + + /** + * + * + * @generated + */ + @Override + public EList getInputSetWithWhileExecuting() { + if (inputSetWithWhileExecuting == null) { + inputSetWithWhileExecuting = new EObjectWithInverseResolvingEList.ManyInverse(InputSet.class, + this, Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_WHILE_EXECUTING, + Bpmn2Package.INPUT_SET__WHILE_EXECUTING_INPUT_REFS); + } + return inputSetWithWhileExecuting; + } + + /** + * + * + * @generated + */ + @Override + public EList getInputSetRefs() { + if (inputSetRefs == null) { + inputSetRefs = new EObjectWithInverseResolvingEList.ManyInverse(InputSet.class, this, + Bpmn2Package.DATA_INPUT__INPUT_SET_REFS, Bpmn2Package.INPUT_SET__DATA_INPUT_REFS); + } + return inputSetRefs; + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsCollection() { + return isCollection; + } + + /** + * + * + * @generated + */ + @Override + public void setIsCollection(boolean newIsCollection) { + boolean oldIsCollection = isCollection; + isCollection = newIsCollection; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_INPUT__IS_COLLECTION, + oldIsCollection, isCollection)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_INPUT__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_OPTIONAL: + return ((InternalEList) (InternalEList) getInputSetWithOptional()).basicAdd(otherEnd, + msgs); + case Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_WHILE_EXECUTING: + return ((InternalEList) (InternalEList) getInputSetWithWhileExecuting()) + .basicAdd(otherEnd, msgs); + case Bpmn2Package.DATA_INPUT__INPUT_SET_REFS: + return ((InternalEList) (InternalEList) getInputSetRefs()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_OPTIONAL: + return ((InternalEList) getInputSetWithOptional()).basicRemove(otherEnd, msgs); + case Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_WHILE_EXECUTING: + return ((InternalEList) getInputSetWithWhileExecuting()).basicRemove(otherEnd, msgs); + case Bpmn2Package.DATA_INPUT__INPUT_SET_REFS: + return ((InternalEList) getInputSetRefs()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_OPTIONAL: + return getInputSetWithOptional(); + case Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_WHILE_EXECUTING: + return getInputSetWithWhileExecuting(); + case Bpmn2Package.DATA_INPUT__INPUT_SET_REFS: + return getInputSetRefs(); + case Bpmn2Package.DATA_INPUT__IS_COLLECTION: + return isIsCollection(); + case Bpmn2Package.DATA_INPUT__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_OPTIONAL: + getInputSetWithOptional().clear(); + getInputSetWithOptional().addAll((Collection) newValue); + return; + case Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_WHILE_EXECUTING: + getInputSetWithWhileExecuting().clear(); + getInputSetWithWhileExecuting().addAll((Collection) newValue); + return; + case Bpmn2Package.DATA_INPUT__INPUT_SET_REFS: + getInputSetRefs().clear(); + getInputSetRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.DATA_INPUT__IS_COLLECTION: + setIsCollection((Boolean) newValue); + return; + case Bpmn2Package.DATA_INPUT__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_OPTIONAL: + getInputSetWithOptional().clear(); + return; + case Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_WHILE_EXECUTING: + getInputSetWithWhileExecuting().clear(); + return; + case Bpmn2Package.DATA_INPUT__INPUT_SET_REFS: + getInputSetRefs().clear(); + return; + case Bpmn2Package.DATA_INPUT__IS_COLLECTION: + setIsCollection(IS_COLLECTION_EDEFAULT); + return; + case Bpmn2Package.DATA_INPUT__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_OPTIONAL: + return inputSetWithOptional != null && !inputSetWithOptional.isEmpty(); + case Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_WHILE_EXECUTING: + return inputSetWithWhileExecuting != null && !inputSetWithWhileExecuting.isEmpty(); + case Bpmn2Package.DATA_INPUT__INPUT_SET_REFS: + return inputSetRefs != null && !inputSetRefs.isEmpty(); + case Bpmn2Package.DATA_INPUT__IS_COLLECTION: + return isCollection != IS_COLLECTION_EDEFAULT; + case Bpmn2Package.DATA_INPUT__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (isCollection: "); + result.append(isCollection); + result.append(", name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //DataInputImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataObjectImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataObjectImpl.java new file mode 100644 index 00000000000..f7c38657ca7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataObjectImpl.java @@ -0,0 +1,380 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataObject; +import org.eclipse.bpmn2.DataState; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.ItemDefinition; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Data Object'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.DataObjectImpl#getDataState Data State}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataObjectImpl#getItemSubjectRef Item Subject Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataObjectImpl#isIsCollection Is Collection}
  • + *
+ * + * @generated + */ +public class DataObjectImpl extends FlowElementImpl implements DataObject { + /** + * The cached value of the '{@link #getDataState() Data State}' containment reference. + * + * + * @see #getDataState() + * @generated + * @ordered + */ + @GwtTransient + protected DataState dataState; + + /** + * The cached value of the '{@link #getItemSubjectRef() Item Subject Ref}' reference. + * + * + * @see #getItemSubjectRef() + * @generated + * @ordered + */ + @GwtTransient + protected ItemDefinition itemSubjectRef; + + /** + * The default value of the '{@link #isIsCollection() Is Collection}' attribute. + * + * + * @see #isIsCollection() + * @generated + * @ordered + */ + protected static final boolean IS_COLLECTION_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsCollection() Is Collection}' attribute. + * + * + * @see #isIsCollection() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isCollection = IS_COLLECTION_EDEFAULT; + + /** + * + * + * @generated + */ + protected DataObjectImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.DATA_OBJECT; + } + + /** + * + * + * @generated + */ + @Override + public DataState getDataState() { + return dataState; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataState(DataState newDataState, NotificationChain msgs) { + DataState oldDataState = dataState; + dataState = newDataState; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.DATA_OBJECT__DATA_STATE, oldDataState, newDataState); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setDataState(DataState newDataState) { + if (newDataState != dataState) { + NotificationChain msgs = null; + if (dataState != null) + msgs = ((InternalEObject) dataState).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.DATA_OBJECT__DATA_STATE, null, msgs); + if (newDataState != null) + msgs = ((InternalEObject) newDataState).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.DATA_OBJECT__DATA_STATE, null, msgs); + msgs = basicSetDataState(newDataState, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_OBJECT__DATA_STATE, newDataState, + newDataState)); + } + + /** + * + * + * @generated + */ + @Override + public ItemDefinition getItemSubjectRef() { + if (itemSubjectRef != null && itemSubjectRef.eIsProxy()) { + InternalEObject oldItemSubjectRef = (InternalEObject) itemSubjectRef; + itemSubjectRef = (ItemDefinition) eResolveProxy(oldItemSubjectRef); + if (itemSubjectRef != oldItemSubjectRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF, oldItemSubjectRef, itemSubjectRef)); + } + } + return itemSubjectRef; + } + + /** + * + * + * @generated + */ + public ItemDefinition basicGetItemSubjectRef() { + return itemSubjectRef; + } + + /** + * + * + * @generated + */ + @Override + public void setItemSubjectRef(ItemDefinition newItemSubjectRef) { + ItemDefinition oldItemSubjectRef = itemSubjectRef; + itemSubjectRef = newItemSubjectRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF, + oldItemSubjectRef, itemSubjectRef)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsCollection() { + return isCollection; + } + + /** + * + * + * @generated + */ + @Override + public void setIsCollection(boolean newIsCollection) { + boolean oldIsCollection = isCollection; + isCollection = newIsCollection; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_OBJECT__IS_COLLECTION, + oldIsCollection, isCollection)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.DATA_OBJECT__DATA_STATE: + return basicSetDataState(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.DATA_OBJECT__DATA_STATE: + return getDataState(); + case Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF: + if (resolve) + return getItemSubjectRef(); + return basicGetItemSubjectRef(); + case Bpmn2Package.DATA_OBJECT__IS_COLLECTION: + return isIsCollection(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.DATA_OBJECT__DATA_STATE: + setDataState((DataState) newValue); + return; + case Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF: + setItemSubjectRef((ItemDefinition) newValue); + return; + case Bpmn2Package.DATA_OBJECT__IS_COLLECTION: + setIsCollection((Boolean) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_OBJECT__DATA_STATE: + setDataState((DataState) null); + return; + case Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF: + setItemSubjectRef((ItemDefinition) null); + return; + case Bpmn2Package.DATA_OBJECT__IS_COLLECTION: + setIsCollection(IS_COLLECTION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_OBJECT__DATA_STATE: + return dataState != null; + case Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF: + return itemSubjectRef != null; + case Bpmn2Package.DATA_OBJECT__IS_COLLECTION: + return isCollection != IS_COLLECTION_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == ItemAwareElement.class) { + switch (derivedFeatureID) { + case Bpmn2Package.DATA_OBJECT__DATA_STATE: + return Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE; + case Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF: + return Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == ItemAwareElement.class) { + switch (baseFeatureID) { + case Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE: + return Bpmn2Package.DATA_OBJECT__DATA_STATE; + case Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF: + return Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (isCollection: "); + result.append(isCollection); + result.append(')'); + return result.toString(); + } + +} //DataObjectImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataObjectReferenceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataObjectReferenceImpl.java new file mode 100644 index 00000000000..0042dff96c6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataObjectReferenceImpl.java @@ -0,0 +1,354 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataObject; +import org.eclipse.bpmn2.DataObjectReference; +import org.eclipse.bpmn2.DataState; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.ItemDefinition; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Data Object Reference'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.DataObjectReferenceImpl#getDataState Data State}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataObjectReferenceImpl#getItemSubjectRef Item Subject Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataObjectReferenceImpl#getDataObjectRef Data Object Ref}
  • + *
+ * + * @generated + */ +public class DataObjectReferenceImpl extends FlowElementImpl implements DataObjectReference { + /** + * The cached value of the '{@link #getDataState() Data State}' containment reference. + * + * + * @see #getDataState() + * @generated + * @ordered + */ + @GwtTransient + protected DataState dataState; + + /** + * The cached value of the '{@link #getItemSubjectRef() Item Subject Ref}' reference. + * + * + * @see #getItemSubjectRef() + * @generated + * @ordered + */ + @GwtTransient + protected ItemDefinition itemSubjectRef; + + /** + * The cached value of the '{@link #getDataObjectRef() Data Object Ref}' reference. + * + * + * @see #getDataObjectRef() + * @generated + * @ordered + */ + @GwtTransient + protected DataObject dataObjectRef; + + /** + * + * + * @generated + */ + protected DataObjectReferenceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.DATA_OBJECT_REFERENCE; + } + + /** + * + * + * @generated + */ + @Override + public DataState getDataState() { + return dataState; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataState(DataState newDataState, NotificationChain msgs) { + DataState oldDataState = dataState; + dataState = newDataState; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_STATE, oldDataState, newDataState); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setDataState(DataState newDataState) { + if (newDataState != dataState) { + NotificationChain msgs = null; + if (dataState != null) + msgs = ((InternalEObject) dataState).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_STATE, null, msgs); + if (newDataState != null) + msgs = ((InternalEObject) newDataState).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_STATE, null, msgs); + msgs = basicSetDataState(newDataState, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_STATE, + newDataState, newDataState)); + } + + /** + * + * + * @generated + */ + @Override + public ItemDefinition getItemSubjectRef() { + if (itemSubjectRef != null && itemSubjectRef.eIsProxy()) { + InternalEObject oldItemSubjectRef = (InternalEObject) itemSubjectRef; + itemSubjectRef = (ItemDefinition) eResolveProxy(oldItemSubjectRef); + if (itemSubjectRef != oldItemSubjectRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.DATA_OBJECT_REFERENCE__ITEM_SUBJECT_REF, oldItemSubjectRef, itemSubjectRef)); + } + } + return itemSubjectRef; + } + + /** + * + * + * @generated + */ + public ItemDefinition basicGetItemSubjectRef() { + return itemSubjectRef; + } + + /** + * + * + * @generated + */ + @Override + public void setItemSubjectRef(ItemDefinition newItemSubjectRef) { + ItemDefinition oldItemSubjectRef = itemSubjectRef; + itemSubjectRef = newItemSubjectRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_OBJECT_REFERENCE__ITEM_SUBJECT_REF, + oldItemSubjectRef, itemSubjectRef)); + } + + /** + * + * + * @generated + */ + @Override + public DataObject getDataObjectRef() { + return dataObjectRef; + } + + /** + * + * + * @generated + */ + @Override + public void setDataObjectRef(DataObject newDataObjectRef) { + DataObject oldDataObjectRef = dataObjectRef; + dataObjectRef = newDataObjectRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_OBJECT_REF, + oldDataObjectRef, dataObjectRef)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_STATE: + return basicSetDataState(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_STATE: + return getDataState(); + case Bpmn2Package.DATA_OBJECT_REFERENCE__ITEM_SUBJECT_REF: + if (resolve) + return getItemSubjectRef(); + return basicGetItemSubjectRef(); + case Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_OBJECT_REF: + return getDataObjectRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_STATE: + setDataState((DataState) newValue); + return; + case Bpmn2Package.DATA_OBJECT_REFERENCE__ITEM_SUBJECT_REF: + setItemSubjectRef((ItemDefinition) newValue); + return; + case Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_OBJECT_REF: + setDataObjectRef((DataObject) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_STATE: + setDataState((DataState) null); + return; + case Bpmn2Package.DATA_OBJECT_REFERENCE__ITEM_SUBJECT_REF: + setItemSubjectRef((ItemDefinition) null); + return; + case Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_OBJECT_REF: + setDataObjectRef((DataObject) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_STATE: + return dataState != null; + case Bpmn2Package.DATA_OBJECT_REFERENCE__ITEM_SUBJECT_REF: + return itemSubjectRef != null; + case Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_OBJECT_REF: + return dataObjectRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == ItemAwareElement.class) { + switch (derivedFeatureID) { + case Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_STATE: + return Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE; + case Bpmn2Package.DATA_OBJECT_REFERENCE__ITEM_SUBJECT_REF: + return Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == ItemAwareElement.class) { + switch (baseFeatureID) { + case Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE: + return Bpmn2Package.DATA_OBJECT_REFERENCE__DATA_STATE; + case Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF: + return Bpmn2Package.DATA_OBJECT_REFERENCE__ITEM_SUBJECT_REF; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + +} //DataObjectReferenceImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataOutputAssociationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataOutputAssociationImpl.java new file mode 100644 index 00000000000..0a9e2f642cf --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataOutputAssociationImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataOutputAssociation; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Data Output Association'. + * + * + * @generated + */ +public class DataOutputAssociationImpl extends DataAssociationImpl implements DataOutputAssociation { + /** + * + * + * @generated + */ + protected DataOutputAssociationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.DATA_OUTPUT_ASSOCIATION; + } + +} //DataOutputAssociationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataOutputImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataOutputImpl.java new file mode 100644 index 00000000000..41c1f123ec4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataOutputImpl.java @@ -0,0 +1,400 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.OutputSet; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Data Output'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.DataOutputImpl#getOutputSetWithOptional Output Set With Optional}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataOutputImpl#getOutputSetWithWhileExecuting Output Set With While Executing}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataOutputImpl#getOutputSetRefs Output Set Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataOutputImpl#isIsCollection Is Collection}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataOutputImpl#getName Name}
  • + *
+ * + * @generated + */ +public class DataOutputImpl extends ItemAwareElementImpl implements DataOutput { + /** + * The cached value of the '{@link #getOutputSetWithOptional() Output Set With Optional}' reference list. + * + * + * @see #getOutputSetWithOptional() + * @generated + * @ordered + */ + @GwtTransient + protected EList outputSetWithOptional; + + /** + * The cached value of the '{@link #getOutputSetWithWhileExecuting() Output Set With While Executing}' reference list. + * + * + * @see #getOutputSetWithWhileExecuting() + * @generated + * @ordered + */ + @GwtTransient + protected EList outputSetWithWhileExecuting; + + /** + * The cached value of the '{@link #getOutputSetRefs() Output Set Refs}' reference list. + * + * + * @see #getOutputSetRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList outputSetRefs; + + /** + * The default value of the '{@link #isIsCollection() Is Collection}' attribute. + * + * + * @see #isIsCollection() + * @generated + * @ordered + */ + protected static final boolean IS_COLLECTION_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsCollection() Is Collection}' attribute. + * + * + * @see #isIsCollection() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isCollection = IS_COLLECTION_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected DataOutputImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.DATA_OUTPUT; + } + + /** + * + * + * @generated + */ + @Override + public EList getOutputSetWithOptional() { + if (outputSetWithOptional == null) { + outputSetWithOptional = new EObjectWithInverseResolvingEList.ManyInverse(OutputSet.class, this, + Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_OPTIONAL, Bpmn2Package.OUTPUT_SET__OPTIONAL_OUTPUT_REFS); + } + return outputSetWithOptional; + } + + /** + * + * + * @generated + */ + @Override + public EList getOutputSetWithWhileExecuting() { + if (outputSetWithWhileExecuting == null) { + outputSetWithWhileExecuting = new EObjectWithInverseResolvingEList.ManyInverse(OutputSet.class, + this, Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_WHILE_EXECUTING, + Bpmn2Package.OUTPUT_SET__WHILE_EXECUTING_OUTPUT_REFS); + } + return outputSetWithWhileExecuting; + } + + /** + * + * + * @generated + */ + @Override + public EList getOutputSetRefs() { + if (outputSetRefs == null) { + outputSetRefs = new EObjectWithInverseResolvingEList.ManyInverse(OutputSet.class, this, + Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_REFS, Bpmn2Package.OUTPUT_SET__DATA_OUTPUT_REFS); + } + return outputSetRefs; + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsCollection() { + return isCollection; + } + + /** + * + * + * @generated + */ + @Override + public void setIsCollection(boolean newIsCollection) { + boolean oldIsCollection = isCollection; + isCollection = newIsCollection; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_OUTPUT__IS_COLLECTION, + oldIsCollection, isCollection)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_OUTPUT__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_OPTIONAL: + return ((InternalEList) (InternalEList) getOutputSetWithOptional()).basicAdd(otherEnd, + msgs); + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_WHILE_EXECUTING: + return ((InternalEList) (InternalEList) getOutputSetWithWhileExecuting()) + .basicAdd(otherEnd, msgs); + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_REFS: + return ((InternalEList) (InternalEList) getOutputSetRefs()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_OPTIONAL: + return ((InternalEList) getOutputSetWithOptional()).basicRemove(otherEnd, msgs); + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_WHILE_EXECUTING: + return ((InternalEList) getOutputSetWithWhileExecuting()).basicRemove(otherEnd, msgs); + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_REFS: + return ((InternalEList) getOutputSetRefs()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_OPTIONAL: + return getOutputSetWithOptional(); + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_WHILE_EXECUTING: + return getOutputSetWithWhileExecuting(); + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_REFS: + return getOutputSetRefs(); + case Bpmn2Package.DATA_OUTPUT__IS_COLLECTION: + return isIsCollection(); + case Bpmn2Package.DATA_OUTPUT__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_OPTIONAL: + getOutputSetWithOptional().clear(); + getOutputSetWithOptional().addAll((Collection) newValue); + return; + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_WHILE_EXECUTING: + getOutputSetWithWhileExecuting().clear(); + getOutputSetWithWhileExecuting().addAll((Collection) newValue); + return; + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_REFS: + getOutputSetRefs().clear(); + getOutputSetRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.DATA_OUTPUT__IS_COLLECTION: + setIsCollection((Boolean) newValue); + return; + case Bpmn2Package.DATA_OUTPUT__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_OPTIONAL: + getOutputSetWithOptional().clear(); + return; + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_WHILE_EXECUTING: + getOutputSetWithWhileExecuting().clear(); + return; + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_REFS: + getOutputSetRefs().clear(); + return; + case Bpmn2Package.DATA_OUTPUT__IS_COLLECTION: + setIsCollection(IS_COLLECTION_EDEFAULT); + return; + case Bpmn2Package.DATA_OUTPUT__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_OPTIONAL: + return outputSetWithOptional != null && !outputSetWithOptional.isEmpty(); + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_WHILE_EXECUTING: + return outputSetWithWhileExecuting != null && !outputSetWithWhileExecuting.isEmpty(); + case Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_REFS: + return outputSetRefs != null && !outputSetRefs.isEmpty(); + case Bpmn2Package.DATA_OUTPUT__IS_COLLECTION: + return isCollection != IS_COLLECTION_EDEFAULT; + case Bpmn2Package.DATA_OUTPUT__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (isCollection: "); + result.append(isCollection); + result.append(", name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //DataOutputImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataStateImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataStateImpl.java new file mode 100644 index 00000000000..caaba02657f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataStateImpl.java @@ -0,0 +1,180 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataState; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Data State'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.DataStateImpl#getName Name}
  • + *
+ * + * @generated + */ +public class DataStateImpl extends BaseElementImpl implements DataState { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected DataStateImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.DATA_STATE; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_STATE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.DATA_STATE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.DATA_STATE__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_STATE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_STATE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //DataStateImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataStoreImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataStoreImpl.java new file mode 100644 index 00000000000..600d09737e4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataStoreImpl.java @@ -0,0 +1,296 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataStore; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Data Store'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.DataStoreImpl#getCapacity Capacity}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataStoreImpl#isIsUnlimited Is Unlimited}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataStoreImpl#getName Name}
  • + *
+ * + * @generated + */ +public class DataStoreImpl extends ItemAwareElementImpl implements DataStore { + /** + * The default value of the '{@link #getCapacity() Capacity}' attribute. + * + * + * @see #getCapacity() + * @generated + * @ordered + */ + protected static final int CAPACITY_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getCapacity() Capacity}' attribute. + * + * + * @see #getCapacity() + * @generated + * @ordered + */ + @GwtTransient + protected int capacity = CAPACITY_EDEFAULT; + + /** + * The default value of the '{@link #isIsUnlimited() Is Unlimited}' attribute. + * + * + * @see #isIsUnlimited() + * @generated + * @ordered + */ + protected static final boolean IS_UNLIMITED_EDEFAULT = true; + + /** + * The cached value of the '{@link #isIsUnlimited() Is Unlimited}' attribute. + * + * + * @see #isIsUnlimited() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isUnlimited = IS_UNLIMITED_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected DataStoreImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.DATA_STORE; + } + + /** + * + * + * @generated + */ + @Override + public int getCapacity() { + return capacity; + } + + /** + * + * + * @generated + */ + @Override + public void setCapacity(int newCapacity) { + int oldCapacity = capacity; + capacity = newCapacity; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_STORE__CAPACITY, oldCapacity, + capacity)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsUnlimited() { + return isUnlimited; + } + + /** + * + * + * @generated + */ + @Override + public void setIsUnlimited(boolean newIsUnlimited) { + boolean oldIsUnlimited = isUnlimited; + isUnlimited = newIsUnlimited; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_STORE__IS_UNLIMITED, oldIsUnlimited, + isUnlimited)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_STORE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.DATA_STORE__CAPACITY: + return getCapacity(); + case Bpmn2Package.DATA_STORE__IS_UNLIMITED: + return isIsUnlimited(); + case Bpmn2Package.DATA_STORE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.DATA_STORE__CAPACITY: + setCapacity((Integer) newValue); + return; + case Bpmn2Package.DATA_STORE__IS_UNLIMITED: + setIsUnlimited((Boolean) newValue); + return; + case Bpmn2Package.DATA_STORE__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_STORE__CAPACITY: + setCapacity(CAPACITY_EDEFAULT); + return; + case Bpmn2Package.DATA_STORE__IS_UNLIMITED: + setIsUnlimited(IS_UNLIMITED_EDEFAULT); + return; + case Bpmn2Package.DATA_STORE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_STORE__CAPACITY: + return capacity != CAPACITY_EDEFAULT; + case Bpmn2Package.DATA_STORE__IS_UNLIMITED: + return isUnlimited != IS_UNLIMITED_EDEFAULT; + case Bpmn2Package.DATA_STORE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (capacity: "); + result.append(capacity); + result.append(", isUnlimited: "); + result.append(isUnlimited); + result.append(", name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //DataStoreImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataStoreReferenceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataStoreReferenceImpl.java new file mode 100644 index 00000000000..24416691e16 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DataStoreReferenceImpl.java @@ -0,0 +1,374 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataState; +import org.eclipse.bpmn2.DataStore; +import org.eclipse.bpmn2.DataStoreReference; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.ItemDefinition; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Data Store Reference'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.DataStoreReferenceImpl#getDataState Data State}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataStoreReferenceImpl#getItemSubjectRef Item Subject Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.DataStoreReferenceImpl#getDataStoreRef Data Store Ref}
  • + *
+ * + * @generated + */ +public class DataStoreReferenceImpl extends FlowElementImpl implements DataStoreReference { + /** + * The cached value of the '{@link #getDataState() Data State}' containment reference. + * + * + * @see #getDataState() + * @generated + * @ordered + */ + @GwtTransient + protected DataState dataState; + + /** + * The cached value of the '{@link #getItemSubjectRef() Item Subject Ref}' reference. + * + * + * @see #getItemSubjectRef() + * @generated + * @ordered + */ + @GwtTransient + protected ItemDefinition itemSubjectRef; + + /** + * The cached value of the '{@link #getDataStoreRef() Data Store Ref}' reference. + * + * + * @see #getDataStoreRef() + * @generated + * @ordered + */ + @GwtTransient + protected DataStore dataStoreRef; + + /** + * + * + * @generated + */ + protected DataStoreReferenceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.DATA_STORE_REFERENCE; + } + + /** + * + * + * @generated + */ + @Override + public DataState getDataState() { + return dataState; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataState(DataState newDataState, NotificationChain msgs) { + DataState oldDataState = dataState; + dataState = newDataState; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.DATA_STORE_REFERENCE__DATA_STATE, oldDataState, newDataState); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setDataState(DataState newDataState) { + if (newDataState != dataState) { + NotificationChain msgs = null; + if (dataState != null) + msgs = ((InternalEObject) dataState).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.DATA_STORE_REFERENCE__DATA_STATE, null, msgs); + if (newDataState != null) + msgs = ((InternalEObject) newDataState).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.DATA_STORE_REFERENCE__DATA_STATE, null, msgs); + msgs = basicSetDataState(newDataState, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_STORE_REFERENCE__DATA_STATE, + newDataState, newDataState)); + } + + /** + * + * + * @generated + */ + @Override + public ItemDefinition getItemSubjectRef() { + if (itemSubjectRef != null && itemSubjectRef.eIsProxy()) { + InternalEObject oldItemSubjectRef = (InternalEObject) itemSubjectRef; + itemSubjectRef = (ItemDefinition) eResolveProxy(oldItemSubjectRef); + if (itemSubjectRef != oldItemSubjectRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.DATA_STORE_REFERENCE__ITEM_SUBJECT_REF, oldItemSubjectRef, itemSubjectRef)); + } + } + return itemSubjectRef; + } + + /** + * + * + * @generated + */ + public ItemDefinition basicGetItemSubjectRef() { + return itemSubjectRef; + } + + /** + * + * + * @generated + */ + @Override + public void setItemSubjectRef(ItemDefinition newItemSubjectRef) { + ItemDefinition oldItemSubjectRef = itemSubjectRef; + itemSubjectRef = newItemSubjectRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_STORE_REFERENCE__ITEM_SUBJECT_REF, + oldItemSubjectRef, itemSubjectRef)); + } + + /** + * + * + * @generated + */ + @Override + public DataStore getDataStoreRef() { + if (dataStoreRef != null && dataStoreRef.eIsProxy()) { + InternalEObject oldDataStoreRef = (InternalEObject) dataStoreRef; + dataStoreRef = (DataStore) eResolveProxy(oldDataStoreRef); + if (dataStoreRef != oldDataStoreRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.DATA_STORE_REFERENCE__DATA_STORE_REF, oldDataStoreRef, dataStoreRef)); + } + } + return dataStoreRef; + } + + /** + * + * + * @generated + */ + public DataStore basicGetDataStoreRef() { + return dataStoreRef; + } + + /** + * + * + * @generated + */ + @Override + public void setDataStoreRef(DataStore newDataStoreRef) { + DataStore oldDataStoreRef = dataStoreRef; + dataStoreRef = newDataStoreRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_STORE_REFERENCE__DATA_STORE_REF, + oldDataStoreRef, dataStoreRef)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.DATA_STORE_REFERENCE__DATA_STATE: + return basicSetDataState(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.DATA_STORE_REFERENCE__DATA_STATE: + return getDataState(); + case Bpmn2Package.DATA_STORE_REFERENCE__ITEM_SUBJECT_REF: + if (resolve) + return getItemSubjectRef(); + return basicGetItemSubjectRef(); + case Bpmn2Package.DATA_STORE_REFERENCE__DATA_STORE_REF: + if (resolve) + return getDataStoreRef(); + return basicGetDataStoreRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.DATA_STORE_REFERENCE__DATA_STATE: + setDataState((DataState) newValue); + return; + case Bpmn2Package.DATA_STORE_REFERENCE__ITEM_SUBJECT_REF: + setItemSubjectRef((ItemDefinition) newValue); + return; + case Bpmn2Package.DATA_STORE_REFERENCE__DATA_STORE_REF: + setDataStoreRef((DataStore) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_STORE_REFERENCE__DATA_STATE: + setDataState((DataState) null); + return; + case Bpmn2Package.DATA_STORE_REFERENCE__ITEM_SUBJECT_REF: + setItemSubjectRef((ItemDefinition) null); + return; + case Bpmn2Package.DATA_STORE_REFERENCE__DATA_STORE_REF: + setDataStoreRef((DataStore) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.DATA_STORE_REFERENCE__DATA_STATE: + return dataState != null; + case Bpmn2Package.DATA_STORE_REFERENCE__ITEM_SUBJECT_REF: + return itemSubjectRef != null; + case Bpmn2Package.DATA_STORE_REFERENCE__DATA_STORE_REF: + return dataStoreRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == ItemAwareElement.class) { + switch (derivedFeatureID) { + case Bpmn2Package.DATA_STORE_REFERENCE__DATA_STATE: + return Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE; + case Bpmn2Package.DATA_STORE_REFERENCE__ITEM_SUBJECT_REF: + return Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == ItemAwareElement.class) { + switch (baseFeatureID) { + case Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE: + return Bpmn2Package.DATA_STORE_REFERENCE__DATA_STATE; + case Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF: + return Bpmn2Package.DATA_STORE_REFERENCE__ITEM_SUBJECT_REF; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + +} //DataStoreReferenceImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DefinitionsImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DefinitionsImpl.java new file mode 100644 index 00000000000..5580888f460 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DefinitionsImpl.java @@ -0,0 +1,695 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.Extension; +import org.eclipse.bpmn2.Import; +import org.eclipse.bpmn2.Relationship; +import org.eclipse.bpmn2.RootElement; + +import org.eclipse.bpmn2.di.BPMNDiagram; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Definitions'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.DefinitionsImpl#getImports Imports}
  • + *
  • {@link org.eclipse.bpmn2.impl.DefinitionsImpl#getExtensions Extensions}
  • + *
  • {@link org.eclipse.bpmn2.impl.DefinitionsImpl#getRootElements Root Elements}
  • + *
  • {@link org.eclipse.bpmn2.impl.DefinitionsImpl#getDiagrams Diagrams}
  • + *
  • {@link org.eclipse.bpmn2.impl.DefinitionsImpl#getRelationships Relationships}
  • + *
  • {@link org.eclipse.bpmn2.impl.DefinitionsImpl#getExporter Exporter}
  • + *
  • {@link org.eclipse.bpmn2.impl.DefinitionsImpl#getExporterVersion Exporter Version}
  • + *
  • {@link org.eclipse.bpmn2.impl.DefinitionsImpl#getExpressionLanguage Expression Language}
  • + *
  • {@link org.eclipse.bpmn2.impl.DefinitionsImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.DefinitionsImpl#getTargetNamespace Target Namespace}
  • + *
  • {@link org.eclipse.bpmn2.impl.DefinitionsImpl#getTypeLanguage Type Language}
  • + *
+ * + * @generated + */ +public class DefinitionsImpl extends BaseElementImpl implements Definitions { + /** + * The cached value of the '{@link #getImports() Imports}' containment reference list. + * + * + * @see #getImports() + * @generated + * @ordered + */ + @GwtTransient + protected EList imports; + + /** + * The cached value of the '{@link #getExtensions() Extensions}' containment reference list. + * + * + * @see #getExtensions() + * @generated + * @ordered + */ + @GwtTransient + protected EList extensions; + + /** + * The cached value of the '{@link #getRootElements() Root Elements}' containment reference list. + * + * + * @see #getRootElements() + * @generated + * @ordered + */ + @GwtTransient + protected EList rootElements; + + /** + * The cached value of the '{@link #getDiagrams() Diagrams}' containment reference list. + * + * + * @see #getDiagrams() + * @generated + * @ordered + */ + @GwtTransient + protected EList diagrams; + + /** + * The cached value of the '{@link #getRelationships() Relationships}' containment reference list. + * + * + * @see #getRelationships() + * @generated + * @ordered + */ + @GwtTransient + protected EList relationships; + + /** + * The default value of the '{@link #getExporter() Exporter}' attribute. + * + * + * @see #getExporter() + * @generated + * @ordered + */ + protected static final String EXPORTER_EDEFAULT = null; + + /** + * The cached value of the '{@link #getExporter() Exporter}' attribute. + * + * + * @see #getExporter() + * @generated + * @ordered + */ + @GwtTransient + protected String exporter = EXPORTER_EDEFAULT; + + /** + * The default value of the '{@link #getExporterVersion() Exporter Version}' attribute. + * + * + * @see #getExporterVersion() + * @generated + * @ordered + */ + protected static final String EXPORTER_VERSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getExporterVersion() Exporter Version}' attribute. + * + * + * @see #getExporterVersion() + * @generated + * @ordered + */ + @GwtTransient + protected String exporterVersion = EXPORTER_VERSION_EDEFAULT; + + /** + * The default value of the '{@link #getExpressionLanguage() Expression Language}' attribute. + * + * + * @see #getExpressionLanguage() + * @generated + * @ordered + */ + protected static final String EXPRESSION_LANGUAGE_EDEFAULT = "http://www.w3.org/1999/XPath"; + + /** + * The cached value of the '{@link #getExpressionLanguage() Expression Language}' attribute. + * + * + * @see #getExpressionLanguage() + * @generated + * @ordered + */ + @GwtTransient + protected String expressionLanguage = EXPRESSION_LANGUAGE_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getTargetNamespace() Target Namespace}' attribute. + * + * + * @see #getTargetNamespace() + * @generated + * @ordered + */ + protected static final String TARGET_NAMESPACE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getTargetNamespace() Target Namespace}' attribute. + * + * + * @see #getTargetNamespace() + * @generated + * @ordered + */ + @GwtTransient + protected String targetNamespace = TARGET_NAMESPACE_EDEFAULT; + + /** + * The default value of the '{@link #getTypeLanguage() Type Language}' attribute. + * + * + * @see #getTypeLanguage() + * @generated + * @ordered + */ + protected static final String TYPE_LANGUAGE_EDEFAULT = "http://www.w3.org/2001/XMLSchema"; + + /** + * The cached value of the '{@link #getTypeLanguage() Type Language}' attribute. + * + * + * @see #getTypeLanguage() + * @generated + * @ordered + */ + @GwtTransient + protected String typeLanguage = TYPE_LANGUAGE_EDEFAULT; + + /** + * + * + * @generated + */ + protected DefinitionsImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.DEFINITIONS; + } + + /** + * + * + * @generated + */ + @Override + public EList getImports() { + if (imports == null) { + imports = new EObjectContainmentEList(Import.class, this, Bpmn2Package.DEFINITIONS__IMPORTS); + } + return imports; + } + + /** + * + * + * @generated + */ + @Override + public EList getExtensions() { + if (extensions == null) { + extensions = new EObjectContainmentEList(Extension.class, this, + Bpmn2Package.DEFINITIONS__EXTENSIONS); + } + return extensions; + } + + /** + * + * + * @generated + */ + @Override + public EList getRootElements() { + if (rootElements == null) { + rootElements = new EObjectContainmentEList(RootElement.class, this, + Bpmn2Package.DEFINITIONS__ROOT_ELEMENTS); + } + return rootElements; + } + + /** + * + * + * @generated + */ + @Override + public EList getDiagrams() { + if (diagrams == null) { + diagrams = new EObjectContainmentEList(BPMNDiagram.class, this, + Bpmn2Package.DEFINITIONS__DIAGRAMS); + } + return diagrams; + } + + /** + * + * + * @generated + */ + @Override + public EList getRelationships() { + if (relationships == null) { + relationships = new EObjectContainmentEList(Relationship.class, this, + Bpmn2Package.DEFINITIONS__RELATIONSHIPS); + } + return relationships; + } + + /** + * + * + * @generated + */ + @Override + public String getExporter() { + return exporter; + } + + /** + * + * + * @generated + */ + @Override + public void setExporter(String newExporter) { + String oldExporter = exporter; + exporter = newExporter; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DEFINITIONS__EXPORTER, oldExporter, + exporter)); + } + + /** + * + * + * @generated + */ + @Override + public String getExporterVersion() { + return exporterVersion; + } + + /** + * + * + * @generated + */ + @Override + public void setExporterVersion(String newExporterVersion) { + String oldExporterVersion = exporterVersion; + exporterVersion = newExporterVersion; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DEFINITIONS__EXPORTER_VERSION, + oldExporterVersion, exporterVersion)); + } + + /** + * + * + * @generated + */ + @Override + public String getExpressionLanguage() { + return expressionLanguage; + } + + /** + * + * + * @generated + */ + @Override + public void setExpressionLanguage(String newExpressionLanguage) { + String oldExpressionLanguage = expressionLanguage; + expressionLanguage = newExpressionLanguage; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DEFINITIONS__EXPRESSION_LANGUAGE, + oldExpressionLanguage, expressionLanguage)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DEFINITIONS__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public String getTargetNamespace() { + return targetNamespace; + } + + /** + * + * + * @generated + */ + @Override + public void setTargetNamespace(String newTargetNamespace) { + String oldTargetNamespace = targetNamespace; + targetNamespace = newTargetNamespace; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DEFINITIONS__TARGET_NAMESPACE, + oldTargetNamespace, targetNamespace)); + } + + /** + * + * + * @generated + */ + @Override + public String getTypeLanguage() { + return typeLanguage; + } + + /** + * + * + * @generated + */ + @Override + public void setTypeLanguage(String newTypeLanguage) { + String oldTypeLanguage = typeLanguage; + typeLanguage = newTypeLanguage; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DEFINITIONS__TYPE_LANGUAGE, + oldTypeLanguage, typeLanguage)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.DEFINITIONS__IMPORTS: + return ((InternalEList) getImports()).basicRemove(otherEnd, msgs); + case Bpmn2Package.DEFINITIONS__EXTENSIONS: + return ((InternalEList) getExtensions()).basicRemove(otherEnd, msgs); + case Bpmn2Package.DEFINITIONS__ROOT_ELEMENTS: + return ((InternalEList) getRootElements()).basicRemove(otherEnd, msgs); + case Bpmn2Package.DEFINITIONS__DIAGRAMS: + return ((InternalEList) getDiagrams()).basicRemove(otherEnd, msgs); + case Bpmn2Package.DEFINITIONS__RELATIONSHIPS: + return ((InternalEList) getRelationships()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.DEFINITIONS__IMPORTS: + return getImports(); + case Bpmn2Package.DEFINITIONS__EXTENSIONS: + return getExtensions(); + case Bpmn2Package.DEFINITIONS__ROOT_ELEMENTS: + return getRootElements(); + case Bpmn2Package.DEFINITIONS__DIAGRAMS: + return getDiagrams(); + case Bpmn2Package.DEFINITIONS__RELATIONSHIPS: + return getRelationships(); + case Bpmn2Package.DEFINITIONS__EXPORTER: + return getExporter(); + case Bpmn2Package.DEFINITIONS__EXPORTER_VERSION: + return getExporterVersion(); + case Bpmn2Package.DEFINITIONS__EXPRESSION_LANGUAGE: + return getExpressionLanguage(); + case Bpmn2Package.DEFINITIONS__NAME: + return getName(); + case Bpmn2Package.DEFINITIONS__TARGET_NAMESPACE: + return getTargetNamespace(); + case Bpmn2Package.DEFINITIONS__TYPE_LANGUAGE: + return getTypeLanguage(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.DEFINITIONS__IMPORTS: + getImports().clear(); + getImports().addAll((Collection) newValue); + return; + case Bpmn2Package.DEFINITIONS__EXTENSIONS: + getExtensions().clear(); + getExtensions().addAll((Collection) newValue); + return; + case Bpmn2Package.DEFINITIONS__ROOT_ELEMENTS: + getRootElements().clear(); + getRootElements().addAll((Collection) newValue); + return; + case Bpmn2Package.DEFINITIONS__DIAGRAMS: + getDiagrams().clear(); + getDiagrams().addAll((Collection) newValue); + return; + case Bpmn2Package.DEFINITIONS__RELATIONSHIPS: + getRelationships().clear(); + getRelationships().addAll((Collection) newValue); + return; + case Bpmn2Package.DEFINITIONS__EXPORTER: + setExporter((String) newValue); + return; + case Bpmn2Package.DEFINITIONS__EXPORTER_VERSION: + setExporterVersion((String) newValue); + return; + case Bpmn2Package.DEFINITIONS__EXPRESSION_LANGUAGE: + setExpressionLanguage((String) newValue); + return; + case Bpmn2Package.DEFINITIONS__NAME: + setName((String) newValue); + return; + case Bpmn2Package.DEFINITIONS__TARGET_NAMESPACE: + setTargetNamespace((String) newValue); + return; + case Bpmn2Package.DEFINITIONS__TYPE_LANGUAGE: + setTypeLanguage((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.DEFINITIONS__IMPORTS: + getImports().clear(); + return; + case Bpmn2Package.DEFINITIONS__EXTENSIONS: + getExtensions().clear(); + return; + case Bpmn2Package.DEFINITIONS__ROOT_ELEMENTS: + getRootElements().clear(); + return; + case Bpmn2Package.DEFINITIONS__DIAGRAMS: + getDiagrams().clear(); + return; + case Bpmn2Package.DEFINITIONS__RELATIONSHIPS: + getRelationships().clear(); + return; + case Bpmn2Package.DEFINITIONS__EXPORTER: + setExporter(EXPORTER_EDEFAULT); + return; + case Bpmn2Package.DEFINITIONS__EXPORTER_VERSION: + setExporterVersion(EXPORTER_VERSION_EDEFAULT); + return; + case Bpmn2Package.DEFINITIONS__EXPRESSION_LANGUAGE: + setExpressionLanguage(EXPRESSION_LANGUAGE_EDEFAULT); + return; + case Bpmn2Package.DEFINITIONS__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.DEFINITIONS__TARGET_NAMESPACE: + setTargetNamespace(TARGET_NAMESPACE_EDEFAULT); + return; + case Bpmn2Package.DEFINITIONS__TYPE_LANGUAGE: + setTypeLanguage(TYPE_LANGUAGE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.DEFINITIONS__IMPORTS: + return imports != null && !imports.isEmpty(); + case Bpmn2Package.DEFINITIONS__EXTENSIONS: + return extensions != null && !extensions.isEmpty(); + case Bpmn2Package.DEFINITIONS__ROOT_ELEMENTS: + return rootElements != null && !rootElements.isEmpty(); + case Bpmn2Package.DEFINITIONS__DIAGRAMS: + return diagrams != null && !diagrams.isEmpty(); + case Bpmn2Package.DEFINITIONS__RELATIONSHIPS: + return relationships != null && !relationships.isEmpty(); + case Bpmn2Package.DEFINITIONS__EXPORTER: + return EXPORTER_EDEFAULT == null ? exporter != null : !EXPORTER_EDEFAULT.equals(exporter); + case Bpmn2Package.DEFINITIONS__EXPORTER_VERSION: + return EXPORTER_VERSION_EDEFAULT == null ? exporterVersion != null + : !EXPORTER_VERSION_EDEFAULT.equals(exporterVersion); + case Bpmn2Package.DEFINITIONS__EXPRESSION_LANGUAGE: + return EXPRESSION_LANGUAGE_EDEFAULT == null ? expressionLanguage != null + : !EXPRESSION_LANGUAGE_EDEFAULT.equals(expressionLanguage); + case Bpmn2Package.DEFINITIONS__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.DEFINITIONS__TARGET_NAMESPACE: + return TARGET_NAMESPACE_EDEFAULT == null ? targetNamespace != null + : !TARGET_NAMESPACE_EDEFAULT.equals(targetNamespace); + case Bpmn2Package.DEFINITIONS__TYPE_LANGUAGE: + return TYPE_LANGUAGE_EDEFAULT == null ? typeLanguage != null : !TYPE_LANGUAGE_EDEFAULT.equals(typeLanguage); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (exporter: "); + result.append(exporter); + result.append(", exporterVersion: "); + result.append(exporterVersion); + result.append(", expressionLanguage: "); + result.append(expressionLanguage); + result.append(", name: "); + result.append(name); + result.append(", targetNamespace: "); + result.append(targetNamespace); + result.append(", typeLanguage: "); + result.append(typeLanguage); + result.append(')'); + return result.toString(); + } + +} //DefinitionsImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DocumentRootImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DocumentRootImpl.java new file mode 100644 index 00000000000..5fbb228eba2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DocumentRootImpl.java @@ -0,0 +1,6357 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.Artifact; +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.Association; +import org.eclipse.bpmn2.Auditing; +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.BusinessRuleTask; +import org.eclipse.bpmn2.CallActivity; +import org.eclipse.bpmn2.CallChoreography; +import org.eclipse.bpmn2.CallConversation; +import org.eclipse.bpmn2.CallableElement; +import org.eclipse.bpmn2.CancelEventDefinition; +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.Category; +import org.eclipse.bpmn2.CategoryValue; +import org.eclipse.bpmn2.Choreography; +import org.eclipse.bpmn2.ChoreographyActivity; +import org.eclipse.bpmn2.ChoreographyTask; +import org.eclipse.bpmn2.Collaboration; +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.ComplexBehaviorDefinition; +import org.eclipse.bpmn2.ComplexGateway; +import org.eclipse.bpmn2.ConditionalEventDefinition; +import org.eclipse.bpmn2.Conversation; +import org.eclipse.bpmn2.ConversationAssociation; +import org.eclipse.bpmn2.ConversationLink; +import org.eclipse.bpmn2.ConversationNode; +import org.eclipse.bpmn2.CorrelationKey; +import org.eclipse.bpmn2.CorrelationProperty; +import org.eclipse.bpmn2.CorrelationPropertyBinding; +import org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression; +import org.eclipse.bpmn2.CorrelationSubscription; +import org.eclipse.bpmn2.DataAssociation; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataObject; +import org.eclipse.bpmn2.DataObjectReference; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.DataState; +import org.eclipse.bpmn2.DataStore; +import org.eclipse.bpmn2.DataStoreReference; +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.DocumentRoot; +import org.eclipse.bpmn2.Documentation; +import org.eclipse.bpmn2.EndEvent; +import org.eclipse.bpmn2.EndPoint; +import org.eclipse.bpmn2.ErrorEventDefinition; +import org.eclipse.bpmn2.Escalation; +import org.eclipse.bpmn2.EscalationEventDefinition; +import org.eclipse.bpmn2.Event; +import org.eclipse.bpmn2.EventBasedGateway; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.EventSubprocess; +import org.eclipse.bpmn2.ExclusiveGateway; +import org.eclipse.bpmn2.Expression; +import org.eclipse.bpmn2.Extension; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.FlowNode; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.Gateway; +import org.eclipse.bpmn2.GlobalBusinessRuleTask; +import org.eclipse.bpmn2.GlobalChoreographyTask; +import org.eclipse.bpmn2.GlobalConversation; +import org.eclipse.bpmn2.GlobalManualTask; +import org.eclipse.bpmn2.GlobalScriptTask; +import org.eclipse.bpmn2.GlobalTask; +import org.eclipse.bpmn2.GlobalUserTask; +import org.eclipse.bpmn2.Group; +import org.eclipse.bpmn2.HumanPerformer; +import org.eclipse.bpmn2.ImplicitThrowEvent; +import org.eclipse.bpmn2.Import; +import org.eclipse.bpmn2.InclusiveGateway; +import org.eclipse.bpmn2.InputOutputBinding; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.Interface; +import org.eclipse.bpmn2.IntermediateCatchEvent; +import org.eclipse.bpmn2.IntermediateThrowEvent; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.LaneSet; +import org.eclipse.bpmn2.LinkEventDefinition; +import org.eclipse.bpmn2.LoopCharacteristics; +import org.eclipse.bpmn2.ManualTask; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.MessageEventDefinition; +import org.eclipse.bpmn2.MessageFlow; +import org.eclipse.bpmn2.MessageFlowAssociation; +import org.eclipse.bpmn2.Monitoring; +import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics; +import org.eclipse.bpmn2.Operation; +import org.eclipse.bpmn2.OutputSet; +import org.eclipse.bpmn2.ParallelGateway; +import org.eclipse.bpmn2.Participant; +import org.eclipse.bpmn2.ParticipantAssociation; +import org.eclipse.bpmn2.ParticipantMultiplicity; +import org.eclipse.bpmn2.PartnerEntity; +import org.eclipse.bpmn2.PartnerRole; +import org.eclipse.bpmn2.Performer; +import org.eclipse.bpmn2.PotentialOwner; +import org.eclipse.bpmn2.Property; +import org.eclipse.bpmn2.ReceiveTask; +import org.eclipse.bpmn2.Relationship; +import org.eclipse.bpmn2.Rendering; +import org.eclipse.bpmn2.Resource; +import org.eclipse.bpmn2.ResourceAssignmentExpression; +import org.eclipse.bpmn2.ResourceParameter; +import org.eclipse.bpmn2.ResourceParameterBinding; +import org.eclipse.bpmn2.ResourceRole; +import org.eclipse.bpmn2.RootElement; +import org.eclipse.bpmn2.ScriptTask; +import org.eclipse.bpmn2.SendTask; +import org.eclipse.bpmn2.SequenceFlow; +import org.eclipse.bpmn2.ServiceTask; +import org.eclipse.bpmn2.Signal; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.bpmn2.StandardLoopCharacteristics; +import org.eclipse.bpmn2.StartEvent; +import org.eclipse.bpmn2.SubChoreography; +import org.eclipse.bpmn2.SubConversation; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.TerminateEventDefinition; +import org.eclipse.bpmn2.TextAnnotation; +import org.eclipse.bpmn2.ThrowEvent; +import org.eclipse.bpmn2.TimerEventDefinition; +import org.eclipse.bpmn2.Transaction; +import org.eclipse.bpmn2.UserTask; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EMap; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.EcoreEMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Document Root'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getMixed Mixed}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getXMLNSPrefixMap XMLNS Prefix Map}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getXSISchemaLocation XSI Schema Location}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getActivity Activity}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getAdHocSubProcess Ad Hoc Sub Process}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getFlowElement Flow Element}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getArtifact Artifact}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getAssignment Assignment}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getAssociation Association}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getAuditing Auditing}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getBaseElement Base Element}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getBaseElementWithMixedContent Base Element With Mixed Content}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getBoundaryEvent Boundary Event}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getBusinessRuleTask Business Rule Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCallableElement Callable Element}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCallActivity Call Activity}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCallChoreography Call Choreography}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCallConversation Call Conversation}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getConversationNode Conversation Node}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCancelEventDefinition Cancel Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getEventDefinition Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getRootElement Root Element}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCatchEvent Catch Event}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCategory Category}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCategoryValue Category Value}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getChoreography Choreography}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCollaboration Collaboration}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getChoreographyActivity Choreography Activity}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getChoreographyTask Choreography Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCompensateEventDefinition Compensate Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getComplexBehaviorDefinition Complex Behavior Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getComplexGateway Complex Gateway}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getConditionalEventDefinition Conditional Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getConversation Conversation}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getConversationAssociation Conversation Association}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getConversationLink Conversation Link}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCorrelationKey Correlation Key}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCorrelationProperty Correlation Property}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCorrelationPropertyBinding Correlation Property Binding}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCorrelationPropertyRetrievalExpression Correlation Property Retrieval Expression}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getCorrelationSubscription Correlation Subscription}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getDataAssociation Data Association}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getDataInput Data Input}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getDataInputAssociation Data Input Association}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getDataObject Data Object}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getDataObjectReference Data Object Reference}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getDataOutput Data Output}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getDataOutputAssociation Data Output Association}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getDataState Data State}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getDataStore Data Store}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getDataStoreReference Data Store Reference}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getDefinitions Definitions}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getDocumentation Documentation}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getEndEvent End Event}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getEndPoint End Point}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getError Error}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getErrorEventDefinition Error Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getEscalation Escalation}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getEscalationEventDefinition Escalation Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getEvent Event}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getEventBasedGateway Event Based Gateway}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getExclusiveGateway Exclusive Gateway}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getExpression Expression}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getExtension Extension}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getExtensionElements Extension Elements}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getFlowNode Flow Node}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getFormalExpression Formal Expression}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getGateway Gateway}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getGlobalBusinessRuleTask Global Business Rule Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getGlobalChoreographyTask Global Choreography Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getGlobalConversation Global Conversation}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getGlobalManualTask Global Manual Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getGlobalScriptTask Global Script Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getGlobalTask Global Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getGlobalUserTask Global User Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getGroup Group}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getHumanPerformer Human Performer}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getPerformer Performer}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getResourceRole Resource Role}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getImplicitThrowEvent Implicit Throw Event}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getImport Import}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getInclusiveGateway Inclusive Gateway}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getInputSet Input Set}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getInterface Interface}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getIntermediateCatchEvent Intermediate Catch Event}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getIntermediateThrowEvent Intermediate Throw Event}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getIoBinding Io Binding}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getIoSpecification Io Specification}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getItemDefinition Item Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getLane Lane}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getLaneSet Lane Set}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getLinkEventDefinition Link Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getLoopCharacteristics Loop Characteristics}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getManualTask Manual Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getMessage Message}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getMessageEventDefinition Message Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getMessageFlow Message Flow}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getMessageFlowAssociation Message Flow Association}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getMonitoring Monitoring}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getMultiInstanceLoopCharacteristics Multi Instance Loop Characteristics}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getOperation Operation}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getOutputSet Output Set}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getParallelGateway Parallel Gateway}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getParticipant Participant}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getParticipantAssociation Participant Association}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getParticipantMultiplicity Participant Multiplicity}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getPartnerEntity Partner Entity}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getPartnerRole Partner Role}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getPotentialOwner Potential Owner}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getProcess Process}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getProperty Property}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getReceiveTask Receive Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getRelationship Relationship}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getRendering Rendering}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getResource Resource}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getResourceAssignmentExpression Resource Assignment Expression}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getResourceParameter Resource Parameter}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getResourceParameterBinding Resource Parameter Binding}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getScript Script}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getScriptTask Script Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getSendTask Send Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getSequenceFlow Sequence Flow}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getServiceTask Service Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getSignal Signal}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getSignalEventDefinition Signal Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getStandardLoopCharacteristics Standard Loop Characteristics}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getStartEvent Start Event}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getSubChoreography Sub Choreography}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getSubConversation Sub Conversation}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getSubProcess Sub Process}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getTask Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getTerminateEventDefinition Terminate Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getText Text}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getTextAnnotation Text Annotation}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getThrowEvent Throw Event}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getTimerEventDefinition Timer Event Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getTransaction Transaction}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getUserTask User Task}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentRootImpl#getEventSubProcess Event Sub Process}
  • + *
+ * + * @generated + */ +public class DocumentRootImpl extends EObjectImpl implements DocumentRoot { + /** + * The cached value of the '{@link #getMixed() Mixed}' attribute list. + * + * + * @see #getMixed() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap mixed; + + /** + * The cached value of the '{@link #getXMLNSPrefixMap() XMLNS Prefix Map}' map. + * + * + * @see #getXMLNSPrefixMap() + * @generated + * @ordered + */ + @GwtTransient + protected EMap xMLNSPrefixMap; + + /** + * The cached value of the '{@link #getXSISchemaLocation() XSI Schema Location}' map. + * + * + * @see #getXSISchemaLocation() + * @generated + * @ordered + */ + @GwtTransient + protected EMap xSISchemaLocation; + + /** + * + * + * @generated + */ + protected DocumentRootImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.DOCUMENT_ROOT; + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getMixed() { + if (mixed == null) { + mixed = new BasicFeatureMap(this, Bpmn2Package.DOCUMENT_ROOT__MIXED); + } + return mixed; + } + + /** + * + * + * @generated + */ + @Override + public EMap getXMLNSPrefixMap() { + if (xMLNSPrefixMap == null) { + xMLNSPrefixMap = new EcoreEMap(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, + EStringToStringMapEntryImpl.class, this, Bpmn2Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP); + } + return xMLNSPrefixMap; + } + + /** + * + * + * @generated + */ + @Override + public EMap getXSISchemaLocation() { + if (xSISchemaLocation == null) { + xSISchemaLocation = new EcoreEMap(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, + EStringToStringMapEntryImpl.class, this, Bpmn2Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); + } + return xSISchemaLocation; + } + + /** + * + * + * @generated + */ + @Override + public Activity getActivity() { + return (Activity) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__ACTIVITY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetActivity(Activity newActivity, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__ACTIVITY, newActivity, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setActivity(Activity newActivity) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__ACTIVITY, newActivity); + } + + /** + * + * + * @generated + */ + @Override + public AdHocSubProcess getAdHocSubProcess() { + return (AdHocSubProcess) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__AD_HOC_SUB_PROCESS, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetAdHocSubProcess(AdHocSubProcess newAdHocSubProcess, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__AD_HOC_SUB_PROCESS, + newAdHocSubProcess, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setAdHocSubProcess(AdHocSubProcess newAdHocSubProcess) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__AD_HOC_SUB_PROCESS, + newAdHocSubProcess); + } + + /** + * + * + * @generated + */ + @Override + public FlowElement getFlowElement() { + return (FlowElement) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__FLOW_ELEMENT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFlowElement(FlowElement newFlowElement, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__FLOW_ELEMENT, + newFlowElement, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setFlowElement(FlowElement newFlowElement) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__FLOW_ELEMENT, newFlowElement); + } + + /** + * + * + * @generated + */ + @Override + public Artifact getArtifact() { + return (Artifact) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__ARTIFACT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetArtifact(Artifact newArtifact, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__ARTIFACT, newArtifact, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setArtifact(Artifact newArtifact) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__ARTIFACT, newArtifact); + } + + /** + * + * + * @generated + */ + @Override + public Assignment getAssignment() { + return (Assignment) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__ASSIGNMENT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetAssignment(Assignment newAssignment, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__ASSIGNMENT, + newAssignment, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setAssignment(Assignment newAssignment) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__ASSIGNMENT, newAssignment); + } + + /** + * + * + * @generated + */ + @Override + public Association getAssociation() { + return (Association) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__ASSOCIATION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetAssociation(Association newAssociation, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__ASSOCIATION, + newAssociation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setAssociation(Association newAssociation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__ASSOCIATION, newAssociation); + } + + /** + * + * + * @generated + */ + @Override + public Auditing getAuditing() { + return (Auditing) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__AUDITING, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetAuditing(Auditing newAuditing, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__AUDITING, newAuditing, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setAuditing(Auditing newAuditing) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__AUDITING, newAuditing); + } + + /** + * + * + * @generated + */ + @Override + public BaseElement getBaseElement() { + return (BaseElement) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__BASE_ELEMENT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBaseElement(BaseElement newBaseElement, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__BASE_ELEMENT, + newBaseElement, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBaseElement(BaseElement newBaseElement) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__BASE_ELEMENT, newBaseElement); + } + + /** + * + * + * @generated + */ + @Override + public BaseElement getBaseElementWithMixedContent() { + return (BaseElement) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__BASE_ELEMENT_WITH_MIXED_CONTENT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBaseElementWithMixedContent(BaseElement newBaseElementWithMixedContent, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__BASE_ELEMENT_WITH_MIXED_CONTENT, newBaseElementWithMixedContent, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBaseElementWithMixedContent(BaseElement newBaseElementWithMixedContent) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__BASE_ELEMENT_WITH_MIXED_CONTENT, + newBaseElementWithMixedContent); + } + + /** + * + * + * @generated + */ + @Override + public BoundaryEvent getBoundaryEvent() { + return (BoundaryEvent) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__BOUNDARY_EVENT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBoundaryEvent(BoundaryEvent newBoundaryEvent, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__BOUNDARY_EVENT, + newBoundaryEvent, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBoundaryEvent(BoundaryEvent newBoundaryEvent) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__BOUNDARY_EVENT, newBoundaryEvent); + } + + /** + * + * + * @generated + */ + @Override + public BusinessRuleTask getBusinessRuleTask() { + return (BusinessRuleTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__BUSINESS_RULE_TASK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBusinessRuleTask(BusinessRuleTask newBusinessRuleTask, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__BUSINESS_RULE_TASK, + newBusinessRuleTask, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBusinessRuleTask(BusinessRuleTask newBusinessRuleTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__BUSINESS_RULE_TASK, + newBusinessRuleTask); + } + + /** + * + * + * @generated + */ + @Override + public CallableElement getCallableElement() { + return (CallableElement) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CALLABLE_ELEMENT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCallableElement(CallableElement newCallableElement, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CALLABLE_ELEMENT, + newCallableElement, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCallableElement(CallableElement newCallableElement) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CALLABLE_ELEMENT, + newCallableElement); + } + + /** + * + * + * @generated + */ + @Override + public CallActivity getCallActivity() { + return (CallActivity) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CALL_ACTIVITY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCallActivity(CallActivity newCallActivity, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CALL_ACTIVITY, + newCallActivity, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCallActivity(CallActivity newCallActivity) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CALL_ACTIVITY, newCallActivity); + } + + /** + * + * + * @generated + */ + @Override + public CallChoreography getCallChoreography() { + return (CallChoreography) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CALL_CHOREOGRAPHY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCallChoreography(CallChoreography newCallChoreography, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CALL_CHOREOGRAPHY, + newCallChoreography, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCallChoreography(CallChoreography newCallChoreography) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CALL_CHOREOGRAPHY, + newCallChoreography); + } + + /** + * + * + * @generated + */ + @Override + public CallConversation getCallConversation() { + return (CallConversation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CALL_CONVERSATION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCallConversation(CallConversation newCallConversation, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CALL_CONVERSATION, + newCallConversation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCallConversation(CallConversation newCallConversation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CALL_CONVERSATION, + newCallConversation); + } + + /** + * + * + * @generated + */ + @Override + public ConversationNode getConversationNode() { + return (ConversationNode) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CONVERSATION_NODE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetConversationNode(ConversationNode newConversationNode, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CONVERSATION_NODE, + newConversationNode, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setConversationNode(ConversationNode newConversationNode) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CONVERSATION_NODE, + newConversationNode); + } + + /** + * + * + * @generated + */ + @Override + public CancelEventDefinition getCancelEventDefinition() { + return (CancelEventDefinition) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CANCEL_EVENT_DEFINITION, + true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCancelEventDefinition(CancelEventDefinition newCancelEventDefinition, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CANCEL_EVENT_DEFINITION, + newCancelEventDefinition, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCancelEventDefinition(CancelEventDefinition newCancelEventDefinition) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CANCEL_EVENT_DEFINITION, + newCancelEventDefinition); + } + + /** + * + * + * @generated + */ + @Override + public EventDefinition getEventDefinition() { + return (EventDefinition) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__EVENT_DEFINITION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEventDefinition(EventDefinition newEventDefinition, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__EVENT_DEFINITION, + newEventDefinition, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setEventDefinition(EventDefinition newEventDefinition) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__EVENT_DEFINITION, + newEventDefinition); + } + + /** + * + * + * @generated + */ + @Override + public RootElement getRootElement() { + return (RootElement) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__ROOT_ELEMENT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetRootElement(RootElement newRootElement, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__ROOT_ELEMENT, + newRootElement, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setRootElement(RootElement newRootElement) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__ROOT_ELEMENT, newRootElement); + } + + /** + * + * + * @generated + */ + @Override + public CatchEvent getCatchEvent() { + return (CatchEvent) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CATCH_EVENT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCatchEvent(CatchEvent newCatchEvent, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CATCH_EVENT, + newCatchEvent, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCatchEvent(CatchEvent newCatchEvent) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CATCH_EVENT, newCatchEvent); + } + + /** + * + * + * @generated + */ + @Override + public Category getCategory() { + return (Category) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CATEGORY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCategory(Category newCategory, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CATEGORY, newCategory, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCategory(Category newCategory) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CATEGORY, newCategory); + } + + /** + * + * + * @generated + */ + @Override + public CategoryValue getCategoryValue() { + return (CategoryValue) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CATEGORY_VALUE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCategoryValue(CategoryValue newCategoryValue, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CATEGORY_VALUE, + newCategoryValue, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCategoryValue(CategoryValue newCategoryValue) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CATEGORY_VALUE, newCategoryValue); + } + + /** + * + * + * @generated + */ + @Override + public Choreography getChoreography() { + return (Choreography) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CHOREOGRAPHY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetChoreography(Choreography newChoreography, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CHOREOGRAPHY, + newChoreography, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setChoreography(Choreography newChoreography) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CHOREOGRAPHY, newChoreography); + } + + /** + * + * + * @generated + */ + @Override + public Collaboration getCollaboration() { + return (Collaboration) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__COLLABORATION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCollaboration(Collaboration newCollaboration, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__COLLABORATION, + newCollaboration, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCollaboration(Collaboration newCollaboration) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__COLLABORATION, newCollaboration); + } + + /** + * + * + * @generated + */ + @Override + public ChoreographyActivity getChoreographyActivity() { + return (ChoreographyActivity) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CHOREOGRAPHY_ACTIVITY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetChoreographyActivity(ChoreographyActivity newChoreographyActivity, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CHOREOGRAPHY_ACTIVITY, + newChoreographyActivity, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setChoreographyActivity(ChoreographyActivity newChoreographyActivity) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CHOREOGRAPHY_ACTIVITY, + newChoreographyActivity); + } + + /** + * + * + * @generated + */ + @Override + public ChoreographyTask getChoreographyTask() { + return (ChoreographyTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CHOREOGRAPHY_TASK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetChoreographyTask(ChoreographyTask newChoreographyTask, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CHOREOGRAPHY_TASK, + newChoreographyTask, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setChoreographyTask(ChoreographyTask newChoreographyTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CHOREOGRAPHY_TASK, + newChoreographyTask); + } + + /** + * + * + * @generated + */ + @Override + public CompensateEventDefinition getCompensateEventDefinition() { + return (CompensateEventDefinition) getMixed() + .get(Bpmn2Package.Literals.DOCUMENT_ROOT__COMPENSATE_EVENT_DEFINITION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCompensateEventDefinition(CompensateEventDefinition newCompensateEventDefinition, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__COMPENSATE_EVENT_DEFINITION, newCompensateEventDefinition, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCompensateEventDefinition(CompensateEventDefinition newCompensateEventDefinition) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__COMPENSATE_EVENT_DEFINITION, + newCompensateEventDefinition); + } + + /** + * + * + * @generated + */ + @Override + public ComplexBehaviorDefinition getComplexBehaviorDefinition() { + return (ComplexBehaviorDefinition) getMixed() + .get(Bpmn2Package.Literals.DOCUMENT_ROOT__COMPLEX_BEHAVIOR_DEFINITION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetComplexBehaviorDefinition(ComplexBehaviorDefinition newComplexBehaviorDefinition, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__COMPLEX_BEHAVIOR_DEFINITION, newComplexBehaviorDefinition, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setComplexBehaviorDefinition(ComplexBehaviorDefinition newComplexBehaviorDefinition) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__COMPLEX_BEHAVIOR_DEFINITION, + newComplexBehaviorDefinition); + } + + /** + * + * + * @generated + */ + @Override + public ComplexGateway getComplexGateway() { + return (ComplexGateway) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__COMPLEX_GATEWAY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetComplexGateway(ComplexGateway newComplexGateway, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__COMPLEX_GATEWAY, + newComplexGateway, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setComplexGateway(ComplexGateway newComplexGateway) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__COMPLEX_GATEWAY, newComplexGateway); + } + + /** + * + * + * @generated + */ + @Override + public ConditionalEventDefinition getConditionalEventDefinition() { + return (ConditionalEventDefinition) getMixed() + .get(Bpmn2Package.Literals.DOCUMENT_ROOT__CONDITIONAL_EVENT_DEFINITION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetConditionalEventDefinition( + ConditionalEventDefinition newConditionalEventDefinition, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__CONDITIONAL_EVENT_DEFINITION, newConditionalEventDefinition, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setConditionalEventDefinition(ConditionalEventDefinition newConditionalEventDefinition) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CONDITIONAL_EVENT_DEFINITION, + newConditionalEventDefinition); + } + + /** + * + * + * @generated + */ + @Override + public Conversation getConversation() { + return (Conversation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CONVERSATION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetConversation(Conversation newConversation, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CONVERSATION, + newConversation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setConversation(Conversation newConversation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CONVERSATION, newConversation); + } + + /** + * + * + * @generated + */ + @Override + public ConversationAssociation getConversationAssociation() { + return (ConversationAssociation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CONVERSATION_ASSOCIATION, + true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetConversationAssociation(ConversationAssociation newConversationAssociation, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__CONVERSATION_ASSOCIATION, newConversationAssociation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setConversationAssociation(ConversationAssociation newConversationAssociation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CONVERSATION_ASSOCIATION, + newConversationAssociation); + } + + /** + * + * + * @generated + */ + @Override + public ConversationLink getConversationLink() { + return (ConversationLink) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CONVERSATION_LINK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetConversationLink(ConversationLink newConversationLink, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CONVERSATION_LINK, + newConversationLink, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setConversationLink(ConversationLink newConversationLink) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CONVERSATION_LINK, + newConversationLink); + } + + /** + * + * + * @generated + */ + @Override + public CorrelationKey getCorrelationKey() { + return (CorrelationKey) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_KEY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCorrelationKey(CorrelationKey newCorrelationKey, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_KEY, + newCorrelationKey, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCorrelationKey(CorrelationKey newCorrelationKey) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_KEY, newCorrelationKey); + } + + /** + * + * + * @generated + */ + @Override + public CorrelationProperty getCorrelationProperty() { + return (CorrelationProperty) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_PROPERTY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCorrelationProperty(CorrelationProperty newCorrelationProperty, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_PROPERTY, + newCorrelationProperty, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCorrelationProperty(CorrelationProperty newCorrelationProperty) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_PROPERTY, + newCorrelationProperty); + } + + /** + * + * + * @generated + */ + @Override + public CorrelationPropertyBinding getCorrelationPropertyBinding() { + return (CorrelationPropertyBinding) getMixed() + .get(Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_PROPERTY_BINDING, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCorrelationPropertyBinding( + CorrelationPropertyBinding newCorrelationPropertyBinding, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_PROPERTY_BINDING, newCorrelationPropertyBinding, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCorrelationPropertyBinding(CorrelationPropertyBinding newCorrelationPropertyBinding) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_PROPERTY_BINDING, + newCorrelationPropertyBinding); + } + + /** + * + * + * @generated + */ + @Override + public CorrelationPropertyRetrievalExpression getCorrelationPropertyRetrievalExpression() { + return (CorrelationPropertyRetrievalExpression) getMixed() + .get(Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCorrelationPropertyRetrievalExpression( + CorrelationPropertyRetrievalExpression newCorrelationPropertyRetrievalExpression, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION, + newCorrelationPropertyRetrievalExpression, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCorrelationPropertyRetrievalExpression( + CorrelationPropertyRetrievalExpression newCorrelationPropertyRetrievalExpression) { + ((FeatureMap.Internal) getMixed()).set( + Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION, + newCorrelationPropertyRetrievalExpression); + } + + /** + * + * + * @generated + */ + @Override + public CorrelationSubscription getCorrelationSubscription() { + return (CorrelationSubscription) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_SUBSCRIPTION, + true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCorrelationSubscription(CorrelationSubscription newCorrelationSubscription, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_SUBSCRIPTION, newCorrelationSubscription, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setCorrelationSubscription(CorrelationSubscription newCorrelationSubscription) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__CORRELATION_SUBSCRIPTION, + newCorrelationSubscription); + } + + /** + * + * + * @generated + */ + @Override + public DataAssociation getDataAssociation() { + return (DataAssociation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_ASSOCIATION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataAssociation(DataAssociation newDataAssociation, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_ASSOCIATION, + newDataAssociation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDataAssociation(DataAssociation newDataAssociation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_ASSOCIATION, + newDataAssociation); + } + + /** + * + * + * @generated + */ + @Override + public DataInput getDataInput() { + return (DataInput) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_INPUT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataInput(DataInput newDataInput, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_INPUT, + newDataInput, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDataInput(DataInput newDataInput) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_INPUT, newDataInput); + } + + /** + * + * + * @generated + */ + @Override + public DataInputAssociation getDataInputAssociation() { + return (DataInputAssociation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_INPUT_ASSOCIATION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataInputAssociation(DataInputAssociation newDataInputAssociation, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_INPUT_ASSOCIATION, + newDataInputAssociation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDataInputAssociation(DataInputAssociation newDataInputAssociation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_INPUT_ASSOCIATION, + newDataInputAssociation); + } + + /** + * + * + * @generated + */ + @Override + public DataObject getDataObject() { + return (DataObject) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_OBJECT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataObject(DataObject newDataObject, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_OBJECT, + newDataObject, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDataObject(DataObject newDataObject) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_OBJECT, newDataObject); + } + + /** + * + * + * @generated + */ + @Override + public DataObjectReference getDataObjectReference() { + return (DataObjectReference) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_OBJECT_REFERENCE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataObjectReference(DataObjectReference newDataObjectReference, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_OBJECT_REFERENCE, + newDataObjectReference, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDataObjectReference(DataObjectReference newDataObjectReference) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_OBJECT_REFERENCE, + newDataObjectReference); + } + + /** + * + * + * @generated + */ + @Override + public DataOutput getDataOutput() { + return (DataOutput) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_OUTPUT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataOutput(DataOutput newDataOutput, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_OUTPUT, + newDataOutput, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDataOutput(DataOutput newDataOutput) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_OUTPUT, newDataOutput); + } + + /** + * + * + * @generated + */ + @Override + public DataOutputAssociation getDataOutputAssociation() { + return (DataOutputAssociation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_OUTPUT_ASSOCIATION, + true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataOutputAssociation(DataOutputAssociation newDataOutputAssociation, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_OUTPUT_ASSOCIATION, + newDataOutputAssociation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDataOutputAssociation(DataOutputAssociation newDataOutputAssociation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_OUTPUT_ASSOCIATION, + newDataOutputAssociation); + } + + /** + * + * + * @generated + */ + @Override + public DataState getDataState() { + return (DataState) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_STATE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataState(DataState newDataState, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_STATE, + newDataState, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDataState(DataState newDataState) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_STATE, newDataState); + } + + /** + * + * + * @generated + */ + @Override + public DataStore getDataStore() { + return (DataStore) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_STORE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataStore(DataStore newDataStore, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_STORE, + newDataStore, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDataStore(DataStore newDataStore) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_STORE, newDataStore); + } + + /** + * + * + * @generated + */ + @Override + public DataStoreReference getDataStoreReference() { + return (DataStoreReference) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_STORE_REFERENCE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataStoreReference(DataStoreReference newDataStoreReference, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_STORE_REFERENCE, + newDataStoreReference, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDataStoreReference(DataStoreReference newDataStoreReference) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__DATA_STORE_REFERENCE, + newDataStoreReference); + } + + /** + * + * + * @generated + */ + @Override + public Definitions getDefinitions() { + return (Definitions) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__DEFINITIONS, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDefinitions(Definitions newDefinitions, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__DEFINITIONS, + newDefinitions, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDefinitions(Definitions newDefinitions) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__DEFINITIONS, newDefinitions); + } + + /** + * + * + * @generated + */ + @Override + public Documentation getDocumentation() { + return (Documentation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__DOCUMENTATION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDocumentation(Documentation newDocumentation, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__DOCUMENTATION, + newDocumentation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setDocumentation(Documentation newDocumentation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__DOCUMENTATION, newDocumentation); + } + + /** + * + * + * @generated + */ + @Override + public EndEvent getEndEvent() { + return (EndEvent) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__END_EVENT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEndEvent(EndEvent newEndEvent, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__END_EVENT, newEndEvent, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setEndEvent(EndEvent newEndEvent) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__END_EVENT, newEndEvent); + } + + /** + * + * + * @generated + */ + @Override + public EndPoint getEndPoint() { + return (EndPoint) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__END_POINT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEndPoint(EndPoint newEndPoint, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__END_POINT, newEndPoint, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setEndPoint(EndPoint newEndPoint) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__END_POINT, newEndPoint); + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.bpmn2.Error getError() { + return (org.eclipse.bpmn2.Error) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__ERROR, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetError(org.eclipse.bpmn2.Error newError, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__ERROR, newError, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setError(org.eclipse.bpmn2.Error newError) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__ERROR, newError); + } + + /** + * + * + * @generated + */ + @Override + public ErrorEventDefinition getErrorEventDefinition() { + return (ErrorEventDefinition) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__ERROR_EVENT_DEFINITION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetErrorEventDefinition(ErrorEventDefinition newErrorEventDefinition, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__ERROR_EVENT_DEFINITION, + newErrorEventDefinition, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setErrorEventDefinition(ErrorEventDefinition newErrorEventDefinition) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__ERROR_EVENT_DEFINITION, + newErrorEventDefinition); + } + + /** + * + * + * @generated + */ + @Override + public Escalation getEscalation() { + return (Escalation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__ESCALATION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEscalation(Escalation newEscalation, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__ESCALATION, + newEscalation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setEscalation(Escalation newEscalation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__ESCALATION, newEscalation); + } + + /** + * + * + * @generated + */ + @Override + public EscalationEventDefinition getEscalationEventDefinition() { + return (EscalationEventDefinition) getMixed() + .get(Bpmn2Package.Literals.DOCUMENT_ROOT__ESCALATION_EVENT_DEFINITION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEscalationEventDefinition(EscalationEventDefinition newEscalationEventDefinition, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__ESCALATION_EVENT_DEFINITION, newEscalationEventDefinition, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setEscalationEventDefinition(EscalationEventDefinition newEscalationEventDefinition) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__ESCALATION_EVENT_DEFINITION, + newEscalationEventDefinition); + } + + /** + * + * + * @generated + */ + @Override + public Event getEvent() { + return (Event) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__EVENT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEvent(Event newEvent, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__EVENT, newEvent, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setEvent(Event newEvent) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__EVENT, newEvent); + } + + /** + * + * + * @generated + */ + @Override + public EventBasedGateway getEventBasedGateway() { + return (EventBasedGateway) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__EVENT_BASED_GATEWAY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEventBasedGateway(EventBasedGateway newEventBasedGateway, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__EVENT_BASED_GATEWAY, + newEventBasedGateway, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setEventBasedGateway(EventBasedGateway newEventBasedGateway) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__EVENT_BASED_GATEWAY, + newEventBasedGateway); + } + + /** + * + * + * @generated + */ + @Override + public ExclusiveGateway getExclusiveGateway() { + return (ExclusiveGateway) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__EXCLUSIVE_GATEWAY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetExclusiveGateway(ExclusiveGateway newExclusiveGateway, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__EXCLUSIVE_GATEWAY, + newExclusiveGateway, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setExclusiveGateway(ExclusiveGateway newExclusiveGateway) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__EXCLUSIVE_GATEWAY, + newExclusiveGateway); + } + + /** + * + * + * @generated + */ + @Override + public Expression getExpression() { + return (Expression) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__EXPRESSION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetExpression(Expression newExpression, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__EXPRESSION, + newExpression, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setExpression(Expression newExpression) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__EXPRESSION, newExpression); + } + + /** + * + * + * @generated + */ + @Override + public Extension getExtension() { + return (Extension) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__EXTENSION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetExtension(Extension newExtension, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__EXTENSION, newExtension, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setExtension(Extension newExtension) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__EXTENSION, newExtension); + } + + /** + * + * + * @generated + */ + @Override + public ExtensionAttributeValue getExtensionElements() { + return (ExtensionAttributeValue) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__EXTENSION_ELEMENTS, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetExtensionElements(ExtensionAttributeValue newExtensionElements, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__EXTENSION_ELEMENTS, + newExtensionElements, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setExtensionElements(ExtensionAttributeValue newExtensionElements) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__EXTENSION_ELEMENTS, + newExtensionElements); + } + + /** + * + * + * @generated + */ + @Override + public FlowNode getFlowNode() { + return (FlowNode) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__FLOW_NODE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFlowNode(FlowNode newFlowNode, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__FLOW_NODE, newFlowNode, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setFlowNode(FlowNode newFlowNode) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__FLOW_NODE, newFlowNode); + } + + /** + * + * + * @generated + */ + @Override + public FormalExpression getFormalExpression() { + return (FormalExpression) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__FORMAL_EXPRESSION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFormalExpression(FormalExpression newFormalExpression, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__FORMAL_EXPRESSION, + newFormalExpression, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setFormalExpression(FormalExpression newFormalExpression) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__FORMAL_EXPRESSION, + newFormalExpression); + } + + /** + * + * + * @generated + */ + @Override + public Gateway getGateway() { + return (Gateway) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__GATEWAY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGateway(Gateway newGateway, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__GATEWAY, newGateway, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public GlobalBusinessRuleTask getGlobalBusinessRuleTask() { + return (GlobalBusinessRuleTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_BUSINESS_RULE_TASK, + true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGlobalBusinessRuleTask(GlobalBusinessRuleTask newGlobalBusinessRuleTask, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_BUSINESS_RULE_TASK, newGlobalBusinessRuleTask, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setGlobalBusinessRuleTask(GlobalBusinessRuleTask newGlobalBusinessRuleTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_BUSINESS_RULE_TASK, + newGlobalBusinessRuleTask); + } + + /** + * + * + * @generated + */ + @Override + public GlobalChoreographyTask getGlobalChoreographyTask() { + return (GlobalChoreographyTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_CHOREOGRAPHY_TASK, + true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGlobalChoreographyTask(GlobalChoreographyTask newGlobalChoreographyTask, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_CHOREOGRAPHY_TASK, newGlobalChoreographyTask, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setGlobalChoreographyTask(GlobalChoreographyTask newGlobalChoreographyTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_CHOREOGRAPHY_TASK, + newGlobalChoreographyTask); + } + + /** + * + * + * @generated + */ + @Override + public GlobalConversation getGlobalConversation() { + return (GlobalConversation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_CONVERSATION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGlobalConversation(GlobalConversation newGlobalConversation, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_CONVERSATION, + newGlobalConversation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setGlobalConversation(GlobalConversation newGlobalConversation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_CONVERSATION, + newGlobalConversation); + } + + /** + * + * + * @generated + */ + @Override + public GlobalManualTask getGlobalManualTask() { + return (GlobalManualTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_MANUAL_TASK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGlobalManualTask(GlobalManualTask newGlobalManualTask, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_MANUAL_TASK, + newGlobalManualTask, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setGlobalManualTask(GlobalManualTask newGlobalManualTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_MANUAL_TASK, + newGlobalManualTask); + } + + /** + * + * + * @generated + */ + @Override + public GlobalScriptTask getGlobalScriptTask() { + return (GlobalScriptTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_SCRIPT_TASK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGlobalScriptTask(GlobalScriptTask newGlobalScriptTask, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_SCRIPT_TASK, + newGlobalScriptTask, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setGlobalScriptTask(GlobalScriptTask newGlobalScriptTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_SCRIPT_TASK, + newGlobalScriptTask); + } + + /** + * + * + * @generated + */ + @Override + public GlobalTask getGlobalTask() { + return (GlobalTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_TASK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGlobalTask(GlobalTask newGlobalTask, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_TASK, + newGlobalTask, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setGlobalTask(GlobalTask newGlobalTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_TASK, newGlobalTask); + } + + /** + * + * + * @generated + */ + @Override + public GlobalUserTask getGlobalUserTask() { + return (GlobalUserTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_USER_TASK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGlobalUserTask(GlobalUserTask newGlobalUserTask, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_USER_TASK, + newGlobalUserTask, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setGlobalUserTask(GlobalUserTask newGlobalUserTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__GLOBAL_USER_TASK, + newGlobalUserTask); + } + + /** + * + * + * @generated + */ + @Override + public Group getGroup() { + return (Group) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__GROUP, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGroup(Group newGroup, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__GROUP, newGroup, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setGroup(Group newGroup) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__GROUP, newGroup); + } + + /** + * + * + * @generated + */ + @Override + public HumanPerformer getHumanPerformer() { + return (HumanPerformer) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__HUMAN_PERFORMER, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetHumanPerformer(HumanPerformer newHumanPerformer, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__HUMAN_PERFORMER, + newHumanPerformer, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setHumanPerformer(HumanPerformer newHumanPerformer) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__HUMAN_PERFORMER, newHumanPerformer); + } + + /** + * + * + * @generated + */ + @Override + public Performer getPerformer() { + return (Performer) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__PERFORMER, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetPerformer(Performer newPerformer, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__PERFORMER, newPerformer, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setPerformer(Performer newPerformer) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__PERFORMER, newPerformer); + } + + /** + * + * + * @generated + */ + @Override + public ResourceRole getResourceRole() { + return (ResourceRole) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE_ROLE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetResourceRole(ResourceRole newResourceRole, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE_ROLE, + newResourceRole, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setResourceRole(ResourceRole newResourceRole) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE_ROLE, newResourceRole); + } + + /** + * + * + * @generated + */ + @Override + public ImplicitThrowEvent getImplicitThrowEvent() { + return (ImplicitThrowEvent) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__IMPLICIT_THROW_EVENT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetImplicitThrowEvent(ImplicitThrowEvent newImplicitThrowEvent, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__IMPLICIT_THROW_EVENT, + newImplicitThrowEvent, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setImplicitThrowEvent(ImplicitThrowEvent newImplicitThrowEvent) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__IMPLICIT_THROW_EVENT, + newImplicitThrowEvent); + } + + /** + * + * + * @generated + */ + @Override + public Import getImport() { + return (Import) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__IMPORT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetImport(Import newImport, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__IMPORT, newImport, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setImport(Import newImport) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__IMPORT, newImport); + } + + /** + * + * + * @generated + */ + @Override + public InclusiveGateway getInclusiveGateway() { + return (InclusiveGateway) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__INCLUSIVE_GATEWAY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetInclusiveGateway(InclusiveGateway newInclusiveGateway, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__INCLUSIVE_GATEWAY, + newInclusiveGateway, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setInclusiveGateway(InclusiveGateway newInclusiveGateway) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__INCLUSIVE_GATEWAY, + newInclusiveGateway); + } + + /** + * + * + * @generated + */ + @Override + public InputSet getInputSet() { + return (InputSet) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__INPUT_SET, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetInputSet(InputSet newInputSet, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__INPUT_SET, newInputSet, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setInputSet(InputSet newInputSet) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__INPUT_SET, newInputSet); + } + + /** + * + * + * @generated + */ + @Override + public Interface getInterface() { + return (Interface) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__INTERFACE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetInterface(Interface newInterface, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__INTERFACE, newInterface, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setInterface(Interface newInterface) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__INTERFACE, newInterface); + } + + /** + * + * + * @generated + */ + @Override + public IntermediateCatchEvent getIntermediateCatchEvent() { + return (IntermediateCatchEvent) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__INTERMEDIATE_CATCH_EVENT, + true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetIntermediateCatchEvent(IntermediateCatchEvent newIntermediateCatchEvent, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__INTERMEDIATE_CATCH_EVENT, newIntermediateCatchEvent, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setIntermediateCatchEvent(IntermediateCatchEvent newIntermediateCatchEvent) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__INTERMEDIATE_CATCH_EVENT, + newIntermediateCatchEvent); + } + + /** + * + * + * @generated + */ + @Override + public IntermediateThrowEvent getIntermediateThrowEvent() { + return (IntermediateThrowEvent) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__INTERMEDIATE_THROW_EVENT, + true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetIntermediateThrowEvent(IntermediateThrowEvent newIntermediateThrowEvent, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__INTERMEDIATE_THROW_EVENT, newIntermediateThrowEvent, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setIntermediateThrowEvent(IntermediateThrowEvent newIntermediateThrowEvent) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__INTERMEDIATE_THROW_EVENT, + newIntermediateThrowEvent); + } + + /** + * + * + * @generated + */ + @Override + public InputOutputBinding getIoBinding() { + return (InputOutputBinding) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__IO_BINDING, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetIoBinding(InputOutputBinding newIoBinding, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__IO_BINDING, + newIoBinding, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setIoBinding(InputOutputBinding newIoBinding) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__IO_BINDING, newIoBinding); + } + + /** + * + * + * @generated + */ + @Override + public InputOutputSpecification getIoSpecification() { + return (InputOutputSpecification) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__IO_SPECIFICATION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetIoSpecification(InputOutputSpecification newIoSpecification, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__IO_SPECIFICATION, + newIoSpecification, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setIoSpecification(InputOutputSpecification newIoSpecification) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__IO_SPECIFICATION, + newIoSpecification); + } + + /** + * + * + * @generated + */ + @Override + public ItemDefinition getItemDefinition() { + return (ItemDefinition) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__ITEM_DEFINITION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetItemDefinition(ItemDefinition newItemDefinition, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__ITEM_DEFINITION, + newItemDefinition, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setItemDefinition(ItemDefinition newItemDefinition) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__ITEM_DEFINITION, newItemDefinition); + } + + /** + * + * + * @generated + */ + @Override + public Lane getLane() { + return (Lane) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__LANE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLane(Lane newLane, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__LANE, newLane, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setLane(Lane newLane) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__LANE, newLane); + } + + /** + * + * + * @generated + */ + @Override + public LaneSet getLaneSet() { + return (LaneSet) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__LANE_SET, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLaneSet(LaneSet newLaneSet, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__LANE_SET, newLaneSet, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setLaneSet(LaneSet newLaneSet) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__LANE_SET, newLaneSet); + } + + /** + * + * + * @generated + */ + @Override + public LinkEventDefinition getLinkEventDefinition() { + return (LinkEventDefinition) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__LINK_EVENT_DEFINITION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLinkEventDefinition(LinkEventDefinition newLinkEventDefinition, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__LINK_EVENT_DEFINITION, + newLinkEventDefinition, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setLinkEventDefinition(LinkEventDefinition newLinkEventDefinition) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__LINK_EVENT_DEFINITION, + newLinkEventDefinition); + } + + /** + * + * + * @generated + */ + @Override + public LoopCharacteristics getLoopCharacteristics() { + return (LoopCharacteristics) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__LOOP_CHARACTERISTICS, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLoopCharacteristics(LoopCharacteristics newLoopCharacteristics, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__LOOP_CHARACTERISTICS, + newLoopCharacteristics, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setLoopCharacteristics(LoopCharacteristics newLoopCharacteristics) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__LOOP_CHARACTERISTICS, + newLoopCharacteristics); + } + + /** + * + * + * @generated + */ + @Override + public ManualTask getManualTask() { + return (ManualTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__MANUAL_TASK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetManualTask(ManualTask newManualTask, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__MANUAL_TASK, + newManualTask, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setManualTask(ManualTask newManualTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__MANUAL_TASK, newManualTask); + } + + /** + * + * + * @generated + */ + @Override + public Message getMessage() { + return (Message) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__MESSAGE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetMessage(Message newMessage, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__MESSAGE, newMessage, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setMessage(Message newMessage) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__MESSAGE, newMessage); + } + + /** + * + * + * @generated + */ + @Override + public MessageEventDefinition getMessageEventDefinition() { + return (MessageEventDefinition) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__MESSAGE_EVENT_DEFINITION, + true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetMessageEventDefinition(MessageEventDefinition newMessageEventDefinition, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__MESSAGE_EVENT_DEFINITION, newMessageEventDefinition, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setMessageEventDefinition(MessageEventDefinition newMessageEventDefinition) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__MESSAGE_EVENT_DEFINITION, + newMessageEventDefinition); + } + + /** + * + * + * @generated + */ + @Override + public MessageFlow getMessageFlow() { + return (MessageFlow) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__MESSAGE_FLOW, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetMessageFlow(MessageFlow newMessageFlow, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__MESSAGE_FLOW, + newMessageFlow, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setMessageFlow(MessageFlow newMessageFlow) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__MESSAGE_FLOW, newMessageFlow); + } + + /** + * + * + * @generated + */ + @Override + public MessageFlowAssociation getMessageFlowAssociation() { + return (MessageFlowAssociation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__MESSAGE_FLOW_ASSOCIATION, + true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetMessageFlowAssociation(MessageFlowAssociation newMessageFlowAssociation, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__MESSAGE_FLOW_ASSOCIATION, newMessageFlowAssociation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setMessageFlowAssociation(MessageFlowAssociation newMessageFlowAssociation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__MESSAGE_FLOW_ASSOCIATION, + newMessageFlowAssociation); + } + + /** + * + * + * @generated + */ + @Override + public Monitoring getMonitoring() { + return (Monitoring) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__MONITORING, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetMonitoring(Monitoring newMonitoring, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__MONITORING, + newMonitoring, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setMonitoring(Monitoring newMonitoring) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__MONITORING, newMonitoring); + } + + /** + * + * + * @generated + */ + @Override + public MultiInstanceLoopCharacteristics getMultiInstanceLoopCharacteristics() { + return (MultiInstanceLoopCharacteristics) getMixed() + .get(Bpmn2Package.Literals.DOCUMENT_ROOT__MULTI_INSTANCE_LOOP_CHARACTERISTICS, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetMultiInstanceLoopCharacteristics( + MultiInstanceLoopCharacteristics newMultiInstanceLoopCharacteristics, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__MULTI_INSTANCE_LOOP_CHARACTERISTICS, + newMultiInstanceLoopCharacteristics, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setMultiInstanceLoopCharacteristics( + MultiInstanceLoopCharacteristics newMultiInstanceLoopCharacteristics) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__MULTI_INSTANCE_LOOP_CHARACTERISTICS, + newMultiInstanceLoopCharacteristics); + } + + /** + * + * + * @generated + */ + @Override + public Operation getOperation() { + return (Operation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__OPERATION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetOperation(Operation newOperation, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__OPERATION, newOperation, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setOperation(Operation newOperation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__OPERATION, newOperation); + } + + /** + * + * + * @generated + */ + @Override + public OutputSet getOutputSet() { + return (OutputSet) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__OUTPUT_SET, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetOutputSet(OutputSet newOutputSet, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__OUTPUT_SET, + newOutputSet, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setOutputSet(OutputSet newOutputSet) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__OUTPUT_SET, newOutputSet); + } + + /** + * + * + * @generated + */ + @Override + public ParallelGateway getParallelGateway() { + return (ParallelGateway) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__PARALLEL_GATEWAY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetParallelGateway(ParallelGateway newParallelGateway, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__PARALLEL_GATEWAY, + newParallelGateway, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setParallelGateway(ParallelGateway newParallelGateway) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__PARALLEL_GATEWAY, + newParallelGateway); + } + + /** + * + * + * @generated + */ + @Override + public Participant getParticipant() { + return (Participant) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTICIPANT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetParticipant(Participant newParticipant, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTICIPANT, + newParticipant, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setParticipant(Participant newParticipant) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTICIPANT, newParticipant); + } + + /** + * + * + * @generated + */ + @Override + public ParticipantAssociation getParticipantAssociation() { + return (ParticipantAssociation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTICIPANT_ASSOCIATION, + true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetParticipantAssociation(ParticipantAssociation newParticipantAssociation, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTICIPANT_ASSOCIATION, + newParticipantAssociation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setParticipantAssociation(ParticipantAssociation newParticipantAssociation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTICIPANT_ASSOCIATION, + newParticipantAssociation); + } + + /** + * + * + * @generated + */ + @Override + public ParticipantMultiplicity getParticipantMultiplicity() { + return (ParticipantMultiplicity) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTICIPANT_MULTIPLICITY, + true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetParticipantMultiplicity(ParticipantMultiplicity newParticipantMultiplicity, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__PARTICIPANT_MULTIPLICITY, newParticipantMultiplicity, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setParticipantMultiplicity(ParticipantMultiplicity newParticipantMultiplicity) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTICIPANT_MULTIPLICITY, + newParticipantMultiplicity); + } + + /** + * + * + * @generated + */ + @Override + public PartnerEntity getPartnerEntity() { + return (PartnerEntity) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTNER_ENTITY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetPartnerEntity(PartnerEntity newPartnerEntity, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTNER_ENTITY, + newPartnerEntity, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setPartnerEntity(PartnerEntity newPartnerEntity) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTNER_ENTITY, newPartnerEntity); + } + + /** + * + * + * @generated + */ + @Override + public PartnerRole getPartnerRole() { + return (PartnerRole) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTNER_ROLE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetPartnerRole(PartnerRole newPartnerRole, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTNER_ROLE, + newPartnerRole, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setPartnerRole(PartnerRole newPartnerRole) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__PARTNER_ROLE, newPartnerRole); + } + + /** + * + * + * @generated + */ + @Override + public PotentialOwner getPotentialOwner() { + return (PotentialOwner) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__POTENTIAL_OWNER, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetPotentialOwner(PotentialOwner newPotentialOwner, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__POTENTIAL_OWNER, + newPotentialOwner, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setPotentialOwner(PotentialOwner newPotentialOwner) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__POTENTIAL_OWNER, newPotentialOwner); + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.bpmn2.Process getProcess() { + return (org.eclipse.bpmn2.Process) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__PROCESS, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetProcess(org.eclipse.bpmn2.Process newProcess, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__PROCESS, newProcess, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setProcess(org.eclipse.bpmn2.Process newProcess) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__PROCESS, newProcess); + } + + /** + * + * + * @generated + */ + @Override + public Property getProperty() { + return (Property) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__PROPERTY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetProperty(Property newProperty, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__PROPERTY, newProperty, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setProperty(Property newProperty) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__PROPERTY, newProperty); + } + + /** + * + * + * @generated + */ + @Override + public ReceiveTask getReceiveTask() { + return (ReceiveTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__RECEIVE_TASK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetReceiveTask(ReceiveTask newReceiveTask, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__RECEIVE_TASK, + newReceiveTask, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setReceiveTask(ReceiveTask newReceiveTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__RECEIVE_TASK, newReceiveTask); + } + + /** + * + * + * @generated + */ + @Override + public Relationship getRelationship() { + return (Relationship) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__RELATIONSHIP, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetRelationship(Relationship newRelationship, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__RELATIONSHIP, + newRelationship, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setRelationship(Relationship newRelationship) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__RELATIONSHIP, newRelationship); + } + + /** + * + * + * @generated + */ + @Override + public Rendering getRendering() { + return (Rendering) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__RENDERING, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetRendering(Rendering newRendering, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__RENDERING, newRendering, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setRendering(Rendering newRendering) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__RENDERING, newRendering); + } + + /** + * + * + * @generated + */ + @Override + public Resource getResource() { + return (Resource) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetResource(Resource newResource, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE, newResource, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setResource(Resource newResource) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE, newResource); + } + + /** + * + * + * @generated + */ + @Override + public ResourceAssignmentExpression getResourceAssignmentExpression() { + return (ResourceAssignmentExpression) getMixed() + .get(Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE_ASSIGNMENT_EXPRESSION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetResourceAssignmentExpression( + ResourceAssignmentExpression newResourceAssignmentExpression, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE_ASSIGNMENT_EXPRESSION, newResourceAssignmentExpression, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setResourceAssignmentExpression(ResourceAssignmentExpression newResourceAssignmentExpression) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE_ASSIGNMENT_EXPRESSION, + newResourceAssignmentExpression); + } + + /** + * + * + * @generated + */ + @Override + public ResourceParameter getResourceParameter() { + return (ResourceParameter) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE_PARAMETER, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetResourceParameter(ResourceParameter newResourceParameter, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE_PARAMETER, + newResourceParameter, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setResourceParameter(ResourceParameter newResourceParameter) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE_PARAMETER, + newResourceParameter); + } + + /** + * + * + * @generated + */ + @Override + public ResourceParameterBinding getResourceParameterBinding() { + return (ResourceParameterBinding) getMixed() + .get(Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE_PARAMETER_BINDING, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetResourceParameterBinding(ResourceParameterBinding newResourceParameterBinding, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE_PARAMETER_BINDING, newResourceParameterBinding, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setResourceParameterBinding(ResourceParameterBinding newResourceParameterBinding) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__RESOURCE_PARAMETER_BINDING, + newResourceParameterBinding); + } + + /** + * + * + * @generated + */ + @Override + public EObject getScript() { + return (EObject) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__SCRIPT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetScript(EObject newScript, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__SCRIPT, newScript, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setScript(EObject newScript) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__SCRIPT, newScript); + } + + /** + * + * + * @generated + */ + @Override + public ScriptTask getScriptTask() { + return (ScriptTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__SCRIPT_TASK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetScriptTask(ScriptTask newScriptTask, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__SCRIPT_TASK, + newScriptTask, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setScriptTask(ScriptTask newScriptTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__SCRIPT_TASK, newScriptTask); + } + + /** + * + * + * @generated + */ + @Override + public SendTask getSendTask() { + return (SendTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__SEND_TASK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSendTask(SendTask newSendTask, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__SEND_TASK, newSendTask, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setSendTask(SendTask newSendTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__SEND_TASK, newSendTask); + } + + /** + * + * + * @generated + */ + @Override + public SequenceFlow getSequenceFlow() { + return (SequenceFlow) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__SEQUENCE_FLOW, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSequenceFlow(SequenceFlow newSequenceFlow, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__SEQUENCE_FLOW, + newSequenceFlow, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setSequenceFlow(SequenceFlow newSequenceFlow) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__SEQUENCE_FLOW, newSequenceFlow); + } + + /** + * + * + * @generated + */ + @Override + public ServiceTask getServiceTask() { + return (ServiceTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__SERVICE_TASK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetServiceTask(ServiceTask newServiceTask, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__SERVICE_TASK, + newServiceTask, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setServiceTask(ServiceTask newServiceTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__SERVICE_TASK, newServiceTask); + } + + /** + * + * + * @generated + */ + @Override + public Signal getSignal() { + return (Signal) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__SIGNAL, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSignal(Signal newSignal, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__SIGNAL, newSignal, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setSignal(Signal newSignal) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__SIGNAL, newSignal); + } + + /** + * + * + * @generated + */ + @Override + public SignalEventDefinition getSignalEventDefinition() { + return (SignalEventDefinition) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__SIGNAL_EVENT_DEFINITION, + true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSignalEventDefinition(SignalEventDefinition newSignalEventDefinition, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__SIGNAL_EVENT_DEFINITION, + newSignalEventDefinition, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setSignalEventDefinition(SignalEventDefinition newSignalEventDefinition) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__SIGNAL_EVENT_DEFINITION, + newSignalEventDefinition); + } + + /** + * + * + * @generated + */ + @Override + public StandardLoopCharacteristics getStandardLoopCharacteristics() { + return (StandardLoopCharacteristics) getMixed() + .get(Bpmn2Package.Literals.DOCUMENT_ROOT__STANDARD_LOOP_CHARACTERISTICS, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetStandardLoopCharacteristics( + StandardLoopCharacteristics newStandardLoopCharacteristics, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__STANDARD_LOOP_CHARACTERISTICS, newStandardLoopCharacteristics, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setStandardLoopCharacteristics(StandardLoopCharacteristics newStandardLoopCharacteristics) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__STANDARD_LOOP_CHARACTERISTICS, + newStandardLoopCharacteristics); + } + + /** + * + * + * @generated + */ + @Override + public StartEvent getStartEvent() { + return (StartEvent) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__START_EVENT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetStartEvent(StartEvent newStartEvent, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__START_EVENT, + newStartEvent, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setStartEvent(StartEvent newStartEvent) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__START_EVENT, newStartEvent); + } + + /** + * + * + * @generated + */ + @Override + public SubChoreography getSubChoreography() { + return (SubChoreography) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__SUB_CHOREOGRAPHY, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSubChoreography(SubChoreography newSubChoreography, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__SUB_CHOREOGRAPHY, + newSubChoreography, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setSubChoreography(SubChoreography newSubChoreography) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__SUB_CHOREOGRAPHY, + newSubChoreography); + } + + /** + * + * + * @generated + */ + @Override + public SubConversation getSubConversation() { + return (SubConversation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__SUB_CONVERSATION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSubConversation(SubConversation newSubConversation, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__SUB_CONVERSATION, + newSubConversation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setSubConversation(SubConversation newSubConversation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__SUB_CONVERSATION, + newSubConversation); + } + + /** + * + * + * @generated + */ + @Override + public SubProcess getSubProcess() { + return (SubProcess) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__SUB_PROCESS, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSubProcess(SubProcess newSubProcess, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__SUB_PROCESS, + newSubProcess, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setSubProcess(SubProcess newSubProcess) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__SUB_PROCESS, newSubProcess); + } + + /** + * + * + * @generated + */ + @Override + public Task getTask() { + return (Task) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__TASK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTask(Task newTask, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__TASK, newTask, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setTask(Task newTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__TASK, newTask); + } + + /** + * + * + * @generated + */ + @Override + public TerminateEventDefinition getTerminateEventDefinition() { + return (TerminateEventDefinition) getMixed() + .get(Bpmn2Package.Literals.DOCUMENT_ROOT__TERMINATE_EVENT_DEFINITION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTerminateEventDefinition(TerminateEventDefinition newTerminateEventDefinition, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd( + Bpmn2Package.Literals.DOCUMENT_ROOT__TERMINATE_EVENT_DEFINITION, newTerminateEventDefinition, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setTerminateEventDefinition(TerminateEventDefinition newTerminateEventDefinition) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__TERMINATE_EVENT_DEFINITION, + newTerminateEventDefinition); + } + + /** + * + * + * @generated + */ + @Override + public EObject getText() { + return (EObject) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__TEXT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetText(EObject newText, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__TEXT, newText, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setText(EObject newText) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__TEXT, newText); + } + + /** + * + * + * @generated + */ + @Override + public TextAnnotation getTextAnnotation() { + return (TextAnnotation) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__TEXT_ANNOTATION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTextAnnotation(TextAnnotation newTextAnnotation, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__TEXT_ANNOTATION, + newTextAnnotation, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setTextAnnotation(TextAnnotation newTextAnnotation) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__TEXT_ANNOTATION, newTextAnnotation); + } + + /** + * + * + * @generated + */ + @Override + public ThrowEvent getThrowEvent() { + return (ThrowEvent) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__THROW_EVENT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetThrowEvent(ThrowEvent newThrowEvent, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__THROW_EVENT, + newThrowEvent, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setThrowEvent(ThrowEvent newThrowEvent) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__THROW_EVENT, newThrowEvent); + } + + /** + * + * + * @generated + */ + @Override + public TimerEventDefinition getTimerEventDefinition() { + return (TimerEventDefinition) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__TIMER_EVENT_DEFINITION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTimerEventDefinition(TimerEventDefinition newTimerEventDefinition, + NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__TIMER_EVENT_DEFINITION, + newTimerEventDefinition, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setTimerEventDefinition(TimerEventDefinition newTimerEventDefinition) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__TIMER_EVENT_DEFINITION, + newTimerEventDefinition); + } + + /** + * + * + * @generated + */ + @Override + public Transaction getTransaction() { + return (Transaction) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__TRANSACTION, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTransaction(Transaction newTransaction, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__TRANSACTION, + newTransaction, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setTransaction(Transaction newTransaction) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__TRANSACTION, newTransaction); + } + + /** + * + * + * @generated + */ + @Override + public UserTask getUserTask() { + return (UserTask) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__USER_TASK, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetUserTask(UserTask newUserTask, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__USER_TASK, newUserTask, + msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setUserTask(UserTask newUserTask) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__USER_TASK, newUserTask); + } + + /** + * + * + * @generated + */ + @Override + public EventSubprocess getEventSubProcess() { + return (EventSubprocess) getMixed().get(Bpmn2Package.Literals.DOCUMENT_ROOT__EVENT_SUB_PROCESS, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEventSubProcess(EventSubprocess newEventSubProcess, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(Bpmn2Package.Literals.DOCUMENT_ROOT__EVENT_SUB_PROCESS, + newEventSubProcess, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setEventSubProcess(EventSubprocess newEventSubProcess) { + ((FeatureMap.Internal) getMixed()).set(Bpmn2Package.Literals.DOCUMENT_ROOT__EVENT_SUB_PROCESS, + newEventSubProcess); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.DOCUMENT_ROOT__MIXED: + return ((InternalEList) getMixed()).basicRemove(otherEnd, msgs); + case Bpmn2Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + return ((InternalEList) getXMLNSPrefixMap()).basicRemove(otherEnd, msgs); + case Bpmn2Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + return ((InternalEList) getXSISchemaLocation()).basicRemove(otherEnd, msgs); + case Bpmn2Package.DOCUMENT_ROOT__ACTIVITY: + return basicSetActivity(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__AD_HOC_SUB_PROCESS: + return basicSetAdHocSubProcess(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__FLOW_ELEMENT: + return basicSetFlowElement(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__ARTIFACT: + return basicSetArtifact(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__ASSIGNMENT: + return basicSetAssignment(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__ASSOCIATION: + return basicSetAssociation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__AUDITING: + return basicSetAuditing(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__BASE_ELEMENT: + return basicSetBaseElement(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__BASE_ELEMENT_WITH_MIXED_CONTENT: + return basicSetBaseElementWithMixedContent(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__BOUNDARY_EVENT: + return basicSetBoundaryEvent(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__BUSINESS_RULE_TASK: + return basicSetBusinessRuleTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CALLABLE_ELEMENT: + return basicSetCallableElement(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CALL_ACTIVITY: + return basicSetCallActivity(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CALL_CHOREOGRAPHY: + return basicSetCallChoreography(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CALL_CONVERSATION: + return basicSetCallConversation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_NODE: + return basicSetConversationNode(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CANCEL_EVENT_DEFINITION: + return basicSetCancelEventDefinition(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__EVENT_DEFINITION: + return basicSetEventDefinition(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__ROOT_ELEMENT: + return basicSetRootElement(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CATCH_EVENT: + return basicSetCatchEvent(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CATEGORY: + return basicSetCategory(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CATEGORY_VALUE: + return basicSetCategoryValue(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY: + return basicSetChoreography(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__COLLABORATION: + return basicSetCollaboration(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY_ACTIVITY: + return basicSetChoreographyActivity(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY_TASK: + return basicSetChoreographyTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__COMPENSATE_EVENT_DEFINITION: + return basicSetCompensateEventDefinition(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__COMPLEX_BEHAVIOR_DEFINITION: + return basicSetComplexBehaviorDefinition(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__COMPLEX_GATEWAY: + return basicSetComplexGateway(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CONDITIONAL_EVENT_DEFINITION: + return basicSetConditionalEventDefinition(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION: + return basicSetConversation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_ASSOCIATION: + return basicSetConversationAssociation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_LINK: + return basicSetConversationLink(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_KEY: + return basicSetCorrelationKey(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY: + return basicSetCorrelationProperty(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY_BINDING: + return basicSetCorrelationPropertyBinding(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION: + return basicSetCorrelationPropertyRetrievalExpression(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_SUBSCRIPTION: + return basicSetCorrelationSubscription(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__DATA_ASSOCIATION: + return basicSetDataAssociation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__DATA_INPUT: + return basicSetDataInput(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__DATA_INPUT_ASSOCIATION: + return basicSetDataInputAssociation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__DATA_OBJECT: + return basicSetDataObject(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__DATA_OBJECT_REFERENCE: + return basicSetDataObjectReference(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__DATA_OUTPUT: + return basicSetDataOutput(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__DATA_OUTPUT_ASSOCIATION: + return basicSetDataOutputAssociation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__DATA_STATE: + return basicSetDataState(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__DATA_STORE: + return basicSetDataStore(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__DATA_STORE_REFERENCE: + return basicSetDataStoreReference(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__DEFINITIONS: + return basicSetDefinitions(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__DOCUMENTATION: + return basicSetDocumentation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__END_EVENT: + return basicSetEndEvent(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__END_POINT: + return basicSetEndPoint(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__ERROR: + return basicSetError(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__ERROR_EVENT_DEFINITION: + return basicSetErrorEventDefinition(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__ESCALATION: + return basicSetEscalation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__ESCALATION_EVENT_DEFINITION: + return basicSetEscalationEventDefinition(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__EVENT: + return basicSetEvent(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__EVENT_BASED_GATEWAY: + return basicSetEventBasedGateway(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__EXCLUSIVE_GATEWAY: + return basicSetExclusiveGateway(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__EXPRESSION: + return basicSetExpression(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__EXTENSION: + return basicSetExtension(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__EXTENSION_ELEMENTS: + return basicSetExtensionElements(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__FLOW_NODE: + return basicSetFlowNode(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__FORMAL_EXPRESSION: + return basicSetFormalExpression(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__GATEWAY: + return basicSetGateway(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_BUSINESS_RULE_TASK: + return basicSetGlobalBusinessRuleTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_CHOREOGRAPHY_TASK: + return basicSetGlobalChoreographyTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_CONVERSATION: + return basicSetGlobalConversation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_MANUAL_TASK: + return basicSetGlobalManualTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_SCRIPT_TASK: + return basicSetGlobalScriptTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_TASK: + return basicSetGlobalTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_USER_TASK: + return basicSetGlobalUserTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__GROUP: + return basicSetGroup(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__HUMAN_PERFORMER: + return basicSetHumanPerformer(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__PERFORMER: + return basicSetPerformer(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_ROLE: + return basicSetResourceRole(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__IMPLICIT_THROW_EVENT: + return basicSetImplicitThrowEvent(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__IMPORT: + return basicSetImport(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__INCLUSIVE_GATEWAY: + return basicSetInclusiveGateway(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__INPUT_SET: + return basicSetInputSet(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__INTERFACE: + return basicSetInterface(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__INTERMEDIATE_CATCH_EVENT: + return basicSetIntermediateCatchEvent(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__INTERMEDIATE_THROW_EVENT: + return basicSetIntermediateThrowEvent(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__IO_BINDING: + return basicSetIoBinding(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__IO_SPECIFICATION: + return basicSetIoSpecification(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__ITEM_DEFINITION: + return basicSetItemDefinition(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__LANE: + return basicSetLane(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__LANE_SET: + return basicSetLaneSet(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__LINK_EVENT_DEFINITION: + return basicSetLinkEventDefinition(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__LOOP_CHARACTERISTICS: + return basicSetLoopCharacteristics(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__MANUAL_TASK: + return basicSetManualTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE: + return basicSetMessage(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_EVENT_DEFINITION: + return basicSetMessageEventDefinition(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_FLOW: + return basicSetMessageFlow(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_FLOW_ASSOCIATION: + return basicSetMessageFlowAssociation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__MONITORING: + return basicSetMonitoring(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__MULTI_INSTANCE_LOOP_CHARACTERISTICS: + return basicSetMultiInstanceLoopCharacteristics(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__OPERATION: + return basicSetOperation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__OUTPUT_SET: + return basicSetOutputSet(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__PARALLEL_GATEWAY: + return basicSetParallelGateway(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT: + return basicSetParticipant(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT_ASSOCIATION: + return basicSetParticipantAssociation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT_MULTIPLICITY: + return basicSetParticipantMultiplicity(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__PARTNER_ENTITY: + return basicSetPartnerEntity(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__PARTNER_ROLE: + return basicSetPartnerRole(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__POTENTIAL_OWNER: + return basicSetPotentialOwner(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__PROCESS: + return basicSetProcess(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__PROPERTY: + return basicSetProperty(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__RECEIVE_TASK: + return basicSetReceiveTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__RELATIONSHIP: + return basicSetRelationship(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__RENDERING: + return basicSetRendering(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE: + return basicSetResource(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_ASSIGNMENT_EXPRESSION: + return basicSetResourceAssignmentExpression(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_PARAMETER: + return basicSetResourceParameter(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_PARAMETER_BINDING: + return basicSetResourceParameterBinding(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__SCRIPT: + return basicSetScript(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__SCRIPT_TASK: + return basicSetScriptTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__SEND_TASK: + return basicSetSendTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__SEQUENCE_FLOW: + return basicSetSequenceFlow(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__SERVICE_TASK: + return basicSetServiceTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__SIGNAL: + return basicSetSignal(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__SIGNAL_EVENT_DEFINITION: + return basicSetSignalEventDefinition(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__STANDARD_LOOP_CHARACTERISTICS: + return basicSetStandardLoopCharacteristics(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__START_EVENT: + return basicSetStartEvent(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__SUB_CHOREOGRAPHY: + return basicSetSubChoreography(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__SUB_CONVERSATION: + return basicSetSubConversation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__SUB_PROCESS: + return basicSetSubProcess(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__TASK: + return basicSetTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__TERMINATE_EVENT_DEFINITION: + return basicSetTerminateEventDefinition(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__TEXT: + return basicSetText(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__TEXT_ANNOTATION: + return basicSetTextAnnotation(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__THROW_EVENT: + return basicSetThrowEvent(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__TIMER_EVENT_DEFINITION: + return basicSetTimerEventDefinition(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__TRANSACTION: + return basicSetTransaction(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__USER_TASK: + return basicSetUserTask(null, msgs); + case Bpmn2Package.DOCUMENT_ROOT__EVENT_SUB_PROCESS: + return basicSetEventSubProcess(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.DOCUMENT_ROOT__MIXED: + if (coreType) + return getMixed(); + return ((FeatureMap.Internal) getMixed()).getWrapper(); + case Bpmn2Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + if (coreType) + return getXMLNSPrefixMap(); + else + return getXMLNSPrefixMap().map(); + case Bpmn2Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + if (coreType) + return getXSISchemaLocation(); + else + return getXSISchemaLocation().map(); + case Bpmn2Package.DOCUMENT_ROOT__ACTIVITY: + return getActivity(); + case Bpmn2Package.DOCUMENT_ROOT__AD_HOC_SUB_PROCESS: + return getAdHocSubProcess(); + case Bpmn2Package.DOCUMENT_ROOT__FLOW_ELEMENT: + return getFlowElement(); + case Bpmn2Package.DOCUMENT_ROOT__ARTIFACT: + return getArtifact(); + case Bpmn2Package.DOCUMENT_ROOT__ASSIGNMENT: + return getAssignment(); + case Bpmn2Package.DOCUMENT_ROOT__ASSOCIATION: + return getAssociation(); + case Bpmn2Package.DOCUMENT_ROOT__AUDITING: + return getAuditing(); + case Bpmn2Package.DOCUMENT_ROOT__BASE_ELEMENT: + return getBaseElement(); + case Bpmn2Package.DOCUMENT_ROOT__BASE_ELEMENT_WITH_MIXED_CONTENT: + return getBaseElementWithMixedContent(); + case Bpmn2Package.DOCUMENT_ROOT__BOUNDARY_EVENT: + return getBoundaryEvent(); + case Bpmn2Package.DOCUMENT_ROOT__BUSINESS_RULE_TASK: + return getBusinessRuleTask(); + case Bpmn2Package.DOCUMENT_ROOT__CALLABLE_ELEMENT: + return getCallableElement(); + case Bpmn2Package.DOCUMENT_ROOT__CALL_ACTIVITY: + return getCallActivity(); + case Bpmn2Package.DOCUMENT_ROOT__CALL_CHOREOGRAPHY: + return getCallChoreography(); + case Bpmn2Package.DOCUMENT_ROOT__CALL_CONVERSATION: + return getCallConversation(); + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_NODE: + return getConversationNode(); + case Bpmn2Package.DOCUMENT_ROOT__CANCEL_EVENT_DEFINITION: + return getCancelEventDefinition(); + case Bpmn2Package.DOCUMENT_ROOT__EVENT_DEFINITION: + return getEventDefinition(); + case Bpmn2Package.DOCUMENT_ROOT__ROOT_ELEMENT: + return getRootElement(); + case Bpmn2Package.DOCUMENT_ROOT__CATCH_EVENT: + return getCatchEvent(); + case Bpmn2Package.DOCUMENT_ROOT__CATEGORY: + return getCategory(); + case Bpmn2Package.DOCUMENT_ROOT__CATEGORY_VALUE: + return getCategoryValue(); + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY: + return getChoreography(); + case Bpmn2Package.DOCUMENT_ROOT__COLLABORATION: + return getCollaboration(); + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY_ACTIVITY: + return getChoreographyActivity(); + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY_TASK: + return getChoreographyTask(); + case Bpmn2Package.DOCUMENT_ROOT__COMPENSATE_EVENT_DEFINITION: + return getCompensateEventDefinition(); + case Bpmn2Package.DOCUMENT_ROOT__COMPLEX_BEHAVIOR_DEFINITION: + return getComplexBehaviorDefinition(); + case Bpmn2Package.DOCUMENT_ROOT__COMPLEX_GATEWAY: + return getComplexGateway(); + case Bpmn2Package.DOCUMENT_ROOT__CONDITIONAL_EVENT_DEFINITION: + return getConditionalEventDefinition(); + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION: + return getConversation(); + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_ASSOCIATION: + return getConversationAssociation(); + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_LINK: + return getConversationLink(); + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_KEY: + return getCorrelationKey(); + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY: + return getCorrelationProperty(); + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY_BINDING: + return getCorrelationPropertyBinding(); + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION: + return getCorrelationPropertyRetrievalExpression(); + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_SUBSCRIPTION: + return getCorrelationSubscription(); + case Bpmn2Package.DOCUMENT_ROOT__DATA_ASSOCIATION: + return getDataAssociation(); + case Bpmn2Package.DOCUMENT_ROOT__DATA_INPUT: + return getDataInput(); + case Bpmn2Package.DOCUMENT_ROOT__DATA_INPUT_ASSOCIATION: + return getDataInputAssociation(); + case Bpmn2Package.DOCUMENT_ROOT__DATA_OBJECT: + return getDataObject(); + case Bpmn2Package.DOCUMENT_ROOT__DATA_OBJECT_REFERENCE: + return getDataObjectReference(); + case Bpmn2Package.DOCUMENT_ROOT__DATA_OUTPUT: + return getDataOutput(); + case Bpmn2Package.DOCUMENT_ROOT__DATA_OUTPUT_ASSOCIATION: + return getDataOutputAssociation(); + case Bpmn2Package.DOCUMENT_ROOT__DATA_STATE: + return getDataState(); + case Bpmn2Package.DOCUMENT_ROOT__DATA_STORE: + return getDataStore(); + case Bpmn2Package.DOCUMENT_ROOT__DATA_STORE_REFERENCE: + return getDataStoreReference(); + case Bpmn2Package.DOCUMENT_ROOT__DEFINITIONS: + return getDefinitions(); + case Bpmn2Package.DOCUMENT_ROOT__DOCUMENTATION: + return getDocumentation(); + case Bpmn2Package.DOCUMENT_ROOT__END_EVENT: + return getEndEvent(); + case Bpmn2Package.DOCUMENT_ROOT__END_POINT: + return getEndPoint(); + case Bpmn2Package.DOCUMENT_ROOT__ERROR: + return getError(); + case Bpmn2Package.DOCUMENT_ROOT__ERROR_EVENT_DEFINITION: + return getErrorEventDefinition(); + case Bpmn2Package.DOCUMENT_ROOT__ESCALATION: + return getEscalation(); + case Bpmn2Package.DOCUMENT_ROOT__ESCALATION_EVENT_DEFINITION: + return getEscalationEventDefinition(); + case Bpmn2Package.DOCUMENT_ROOT__EVENT: + return getEvent(); + case Bpmn2Package.DOCUMENT_ROOT__EVENT_BASED_GATEWAY: + return getEventBasedGateway(); + case Bpmn2Package.DOCUMENT_ROOT__EXCLUSIVE_GATEWAY: + return getExclusiveGateway(); + case Bpmn2Package.DOCUMENT_ROOT__EXPRESSION: + return getExpression(); + case Bpmn2Package.DOCUMENT_ROOT__EXTENSION: + return getExtension(); + case Bpmn2Package.DOCUMENT_ROOT__EXTENSION_ELEMENTS: + return getExtensionElements(); + case Bpmn2Package.DOCUMENT_ROOT__FLOW_NODE: + return getFlowNode(); + case Bpmn2Package.DOCUMENT_ROOT__FORMAL_EXPRESSION: + return getFormalExpression(); + case Bpmn2Package.DOCUMENT_ROOT__GATEWAY: + return getGateway(); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_BUSINESS_RULE_TASK: + return getGlobalBusinessRuleTask(); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_CHOREOGRAPHY_TASK: + return getGlobalChoreographyTask(); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_CONVERSATION: + return getGlobalConversation(); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_MANUAL_TASK: + return getGlobalManualTask(); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_SCRIPT_TASK: + return getGlobalScriptTask(); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_TASK: + return getGlobalTask(); + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_USER_TASK: + return getGlobalUserTask(); + case Bpmn2Package.DOCUMENT_ROOT__GROUP: + return getGroup(); + case Bpmn2Package.DOCUMENT_ROOT__HUMAN_PERFORMER: + return getHumanPerformer(); + case Bpmn2Package.DOCUMENT_ROOT__PERFORMER: + return getPerformer(); + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_ROLE: + return getResourceRole(); + case Bpmn2Package.DOCUMENT_ROOT__IMPLICIT_THROW_EVENT: + return getImplicitThrowEvent(); + case Bpmn2Package.DOCUMENT_ROOT__IMPORT: + return getImport(); + case Bpmn2Package.DOCUMENT_ROOT__INCLUSIVE_GATEWAY: + return getInclusiveGateway(); + case Bpmn2Package.DOCUMENT_ROOT__INPUT_SET: + return getInputSet(); + case Bpmn2Package.DOCUMENT_ROOT__INTERFACE: + return getInterface(); + case Bpmn2Package.DOCUMENT_ROOT__INTERMEDIATE_CATCH_EVENT: + return getIntermediateCatchEvent(); + case Bpmn2Package.DOCUMENT_ROOT__INTERMEDIATE_THROW_EVENT: + return getIntermediateThrowEvent(); + case Bpmn2Package.DOCUMENT_ROOT__IO_BINDING: + return getIoBinding(); + case Bpmn2Package.DOCUMENT_ROOT__IO_SPECIFICATION: + return getIoSpecification(); + case Bpmn2Package.DOCUMENT_ROOT__ITEM_DEFINITION: + return getItemDefinition(); + case Bpmn2Package.DOCUMENT_ROOT__LANE: + return getLane(); + case Bpmn2Package.DOCUMENT_ROOT__LANE_SET: + return getLaneSet(); + case Bpmn2Package.DOCUMENT_ROOT__LINK_EVENT_DEFINITION: + return getLinkEventDefinition(); + case Bpmn2Package.DOCUMENT_ROOT__LOOP_CHARACTERISTICS: + return getLoopCharacteristics(); + case Bpmn2Package.DOCUMENT_ROOT__MANUAL_TASK: + return getManualTask(); + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE: + return getMessage(); + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_EVENT_DEFINITION: + return getMessageEventDefinition(); + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_FLOW: + return getMessageFlow(); + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_FLOW_ASSOCIATION: + return getMessageFlowAssociation(); + case Bpmn2Package.DOCUMENT_ROOT__MONITORING: + return getMonitoring(); + case Bpmn2Package.DOCUMENT_ROOT__MULTI_INSTANCE_LOOP_CHARACTERISTICS: + return getMultiInstanceLoopCharacteristics(); + case Bpmn2Package.DOCUMENT_ROOT__OPERATION: + return getOperation(); + case Bpmn2Package.DOCUMENT_ROOT__OUTPUT_SET: + return getOutputSet(); + case Bpmn2Package.DOCUMENT_ROOT__PARALLEL_GATEWAY: + return getParallelGateway(); + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT: + return getParticipant(); + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT_ASSOCIATION: + return getParticipantAssociation(); + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT_MULTIPLICITY: + return getParticipantMultiplicity(); + case Bpmn2Package.DOCUMENT_ROOT__PARTNER_ENTITY: + return getPartnerEntity(); + case Bpmn2Package.DOCUMENT_ROOT__PARTNER_ROLE: + return getPartnerRole(); + case Bpmn2Package.DOCUMENT_ROOT__POTENTIAL_OWNER: + return getPotentialOwner(); + case Bpmn2Package.DOCUMENT_ROOT__PROCESS: + return getProcess(); + case Bpmn2Package.DOCUMENT_ROOT__PROPERTY: + return getProperty(); + case Bpmn2Package.DOCUMENT_ROOT__RECEIVE_TASK: + return getReceiveTask(); + case Bpmn2Package.DOCUMENT_ROOT__RELATIONSHIP: + return getRelationship(); + case Bpmn2Package.DOCUMENT_ROOT__RENDERING: + return getRendering(); + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE: + return getResource(); + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_ASSIGNMENT_EXPRESSION: + return getResourceAssignmentExpression(); + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_PARAMETER: + return getResourceParameter(); + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_PARAMETER_BINDING: + return getResourceParameterBinding(); + case Bpmn2Package.DOCUMENT_ROOT__SCRIPT: + return getScript(); + case Bpmn2Package.DOCUMENT_ROOT__SCRIPT_TASK: + return getScriptTask(); + case Bpmn2Package.DOCUMENT_ROOT__SEND_TASK: + return getSendTask(); + case Bpmn2Package.DOCUMENT_ROOT__SEQUENCE_FLOW: + return getSequenceFlow(); + case Bpmn2Package.DOCUMENT_ROOT__SERVICE_TASK: + return getServiceTask(); + case Bpmn2Package.DOCUMENT_ROOT__SIGNAL: + return getSignal(); + case Bpmn2Package.DOCUMENT_ROOT__SIGNAL_EVENT_DEFINITION: + return getSignalEventDefinition(); + case Bpmn2Package.DOCUMENT_ROOT__STANDARD_LOOP_CHARACTERISTICS: + return getStandardLoopCharacteristics(); + case Bpmn2Package.DOCUMENT_ROOT__START_EVENT: + return getStartEvent(); + case Bpmn2Package.DOCUMENT_ROOT__SUB_CHOREOGRAPHY: + return getSubChoreography(); + case Bpmn2Package.DOCUMENT_ROOT__SUB_CONVERSATION: + return getSubConversation(); + case Bpmn2Package.DOCUMENT_ROOT__SUB_PROCESS: + return getSubProcess(); + case Bpmn2Package.DOCUMENT_ROOT__TASK: + return getTask(); + case Bpmn2Package.DOCUMENT_ROOT__TERMINATE_EVENT_DEFINITION: + return getTerminateEventDefinition(); + case Bpmn2Package.DOCUMENT_ROOT__TEXT: + return getText(); + case Bpmn2Package.DOCUMENT_ROOT__TEXT_ANNOTATION: + return getTextAnnotation(); + case Bpmn2Package.DOCUMENT_ROOT__THROW_EVENT: + return getThrowEvent(); + case Bpmn2Package.DOCUMENT_ROOT__TIMER_EVENT_DEFINITION: + return getTimerEventDefinition(); + case Bpmn2Package.DOCUMENT_ROOT__TRANSACTION: + return getTransaction(); + case Bpmn2Package.DOCUMENT_ROOT__USER_TASK: + return getUserTask(); + case Bpmn2Package.DOCUMENT_ROOT__EVENT_SUB_PROCESS: + return getEventSubProcess(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.DOCUMENT_ROOT__MIXED: + ((FeatureMap.Internal) getMixed()).set(newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + ((EStructuralFeature.Setting) getXMLNSPrefixMap()).set(newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + ((EStructuralFeature.Setting) getXSISchemaLocation()).set(newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__ACTIVITY: + setActivity((Activity) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__AD_HOC_SUB_PROCESS: + setAdHocSubProcess((AdHocSubProcess) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__FLOW_ELEMENT: + setFlowElement((FlowElement) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__ARTIFACT: + setArtifact((Artifact) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__ASSIGNMENT: + setAssignment((Assignment) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__ASSOCIATION: + setAssociation((Association) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__AUDITING: + setAuditing((Auditing) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__BASE_ELEMENT: + setBaseElement((BaseElement) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__BASE_ELEMENT_WITH_MIXED_CONTENT: + setBaseElementWithMixedContent((BaseElement) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__BOUNDARY_EVENT: + setBoundaryEvent((BoundaryEvent) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__BUSINESS_RULE_TASK: + setBusinessRuleTask((BusinessRuleTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CALLABLE_ELEMENT: + setCallableElement((CallableElement) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CALL_ACTIVITY: + setCallActivity((CallActivity) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CALL_CHOREOGRAPHY: + setCallChoreography((CallChoreography) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CALL_CONVERSATION: + setCallConversation((CallConversation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_NODE: + setConversationNode((ConversationNode) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CANCEL_EVENT_DEFINITION: + setCancelEventDefinition((CancelEventDefinition) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__EVENT_DEFINITION: + setEventDefinition((EventDefinition) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__ROOT_ELEMENT: + setRootElement((RootElement) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CATCH_EVENT: + setCatchEvent((CatchEvent) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CATEGORY: + setCategory((Category) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CATEGORY_VALUE: + setCategoryValue((CategoryValue) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY: + setChoreography((Choreography) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__COLLABORATION: + setCollaboration((Collaboration) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY_ACTIVITY: + setChoreographyActivity((ChoreographyActivity) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY_TASK: + setChoreographyTask((ChoreographyTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__COMPENSATE_EVENT_DEFINITION: + setCompensateEventDefinition((CompensateEventDefinition) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__COMPLEX_BEHAVIOR_DEFINITION: + setComplexBehaviorDefinition((ComplexBehaviorDefinition) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__COMPLEX_GATEWAY: + setComplexGateway((ComplexGateway) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CONDITIONAL_EVENT_DEFINITION: + setConditionalEventDefinition((ConditionalEventDefinition) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION: + setConversation((Conversation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_ASSOCIATION: + setConversationAssociation((ConversationAssociation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_LINK: + setConversationLink((ConversationLink) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_KEY: + setCorrelationKey((CorrelationKey) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY: + setCorrelationProperty((CorrelationProperty) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY_BINDING: + setCorrelationPropertyBinding((CorrelationPropertyBinding) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION: + setCorrelationPropertyRetrievalExpression((CorrelationPropertyRetrievalExpression) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_SUBSCRIPTION: + setCorrelationSubscription((CorrelationSubscription) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_ASSOCIATION: + setDataAssociation((DataAssociation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_INPUT: + setDataInput((DataInput) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_INPUT_ASSOCIATION: + setDataInputAssociation((DataInputAssociation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_OBJECT: + setDataObject((DataObject) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_OBJECT_REFERENCE: + setDataObjectReference((DataObjectReference) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_OUTPUT: + setDataOutput((DataOutput) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_OUTPUT_ASSOCIATION: + setDataOutputAssociation((DataOutputAssociation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_STATE: + setDataState((DataState) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_STORE: + setDataStore((DataStore) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_STORE_REFERENCE: + setDataStoreReference((DataStoreReference) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__DEFINITIONS: + setDefinitions((Definitions) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__DOCUMENTATION: + setDocumentation((Documentation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__END_EVENT: + setEndEvent((EndEvent) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__END_POINT: + setEndPoint((EndPoint) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__ERROR: + setError((org.eclipse.bpmn2.Error) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__ERROR_EVENT_DEFINITION: + setErrorEventDefinition((ErrorEventDefinition) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__ESCALATION: + setEscalation((Escalation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__ESCALATION_EVENT_DEFINITION: + setEscalationEventDefinition((EscalationEventDefinition) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__EVENT: + setEvent((Event) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__EVENT_BASED_GATEWAY: + setEventBasedGateway((EventBasedGateway) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__EXCLUSIVE_GATEWAY: + setExclusiveGateway((ExclusiveGateway) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__EXPRESSION: + setExpression((Expression) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__EXTENSION: + setExtension((Extension) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__EXTENSION_ELEMENTS: + setExtensionElements((ExtensionAttributeValue) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__FLOW_NODE: + setFlowNode((FlowNode) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__FORMAL_EXPRESSION: + setFormalExpression((FormalExpression) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_BUSINESS_RULE_TASK: + setGlobalBusinessRuleTask((GlobalBusinessRuleTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_CHOREOGRAPHY_TASK: + setGlobalChoreographyTask((GlobalChoreographyTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_CONVERSATION: + setGlobalConversation((GlobalConversation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_MANUAL_TASK: + setGlobalManualTask((GlobalManualTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_SCRIPT_TASK: + setGlobalScriptTask((GlobalScriptTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_TASK: + setGlobalTask((GlobalTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_USER_TASK: + setGlobalUserTask((GlobalUserTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__GROUP: + setGroup((Group) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__HUMAN_PERFORMER: + setHumanPerformer((HumanPerformer) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__PERFORMER: + setPerformer((Performer) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_ROLE: + setResourceRole((ResourceRole) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__IMPLICIT_THROW_EVENT: + setImplicitThrowEvent((ImplicitThrowEvent) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__IMPORT: + setImport((Import) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__INCLUSIVE_GATEWAY: + setInclusiveGateway((InclusiveGateway) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__INPUT_SET: + setInputSet((InputSet) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__INTERFACE: + setInterface((Interface) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__INTERMEDIATE_CATCH_EVENT: + setIntermediateCatchEvent((IntermediateCatchEvent) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__INTERMEDIATE_THROW_EVENT: + setIntermediateThrowEvent((IntermediateThrowEvent) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__IO_BINDING: + setIoBinding((InputOutputBinding) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__IO_SPECIFICATION: + setIoSpecification((InputOutputSpecification) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__ITEM_DEFINITION: + setItemDefinition((ItemDefinition) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__LANE: + setLane((Lane) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__LANE_SET: + setLaneSet((LaneSet) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__LINK_EVENT_DEFINITION: + setLinkEventDefinition((LinkEventDefinition) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__LOOP_CHARACTERISTICS: + setLoopCharacteristics((LoopCharacteristics) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__MANUAL_TASK: + setManualTask((ManualTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE: + setMessage((Message) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_EVENT_DEFINITION: + setMessageEventDefinition((MessageEventDefinition) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_FLOW: + setMessageFlow((MessageFlow) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_FLOW_ASSOCIATION: + setMessageFlowAssociation((MessageFlowAssociation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__MONITORING: + setMonitoring((Monitoring) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__MULTI_INSTANCE_LOOP_CHARACTERISTICS: + setMultiInstanceLoopCharacteristics((MultiInstanceLoopCharacteristics) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__OPERATION: + setOperation((Operation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__OUTPUT_SET: + setOutputSet((OutputSet) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__PARALLEL_GATEWAY: + setParallelGateway((ParallelGateway) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT: + setParticipant((Participant) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT_ASSOCIATION: + setParticipantAssociation((ParticipantAssociation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT_MULTIPLICITY: + setParticipantMultiplicity((ParticipantMultiplicity) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__PARTNER_ENTITY: + setPartnerEntity((PartnerEntity) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__PARTNER_ROLE: + setPartnerRole((PartnerRole) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__POTENTIAL_OWNER: + setPotentialOwner((PotentialOwner) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__PROCESS: + setProcess((org.eclipse.bpmn2.Process) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__PROPERTY: + setProperty((Property) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__RECEIVE_TASK: + setReceiveTask((ReceiveTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__RELATIONSHIP: + setRelationship((Relationship) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__RENDERING: + setRendering((Rendering) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE: + setResource((Resource) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_ASSIGNMENT_EXPRESSION: + setResourceAssignmentExpression((ResourceAssignmentExpression) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_PARAMETER: + setResourceParameter((ResourceParameter) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_PARAMETER_BINDING: + setResourceParameterBinding((ResourceParameterBinding) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__SCRIPT: + setScript((EObject) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__SCRIPT_TASK: + setScriptTask((ScriptTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__SEND_TASK: + setSendTask((SendTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__SEQUENCE_FLOW: + setSequenceFlow((SequenceFlow) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__SERVICE_TASK: + setServiceTask((ServiceTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__SIGNAL: + setSignal((Signal) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__SIGNAL_EVENT_DEFINITION: + setSignalEventDefinition((SignalEventDefinition) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__STANDARD_LOOP_CHARACTERISTICS: + setStandardLoopCharacteristics((StandardLoopCharacteristics) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__START_EVENT: + setStartEvent((StartEvent) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__SUB_CHOREOGRAPHY: + setSubChoreography((SubChoreography) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__SUB_CONVERSATION: + setSubConversation((SubConversation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__SUB_PROCESS: + setSubProcess((SubProcess) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__TASK: + setTask((Task) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__TERMINATE_EVENT_DEFINITION: + setTerminateEventDefinition((TerminateEventDefinition) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__TEXT: + setText((EObject) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__TEXT_ANNOTATION: + setTextAnnotation((TextAnnotation) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__THROW_EVENT: + setThrowEvent((ThrowEvent) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__TIMER_EVENT_DEFINITION: + setTimerEventDefinition((TimerEventDefinition) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__TRANSACTION: + setTransaction((Transaction) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__USER_TASK: + setUserTask((UserTask) newValue); + return; + case Bpmn2Package.DOCUMENT_ROOT__EVENT_SUB_PROCESS: + setEventSubProcess((EventSubprocess) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.DOCUMENT_ROOT__MIXED: + getMixed().clear(); + return; + case Bpmn2Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + getXMLNSPrefixMap().clear(); + return; + case Bpmn2Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + getXSISchemaLocation().clear(); + return; + case Bpmn2Package.DOCUMENT_ROOT__ACTIVITY: + setActivity((Activity) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__AD_HOC_SUB_PROCESS: + setAdHocSubProcess((AdHocSubProcess) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__FLOW_ELEMENT: + setFlowElement((FlowElement) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__ARTIFACT: + setArtifact((Artifact) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__ASSIGNMENT: + setAssignment((Assignment) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__ASSOCIATION: + setAssociation((Association) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__AUDITING: + setAuditing((Auditing) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__BASE_ELEMENT: + setBaseElement((BaseElement) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__BASE_ELEMENT_WITH_MIXED_CONTENT: + setBaseElementWithMixedContent((BaseElement) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__BOUNDARY_EVENT: + setBoundaryEvent((BoundaryEvent) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__BUSINESS_RULE_TASK: + setBusinessRuleTask((BusinessRuleTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CALLABLE_ELEMENT: + setCallableElement((CallableElement) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CALL_ACTIVITY: + setCallActivity((CallActivity) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CALL_CHOREOGRAPHY: + setCallChoreography((CallChoreography) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CALL_CONVERSATION: + setCallConversation((CallConversation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_NODE: + setConversationNode((ConversationNode) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CANCEL_EVENT_DEFINITION: + setCancelEventDefinition((CancelEventDefinition) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__EVENT_DEFINITION: + setEventDefinition((EventDefinition) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__ROOT_ELEMENT: + setRootElement((RootElement) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CATCH_EVENT: + setCatchEvent((CatchEvent) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CATEGORY: + setCategory((Category) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CATEGORY_VALUE: + setCategoryValue((CategoryValue) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY: + setChoreography((Choreography) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__COLLABORATION: + setCollaboration((Collaboration) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY_ACTIVITY: + setChoreographyActivity((ChoreographyActivity) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY_TASK: + setChoreographyTask((ChoreographyTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__COMPENSATE_EVENT_DEFINITION: + setCompensateEventDefinition((CompensateEventDefinition) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__COMPLEX_BEHAVIOR_DEFINITION: + setComplexBehaviorDefinition((ComplexBehaviorDefinition) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__COMPLEX_GATEWAY: + setComplexGateway((ComplexGateway) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CONDITIONAL_EVENT_DEFINITION: + setConditionalEventDefinition((ConditionalEventDefinition) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION: + setConversation((Conversation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_ASSOCIATION: + setConversationAssociation((ConversationAssociation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_LINK: + setConversationLink((ConversationLink) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_KEY: + setCorrelationKey((CorrelationKey) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY: + setCorrelationProperty((CorrelationProperty) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY_BINDING: + setCorrelationPropertyBinding((CorrelationPropertyBinding) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION: + setCorrelationPropertyRetrievalExpression((CorrelationPropertyRetrievalExpression) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_SUBSCRIPTION: + setCorrelationSubscription((CorrelationSubscription) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_ASSOCIATION: + setDataAssociation((DataAssociation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_INPUT: + setDataInput((DataInput) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_INPUT_ASSOCIATION: + setDataInputAssociation((DataInputAssociation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_OBJECT: + setDataObject((DataObject) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_OBJECT_REFERENCE: + setDataObjectReference((DataObjectReference) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_OUTPUT: + setDataOutput((DataOutput) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_OUTPUT_ASSOCIATION: + setDataOutputAssociation((DataOutputAssociation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_STATE: + setDataState((DataState) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_STORE: + setDataStore((DataStore) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__DATA_STORE_REFERENCE: + setDataStoreReference((DataStoreReference) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__DEFINITIONS: + setDefinitions((Definitions) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__DOCUMENTATION: + setDocumentation((Documentation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__END_EVENT: + setEndEvent((EndEvent) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__END_POINT: + setEndPoint((EndPoint) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__ERROR: + setError((org.eclipse.bpmn2.Error) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__ERROR_EVENT_DEFINITION: + setErrorEventDefinition((ErrorEventDefinition) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__ESCALATION: + setEscalation((Escalation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__ESCALATION_EVENT_DEFINITION: + setEscalationEventDefinition((EscalationEventDefinition) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__EVENT: + setEvent((Event) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__EVENT_BASED_GATEWAY: + setEventBasedGateway((EventBasedGateway) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__EXCLUSIVE_GATEWAY: + setExclusiveGateway((ExclusiveGateway) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__EXPRESSION: + setExpression((Expression) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__EXTENSION: + setExtension((Extension) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__EXTENSION_ELEMENTS: + setExtensionElements((ExtensionAttributeValue) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__FLOW_NODE: + setFlowNode((FlowNode) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__FORMAL_EXPRESSION: + setFormalExpression((FormalExpression) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_BUSINESS_RULE_TASK: + setGlobalBusinessRuleTask((GlobalBusinessRuleTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_CHOREOGRAPHY_TASK: + setGlobalChoreographyTask((GlobalChoreographyTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_CONVERSATION: + setGlobalConversation((GlobalConversation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_MANUAL_TASK: + setGlobalManualTask((GlobalManualTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_SCRIPT_TASK: + setGlobalScriptTask((GlobalScriptTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_TASK: + setGlobalTask((GlobalTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_USER_TASK: + setGlobalUserTask((GlobalUserTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__GROUP: + setGroup((Group) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__HUMAN_PERFORMER: + setHumanPerformer((HumanPerformer) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__PERFORMER: + setPerformer((Performer) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_ROLE: + setResourceRole((ResourceRole) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__IMPLICIT_THROW_EVENT: + setImplicitThrowEvent((ImplicitThrowEvent) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__IMPORT: + setImport((Import) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__INCLUSIVE_GATEWAY: + setInclusiveGateway((InclusiveGateway) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__INPUT_SET: + setInputSet((InputSet) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__INTERFACE: + setInterface((Interface) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__INTERMEDIATE_CATCH_EVENT: + setIntermediateCatchEvent((IntermediateCatchEvent) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__INTERMEDIATE_THROW_EVENT: + setIntermediateThrowEvent((IntermediateThrowEvent) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__IO_BINDING: + setIoBinding((InputOutputBinding) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__IO_SPECIFICATION: + setIoSpecification((InputOutputSpecification) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__ITEM_DEFINITION: + setItemDefinition((ItemDefinition) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__LANE: + setLane((Lane) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__LANE_SET: + setLaneSet((LaneSet) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__LINK_EVENT_DEFINITION: + setLinkEventDefinition((LinkEventDefinition) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__LOOP_CHARACTERISTICS: + setLoopCharacteristics((LoopCharacteristics) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__MANUAL_TASK: + setManualTask((ManualTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE: + setMessage((Message) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_EVENT_DEFINITION: + setMessageEventDefinition((MessageEventDefinition) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_FLOW: + setMessageFlow((MessageFlow) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_FLOW_ASSOCIATION: + setMessageFlowAssociation((MessageFlowAssociation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__MONITORING: + setMonitoring((Monitoring) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__MULTI_INSTANCE_LOOP_CHARACTERISTICS: + setMultiInstanceLoopCharacteristics((MultiInstanceLoopCharacteristics) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__OPERATION: + setOperation((Operation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__OUTPUT_SET: + setOutputSet((OutputSet) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__PARALLEL_GATEWAY: + setParallelGateway((ParallelGateway) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT: + setParticipant((Participant) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT_ASSOCIATION: + setParticipantAssociation((ParticipantAssociation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT_MULTIPLICITY: + setParticipantMultiplicity((ParticipantMultiplicity) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__PARTNER_ENTITY: + setPartnerEntity((PartnerEntity) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__PARTNER_ROLE: + setPartnerRole((PartnerRole) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__POTENTIAL_OWNER: + setPotentialOwner((PotentialOwner) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__PROCESS: + setProcess((org.eclipse.bpmn2.Process) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__PROPERTY: + setProperty((Property) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__RECEIVE_TASK: + setReceiveTask((ReceiveTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__RELATIONSHIP: + setRelationship((Relationship) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__RENDERING: + setRendering((Rendering) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE: + setResource((Resource) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_ASSIGNMENT_EXPRESSION: + setResourceAssignmentExpression((ResourceAssignmentExpression) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_PARAMETER: + setResourceParameter((ResourceParameter) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_PARAMETER_BINDING: + setResourceParameterBinding((ResourceParameterBinding) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__SCRIPT: + setScript((EObject) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__SCRIPT_TASK: + setScriptTask((ScriptTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__SEND_TASK: + setSendTask((SendTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__SEQUENCE_FLOW: + setSequenceFlow((SequenceFlow) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__SERVICE_TASK: + setServiceTask((ServiceTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__SIGNAL: + setSignal((Signal) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__SIGNAL_EVENT_DEFINITION: + setSignalEventDefinition((SignalEventDefinition) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__STANDARD_LOOP_CHARACTERISTICS: + setStandardLoopCharacteristics((StandardLoopCharacteristics) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__START_EVENT: + setStartEvent((StartEvent) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__SUB_CHOREOGRAPHY: + setSubChoreography((SubChoreography) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__SUB_CONVERSATION: + setSubConversation((SubConversation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__SUB_PROCESS: + setSubProcess((SubProcess) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__TASK: + setTask((Task) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__TERMINATE_EVENT_DEFINITION: + setTerminateEventDefinition((TerminateEventDefinition) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__TEXT: + setText((EObject) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__TEXT_ANNOTATION: + setTextAnnotation((TextAnnotation) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__THROW_EVENT: + setThrowEvent((ThrowEvent) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__TIMER_EVENT_DEFINITION: + setTimerEventDefinition((TimerEventDefinition) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__TRANSACTION: + setTransaction((Transaction) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__USER_TASK: + setUserTask((UserTask) null); + return; + case Bpmn2Package.DOCUMENT_ROOT__EVENT_SUB_PROCESS: + setEventSubProcess((EventSubprocess) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.DOCUMENT_ROOT__MIXED: + return mixed != null && !mixed.isEmpty(); + case Bpmn2Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty(); + case Bpmn2Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + return xSISchemaLocation != null && !xSISchemaLocation.isEmpty(); + case Bpmn2Package.DOCUMENT_ROOT__ACTIVITY: + return getActivity() != null; + case Bpmn2Package.DOCUMENT_ROOT__AD_HOC_SUB_PROCESS: + return getAdHocSubProcess() != null; + case Bpmn2Package.DOCUMENT_ROOT__FLOW_ELEMENT: + return getFlowElement() != null; + case Bpmn2Package.DOCUMENT_ROOT__ARTIFACT: + return getArtifact() != null; + case Bpmn2Package.DOCUMENT_ROOT__ASSIGNMENT: + return getAssignment() != null; + case Bpmn2Package.DOCUMENT_ROOT__ASSOCIATION: + return getAssociation() != null; + case Bpmn2Package.DOCUMENT_ROOT__AUDITING: + return getAuditing() != null; + case Bpmn2Package.DOCUMENT_ROOT__BASE_ELEMENT: + return getBaseElement() != null; + case Bpmn2Package.DOCUMENT_ROOT__BASE_ELEMENT_WITH_MIXED_CONTENT: + return getBaseElementWithMixedContent() != null; + case Bpmn2Package.DOCUMENT_ROOT__BOUNDARY_EVENT: + return getBoundaryEvent() != null; + case Bpmn2Package.DOCUMENT_ROOT__BUSINESS_RULE_TASK: + return getBusinessRuleTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__CALLABLE_ELEMENT: + return getCallableElement() != null; + case Bpmn2Package.DOCUMENT_ROOT__CALL_ACTIVITY: + return getCallActivity() != null; + case Bpmn2Package.DOCUMENT_ROOT__CALL_CHOREOGRAPHY: + return getCallChoreography() != null; + case Bpmn2Package.DOCUMENT_ROOT__CALL_CONVERSATION: + return getCallConversation() != null; + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_NODE: + return getConversationNode() != null; + case Bpmn2Package.DOCUMENT_ROOT__CANCEL_EVENT_DEFINITION: + return getCancelEventDefinition() != null; + case Bpmn2Package.DOCUMENT_ROOT__EVENT_DEFINITION: + return getEventDefinition() != null; + case Bpmn2Package.DOCUMENT_ROOT__ROOT_ELEMENT: + return getRootElement() != null; + case Bpmn2Package.DOCUMENT_ROOT__CATCH_EVENT: + return getCatchEvent() != null; + case Bpmn2Package.DOCUMENT_ROOT__CATEGORY: + return getCategory() != null; + case Bpmn2Package.DOCUMENT_ROOT__CATEGORY_VALUE: + return getCategoryValue() != null; + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY: + return getChoreography() != null; + case Bpmn2Package.DOCUMENT_ROOT__COLLABORATION: + return getCollaboration() != null; + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY_ACTIVITY: + return getChoreographyActivity() != null; + case Bpmn2Package.DOCUMENT_ROOT__CHOREOGRAPHY_TASK: + return getChoreographyTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__COMPENSATE_EVENT_DEFINITION: + return getCompensateEventDefinition() != null; + case Bpmn2Package.DOCUMENT_ROOT__COMPLEX_BEHAVIOR_DEFINITION: + return getComplexBehaviorDefinition() != null; + case Bpmn2Package.DOCUMENT_ROOT__COMPLEX_GATEWAY: + return getComplexGateway() != null; + case Bpmn2Package.DOCUMENT_ROOT__CONDITIONAL_EVENT_DEFINITION: + return getConditionalEventDefinition() != null; + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION: + return getConversation() != null; + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_ASSOCIATION: + return getConversationAssociation() != null; + case Bpmn2Package.DOCUMENT_ROOT__CONVERSATION_LINK: + return getConversationLink() != null; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_KEY: + return getCorrelationKey() != null; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY: + return getCorrelationProperty() != null; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY_BINDING: + return getCorrelationPropertyBinding() != null; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION: + return getCorrelationPropertyRetrievalExpression() != null; + case Bpmn2Package.DOCUMENT_ROOT__CORRELATION_SUBSCRIPTION: + return getCorrelationSubscription() != null; + case Bpmn2Package.DOCUMENT_ROOT__DATA_ASSOCIATION: + return getDataAssociation() != null; + case Bpmn2Package.DOCUMENT_ROOT__DATA_INPUT: + return getDataInput() != null; + case Bpmn2Package.DOCUMENT_ROOT__DATA_INPUT_ASSOCIATION: + return getDataInputAssociation() != null; + case Bpmn2Package.DOCUMENT_ROOT__DATA_OBJECT: + return getDataObject() != null; + case Bpmn2Package.DOCUMENT_ROOT__DATA_OBJECT_REFERENCE: + return getDataObjectReference() != null; + case Bpmn2Package.DOCUMENT_ROOT__DATA_OUTPUT: + return getDataOutput() != null; + case Bpmn2Package.DOCUMENT_ROOT__DATA_OUTPUT_ASSOCIATION: + return getDataOutputAssociation() != null; + case Bpmn2Package.DOCUMENT_ROOT__DATA_STATE: + return getDataState() != null; + case Bpmn2Package.DOCUMENT_ROOT__DATA_STORE: + return getDataStore() != null; + case Bpmn2Package.DOCUMENT_ROOT__DATA_STORE_REFERENCE: + return getDataStoreReference() != null; + case Bpmn2Package.DOCUMENT_ROOT__DEFINITIONS: + return getDefinitions() != null; + case Bpmn2Package.DOCUMENT_ROOT__DOCUMENTATION: + return getDocumentation() != null; + case Bpmn2Package.DOCUMENT_ROOT__END_EVENT: + return getEndEvent() != null; + case Bpmn2Package.DOCUMENT_ROOT__END_POINT: + return getEndPoint() != null; + case Bpmn2Package.DOCUMENT_ROOT__ERROR: + return getError() != null; + case Bpmn2Package.DOCUMENT_ROOT__ERROR_EVENT_DEFINITION: + return getErrorEventDefinition() != null; + case Bpmn2Package.DOCUMENT_ROOT__ESCALATION: + return getEscalation() != null; + case Bpmn2Package.DOCUMENT_ROOT__ESCALATION_EVENT_DEFINITION: + return getEscalationEventDefinition() != null; + case Bpmn2Package.DOCUMENT_ROOT__EVENT: + return getEvent() != null; + case Bpmn2Package.DOCUMENT_ROOT__EVENT_BASED_GATEWAY: + return getEventBasedGateway() != null; + case Bpmn2Package.DOCUMENT_ROOT__EXCLUSIVE_GATEWAY: + return getExclusiveGateway() != null; + case Bpmn2Package.DOCUMENT_ROOT__EXPRESSION: + return getExpression() != null; + case Bpmn2Package.DOCUMENT_ROOT__EXTENSION: + return getExtension() != null; + case Bpmn2Package.DOCUMENT_ROOT__EXTENSION_ELEMENTS: + return getExtensionElements() != null; + case Bpmn2Package.DOCUMENT_ROOT__FLOW_NODE: + return getFlowNode() != null; + case Bpmn2Package.DOCUMENT_ROOT__FORMAL_EXPRESSION: + return getFormalExpression() != null; + case Bpmn2Package.DOCUMENT_ROOT__GATEWAY: + return getGateway() != null; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_BUSINESS_RULE_TASK: + return getGlobalBusinessRuleTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_CHOREOGRAPHY_TASK: + return getGlobalChoreographyTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_CONVERSATION: + return getGlobalConversation() != null; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_MANUAL_TASK: + return getGlobalManualTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_SCRIPT_TASK: + return getGlobalScriptTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_TASK: + return getGlobalTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__GLOBAL_USER_TASK: + return getGlobalUserTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__GROUP: + return getGroup() != null; + case Bpmn2Package.DOCUMENT_ROOT__HUMAN_PERFORMER: + return getHumanPerformer() != null; + case Bpmn2Package.DOCUMENT_ROOT__PERFORMER: + return getPerformer() != null; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_ROLE: + return getResourceRole() != null; + case Bpmn2Package.DOCUMENT_ROOT__IMPLICIT_THROW_EVENT: + return getImplicitThrowEvent() != null; + case Bpmn2Package.DOCUMENT_ROOT__IMPORT: + return getImport() != null; + case Bpmn2Package.DOCUMENT_ROOT__INCLUSIVE_GATEWAY: + return getInclusiveGateway() != null; + case Bpmn2Package.DOCUMENT_ROOT__INPUT_SET: + return getInputSet() != null; + case Bpmn2Package.DOCUMENT_ROOT__INTERFACE: + return getInterface() != null; + case Bpmn2Package.DOCUMENT_ROOT__INTERMEDIATE_CATCH_EVENT: + return getIntermediateCatchEvent() != null; + case Bpmn2Package.DOCUMENT_ROOT__INTERMEDIATE_THROW_EVENT: + return getIntermediateThrowEvent() != null; + case Bpmn2Package.DOCUMENT_ROOT__IO_BINDING: + return getIoBinding() != null; + case Bpmn2Package.DOCUMENT_ROOT__IO_SPECIFICATION: + return getIoSpecification() != null; + case Bpmn2Package.DOCUMENT_ROOT__ITEM_DEFINITION: + return getItemDefinition() != null; + case Bpmn2Package.DOCUMENT_ROOT__LANE: + return getLane() != null; + case Bpmn2Package.DOCUMENT_ROOT__LANE_SET: + return getLaneSet() != null; + case Bpmn2Package.DOCUMENT_ROOT__LINK_EVENT_DEFINITION: + return getLinkEventDefinition() != null; + case Bpmn2Package.DOCUMENT_ROOT__LOOP_CHARACTERISTICS: + return getLoopCharacteristics() != null; + case Bpmn2Package.DOCUMENT_ROOT__MANUAL_TASK: + return getManualTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE: + return getMessage() != null; + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_EVENT_DEFINITION: + return getMessageEventDefinition() != null; + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_FLOW: + return getMessageFlow() != null; + case Bpmn2Package.DOCUMENT_ROOT__MESSAGE_FLOW_ASSOCIATION: + return getMessageFlowAssociation() != null; + case Bpmn2Package.DOCUMENT_ROOT__MONITORING: + return getMonitoring() != null; + case Bpmn2Package.DOCUMENT_ROOT__MULTI_INSTANCE_LOOP_CHARACTERISTICS: + return getMultiInstanceLoopCharacteristics() != null; + case Bpmn2Package.DOCUMENT_ROOT__OPERATION: + return getOperation() != null; + case Bpmn2Package.DOCUMENT_ROOT__OUTPUT_SET: + return getOutputSet() != null; + case Bpmn2Package.DOCUMENT_ROOT__PARALLEL_GATEWAY: + return getParallelGateway() != null; + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT: + return getParticipant() != null; + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT_ASSOCIATION: + return getParticipantAssociation() != null; + case Bpmn2Package.DOCUMENT_ROOT__PARTICIPANT_MULTIPLICITY: + return getParticipantMultiplicity() != null; + case Bpmn2Package.DOCUMENT_ROOT__PARTNER_ENTITY: + return getPartnerEntity() != null; + case Bpmn2Package.DOCUMENT_ROOT__PARTNER_ROLE: + return getPartnerRole() != null; + case Bpmn2Package.DOCUMENT_ROOT__POTENTIAL_OWNER: + return getPotentialOwner() != null; + case Bpmn2Package.DOCUMENT_ROOT__PROCESS: + return getProcess() != null; + case Bpmn2Package.DOCUMENT_ROOT__PROPERTY: + return getProperty() != null; + case Bpmn2Package.DOCUMENT_ROOT__RECEIVE_TASK: + return getReceiveTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__RELATIONSHIP: + return getRelationship() != null; + case Bpmn2Package.DOCUMENT_ROOT__RENDERING: + return getRendering() != null; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE: + return getResource() != null; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_ASSIGNMENT_EXPRESSION: + return getResourceAssignmentExpression() != null; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_PARAMETER: + return getResourceParameter() != null; + case Bpmn2Package.DOCUMENT_ROOT__RESOURCE_PARAMETER_BINDING: + return getResourceParameterBinding() != null; + case Bpmn2Package.DOCUMENT_ROOT__SCRIPT: + return getScript() != null; + case Bpmn2Package.DOCUMENT_ROOT__SCRIPT_TASK: + return getScriptTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__SEND_TASK: + return getSendTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__SEQUENCE_FLOW: + return getSequenceFlow() != null; + case Bpmn2Package.DOCUMENT_ROOT__SERVICE_TASK: + return getServiceTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__SIGNAL: + return getSignal() != null; + case Bpmn2Package.DOCUMENT_ROOT__SIGNAL_EVENT_DEFINITION: + return getSignalEventDefinition() != null; + case Bpmn2Package.DOCUMENT_ROOT__STANDARD_LOOP_CHARACTERISTICS: + return getStandardLoopCharacteristics() != null; + case Bpmn2Package.DOCUMENT_ROOT__START_EVENT: + return getStartEvent() != null; + case Bpmn2Package.DOCUMENT_ROOT__SUB_CHOREOGRAPHY: + return getSubChoreography() != null; + case Bpmn2Package.DOCUMENT_ROOT__SUB_CONVERSATION: + return getSubConversation() != null; + case Bpmn2Package.DOCUMENT_ROOT__SUB_PROCESS: + return getSubProcess() != null; + case Bpmn2Package.DOCUMENT_ROOT__TASK: + return getTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__TERMINATE_EVENT_DEFINITION: + return getTerminateEventDefinition() != null; + case Bpmn2Package.DOCUMENT_ROOT__TEXT: + return getText() != null; + case Bpmn2Package.DOCUMENT_ROOT__TEXT_ANNOTATION: + return getTextAnnotation() != null; + case Bpmn2Package.DOCUMENT_ROOT__THROW_EVENT: + return getThrowEvent() != null; + case Bpmn2Package.DOCUMENT_ROOT__TIMER_EVENT_DEFINITION: + return getTimerEventDefinition() != null; + case Bpmn2Package.DOCUMENT_ROOT__TRANSACTION: + return getTransaction() != null; + case Bpmn2Package.DOCUMENT_ROOT__USER_TASK: + return getUserTask() != null; + case Bpmn2Package.DOCUMENT_ROOT__EVENT_SUB_PROCESS: + return getEventSubProcess() != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (mixed: "); + result.append(mixed); + result.append(')'); + return result.toString(); + } + +} //DocumentRootImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DocumentationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DocumentationImpl.java new file mode 100644 index 00000000000..7f67ae36987 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/DocumentationImpl.java @@ -0,0 +1,285 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Documentation; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Documentation'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.DocumentationImpl#getMixed Mixed}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentationImpl#getText Text}
  • + *
  • {@link org.eclipse.bpmn2.impl.DocumentationImpl#getTextFormat Text Format}
  • + *
+ * + * @generated + */ +public class DocumentationImpl extends BaseElementImpl implements Documentation { + /** + * The cached value of the '{@link #getMixed() Mixed}' attribute list. + * + * + * @see #getMixed() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap mixed; + + /** + * The default value of the '{@link #getText() Text}' attribute. + * + * + * @see #getText() + * @generated + * @ordered + */ + protected static final String TEXT_EDEFAULT = null; + + /** + * The default value of the '{@link #getTextFormat() Text Format}' attribute. + * + * + * @see #getTextFormat() + * @generated + * @ordered + */ + protected static final String TEXT_FORMAT_EDEFAULT = "text/plain"; + + /** + * The cached value of the '{@link #getTextFormat() Text Format}' attribute. + * + * + * @see #getTextFormat() + * @generated + * @ordered + */ + @GwtTransient + protected String textFormat = TEXT_FORMAT_EDEFAULT; + + /** + * + * + * @generated + */ + protected DocumentationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.DOCUMENTATION; + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getMixed() { + if (mixed == null) { + mixed = new BasicFeatureMap(this, Bpmn2Package.DOCUMENTATION__MIXED); + } + return mixed; + } + + /** + * + * + * @generated + */ + @Override + public String getText() { + // TODO: implement this method to return the 'Text' attribute + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public void setText(String newText) { + // TODO: implement this method to set the 'Text' attribute + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public String getTextFormat() { + return textFormat; + } + + /** + * + * + * @generated + */ + @Override + public void setTextFormat(String newTextFormat) { + String oldTextFormat = textFormat; + textFormat = newTextFormat; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DOCUMENTATION__TEXT_FORMAT, + oldTextFormat, textFormat)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.DOCUMENTATION__MIXED: + return ((InternalEList) getMixed()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.DOCUMENTATION__MIXED: + if (coreType) + return getMixed(); + return ((FeatureMap.Internal) getMixed()).getWrapper(); + case Bpmn2Package.DOCUMENTATION__TEXT: + return getText(); + case Bpmn2Package.DOCUMENTATION__TEXT_FORMAT: + return getTextFormat(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.DOCUMENTATION__MIXED: + ((FeatureMap.Internal) getMixed()).set(newValue); + return; + case Bpmn2Package.DOCUMENTATION__TEXT: + setText((String) newValue); + return; + case Bpmn2Package.DOCUMENTATION__TEXT_FORMAT: + setTextFormat((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.DOCUMENTATION__MIXED: + getMixed().clear(); + return; + case Bpmn2Package.DOCUMENTATION__TEXT: + setText(TEXT_EDEFAULT); + return; + case Bpmn2Package.DOCUMENTATION__TEXT_FORMAT: + setTextFormat(TEXT_FORMAT_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.DOCUMENTATION__MIXED: + return mixed != null && !mixed.isEmpty(); + case Bpmn2Package.DOCUMENTATION__TEXT: + return TEXT_EDEFAULT == null ? getText() != null : !TEXT_EDEFAULT.equals(getText()); + case Bpmn2Package.DOCUMENTATION__TEXT_FORMAT: + return TEXT_FORMAT_EDEFAULT == null ? textFormat != null : !TEXT_FORMAT_EDEFAULT.equals(textFormat); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (mixed: "); + result.append(mixed); + result.append(", textFormat: "); + result.append(textFormat); + result.append(')'); + return result.toString(); + } + +} //DocumentationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EndEventImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EndEventImpl.java new file mode 100644 index 00000000000..1ee0112e1fd --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EndEventImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.EndEvent; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'End Event'. + * + * + * @generated + */ +public class EndEventImpl extends ThrowEventImpl implements EndEvent { + /** + * + * + * @generated + */ + protected EndEventImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.END_EVENT; + } + +} //EndEventImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EndPointImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EndPointImpl.java new file mode 100644 index 00000000000..cd6a96b4ee9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EndPointImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.EndPoint; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'End Point'. + * + * + * @generated + */ +public class EndPointImpl extends RootElementImpl implements EndPoint { + /** + * + * + * @generated + */ + protected EndPointImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.END_POINT; + } + +} //EndPointImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ErrorEventDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ErrorEventDefinitionImpl.java new file mode 100644 index 00000000000..e157bb39fd3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ErrorEventDefinitionImpl.java @@ -0,0 +1,175 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ErrorEventDefinition; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Error Event Definition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ErrorEventDefinitionImpl#getErrorRef Error Ref}
  • + *
+ * + * @generated + */ +public class ErrorEventDefinitionImpl extends EventDefinitionImpl implements ErrorEventDefinition { + /** + * The cached value of the '{@link #getErrorRef() Error Ref}' reference. + * + * + * @see #getErrorRef() + * @generated + * @ordered + */ + @GwtTransient + protected org.eclipse.bpmn2.Error errorRef; + + /** + * + * + * @generated + */ + protected ErrorEventDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.ERROR_EVENT_DEFINITION; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.bpmn2.Error getErrorRef() { + if (errorRef != null && errorRef.eIsProxy()) { + InternalEObject oldErrorRef = (InternalEObject) errorRef; + errorRef = (org.eclipse.bpmn2.Error) eResolveProxy(oldErrorRef); + if (errorRef != oldErrorRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.ERROR_EVENT_DEFINITION__ERROR_REF, oldErrorRef, errorRef)); + } + } + return errorRef; + } + + /** + * + * + * @generated + */ + public org.eclipse.bpmn2.Error basicGetErrorRef() { + return errorRef; + } + + /** + * + * + * @generated + */ + @Override + public void setErrorRef(org.eclipse.bpmn2.Error newErrorRef) { + org.eclipse.bpmn2.Error oldErrorRef = errorRef; + errorRef = newErrorRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ERROR_EVENT_DEFINITION__ERROR_REF, + oldErrorRef, errorRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.ERROR_EVENT_DEFINITION__ERROR_REF: + if (resolve) + return getErrorRef(); + return basicGetErrorRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.ERROR_EVENT_DEFINITION__ERROR_REF: + setErrorRef((org.eclipse.bpmn2.Error) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.ERROR_EVENT_DEFINITION__ERROR_REF: + setErrorRef((org.eclipse.bpmn2.Error) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.ERROR_EVENT_DEFINITION__ERROR_REF: + return errorRef != null; + } + return super.eIsSet(featureID); + } + +} //ErrorEventDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ErrorImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ErrorImpl.java new file mode 100644 index 00000000000..b9ae6b6218a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ErrorImpl.java @@ -0,0 +1,305 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ItemDefinition; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Error'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ErrorImpl#getErrorCode Error Code}
  • + *
  • {@link org.eclipse.bpmn2.impl.ErrorImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.ErrorImpl#getStructureRef Structure Ref}
  • + *
+ * + * @generated + */ +public class ErrorImpl extends RootElementImpl implements org.eclipse.bpmn2.Error { + /** + * The default value of the '{@link #getErrorCode() Error Code}' attribute. + * + * + * @see #getErrorCode() + * @generated + * @ordered + */ + protected static final String ERROR_CODE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getErrorCode() Error Code}' attribute. + * + * + * @see #getErrorCode() + * @generated + * @ordered + */ + @GwtTransient + protected String errorCode = ERROR_CODE_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getStructureRef() Structure Ref}' reference. + * + * + * @see #getStructureRef() + * @generated + * @ordered + */ + @GwtTransient + protected ItemDefinition structureRef; + + /** + * + * + * @generated + */ + protected ErrorImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.ERROR; + } + + /** + * + * + * @generated + */ + @Override + public String getErrorCode() { + return errorCode; + } + + /** + * + * + * @generated + */ + @Override + public void setErrorCode(String newErrorCode) { + String oldErrorCode = errorCode; + errorCode = newErrorCode; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ERROR__ERROR_CODE, oldErrorCode, + errorCode)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ERROR__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public ItemDefinition getStructureRef() { + if (structureRef != null && structureRef.eIsProxy()) { + InternalEObject oldStructureRef = (InternalEObject) structureRef; + structureRef = (ItemDefinition) eResolveProxy(oldStructureRef); + if (structureRef != oldStructureRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.ERROR__STRUCTURE_REF, + oldStructureRef, structureRef)); + } + } + return structureRef; + } + + /** + * + * + * @generated + */ + public ItemDefinition basicGetStructureRef() { + return structureRef; + } + + /** + * + * + * @generated + */ + @Override + public void setStructureRef(ItemDefinition newStructureRef) { + ItemDefinition oldStructureRef = structureRef; + structureRef = newStructureRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ERROR__STRUCTURE_REF, oldStructureRef, + structureRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.ERROR__ERROR_CODE: + return getErrorCode(); + case Bpmn2Package.ERROR__NAME: + return getName(); + case Bpmn2Package.ERROR__STRUCTURE_REF: + if (resolve) + return getStructureRef(); + return basicGetStructureRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.ERROR__ERROR_CODE: + setErrorCode((String) newValue); + return; + case Bpmn2Package.ERROR__NAME: + setName((String) newValue); + return; + case Bpmn2Package.ERROR__STRUCTURE_REF: + setStructureRef((ItemDefinition) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.ERROR__ERROR_CODE: + setErrorCode(ERROR_CODE_EDEFAULT); + return; + case Bpmn2Package.ERROR__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.ERROR__STRUCTURE_REF: + setStructureRef((ItemDefinition) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.ERROR__ERROR_CODE: + return ERROR_CODE_EDEFAULT == null ? errorCode != null : !ERROR_CODE_EDEFAULT.equals(errorCode); + case Bpmn2Package.ERROR__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.ERROR__STRUCTURE_REF: + return structureRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (errorCode: "); + result.append(errorCode); + result.append(", name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //ErrorImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EscalationEventDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EscalationEventDefinitionImpl.java new file mode 100644 index 00000000000..0ef49719263 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EscalationEventDefinitionImpl.java @@ -0,0 +1,176 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Escalation; +import org.eclipse.bpmn2.EscalationEventDefinition; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Escalation Event Definition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.EscalationEventDefinitionImpl#getEscalationRef Escalation Ref}
  • + *
+ * + * @generated + */ +public class EscalationEventDefinitionImpl extends EventDefinitionImpl implements EscalationEventDefinition { + /** + * The cached value of the '{@link #getEscalationRef() Escalation Ref}' reference. + * + * + * @see #getEscalationRef() + * @generated + * @ordered + */ + @GwtTransient + protected Escalation escalationRef; + + /** + * + * + * @generated + */ + protected EscalationEventDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.ESCALATION_EVENT_DEFINITION; + } + + /** + * + * + * @generated + */ + @Override + public Escalation getEscalationRef() { + if (escalationRef != null && escalationRef.eIsProxy()) { + InternalEObject oldEscalationRef = (InternalEObject) escalationRef; + escalationRef = (Escalation) eResolveProxy(oldEscalationRef); + if (escalationRef != oldEscalationRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.ESCALATION_EVENT_DEFINITION__ESCALATION_REF, oldEscalationRef, escalationRef)); + } + } + return escalationRef; + } + + /** + * + * + * @generated + */ + public Escalation basicGetEscalationRef() { + return escalationRef; + } + + /** + * + * + * @generated + */ + @Override + public void setEscalationRef(Escalation newEscalationRef) { + Escalation oldEscalationRef = escalationRef; + escalationRef = newEscalationRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.ESCALATION_EVENT_DEFINITION__ESCALATION_REF, oldEscalationRef, escalationRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.ESCALATION_EVENT_DEFINITION__ESCALATION_REF: + if (resolve) + return getEscalationRef(); + return basicGetEscalationRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.ESCALATION_EVENT_DEFINITION__ESCALATION_REF: + setEscalationRef((Escalation) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.ESCALATION_EVENT_DEFINITION__ESCALATION_REF: + setEscalationRef((Escalation) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.ESCALATION_EVENT_DEFINITION__ESCALATION_REF: + return escalationRef != null; + } + return super.eIsSet(featureID); + } + +} //EscalationEventDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EscalationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EscalationImpl.java new file mode 100644 index 00000000000..5581a4cd0d8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EscalationImpl.java @@ -0,0 +1,307 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Escalation; +import org.eclipse.bpmn2.ItemDefinition; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Escalation'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.EscalationImpl#getEscalationCode Escalation Code}
  • + *
  • {@link org.eclipse.bpmn2.impl.EscalationImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.EscalationImpl#getStructureRef Structure Ref}
  • + *
+ * + * @generated + */ +public class EscalationImpl extends RootElementImpl implements Escalation { + /** + * The default value of the '{@link #getEscalationCode() Escalation Code}' attribute. + * + * + * @see #getEscalationCode() + * @generated + * @ordered + */ + protected static final String ESCALATION_CODE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getEscalationCode() Escalation Code}' attribute. + * + * + * @see #getEscalationCode() + * @generated + * @ordered + */ + @GwtTransient + protected String escalationCode = ESCALATION_CODE_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getStructureRef() Structure Ref}' reference. + * + * + * @see #getStructureRef() + * @generated + * @ordered + */ + @GwtTransient + protected ItemDefinition structureRef; + + /** + * + * + * @generated + */ + protected EscalationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.ESCALATION; + } + + /** + * + * + * @generated + */ + @Override + public String getEscalationCode() { + return escalationCode; + } + + /** + * + * + * @generated + */ + @Override + public void setEscalationCode(String newEscalationCode) { + String oldEscalationCode = escalationCode; + escalationCode = newEscalationCode; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ESCALATION__ESCALATION_CODE, + oldEscalationCode, escalationCode)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ESCALATION__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public ItemDefinition getStructureRef() { + if (structureRef != null && structureRef.eIsProxy()) { + InternalEObject oldStructureRef = (InternalEObject) structureRef; + structureRef = (ItemDefinition) eResolveProxy(oldStructureRef); + if (structureRef != oldStructureRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.ESCALATION__STRUCTURE_REF, + oldStructureRef, structureRef)); + } + } + return structureRef; + } + + /** + * + * + * @generated + */ + public ItemDefinition basicGetStructureRef() { + return structureRef; + } + + /** + * + * + * @generated + */ + @Override + public void setStructureRef(ItemDefinition newStructureRef) { + ItemDefinition oldStructureRef = structureRef; + structureRef = newStructureRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ESCALATION__STRUCTURE_REF, + oldStructureRef, structureRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.ESCALATION__ESCALATION_CODE: + return getEscalationCode(); + case Bpmn2Package.ESCALATION__NAME: + return getName(); + case Bpmn2Package.ESCALATION__STRUCTURE_REF: + if (resolve) + return getStructureRef(); + return basicGetStructureRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.ESCALATION__ESCALATION_CODE: + setEscalationCode((String) newValue); + return; + case Bpmn2Package.ESCALATION__NAME: + setName((String) newValue); + return; + case Bpmn2Package.ESCALATION__STRUCTURE_REF: + setStructureRef((ItemDefinition) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.ESCALATION__ESCALATION_CODE: + setEscalationCode(ESCALATION_CODE_EDEFAULT); + return; + case Bpmn2Package.ESCALATION__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.ESCALATION__STRUCTURE_REF: + setStructureRef((ItemDefinition) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.ESCALATION__ESCALATION_CODE: + return ESCALATION_CODE_EDEFAULT == null ? escalationCode != null + : !ESCALATION_CODE_EDEFAULT.equals(escalationCode); + case Bpmn2Package.ESCALATION__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.ESCALATION__STRUCTURE_REF: + return structureRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (escalationCode: "); + result.append(escalationCode); + result.append(", name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //EscalationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EventBasedGatewayImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EventBasedGatewayImpl.java new file mode 100644 index 00000000000..0071f7005b2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EventBasedGatewayImpl.java @@ -0,0 +1,240 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.EventBasedGateway; +import org.eclipse.bpmn2.EventBasedGatewayType; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Event Based Gateway'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.EventBasedGatewayImpl#getEventGatewayType Event Gateway Type}
  • + *
  • {@link org.eclipse.bpmn2.impl.EventBasedGatewayImpl#isInstantiate Instantiate}
  • + *
+ * + * @generated + */ +public class EventBasedGatewayImpl extends GatewayImpl implements EventBasedGateway { + /** + * The default value of the '{@link #getEventGatewayType() Event Gateway Type}' attribute. + * + * + * @see #getEventGatewayType() + * @generated + * @ordered + */ + protected static final EventBasedGatewayType EVENT_GATEWAY_TYPE_EDEFAULT = EventBasedGatewayType.PARALLEL; + + /** + * The cached value of the '{@link #getEventGatewayType() Event Gateway Type}' attribute. + * + * + * @see #getEventGatewayType() + * @generated + * @ordered + */ + @GwtTransient + protected EventBasedGatewayType eventGatewayType = EVENT_GATEWAY_TYPE_EDEFAULT; + + /** + * The default value of the '{@link #isInstantiate() Instantiate}' attribute. + * + * + * @see #isInstantiate() + * @generated + * @ordered + */ + protected static final boolean INSTANTIATE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isInstantiate() Instantiate}' attribute. + * + * + * @see #isInstantiate() + * @generated + * @ordered + */ + @GwtTransient + protected boolean instantiate = INSTANTIATE_EDEFAULT; + + /** + * + * + * @generated + */ + protected EventBasedGatewayImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.EVENT_BASED_GATEWAY; + } + + /** + * + * + * @generated + */ + @Override + public EventBasedGatewayType getEventGatewayType() { + return eventGatewayType; + } + + /** + * + * + * @generated + */ + @Override + public void setEventGatewayType(EventBasedGatewayType newEventGatewayType) { + EventBasedGatewayType oldEventGatewayType = eventGatewayType; + eventGatewayType = newEventGatewayType == null ? EVENT_GATEWAY_TYPE_EDEFAULT : newEventGatewayType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.EVENT_BASED_GATEWAY__EVENT_GATEWAY_TYPE, + oldEventGatewayType, eventGatewayType)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isInstantiate() { + return instantiate; + } + + /** + * + * + * @generated + */ + @Override + public void setInstantiate(boolean newInstantiate) { + boolean oldInstantiate = instantiate; + instantiate = newInstantiate; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.EVENT_BASED_GATEWAY__INSTANTIATE, + oldInstantiate, instantiate)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.EVENT_BASED_GATEWAY__EVENT_GATEWAY_TYPE: + return getEventGatewayType(); + case Bpmn2Package.EVENT_BASED_GATEWAY__INSTANTIATE: + return isInstantiate(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.EVENT_BASED_GATEWAY__EVENT_GATEWAY_TYPE: + setEventGatewayType((EventBasedGatewayType) newValue); + return; + case Bpmn2Package.EVENT_BASED_GATEWAY__INSTANTIATE: + setInstantiate((Boolean) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.EVENT_BASED_GATEWAY__EVENT_GATEWAY_TYPE: + setEventGatewayType(EVENT_GATEWAY_TYPE_EDEFAULT); + return; + case Bpmn2Package.EVENT_BASED_GATEWAY__INSTANTIATE: + setInstantiate(INSTANTIATE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.EVENT_BASED_GATEWAY__EVENT_GATEWAY_TYPE: + return eventGatewayType != EVENT_GATEWAY_TYPE_EDEFAULT; + case Bpmn2Package.EVENT_BASED_GATEWAY__INSTANTIATE: + return instantiate != INSTANTIATE_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (eventGatewayType: "); + result.append(eventGatewayType); + result.append(", instantiate: "); + result.append(instantiate); + result.append(')'); + return result.toString(); + } + +} //EventBasedGatewayImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EventDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EventDefinitionImpl.java new file mode 100644 index 00000000000..6793098162a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EventDefinitionImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.EventDefinition; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Event Definition'. + * + * + * @generated + */ +public class EventDefinitionImpl extends RootElementImpl implements EventDefinition { + /** + * + * + * @generated + */ + protected EventDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.EVENT_DEFINITION; + } + +} //EventDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EventImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EventImpl.java new file mode 100644 index 00000000000..4df9eb35656 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EventImpl.java @@ -0,0 +1,246 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ConversationLink; +import org.eclipse.bpmn2.Event; +import org.eclipse.bpmn2.InteractionNode; +import org.eclipse.bpmn2.Property; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Event'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.EventImpl#getIncomingConversationLinks Incoming Conversation Links}
  • + *
  • {@link org.eclipse.bpmn2.impl.EventImpl#getOutgoingConversationLinks Outgoing Conversation Links}
  • + *
  • {@link org.eclipse.bpmn2.impl.EventImpl#getProperties Properties}
  • + *
+ * + * @generated + */ +public abstract class EventImpl extends FlowNodeImpl implements Event { + /** + * The cached value of the '{@link #getProperties() Properties}' containment reference list. + * + * + * @see #getProperties() + * @generated + * @ordered + */ + @GwtTransient + protected EList properties; + + /** + * + * + * @generated + */ + protected EventImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.EVENT; + } + + /** + * + * + * @generated + */ + @Override + public EList getIncomingConversationLinks() { + // TODO: implement this method to return the 'Incoming Conversation Links' reference list + // Ensure that you remove @generated or mark it @generated NOT + // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting + // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public EList getOutgoingConversationLinks() { + // TODO: implement this method to return the 'Outgoing Conversation Links' reference list + // Ensure that you remove @generated or mark it @generated NOT + // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting + // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public EList getProperties() { + if (properties == null) { + properties = new EObjectContainmentEList(Property.class, this, Bpmn2Package.EVENT__PROPERTIES); + } + return properties; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.EVENT__PROPERTIES: + return ((InternalEList) getProperties()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.EVENT__INCOMING_CONVERSATION_LINKS: + return getIncomingConversationLinks(); + case Bpmn2Package.EVENT__OUTGOING_CONVERSATION_LINKS: + return getOutgoingConversationLinks(); + case Bpmn2Package.EVENT__PROPERTIES: + return getProperties(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.EVENT__PROPERTIES: + getProperties().clear(); + getProperties().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.EVENT__PROPERTIES: + getProperties().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.EVENT__INCOMING_CONVERSATION_LINKS: + return !getIncomingConversationLinks().isEmpty(); + case Bpmn2Package.EVENT__OUTGOING_CONVERSATION_LINKS: + return !getOutgoingConversationLinks().isEmpty(); + case Bpmn2Package.EVENT__PROPERTIES: + return properties != null && !properties.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == InteractionNode.class) { + switch (derivedFeatureID) { + case Bpmn2Package.EVENT__INCOMING_CONVERSATION_LINKS: + return Bpmn2Package.INTERACTION_NODE__INCOMING_CONVERSATION_LINKS; + case Bpmn2Package.EVENT__OUTGOING_CONVERSATION_LINKS: + return Bpmn2Package.INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == InteractionNode.class) { + switch (baseFeatureID) { + case Bpmn2Package.INTERACTION_NODE__INCOMING_CONVERSATION_LINKS: + return Bpmn2Package.EVENT__INCOMING_CONVERSATION_LINKS; + case Bpmn2Package.INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS: + return Bpmn2Package.EVENT__OUTGOING_CONVERSATION_LINKS; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + +} //EventImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EventSubprocessImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EventSubprocessImpl.java new file mode 100644 index 00000000000..331860fa279 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/EventSubprocessImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.EventSubprocess; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Event Subprocess'. + * + * + * @generated + */ +public class EventSubprocessImpl extends SubProcessImpl implements EventSubprocess { + /** + * + * + * @generated + */ + protected EventSubprocessImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.EVENT_SUBPROCESS; + } + +} //EventSubprocessImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExclusiveGatewayImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExclusiveGatewayImpl.java new file mode 100644 index 00000000000..fbd7c3d0210 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExclusiveGatewayImpl.java @@ -0,0 +1,155 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ExclusiveGateway; +import org.eclipse.bpmn2.SequenceFlow; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Exclusive Gateway'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ExclusiveGatewayImpl#getDefault Default}
  • + *
+ * + * @generated + */ +public class ExclusiveGatewayImpl extends GatewayImpl implements ExclusiveGateway { + /** + * The cached value of the '{@link #getDefault() Default}' reference. + * + * + * @see #getDefault() + * @generated + * @ordered + */ + @GwtTransient + protected SequenceFlow default_; + + /** + * + * + * @generated + */ + protected ExclusiveGatewayImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.EXCLUSIVE_GATEWAY; + } + + /** + * + * + * @generated + */ + @Override + public SequenceFlow getDefault() { + return default_; + } + + /** + * + * + * @generated + */ + @Override + public void setDefault(SequenceFlow newDefault) { + SequenceFlow oldDefault = default_; + default_ = newDefault; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.EXCLUSIVE_GATEWAY__DEFAULT, oldDefault, + default_)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.EXCLUSIVE_GATEWAY__DEFAULT: + return getDefault(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.EXCLUSIVE_GATEWAY__DEFAULT: + setDefault((SequenceFlow) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.EXCLUSIVE_GATEWAY__DEFAULT: + setDefault((SequenceFlow) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.EXCLUSIVE_GATEWAY__DEFAULT: + return default_ != null; + } + return super.eIsSet(featureID); + } + +} //ExclusiveGatewayImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExpressionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExpressionImpl.java new file mode 100644 index 00000000000..03fac487bf0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExpressionImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Expression; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Expression'. + * + * + * @generated + */ +public class ExpressionImpl extends BaseElementImpl implements Expression { + /** + * + * + * @generated + */ + protected ExpressionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.EXPRESSION; + } + +} //ExpressionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExtensionAttributeDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExtensionAttributeDefinitionImpl.java new file mode 100644 index 00000000000..047d50854e8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExtensionAttributeDefinitionImpl.java @@ -0,0 +1,412 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ExtensionAttributeDefinition; +import org.eclipse.bpmn2.ExtensionDefinition; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EcoreUtil; + +/** + * + * An implementation of the model object 'Extension Attribute Definition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ExtensionAttributeDefinitionImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.ExtensionAttributeDefinitionImpl#getType Type}
  • + *
  • {@link org.eclipse.bpmn2.impl.ExtensionAttributeDefinitionImpl#isIsReference Is Reference}
  • + *
  • {@link org.eclipse.bpmn2.impl.ExtensionAttributeDefinitionImpl#getExtensionDefinition Extension Definition}
  • + *
+ * + * @generated + */ +public class ExtensionAttributeDefinitionImpl extends EObjectImpl implements ExtensionAttributeDefinition { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getType() Type}' attribute. + * + * + * @see #getType() + * @generated + * @ordered + */ + protected static final String TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getType() Type}' attribute. + * + * + * @see #getType() + * @generated + * @ordered + */ + @GwtTransient + protected String type = TYPE_EDEFAULT; + + /** + * The default value of the '{@link #isIsReference() Is Reference}' attribute. + * + * + * @see #isIsReference() + * @generated + * @ordered + */ + protected static final boolean IS_REFERENCE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsReference() Is Reference}' attribute. + * + * + * @see #isIsReference() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isReference = IS_REFERENCE_EDEFAULT; + + /** + * + * + * @generated + */ + protected ExtensionAttributeDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.EXTENSION_ATTRIBUTE_DEFINITION; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__NAME, + oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public String getType() { + return type; + } + + /** + * + * + * @generated + */ + @Override + public void setType(String newType) { + String oldType = type; + type = newType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__TYPE, + oldType, type)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsReference() { + return isReference; + } + + /** + * + * + * @generated + */ + @Override + public void setIsReference(boolean newIsReference) { + boolean oldIsReference = isReference; + isReference = newIsReference; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__IS_REFERENCE, oldIsReference, isReference)); + } + + /** + * + * + * @generated + */ + @Override + public ExtensionDefinition getExtensionDefinition() { + if (eContainerFeatureID() != Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION) + return null; + return (ExtensionDefinition) eInternalContainer(); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetExtensionDefinition(ExtensionDefinition newExtensionDefinition, + NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newExtensionDefinition, + Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION, msgs); + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setExtensionDefinition(ExtensionDefinition newExtensionDefinition) { + if (newExtensionDefinition != eInternalContainer() + || (eContainerFeatureID() != Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION + && newExtensionDefinition != null)) { + if (EcoreUtil.isAncestor(this, newExtensionDefinition)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newExtensionDefinition != null) + msgs = ((InternalEObject) newExtensionDefinition).eInverseAdd(this, + Bpmn2Package.EXTENSION_DEFINITION__EXTENSION_ATTRIBUTE_DEFINITIONS, ExtensionDefinition.class, + msgs); + msgs = basicSetExtensionDefinition(newExtensionDefinition, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION, newExtensionDefinition, + newExtensionDefinition)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetExtensionDefinition((ExtensionDefinition) otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION: + return basicSetExtensionDefinition(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION: + return eInternalContainer().eInverseRemove(this, + Bpmn2Package.EXTENSION_DEFINITION__EXTENSION_ATTRIBUTE_DEFINITIONS, ExtensionDefinition.class, + msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__NAME: + return getName(); + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__TYPE: + return getType(); + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__IS_REFERENCE: + return isIsReference(); + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION: + return getExtensionDefinition(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__NAME: + setName((String) newValue); + return; + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__TYPE: + setType((String) newValue); + return; + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__IS_REFERENCE: + setIsReference((Boolean) newValue); + return; + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION: + setExtensionDefinition((ExtensionDefinition) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__TYPE: + setType(TYPE_EDEFAULT); + return; + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__IS_REFERENCE: + setIsReference(IS_REFERENCE_EDEFAULT); + return; + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION: + setExtensionDefinition((ExtensionDefinition) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__TYPE: + return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__IS_REFERENCE: + return isReference != IS_REFERENCE_EDEFAULT; + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION: + return getExtensionDefinition() != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(", type: "); + result.append(type); + result.append(", isReference: "); + result.append(isReference); + result.append(')'); + return result.toString(); + } + +} //ExtensionAttributeDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExtensionAttributeValueImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExtensionAttributeValueImpl.java new file mode 100644 index 00000000000..f8acf80db13 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExtensionAttributeValueImpl.java @@ -0,0 +1,320 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ExtensionAttributeDefinition; +import org.eclipse.bpmn2.ExtensionAttributeValue; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Extension Attribute Value'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ExtensionAttributeValueImpl#getValueRef Value Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.ExtensionAttributeValueImpl#getValue Value}
  • + *
  • {@link org.eclipse.bpmn2.impl.ExtensionAttributeValueImpl#getExtensionAttributeDefinition Extension Attribute Definition}
  • + *
+ * + * @generated + */ +public class ExtensionAttributeValueImpl extends EObjectImpl implements ExtensionAttributeValue { + /** + * The cached value of the '{@link #getValueRef() Value Ref}' reference. + * + * + * @see #getValueRef() + * @generated + * @ordered + */ + @GwtTransient + protected EObject valueRef; + + /** + * The cached value of the '{@link #getValue() Value}' attribute list. + * + * + * @see #getValue() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap value; + + /** + * The cached value of the '{@link #getExtensionAttributeDefinition() Extension Attribute Definition}' reference. + * + * + * @see #getExtensionAttributeDefinition() + * @generated + * @ordered + */ + @GwtTransient + protected ExtensionAttributeDefinition extensionAttributeDefinition; + + /** + * + * + * @generated + */ + protected ExtensionAttributeValueImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.EXTENSION_ATTRIBUTE_VALUE; + } + + /** + * + * + * @generated + */ + @Override + public EObject getValueRef() { + if (valueRef != null && valueRef.eIsProxy()) { + InternalEObject oldValueRef = (InternalEObject) valueRef; + valueRef = eResolveProxy(oldValueRef); + if (valueRef != oldValueRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__VALUE_REF, oldValueRef, valueRef)); + } + } + return valueRef; + } + + /** + * + * + * @generated + */ + public EObject basicGetValueRef() { + return valueRef; + } + + /** + * + * + * @generated + */ + @Override + public void setValueRef(EObject newValueRef) { + EObject oldValueRef = valueRef; + valueRef = newValueRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__VALUE_REF, + oldValueRef, valueRef)); + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getValue() { + if (value == null) { + value = new BasicFeatureMap(this, Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__VALUE); + } + return value; + } + + /** + * + * + * @generated + */ + @Override + public ExtensionAttributeDefinition getExtensionAttributeDefinition() { + if (extensionAttributeDefinition != null && extensionAttributeDefinition.eIsProxy()) { + InternalEObject oldExtensionAttributeDefinition = (InternalEObject) extensionAttributeDefinition; + extensionAttributeDefinition = (ExtensionAttributeDefinition) eResolveProxy( + oldExtensionAttributeDefinition); + if (extensionAttributeDefinition != oldExtensionAttributeDefinition) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__EXTENSION_ATTRIBUTE_DEFINITION, + oldExtensionAttributeDefinition, extensionAttributeDefinition)); + } + } + return extensionAttributeDefinition; + } + + /** + * + * + * @generated + */ + public ExtensionAttributeDefinition basicGetExtensionAttributeDefinition() { + return extensionAttributeDefinition; + } + + /** + * + * + * @generated + */ + @Override + public void setExtensionAttributeDefinition(ExtensionAttributeDefinition newExtensionAttributeDefinition) { + ExtensionAttributeDefinition oldExtensionAttributeDefinition = extensionAttributeDefinition; + extensionAttributeDefinition = newExtensionAttributeDefinition; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__EXTENSION_ATTRIBUTE_DEFINITION, + oldExtensionAttributeDefinition, extensionAttributeDefinition)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__VALUE: + return ((InternalEList) getValue()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__VALUE_REF: + if (resolve) + return getValueRef(); + return basicGetValueRef(); + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__VALUE: + if (coreType) + return getValue(); + return ((FeatureMap.Internal) getValue()).getWrapper(); + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__EXTENSION_ATTRIBUTE_DEFINITION: + if (resolve) + return getExtensionAttributeDefinition(); + return basicGetExtensionAttributeDefinition(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__VALUE_REF: + setValueRef((EObject) newValue); + return; + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__VALUE: + ((FeatureMap.Internal) getValue()).set(newValue); + return; + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__EXTENSION_ATTRIBUTE_DEFINITION: + setExtensionAttributeDefinition((ExtensionAttributeDefinition) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__VALUE_REF: + setValueRef((EObject) null); + return; + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__VALUE: + getValue().clear(); + return; + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__EXTENSION_ATTRIBUTE_DEFINITION: + setExtensionAttributeDefinition((ExtensionAttributeDefinition) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__VALUE_REF: + return valueRef != null; + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__VALUE: + return value != null && !value.isEmpty(); + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE__EXTENSION_ATTRIBUTE_DEFINITION: + return extensionAttributeDefinition != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (value: "); + result.append(value); + result.append(')'); + return result.toString(); + } + +} //ExtensionAttributeValueImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExtensionDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExtensionDefinitionImpl.java new file mode 100644 index 00000000000..7d6e5f286ec --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExtensionDefinitionImpl.java @@ -0,0 +1,262 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ExtensionAttributeDefinition; +import org.eclipse.bpmn2.ExtensionDefinition; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Extension Definition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ExtensionDefinitionImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.ExtensionDefinitionImpl#getExtensionAttributeDefinitions Extension Attribute Definitions}
  • + *
+ * + * @generated + */ +public class ExtensionDefinitionImpl extends EObjectImpl implements ExtensionDefinition { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getExtensionAttributeDefinitions() Extension Attribute Definitions}' containment reference list. + * + * + * @see #getExtensionAttributeDefinitions() + * @generated + * @ordered + */ + @GwtTransient + protected EList extensionAttributeDefinitions; + + /** + * + * + * @generated + */ + protected ExtensionDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.EXTENSION_DEFINITION; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.EXTENSION_DEFINITION__NAME, oldName, + name)); + } + + /** + * + * + * @generated + */ + @Override + public EList getExtensionAttributeDefinitions() { + if (extensionAttributeDefinitions == null) { + extensionAttributeDefinitions = new EObjectContainmentWithInverseEList( + ExtensionAttributeDefinition.class, this, + Bpmn2Package.EXTENSION_DEFINITION__EXTENSION_ATTRIBUTE_DEFINITIONS, + Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION__EXTENSION_DEFINITION); + } + return extensionAttributeDefinitions; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.EXTENSION_DEFINITION__EXTENSION_ATTRIBUTE_DEFINITIONS: + return ((InternalEList) (InternalEList) getExtensionAttributeDefinitions()) + .basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.EXTENSION_DEFINITION__EXTENSION_ATTRIBUTE_DEFINITIONS: + return ((InternalEList) getExtensionAttributeDefinitions()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.EXTENSION_DEFINITION__NAME: + return getName(); + case Bpmn2Package.EXTENSION_DEFINITION__EXTENSION_ATTRIBUTE_DEFINITIONS: + return getExtensionAttributeDefinitions(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.EXTENSION_DEFINITION__NAME: + setName((String) newValue); + return; + case Bpmn2Package.EXTENSION_DEFINITION__EXTENSION_ATTRIBUTE_DEFINITIONS: + getExtensionAttributeDefinitions().clear(); + getExtensionAttributeDefinitions().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.EXTENSION_DEFINITION__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.EXTENSION_DEFINITION__EXTENSION_ATTRIBUTE_DEFINITIONS: + getExtensionAttributeDefinitions().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.EXTENSION_DEFINITION__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.EXTENSION_DEFINITION__EXTENSION_ATTRIBUTE_DEFINITIONS: + return extensionAttributeDefinitions != null && !extensionAttributeDefinitions.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //ExtensionDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExtensionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExtensionImpl.java new file mode 100644 index 00000000000..24cfe38db33 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ExtensionImpl.java @@ -0,0 +1,334 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import javax.xml.namespace.QName; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Extension; +import org.eclipse.bpmn2.ExtensionDefinition; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Extension'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ExtensionImpl#getDefinition Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.ExtensionImpl#isMustUnderstand Must Understand}
  • + *
  • {@link org.eclipse.bpmn2.impl.ExtensionImpl#getXsdDefinition Xsd Definition}
  • + *
+ * + * @generated + */ +public class ExtensionImpl extends EObjectImpl implements Extension { + /** + * The cached value of the '{@link #getDefinition() Definition}' containment reference. + * + * + * @see #getDefinition() + * @generated + * @ordered + */ + @GwtTransient + protected ExtensionDefinition definition; + + /** + * The default value of the '{@link #isMustUnderstand() Must Understand}' attribute. + * + * + * @see #isMustUnderstand() + * @generated + * @ordered + */ + protected static final boolean MUST_UNDERSTAND_EDEFAULT = false; + + /** + * The cached value of the '{@link #isMustUnderstand() Must Understand}' attribute. + * + * + * @see #isMustUnderstand() + * @generated + * @ordered + */ + @GwtTransient + protected boolean mustUnderstand = MUST_UNDERSTAND_EDEFAULT; + + /** + * The default value of the '{@link #getXsdDefinition() Xsd Definition}' attribute. + * + * + * @see #getXsdDefinition() + * @generated + * @ordered + */ + protected static final QName XSD_DEFINITION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getXsdDefinition() Xsd Definition}' attribute. + * + * + * @see #getXsdDefinition() + * @generated + * @ordered + */ + @GwtTransient + protected QName xsdDefinition = XSD_DEFINITION_EDEFAULT; + + /** + * + * + * @generated + */ + protected ExtensionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.EXTENSION; + } + + /** + * + * + * @generated + */ + @Override + public ExtensionDefinition getDefinition() { + return definition; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDefinition(ExtensionDefinition newDefinition, NotificationChain msgs) { + ExtensionDefinition oldDefinition = definition; + definition = newDefinition; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.EXTENSION__DEFINITION, oldDefinition, newDefinition); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setDefinition(ExtensionDefinition newDefinition) { + if (newDefinition != definition) { + NotificationChain msgs = null; + if (definition != null) + msgs = ((InternalEObject) definition).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.EXTENSION__DEFINITION, null, msgs); + if (newDefinition != null) + msgs = ((InternalEObject) newDefinition).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.EXTENSION__DEFINITION, null, msgs); + msgs = basicSetDefinition(newDefinition, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.EXTENSION__DEFINITION, newDefinition, + newDefinition)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isMustUnderstand() { + return mustUnderstand; + } + + /** + * + * + * @generated + */ + @Override + public void setMustUnderstand(boolean newMustUnderstand) { + boolean oldMustUnderstand = mustUnderstand; + mustUnderstand = newMustUnderstand; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.EXTENSION__MUST_UNDERSTAND, + oldMustUnderstand, mustUnderstand)); + } + + /** + * + * + * @generated + */ + @Override + public QName getXsdDefinition() { + return xsdDefinition; + } + + /** + * + * + * @generated + */ + @Override + public void setXsdDefinition(QName newXsdDefinition) { + QName oldXsdDefinition = xsdDefinition; + xsdDefinition = newXsdDefinition; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.EXTENSION__XSD_DEFINITION, + oldXsdDefinition, xsdDefinition)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.EXTENSION__DEFINITION: + return basicSetDefinition(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.EXTENSION__DEFINITION: + return getDefinition(); + case Bpmn2Package.EXTENSION__MUST_UNDERSTAND: + return isMustUnderstand(); + case Bpmn2Package.EXTENSION__XSD_DEFINITION: + return getXsdDefinition(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.EXTENSION__DEFINITION: + setDefinition((ExtensionDefinition) newValue); + return; + case Bpmn2Package.EXTENSION__MUST_UNDERSTAND: + setMustUnderstand((Boolean) newValue); + return; + case Bpmn2Package.EXTENSION__XSD_DEFINITION: + setXsdDefinition((QName) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.EXTENSION__DEFINITION: + setDefinition((ExtensionDefinition) null); + return; + case Bpmn2Package.EXTENSION__MUST_UNDERSTAND: + setMustUnderstand(MUST_UNDERSTAND_EDEFAULT); + return; + case Bpmn2Package.EXTENSION__XSD_DEFINITION: + setXsdDefinition(XSD_DEFINITION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.EXTENSION__DEFINITION: + return definition != null; + case Bpmn2Package.EXTENSION__MUST_UNDERSTAND: + return mustUnderstand != MUST_UNDERSTAND_EDEFAULT; + case Bpmn2Package.EXTENSION__XSD_DEFINITION: + return XSD_DEFINITION_EDEFAULT == null ? xsdDefinition != null + : !XSD_DEFINITION_EDEFAULT.equals(xsdDefinition); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (mustUnderstand: "); + result.append(mustUnderstand); + result.append(", xsdDefinition: "); + result.append(xsdDefinition); + result.append(')'); + return result.toString(); + } + +} //ExtensionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/FlowElementImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/FlowElementImpl.java new file mode 100644 index 00000000000..e1b77b0d7ae --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/FlowElementImpl.java @@ -0,0 +1,393 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Auditing; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CategoryValue; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.Monitoring; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'Flow Element'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.FlowElementImpl#getAuditing Auditing}
  • + *
  • {@link org.eclipse.bpmn2.impl.FlowElementImpl#getMonitoring Monitoring}
  • + *
  • {@link org.eclipse.bpmn2.impl.FlowElementImpl#getCategoryValueRef Category Value Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.FlowElementImpl#getName Name}
  • + *
+ * + * @generated + */ +public abstract class FlowElementImpl extends BaseElementImpl implements FlowElement { + /** + * The cached value of the '{@link #getAuditing() Auditing}' containment reference. + * + * + * @see #getAuditing() + * @generated + * @ordered + */ + @GwtTransient + protected Auditing auditing; + + /** + * The cached value of the '{@link #getMonitoring() Monitoring}' containment reference. + * + * + * @see #getMonitoring() + * @generated + * @ordered + */ + @GwtTransient + protected Monitoring monitoring; + + /** + * The cached value of the '{@link #getCategoryValueRef() Category Value Ref}' reference list. + * + * + * @see #getCategoryValueRef() + * @generated + * @ordered + */ + @GwtTransient + protected EList categoryValueRef; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected FlowElementImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.FLOW_ELEMENT; + } + + /** + * + * + * @generated + */ + @Override + public Auditing getAuditing() { + return auditing; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetAuditing(Auditing newAuditing, NotificationChain msgs) { + Auditing oldAuditing = auditing; + auditing = newAuditing; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.FLOW_ELEMENT__AUDITING, oldAuditing, newAuditing); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setAuditing(Auditing newAuditing) { + if (newAuditing != auditing) { + NotificationChain msgs = null; + if (auditing != null) + msgs = ((InternalEObject) auditing).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.FLOW_ELEMENT__AUDITING, null, msgs); + if (newAuditing != null) + msgs = ((InternalEObject) newAuditing).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.FLOW_ELEMENT__AUDITING, null, msgs); + msgs = basicSetAuditing(newAuditing, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.FLOW_ELEMENT__AUDITING, newAuditing, + newAuditing)); + } + + /** + * + * + * @generated + */ + @Override + public Monitoring getMonitoring() { + return monitoring; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetMonitoring(Monitoring newMonitoring, NotificationChain msgs) { + Monitoring oldMonitoring = monitoring; + monitoring = newMonitoring; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.FLOW_ELEMENT__MONITORING, oldMonitoring, newMonitoring); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setMonitoring(Monitoring newMonitoring) { + if (newMonitoring != monitoring) { + NotificationChain msgs = null; + if (monitoring != null) + msgs = ((InternalEObject) monitoring).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.FLOW_ELEMENT__MONITORING, null, msgs); + if (newMonitoring != null) + msgs = ((InternalEObject) newMonitoring).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.FLOW_ELEMENT__MONITORING, null, msgs); + msgs = basicSetMonitoring(newMonitoring, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.FLOW_ELEMENT__MONITORING, newMonitoring, + newMonitoring)); + } + + /** + * + * + * @generated + */ + @Override + public EList getCategoryValueRef() { + if (categoryValueRef == null) { + categoryValueRef = new EObjectResolvingEList(CategoryValue.class, this, + Bpmn2Package.FLOW_ELEMENT__CATEGORY_VALUE_REF); + } + return categoryValueRef; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.FLOW_ELEMENT__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.FLOW_ELEMENT__AUDITING: + return basicSetAuditing(null, msgs); + case Bpmn2Package.FLOW_ELEMENT__MONITORING: + return basicSetMonitoring(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.FLOW_ELEMENT__AUDITING: + return getAuditing(); + case Bpmn2Package.FLOW_ELEMENT__MONITORING: + return getMonitoring(); + case Bpmn2Package.FLOW_ELEMENT__CATEGORY_VALUE_REF: + return getCategoryValueRef(); + case Bpmn2Package.FLOW_ELEMENT__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.FLOW_ELEMENT__AUDITING: + setAuditing((Auditing) newValue); + return; + case Bpmn2Package.FLOW_ELEMENT__MONITORING: + setMonitoring((Monitoring) newValue); + return; + case Bpmn2Package.FLOW_ELEMENT__CATEGORY_VALUE_REF: + getCategoryValueRef().clear(); + getCategoryValueRef().addAll((Collection) newValue); + return; + case Bpmn2Package.FLOW_ELEMENT__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.FLOW_ELEMENT__AUDITING: + setAuditing((Auditing) null); + return; + case Bpmn2Package.FLOW_ELEMENT__MONITORING: + setMonitoring((Monitoring) null); + return; + case Bpmn2Package.FLOW_ELEMENT__CATEGORY_VALUE_REF: + getCategoryValueRef().clear(); + return; + case Bpmn2Package.FLOW_ELEMENT__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.FLOW_ELEMENT__AUDITING: + return auditing != null; + case Bpmn2Package.FLOW_ELEMENT__MONITORING: + return monitoring != null; + case Bpmn2Package.FLOW_ELEMENT__CATEGORY_VALUE_REF: + return categoryValueRef != null && !categoryValueRef.isEmpty(); + case Bpmn2Package.FLOW_ELEMENT__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //FlowElementImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/FlowElementsContainerImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/FlowElementsContainerImpl.java new file mode 100644 index 00000000000..4847ed8ed26 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/FlowElementsContainerImpl.java @@ -0,0 +1,207 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.FlowElementsContainer; +import org.eclipse.bpmn2.LaneSet; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Flow Elements Container'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.FlowElementsContainerImpl#getLaneSets Lane Sets}
  • + *
  • {@link org.eclipse.bpmn2.impl.FlowElementsContainerImpl#getFlowElements Flow Elements}
  • + *
+ * + * @generated + */ +public abstract class FlowElementsContainerImpl extends BaseElementImpl implements FlowElementsContainer { + /** + * The cached value of the '{@link #getLaneSets() Lane Sets}' containment reference list. + * + * + * @see #getLaneSets() + * @generated + * @ordered + */ + @GwtTransient + protected EList laneSets; + + /** + * The cached value of the '{@link #getFlowElements() Flow Elements}' containment reference list. + * + * + * @see #getFlowElements() + * @generated + * @ordered + */ + @GwtTransient + protected EList flowElements; + + /** + * + * + * @generated + */ + protected FlowElementsContainerImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.FLOW_ELEMENTS_CONTAINER; + } + + /** + * + * + * @generated + */ + @Override + public EList getLaneSets() { + if (laneSets == null) { + laneSets = new EObjectContainmentEList(LaneSet.class, this, + Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS); + } + return laneSets; + } + + /** + * + * + * @generated + */ + @Override + public EList getFlowElements() { + if (flowElements == null) { + flowElements = new EObjectContainmentEList(FlowElement.class, this, + Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS); + } + return flowElements; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS: + return ((InternalEList) getLaneSets()).basicRemove(otherEnd, msgs); + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS: + return ((InternalEList) getFlowElements()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS: + return getLaneSets(); + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS: + return getFlowElements(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS: + getLaneSets().clear(); + getLaneSets().addAll((Collection) newValue); + return; + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS: + getFlowElements().clear(); + getFlowElements().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS: + getLaneSets().clear(); + return; + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS: + getFlowElements().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS: + return laneSets != null && !laneSets.isEmpty(); + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS: + return flowElements != null && !flowElements.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //FlowElementsContainerImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/FlowNodeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/FlowNodeImpl.java new file mode 100644 index 00000000000..34d97834655 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/FlowNodeImpl.java @@ -0,0 +1,266 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.FlowNode; +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.SequenceFlow; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectWithInverseEList; +import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Flow Node'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.FlowNodeImpl#getIncoming Incoming}
  • + *
  • {@link org.eclipse.bpmn2.impl.FlowNodeImpl#getLanes Lanes}
  • + *
  • {@link org.eclipse.bpmn2.impl.FlowNodeImpl#getOutgoing Outgoing}
  • + *
+ * + * @generated + */ +public abstract class FlowNodeImpl extends FlowElementImpl implements FlowNode { + /** + * The cached value of the '{@link #getIncoming() Incoming}' reference list. + * + * + * @see #getIncoming() + * @generated + * @ordered + */ + @GwtTransient + protected EList incoming; + + /** + * The cached value of the '{@link #getLanes() Lanes}' reference list. + * + * + * @see #getLanes() + * @generated + * @ordered + */ + @GwtTransient + protected EList lanes; + + /** + * The cached value of the '{@link #getOutgoing() Outgoing}' reference list. + * + * + * @see #getOutgoing() + * @generated + * @ordered + */ + @GwtTransient + protected EList outgoing; + + /** + * + * + * @generated + */ + protected FlowNodeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.FLOW_NODE; + } + + /** + * + * + * @generated + */ + @Override + public EList getIncoming() { + if (incoming == null) { + incoming = new EObjectWithInverseEList(SequenceFlow.class, this, + Bpmn2Package.FLOW_NODE__INCOMING, Bpmn2Package.SEQUENCE_FLOW__TARGET_REF); + } + return incoming; + } + + /** + * + * + * @generated + */ + @Override + public EList getLanes() { + if (lanes == null) { + lanes = new EObjectWithInverseResolvingEList.ManyInverse(Lane.class, this, + Bpmn2Package.FLOW_NODE__LANES, Bpmn2Package.LANE__FLOW_NODE_REFS); + } + return lanes; + } + + /** + * + * + * @generated + */ + @Override + public EList getOutgoing() { + if (outgoing == null) { + outgoing = new EObjectWithInverseEList(SequenceFlow.class, this, + Bpmn2Package.FLOW_NODE__OUTGOING, Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF); + } + return outgoing; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.FLOW_NODE__INCOMING: + return ((InternalEList) (InternalEList) getIncoming()).basicAdd(otherEnd, msgs); + case Bpmn2Package.FLOW_NODE__LANES: + return ((InternalEList) (InternalEList) getLanes()).basicAdd(otherEnd, msgs); + case Bpmn2Package.FLOW_NODE__OUTGOING: + return ((InternalEList) (InternalEList) getOutgoing()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.FLOW_NODE__INCOMING: + return ((InternalEList) getIncoming()).basicRemove(otherEnd, msgs); + case Bpmn2Package.FLOW_NODE__LANES: + return ((InternalEList) getLanes()).basicRemove(otherEnd, msgs); + case Bpmn2Package.FLOW_NODE__OUTGOING: + return ((InternalEList) getOutgoing()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.FLOW_NODE__INCOMING: + return getIncoming(); + case Bpmn2Package.FLOW_NODE__LANES: + return getLanes(); + case Bpmn2Package.FLOW_NODE__OUTGOING: + return getOutgoing(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.FLOW_NODE__INCOMING: + getIncoming().clear(); + getIncoming().addAll((Collection) newValue); + return; + case Bpmn2Package.FLOW_NODE__LANES: + getLanes().clear(); + getLanes().addAll((Collection) newValue); + return; + case Bpmn2Package.FLOW_NODE__OUTGOING: + getOutgoing().clear(); + getOutgoing().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.FLOW_NODE__INCOMING: + getIncoming().clear(); + return; + case Bpmn2Package.FLOW_NODE__LANES: + getLanes().clear(); + return; + case Bpmn2Package.FLOW_NODE__OUTGOING: + getOutgoing().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.FLOW_NODE__INCOMING: + return incoming != null && !incoming.isEmpty(); + case Bpmn2Package.FLOW_NODE__LANES: + return lanes != null && !lanes.isEmpty(); + case Bpmn2Package.FLOW_NODE__OUTGOING: + return outgoing != null && !outgoing.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //FlowNodeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/FormalExpressionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/FormalExpressionImpl.java new file mode 100644 index 00000000000..bc11c24ec1d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/FormalExpressionImpl.java @@ -0,0 +1,353 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.ItemDefinition; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Formal Expression'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.FormalExpressionImpl#getMixed Mixed}
  • + *
  • {@link org.eclipse.bpmn2.impl.FormalExpressionImpl#getBody Body}
  • + *
  • {@link org.eclipse.bpmn2.impl.FormalExpressionImpl#getEvaluatesToTypeRef Evaluates To Type Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.FormalExpressionImpl#getLanguage Language}
  • + *
+ * + * @generated + */ +public class FormalExpressionImpl extends ExpressionImpl implements FormalExpression { + /** + * The cached value of the '{@link #getMixed() Mixed}' attribute list. + * + * + * @see #getMixed() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap mixed; + + /** + * The default value of the '{@link #getBody() Body}' attribute. + * + * + * @see #getBody() + * @generated + * @ordered + */ + protected static final String BODY_EDEFAULT = null; + + /** + * The cached value of the '{@link #getEvaluatesToTypeRef() Evaluates To Type Ref}' reference. + * + * + * @see #getEvaluatesToTypeRef() + * @generated + * @ordered + */ + @GwtTransient + protected ItemDefinition evaluatesToTypeRef; + + /** + * The default value of the '{@link #getLanguage() Language}' attribute. + * + * + * @see #getLanguage() + * @generated + * @ordered + */ + protected static final String LANGUAGE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getLanguage() Language}' attribute. + * + * + * @see #getLanguage() + * @generated + * @ordered + */ + @GwtTransient + protected String language = LANGUAGE_EDEFAULT; + + /** + * + * + * @generated + */ + protected FormalExpressionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.FORMAL_EXPRESSION; + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getMixed() { + if (mixed == null) { + mixed = new BasicFeatureMap(this, Bpmn2Package.FORMAL_EXPRESSION__MIXED); + } + return mixed; + } + + /** + * + * + * @generated + */ + @Override + public String getBody() { + // TODO: implement this method to return the 'Body' attribute + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public void setBody(String newBody) { + // TODO: implement this method to set the 'Body' attribute + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public ItemDefinition getEvaluatesToTypeRef() { + if (evaluatesToTypeRef != null && evaluatesToTypeRef.eIsProxy()) { + InternalEObject oldEvaluatesToTypeRef = (InternalEObject) evaluatesToTypeRef; + evaluatesToTypeRef = (ItemDefinition) eResolveProxy(oldEvaluatesToTypeRef); + if (evaluatesToTypeRef != oldEvaluatesToTypeRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.FORMAL_EXPRESSION__EVALUATES_TO_TYPE_REF, oldEvaluatesToTypeRef, + evaluatesToTypeRef)); + } + } + return evaluatesToTypeRef; + } + + /** + * + * + * @generated + */ + public ItemDefinition basicGetEvaluatesToTypeRef() { + return evaluatesToTypeRef; + } + + /** + * + * + * @generated + */ + @Override + public void setEvaluatesToTypeRef(ItemDefinition newEvaluatesToTypeRef) { + ItemDefinition oldEvaluatesToTypeRef = evaluatesToTypeRef; + evaluatesToTypeRef = newEvaluatesToTypeRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.FORMAL_EXPRESSION__EVALUATES_TO_TYPE_REF, + oldEvaluatesToTypeRef, evaluatesToTypeRef)); + } + + /** + * + * + * @generated + */ + @Override + public String getLanguage() { + return language; + } + + /** + * + * + * @generated + */ + @Override + public void setLanguage(String newLanguage) { + String oldLanguage = language; + language = newLanguage; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.FORMAL_EXPRESSION__LANGUAGE, oldLanguage, + language)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.FORMAL_EXPRESSION__MIXED: + return ((InternalEList) getMixed()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.FORMAL_EXPRESSION__MIXED: + if (coreType) + return getMixed(); + return ((FeatureMap.Internal) getMixed()).getWrapper(); + case Bpmn2Package.FORMAL_EXPRESSION__BODY: + return getBody(); + case Bpmn2Package.FORMAL_EXPRESSION__EVALUATES_TO_TYPE_REF: + if (resolve) + return getEvaluatesToTypeRef(); + return basicGetEvaluatesToTypeRef(); + case Bpmn2Package.FORMAL_EXPRESSION__LANGUAGE: + return getLanguage(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.FORMAL_EXPRESSION__MIXED: + ((FeatureMap.Internal) getMixed()).set(newValue); + return; + case Bpmn2Package.FORMAL_EXPRESSION__BODY: + setBody((String) newValue); + return; + case Bpmn2Package.FORMAL_EXPRESSION__EVALUATES_TO_TYPE_REF: + setEvaluatesToTypeRef((ItemDefinition) newValue); + return; + case Bpmn2Package.FORMAL_EXPRESSION__LANGUAGE: + setLanguage((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.FORMAL_EXPRESSION__MIXED: + getMixed().clear(); + return; + case Bpmn2Package.FORMAL_EXPRESSION__BODY: + setBody(BODY_EDEFAULT); + return; + case Bpmn2Package.FORMAL_EXPRESSION__EVALUATES_TO_TYPE_REF: + setEvaluatesToTypeRef((ItemDefinition) null); + return; + case Bpmn2Package.FORMAL_EXPRESSION__LANGUAGE: + setLanguage(LANGUAGE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.FORMAL_EXPRESSION__MIXED: + return mixed != null && !mixed.isEmpty(); + case Bpmn2Package.FORMAL_EXPRESSION__BODY: + return BODY_EDEFAULT == null ? getBody() != null : !BODY_EDEFAULT.equals(getBody()); + case Bpmn2Package.FORMAL_EXPRESSION__EVALUATES_TO_TYPE_REF: + return evaluatesToTypeRef != null; + case Bpmn2Package.FORMAL_EXPRESSION__LANGUAGE: + return LANGUAGE_EDEFAULT == null ? language != null : !LANGUAGE_EDEFAULT.equals(language); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (mixed: "); + result.append(mixed); + result.append(", language: "); + result.append(language); + result.append(')'); + return result.toString(); + } + +} //FormalExpressionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GatewayImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GatewayImpl.java new file mode 100644 index 00000000000..4a1325eea4a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GatewayImpl.java @@ -0,0 +1,182 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Gateway; +import org.eclipse.bpmn2.GatewayDirection; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Gateway'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.GatewayImpl#getGatewayDirection Gateway Direction}
  • + *
+ * + * @generated + */ +public abstract class GatewayImpl extends FlowNodeImpl implements Gateway { + /** + * The default value of the '{@link #getGatewayDirection() Gateway Direction}' attribute. + * + * + * @see #getGatewayDirection() + * @generated + * @ordered + */ + protected static final GatewayDirection GATEWAY_DIRECTION_EDEFAULT = GatewayDirection.UNSPECIFIED; + + /** + * The cached value of the '{@link #getGatewayDirection() Gateway Direction}' attribute. + * + * + * @see #getGatewayDirection() + * @generated + * @ordered + */ + @GwtTransient + protected GatewayDirection gatewayDirection = GATEWAY_DIRECTION_EDEFAULT; + + /** + * + * + * @generated + */ + protected GatewayImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.GATEWAY; + } + + /** + * + * + * @generated + */ + @Override + public GatewayDirection getGatewayDirection() { + return gatewayDirection; + } + + /** + * + * + * @generated + */ + @Override + public void setGatewayDirection(GatewayDirection newGatewayDirection) { + GatewayDirection oldGatewayDirection = gatewayDirection; + gatewayDirection = newGatewayDirection == null ? GATEWAY_DIRECTION_EDEFAULT : newGatewayDirection; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.GATEWAY__GATEWAY_DIRECTION, + oldGatewayDirection, gatewayDirection)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.GATEWAY__GATEWAY_DIRECTION: + return getGatewayDirection(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.GATEWAY__GATEWAY_DIRECTION: + setGatewayDirection((GatewayDirection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.GATEWAY__GATEWAY_DIRECTION: + setGatewayDirection(GATEWAY_DIRECTION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.GATEWAY__GATEWAY_DIRECTION: + return gatewayDirection != GATEWAY_DIRECTION_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (gatewayDirection: "); + result.append(gatewayDirection); + result.append(')'); + return result.toString(); + } + +} //GatewayImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalBusinessRuleTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalBusinessRuleTaskImpl.java new file mode 100644 index 00000000000..78e17a58e99 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalBusinessRuleTaskImpl.java @@ -0,0 +1,182 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.GlobalBusinessRuleTask; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Global Business Rule Task'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.GlobalBusinessRuleTaskImpl#getImplementation Implementation}
  • + *
+ * + * @generated + */ +public class GlobalBusinessRuleTaskImpl extends GlobalTaskImpl implements GlobalBusinessRuleTask { + /** + * The default value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + protected static final String IMPLEMENTATION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + @GwtTransient + protected String implementation = IMPLEMENTATION_EDEFAULT; + + /** + * + * + * @generated + */ + protected GlobalBusinessRuleTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.GLOBAL_BUSINESS_RULE_TASK; + } + + /** + * + * + * @generated + */ + @Override + public String getImplementation() { + return implementation; + } + + /** + * + * + * @generated + */ + @Override + public void setImplementation(String newImplementation) { + String oldImplementation = implementation; + implementation = newImplementation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.GLOBAL_BUSINESS_RULE_TASK__IMPLEMENTATION, oldImplementation, implementation)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.GLOBAL_BUSINESS_RULE_TASK__IMPLEMENTATION: + return getImplementation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.GLOBAL_BUSINESS_RULE_TASK__IMPLEMENTATION: + setImplementation((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.GLOBAL_BUSINESS_RULE_TASK__IMPLEMENTATION: + setImplementation(IMPLEMENTATION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.GLOBAL_BUSINESS_RULE_TASK__IMPLEMENTATION: + return IMPLEMENTATION_EDEFAULT == null ? implementation != null + : !IMPLEMENTATION_EDEFAULT.equals(implementation); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (implementation: "); + result.append(implementation); + result.append(')'); + return result.toString(); + } + +} //GlobalBusinessRuleTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalChoreographyTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalChoreographyTaskImpl.java new file mode 100644 index 00000000000..3ea075eff5e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalChoreographyTaskImpl.java @@ -0,0 +1,178 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.GlobalChoreographyTask; +import org.eclipse.bpmn2.Participant; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Global Choreography Task'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.GlobalChoreographyTaskImpl#getInitiatingParticipantRef Initiating Participant Ref}
  • + *
+ * + * @generated + */ +public class GlobalChoreographyTaskImpl extends ChoreographyImpl implements GlobalChoreographyTask { + /** + * The cached value of the '{@link #getInitiatingParticipantRef() Initiating Participant Ref}' reference. + * + * + * @see #getInitiatingParticipantRef() + * @generated + * @ordered + */ + @GwtTransient + protected Participant initiatingParticipantRef; + + /** + * + * + * @generated + */ + protected GlobalChoreographyTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.GLOBAL_CHOREOGRAPHY_TASK; + } + + /** + * + * + * @generated + */ + @Override + public Participant getInitiatingParticipantRef() { + if (initiatingParticipantRef != null && initiatingParticipantRef.eIsProxy()) { + InternalEObject oldInitiatingParticipantRef = (InternalEObject) initiatingParticipantRef; + initiatingParticipantRef = (Participant) eResolveProxy(oldInitiatingParticipantRef); + if (initiatingParticipantRef != oldInitiatingParticipantRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.GLOBAL_CHOREOGRAPHY_TASK__INITIATING_PARTICIPANT_REF, + oldInitiatingParticipantRef, initiatingParticipantRef)); + } + } + return initiatingParticipantRef; + } + + /** + * + * + * @generated + */ + public Participant basicGetInitiatingParticipantRef() { + return initiatingParticipantRef; + } + + /** + * + * + * @generated + */ + @Override + public void setInitiatingParticipantRef(Participant newInitiatingParticipantRef) { + Participant oldInitiatingParticipantRef = initiatingParticipantRef; + initiatingParticipantRef = newInitiatingParticipantRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.GLOBAL_CHOREOGRAPHY_TASK__INITIATING_PARTICIPANT_REF, oldInitiatingParticipantRef, + initiatingParticipantRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.GLOBAL_CHOREOGRAPHY_TASK__INITIATING_PARTICIPANT_REF: + if (resolve) + return getInitiatingParticipantRef(); + return basicGetInitiatingParticipantRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.GLOBAL_CHOREOGRAPHY_TASK__INITIATING_PARTICIPANT_REF: + setInitiatingParticipantRef((Participant) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.GLOBAL_CHOREOGRAPHY_TASK__INITIATING_PARTICIPANT_REF: + setInitiatingParticipantRef((Participant) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.GLOBAL_CHOREOGRAPHY_TASK__INITIATING_PARTICIPANT_REF: + return initiatingParticipantRef != null; + } + return super.eIsSet(featureID); + } + +} //GlobalChoreographyTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalConversationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalConversationImpl.java new file mode 100644 index 00000000000..74e99b298f0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalConversationImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.GlobalConversation; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Global Conversation'. + * + * + * @generated + */ +public class GlobalConversationImpl extends CollaborationImpl implements GlobalConversation { + /** + * + * + * @generated + */ + protected GlobalConversationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.GLOBAL_CONVERSATION; + } + +} //GlobalConversationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalManualTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalManualTaskImpl.java new file mode 100644 index 00000000000..7231180ff36 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalManualTaskImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.GlobalManualTask; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Global Manual Task'. + * + * + * @generated + */ +public class GlobalManualTaskImpl extends GlobalTaskImpl implements GlobalManualTask { + /** + * + * + * @generated + */ + protected GlobalManualTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.GLOBAL_MANUAL_TASK; + } + +} //GlobalManualTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalScriptTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalScriptTaskImpl.java new file mode 100644 index 00000000000..762b81b71b4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalScriptTaskImpl.java @@ -0,0 +1,240 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.GlobalScriptTask; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Global Script Task'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.GlobalScriptTaskImpl#getScript Script}
  • + *
  • {@link org.eclipse.bpmn2.impl.GlobalScriptTaskImpl#getScriptLanguage Script Language}
  • + *
+ * + * @generated + */ +public class GlobalScriptTaskImpl extends GlobalTaskImpl implements GlobalScriptTask { + /** + * The default value of the '{@link #getScript() Script}' attribute. + * + * + * @see #getScript() + * @generated + * @ordered + */ + protected static final String SCRIPT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getScript() Script}' attribute. + * + * + * @see #getScript() + * @generated + * @ordered + */ + @GwtTransient + protected String script = SCRIPT_EDEFAULT; + + /** + * The default value of the '{@link #getScriptLanguage() Script Language}' attribute. + * + * + * @see #getScriptLanguage() + * @generated + * @ordered + */ + protected static final String SCRIPT_LANGUAGE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getScriptLanguage() Script Language}' attribute. + * + * + * @see #getScriptLanguage() + * @generated + * @ordered + */ + @GwtTransient + protected String scriptLanguage = SCRIPT_LANGUAGE_EDEFAULT; + + /** + * + * + * @generated + */ + protected GlobalScriptTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.GLOBAL_SCRIPT_TASK; + } + + /** + * + * + * @generated + */ + @Override + public String getScript() { + return script; + } + + /** + * + * + * @generated + */ + @Override + public void setScript(String newScript) { + String oldScript = script; + script = newScript; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.GLOBAL_SCRIPT_TASK__SCRIPT, oldScript, + script)); + } + + /** + * + * + * @generated + */ + @Override + public String getScriptLanguage() { + return scriptLanguage; + } + + /** + * + * + * @generated + */ + @Override + public void setScriptLanguage(String newScriptLanguage) { + String oldScriptLanguage = scriptLanguage; + scriptLanguage = newScriptLanguage; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.GLOBAL_SCRIPT_TASK__SCRIPT_LANGUAGE, + oldScriptLanguage, scriptLanguage)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.GLOBAL_SCRIPT_TASK__SCRIPT: + return getScript(); + case Bpmn2Package.GLOBAL_SCRIPT_TASK__SCRIPT_LANGUAGE: + return getScriptLanguage(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.GLOBAL_SCRIPT_TASK__SCRIPT: + setScript((String) newValue); + return; + case Bpmn2Package.GLOBAL_SCRIPT_TASK__SCRIPT_LANGUAGE: + setScriptLanguage((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.GLOBAL_SCRIPT_TASK__SCRIPT: + setScript(SCRIPT_EDEFAULT); + return; + case Bpmn2Package.GLOBAL_SCRIPT_TASK__SCRIPT_LANGUAGE: + setScriptLanguage(SCRIPT_LANGUAGE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.GLOBAL_SCRIPT_TASK__SCRIPT: + return SCRIPT_EDEFAULT == null ? script != null : !SCRIPT_EDEFAULT.equals(script); + case Bpmn2Package.GLOBAL_SCRIPT_TASK__SCRIPT_LANGUAGE: + return SCRIPT_LANGUAGE_EDEFAULT == null ? scriptLanguage != null + : !SCRIPT_LANGUAGE_EDEFAULT.equals(scriptLanguage); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (script: "); + result.append(script); + result.append(", scriptLanguage: "); + result.append(scriptLanguage); + result.append(')'); + return result.toString(); + } + +} //GlobalScriptTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalTaskImpl.java new file mode 100644 index 00000000000..cc0fbdde3f9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalTaskImpl.java @@ -0,0 +1,167 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.GlobalTask; +import org.eclipse.bpmn2.ResourceRole; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Global Task'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.GlobalTaskImpl#getResources Resources}
  • + *
+ * + * @generated + */ +public class GlobalTaskImpl extends CallableElementImpl implements GlobalTask { + /** + * The cached value of the '{@link #getResources() Resources}' containment reference list. + * + * + * @see #getResources() + * @generated + * @ordered + */ + @GwtTransient + protected EList resources; + + /** + * + * + * @generated + */ + protected GlobalTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.GLOBAL_TASK; + } + + /** + * + * + * @generated + */ + @Override + public EList getResources() { + if (resources == null) { + resources = new EObjectContainmentEList(ResourceRole.class, this, + Bpmn2Package.GLOBAL_TASK__RESOURCES); + } + return resources; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.GLOBAL_TASK__RESOURCES: + return ((InternalEList) getResources()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.GLOBAL_TASK__RESOURCES: + return getResources(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.GLOBAL_TASK__RESOURCES: + getResources().clear(); + getResources().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.GLOBAL_TASK__RESOURCES: + getResources().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.GLOBAL_TASK__RESOURCES: + return resources != null && !resources.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //GlobalTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalUserTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalUserTaskImpl.java new file mode 100644 index 00000000000..9b432a24465 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GlobalUserTaskImpl.java @@ -0,0 +1,244 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.GlobalUserTask; +import org.eclipse.bpmn2.Rendering; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Global User Task'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.GlobalUserTaskImpl#getRenderings Renderings}
  • + *
  • {@link org.eclipse.bpmn2.impl.GlobalUserTaskImpl#getImplementation Implementation}
  • + *
+ * + * @generated + */ +public class GlobalUserTaskImpl extends GlobalTaskImpl implements GlobalUserTask { + /** + * The cached value of the '{@link #getRenderings() Renderings}' containment reference list. + * + * + * @see #getRenderings() + * @generated + * @ordered + */ + @GwtTransient + protected EList renderings; + + /** + * The default value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + protected static final String IMPLEMENTATION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + @GwtTransient + protected String implementation = IMPLEMENTATION_EDEFAULT; + + /** + * + * + * @generated + */ + protected GlobalUserTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.GLOBAL_USER_TASK; + } + + /** + * + * + * @generated + */ + @Override + public EList getRenderings() { + if (renderings == null) { + renderings = new EObjectContainmentEList(Rendering.class, this, + Bpmn2Package.GLOBAL_USER_TASK__RENDERINGS); + } + return renderings; + } + + /** + * + * + * @generated + */ + @Override + public String getImplementation() { + return implementation; + } + + /** + * + * + * @generated + */ + @Override + public void setImplementation(String newImplementation) { + String oldImplementation = implementation; + implementation = newImplementation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.GLOBAL_USER_TASK__IMPLEMENTATION, + oldImplementation, implementation)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.GLOBAL_USER_TASK__RENDERINGS: + return ((InternalEList) getRenderings()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.GLOBAL_USER_TASK__RENDERINGS: + return getRenderings(); + case Bpmn2Package.GLOBAL_USER_TASK__IMPLEMENTATION: + return getImplementation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.GLOBAL_USER_TASK__RENDERINGS: + getRenderings().clear(); + getRenderings().addAll((Collection) newValue); + return; + case Bpmn2Package.GLOBAL_USER_TASK__IMPLEMENTATION: + setImplementation((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.GLOBAL_USER_TASK__RENDERINGS: + getRenderings().clear(); + return; + case Bpmn2Package.GLOBAL_USER_TASK__IMPLEMENTATION: + setImplementation(IMPLEMENTATION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.GLOBAL_USER_TASK__RENDERINGS: + return renderings != null && !renderings.isEmpty(); + case Bpmn2Package.GLOBAL_USER_TASK__IMPLEMENTATION: + return IMPLEMENTATION_EDEFAULT == null ? implementation != null + : !IMPLEMENTATION_EDEFAULT.equals(implementation); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (implementation: "); + result.append(implementation); + result.append(')'); + return result.toString(); + } + +} //GlobalUserTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GroupImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GroupImpl.java new file mode 100644 index 00000000000..dd0c4a7e3c1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/GroupImpl.java @@ -0,0 +1,176 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CategoryValue; +import org.eclipse.bpmn2.Group; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Group'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.GroupImpl#getCategoryValueRef Category Value Ref}
  • + *
+ * + * @generated + */ +public class GroupImpl extends ArtifactImpl implements Group { + /** + * The cached value of the '{@link #getCategoryValueRef() Category Value Ref}' reference. + * + * + * @see #getCategoryValueRef() + * @generated + * @ordered + */ + @GwtTransient + protected CategoryValue categoryValueRef; + + /** + * + * + * @generated + */ + protected GroupImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.GROUP; + } + + /** + * + * + * @generated + */ + @Override + public CategoryValue getCategoryValueRef() { + if (categoryValueRef != null && categoryValueRef.eIsProxy()) { + InternalEObject oldCategoryValueRef = (InternalEObject) categoryValueRef; + categoryValueRef = (CategoryValue) eResolveProxy(oldCategoryValueRef); + if (categoryValueRef != oldCategoryValueRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.GROUP__CATEGORY_VALUE_REF, + oldCategoryValueRef, categoryValueRef)); + } + } + return categoryValueRef; + } + + /** + * + * + * @generated + */ + public CategoryValue basicGetCategoryValueRef() { + return categoryValueRef; + } + + /** + * + * + * @generated + */ + @Override + public void setCategoryValueRef(CategoryValue newCategoryValueRef) { + CategoryValue oldCategoryValueRef = categoryValueRef; + categoryValueRef = newCategoryValueRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.GROUP__CATEGORY_VALUE_REF, + oldCategoryValueRef, categoryValueRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.GROUP__CATEGORY_VALUE_REF: + if (resolve) + return getCategoryValueRef(); + return basicGetCategoryValueRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.GROUP__CATEGORY_VALUE_REF: + setCategoryValueRef((CategoryValue) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.GROUP__CATEGORY_VALUE_REF: + setCategoryValueRef((CategoryValue) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.GROUP__CATEGORY_VALUE_REF: + return categoryValueRef != null; + } + return super.eIsSet(featureID); + } + +} //GroupImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/HumanPerformerImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/HumanPerformerImpl.java new file mode 100644 index 00000000000..4606e9902c7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/HumanPerformerImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.HumanPerformer; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Human Performer'. + * + * + * @generated + */ +public class HumanPerformerImpl extends PerformerImpl implements HumanPerformer { + /** + * + * + * @generated + */ + protected HumanPerformerImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.HUMAN_PERFORMER; + } + +} //HumanPerformerImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ImplicitThrowEventImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ImplicitThrowEventImpl.java new file mode 100644 index 00000000000..b475cb43db7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ImplicitThrowEventImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ImplicitThrowEvent; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Implicit Throw Event'. + * + * + * @generated + */ +public class ImplicitThrowEventImpl extends ThrowEventImpl implements ImplicitThrowEvent { + /** + * + * + * @generated + */ + protected ImplicitThrowEventImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.IMPLICIT_THROW_EVENT; + } + +} //ImplicitThrowEventImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ImportImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ImportImpl.java new file mode 100644 index 00000000000..c806858bc1c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ImportImpl.java @@ -0,0 +1,298 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Import; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Import'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ImportImpl#getImportType Import Type}
  • + *
  • {@link org.eclipse.bpmn2.impl.ImportImpl#getLocation Location}
  • + *
  • {@link org.eclipse.bpmn2.impl.ImportImpl#getNamespace Namespace}
  • + *
+ * + * @generated + */ +public class ImportImpl extends EObjectImpl implements Import { + /** + * The default value of the '{@link #getImportType() Import Type}' attribute. + * + * + * @see #getImportType() + * @generated + * @ordered + */ + protected static final String IMPORT_TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getImportType() Import Type}' attribute. + * + * + * @see #getImportType() + * @generated + * @ordered + */ + @GwtTransient + protected String importType = IMPORT_TYPE_EDEFAULT; + + /** + * The default value of the '{@link #getLocation() Location}' attribute. + * + * + * @see #getLocation() + * @generated + * @ordered + */ + protected static final String LOCATION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getLocation() Location}' attribute. + * + * + * @see #getLocation() + * @generated + * @ordered + */ + @GwtTransient + protected String location = LOCATION_EDEFAULT; + + /** + * The default value of the '{@link #getNamespace() Namespace}' attribute. + * + * + * @see #getNamespace() + * @generated + * @ordered + */ + protected static final String NAMESPACE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getNamespace() Namespace}' attribute. + * + * + * @see #getNamespace() + * @generated + * @ordered + */ + @GwtTransient + protected String namespace = NAMESPACE_EDEFAULT; + + /** + * + * + * @generated + */ + protected ImportImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.IMPORT; + } + + /** + * + * + * @generated + */ + @Override + public String getImportType() { + return importType; + } + + /** + * + * + * @generated + */ + @Override + public void setImportType(String newImportType) { + String oldImportType = importType; + importType = newImportType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.IMPORT__IMPORT_TYPE, oldImportType, + importType)); + } + + /** + * + * + * @generated + */ + @Override + public String getLocation() { + return location; + } + + /** + * + * + * @generated + */ + @Override + public void setLocation(String newLocation) { + String oldLocation = location; + location = newLocation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.IMPORT__LOCATION, oldLocation, + location)); + } + + /** + * + * + * @generated + */ + @Override + public String getNamespace() { + return namespace; + } + + /** + * + * + * @generated + */ + @Override + public void setNamespace(String newNamespace) { + String oldNamespace = namespace; + namespace = newNamespace; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.IMPORT__NAMESPACE, oldNamespace, + namespace)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.IMPORT__IMPORT_TYPE: + return getImportType(); + case Bpmn2Package.IMPORT__LOCATION: + return getLocation(); + case Bpmn2Package.IMPORT__NAMESPACE: + return getNamespace(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.IMPORT__IMPORT_TYPE: + setImportType((String) newValue); + return; + case Bpmn2Package.IMPORT__LOCATION: + setLocation((String) newValue); + return; + case Bpmn2Package.IMPORT__NAMESPACE: + setNamespace((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.IMPORT__IMPORT_TYPE: + setImportType(IMPORT_TYPE_EDEFAULT); + return; + case Bpmn2Package.IMPORT__LOCATION: + setLocation(LOCATION_EDEFAULT); + return; + case Bpmn2Package.IMPORT__NAMESPACE: + setNamespace(NAMESPACE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.IMPORT__IMPORT_TYPE: + return IMPORT_TYPE_EDEFAULT == null ? importType != null : !IMPORT_TYPE_EDEFAULT.equals(importType); + case Bpmn2Package.IMPORT__LOCATION: + return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location); + case Bpmn2Package.IMPORT__NAMESPACE: + return NAMESPACE_EDEFAULT == null ? namespace != null : !NAMESPACE_EDEFAULT.equals(namespace); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (importType: "); + result.append(importType); + result.append(", location: "); + result.append(location); + result.append(", namespace: "); + result.append(namespace); + result.append(')'); + return result.toString(); + } + +} //ImportImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InclusiveGatewayImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InclusiveGatewayImpl.java new file mode 100644 index 00000000000..6a81ce8d1b3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InclusiveGatewayImpl.java @@ -0,0 +1,155 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.InclusiveGateway; +import org.eclipse.bpmn2.SequenceFlow; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Inclusive Gateway'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.InclusiveGatewayImpl#getDefault Default}
  • + *
+ * + * @generated + */ +public class InclusiveGatewayImpl extends GatewayImpl implements InclusiveGateway { + /** + * The cached value of the '{@link #getDefault() Default}' reference. + * + * + * @see #getDefault() + * @generated + * @ordered + */ + @GwtTransient + protected SequenceFlow default_; + + /** + * + * + * @generated + */ + protected InclusiveGatewayImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.INCLUSIVE_GATEWAY; + } + + /** + * + * + * @generated + */ + @Override + public SequenceFlow getDefault() { + return default_; + } + + /** + * + * + * @generated + */ + @Override + public void setDefault(SequenceFlow newDefault) { + SequenceFlow oldDefault = default_; + default_ = newDefault; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.INCLUSIVE_GATEWAY__DEFAULT, oldDefault, + default_)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.INCLUSIVE_GATEWAY__DEFAULT: + return getDefault(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.INCLUSIVE_GATEWAY__DEFAULT: + setDefault((SequenceFlow) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.INCLUSIVE_GATEWAY__DEFAULT: + setDefault((SequenceFlow) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.INCLUSIVE_GATEWAY__DEFAULT: + return default_ != null; + } + return super.eIsSet(featureID); + } + +} //InclusiveGatewayImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InputOutputBindingImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InputOutputBindingImpl.java new file mode 100644 index 00000000000..5a63db22fda --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InputOutputBindingImpl.java @@ -0,0 +1,270 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.InputOutputBinding; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.Operation; +import org.eclipse.bpmn2.OutputSet; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Input Output Binding'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.InputOutputBindingImpl#getInputDataRef Input Data Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.InputOutputBindingImpl#getOperationRef Operation Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.InputOutputBindingImpl#getOutputDataRef Output Data Ref}
  • + *
+ * + * @generated + */ +public class InputOutputBindingImpl extends BaseElementImpl implements InputOutputBinding { + /** + * The cached value of the '{@link #getInputDataRef() Input Data Ref}' reference. + * + * + * @see #getInputDataRef() + * @generated + * @ordered + */ + @GwtTransient + protected InputSet inputDataRef; + + /** + * The cached value of the '{@link #getOperationRef() Operation Ref}' reference. + * + * + * @see #getOperationRef() + * @generated + * @ordered + */ + @GwtTransient + protected Operation operationRef; + + /** + * The cached value of the '{@link #getOutputDataRef() Output Data Ref}' reference. + * + * + * @see #getOutputDataRef() + * @generated + * @ordered + */ + @GwtTransient + protected OutputSet outputDataRef; + + /** + * + * + * @generated + */ + protected InputOutputBindingImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.INPUT_OUTPUT_BINDING; + } + + /** + * + * + * @generated + */ + @Override + public InputSet getInputDataRef() { + return inputDataRef; + } + + /** + * + * + * @generated + */ + @Override + public void setInputDataRef(InputSet newInputDataRef) { + InputSet oldInputDataRef = inputDataRef; + inputDataRef = newInputDataRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.INPUT_OUTPUT_BINDING__INPUT_DATA_REF, + oldInputDataRef, inputDataRef)); + } + + /** + * + * + * @generated + */ + @Override + public Operation getOperationRef() { + if (operationRef != null && operationRef.eIsProxy()) { + InternalEObject oldOperationRef = (InternalEObject) operationRef; + operationRef = (Operation) eResolveProxy(oldOperationRef); + if (operationRef != oldOperationRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.INPUT_OUTPUT_BINDING__OPERATION_REF, oldOperationRef, operationRef)); + } + } + return operationRef; + } + + /** + * + * + * @generated + */ + public Operation basicGetOperationRef() { + return operationRef; + } + + /** + * + * + * @generated + */ + @Override + public void setOperationRef(Operation newOperationRef) { + Operation oldOperationRef = operationRef; + operationRef = newOperationRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.INPUT_OUTPUT_BINDING__OPERATION_REF, + oldOperationRef, operationRef)); + } + + /** + * + * + * @generated + */ + @Override + public OutputSet getOutputDataRef() { + return outputDataRef; + } + + /** + * + * + * @generated + */ + @Override + public void setOutputDataRef(OutputSet newOutputDataRef) { + OutputSet oldOutputDataRef = outputDataRef; + outputDataRef = newOutputDataRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.INPUT_OUTPUT_BINDING__OUTPUT_DATA_REF, + oldOutputDataRef, outputDataRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.INPUT_OUTPUT_BINDING__INPUT_DATA_REF: + return getInputDataRef(); + case Bpmn2Package.INPUT_OUTPUT_BINDING__OPERATION_REF: + if (resolve) + return getOperationRef(); + return basicGetOperationRef(); + case Bpmn2Package.INPUT_OUTPUT_BINDING__OUTPUT_DATA_REF: + return getOutputDataRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.INPUT_OUTPUT_BINDING__INPUT_DATA_REF: + setInputDataRef((InputSet) newValue); + return; + case Bpmn2Package.INPUT_OUTPUT_BINDING__OPERATION_REF: + setOperationRef((Operation) newValue); + return; + case Bpmn2Package.INPUT_OUTPUT_BINDING__OUTPUT_DATA_REF: + setOutputDataRef((OutputSet) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.INPUT_OUTPUT_BINDING__INPUT_DATA_REF: + setInputDataRef((InputSet) null); + return; + case Bpmn2Package.INPUT_OUTPUT_BINDING__OPERATION_REF: + setOperationRef((Operation) null); + return; + case Bpmn2Package.INPUT_OUTPUT_BINDING__OUTPUT_DATA_REF: + setOutputDataRef((OutputSet) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.INPUT_OUTPUT_BINDING__INPUT_DATA_REF: + return inputDataRef != null; + case Bpmn2Package.INPUT_OUTPUT_BINDING__OPERATION_REF: + return operationRef != null; + case Bpmn2Package.INPUT_OUTPUT_BINDING__OUTPUT_DATA_REF: + return outputDataRef != null; + } + return super.eIsSet(featureID); + } + +} //InputOutputBindingImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InputOutputSpecificationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InputOutputSpecificationImpl.java new file mode 100644 index 00000000000..61a75cf7b53 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InputOutputSpecificationImpl.java @@ -0,0 +1,287 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.OutputSet; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Input Output Specification'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.InputOutputSpecificationImpl#getDataInputs Data Inputs}
  • + *
  • {@link org.eclipse.bpmn2.impl.InputOutputSpecificationImpl#getDataOutputs Data Outputs}
  • + *
  • {@link org.eclipse.bpmn2.impl.InputOutputSpecificationImpl#getInputSets Input Sets}
  • + *
  • {@link org.eclipse.bpmn2.impl.InputOutputSpecificationImpl#getOutputSets Output Sets}
  • + *
+ * + * @generated + */ +public class InputOutputSpecificationImpl extends BaseElementImpl implements InputOutputSpecification { + /** + * The cached value of the '{@link #getDataInputs() Data Inputs}' containment reference list. + * + * + * @see #getDataInputs() + * @generated + * @ordered + */ + @GwtTransient + protected EList dataInputs; + + /** + * The cached value of the '{@link #getDataOutputs() Data Outputs}' containment reference list. + * + * + * @see #getDataOutputs() + * @generated + * @ordered + */ + @GwtTransient + protected EList dataOutputs; + + /** + * The cached value of the '{@link #getInputSets() Input Sets}' containment reference list. + * + * + * @see #getInputSets() + * @generated + * @ordered + */ + @GwtTransient + protected EList inputSets; + + /** + * The cached value of the '{@link #getOutputSets() Output Sets}' containment reference list. + * + * + * @see #getOutputSets() + * @generated + * @ordered + */ + @GwtTransient + protected EList outputSets; + + /** + * + * + * @generated + */ + protected InputOutputSpecificationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.INPUT_OUTPUT_SPECIFICATION; + } + + /** + * + * + * @generated + */ + @Override + public EList getDataInputs() { + if (dataInputs == null) { + dataInputs = new EObjectContainmentEList(DataInput.class, this, + Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__DATA_INPUTS); + } + return dataInputs; + } + + /** + * + * + * @generated + */ + @Override + public EList getDataOutputs() { + if (dataOutputs == null) { + dataOutputs = new EObjectContainmentEList(DataOutput.class, this, + Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__DATA_OUTPUTS); + } + return dataOutputs; + } + + /** + * + * + * @generated + */ + @Override + public EList getInputSets() { + if (inputSets == null) { + inputSets = new EObjectContainmentEList(InputSet.class, this, + Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__INPUT_SETS); + } + return inputSets; + } + + /** + * + * + * @generated + */ + @Override + public EList getOutputSets() { + if (outputSets == null) { + outputSets = new EObjectContainmentEList(OutputSet.class, this, + Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__OUTPUT_SETS); + } + return outputSets; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__DATA_INPUTS: + return ((InternalEList) getDataInputs()).basicRemove(otherEnd, msgs); + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__DATA_OUTPUTS: + return ((InternalEList) getDataOutputs()).basicRemove(otherEnd, msgs); + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__INPUT_SETS: + return ((InternalEList) getInputSets()).basicRemove(otherEnd, msgs); + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__OUTPUT_SETS: + return ((InternalEList) getOutputSets()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__DATA_INPUTS: + return getDataInputs(); + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__DATA_OUTPUTS: + return getDataOutputs(); + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__INPUT_SETS: + return getInputSets(); + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__OUTPUT_SETS: + return getOutputSets(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__DATA_INPUTS: + getDataInputs().clear(); + getDataInputs().addAll((Collection) newValue); + return; + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__DATA_OUTPUTS: + getDataOutputs().clear(); + getDataOutputs().addAll((Collection) newValue); + return; + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__INPUT_SETS: + getInputSets().clear(); + getInputSets().addAll((Collection) newValue); + return; + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__OUTPUT_SETS: + getOutputSets().clear(); + getOutputSets().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__DATA_INPUTS: + getDataInputs().clear(); + return; + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__DATA_OUTPUTS: + getDataOutputs().clear(); + return; + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__INPUT_SETS: + getInputSets().clear(); + return; + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__OUTPUT_SETS: + getOutputSets().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__DATA_INPUTS: + return dataInputs != null && !dataInputs.isEmpty(); + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__DATA_OUTPUTS: + return dataOutputs != null && !dataOutputs.isEmpty(); + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__INPUT_SETS: + return inputSets != null && !inputSets.isEmpty(); + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION__OUTPUT_SETS: + return outputSets != null && !outputSets.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //InputOutputSpecificationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InputSetImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InputSetImpl.java new file mode 100644 index 00000000000..17abbd81879 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InputSetImpl.java @@ -0,0 +1,384 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.OutputSet; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Input Set'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.InputSetImpl#getDataInputRefs Data Input Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.InputSetImpl#getOptionalInputRefs Optional Input Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.InputSetImpl#getWhileExecutingInputRefs While Executing Input Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.InputSetImpl#getOutputSetRefs Output Set Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.InputSetImpl#getName Name}
  • + *
+ * + * @generated + */ +public class InputSetImpl extends BaseElementImpl implements InputSet { + /** + * The cached value of the '{@link #getDataInputRefs() Data Input Refs}' reference list. + * + * + * @see #getDataInputRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList dataInputRefs; + + /** + * The cached value of the '{@link #getOptionalInputRefs() Optional Input Refs}' reference list. + * + * + * @see #getOptionalInputRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList optionalInputRefs; + + /** + * The cached value of the '{@link #getWhileExecutingInputRefs() While Executing Input Refs}' reference list. + * + * + * @see #getWhileExecutingInputRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList whileExecutingInputRefs; + + /** + * The cached value of the '{@link #getOutputSetRefs() Output Set Refs}' reference list. + * + * + * @see #getOutputSetRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList outputSetRefs; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected InputSetImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.INPUT_SET; + } + + /** + * + * + * @generated + */ + @Override + public EList getDataInputRefs() { + if (dataInputRefs == null) { + dataInputRefs = new EObjectWithInverseEList.ManyInverse(DataInput.class, this, + Bpmn2Package.INPUT_SET__DATA_INPUT_REFS, Bpmn2Package.DATA_INPUT__INPUT_SET_REFS); + } + return dataInputRefs; + } + + /** + * + * + * @generated + */ + @Override + public EList getOptionalInputRefs() { + if (optionalInputRefs == null) { + optionalInputRefs = new EObjectWithInverseEList.ManyInverse(DataInput.class, this, + Bpmn2Package.INPUT_SET__OPTIONAL_INPUT_REFS, Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_OPTIONAL); + } + return optionalInputRefs; + } + + /** + * + * + * @generated + */ + @Override + public EList getWhileExecutingInputRefs() { + if (whileExecutingInputRefs == null) { + whileExecutingInputRefs = new EObjectWithInverseEList.ManyInverse(DataInput.class, this, + Bpmn2Package.INPUT_SET__WHILE_EXECUTING_INPUT_REFS, + Bpmn2Package.DATA_INPUT__INPUT_SET_WITH_WHILE_EXECUTING); + } + return whileExecutingInputRefs; + } + + /** + * + * + * @generated + */ + @Override + public EList getOutputSetRefs() { + if (outputSetRefs == null) { + outputSetRefs = new EObjectWithInverseEList.ManyInverse(OutputSet.class, this, + Bpmn2Package.INPUT_SET__OUTPUT_SET_REFS, Bpmn2Package.OUTPUT_SET__INPUT_SET_REFS); + } + return outputSetRefs; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.INPUT_SET__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.INPUT_SET__DATA_INPUT_REFS: + return ((InternalEList) (InternalEList) getDataInputRefs()).basicAdd(otherEnd, msgs); + case Bpmn2Package.INPUT_SET__OPTIONAL_INPUT_REFS: + return ((InternalEList) (InternalEList) getOptionalInputRefs()).basicAdd(otherEnd, + msgs); + case Bpmn2Package.INPUT_SET__WHILE_EXECUTING_INPUT_REFS: + return ((InternalEList) (InternalEList) getWhileExecutingInputRefs()).basicAdd(otherEnd, + msgs); + case Bpmn2Package.INPUT_SET__OUTPUT_SET_REFS: + return ((InternalEList) (InternalEList) getOutputSetRefs()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.INPUT_SET__DATA_INPUT_REFS: + return ((InternalEList) getDataInputRefs()).basicRemove(otherEnd, msgs); + case Bpmn2Package.INPUT_SET__OPTIONAL_INPUT_REFS: + return ((InternalEList) getOptionalInputRefs()).basicRemove(otherEnd, msgs); + case Bpmn2Package.INPUT_SET__WHILE_EXECUTING_INPUT_REFS: + return ((InternalEList) getWhileExecutingInputRefs()).basicRemove(otherEnd, msgs); + case Bpmn2Package.INPUT_SET__OUTPUT_SET_REFS: + return ((InternalEList) getOutputSetRefs()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.INPUT_SET__DATA_INPUT_REFS: + return getDataInputRefs(); + case Bpmn2Package.INPUT_SET__OPTIONAL_INPUT_REFS: + return getOptionalInputRefs(); + case Bpmn2Package.INPUT_SET__WHILE_EXECUTING_INPUT_REFS: + return getWhileExecutingInputRefs(); + case Bpmn2Package.INPUT_SET__OUTPUT_SET_REFS: + return getOutputSetRefs(); + case Bpmn2Package.INPUT_SET__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.INPUT_SET__DATA_INPUT_REFS: + getDataInputRefs().clear(); + getDataInputRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.INPUT_SET__OPTIONAL_INPUT_REFS: + getOptionalInputRefs().clear(); + getOptionalInputRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.INPUT_SET__WHILE_EXECUTING_INPUT_REFS: + getWhileExecutingInputRefs().clear(); + getWhileExecutingInputRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.INPUT_SET__OUTPUT_SET_REFS: + getOutputSetRefs().clear(); + getOutputSetRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.INPUT_SET__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.INPUT_SET__DATA_INPUT_REFS: + getDataInputRefs().clear(); + return; + case Bpmn2Package.INPUT_SET__OPTIONAL_INPUT_REFS: + getOptionalInputRefs().clear(); + return; + case Bpmn2Package.INPUT_SET__WHILE_EXECUTING_INPUT_REFS: + getWhileExecutingInputRefs().clear(); + return; + case Bpmn2Package.INPUT_SET__OUTPUT_SET_REFS: + getOutputSetRefs().clear(); + return; + case Bpmn2Package.INPUT_SET__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.INPUT_SET__DATA_INPUT_REFS: + return dataInputRefs != null && !dataInputRefs.isEmpty(); + case Bpmn2Package.INPUT_SET__OPTIONAL_INPUT_REFS: + return optionalInputRefs != null && !optionalInputRefs.isEmpty(); + case Bpmn2Package.INPUT_SET__WHILE_EXECUTING_INPUT_REFS: + return whileExecutingInputRefs != null && !whileExecutingInputRefs.isEmpty(); + case Bpmn2Package.INPUT_SET__OUTPUT_SET_REFS: + return outputSetRefs != null && !outputSetRefs.isEmpty(); + case Bpmn2Package.INPUT_SET__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //InputSetImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InteractionNodeImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InteractionNodeImpl.java new file mode 100644 index 00000000000..aeac4978cb6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InteractionNodeImpl.java @@ -0,0 +1,121 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ConversationLink; +import org.eclipse.bpmn2.InteractionNode; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Interaction Node'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.InteractionNodeImpl#getIncomingConversationLinks Incoming Conversation Links}
  • + *
  • {@link org.eclipse.bpmn2.impl.InteractionNodeImpl#getOutgoingConversationLinks Outgoing Conversation Links}
  • + *
+ * + * @generated + */ +public class InteractionNodeImpl extends EObjectImpl implements InteractionNode { + /** + * + * + * @generated + */ + protected InteractionNodeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.INTERACTION_NODE; + } + + /** + * + * + * @generated + */ + @Override + public EList getIncomingConversationLinks() { + // TODO: implement this method to return the 'Incoming Conversation Links' reference list + // Ensure that you remove @generated or mark it @generated NOT + // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting + // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public EList getOutgoingConversationLinks() { + // TODO: implement this method to return the 'Outgoing Conversation Links' reference list + // Ensure that you remove @generated or mark it @generated NOT + // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting + // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.INTERACTION_NODE__INCOMING_CONVERSATION_LINKS: + return getIncomingConversationLinks(); + case Bpmn2Package.INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS: + return getOutgoingConversationLinks(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.INTERACTION_NODE__INCOMING_CONVERSATION_LINKS: + return !getIncomingConversationLinks().isEmpty(); + case Bpmn2Package.INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS: + return !getOutgoingConversationLinks().isEmpty(); + } + return super.eIsSet(featureID); + } + +} //InteractionNodeImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InterfaceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InterfaceImpl.java new file mode 100644 index 00000000000..af46002dab4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/InterfaceImpl.java @@ -0,0 +1,301 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Interface; +import org.eclipse.bpmn2.Operation; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Interface'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.InterfaceImpl#getOperations Operations}
  • + *
  • {@link org.eclipse.bpmn2.impl.InterfaceImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.InterfaceImpl#getImplementationRef Implementation Ref}
  • + *
+ * + * @generated + */ +public class InterfaceImpl extends RootElementImpl implements Interface { + /** + * The cached value of the '{@link #getOperations() Operations}' containment reference list. + * + * + * @see #getOperations() + * @generated + * @ordered + */ + @GwtTransient + protected EList operations; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getImplementationRef() Implementation Ref}' attribute. + * + * + * @see #getImplementationRef() + * @generated + * @ordered + */ + protected static final String IMPLEMENTATION_REF_EDEFAULT = null; + + /** + * The cached value of the '{@link #getImplementationRef() Implementation Ref}' attribute. + * + * + * @see #getImplementationRef() + * @generated + * @ordered + */ + @GwtTransient + protected String implementationRef = IMPLEMENTATION_REF_EDEFAULT; + + /** + * + * + * @generated + */ + protected InterfaceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.INTERFACE; + } + + /** + * + * + * @generated + */ + @Override + public EList getOperations() { + if (operations == null) { + operations = new EObjectContainmentEList(Operation.class, this, + Bpmn2Package.INTERFACE__OPERATIONS); + } + return operations; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.INTERFACE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public String getImplementationRef() { + return implementationRef; + } + + /** + * + * + * @generated + */ + @Override + public void setImplementationRef(String newImplementationRef) { + String oldImplementationRef = implementationRef; + implementationRef = newImplementationRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.INTERFACE__IMPLEMENTATION_REF, + oldImplementationRef, implementationRef)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.INTERFACE__OPERATIONS: + return ((InternalEList) getOperations()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.INTERFACE__OPERATIONS: + return getOperations(); + case Bpmn2Package.INTERFACE__NAME: + return getName(); + case Bpmn2Package.INTERFACE__IMPLEMENTATION_REF: + return getImplementationRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.INTERFACE__OPERATIONS: + getOperations().clear(); + getOperations().addAll((Collection) newValue); + return; + case Bpmn2Package.INTERFACE__NAME: + setName((String) newValue); + return; + case Bpmn2Package.INTERFACE__IMPLEMENTATION_REF: + setImplementationRef((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.INTERFACE__OPERATIONS: + getOperations().clear(); + return; + case Bpmn2Package.INTERFACE__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.INTERFACE__IMPLEMENTATION_REF: + setImplementationRef(IMPLEMENTATION_REF_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.INTERFACE__OPERATIONS: + return operations != null && !operations.isEmpty(); + case Bpmn2Package.INTERFACE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.INTERFACE__IMPLEMENTATION_REF: + return IMPLEMENTATION_REF_EDEFAULT == null ? implementationRef != null + : !IMPLEMENTATION_REF_EDEFAULT.equals(implementationRef); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(", implementationRef: "); + result.append(implementationRef); + result.append(')'); + return result.toString(); + } + +} //InterfaceImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/IntermediateCatchEventImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/IntermediateCatchEventImpl.java new file mode 100644 index 00000000000..a8b664051ec --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/IntermediateCatchEventImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.IntermediateCatchEvent; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Intermediate Catch Event'. + * + * + * @generated + */ +public class IntermediateCatchEventImpl extends CatchEventImpl implements IntermediateCatchEvent { + /** + * + * + * @generated + */ + protected IntermediateCatchEventImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.INTERMEDIATE_CATCH_EVENT; + } + +} //IntermediateCatchEventImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/IntermediateThrowEventImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/IntermediateThrowEventImpl.java new file mode 100644 index 00000000000..9d83e97146c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/IntermediateThrowEventImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.IntermediateThrowEvent; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Intermediate Throw Event'. + * + * + * @generated + */ +public class IntermediateThrowEventImpl extends ThrowEventImpl implements IntermediateThrowEvent { + /** + * + * + * @generated + */ + protected IntermediateThrowEventImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.INTERMEDIATE_THROW_EVENT; + } + +} //IntermediateThrowEventImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ItemAwareElementImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ItemAwareElementImpl.java new file mode 100644 index 00000000000..ee2d5d2d4fe --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ItemAwareElementImpl.java @@ -0,0 +1,266 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataState; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.ItemDefinition; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Item Aware Element'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ItemAwareElementImpl#getDataState Data State}
  • + *
  • {@link org.eclipse.bpmn2.impl.ItemAwareElementImpl#getItemSubjectRef Item Subject Ref}
  • + *
+ * + * @generated + */ +public class ItemAwareElementImpl extends BaseElementImpl implements ItemAwareElement { + /** + * The cached value of the '{@link #getDataState() Data State}' containment reference. + * + * + * @see #getDataState() + * @generated + * @ordered + */ + @GwtTransient + protected DataState dataState; + + /** + * The cached value of the '{@link #getItemSubjectRef() Item Subject Ref}' reference. + * + * + * @see #getItemSubjectRef() + * @generated + * @ordered + */ + @GwtTransient + protected ItemDefinition itemSubjectRef; + + /** + * + * + * @generated + */ + protected ItemAwareElementImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.ITEM_AWARE_ELEMENT; + } + + /** + * + * + * @generated + */ + @Override + public DataState getDataState() { + return dataState; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetDataState(DataState newDataState, NotificationChain msgs) { + DataState oldDataState = dataState; + dataState = newDataState; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE, oldDataState, newDataState); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setDataState(DataState newDataState) { + if (newDataState != dataState) { + NotificationChain msgs = null; + if (dataState != null) + msgs = ((InternalEObject) dataState).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE, null, msgs); + if (newDataState != null) + msgs = ((InternalEObject) newDataState).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE, null, msgs); + msgs = basicSetDataState(newDataState, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE, + newDataState, newDataState)); + } + + /** + * + * + * @generated + */ + @Override + public ItemDefinition getItemSubjectRef() { + if (itemSubjectRef != null && itemSubjectRef.eIsProxy()) { + InternalEObject oldItemSubjectRef = (InternalEObject) itemSubjectRef; + itemSubjectRef = (ItemDefinition) eResolveProxy(oldItemSubjectRef); + if (itemSubjectRef != oldItemSubjectRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF, oldItemSubjectRef, itemSubjectRef)); + } + } + return itemSubjectRef; + } + + /** + * + * + * @generated + */ + public ItemDefinition basicGetItemSubjectRef() { + return itemSubjectRef; + } + + /** + * + * + * @generated + */ + @Override + public void setItemSubjectRef(ItemDefinition newItemSubjectRef) { + ItemDefinition oldItemSubjectRef = itemSubjectRef; + itemSubjectRef = newItemSubjectRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF, + oldItemSubjectRef, itemSubjectRef)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE: + return basicSetDataState(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE: + return getDataState(); + case Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF: + if (resolve) + return getItemSubjectRef(); + return basicGetItemSubjectRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE: + setDataState((DataState) newValue); + return; + case Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF: + setItemSubjectRef((ItemDefinition) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE: + setDataState((DataState) null); + return; + case Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF: + setItemSubjectRef((ItemDefinition) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE: + return dataState != null; + case Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF: + return itemSubjectRef != null; + } + return super.eIsSet(featureID); + } + +} //ItemAwareElementImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ItemDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ItemDefinitionImpl.java new file mode 100644 index 00000000000..51f51a2e8af --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ItemDefinitionImpl.java @@ -0,0 +1,366 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Import; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.ItemKind; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Item Definition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ItemDefinitionImpl#isIsCollection Is Collection}
  • + *
  • {@link org.eclipse.bpmn2.impl.ItemDefinitionImpl#getImport Import}
  • + *
  • {@link org.eclipse.bpmn2.impl.ItemDefinitionImpl#getItemKind Item Kind}
  • + *
  • {@link org.eclipse.bpmn2.impl.ItemDefinitionImpl#getStructureRef Structure Ref}
  • + *
+ * + * @generated + */ +public class ItemDefinitionImpl extends RootElementImpl implements ItemDefinition { + /** + * The default value of the '{@link #isIsCollection() Is Collection}' attribute. + * + * + * @see #isIsCollection() + * @generated + * @ordered + */ + protected static final boolean IS_COLLECTION_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsCollection() Is Collection}' attribute. + * + * + * @see #isIsCollection() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isCollection = IS_COLLECTION_EDEFAULT; + + /** + * The cached value of the '{@link #getImport() Import}' reference. + * + * + * @see #getImport() + * @generated + * @ordered + */ + @GwtTransient + protected Import import_; + + /** + * The default value of the '{@link #getItemKind() Item Kind}' attribute. + * + * + * @see #getItemKind() + * @generated + * @ordered + */ + protected static final ItemKind ITEM_KIND_EDEFAULT = ItemKind.PHYSICAL; + + /** + * The cached value of the '{@link #getItemKind() Item Kind}' attribute. + * + * + * @see #getItemKind() + * @generated + * @ordered + */ + @GwtTransient + protected ItemKind itemKind = ITEM_KIND_EDEFAULT; + + /** + * The default value of the '{@link #getStructureRef() Structure Ref}' attribute. + * + * + * @see #getStructureRef() + * @generated + * @ordered + */ + protected static final String STRUCTURE_REF_EDEFAULT = null; + + /** + * The cached value of the '{@link #getStructureRef() Structure Ref}' attribute. + * + * + * @see #getStructureRef() + * @generated + * @ordered + */ + @GwtTransient + protected String structureRef = STRUCTURE_REF_EDEFAULT; + + /** + * + * + * @generated + */ + protected ItemDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.ITEM_DEFINITION; + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsCollection() { + return isCollection; + } + + /** + * + * + * @generated + */ + @Override + public void setIsCollection(boolean newIsCollection) { + boolean oldIsCollection = isCollection; + isCollection = newIsCollection; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ITEM_DEFINITION__IS_COLLECTION, + oldIsCollection, isCollection)); + } + + /** + * + * + * @generated + */ + @Override + public Import getImport() { + if (import_ != null && import_.eIsProxy()) { + InternalEObject oldImport = (InternalEObject) import_; + import_ = (Import) eResolveProxy(oldImport); + if (import_ != oldImport) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.ITEM_DEFINITION__IMPORT, + oldImport, import_)); + } + } + return import_; + } + + /** + * + * + * @generated + */ + public Import basicGetImport() { + return import_; + } + + /** + * + * + * @generated + */ + @Override + public void setImport(Import newImport) { + Import oldImport = import_; + import_ = newImport; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ITEM_DEFINITION__IMPORT, oldImport, + import_)); + } + + /** + * + * + * @generated + */ + @Override + public ItemKind getItemKind() { + return itemKind; + } + + /** + * + * + * @generated + */ + @Override + public void setItemKind(ItemKind newItemKind) { + ItemKind oldItemKind = itemKind; + itemKind = newItemKind == null ? ITEM_KIND_EDEFAULT : newItemKind; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ITEM_DEFINITION__ITEM_KIND, oldItemKind, + itemKind)); + } + + /** + * + * + * @generated + */ + @Override + public String getStructureRef() { + return structureRef; + } + + /** + * + * + * @generated + */ + @Override + public void setStructureRef(String newStructureRef) { + String oldStructureRef = structureRef; + structureRef = newStructureRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ITEM_DEFINITION__STRUCTURE_REF, + oldStructureRef, structureRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.ITEM_DEFINITION__IS_COLLECTION: + return isIsCollection(); + case Bpmn2Package.ITEM_DEFINITION__IMPORT: + if (resolve) + return getImport(); + return basicGetImport(); + case Bpmn2Package.ITEM_DEFINITION__ITEM_KIND: + return getItemKind(); + case Bpmn2Package.ITEM_DEFINITION__STRUCTURE_REF: + return getStructureRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.ITEM_DEFINITION__IS_COLLECTION: + setIsCollection((Boolean) newValue); + return; + case Bpmn2Package.ITEM_DEFINITION__IMPORT: + setImport((Import) newValue); + return; + case Bpmn2Package.ITEM_DEFINITION__ITEM_KIND: + setItemKind((ItemKind) newValue); + return; + case Bpmn2Package.ITEM_DEFINITION__STRUCTURE_REF: + setStructureRef((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.ITEM_DEFINITION__IS_COLLECTION: + setIsCollection(IS_COLLECTION_EDEFAULT); + return; + case Bpmn2Package.ITEM_DEFINITION__IMPORT: + setImport((Import) null); + return; + case Bpmn2Package.ITEM_DEFINITION__ITEM_KIND: + setItemKind(ITEM_KIND_EDEFAULT); + return; + case Bpmn2Package.ITEM_DEFINITION__STRUCTURE_REF: + setStructureRef(STRUCTURE_REF_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.ITEM_DEFINITION__IS_COLLECTION: + return isCollection != IS_COLLECTION_EDEFAULT; + case Bpmn2Package.ITEM_DEFINITION__IMPORT: + return import_ != null; + case Bpmn2Package.ITEM_DEFINITION__ITEM_KIND: + return itemKind != ITEM_KIND_EDEFAULT; + case Bpmn2Package.ITEM_DEFINITION__STRUCTURE_REF: + return STRUCTURE_REF_EDEFAULT == null ? structureRef != null : !STRUCTURE_REF_EDEFAULT.equals(structureRef); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (isCollection: "); + result.append(isCollection); + result.append(", itemKind: "); + result.append(itemKind); + result.append(", structureRef: "); + result.append(structureRef); + result.append(')'); + return result.toString(); + } + +} //ItemDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/LaneImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/LaneImpl.java new file mode 100644 index 00000000000..39c3ca67b55 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/LaneImpl.java @@ -0,0 +1,477 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.FlowNode; +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.LaneSet; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Lane'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.LaneImpl#getPartitionElement Partition Element}
  • + *
  • {@link org.eclipse.bpmn2.impl.LaneImpl#getFlowNodeRefs Flow Node Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.LaneImpl#getChildLaneSet Child Lane Set}
  • + *
  • {@link org.eclipse.bpmn2.impl.LaneImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.LaneImpl#getPartitionElementRef Partition Element Ref}
  • + *
+ * + * @generated + */ +public class LaneImpl extends BaseElementImpl implements Lane { + /** + * The cached value of the '{@link #getPartitionElement() Partition Element}' containment reference. + * + * + * @see #getPartitionElement() + * @generated + * @ordered + */ + @GwtTransient + protected BaseElement partitionElement; + + /** + * The cached value of the '{@link #getFlowNodeRefs() Flow Node Refs}' reference list. + * + * + * @see #getFlowNodeRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList flowNodeRefs; + + /** + * The cached value of the '{@link #getChildLaneSet() Child Lane Set}' containment reference. + * + * + * @see #getChildLaneSet() + * @generated + * @ordered + */ + @GwtTransient + protected LaneSet childLaneSet; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getPartitionElementRef() Partition Element Ref}' reference. + * + * + * @see #getPartitionElementRef() + * @generated + * @ordered + */ + @GwtTransient + protected BaseElement partitionElementRef; + + /** + * + * + * @generated + */ + protected LaneImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.LANE; + } + + /** + * + * + * @generated + */ + @Override + public BaseElement getPartitionElement() { + return partitionElement; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetPartitionElement(BaseElement newPartitionElement, NotificationChain msgs) { + BaseElement oldPartitionElement = partitionElement; + partitionElement = newPartitionElement; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.LANE__PARTITION_ELEMENT, oldPartitionElement, newPartitionElement); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setPartitionElement(BaseElement newPartitionElement) { + if (newPartitionElement != partitionElement) { + NotificationChain msgs = null; + if (partitionElement != null) + msgs = ((InternalEObject) partitionElement).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.LANE__PARTITION_ELEMENT, null, msgs); + if (newPartitionElement != null) + msgs = ((InternalEObject) newPartitionElement).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.LANE__PARTITION_ELEMENT, null, msgs); + msgs = basicSetPartitionElement(newPartitionElement, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.LANE__PARTITION_ELEMENT, + newPartitionElement, newPartitionElement)); + } + + /** + * + * + * @generated + */ + @Override + public EList getFlowNodeRefs() { + if (flowNodeRefs == null) { + flowNodeRefs = new EObjectWithInverseEList.ManyInverse(FlowNode.class, this, + Bpmn2Package.LANE__FLOW_NODE_REFS, Bpmn2Package.FLOW_NODE__LANES); + } + return flowNodeRefs; + } + + /** + * + * + * @generated + */ + @Override + public LaneSet getChildLaneSet() { + return childLaneSet; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetChildLaneSet(LaneSet newChildLaneSet, NotificationChain msgs) { + LaneSet oldChildLaneSet = childLaneSet; + childLaneSet = newChildLaneSet; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.LANE__CHILD_LANE_SET, oldChildLaneSet, newChildLaneSet); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setChildLaneSet(LaneSet newChildLaneSet) { + if (newChildLaneSet != childLaneSet) { + NotificationChain msgs = null; + if (childLaneSet != null) + msgs = ((InternalEObject) childLaneSet).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.LANE__CHILD_LANE_SET, null, msgs); + if (newChildLaneSet != null) + msgs = ((InternalEObject) newChildLaneSet).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.LANE__CHILD_LANE_SET, null, msgs); + msgs = basicSetChildLaneSet(newChildLaneSet, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.LANE__CHILD_LANE_SET, newChildLaneSet, + newChildLaneSet)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.LANE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public BaseElement getPartitionElementRef() { + if (partitionElementRef != null && partitionElementRef.eIsProxy()) { + InternalEObject oldPartitionElementRef = (InternalEObject) partitionElementRef; + partitionElementRef = (BaseElement) eResolveProxy(oldPartitionElementRef); + if (partitionElementRef != oldPartitionElementRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.LANE__PARTITION_ELEMENT_REF, + oldPartitionElementRef, partitionElementRef)); + } + } + return partitionElementRef; + } + + /** + * + * + * @generated + */ + public BaseElement basicGetPartitionElementRef() { + return partitionElementRef; + } + + /** + * + * + * @generated + */ + @Override + public void setPartitionElementRef(BaseElement newPartitionElementRef) { + BaseElement oldPartitionElementRef = partitionElementRef; + partitionElementRef = newPartitionElementRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.LANE__PARTITION_ELEMENT_REF, + oldPartitionElementRef, partitionElementRef)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.LANE__FLOW_NODE_REFS: + return ((InternalEList) (InternalEList) getFlowNodeRefs()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.LANE__PARTITION_ELEMENT: + return basicSetPartitionElement(null, msgs); + case Bpmn2Package.LANE__FLOW_NODE_REFS: + return ((InternalEList) getFlowNodeRefs()).basicRemove(otherEnd, msgs); + case Bpmn2Package.LANE__CHILD_LANE_SET: + return basicSetChildLaneSet(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.LANE__PARTITION_ELEMENT: + return getPartitionElement(); + case Bpmn2Package.LANE__FLOW_NODE_REFS: + return getFlowNodeRefs(); + case Bpmn2Package.LANE__CHILD_LANE_SET: + return getChildLaneSet(); + case Bpmn2Package.LANE__NAME: + return getName(); + case Bpmn2Package.LANE__PARTITION_ELEMENT_REF: + if (resolve) + return getPartitionElementRef(); + return basicGetPartitionElementRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.LANE__PARTITION_ELEMENT: + setPartitionElement((BaseElement) newValue); + return; + case Bpmn2Package.LANE__FLOW_NODE_REFS: + getFlowNodeRefs().clear(); + getFlowNodeRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.LANE__CHILD_LANE_SET: + setChildLaneSet((LaneSet) newValue); + return; + case Bpmn2Package.LANE__NAME: + setName((String) newValue); + return; + case Bpmn2Package.LANE__PARTITION_ELEMENT_REF: + setPartitionElementRef((BaseElement) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.LANE__PARTITION_ELEMENT: + setPartitionElement((BaseElement) null); + return; + case Bpmn2Package.LANE__FLOW_NODE_REFS: + getFlowNodeRefs().clear(); + return; + case Bpmn2Package.LANE__CHILD_LANE_SET: + setChildLaneSet((LaneSet) null); + return; + case Bpmn2Package.LANE__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.LANE__PARTITION_ELEMENT_REF: + setPartitionElementRef((BaseElement) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.LANE__PARTITION_ELEMENT: + return partitionElement != null; + case Bpmn2Package.LANE__FLOW_NODE_REFS: + return flowNodeRefs != null && !flowNodeRefs.isEmpty(); + case Bpmn2Package.LANE__CHILD_LANE_SET: + return childLaneSet != null; + case Bpmn2Package.LANE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.LANE__PARTITION_ELEMENT_REF: + return partitionElementRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //LaneImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/LaneSetImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/LaneSetImpl.java new file mode 100644 index 00000000000..2b2e925218b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/LaneSetImpl.java @@ -0,0 +1,241 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.LaneSet; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Lane Set'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.LaneSetImpl#getLanes Lanes}
  • + *
  • {@link org.eclipse.bpmn2.impl.LaneSetImpl#getName Name}
  • + *
+ * + * @generated + */ +public class LaneSetImpl extends BaseElementImpl implements LaneSet { + /** + * The cached value of the '{@link #getLanes() Lanes}' containment reference list. + * + * + * @see #getLanes() + * @generated + * @ordered + */ + @GwtTransient + protected EList lanes; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected LaneSetImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.LANE_SET; + } + + /** + * + * + * @generated + */ + @Override + public EList getLanes() { + if (lanes == null) { + lanes = new EObjectContainmentEList(Lane.class, this, Bpmn2Package.LANE_SET__LANES); + } + return lanes; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.LANE_SET__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.LANE_SET__LANES: + return ((InternalEList) getLanes()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.LANE_SET__LANES: + return getLanes(); + case Bpmn2Package.LANE_SET__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.LANE_SET__LANES: + getLanes().clear(); + getLanes().addAll((Collection) newValue); + return; + case Bpmn2Package.LANE_SET__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.LANE_SET__LANES: + getLanes().clear(); + return; + case Bpmn2Package.LANE_SET__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.LANE_SET__LANES: + return lanes != null && !lanes.isEmpty(); + case Bpmn2Package.LANE_SET__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //LaneSetImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/LinkEventDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/LinkEventDefinitionImpl.java new file mode 100644 index 00000000000..e7391974717 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/LinkEventDefinitionImpl.java @@ -0,0 +1,358 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.LinkEventDefinition; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Link Event Definition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.LinkEventDefinitionImpl#getSource Source}
  • + *
  • {@link org.eclipse.bpmn2.impl.LinkEventDefinitionImpl#getTarget Target}
  • + *
  • {@link org.eclipse.bpmn2.impl.LinkEventDefinitionImpl#getName Name}
  • + *
+ * + * @generated + */ +public class LinkEventDefinitionImpl extends EventDefinitionImpl implements LinkEventDefinition { + /** + * The cached value of the '{@link #getSource() Source}' reference list. + * + * + * @see #getSource() + * @generated + * @ordered + */ + @GwtTransient + protected EList source; + + /** + * The cached value of the '{@link #getTarget() Target}' reference. + * + * + * @see #getTarget() + * @generated + * @ordered + */ + @GwtTransient + protected LinkEventDefinition target; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected LinkEventDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.LINK_EVENT_DEFINITION; + } + + /** + * + * + * @generated + */ + @Override + public EList getSource() { + if (source == null) { + source = new EObjectWithInverseResolvingEList(LinkEventDefinition.class, this, + Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE, Bpmn2Package.LINK_EVENT_DEFINITION__TARGET); + } + return source; + } + + /** + * + * + * @generated + */ + @Override + public LinkEventDefinition getTarget() { + if (target != null && target.eIsProxy()) { + InternalEObject oldTarget = (InternalEObject) target; + target = (LinkEventDefinition) eResolveProxy(oldTarget); + if (target != oldTarget) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.LINK_EVENT_DEFINITION__TARGET, oldTarget, target)); + } + } + return target; + } + + /** + * + * + * @generated + */ + public LinkEventDefinition basicGetTarget() { + return target; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTarget(LinkEventDefinition newTarget, NotificationChain msgs) { + LinkEventDefinition oldTarget = target; + target = newTarget; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.LINK_EVENT_DEFINITION__TARGET, oldTarget, newTarget); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setTarget(LinkEventDefinition newTarget) { + if (newTarget != target) { + NotificationChain msgs = null; + if (target != null) + msgs = ((InternalEObject) target).eInverseRemove(this, Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE, + LinkEventDefinition.class, msgs); + if (newTarget != null) + msgs = ((InternalEObject) newTarget).eInverseAdd(this, Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE, + LinkEventDefinition.class, msgs); + msgs = basicSetTarget(newTarget, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.LINK_EVENT_DEFINITION__TARGET, newTarget, + newTarget)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.LINK_EVENT_DEFINITION__NAME, oldName, + name)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE: + return ((InternalEList) (InternalEList) getSource()).basicAdd(otherEnd, msgs); + case Bpmn2Package.LINK_EVENT_DEFINITION__TARGET: + if (target != null) + msgs = ((InternalEObject) target).eInverseRemove(this, Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE, + LinkEventDefinition.class, msgs); + return basicSetTarget((LinkEventDefinition) otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE: + return ((InternalEList) getSource()).basicRemove(otherEnd, msgs); + case Bpmn2Package.LINK_EVENT_DEFINITION__TARGET: + return basicSetTarget(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE: + return getSource(); + case Bpmn2Package.LINK_EVENT_DEFINITION__TARGET: + if (resolve) + return getTarget(); + return basicGetTarget(); + case Bpmn2Package.LINK_EVENT_DEFINITION__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE: + getSource().clear(); + getSource().addAll((Collection) newValue); + return; + case Bpmn2Package.LINK_EVENT_DEFINITION__TARGET: + setTarget((LinkEventDefinition) newValue); + return; + case Bpmn2Package.LINK_EVENT_DEFINITION__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE: + getSource().clear(); + return; + case Bpmn2Package.LINK_EVENT_DEFINITION__TARGET: + setTarget((LinkEventDefinition) null); + return; + case Bpmn2Package.LINK_EVENT_DEFINITION__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE: + return source != null && !source.isEmpty(); + case Bpmn2Package.LINK_EVENT_DEFINITION__TARGET: + return target != null; + case Bpmn2Package.LINK_EVENT_DEFINITION__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //LinkEventDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/LoopCharacteristicsImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/LoopCharacteristicsImpl.java new file mode 100644 index 00000000000..833cada0f6b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/LoopCharacteristicsImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.LoopCharacteristics; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Loop Characteristics'. + * + * + * @generated + */ +public abstract class LoopCharacteristicsImpl extends BaseElementImpl implements LoopCharacteristics { + /** + * + * + * @generated + */ + protected LoopCharacteristicsImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.LOOP_CHARACTERISTICS; + } + +} //LoopCharacteristicsImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ManualTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ManualTaskImpl.java new file mode 100644 index 00000000000..ce11f788565 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ManualTaskImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ManualTask; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Manual Task'. + * + * + * @generated + */ +public class ManualTaskImpl extends TaskImpl implements ManualTask { + /** + * + * + * @generated + */ + protected ManualTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.MANUAL_TASK; + } + +} //ManualTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MessageEventDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MessageEventDefinitionImpl.java new file mode 100644 index 00000000000..d22221f3d26 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MessageEventDefinitionImpl.java @@ -0,0 +1,243 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.MessageEventDefinition; +import org.eclipse.bpmn2.Operation; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Message Event Definition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.MessageEventDefinitionImpl#getOperationRef Operation Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.MessageEventDefinitionImpl#getMessageRef Message Ref}
  • + *
+ * + * @generated + */ +public class MessageEventDefinitionImpl extends EventDefinitionImpl implements MessageEventDefinition { + /** + * The cached value of the '{@link #getOperationRef() Operation Ref}' reference. + * + * + * @see #getOperationRef() + * @generated + * @ordered + */ + @GwtTransient + protected Operation operationRef; + + /** + * The cached value of the '{@link #getMessageRef() Message Ref}' reference. + * + * + * @see #getMessageRef() + * @generated + * @ordered + */ + @GwtTransient + protected Message messageRef; + + /** + * + * + * @generated + */ + protected MessageEventDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.MESSAGE_EVENT_DEFINITION; + } + + /** + * + * + * @generated + */ + @Override + public Operation getOperationRef() { + if (operationRef != null && operationRef.eIsProxy()) { + InternalEObject oldOperationRef = (InternalEObject) operationRef; + operationRef = (Operation) eResolveProxy(oldOperationRef); + if (operationRef != oldOperationRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.MESSAGE_EVENT_DEFINITION__OPERATION_REF, oldOperationRef, operationRef)); + } + } + return operationRef; + } + + /** + * + * + * @generated + */ + public Operation basicGetOperationRef() { + return operationRef; + } + + /** + * + * + * @generated + */ + @Override + public void setOperationRef(Operation newOperationRef) { + Operation oldOperationRef = operationRef; + operationRef = newOperationRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.MESSAGE_EVENT_DEFINITION__OPERATION_REF, + oldOperationRef, operationRef)); + } + + /** + * + * + * @generated + */ + @Override + public Message getMessageRef() { + if (messageRef != null && messageRef.eIsProxy()) { + InternalEObject oldMessageRef = (InternalEObject) messageRef; + messageRef = (Message) eResolveProxy(oldMessageRef); + if (messageRef != oldMessageRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.MESSAGE_EVENT_DEFINITION__MESSAGE_REF, oldMessageRef, messageRef)); + } + } + return messageRef; + } + + /** + * + * + * @generated + */ + public Message basicGetMessageRef() { + return messageRef; + } + + /** + * + * + * @generated + */ + @Override + public void setMessageRef(Message newMessageRef) { + Message oldMessageRef = messageRef; + messageRef = newMessageRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.MESSAGE_EVENT_DEFINITION__MESSAGE_REF, + oldMessageRef, messageRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.MESSAGE_EVENT_DEFINITION__OPERATION_REF: + if (resolve) + return getOperationRef(); + return basicGetOperationRef(); + case Bpmn2Package.MESSAGE_EVENT_DEFINITION__MESSAGE_REF: + if (resolve) + return getMessageRef(); + return basicGetMessageRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.MESSAGE_EVENT_DEFINITION__OPERATION_REF: + setOperationRef((Operation) newValue); + return; + case Bpmn2Package.MESSAGE_EVENT_DEFINITION__MESSAGE_REF: + setMessageRef((Message) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.MESSAGE_EVENT_DEFINITION__OPERATION_REF: + setOperationRef((Operation) null); + return; + case Bpmn2Package.MESSAGE_EVENT_DEFINITION__MESSAGE_REF: + setMessageRef((Message) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.MESSAGE_EVENT_DEFINITION__OPERATION_REF: + return operationRef != null; + case Bpmn2Package.MESSAGE_EVENT_DEFINITION__MESSAGE_REF: + return messageRef != null; + } + return super.eIsSet(featureID); + } + +} //MessageEventDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MessageFlowAssociationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MessageFlowAssociationImpl.java new file mode 100644 index 00000000000..81a0697f78c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MessageFlowAssociationImpl.java @@ -0,0 +1,246 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.MessageFlow; +import org.eclipse.bpmn2.MessageFlowAssociation; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Message Flow Association'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.MessageFlowAssociationImpl#getInnerMessageFlowRef Inner Message Flow Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.MessageFlowAssociationImpl#getOuterMessageFlowRef Outer Message Flow Ref}
  • + *
+ * + * @generated + */ +public class MessageFlowAssociationImpl extends BaseElementImpl implements MessageFlowAssociation { + /** + * The cached value of the '{@link #getInnerMessageFlowRef() Inner Message Flow Ref}' reference. + * + * + * @see #getInnerMessageFlowRef() + * @generated + * @ordered + */ + @GwtTransient + protected MessageFlow innerMessageFlowRef; + + /** + * The cached value of the '{@link #getOuterMessageFlowRef() Outer Message Flow Ref}' reference. + * + * + * @see #getOuterMessageFlowRef() + * @generated + * @ordered + */ + @GwtTransient + protected MessageFlow outerMessageFlowRef; + + /** + * + * + * @generated + */ + protected MessageFlowAssociationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.MESSAGE_FLOW_ASSOCIATION; + } + + /** + * + * + * @generated + */ + @Override + public MessageFlow getInnerMessageFlowRef() { + if (innerMessageFlowRef != null && innerMessageFlowRef.eIsProxy()) { + InternalEObject oldInnerMessageFlowRef = (InternalEObject) innerMessageFlowRef; + innerMessageFlowRef = (MessageFlow) eResolveProxy(oldInnerMessageFlowRef); + if (innerMessageFlowRef != oldInnerMessageFlowRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.MESSAGE_FLOW_ASSOCIATION__INNER_MESSAGE_FLOW_REF, oldInnerMessageFlowRef, + innerMessageFlowRef)); + } + } + return innerMessageFlowRef; + } + + /** + * + * + * @generated + */ + public MessageFlow basicGetInnerMessageFlowRef() { + return innerMessageFlowRef; + } + + /** + * + * + * @generated + */ + @Override + public void setInnerMessageFlowRef(MessageFlow newInnerMessageFlowRef) { + MessageFlow oldInnerMessageFlowRef = innerMessageFlowRef; + innerMessageFlowRef = newInnerMessageFlowRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MESSAGE_FLOW_ASSOCIATION__INNER_MESSAGE_FLOW_REF, oldInnerMessageFlowRef, + innerMessageFlowRef)); + } + + /** + * + * + * @generated + */ + @Override + public MessageFlow getOuterMessageFlowRef() { + if (outerMessageFlowRef != null && outerMessageFlowRef.eIsProxy()) { + InternalEObject oldOuterMessageFlowRef = (InternalEObject) outerMessageFlowRef; + outerMessageFlowRef = (MessageFlow) eResolveProxy(oldOuterMessageFlowRef); + if (outerMessageFlowRef != oldOuterMessageFlowRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.MESSAGE_FLOW_ASSOCIATION__OUTER_MESSAGE_FLOW_REF, oldOuterMessageFlowRef, + outerMessageFlowRef)); + } + } + return outerMessageFlowRef; + } + + /** + * + * + * @generated + */ + public MessageFlow basicGetOuterMessageFlowRef() { + return outerMessageFlowRef; + } + + /** + * + * + * @generated + */ + @Override + public void setOuterMessageFlowRef(MessageFlow newOuterMessageFlowRef) { + MessageFlow oldOuterMessageFlowRef = outerMessageFlowRef; + outerMessageFlowRef = newOuterMessageFlowRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MESSAGE_FLOW_ASSOCIATION__OUTER_MESSAGE_FLOW_REF, oldOuterMessageFlowRef, + outerMessageFlowRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.MESSAGE_FLOW_ASSOCIATION__INNER_MESSAGE_FLOW_REF: + if (resolve) + return getInnerMessageFlowRef(); + return basicGetInnerMessageFlowRef(); + case Bpmn2Package.MESSAGE_FLOW_ASSOCIATION__OUTER_MESSAGE_FLOW_REF: + if (resolve) + return getOuterMessageFlowRef(); + return basicGetOuterMessageFlowRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.MESSAGE_FLOW_ASSOCIATION__INNER_MESSAGE_FLOW_REF: + setInnerMessageFlowRef((MessageFlow) newValue); + return; + case Bpmn2Package.MESSAGE_FLOW_ASSOCIATION__OUTER_MESSAGE_FLOW_REF: + setOuterMessageFlowRef((MessageFlow) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.MESSAGE_FLOW_ASSOCIATION__INNER_MESSAGE_FLOW_REF: + setInnerMessageFlowRef((MessageFlow) null); + return; + case Bpmn2Package.MESSAGE_FLOW_ASSOCIATION__OUTER_MESSAGE_FLOW_REF: + setOuterMessageFlowRef((MessageFlow) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.MESSAGE_FLOW_ASSOCIATION__INNER_MESSAGE_FLOW_REF: + return innerMessageFlowRef != null; + case Bpmn2Package.MESSAGE_FLOW_ASSOCIATION__OUTER_MESSAGE_FLOW_REF: + return outerMessageFlowRef != null; + } + return super.eIsSet(featureID); + } + +} //MessageFlowAssociationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MessageFlowImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MessageFlowImpl.java new file mode 100644 index 00000000000..987ca1eaee3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MessageFlowImpl.java @@ -0,0 +1,381 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.InteractionNode; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.MessageFlow; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Message Flow'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.MessageFlowImpl#getMessageRef Message Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.MessageFlowImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.MessageFlowImpl#getSourceRef Source Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.MessageFlowImpl#getTargetRef Target Ref}
  • + *
+ * + * @generated + */ +public class MessageFlowImpl extends BaseElementImpl implements MessageFlow { + /** + * The cached value of the '{@link #getMessageRef() Message Ref}' reference. + * + * + * @see #getMessageRef() + * @generated + * @ordered + */ + @GwtTransient + protected Message messageRef; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getSourceRef() Source Ref}' reference. + * + * + * @see #getSourceRef() + * @generated + * @ordered + */ + @GwtTransient + protected InteractionNode sourceRef; + + /** + * The cached value of the '{@link #getTargetRef() Target Ref}' reference. + * + * + * @see #getTargetRef() + * @generated + * @ordered + */ + @GwtTransient + protected InteractionNode targetRef; + + /** + * + * + * @generated + */ + protected MessageFlowImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.MESSAGE_FLOW; + } + + /** + * + * + * @generated + */ + @Override + public Message getMessageRef() { + if (messageRef != null && messageRef.eIsProxy()) { + InternalEObject oldMessageRef = (InternalEObject) messageRef; + messageRef = (Message) eResolveProxy(oldMessageRef); + if (messageRef != oldMessageRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.MESSAGE_FLOW__MESSAGE_REF, + oldMessageRef, messageRef)); + } + } + return messageRef; + } + + /** + * + * + * @generated + */ + public Message basicGetMessageRef() { + return messageRef; + } + + /** + * + * + * @generated + */ + @Override + public void setMessageRef(Message newMessageRef) { + Message oldMessageRef = messageRef; + messageRef = newMessageRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.MESSAGE_FLOW__MESSAGE_REF, oldMessageRef, + messageRef)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.MESSAGE_FLOW__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public InteractionNode getSourceRef() { + if (sourceRef != null && sourceRef.eIsProxy()) { + InternalEObject oldSourceRef = (InternalEObject) sourceRef; + sourceRef = (InteractionNode) eResolveProxy(oldSourceRef); + if (sourceRef != oldSourceRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.MESSAGE_FLOW__SOURCE_REF, + oldSourceRef, sourceRef)); + } + } + return sourceRef; + } + + /** + * + * + * @generated + */ + public InteractionNode basicGetSourceRef() { + return sourceRef; + } + + /** + * + * + * @generated + */ + @Override + public void setSourceRef(InteractionNode newSourceRef) { + InteractionNode oldSourceRef = sourceRef; + sourceRef = newSourceRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.MESSAGE_FLOW__SOURCE_REF, oldSourceRef, + sourceRef)); + } + + /** + * + * + * @generated + */ + @Override + public InteractionNode getTargetRef() { + if (targetRef != null && targetRef.eIsProxy()) { + InternalEObject oldTargetRef = (InternalEObject) targetRef; + targetRef = (InteractionNode) eResolveProxy(oldTargetRef); + if (targetRef != oldTargetRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.MESSAGE_FLOW__TARGET_REF, + oldTargetRef, targetRef)); + } + } + return targetRef; + } + + /** + * + * + * @generated + */ + public InteractionNode basicGetTargetRef() { + return targetRef; + } + + /** + * + * + * @generated + */ + @Override + public void setTargetRef(InteractionNode newTargetRef) { + InteractionNode oldTargetRef = targetRef; + targetRef = newTargetRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.MESSAGE_FLOW__TARGET_REF, oldTargetRef, + targetRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.MESSAGE_FLOW__MESSAGE_REF: + if (resolve) + return getMessageRef(); + return basicGetMessageRef(); + case Bpmn2Package.MESSAGE_FLOW__NAME: + return getName(); + case Bpmn2Package.MESSAGE_FLOW__SOURCE_REF: + if (resolve) + return getSourceRef(); + return basicGetSourceRef(); + case Bpmn2Package.MESSAGE_FLOW__TARGET_REF: + if (resolve) + return getTargetRef(); + return basicGetTargetRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.MESSAGE_FLOW__MESSAGE_REF: + setMessageRef((Message) newValue); + return; + case Bpmn2Package.MESSAGE_FLOW__NAME: + setName((String) newValue); + return; + case Bpmn2Package.MESSAGE_FLOW__SOURCE_REF: + setSourceRef((InteractionNode) newValue); + return; + case Bpmn2Package.MESSAGE_FLOW__TARGET_REF: + setTargetRef((InteractionNode) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.MESSAGE_FLOW__MESSAGE_REF: + setMessageRef((Message) null); + return; + case Bpmn2Package.MESSAGE_FLOW__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.MESSAGE_FLOW__SOURCE_REF: + setSourceRef((InteractionNode) null); + return; + case Bpmn2Package.MESSAGE_FLOW__TARGET_REF: + setTargetRef((InteractionNode) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.MESSAGE_FLOW__MESSAGE_REF: + return messageRef != null; + case Bpmn2Package.MESSAGE_FLOW__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.MESSAGE_FLOW__SOURCE_REF: + return sourceRef != null; + case Bpmn2Package.MESSAGE_FLOW__TARGET_REF: + return targetRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //MessageFlowImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MessageImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MessageImpl.java new file mode 100644 index 00000000000..0c0c87168ce --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MessageImpl.java @@ -0,0 +1,247 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Message; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Message'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.MessageImpl#getItemRef Item Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.MessageImpl#getName Name}
  • + *
+ * + * @generated + */ +public class MessageImpl extends RootElementImpl implements Message { + /** + * The cached value of the '{@link #getItemRef() Item Ref}' reference. + * + * + * @see #getItemRef() + * @generated + * @ordered + */ + @GwtTransient + protected ItemDefinition itemRef; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected MessageImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.MESSAGE; + } + + /** + * + * + * @generated + */ + @Override + public ItemDefinition getItemRef() { + if (itemRef != null && itemRef.eIsProxy()) { + InternalEObject oldItemRef = (InternalEObject) itemRef; + itemRef = (ItemDefinition) eResolveProxy(oldItemRef); + if (itemRef != oldItemRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.MESSAGE__ITEM_REF, + oldItemRef, itemRef)); + } + } + return itemRef; + } + + /** + * + * + * @generated + */ + public ItemDefinition basicGetItemRef() { + return itemRef; + } + + /** + * + * + * @generated + */ + @Override + public void setItemRef(ItemDefinition newItemRef) { + ItemDefinition oldItemRef = itemRef; + itemRef = newItemRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.MESSAGE__ITEM_REF, oldItemRef, itemRef)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.MESSAGE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.MESSAGE__ITEM_REF: + if (resolve) + return getItemRef(); + return basicGetItemRef(); + case Bpmn2Package.MESSAGE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.MESSAGE__ITEM_REF: + setItemRef((ItemDefinition) newValue); + return; + case Bpmn2Package.MESSAGE__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.MESSAGE__ITEM_REF: + setItemRef((ItemDefinition) null); + return; + case Bpmn2Package.MESSAGE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.MESSAGE__ITEM_REF: + return itemRef != null; + case Bpmn2Package.MESSAGE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //MessageImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MonitoringImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MonitoringImpl.java new file mode 100644 index 00000000000..99bd9e9687b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MonitoringImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Monitoring; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Monitoring'. + * + * + * @generated + */ +public class MonitoringImpl extends BaseElementImpl implements Monitoring { + /** + * + * + * @generated + */ + protected MonitoringImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.MONITORING; + } + +} //MonitoringImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MultiInstanceLoopCharacteristicsImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MultiInstanceLoopCharacteristicsImpl.java new file mode 100644 index 00000000000..af97ce3d611 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/MultiInstanceLoopCharacteristicsImpl.java @@ -0,0 +1,901 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ComplexBehaviorDefinition; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.Expression; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.MultiInstanceBehavior; +import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Multi Instance Loop Characteristics'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl#getLoopCardinality Loop Cardinality}
  • + *
  • {@link org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl#getLoopDataInputRef Loop Data Input Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl#getLoopDataOutputRef Loop Data Output Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl#getInputDataItem Input Data Item}
  • + *
  • {@link org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl#getOutputDataItem Output Data Item}
  • + *
  • {@link org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl#getComplexBehaviorDefinition Complex Behavior Definition}
  • + *
  • {@link org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl#getCompletionCondition Completion Condition}
  • + *
  • {@link org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl#getBehavior Behavior}
  • + *
  • {@link org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl#isIsSequential Is Sequential}
  • + *
  • {@link org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl#getNoneBehaviorEventRef None Behavior Event Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.MultiInstanceLoopCharacteristicsImpl#getOneBehaviorEventRef One Behavior Event Ref}
  • + *
+ * + * @generated + */ +public class MultiInstanceLoopCharacteristicsImpl extends LoopCharacteristicsImpl + implements MultiInstanceLoopCharacteristics { + /** + * The cached value of the '{@link #getLoopCardinality() Loop Cardinality}' containment reference. + * + * + * @see #getLoopCardinality() + * @generated + * @ordered + */ + @GwtTransient + protected Expression loopCardinality; + + /** + * The cached value of the '{@link #getLoopDataInputRef() Loop Data Input Ref}' reference. + * + * + * @see #getLoopDataInputRef() + * @generated + * @ordered + */ + @GwtTransient + protected ItemAwareElement loopDataInputRef; + + /** + * The cached value of the '{@link #getLoopDataOutputRef() Loop Data Output Ref}' reference. + * + * + * @see #getLoopDataOutputRef() + * @generated + * @ordered + */ + @GwtTransient + protected ItemAwareElement loopDataOutputRef; + + /** + * The cached value of the '{@link #getInputDataItem() Input Data Item}' containment reference. + * + * + * @see #getInputDataItem() + * @generated + * @ordered + */ + @GwtTransient + protected DataInput inputDataItem; + + /** + * The cached value of the '{@link #getOutputDataItem() Output Data Item}' containment reference. + * + * + * @see #getOutputDataItem() + * @generated + * @ordered + */ + @GwtTransient + protected DataOutput outputDataItem; + + /** + * The cached value of the '{@link #getComplexBehaviorDefinition() Complex Behavior Definition}' containment reference list. + * + * + * @see #getComplexBehaviorDefinition() + * @generated + * @ordered + */ + @GwtTransient + protected EList complexBehaviorDefinition; + + /** + * The cached value of the '{@link #getCompletionCondition() Completion Condition}' containment reference. + * + * + * @see #getCompletionCondition() + * @generated + * @ordered + */ + @GwtTransient + protected Expression completionCondition; + + /** + * The default value of the '{@link #getBehavior() Behavior}' attribute. + * + * + * @see #getBehavior() + * @generated + * @ordered + */ + protected static final MultiInstanceBehavior BEHAVIOR_EDEFAULT = MultiInstanceBehavior.ALL; + + /** + * The cached value of the '{@link #getBehavior() Behavior}' attribute. + * + * + * @see #getBehavior() + * @generated + * @ordered + */ + @GwtTransient + protected MultiInstanceBehavior behavior = BEHAVIOR_EDEFAULT; + + /** + * The default value of the '{@link #isIsSequential() Is Sequential}' attribute. + * + * + * @see #isIsSequential() + * @generated + * @ordered + */ + protected static final boolean IS_SEQUENTIAL_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsSequential() Is Sequential}' attribute. + * + * + * @see #isIsSequential() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isSequential = IS_SEQUENTIAL_EDEFAULT; + + /** + * The cached value of the '{@link #getNoneBehaviorEventRef() None Behavior Event Ref}' reference. + * + * + * @see #getNoneBehaviorEventRef() + * @generated + * @ordered + */ + @GwtTransient + protected EventDefinition noneBehaviorEventRef; + + /** + * The cached value of the '{@link #getOneBehaviorEventRef() One Behavior Event Ref}' reference. + * + * + * @see #getOneBehaviorEventRef() + * @generated + * @ordered + */ + @GwtTransient + protected EventDefinition oneBehaviorEventRef; + + /** + * + * + * @generated + */ + protected MultiInstanceLoopCharacteristicsImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.MULTI_INSTANCE_LOOP_CHARACTERISTICS; + } + + /** + * + * + * @generated + */ + @Override + public Expression getLoopCardinality() { + return loopCardinality; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLoopCardinality(Expression newLoopCardinality, NotificationChain msgs) { + Expression oldLoopCardinality = loopCardinality; + loopCardinality = newLoopCardinality; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_CARDINALITY, oldLoopCardinality, + newLoopCardinality); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setLoopCardinality(Expression newLoopCardinality) { + if (newLoopCardinality != loopCardinality) { + NotificationChain msgs = null; + if (loopCardinality != null) + msgs = ((InternalEObject) loopCardinality).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_CARDINALITY, + null, msgs); + if (newLoopCardinality != null) + msgs = ((InternalEObject) newLoopCardinality).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_CARDINALITY, + null, msgs); + msgs = basicSetLoopCardinality(newLoopCardinality, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_CARDINALITY, newLoopCardinality, + newLoopCardinality)); + } + + /** + * + * + * @generated + */ + @Override + public ItemAwareElement getLoopDataInputRef() { + if (loopDataInputRef != null && loopDataInputRef.eIsProxy()) { + InternalEObject oldLoopDataInputRef = (InternalEObject) loopDataInputRef; + loopDataInputRef = (ItemAwareElement) eResolveProxy(oldLoopDataInputRef); + if (loopDataInputRef != oldLoopDataInputRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_INPUT_REF, oldLoopDataInputRef, + loopDataInputRef)); + } + } + return loopDataInputRef; + } + + /** + * + * + * @generated + */ + public ItemAwareElement basicGetLoopDataInputRef() { + return loopDataInputRef; + } + + /** + * + * + * @generated + */ + @Override + public void setLoopDataInputRef(ItemAwareElement newLoopDataInputRef) { + ItemAwareElement oldLoopDataInputRef = loopDataInputRef; + loopDataInputRef = newLoopDataInputRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_INPUT_REF, oldLoopDataInputRef, + loopDataInputRef)); + } + + /** + * + * + * @generated + */ + @Override + public ItemAwareElement getLoopDataOutputRef() { + if (loopDataOutputRef != null && loopDataOutputRef.eIsProxy()) { + InternalEObject oldLoopDataOutputRef = (InternalEObject) loopDataOutputRef; + loopDataOutputRef = (ItemAwareElement) eResolveProxy(oldLoopDataOutputRef); + if (loopDataOutputRef != oldLoopDataOutputRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_OUTPUT_REF, + oldLoopDataOutputRef, loopDataOutputRef)); + } + } + return loopDataOutputRef; + } + + /** + * + * + * @generated + */ + public ItemAwareElement basicGetLoopDataOutputRef() { + return loopDataOutputRef; + } + + /** + * + * + * @generated + */ + @Override + public void setLoopDataOutputRef(ItemAwareElement newLoopDataOutputRef) { + ItemAwareElement oldLoopDataOutputRef = loopDataOutputRef; + loopDataOutputRef = newLoopDataOutputRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_OUTPUT_REF, oldLoopDataOutputRef, + loopDataOutputRef)); + } + + /** + * + * + * @generated + */ + @Override + public DataInput getInputDataItem() { + return inputDataItem; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetInputDataItem(DataInput newInputDataItem, NotificationChain msgs) { + DataInput oldInputDataItem = inputDataItem; + inputDataItem = newInputDataItem; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__INPUT_DATA_ITEM, oldInputDataItem, + newInputDataItem); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setInputDataItem(DataInput newInputDataItem) { + if (newInputDataItem != inputDataItem) { + NotificationChain msgs = null; + if (inputDataItem != null) + msgs = ((InternalEObject) inputDataItem).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__INPUT_DATA_ITEM, + null, msgs); + if (newInputDataItem != null) + msgs = ((InternalEObject) newInputDataItem).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__INPUT_DATA_ITEM, + null, msgs); + msgs = basicSetInputDataItem(newInputDataItem, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__INPUT_DATA_ITEM, newInputDataItem, + newInputDataItem)); + } + + /** + * + * + * @generated + */ + @Override + public DataOutput getOutputDataItem() { + return outputDataItem; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetOutputDataItem(DataOutput newOutputDataItem, NotificationChain msgs) { + DataOutput oldOutputDataItem = outputDataItem; + outputDataItem = newOutputDataItem; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__OUTPUT_DATA_ITEM, oldOutputDataItem, + newOutputDataItem); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setOutputDataItem(DataOutput newOutputDataItem) { + if (newOutputDataItem != outputDataItem) { + NotificationChain msgs = null; + if (outputDataItem != null) + msgs = ((InternalEObject) outputDataItem).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__OUTPUT_DATA_ITEM, + null, msgs); + if (newOutputDataItem != null) + msgs = ((InternalEObject) newOutputDataItem).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__OUTPUT_DATA_ITEM, + null, msgs); + msgs = basicSetOutputDataItem(newOutputDataItem, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__OUTPUT_DATA_ITEM, newOutputDataItem, + newOutputDataItem)); + } + + /** + * + * + * @generated + */ + @Override + public EList getComplexBehaviorDefinition() { + if (complexBehaviorDefinition == null) { + complexBehaviorDefinition = new EObjectContainmentEList( + ComplexBehaviorDefinition.class, this, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLEX_BEHAVIOR_DEFINITION); + } + return complexBehaviorDefinition; + } + + /** + * + * + * @generated + */ + @Override + public Expression getCompletionCondition() { + return completionCondition; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCompletionCondition(Expression newCompletionCondition, NotificationChain msgs) { + Expression oldCompletionCondition = completionCondition; + completionCondition = newCompletionCondition; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLETION_CONDITION, oldCompletionCondition, + newCompletionCondition); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setCompletionCondition(Expression newCompletionCondition) { + if (newCompletionCondition != completionCondition) { + NotificationChain msgs = null; + if (completionCondition != null) + msgs = ((InternalEObject) completionCondition).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLETION_CONDITION, + null, msgs); + if (newCompletionCondition != null) + msgs = ((InternalEObject) newCompletionCondition).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLETION_CONDITION, + null, msgs); + msgs = basicSetCompletionCondition(newCompletionCondition, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLETION_CONDITION, newCompletionCondition, + newCompletionCondition)); + } + + /** + * + * + * @generated + */ + @Override + public MultiInstanceBehavior getBehavior() { + return behavior; + } + + /** + * + * + * @generated + */ + @Override + public void setBehavior(MultiInstanceBehavior newBehavior) { + MultiInstanceBehavior oldBehavior = behavior; + behavior = newBehavior == null ? BEHAVIOR_EDEFAULT : newBehavior; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__BEHAVIOR, oldBehavior, behavior)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsSequential() { + return isSequential; + } + + /** + * + * + * @generated + */ + @Override + public void setIsSequential(boolean newIsSequential) { + boolean oldIsSequential = isSequential; + isSequential = newIsSequential; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__IS_SEQUENTIAL, oldIsSequential, isSequential)); + } + + /** + * + * + * @generated + */ + @Override + public EventDefinition getNoneBehaviorEventRef() { + if (noneBehaviorEventRef != null && noneBehaviorEventRef.eIsProxy()) { + InternalEObject oldNoneBehaviorEventRef = (InternalEObject) noneBehaviorEventRef; + noneBehaviorEventRef = (EventDefinition) eResolveProxy(oldNoneBehaviorEventRef); + if (noneBehaviorEventRef != oldNoneBehaviorEventRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__NONE_BEHAVIOR_EVENT_REF, + oldNoneBehaviorEventRef, noneBehaviorEventRef)); + } + } + return noneBehaviorEventRef; + } + + /** + * + * + * @generated + */ + public EventDefinition basicGetNoneBehaviorEventRef() { + return noneBehaviorEventRef; + } + + /** + * + * + * @generated + */ + @Override + public void setNoneBehaviorEventRef(EventDefinition newNoneBehaviorEventRef) { + EventDefinition oldNoneBehaviorEventRef = noneBehaviorEventRef; + noneBehaviorEventRef = newNoneBehaviorEventRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__NONE_BEHAVIOR_EVENT_REF, oldNoneBehaviorEventRef, + noneBehaviorEventRef)); + } + + /** + * + * + * @generated + */ + @Override + public EventDefinition getOneBehaviorEventRef() { + if (oneBehaviorEventRef != null && oneBehaviorEventRef.eIsProxy()) { + InternalEObject oldOneBehaviorEventRef = (InternalEObject) oneBehaviorEventRef; + oneBehaviorEventRef = (EventDefinition) eResolveProxy(oldOneBehaviorEventRef); + if (oneBehaviorEventRef != oldOneBehaviorEventRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__ONE_BEHAVIOR_EVENT_REF, + oldOneBehaviorEventRef, oneBehaviorEventRef)); + } + } + return oneBehaviorEventRef; + } + + /** + * + * + * @generated + */ + public EventDefinition basicGetOneBehaviorEventRef() { + return oneBehaviorEventRef; + } + + /** + * + * + * @generated + */ + @Override + public void setOneBehaviorEventRef(EventDefinition newOneBehaviorEventRef) { + EventDefinition oldOneBehaviorEventRef = oneBehaviorEventRef; + oneBehaviorEventRef = newOneBehaviorEventRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__ONE_BEHAVIOR_EVENT_REF, oldOneBehaviorEventRef, + oneBehaviorEventRef)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_CARDINALITY: + return basicSetLoopCardinality(null, msgs); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__INPUT_DATA_ITEM: + return basicSetInputDataItem(null, msgs); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__OUTPUT_DATA_ITEM: + return basicSetOutputDataItem(null, msgs); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLEX_BEHAVIOR_DEFINITION: + return ((InternalEList) getComplexBehaviorDefinition()).basicRemove(otherEnd, msgs); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLETION_CONDITION: + return basicSetCompletionCondition(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_CARDINALITY: + return getLoopCardinality(); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_INPUT_REF: + if (resolve) + return getLoopDataInputRef(); + return basicGetLoopDataInputRef(); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_OUTPUT_REF: + if (resolve) + return getLoopDataOutputRef(); + return basicGetLoopDataOutputRef(); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__INPUT_DATA_ITEM: + return getInputDataItem(); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__OUTPUT_DATA_ITEM: + return getOutputDataItem(); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLEX_BEHAVIOR_DEFINITION: + return getComplexBehaviorDefinition(); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLETION_CONDITION: + return getCompletionCondition(); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__BEHAVIOR: + return getBehavior(); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__IS_SEQUENTIAL: + return isIsSequential(); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__NONE_BEHAVIOR_EVENT_REF: + if (resolve) + return getNoneBehaviorEventRef(); + return basicGetNoneBehaviorEventRef(); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__ONE_BEHAVIOR_EVENT_REF: + if (resolve) + return getOneBehaviorEventRef(); + return basicGetOneBehaviorEventRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_CARDINALITY: + setLoopCardinality((Expression) newValue); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_INPUT_REF: + setLoopDataInputRef((ItemAwareElement) newValue); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_OUTPUT_REF: + setLoopDataOutputRef((ItemAwareElement) newValue); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__INPUT_DATA_ITEM: + setInputDataItem((DataInput) newValue); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__OUTPUT_DATA_ITEM: + setOutputDataItem((DataOutput) newValue); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLEX_BEHAVIOR_DEFINITION: + getComplexBehaviorDefinition().clear(); + getComplexBehaviorDefinition().addAll((Collection) newValue); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLETION_CONDITION: + setCompletionCondition((Expression) newValue); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__BEHAVIOR: + setBehavior((MultiInstanceBehavior) newValue); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__IS_SEQUENTIAL: + setIsSequential((Boolean) newValue); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__NONE_BEHAVIOR_EVENT_REF: + setNoneBehaviorEventRef((EventDefinition) newValue); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__ONE_BEHAVIOR_EVENT_REF: + setOneBehaviorEventRef((EventDefinition) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_CARDINALITY: + setLoopCardinality((Expression) null); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_INPUT_REF: + setLoopDataInputRef((ItemAwareElement) null); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_OUTPUT_REF: + setLoopDataOutputRef((ItemAwareElement) null); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__INPUT_DATA_ITEM: + setInputDataItem((DataInput) null); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__OUTPUT_DATA_ITEM: + setOutputDataItem((DataOutput) null); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLEX_BEHAVIOR_DEFINITION: + getComplexBehaviorDefinition().clear(); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLETION_CONDITION: + setCompletionCondition((Expression) null); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__BEHAVIOR: + setBehavior(BEHAVIOR_EDEFAULT); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__IS_SEQUENTIAL: + setIsSequential(IS_SEQUENTIAL_EDEFAULT); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__NONE_BEHAVIOR_EVENT_REF: + setNoneBehaviorEventRef((EventDefinition) null); + return; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__ONE_BEHAVIOR_EVENT_REF: + setOneBehaviorEventRef((EventDefinition) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_CARDINALITY: + return loopCardinality != null; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_INPUT_REF: + return loopDataInputRef != null; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__LOOP_DATA_OUTPUT_REF: + return loopDataOutputRef != null; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__INPUT_DATA_ITEM: + return inputDataItem != null; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__OUTPUT_DATA_ITEM: + return outputDataItem != null; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLEX_BEHAVIOR_DEFINITION: + return complexBehaviorDefinition != null && !complexBehaviorDefinition.isEmpty(); + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__COMPLETION_CONDITION: + return completionCondition != null; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__BEHAVIOR: + return behavior != BEHAVIOR_EDEFAULT; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__IS_SEQUENTIAL: + return isSequential != IS_SEQUENTIAL_EDEFAULT; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__NONE_BEHAVIOR_EVENT_REF: + return noneBehaviorEventRef != null; + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS__ONE_BEHAVIOR_EVENT_REF: + return oneBehaviorEventRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (behavior: "); + result.append(behavior); + result.append(", isSequential: "); + result.append(isSequential); + result.append(')'); + return result.toString(); + } + +} //MultiInstanceLoopCharacteristicsImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/OperationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/OperationImpl.java new file mode 100644 index 00000000000..f776619b7cd --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/OperationImpl.java @@ -0,0 +1,417 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.Operation; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'Operation'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.OperationImpl#getInMessageRef In Message Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.OperationImpl#getOutMessageRef Out Message Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.OperationImpl#getErrorRefs Error Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.OperationImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.OperationImpl#getImplementationRef Implementation Ref}
  • + *
+ * + * @generated + */ +public class OperationImpl extends BaseElementImpl implements Operation { + /** + * The cached value of the '{@link #getInMessageRef() In Message Ref}' reference. + * + * + * @see #getInMessageRef() + * @generated + * @ordered + */ + @GwtTransient + protected Message inMessageRef; + + /** + * The cached value of the '{@link #getOutMessageRef() Out Message Ref}' reference. + * + * + * @see #getOutMessageRef() + * @generated + * @ordered + */ + @GwtTransient + protected Message outMessageRef; + + /** + * The cached value of the '{@link #getErrorRefs() Error Refs}' reference list. + * + * + * @see #getErrorRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList errorRefs; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getImplementationRef() Implementation Ref}' attribute. + * + * + * @see #getImplementationRef() + * @generated + * @ordered + */ + protected static final String IMPLEMENTATION_REF_EDEFAULT = null; + + /** + * The cached value of the '{@link #getImplementationRef() Implementation Ref}' attribute. + * + * + * @see #getImplementationRef() + * @generated + * @ordered + */ + @GwtTransient + protected String implementationRef = IMPLEMENTATION_REF_EDEFAULT; + + /** + * + * + * @generated + */ + protected OperationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.OPERATION; + } + + /** + * + * + * @generated + */ + @Override + public Message getInMessageRef() { + if (inMessageRef != null && inMessageRef.eIsProxy()) { + InternalEObject oldInMessageRef = (InternalEObject) inMessageRef; + inMessageRef = (Message) eResolveProxy(oldInMessageRef); + if (inMessageRef != oldInMessageRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.OPERATION__IN_MESSAGE_REF, + oldInMessageRef, inMessageRef)); + } + } + return inMessageRef; + } + + /** + * + * + * @generated + */ + public Message basicGetInMessageRef() { + return inMessageRef; + } + + /** + * + * + * @generated + */ + @Override + public void setInMessageRef(Message newInMessageRef) { + Message oldInMessageRef = inMessageRef; + inMessageRef = newInMessageRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.OPERATION__IN_MESSAGE_REF, + oldInMessageRef, inMessageRef)); + } + + /** + * + * + * @generated + */ + @Override + public Message getOutMessageRef() { + if (outMessageRef != null && outMessageRef.eIsProxy()) { + InternalEObject oldOutMessageRef = (InternalEObject) outMessageRef; + outMessageRef = (Message) eResolveProxy(oldOutMessageRef); + if (outMessageRef != oldOutMessageRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.OPERATION__OUT_MESSAGE_REF, + oldOutMessageRef, outMessageRef)); + } + } + return outMessageRef; + } + + /** + * + * + * @generated + */ + public Message basicGetOutMessageRef() { + return outMessageRef; + } + + /** + * + * + * @generated + */ + @Override + public void setOutMessageRef(Message newOutMessageRef) { + Message oldOutMessageRef = outMessageRef; + outMessageRef = newOutMessageRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.OPERATION__OUT_MESSAGE_REF, + oldOutMessageRef, outMessageRef)); + } + + /** + * + * + * @generated + */ + @Override + public EList getErrorRefs() { + if (errorRefs == null) { + errorRefs = new EObjectResolvingEList(org.eclipse.bpmn2.Error.class, this, + Bpmn2Package.OPERATION__ERROR_REFS); + } + return errorRefs; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.OPERATION__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public String getImplementationRef() { + return implementationRef; + } + + /** + * + * + * @generated + */ + @Override + public void setImplementationRef(String newImplementationRef) { + String oldImplementationRef = implementationRef; + implementationRef = newImplementationRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.OPERATION__IMPLEMENTATION_REF, + oldImplementationRef, implementationRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.OPERATION__IN_MESSAGE_REF: + if (resolve) + return getInMessageRef(); + return basicGetInMessageRef(); + case Bpmn2Package.OPERATION__OUT_MESSAGE_REF: + if (resolve) + return getOutMessageRef(); + return basicGetOutMessageRef(); + case Bpmn2Package.OPERATION__ERROR_REFS: + return getErrorRefs(); + case Bpmn2Package.OPERATION__NAME: + return getName(); + case Bpmn2Package.OPERATION__IMPLEMENTATION_REF: + return getImplementationRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.OPERATION__IN_MESSAGE_REF: + setInMessageRef((Message) newValue); + return; + case Bpmn2Package.OPERATION__OUT_MESSAGE_REF: + setOutMessageRef((Message) newValue); + return; + case Bpmn2Package.OPERATION__ERROR_REFS: + getErrorRefs().clear(); + getErrorRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.OPERATION__NAME: + setName((String) newValue); + return; + case Bpmn2Package.OPERATION__IMPLEMENTATION_REF: + setImplementationRef((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.OPERATION__IN_MESSAGE_REF: + setInMessageRef((Message) null); + return; + case Bpmn2Package.OPERATION__OUT_MESSAGE_REF: + setOutMessageRef((Message) null); + return; + case Bpmn2Package.OPERATION__ERROR_REFS: + getErrorRefs().clear(); + return; + case Bpmn2Package.OPERATION__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.OPERATION__IMPLEMENTATION_REF: + setImplementationRef(IMPLEMENTATION_REF_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.OPERATION__IN_MESSAGE_REF: + return inMessageRef != null; + case Bpmn2Package.OPERATION__OUT_MESSAGE_REF: + return outMessageRef != null; + case Bpmn2Package.OPERATION__ERROR_REFS: + return errorRefs != null && !errorRefs.isEmpty(); + case Bpmn2Package.OPERATION__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.OPERATION__IMPLEMENTATION_REF: + return IMPLEMENTATION_REF_EDEFAULT == null ? implementationRef != null + : !IMPLEMENTATION_REF_EDEFAULT.equals(implementationRef); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(", implementationRef: "); + result.append(implementationRef); + result.append(')'); + return result.toString(); + } + +} //OperationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/OutputSetImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/OutputSetImpl.java new file mode 100644 index 00000000000..c10dd12856e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/OutputSetImpl.java @@ -0,0 +1,384 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.OutputSet; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Output Set'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.OutputSetImpl#getDataOutputRefs Data Output Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.OutputSetImpl#getOptionalOutputRefs Optional Output Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.OutputSetImpl#getWhileExecutingOutputRefs While Executing Output Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.OutputSetImpl#getInputSetRefs Input Set Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.OutputSetImpl#getName Name}
  • + *
+ * + * @generated + */ +public class OutputSetImpl extends BaseElementImpl implements OutputSet { + /** + * The cached value of the '{@link #getDataOutputRefs() Data Output Refs}' reference list. + * + * + * @see #getDataOutputRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList dataOutputRefs; + + /** + * The cached value of the '{@link #getOptionalOutputRefs() Optional Output Refs}' reference list. + * + * + * @see #getOptionalOutputRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList optionalOutputRefs; + + /** + * The cached value of the '{@link #getWhileExecutingOutputRefs() While Executing Output Refs}' reference list. + * + * + * @see #getWhileExecutingOutputRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList whileExecutingOutputRefs; + + /** + * The cached value of the '{@link #getInputSetRefs() Input Set Refs}' reference list. + * + * + * @see #getInputSetRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList inputSetRefs; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected OutputSetImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.OUTPUT_SET; + } + + /** + * + * + * @generated + */ + @Override + public EList getDataOutputRefs() { + if (dataOutputRefs == null) { + dataOutputRefs = new EObjectWithInverseEList.ManyInverse(DataOutput.class, this, + Bpmn2Package.OUTPUT_SET__DATA_OUTPUT_REFS, Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_REFS); + } + return dataOutputRefs; + } + + /** + * + * + * @generated + */ + @Override + public EList getOptionalOutputRefs() { + if (optionalOutputRefs == null) { + optionalOutputRefs = new EObjectWithInverseEList.ManyInverse(DataOutput.class, this, + Bpmn2Package.OUTPUT_SET__OPTIONAL_OUTPUT_REFS, Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_OPTIONAL); + } + return optionalOutputRefs; + } + + /** + * + * + * @generated + */ + @Override + public EList getWhileExecutingOutputRefs() { + if (whileExecutingOutputRefs == null) { + whileExecutingOutputRefs = new EObjectWithInverseEList.ManyInverse(DataOutput.class, this, + Bpmn2Package.OUTPUT_SET__WHILE_EXECUTING_OUTPUT_REFS, + Bpmn2Package.DATA_OUTPUT__OUTPUT_SET_WITH_WHILE_EXECUTING); + } + return whileExecutingOutputRefs; + } + + /** + * + * + * @generated + */ + @Override + public EList getInputSetRefs() { + if (inputSetRefs == null) { + inputSetRefs = new EObjectWithInverseEList.ManyInverse(InputSet.class, this, + Bpmn2Package.OUTPUT_SET__INPUT_SET_REFS, Bpmn2Package.INPUT_SET__OUTPUT_SET_REFS); + } + return inputSetRefs; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.OUTPUT_SET__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.OUTPUT_SET__DATA_OUTPUT_REFS: + return ((InternalEList) (InternalEList) getDataOutputRefs()).basicAdd(otherEnd, msgs); + case Bpmn2Package.OUTPUT_SET__OPTIONAL_OUTPUT_REFS: + return ((InternalEList) (InternalEList) getOptionalOutputRefs()).basicAdd(otherEnd, + msgs); + case Bpmn2Package.OUTPUT_SET__WHILE_EXECUTING_OUTPUT_REFS: + return ((InternalEList) (InternalEList) getWhileExecutingOutputRefs()) + .basicAdd(otherEnd, msgs); + case Bpmn2Package.OUTPUT_SET__INPUT_SET_REFS: + return ((InternalEList) (InternalEList) getInputSetRefs()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.OUTPUT_SET__DATA_OUTPUT_REFS: + return ((InternalEList) getDataOutputRefs()).basicRemove(otherEnd, msgs); + case Bpmn2Package.OUTPUT_SET__OPTIONAL_OUTPUT_REFS: + return ((InternalEList) getOptionalOutputRefs()).basicRemove(otherEnd, msgs); + case Bpmn2Package.OUTPUT_SET__WHILE_EXECUTING_OUTPUT_REFS: + return ((InternalEList) getWhileExecutingOutputRefs()).basicRemove(otherEnd, msgs); + case Bpmn2Package.OUTPUT_SET__INPUT_SET_REFS: + return ((InternalEList) getInputSetRefs()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.OUTPUT_SET__DATA_OUTPUT_REFS: + return getDataOutputRefs(); + case Bpmn2Package.OUTPUT_SET__OPTIONAL_OUTPUT_REFS: + return getOptionalOutputRefs(); + case Bpmn2Package.OUTPUT_SET__WHILE_EXECUTING_OUTPUT_REFS: + return getWhileExecutingOutputRefs(); + case Bpmn2Package.OUTPUT_SET__INPUT_SET_REFS: + return getInputSetRefs(); + case Bpmn2Package.OUTPUT_SET__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.OUTPUT_SET__DATA_OUTPUT_REFS: + getDataOutputRefs().clear(); + getDataOutputRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.OUTPUT_SET__OPTIONAL_OUTPUT_REFS: + getOptionalOutputRefs().clear(); + getOptionalOutputRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.OUTPUT_SET__WHILE_EXECUTING_OUTPUT_REFS: + getWhileExecutingOutputRefs().clear(); + getWhileExecutingOutputRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.OUTPUT_SET__INPUT_SET_REFS: + getInputSetRefs().clear(); + getInputSetRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.OUTPUT_SET__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.OUTPUT_SET__DATA_OUTPUT_REFS: + getDataOutputRefs().clear(); + return; + case Bpmn2Package.OUTPUT_SET__OPTIONAL_OUTPUT_REFS: + getOptionalOutputRefs().clear(); + return; + case Bpmn2Package.OUTPUT_SET__WHILE_EXECUTING_OUTPUT_REFS: + getWhileExecutingOutputRefs().clear(); + return; + case Bpmn2Package.OUTPUT_SET__INPUT_SET_REFS: + getInputSetRefs().clear(); + return; + case Bpmn2Package.OUTPUT_SET__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.OUTPUT_SET__DATA_OUTPUT_REFS: + return dataOutputRefs != null && !dataOutputRefs.isEmpty(); + case Bpmn2Package.OUTPUT_SET__OPTIONAL_OUTPUT_REFS: + return optionalOutputRefs != null && !optionalOutputRefs.isEmpty(); + case Bpmn2Package.OUTPUT_SET__WHILE_EXECUTING_OUTPUT_REFS: + return whileExecutingOutputRefs != null && !whileExecutingOutputRefs.isEmpty(); + case Bpmn2Package.OUTPUT_SET__INPUT_SET_REFS: + return inputSetRefs != null && !inputSetRefs.isEmpty(); + case Bpmn2Package.OUTPUT_SET__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //OutputSetImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ParallelGatewayImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ParallelGatewayImpl.java new file mode 100644 index 00000000000..bc8358f12c2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ParallelGatewayImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ParallelGateway; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Parallel Gateway'. + * + * + * @generated + */ +public class ParallelGatewayImpl extends GatewayImpl implements ParallelGateway { + /** + * + * + * @generated + */ + protected ParallelGatewayImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.PARALLEL_GATEWAY; + } + +} //ParallelGatewayImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ParticipantAssociationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ParticipantAssociationImpl.java new file mode 100644 index 00000000000..b323ed0e607 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ParticipantAssociationImpl.java @@ -0,0 +1,246 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Participant; +import org.eclipse.bpmn2.ParticipantAssociation; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Participant Association'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ParticipantAssociationImpl#getInnerParticipantRef Inner Participant Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.ParticipantAssociationImpl#getOuterParticipantRef Outer Participant Ref}
  • + *
+ * + * @generated + */ +public class ParticipantAssociationImpl extends BaseElementImpl implements ParticipantAssociation { + /** + * The cached value of the '{@link #getInnerParticipantRef() Inner Participant Ref}' reference. + * + * + * @see #getInnerParticipantRef() + * @generated + * @ordered + */ + @GwtTransient + protected Participant innerParticipantRef; + + /** + * The cached value of the '{@link #getOuterParticipantRef() Outer Participant Ref}' reference. + * + * + * @see #getOuterParticipantRef() + * @generated + * @ordered + */ + @GwtTransient + protected Participant outerParticipantRef; + + /** + * + * + * @generated + */ + protected ParticipantAssociationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.PARTICIPANT_ASSOCIATION; + } + + /** + * + * + * @generated + */ + @Override + public Participant getInnerParticipantRef() { + if (innerParticipantRef != null && innerParticipantRef.eIsProxy()) { + InternalEObject oldInnerParticipantRef = (InternalEObject) innerParticipantRef; + innerParticipantRef = (Participant) eResolveProxy(oldInnerParticipantRef); + if (innerParticipantRef != oldInnerParticipantRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF, oldInnerParticipantRef, + innerParticipantRef)); + } + } + return innerParticipantRef; + } + + /** + * + * + * @generated + */ + public Participant basicGetInnerParticipantRef() { + return innerParticipantRef; + } + + /** + * + * + * @generated + */ + @Override + public void setInnerParticipantRef(Participant newInnerParticipantRef) { + Participant oldInnerParticipantRef = innerParticipantRef; + innerParticipantRef = newInnerParticipantRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF, oldInnerParticipantRef, + innerParticipantRef)); + } + + /** + * + * + * @generated + */ + @Override + public Participant getOuterParticipantRef() { + if (outerParticipantRef != null && outerParticipantRef.eIsProxy()) { + InternalEObject oldOuterParticipantRef = (InternalEObject) outerParticipantRef; + outerParticipantRef = (Participant) eResolveProxy(oldOuterParticipantRef); + if (outerParticipantRef != oldOuterParticipantRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF, oldOuterParticipantRef, + outerParticipantRef)); + } + } + return outerParticipantRef; + } + + /** + * + * + * @generated + */ + public Participant basicGetOuterParticipantRef() { + return outerParticipantRef; + } + + /** + * + * + * @generated + */ + @Override + public void setOuterParticipantRef(Participant newOuterParticipantRef) { + Participant oldOuterParticipantRef = outerParticipantRef; + outerParticipantRef = newOuterParticipantRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF, oldOuterParticipantRef, + outerParticipantRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF: + if (resolve) + return getInnerParticipantRef(); + return basicGetInnerParticipantRef(); + case Bpmn2Package.PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF: + if (resolve) + return getOuterParticipantRef(); + return basicGetOuterParticipantRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF: + setInnerParticipantRef((Participant) newValue); + return; + case Bpmn2Package.PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF: + setOuterParticipantRef((Participant) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF: + setInnerParticipantRef((Participant) null); + return; + case Bpmn2Package.PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF: + setOuterParticipantRef((Participant) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF: + return innerParticipantRef != null; + case Bpmn2Package.PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF: + return outerParticipantRef != null; + } + return super.eIsSet(featureID); + } + +} //ParticipantAssociationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ParticipantImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ParticipantImpl.java new file mode 100644 index 00000000000..9804349e263 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ParticipantImpl.java @@ -0,0 +1,502 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ConversationLink; +import org.eclipse.bpmn2.EndPoint; +import org.eclipse.bpmn2.InteractionNode; +import org.eclipse.bpmn2.Interface; +import org.eclipse.bpmn2.Participant; +import org.eclipse.bpmn2.ParticipantMultiplicity; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'Participant'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ParticipantImpl#getIncomingConversationLinks Incoming Conversation Links}
  • + *
  • {@link org.eclipse.bpmn2.impl.ParticipantImpl#getOutgoingConversationLinks Outgoing Conversation Links}
  • + *
  • {@link org.eclipse.bpmn2.impl.ParticipantImpl#getInterfaceRefs Interface Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.ParticipantImpl#getEndPointRefs End Point Refs}
  • + *
  • {@link org.eclipse.bpmn2.impl.ParticipantImpl#getParticipantMultiplicity Participant Multiplicity}
  • + *
  • {@link org.eclipse.bpmn2.impl.ParticipantImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.ParticipantImpl#getProcessRef Process Ref}
  • + *
+ * + * @generated + */ +public class ParticipantImpl extends BaseElementImpl implements Participant { + /** + * The cached value of the '{@link #getInterfaceRefs() Interface Refs}' reference list. + * + * + * @see #getInterfaceRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList interfaceRefs; + + /** + * The cached value of the '{@link #getEndPointRefs() End Point Refs}' reference list. + * + * + * @see #getEndPointRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList endPointRefs; + + /** + * The cached value of the '{@link #getParticipantMultiplicity() Participant Multiplicity}' containment reference. + * + * + * @see #getParticipantMultiplicity() + * @generated + * @ordered + */ + @GwtTransient + protected ParticipantMultiplicity participantMultiplicity; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getProcessRef() Process Ref}' reference. + * + * + * @see #getProcessRef() + * @generated + * @ordered + */ + @GwtTransient + protected org.eclipse.bpmn2.Process processRef; + + /** + * + * + * @generated + */ + protected ParticipantImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.PARTICIPANT; + } + + /** + * + * + * @generated + */ + @Override + public EList getIncomingConversationLinks() { + // TODO: implement this method to return the 'Incoming Conversation Links' reference list + // Ensure that you remove @generated or mark it @generated NOT + // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting + // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public EList getOutgoingConversationLinks() { + // TODO: implement this method to return the 'Outgoing Conversation Links' reference list + // Ensure that you remove @generated or mark it @generated NOT + // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting + // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public EList getInterfaceRefs() { + if (interfaceRefs == null) { + interfaceRefs = new EObjectResolvingEList(Interface.class, this, + Bpmn2Package.PARTICIPANT__INTERFACE_REFS); + } + return interfaceRefs; + } + + /** + * + * + * @generated + */ + @Override + public EList getEndPointRefs() { + if (endPointRefs == null) { + endPointRefs = new EObjectResolvingEList(EndPoint.class, this, + Bpmn2Package.PARTICIPANT__END_POINT_REFS); + } + return endPointRefs; + } + + /** + * + * + * @generated + */ + @Override + public ParticipantMultiplicity getParticipantMultiplicity() { + return participantMultiplicity; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetParticipantMultiplicity(ParticipantMultiplicity newParticipantMultiplicity, + NotificationChain msgs) { + ParticipantMultiplicity oldParticipantMultiplicity = participantMultiplicity; + participantMultiplicity = newParticipantMultiplicity; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY, oldParticipantMultiplicity, + newParticipantMultiplicity); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setParticipantMultiplicity(ParticipantMultiplicity newParticipantMultiplicity) { + if (newParticipantMultiplicity != participantMultiplicity) { + NotificationChain msgs = null; + if (participantMultiplicity != null) + msgs = ((InternalEObject) participantMultiplicity).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY, null, msgs); + if (newParticipantMultiplicity != null) + msgs = ((InternalEObject) newParticipantMultiplicity).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY, null, msgs); + msgs = basicSetParticipantMultiplicity(newParticipantMultiplicity, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY, + newParticipantMultiplicity, newParticipantMultiplicity)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PARTICIPANT__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.bpmn2.Process getProcessRef() { + if (processRef != null && processRef.eIsProxy()) { + InternalEObject oldProcessRef = (InternalEObject) processRef; + processRef = (org.eclipse.bpmn2.Process) eResolveProxy(oldProcessRef); + if (processRef != oldProcessRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.PARTICIPANT__PROCESS_REF, + oldProcessRef, processRef)); + } + } + return processRef; + } + + /** + * + * + * @generated + */ + public org.eclipse.bpmn2.Process basicGetProcessRef() { + return processRef; + } + + /** + * + * + * @generated + */ + @Override + public void setProcessRef(org.eclipse.bpmn2.Process newProcessRef) { + org.eclipse.bpmn2.Process oldProcessRef = processRef; + processRef = newProcessRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PARTICIPANT__PROCESS_REF, oldProcessRef, + processRef)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY: + return basicSetParticipantMultiplicity(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.PARTICIPANT__INCOMING_CONVERSATION_LINKS: + return getIncomingConversationLinks(); + case Bpmn2Package.PARTICIPANT__OUTGOING_CONVERSATION_LINKS: + return getOutgoingConversationLinks(); + case Bpmn2Package.PARTICIPANT__INTERFACE_REFS: + return getInterfaceRefs(); + case Bpmn2Package.PARTICIPANT__END_POINT_REFS: + return getEndPointRefs(); + case Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY: + return getParticipantMultiplicity(); + case Bpmn2Package.PARTICIPANT__NAME: + return getName(); + case Bpmn2Package.PARTICIPANT__PROCESS_REF: + if (resolve) + return getProcessRef(); + return basicGetProcessRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.PARTICIPANT__INTERFACE_REFS: + getInterfaceRefs().clear(); + getInterfaceRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.PARTICIPANT__END_POINT_REFS: + getEndPointRefs().clear(); + getEndPointRefs().addAll((Collection) newValue); + return; + case Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY: + setParticipantMultiplicity((ParticipantMultiplicity) newValue); + return; + case Bpmn2Package.PARTICIPANT__NAME: + setName((String) newValue); + return; + case Bpmn2Package.PARTICIPANT__PROCESS_REF: + setProcessRef((org.eclipse.bpmn2.Process) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.PARTICIPANT__INTERFACE_REFS: + getInterfaceRefs().clear(); + return; + case Bpmn2Package.PARTICIPANT__END_POINT_REFS: + getEndPointRefs().clear(); + return; + case Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY: + setParticipantMultiplicity((ParticipantMultiplicity) null); + return; + case Bpmn2Package.PARTICIPANT__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.PARTICIPANT__PROCESS_REF: + setProcessRef((org.eclipse.bpmn2.Process) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.PARTICIPANT__INCOMING_CONVERSATION_LINKS: + return !getIncomingConversationLinks().isEmpty(); + case Bpmn2Package.PARTICIPANT__OUTGOING_CONVERSATION_LINKS: + return !getOutgoingConversationLinks().isEmpty(); + case Bpmn2Package.PARTICIPANT__INTERFACE_REFS: + return interfaceRefs != null && !interfaceRefs.isEmpty(); + case Bpmn2Package.PARTICIPANT__END_POINT_REFS: + return endPointRefs != null && !endPointRefs.isEmpty(); + case Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY: + return participantMultiplicity != null; + case Bpmn2Package.PARTICIPANT__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.PARTICIPANT__PROCESS_REF: + return processRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == InteractionNode.class) { + switch (derivedFeatureID) { + case Bpmn2Package.PARTICIPANT__INCOMING_CONVERSATION_LINKS: + return Bpmn2Package.INTERACTION_NODE__INCOMING_CONVERSATION_LINKS; + case Bpmn2Package.PARTICIPANT__OUTGOING_CONVERSATION_LINKS: + return Bpmn2Package.INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == InteractionNode.class) { + switch (baseFeatureID) { + case Bpmn2Package.INTERACTION_NODE__INCOMING_CONVERSATION_LINKS: + return Bpmn2Package.PARTICIPANT__INCOMING_CONVERSATION_LINKS; + case Bpmn2Package.INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS: + return Bpmn2Package.PARTICIPANT__OUTGOING_CONVERSATION_LINKS; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //ParticipantImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ParticipantMultiplicityImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ParticipantMultiplicityImpl.java new file mode 100644 index 00000000000..eecc7ecf116 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ParticipantMultiplicityImpl.java @@ -0,0 +1,239 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ParticipantMultiplicity; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Participant Multiplicity'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ParticipantMultiplicityImpl#getMaximum Maximum}
  • + *
  • {@link org.eclipse.bpmn2.impl.ParticipantMultiplicityImpl#getMinimum Minimum}
  • + *
+ * + * @generated + */ +public class ParticipantMultiplicityImpl extends BaseElementImpl implements ParticipantMultiplicity { + /** + * The default value of the '{@link #getMaximum() Maximum}' attribute. + * + * + * @see #getMaximum() + * @generated + * @ordered + */ + protected static final int MAXIMUM_EDEFAULT = 1; + + /** + * The cached value of the '{@link #getMaximum() Maximum}' attribute. + * + * + * @see #getMaximum() + * @generated + * @ordered + */ + @GwtTransient + protected int maximum = MAXIMUM_EDEFAULT; + + /** + * The default value of the '{@link #getMinimum() Minimum}' attribute. + * + * + * @see #getMinimum() + * @generated + * @ordered + */ + protected static final int MINIMUM_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getMinimum() Minimum}' attribute. + * + * + * @see #getMinimum() + * @generated + * @ordered + */ + @GwtTransient + protected int minimum = MINIMUM_EDEFAULT; + + /** + * + * + * @generated + */ + protected ParticipantMultiplicityImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.PARTICIPANT_MULTIPLICITY; + } + + /** + * + * + * @generated + */ + @Override + public int getMaximum() { + return maximum; + } + + /** + * + * + * @generated + */ + @Override + public void setMaximum(int newMaximum) { + int oldMaximum = maximum; + maximum = newMaximum; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PARTICIPANT_MULTIPLICITY__MAXIMUM, + oldMaximum, maximum)); + } + + /** + * + * + * @generated + */ + @Override + public int getMinimum() { + return minimum; + } + + /** + * + * + * @generated + */ + @Override + public void setMinimum(int newMinimum) { + int oldMinimum = minimum; + minimum = newMinimum; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PARTICIPANT_MULTIPLICITY__MINIMUM, + oldMinimum, minimum)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MAXIMUM: + return getMaximum(); + case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MINIMUM: + return getMinimum(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MAXIMUM: + setMaximum((Integer) newValue); + return; + case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MINIMUM: + setMinimum((Integer) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MAXIMUM: + setMaximum(MAXIMUM_EDEFAULT); + return; + case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MINIMUM: + setMinimum(MINIMUM_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MAXIMUM: + return maximum != MAXIMUM_EDEFAULT; + case Bpmn2Package.PARTICIPANT_MULTIPLICITY__MINIMUM: + return minimum != MINIMUM_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (maximum: "); + result.append(maximum); + result.append(", minimum: "); + result.append(minimum); + result.append(')'); + return result.toString(); + } + +} //ParticipantMultiplicityImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PartnerEntityImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PartnerEntityImpl.java new file mode 100644 index 00000000000..be01fe6d90d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PartnerEntityImpl.java @@ -0,0 +1,225 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Participant; +import org.eclipse.bpmn2.PartnerEntity; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'Partner Entity'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.PartnerEntityImpl#getParticipantRef Participant Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.PartnerEntityImpl#getName Name}
  • + *
+ * + * @generated + */ +public class PartnerEntityImpl extends RootElementImpl implements PartnerEntity { + /** + * The cached value of the '{@link #getParticipantRef() Participant Ref}' reference list. + * + * + * @see #getParticipantRef() + * @generated + * @ordered + */ + @GwtTransient + protected EList participantRef; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected PartnerEntityImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.PARTNER_ENTITY; + } + + /** + * + * + * @generated + */ + @Override + public EList getParticipantRef() { + if (participantRef == null) { + participantRef = new EObjectResolvingEList(Participant.class, this, + Bpmn2Package.PARTNER_ENTITY__PARTICIPANT_REF); + } + return participantRef; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PARTNER_ENTITY__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.PARTNER_ENTITY__PARTICIPANT_REF: + return getParticipantRef(); + case Bpmn2Package.PARTNER_ENTITY__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.PARTNER_ENTITY__PARTICIPANT_REF: + getParticipantRef().clear(); + getParticipantRef().addAll((Collection) newValue); + return; + case Bpmn2Package.PARTNER_ENTITY__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.PARTNER_ENTITY__PARTICIPANT_REF: + getParticipantRef().clear(); + return; + case Bpmn2Package.PARTNER_ENTITY__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.PARTNER_ENTITY__PARTICIPANT_REF: + return participantRef != null && !participantRef.isEmpty(); + case Bpmn2Package.PARTNER_ENTITY__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //PartnerEntityImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PartnerRoleImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PartnerRoleImpl.java new file mode 100644 index 00000000000..5e24f3a7efa --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PartnerRoleImpl.java @@ -0,0 +1,225 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Participant; +import org.eclipse.bpmn2.PartnerRole; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'Partner Role'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.PartnerRoleImpl#getParticipantRef Participant Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.PartnerRoleImpl#getName Name}
  • + *
+ * + * @generated + */ +public class PartnerRoleImpl extends RootElementImpl implements PartnerRole { + /** + * The cached value of the '{@link #getParticipantRef() Participant Ref}' reference list. + * + * + * @see #getParticipantRef() + * @generated + * @ordered + */ + @GwtTransient + protected EList participantRef; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected PartnerRoleImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.PARTNER_ROLE; + } + + /** + * + * + * @generated + */ + @Override + public EList getParticipantRef() { + if (participantRef == null) { + participantRef = new EObjectResolvingEList(Participant.class, this, + Bpmn2Package.PARTNER_ROLE__PARTICIPANT_REF); + } + return participantRef; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PARTNER_ROLE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.PARTNER_ROLE__PARTICIPANT_REF: + return getParticipantRef(); + case Bpmn2Package.PARTNER_ROLE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.PARTNER_ROLE__PARTICIPANT_REF: + getParticipantRef().clear(); + getParticipantRef().addAll((Collection) newValue); + return; + case Bpmn2Package.PARTNER_ROLE__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.PARTNER_ROLE__PARTICIPANT_REF: + getParticipantRef().clear(); + return; + case Bpmn2Package.PARTNER_ROLE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.PARTNER_ROLE__PARTICIPANT_REF: + return participantRef != null && !participantRef.isEmpty(); + case Bpmn2Package.PARTNER_ROLE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //PartnerRoleImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PerformerImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PerformerImpl.java new file mode 100644 index 00000000000..b93c16a69b1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PerformerImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Performer; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Performer'. + * + * + * @generated + */ +public class PerformerImpl extends ResourceRoleImpl implements Performer { + /** + * + * + * @generated + */ + protected PerformerImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.PERFORMER; + } + +} //PerformerImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PotentialOwnerImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PotentialOwnerImpl.java new file mode 100644 index 00000000000..f44223428d9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PotentialOwnerImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.PotentialOwner; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Potential Owner'. + * + * + * @generated + */ +public class PotentialOwnerImpl extends HumanPerformerImpl implements PotentialOwner { + /** + * + * + * @generated + */ + protected PotentialOwnerImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.POTENTIAL_OWNER; + } + +} //PotentialOwnerImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ProcessImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ProcessImpl.java new file mode 100644 index 00000000000..b3c0d32e126 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ProcessImpl.java @@ -0,0 +1,857 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Artifact; +import org.eclipse.bpmn2.Auditing; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Collaboration; +import org.eclipse.bpmn2.CorrelationSubscription; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.FlowElementsContainer; +import org.eclipse.bpmn2.LaneSet; +import org.eclipse.bpmn2.Monitoring; +import org.eclipse.bpmn2.ProcessType; +import org.eclipse.bpmn2.Property; +import org.eclipse.bpmn2.ResourceRole; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Process'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getLaneSets Lane Sets}
  • + *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getFlowElements Flow Elements}
  • + *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getAuditing Auditing}
  • + *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getMonitoring Monitoring}
  • + *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getProperties Properties}
  • + *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getArtifacts Artifacts}
  • + *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getResources Resources}
  • + *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getCorrelationSubscriptions Correlation Subscriptions}
  • + *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getSupports Supports}
  • + *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getDefinitionalCollaborationRef Definitional Collaboration Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#isIsClosed Is Closed}
  • + *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#isIsExecutable Is Executable}
  • + *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getProcessType Process Type}
  • + *
+ * + * @generated + */ +public class ProcessImpl extends CallableElementImpl implements org.eclipse.bpmn2.Process { + /** + * The cached value of the '{@link #getLaneSets() Lane Sets}' containment reference list. + * + * + * @see #getLaneSets() + * @generated + * @ordered + */ + @GwtTransient + protected EList laneSets; + + /** + * The cached value of the '{@link #getFlowElements() Flow Elements}' containment reference list. + * + * + * @see #getFlowElements() + * @generated + * @ordered + */ + @GwtTransient + protected EList flowElements; + + /** + * The cached value of the '{@link #getAuditing() Auditing}' containment reference. + * + * + * @see #getAuditing() + * @generated + * @ordered + */ + @GwtTransient + protected Auditing auditing; + + /** + * The cached value of the '{@link #getMonitoring() Monitoring}' containment reference. + * + * + * @see #getMonitoring() + * @generated + * @ordered + */ + @GwtTransient + protected Monitoring monitoring; + + /** + * The cached value of the '{@link #getProperties() Properties}' containment reference list. + * + * + * @see #getProperties() + * @generated + * @ordered + */ + @GwtTransient + protected EList properties; + + /** + * The cached value of the '{@link #getArtifacts() Artifacts}' containment reference list. + * + * + * @see #getArtifacts() + * @generated + * @ordered + */ + @GwtTransient + protected EList artifacts; + + /** + * The cached value of the '{@link #getResources() Resources}' containment reference list. + * + * + * @see #getResources() + * @generated + * @ordered + */ + @GwtTransient + protected EList resources; + + /** + * The cached value of the '{@link #getCorrelationSubscriptions() Correlation Subscriptions}' containment reference list. + * + * + * @see #getCorrelationSubscriptions() + * @generated + * @ordered + */ + @GwtTransient + protected EList correlationSubscriptions; + + /** + * The cached value of the '{@link #getSupports() Supports}' reference list. + * + * + * @see #getSupports() + * @generated + * @ordered + */ + @GwtTransient + protected EList supports; + + /** + * The cached value of the '{@link #getDefinitionalCollaborationRef() Definitional Collaboration Ref}' reference. + * + * + * @see #getDefinitionalCollaborationRef() + * @generated + * @ordered + */ + @GwtTransient + protected Collaboration definitionalCollaborationRef; + + /** + * The default value of the '{@link #isIsClosed() Is Closed}' attribute. + * + * + * @see #isIsClosed() + * @generated + * @ordered + */ + protected static final boolean IS_CLOSED_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsClosed() Is Closed}' attribute. + * + * + * @see #isIsClosed() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isClosed = IS_CLOSED_EDEFAULT; + + /** + * The default value of the '{@link #isIsExecutable() Is Executable}' attribute. + * + * + * @see #isIsExecutable() + * @generated + * @ordered + */ + protected static final boolean IS_EXECUTABLE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsExecutable() Is Executable}' attribute. + * + * + * @see #isIsExecutable() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isExecutable = IS_EXECUTABLE_EDEFAULT; + + /** + * The default value of the '{@link #getProcessType() Process Type}' attribute. + * + * + * @see #getProcessType() + * @generated + * @ordered + */ + protected static final ProcessType PROCESS_TYPE_EDEFAULT = ProcessType.NONE; + + /** + * The cached value of the '{@link #getProcessType() Process Type}' attribute. + * + * + * @see #getProcessType() + * @generated + * @ordered + */ + @GwtTransient + protected ProcessType processType = PROCESS_TYPE_EDEFAULT; + + /** + * + * + * @generated + */ + protected ProcessImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.PROCESS; + } + + /** + * + * + * @generated + */ + @Override + public EList getLaneSets() { + if (laneSets == null) { + laneSets = new EObjectContainmentEList(LaneSet.class, this, Bpmn2Package.PROCESS__LANE_SETS); + } + return laneSets; + } + + /** + * + * + * @generated + */ + @Override + public EList getFlowElements() { + if (flowElements == null) { + flowElements = new EObjectContainmentEList(FlowElement.class, this, + Bpmn2Package.PROCESS__FLOW_ELEMENTS); + } + return flowElements; + } + + /** + * + * + * @generated + */ + @Override + public Auditing getAuditing() { + return auditing; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetAuditing(Auditing newAuditing, NotificationChain msgs) { + Auditing oldAuditing = auditing; + auditing = newAuditing; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.PROCESS__AUDITING, oldAuditing, newAuditing); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setAuditing(Auditing newAuditing) { + if (newAuditing != auditing) { + NotificationChain msgs = null; + if (auditing != null) + msgs = ((InternalEObject) auditing).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.PROCESS__AUDITING, null, msgs); + if (newAuditing != null) + msgs = ((InternalEObject) newAuditing).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.PROCESS__AUDITING, null, msgs); + msgs = basicSetAuditing(newAuditing, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROCESS__AUDITING, newAuditing, + newAuditing)); + } + + /** + * + * + * @generated + */ + @Override + public Monitoring getMonitoring() { + return monitoring; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetMonitoring(Monitoring newMonitoring, NotificationChain msgs) { + Monitoring oldMonitoring = monitoring; + monitoring = newMonitoring; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.PROCESS__MONITORING, oldMonitoring, newMonitoring); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setMonitoring(Monitoring newMonitoring) { + if (newMonitoring != monitoring) { + NotificationChain msgs = null; + if (monitoring != null) + msgs = ((InternalEObject) monitoring).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.PROCESS__MONITORING, null, msgs); + if (newMonitoring != null) + msgs = ((InternalEObject) newMonitoring).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.PROCESS__MONITORING, null, msgs); + msgs = basicSetMonitoring(newMonitoring, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROCESS__MONITORING, newMonitoring, + newMonitoring)); + } + + /** + * + * + * @generated + */ + @Override + public EList getProperties() { + if (properties == null) { + properties = new EObjectContainmentEList(Property.class, this, Bpmn2Package.PROCESS__PROPERTIES); + } + return properties; + } + + /** + * + * + * @generated + */ + @Override + public EList getArtifacts() { + if (artifacts == null) { + artifacts = new EObjectContainmentEList(Artifact.class, this, Bpmn2Package.PROCESS__ARTIFACTS); + } + return artifacts; + } + + /** + * + * + * @generated + */ + @Override + public EList getResources() { + if (resources == null) { + resources = new EObjectContainmentEList(ResourceRole.class, this, + Bpmn2Package.PROCESS__RESOURCES); + } + return resources; + } + + /** + * + * + * @generated + */ + @Override + public EList getCorrelationSubscriptions() { + if (correlationSubscriptions == null) { + correlationSubscriptions = new EObjectContainmentEList( + CorrelationSubscription.class, this, Bpmn2Package.PROCESS__CORRELATION_SUBSCRIPTIONS); + } + return correlationSubscriptions; + } + + /** + * + * + * @generated + */ + @Override + public EList getSupports() { + if (supports == null) { + supports = new EObjectResolvingEList(org.eclipse.bpmn2.Process.class, this, + Bpmn2Package.PROCESS__SUPPORTS); + } + return supports; + } + + /** + * + * + * @generated + */ + @Override + public Collaboration getDefinitionalCollaborationRef() { + if (definitionalCollaborationRef != null && definitionalCollaborationRef.eIsProxy()) { + InternalEObject oldDefinitionalCollaborationRef = (InternalEObject) definitionalCollaborationRef; + definitionalCollaborationRef = (Collaboration) eResolveProxy(oldDefinitionalCollaborationRef); + if (definitionalCollaborationRef != oldDefinitionalCollaborationRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.PROCESS__DEFINITIONAL_COLLABORATION_REF, oldDefinitionalCollaborationRef, + definitionalCollaborationRef)); + } + } + return definitionalCollaborationRef; + } + + /** + * + * + * @generated + */ + public Collaboration basicGetDefinitionalCollaborationRef() { + return definitionalCollaborationRef; + } + + /** + * + * + * @generated + */ + @Override + public void setDefinitionalCollaborationRef(Collaboration newDefinitionalCollaborationRef) { + Collaboration oldDefinitionalCollaborationRef = definitionalCollaborationRef; + definitionalCollaborationRef = newDefinitionalCollaborationRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROCESS__DEFINITIONAL_COLLABORATION_REF, + oldDefinitionalCollaborationRef, definitionalCollaborationRef)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsClosed() { + return isClosed; + } + + /** + * + * + * @generated + */ + @Override + public void setIsClosed(boolean newIsClosed) { + boolean oldIsClosed = isClosed; + isClosed = newIsClosed; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROCESS__IS_CLOSED, oldIsClosed, + isClosed)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsExecutable() { + return isExecutable; + } + + /** + * + * + * @generated + */ + @Override + public void setIsExecutable(boolean newIsExecutable) { + boolean oldIsExecutable = isExecutable; + isExecutable = newIsExecutable; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROCESS__IS_EXECUTABLE, oldIsExecutable, + isExecutable)); + } + + /** + * + * + * @generated + */ + @Override + public ProcessType getProcessType() { + return processType; + } + + /** + * + * + * @generated + */ + @Override + public void setProcessType(ProcessType newProcessType) { + ProcessType oldProcessType = processType; + processType = newProcessType == null ? PROCESS_TYPE_EDEFAULT : newProcessType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROCESS__PROCESS_TYPE, oldProcessType, + processType)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.PROCESS__LANE_SETS: + return ((InternalEList) getLaneSets()).basicRemove(otherEnd, msgs); + case Bpmn2Package.PROCESS__FLOW_ELEMENTS: + return ((InternalEList) getFlowElements()).basicRemove(otherEnd, msgs); + case Bpmn2Package.PROCESS__AUDITING: + return basicSetAuditing(null, msgs); + case Bpmn2Package.PROCESS__MONITORING: + return basicSetMonitoring(null, msgs); + case Bpmn2Package.PROCESS__PROPERTIES: + return ((InternalEList) getProperties()).basicRemove(otherEnd, msgs); + case Bpmn2Package.PROCESS__ARTIFACTS: + return ((InternalEList) getArtifacts()).basicRemove(otherEnd, msgs); + case Bpmn2Package.PROCESS__RESOURCES: + return ((InternalEList) getResources()).basicRemove(otherEnd, msgs); + case Bpmn2Package.PROCESS__CORRELATION_SUBSCRIPTIONS: + return ((InternalEList) getCorrelationSubscriptions()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.PROCESS__LANE_SETS: + return getLaneSets(); + case Bpmn2Package.PROCESS__FLOW_ELEMENTS: + return getFlowElements(); + case Bpmn2Package.PROCESS__AUDITING: + return getAuditing(); + case Bpmn2Package.PROCESS__MONITORING: + return getMonitoring(); + case Bpmn2Package.PROCESS__PROPERTIES: + return getProperties(); + case Bpmn2Package.PROCESS__ARTIFACTS: + return getArtifacts(); + case Bpmn2Package.PROCESS__RESOURCES: + return getResources(); + case Bpmn2Package.PROCESS__CORRELATION_SUBSCRIPTIONS: + return getCorrelationSubscriptions(); + case Bpmn2Package.PROCESS__SUPPORTS: + return getSupports(); + case Bpmn2Package.PROCESS__DEFINITIONAL_COLLABORATION_REF: + if (resolve) + return getDefinitionalCollaborationRef(); + return basicGetDefinitionalCollaborationRef(); + case Bpmn2Package.PROCESS__IS_CLOSED: + return isIsClosed(); + case Bpmn2Package.PROCESS__IS_EXECUTABLE: + return isIsExecutable(); + case Bpmn2Package.PROCESS__PROCESS_TYPE: + return getProcessType(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.PROCESS__LANE_SETS: + getLaneSets().clear(); + getLaneSets().addAll((Collection) newValue); + return; + case Bpmn2Package.PROCESS__FLOW_ELEMENTS: + getFlowElements().clear(); + getFlowElements().addAll((Collection) newValue); + return; + case Bpmn2Package.PROCESS__AUDITING: + setAuditing((Auditing) newValue); + return; + case Bpmn2Package.PROCESS__MONITORING: + setMonitoring((Monitoring) newValue); + return; + case Bpmn2Package.PROCESS__PROPERTIES: + getProperties().clear(); + getProperties().addAll((Collection) newValue); + return; + case Bpmn2Package.PROCESS__ARTIFACTS: + getArtifacts().clear(); + getArtifacts().addAll((Collection) newValue); + return; + case Bpmn2Package.PROCESS__RESOURCES: + getResources().clear(); + getResources().addAll((Collection) newValue); + return; + case Bpmn2Package.PROCESS__CORRELATION_SUBSCRIPTIONS: + getCorrelationSubscriptions().clear(); + getCorrelationSubscriptions().addAll((Collection) newValue); + return; + case Bpmn2Package.PROCESS__SUPPORTS: + getSupports().clear(); + getSupports().addAll((Collection) newValue); + return; + case Bpmn2Package.PROCESS__DEFINITIONAL_COLLABORATION_REF: + setDefinitionalCollaborationRef((Collaboration) newValue); + return; + case Bpmn2Package.PROCESS__IS_CLOSED: + setIsClosed((Boolean) newValue); + return; + case Bpmn2Package.PROCESS__IS_EXECUTABLE: + setIsExecutable((Boolean) newValue); + return; + case Bpmn2Package.PROCESS__PROCESS_TYPE: + setProcessType((ProcessType) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.PROCESS__LANE_SETS: + getLaneSets().clear(); + return; + case Bpmn2Package.PROCESS__FLOW_ELEMENTS: + getFlowElements().clear(); + return; + case Bpmn2Package.PROCESS__AUDITING: + setAuditing((Auditing) null); + return; + case Bpmn2Package.PROCESS__MONITORING: + setMonitoring((Monitoring) null); + return; + case Bpmn2Package.PROCESS__PROPERTIES: + getProperties().clear(); + return; + case Bpmn2Package.PROCESS__ARTIFACTS: + getArtifacts().clear(); + return; + case Bpmn2Package.PROCESS__RESOURCES: + getResources().clear(); + return; + case Bpmn2Package.PROCESS__CORRELATION_SUBSCRIPTIONS: + getCorrelationSubscriptions().clear(); + return; + case Bpmn2Package.PROCESS__SUPPORTS: + getSupports().clear(); + return; + case Bpmn2Package.PROCESS__DEFINITIONAL_COLLABORATION_REF: + setDefinitionalCollaborationRef((Collaboration) null); + return; + case Bpmn2Package.PROCESS__IS_CLOSED: + setIsClosed(IS_CLOSED_EDEFAULT); + return; + case Bpmn2Package.PROCESS__IS_EXECUTABLE: + setIsExecutable(IS_EXECUTABLE_EDEFAULT); + return; + case Bpmn2Package.PROCESS__PROCESS_TYPE: + setProcessType(PROCESS_TYPE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.PROCESS__LANE_SETS: + return laneSets != null && !laneSets.isEmpty(); + case Bpmn2Package.PROCESS__FLOW_ELEMENTS: + return flowElements != null && !flowElements.isEmpty(); + case Bpmn2Package.PROCESS__AUDITING: + return auditing != null; + case Bpmn2Package.PROCESS__MONITORING: + return monitoring != null; + case Bpmn2Package.PROCESS__PROPERTIES: + return properties != null && !properties.isEmpty(); + case Bpmn2Package.PROCESS__ARTIFACTS: + return artifacts != null && !artifacts.isEmpty(); + case Bpmn2Package.PROCESS__RESOURCES: + return resources != null && !resources.isEmpty(); + case Bpmn2Package.PROCESS__CORRELATION_SUBSCRIPTIONS: + return correlationSubscriptions != null && !correlationSubscriptions.isEmpty(); + case Bpmn2Package.PROCESS__SUPPORTS: + return supports != null && !supports.isEmpty(); + case Bpmn2Package.PROCESS__DEFINITIONAL_COLLABORATION_REF: + return definitionalCollaborationRef != null; + case Bpmn2Package.PROCESS__IS_CLOSED: + return isClosed != IS_CLOSED_EDEFAULT; + case Bpmn2Package.PROCESS__IS_EXECUTABLE: + return isExecutable != IS_EXECUTABLE_EDEFAULT; + case Bpmn2Package.PROCESS__PROCESS_TYPE: + return processType != PROCESS_TYPE_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == FlowElementsContainer.class) { + switch (derivedFeatureID) { + case Bpmn2Package.PROCESS__LANE_SETS: + return Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS; + case Bpmn2Package.PROCESS__FLOW_ELEMENTS: + return Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == FlowElementsContainer.class) { + switch (baseFeatureID) { + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS: + return Bpmn2Package.PROCESS__LANE_SETS; + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS: + return Bpmn2Package.PROCESS__FLOW_ELEMENTS; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (isClosed: "); + result.append(isClosed); + result.append(", isExecutable: "); + result.append(isExecutable); + result.append(", processType: "); + result.append(processType); + result.append(')'); + return result.toString(); + } + +} //ProcessImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PropertyImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PropertyImpl.java new file mode 100644 index 00000000000..07c587f8dae --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/PropertyImpl.java @@ -0,0 +1,180 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Property; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Property'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.PropertyImpl#getName Name}
  • + *
+ * + * @generated + */ +public class PropertyImpl extends ItemAwareElementImpl implements Property { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected PropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.PROPERTY; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROPERTY__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.PROPERTY__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.PROPERTY__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.PROPERTY__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.PROPERTY__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //PropertyImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ReceiveTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ReceiveTaskImpl.java new file mode 100644 index 00000000000..9bb6e185894 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ReceiveTaskImpl.java @@ -0,0 +1,375 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.Operation; +import org.eclipse.bpmn2.ReceiveTask; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Receive Task'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ReceiveTaskImpl#getImplementation Implementation}
  • + *
  • {@link org.eclipse.bpmn2.impl.ReceiveTaskImpl#isInstantiate Instantiate}
  • + *
  • {@link org.eclipse.bpmn2.impl.ReceiveTaskImpl#getMessageRef Message Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.ReceiveTaskImpl#getOperationRef Operation Ref}
  • + *
+ * + * @generated + */ +public class ReceiveTaskImpl extends TaskImpl implements ReceiveTask { + /** + * The default value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + protected static final String IMPLEMENTATION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + @GwtTransient + protected String implementation = IMPLEMENTATION_EDEFAULT; + + /** + * The default value of the '{@link #isInstantiate() Instantiate}' attribute. + * + * + * @see #isInstantiate() + * @generated + * @ordered + */ + protected static final boolean INSTANTIATE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isInstantiate() Instantiate}' attribute. + * + * + * @see #isInstantiate() + * @generated + * @ordered + */ + @GwtTransient + protected boolean instantiate = INSTANTIATE_EDEFAULT; + + /** + * The cached value of the '{@link #getMessageRef() Message Ref}' reference. + * + * + * @see #getMessageRef() + * @generated + * @ordered + */ + @GwtTransient + protected Message messageRef; + + /** + * The cached value of the '{@link #getOperationRef() Operation Ref}' reference. + * + * + * @see #getOperationRef() + * @generated + * @ordered + */ + @GwtTransient + protected Operation operationRef; + + /** + * + * + * @generated + */ + protected ReceiveTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.RECEIVE_TASK; + } + + /** + * + * + * @generated + */ + @Override + public String getImplementation() { + return implementation; + } + + /** + * + * + * @generated + */ + @Override + public void setImplementation(String newImplementation) { + String oldImplementation = implementation; + implementation = newImplementation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RECEIVE_TASK__IMPLEMENTATION, + oldImplementation, implementation)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isInstantiate() { + return instantiate; + } + + /** + * + * + * @generated + */ + @Override + public void setInstantiate(boolean newInstantiate) { + boolean oldInstantiate = instantiate; + instantiate = newInstantiate; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RECEIVE_TASK__INSTANTIATE, + oldInstantiate, instantiate)); + } + + /** + * + * + * @generated + */ + @Override + public Message getMessageRef() { + if (messageRef != null && messageRef.eIsProxy()) { + InternalEObject oldMessageRef = (InternalEObject) messageRef; + messageRef = (Message) eResolveProxy(oldMessageRef); + if (messageRef != oldMessageRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.RECEIVE_TASK__MESSAGE_REF, + oldMessageRef, messageRef)); + } + } + return messageRef; + } + + /** + * + * + * @generated + */ + public Message basicGetMessageRef() { + return messageRef; + } + + /** + * + * + * @generated + */ + @Override + public void setMessageRef(Message newMessageRef) { + Message oldMessageRef = messageRef; + messageRef = newMessageRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RECEIVE_TASK__MESSAGE_REF, oldMessageRef, + messageRef)); + } + + /** + * + * + * @generated + */ + @Override + public Operation getOperationRef() { + if (operationRef != null && operationRef.eIsProxy()) { + InternalEObject oldOperationRef = (InternalEObject) operationRef; + operationRef = (Operation) eResolveProxy(oldOperationRef); + if (operationRef != oldOperationRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.RECEIVE_TASK__OPERATION_REF, + oldOperationRef, operationRef)); + } + } + return operationRef; + } + + /** + * + * + * @generated + */ + public Operation basicGetOperationRef() { + return operationRef; + } + + /** + * + * + * @generated + */ + @Override + public void setOperationRef(Operation newOperationRef) { + Operation oldOperationRef = operationRef; + operationRef = newOperationRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RECEIVE_TASK__OPERATION_REF, + oldOperationRef, operationRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.RECEIVE_TASK__IMPLEMENTATION: + return getImplementation(); + case Bpmn2Package.RECEIVE_TASK__INSTANTIATE: + return isInstantiate(); + case Bpmn2Package.RECEIVE_TASK__MESSAGE_REF: + if (resolve) + return getMessageRef(); + return basicGetMessageRef(); + case Bpmn2Package.RECEIVE_TASK__OPERATION_REF: + if (resolve) + return getOperationRef(); + return basicGetOperationRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.RECEIVE_TASK__IMPLEMENTATION: + setImplementation((String) newValue); + return; + case Bpmn2Package.RECEIVE_TASK__INSTANTIATE: + setInstantiate((Boolean) newValue); + return; + case Bpmn2Package.RECEIVE_TASK__MESSAGE_REF: + setMessageRef((Message) newValue); + return; + case Bpmn2Package.RECEIVE_TASK__OPERATION_REF: + setOperationRef((Operation) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.RECEIVE_TASK__IMPLEMENTATION: + setImplementation(IMPLEMENTATION_EDEFAULT); + return; + case Bpmn2Package.RECEIVE_TASK__INSTANTIATE: + setInstantiate(INSTANTIATE_EDEFAULT); + return; + case Bpmn2Package.RECEIVE_TASK__MESSAGE_REF: + setMessageRef((Message) null); + return; + case Bpmn2Package.RECEIVE_TASK__OPERATION_REF: + setOperationRef((Operation) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.RECEIVE_TASK__IMPLEMENTATION: + return IMPLEMENTATION_EDEFAULT == null ? implementation != null + : !IMPLEMENTATION_EDEFAULT.equals(implementation); + case Bpmn2Package.RECEIVE_TASK__INSTANTIATE: + return instantiate != INSTANTIATE_EDEFAULT; + case Bpmn2Package.RECEIVE_TASK__MESSAGE_REF: + return messageRef != null; + case Bpmn2Package.RECEIVE_TASK__OPERATION_REF: + return operationRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (implementation: "); + result.append(implementation); + result.append(", instantiate: "); + result.append(instantiate); + result.append(')'); + return result.toString(); + } + +} //ReceiveTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/RelationshipImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/RelationshipImpl.java new file mode 100644 index 00000000000..ba31d8dd061 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/RelationshipImpl.java @@ -0,0 +1,319 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Relationship; +import org.eclipse.bpmn2.RelationshipDirection; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'Relationship'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.RelationshipImpl#getSources Sources}
  • + *
  • {@link org.eclipse.bpmn2.impl.RelationshipImpl#getTargets Targets}
  • + *
  • {@link org.eclipse.bpmn2.impl.RelationshipImpl#getDirection Direction}
  • + *
  • {@link org.eclipse.bpmn2.impl.RelationshipImpl#getType Type}
  • + *
+ * + * @generated + */ +public class RelationshipImpl extends BaseElementImpl implements Relationship { + /** + * The cached value of the '{@link #getSources() Sources}' reference list. + * + * + * @see #getSources() + * @generated + * @ordered + */ + @GwtTransient + protected EList sources; + + /** + * The cached value of the '{@link #getTargets() Targets}' reference list. + * + * + * @see #getTargets() + * @generated + * @ordered + */ + @GwtTransient + protected EList targets; + + /** + * The default value of the '{@link #getDirection() Direction}' attribute. + * + * + * @see #getDirection() + * @generated + * @ordered + */ + protected static final RelationshipDirection DIRECTION_EDEFAULT = RelationshipDirection.NONE; + + /** + * The cached value of the '{@link #getDirection() Direction}' attribute. + * + * + * @see #getDirection() + * @generated + * @ordered + */ + @GwtTransient + protected RelationshipDirection direction = DIRECTION_EDEFAULT; + + /** + * The default value of the '{@link #getType() Type}' attribute. + * + * + * @see #getType() + * @generated + * @ordered + */ + protected static final String TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getType() Type}' attribute. + * + * + * @see #getType() + * @generated + * @ordered + */ + @GwtTransient + protected String type = TYPE_EDEFAULT; + + /** + * + * + * @generated + */ + protected RelationshipImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.RELATIONSHIP; + } + + /** + * + * + * @generated + */ + @Override + public EList getSources() { + if (sources == null) { + sources = new EObjectResolvingEList(EObject.class, this, Bpmn2Package.RELATIONSHIP__SOURCES); + } + return sources; + } + + /** + * + * + * @generated + */ + @Override + public EList getTargets() { + if (targets == null) { + targets = new EObjectResolvingEList(EObject.class, this, Bpmn2Package.RELATIONSHIP__TARGETS); + } + return targets; + } + + /** + * + * + * @generated + */ + @Override + public RelationshipDirection getDirection() { + return direction; + } + + /** + * + * + * @generated + */ + @Override + public void setDirection(RelationshipDirection newDirection) { + RelationshipDirection oldDirection = direction; + direction = newDirection == null ? DIRECTION_EDEFAULT : newDirection; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RELATIONSHIP__DIRECTION, oldDirection, + direction)); + } + + /** + * + * + * @generated + */ + @Override + public String getType() { + return type; + } + + /** + * + * + * @generated + */ + @Override + public void setType(String newType) { + String oldType = type; + type = newType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RELATIONSHIP__TYPE, oldType, type)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.RELATIONSHIP__SOURCES: + return getSources(); + case Bpmn2Package.RELATIONSHIP__TARGETS: + return getTargets(); + case Bpmn2Package.RELATIONSHIP__DIRECTION: + return getDirection(); + case Bpmn2Package.RELATIONSHIP__TYPE: + return getType(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.RELATIONSHIP__SOURCES: + getSources().clear(); + getSources().addAll((Collection) newValue); + return; + case Bpmn2Package.RELATIONSHIP__TARGETS: + getTargets().clear(); + getTargets().addAll((Collection) newValue); + return; + case Bpmn2Package.RELATIONSHIP__DIRECTION: + setDirection((RelationshipDirection) newValue); + return; + case Bpmn2Package.RELATIONSHIP__TYPE: + setType((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.RELATIONSHIP__SOURCES: + getSources().clear(); + return; + case Bpmn2Package.RELATIONSHIP__TARGETS: + getTargets().clear(); + return; + case Bpmn2Package.RELATIONSHIP__DIRECTION: + setDirection(DIRECTION_EDEFAULT); + return; + case Bpmn2Package.RELATIONSHIP__TYPE: + setType(TYPE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.RELATIONSHIP__SOURCES: + return sources != null && !sources.isEmpty(); + case Bpmn2Package.RELATIONSHIP__TARGETS: + return targets != null && !targets.isEmpty(); + case Bpmn2Package.RELATIONSHIP__DIRECTION: + return direction != DIRECTION_EDEFAULT; + case Bpmn2Package.RELATIONSHIP__TYPE: + return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (direction: "); + result.append(direction); + result.append(", type: "); + result.append(type); + result.append(')'); + return result.toString(); + } + +} //RelationshipImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/RenderingImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/RenderingImpl.java new file mode 100644 index 00000000000..340bb80a008 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/RenderingImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Rendering; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Rendering'. + * + * + * @generated + */ +public class RenderingImpl extends BaseElementImpl implements Rendering { + /** + * + * + * @generated + */ + protected RenderingImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.RENDERING; + } + +} //RenderingImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceAssignmentExpressionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceAssignmentExpressionImpl.java new file mode 100644 index 00000000000..5b4c866550b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceAssignmentExpressionImpl.java @@ -0,0 +1,199 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Expression; +import org.eclipse.bpmn2.ResourceAssignmentExpression; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Resource Assignment Expression'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ResourceAssignmentExpressionImpl#getExpression Expression}
  • + *
+ * + * @generated + */ +public class ResourceAssignmentExpressionImpl extends BaseElementImpl implements ResourceAssignmentExpression { + /** + * The cached value of the '{@link #getExpression() Expression}' containment reference. + * + * + * @see #getExpression() + * @generated + * @ordered + */ + @GwtTransient + protected Expression expression; + + /** + * + * + * @generated + */ + protected ResourceAssignmentExpressionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.RESOURCE_ASSIGNMENT_EXPRESSION; + } + + /** + * + * + * @generated + */ + @Override + public Expression getExpression() { + return expression; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetExpression(Expression newExpression, NotificationChain msgs) { + Expression oldExpression = expression; + expression = newExpression; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.RESOURCE_ASSIGNMENT_EXPRESSION__EXPRESSION, oldExpression, newExpression); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setExpression(Expression newExpression) { + if (newExpression != expression) { + NotificationChain msgs = null; + if (expression != null) + msgs = ((InternalEObject) expression).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.RESOURCE_ASSIGNMENT_EXPRESSION__EXPRESSION, null, msgs); + if (newExpression != null) + msgs = ((InternalEObject) newExpression).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.RESOURCE_ASSIGNMENT_EXPRESSION__EXPRESSION, null, msgs); + msgs = basicSetExpression(newExpression, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.RESOURCE_ASSIGNMENT_EXPRESSION__EXPRESSION, newExpression, newExpression)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.RESOURCE_ASSIGNMENT_EXPRESSION__EXPRESSION: + return basicSetExpression(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.RESOURCE_ASSIGNMENT_EXPRESSION__EXPRESSION: + return getExpression(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.RESOURCE_ASSIGNMENT_EXPRESSION__EXPRESSION: + setExpression((Expression) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.RESOURCE_ASSIGNMENT_EXPRESSION__EXPRESSION: + setExpression((Expression) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.RESOURCE_ASSIGNMENT_EXPRESSION__EXPRESSION: + return expression != null; + } + return super.eIsSet(featureID); + } + +} //ResourceAssignmentExpressionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceImpl.java new file mode 100644 index 00000000000..2750b646962 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceImpl.java @@ -0,0 +1,242 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Resource; +import org.eclipse.bpmn2.ResourceParameter; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Resource'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ResourceImpl#getResourceParameters Resource Parameters}
  • + *
  • {@link org.eclipse.bpmn2.impl.ResourceImpl#getName Name}
  • + *
+ * + * @generated + */ +public class ResourceImpl extends RootElementImpl implements Resource { + /** + * The cached value of the '{@link #getResourceParameters() Resource Parameters}' containment reference list. + * + * + * @see #getResourceParameters() + * @generated + * @ordered + */ + @GwtTransient + protected EList resourceParameters; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected ResourceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.RESOURCE; + } + + /** + * + * + * @generated + */ + @Override + public EList getResourceParameters() { + if (resourceParameters == null) { + resourceParameters = new EObjectContainmentEList(ResourceParameter.class, this, + Bpmn2Package.RESOURCE__RESOURCE_PARAMETERS); + } + return resourceParameters; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RESOURCE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.RESOURCE__RESOURCE_PARAMETERS: + return ((InternalEList) getResourceParameters()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.RESOURCE__RESOURCE_PARAMETERS: + return getResourceParameters(); + case Bpmn2Package.RESOURCE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.RESOURCE__RESOURCE_PARAMETERS: + getResourceParameters().clear(); + getResourceParameters().addAll((Collection) newValue); + return; + case Bpmn2Package.RESOURCE__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.RESOURCE__RESOURCE_PARAMETERS: + getResourceParameters().clear(); + return; + case Bpmn2Package.RESOURCE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.RESOURCE__RESOURCE_PARAMETERS: + return resourceParameters != null && !resourceParameters.isEmpty(); + case Bpmn2Package.RESOURCE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //ResourceImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceParameterBindingImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceParameterBindingImpl.java new file mode 100644 index 00000000000..ff329826311 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceParameterBindingImpl.java @@ -0,0 +1,266 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Expression; +import org.eclipse.bpmn2.ResourceParameter; +import org.eclipse.bpmn2.ResourceParameterBinding; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Resource Parameter Binding'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ResourceParameterBindingImpl#getExpression Expression}
  • + *
  • {@link org.eclipse.bpmn2.impl.ResourceParameterBindingImpl#getParameterRef Parameter Ref}
  • + *
+ * + * @generated + */ +public class ResourceParameterBindingImpl extends BaseElementImpl implements ResourceParameterBinding { + /** + * The cached value of the '{@link #getExpression() Expression}' containment reference. + * + * + * @see #getExpression() + * @generated + * @ordered + */ + @GwtTransient + protected Expression expression; + + /** + * The cached value of the '{@link #getParameterRef() Parameter Ref}' reference. + * + * + * @see #getParameterRef() + * @generated + * @ordered + */ + @GwtTransient + protected ResourceParameter parameterRef; + + /** + * + * + * @generated + */ + protected ResourceParameterBindingImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.RESOURCE_PARAMETER_BINDING; + } + + /** + * + * + * @generated + */ + @Override + public Expression getExpression() { + return expression; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetExpression(Expression newExpression, NotificationChain msgs) { + Expression oldExpression = expression; + expression = newExpression; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.RESOURCE_PARAMETER_BINDING__EXPRESSION, oldExpression, newExpression); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setExpression(Expression newExpression) { + if (newExpression != expression) { + NotificationChain msgs = null; + if (expression != null) + msgs = ((InternalEObject) expression).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.RESOURCE_PARAMETER_BINDING__EXPRESSION, null, msgs); + if (newExpression != null) + msgs = ((InternalEObject) newExpression).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.RESOURCE_PARAMETER_BINDING__EXPRESSION, null, msgs); + msgs = basicSetExpression(newExpression, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RESOURCE_PARAMETER_BINDING__EXPRESSION, + newExpression, newExpression)); + } + + /** + * + * + * @generated + */ + @Override + public ResourceParameter getParameterRef() { + if (parameterRef != null && parameterRef.eIsProxy()) { + InternalEObject oldParameterRef = (InternalEObject) parameterRef; + parameterRef = (ResourceParameter) eResolveProxy(oldParameterRef); + if (parameterRef != oldParameterRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Bpmn2Package.RESOURCE_PARAMETER_BINDING__PARAMETER_REF, oldParameterRef, parameterRef)); + } + } + return parameterRef; + } + + /** + * + * + * @generated + */ + public ResourceParameter basicGetParameterRef() { + return parameterRef; + } + + /** + * + * + * @generated + */ + @Override + public void setParameterRef(ResourceParameter newParameterRef) { + ResourceParameter oldParameterRef = parameterRef; + parameterRef = newParameterRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.RESOURCE_PARAMETER_BINDING__PARAMETER_REF, oldParameterRef, parameterRef)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.RESOURCE_PARAMETER_BINDING__EXPRESSION: + return basicSetExpression(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.RESOURCE_PARAMETER_BINDING__EXPRESSION: + return getExpression(); + case Bpmn2Package.RESOURCE_PARAMETER_BINDING__PARAMETER_REF: + if (resolve) + return getParameterRef(); + return basicGetParameterRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.RESOURCE_PARAMETER_BINDING__EXPRESSION: + setExpression((Expression) newValue); + return; + case Bpmn2Package.RESOURCE_PARAMETER_BINDING__PARAMETER_REF: + setParameterRef((ResourceParameter) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.RESOURCE_PARAMETER_BINDING__EXPRESSION: + setExpression((Expression) null); + return; + case Bpmn2Package.RESOURCE_PARAMETER_BINDING__PARAMETER_REF: + setParameterRef((ResourceParameter) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.RESOURCE_PARAMETER_BINDING__EXPRESSION: + return expression != null; + case Bpmn2Package.RESOURCE_PARAMETER_BINDING__PARAMETER_REF: + return parameterRef != null; + } + return super.eIsSet(featureID); + } + +} //ResourceParameterBindingImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceParameterImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceParameterImpl.java new file mode 100644 index 00000000000..8c7b22d3361 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceParameterImpl.java @@ -0,0 +1,307 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.ResourceParameter; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Resource Parameter'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ResourceParameterImpl#isIsRequired Is Required}
  • + *
  • {@link org.eclipse.bpmn2.impl.ResourceParameterImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.ResourceParameterImpl#getType Type}
  • + *
+ * + * @generated + */ +public class ResourceParameterImpl extends BaseElementImpl implements ResourceParameter { + /** + * The default value of the '{@link #isIsRequired() Is Required}' attribute. + * + * + * @see #isIsRequired() + * @generated + * @ordered + */ + protected static final boolean IS_REQUIRED_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsRequired() Is Required}' attribute. + * + * + * @see #isIsRequired() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isRequired = IS_REQUIRED_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getType() Type}' reference. + * + * + * @see #getType() + * @generated + * @ordered + */ + @GwtTransient + protected ItemDefinition type; + + /** + * + * + * @generated + */ + protected ResourceParameterImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.RESOURCE_PARAMETER; + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsRequired() { + return isRequired; + } + + /** + * + * + * @generated + */ + @Override + public void setIsRequired(boolean newIsRequired) { + boolean oldIsRequired = isRequired; + isRequired = newIsRequired; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RESOURCE_PARAMETER__IS_REQUIRED, + oldIsRequired, isRequired)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RESOURCE_PARAMETER__NAME, oldName, + name)); + } + + /** + * + * + * @generated + */ + @Override + public ItemDefinition getType() { + if (type != null && type.eIsProxy()) { + InternalEObject oldType = (InternalEObject) type; + type = (ItemDefinition) eResolveProxy(oldType); + if (type != oldType) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.RESOURCE_PARAMETER__TYPE, + oldType, type)); + } + } + return type; + } + + /** + * + * + * @generated + */ + public ItemDefinition basicGetType() { + return type; + } + + /** + * + * + * @generated + */ + @Override + public void setType(ItemDefinition newType) { + ItemDefinition oldType = type; + type = newType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RESOURCE_PARAMETER__TYPE, oldType, + type)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.RESOURCE_PARAMETER__IS_REQUIRED: + return isIsRequired(); + case Bpmn2Package.RESOURCE_PARAMETER__NAME: + return getName(); + case Bpmn2Package.RESOURCE_PARAMETER__TYPE: + if (resolve) + return getType(); + return basicGetType(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.RESOURCE_PARAMETER__IS_REQUIRED: + setIsRequired((Boolean) newValue); + return; + case Bpmn2Package.RESOURCE_PARAMETER__NAME: + setName((String) newValue); + return; + case Bpmn2Package.RESOURCE_PARAMETER__TYPE: + setType((ItemDefinition) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.RESOURCE_PARAMETER__IS_REQUIRED: + setIsRequired(IS_REQUIRED_EDEFAULT); + return; + case Bpmn2Package.RESOURCE_PARAMETER__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.RESOURCE_PARAMETER__TYPE: + setType((ItemDefinition) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.RESOURCE_PARAMETER__IS_REQUIRED: + return isRequired != IS_REQUIRED_EDEFAULT; + case Bpmn2Package.RESOURCE_PARAMETER__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.RESOURCE_PARAMETER__TYPE: + return type != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (isRequired: "); + result.append(isRequired); + result.append(", name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //ResourceParameterImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceRoleImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceRoleImpl.java new file mode 100644 index 00000000000..0d7f8b5c31a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ResourceRoleImpl.java @@ -0,0 +1,391 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Resource; +import org.eclipse.bpmn2.ResourceAssignmentExpression; +import org.eclipse.bpmn2.ResourceParameterBinding; +import org.eclipse.bpmn2.ResourceRole; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Resource Role'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ResourceRoleImpl#getResourceRef Resource Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.ResourceRoleImpl#getResourceParameterBindings Resource Parameter Bindings}
  • + *
  • {@link org.eclipse.bpmn2.impl.ResourceRoleImpl#getResourceAssignmentExpression Resource Assignment Expression}
  • + *
  • {@link org.eclipse.bpmn2.impl.ResourceRoleImpl#getName Name}
  • + *
+ * + * @generated + */ +public class ResourceRoleImpl extends BaseElementImpl implements ResourceRole { + /** + * The cached value of the '{@link #getResourceRef() Resource Ref}' reference. + * + * + * @see #getResourceRef() + * @generated + * @ordered + */ + @GwtTransient + protected Resource resourceRef; + + /** + * The cached value of the '{@link #getResourceParameterBindings() Resource Parameter Bindings}' containment reference list. + * + * + * @see #getResourceParameterBindings() + * @generated + * @ordered + */ + @GwtTransient + protected EList resourceParameterBindings; + + /** + * The cached value of the '{@link #getResourceAssignmentExpression() Resource Assignment Expression}' containment reference. + * + * + * @see #getResourceAssignmentExpression() + * @generated + * @ordered + */ + @GwtTransient + protected ResourceAssignmentExpression resourceAssignmentExpression; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected ResourceRoleImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.RESOURCE_ROLE; + } + + /** + * + * + * @generated + */ + @Override + public Resource getResourceRef() { + if (resourceRef != null && resourceRef.eIsProxy()) { + InternalEObject oldResourceRef = (InternalEObject) resourceRef; + resourceRef = (Resource) eResolveProxy(oldResourceRef); + if (resourceRef != oldResourceRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.RESOURCE_ROLE__RESOURCE_REF, + oldResourceRef, resourceRef)); + } + } + return resourceRef; + } + + /** + * + * + * @generated + */ + public Resource basicGetResourceRef() { + return resourceRef; + } + + /** + * + * + * @generated + */ + @Override + public void setResourceRef(Resource newResourceRef) { + Resource oldResourceRef = resourceRef; + resourceRef = newResourceRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RESOURCE_ROLE__RESOURCE_REF, + oldResourceRef, resourceRef)); + } + + /** + * + * + * @generated + */ + @Override + public EList getResourceParameterBindings() { + if (resourceParameterBindings == null) { + resourceParameterBindings = new EObjectContainmentEList( + ResourceParameterBinding.class, this, Bpmn2Package.RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS); + } + return resourceParameterBindings; + } + + /** + * + * + * @generated + */ + @Override + public ResourceAssignmentExpression getResourceAssignmentExpression() { + return resourceAssignmentExpression; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetResourceAssignmentExpression( + ResourceAssignmentExpression newResourceAssignmentExpression, NotificationChain msgs) { + ResourceAssignmentExpression oldResourceAssignmentExpression = resourceAssignmentExpression; + resourceAssignmentExpression = newResourceAssignmentExpression; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION, oldResourceAssignmentExpression, + newResourceAssignmentExpression); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setResourceAssignmentExpression(ResourceAssignmentExpression newResourceAssignmentExpression) { + if (newResourceAssignmentExpression != resourceAssignmentExpression) { + NotificationChain msgs = null; + if (resourceAssignmentExpression != null) + msgs = ((InternalEObject) resourceAssignmentExpression).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION, null, + msgs); + if (newResourceAssignmentExpression != null) + msgs = ((InternalEObject) newResourceAssignmentExpression).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION, null, + msgs); + msgs = basicSetResourceAssignmentExpression(newResourceAssignmentExpression, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION, newResourceAssignmentExpression, + newResourceAssignmentExpression)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RESOURCE_ROLE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS: + return ((InternalEList) getResourceParameterBindings()).basicRemove(otherEnd, msgs); + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION: + return basicSetResourceAssignmentExpression(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_REF: + if (resolve) + return getResourceRef(); + return basicGetResourceRef(); + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS: + return getResourceParameterBindings(); + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION: + return getResourceAssignmentExpression(); + case Bpmn2Package.RESOURCE_ROLE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_REF: + setResourceRef((Resource) newValue); + return; + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS: + getResourceParameterBindings().clear(); + getResourceParameterBindings().addAll((Collection) newValue); + return; + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION: + setResourceAssignmentExpression((ResourceAssignmentExpression) newValue); + return; + case Bpmn2Package.RESOURCE_ROLE__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_REF: + setResourceRef((Resource) null); + return; + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS: + getResourceParameterBindings().clear(); + return; + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION: + setResourceAssignmentExpression((ResourceAssignmentExpression) null); + return; + case Bpmn2Package.RESOURCE_ROLE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_REF: + return resourceRef != null; + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS: + return resourceParameterBindings != null && !resourceParameterBindings.isEmpty(); + case Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION: + return resourceAssignmentExpression != null; + case Bpmn2Package.RESOURCE_ROLE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //ResourceRoleImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/RootElementImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/RootElementImpl.java new file mode 100644 index 00000000000..dfcc5717a0c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/RootElementImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.RootElement; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Root Element'. + * + * + * @generated + */ +public class RootElementImpl extends BaseElementImpl implements RootElement { + /** + * + * + * @generated + */ + protected RootElementImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.ROOT_ELEMENT; + } + +} //RootElementImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ScriptTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ScriptTaskImpl.java new file mode 100644 index 00000000000..9a068702cde --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ScriptTaskImpl.java @@ -0,0 +1,238 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ScriptTask; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Script Task'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ScriptTaskImpl#getScript Script}
  • + *
  • {@link org.eclipse.bpmn2.impl.ScriptTaskImpl#getScriptFormat Script Format}
  • + *
+ * + * @generated + */ +public class ScriptTaskImpl extends TaskImpl implements ScriptTask { + /** + * The default value of the '{@link #getScript() Script}' attribute. + * + * + * @see #getScript() + * @generated + * @ordered + */ + protected static final String SCRIPT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getScript() Script}' attribute. + * + * + * @see #getScript() + * @generated + * @ordered + */ + @GwtTransient + protected String script = SCRIPT_EDEFAULT; + + /** + * The default value of the '{@link #getScriptFormat() Script Format}' attribute. + * + * + * @see #getScriptFormat() + * @generated + * @ordered + */ + protected static final String SCRIPT_FORMAT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getScriptFormat() Script Format}' attribute. + * + * + * @see #getScriptFormat() + * @generated + * @ordered + */ + @GwtTransient + protected String scriptFormat = SCRIPT_FORMAT_EDEFAULT; + + /** + * + * + * @generated + */ + protected ScriptTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.SCRIPT_TASK; + } + + /** + * + * + * @generated + */ + @Override + public String getScript() { + return script; + } + + /** + * + * + * @generated + */ + @Override + public void setScript(String newScript) { + String oldScript = script; + script = newScript; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SCRIPT_TASK__SCRIPT, oldScript, script)); + } + + /** + * + * + * @generated + */ + @Override + public String getScriptFormat() { + return scriptFormat; + } + + /** + * + * + * @generated + */ + @Override + public void setScriptFormat(String newScriptFormat) { + String oldScriptFormat = scriptFormat; + scriptFormat = newScriptFormat; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SCRIPT_TASK__SCRIPT_FORMAT, + oldScriptFormat, scriptFormat)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.SCRIPT_TASK__SCRIPT: + return getScript(); + case Bpmn2Package.SCRIPT_TASK__SCRIPT_FORMAT: + return getScriptFormat(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.SCRIPT_TASK__SCRIPT: + setScript((String) newValue); + return; + case Bpmn2Package.SCRIPT_TASK__SCRIPT_FORMAT: + setScriptFormat((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.SCRIPT_TASK__SCRIPT: + setScript(SCRIPT_EDEFAULT); + return; + case Bpmn2Package.SCRIPT_TASK__SCRIPT_FORMAT: + setScriptFormat(SCRIPT_FORMAT_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.SCRIPT_TASK__SCRIPT: + return SCRIPT_EDEFAULT == null ? script != null : !SCRIPT_EDEFAULT.equals(script); + case Bpmn2Package.SCRIPT_TASK__SCRIPT_FORMAT: + return SCRIPT_FORMAT_EDEFAULT == null ? scriptFormat != null : !SCRIPT_FORMAT_EDEFAULT.equals(scriptFormat); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (script: "); + result.append(script); + result.append(", scriptFormat: "); + result.append(scriptFormat); + result.append(')'); + return result.toString(); + } + +} //ScriptTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SendTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SendTaskImpl.java new file mode 100644 index 00000000000..a7236287bad --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SendTaskImpl.java @@ -0,0 +1,317 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.Operation; +import org.eclipse.bpmn2.SendTask; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Send Task'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.SendTaskImpl#getImplementation Implementation}
  • + *
  • {@link org.eclipse.bpmn2.impl.SendTaskImpl#getMessageRef Message Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.SendTaskImpl#getOperationRef Operation Ref}
  • + *
+ * + * @generated + */ +public class SendTaskImpl extends TaskImpl implements SendTask { + /** + * The default value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + protected static final String IMPLEMENTATION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + @GwtTransient + protected String implementation = IMPLEMENTATION_EDEFAULT; + + /** + * The cached value of the '{@link #getMessageRef() Message Ref}' reference. + * + * + * @see #getMessageRef() + * @generated + * @ordered + */ + @GwtTransient + protected Message messageRef; + + /** + * The cached value of the '{@link #getOperationRef() Operation Ref}' reference. + * + * + * @see #getOperationRef() + * @generated + * @ordered + */ + @GwtTransient + protected Operation operationRef; + + /** + * + * + * @generated + */ + protected SendTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.SEND_TASK; + } + + /** + * + * + * @generated + */ + @Override + public String getImplementation() { + return implementation; + } + + /** + * + * + * @generated + */ + @Override + public void setImplementation(String newImplementation) { + String oldImplementation = implementation; + implementation = newImplementation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEND_TASK__IMPLEMENTATION, + oldImplementation, implementation)); + } + + /** + * + * + * @generated + */ + @Override + public Message getMessageRef() { + if (messageRef != null && messageRef.eIsProxy()) { + InternalEObject oldMessageRef = (InternalEObject) messageRef; + messageRef = (Message) eResolveProxy(oldMessageRef); + if (messageRef != oldMessageRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.SEND_TASK__MESSAGE_REF, + oldMessageRef, messageRef)); + } + } + return messageRef; + } + + /** + * + * + * @generated + */ + public Message basicGetMessageRef() { + return messageRef; + } + + /** + * + * + * @generated + */ + @Override + public void setMessageRef(Message newMessageRef) { + Message oldMessageRef = messageRef; + messageRef = newMessageRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEND_TASK__MESSAGE_REF, oldMessageRef, + messageRef)); + } + + /** + * + * + * @generated + */ + @Override + public Operation getOperationRef() { + if (operationRef != null && operationRef.eIsProxy()) { + InternalEObject oldOperationRef = (InternalEObject) operationRef; + operationRef = (Operation) eResolveProxy(oldOperationRef); + if (operationRef != oldOperationRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.SEND_TASK__OPERATION_REF, + oldOperationRef, operationRef)); + } + } + return operationRef; + } + + /** + * + * + * @generated + */ + public Operation basicGetOperationRef() { + return operationRef; + } + + /** + * + * + * @generated + */ + @Override + public void setOperationRef(Operation newOperationRef) { + Operation oldOperationRef = operationRef; + operationRef = newOperationRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEND_TASK__OPERATION_REF, + oldOperationRef, operationRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.SEND_TASK__IMPLEMENTATION: + return getImplementation(); + case Bpmn2Package.SEND_TASK__MESSAGE_REF: + if (resolve) + return getMessageRef(); + return basicGetMessageRef(); + case Bpmn2Package.SEND_TASK__OPERATION_REF: + if (resolve) + return getOperationRef(); + return basicGetOperationRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.SEND_TASK__IMPLEMENTATION: + setImplementation((String) newValue); + return; + case Bpmn2Package.SEND_TASK__MESSAGE_REF: + setMessageRef((Message) newValue); + return; + case Bpmn2Package.SEND_TASK__OPERATION_REF: + setOperationRef((Operation) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.SEND_TASK__IMPLEMENTATION: + setImplementation(IMPLEMENTATION_EDEFAULT); + return; + case Bpmn2Package.SEND_TASK__MESSAGE_REF: + setMessageRef((Message) null); + return; + case Bpmn2Package.SEND_TASK__OPERATION_REF: + setOperationRef((Operation) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.SEND_TASK__IMPLEMENTATION: + return IMPLEMENTATION_EDEFAULT == null ? implementation != null + : !IMPLEMENTATION_EDEFAULT.equals(implementation); + case Bpmn2Package.SEND_TASK__MESSAGE_REF: + return messageRef != null; + case Bpmn2Package.SEND_TASK__OPERATION_REF: + return operationRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (implementation: "); + result.append(implementation); + result.append(')'); + return result.toString(); + } + +} //SendTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SequenceFlowImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SequenceFlowImpl.java new file mode 100644 index 00000000000..1dbfcc284dc --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SequenceFlowImpl.java @@ -0,0 +1,447 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Expression; +import org.eclipse.bpmn2.FlowNode; +import org.eclipse.bpmn2.SequenceFlow; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Sequence Flow'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.SequenceFlowImpl#getConditionExpression Condition Expression}
  • + *
  • {@link org.eclipse.bpmn2.impl.SequenceFlowImpl#isIsImmediate Is Immediate}
  • + *
  • {@link org.eclipse.bpmn2.impl.SequenceFlowImpl#getSourceRef Source Ref}
  • + *
  • {@link org.eclipse.bpmn2.impl.SequenceFlowImpl#getTargetRef Target Ref}
  • + *
+ * + * @generated + */ +public class SequenceFlowImpl extends FlowElementImpl implements SequenceFlow { + /** + * The cached value of the '{@link #getConditionExpression() Condition Expression}' containment reference. + * + * + * @see #getConditionExpression() + * @generated + * @ordered + */ + @GwtTransient + protected Expression conditionExpression; + + /** + * The default value of the '{@link #isIsImmediate() Is Immediate}' attribute. + * + * + * @see #isIsImmediate() + * @generated + * @ordered + */ + protected static final boolean IS_IMMEDIATE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsImmediate() Is Immediate}' attribute. + * + * + * @see #isIsImmediate() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isImmediate = IS_IMMEDIATE_EDEFAULT; + + /** + * The cached value of the '{@link #getSourceRef() Source Ref}' reference. + * + * + * @see #getSourceRef() + * @generated + * @ordered + */ + @GwtTransient + protected FlowNode sourceRef; + + /** + * The cached value of the '{@link #getTargetRef() Target Ref}' reference. + * + * + * @see #getTargetRef() + * @generated + * @ordered + */ + @GwtTransient + protected FlowNode targetRef; + + /** + * + * + * @generated + */ + protected SequenceFlowImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.SEQUENCE_FLOW; + } + + /** + * + * + * @generated + */ + @Override + public Expression getConditionExpression() { + return conditionExpression; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetConditionExpression(Expression newConditionExpression, NotificationChain msgs) { + Expression oldConditionExpression = conditionExpression; + conditionExpression = newConditionExpression; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION, oldConditionExpression, newConditionExpression); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setConditionExpression(Expression newConditionExpression) { + if (newConditionExpression != conditionExpression) { + NotificationChain msgs = null; + if (conditionExpression != null) + msgs = ((InternalEObject) conditionExpression).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION, null, msgs); + if (newConditionExpression != null) + msgs = ((InternalEObject) newConditionExpression).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION, null, msgs); + msgs = basicSetConditionExpression(newConditionExpression, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION, + newConditionExpression, newConditionExpression)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsImmediate() { + return isImmediate; + } + + /** + * + * + * @generated + */ + @Override + public void setIsImmediate(boolean newIsImmediate) { + boolean oldIsImmediate = isImmediate; + isImmediate = newIsImmediate; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEQUENCE_FLOW__IS_IMMEDIATE, + oldIsImmediate, isImmediate)); + } + + /** + * + * + * @generated + */ + @Override + public FlowNode getSourceRef() { + return sourceRef; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSourceRef(FlowNode newSourceRef, NotificationChain msgs) { + FlowNode oldSourceRef = sourceRef; + sourceRef = newSourceRef; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF, oldSourceRef, newSourceRef); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setSourceRef(FlowNode newSourceRef) { + if (newSourceRef != sourceRef) { + NotificationChain msgs = null; + if (sourceRef != null) + msgs = ((InternalEObject) sourceRef).eInverseRemove(this, Bpmn2Package.FLOW_NODE__OUTGOING, + FlowNode.class, msgs); + if (newSourceRef != null) + msgs = ((InternalEObject) newSourceRef).eInverseAdd(this, Bpmn2Package.FLOW_NODE__OUTGOING, + FlowNode.class, msgs); + msgs = basicSetSourceRef(newSourceRef, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF, newSourceRef, + newSourceRef)); + } + + /** + * + * + * @generated + */ + @Override + public FlowNode getTargetRef() { + return targetRef; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTargetRef(FlowNode newTargetRef, NotificationChain msgs) { + FlowNode oldTargetRef = targetRef; + targetRef = newTargetRef; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.SEQUENCE_FLOW__TARGET_REF, oldTargetRef, newTargetRef); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setTargetRef(FlowNode newTargetRef) { + if (newTargetRef != targetRef) { + NotificationChain msgs = null; + if (targetRef != null) + msgs = ((InternalEObject) targetRef).eInverseRemove(this, Bpmn2Package.FLOW_NODE__INCOMING, + FlowNode.class, msgs); + if (newTargetRef != null) + msgs = ((InternalEObject) newTargetRef).eInverseAdd(this, Bpmn2Package.FLOW_NODE__INCOMING, + FlowNode.class, msgs); + msgs = basicSetTargetRef(newTargetRef, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEQUENCE_FLOW__TARGET_REF, newTargetRef, + newTargetRef)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF: + if (sourceRef != null) + msgs = ((InternalEObject) sourceRef).eInverseRemove(this, Bpmn2Package.FLOW_NODE__OUTGOING, + FlowNode.class, msgs); + return basicSetSourceRef((FlowNode) otherEnd, msgs); + case Bpmn2Package.SEQUENCE_FLOW__TARGET_REF: + if (targetRef != null) + msgs = ((InternalEObject) targetRef).eInverseRemove(this, Bpmn2Package.FLOW_NODE__INCOMING, + FlowNode.class, msgs); + return basicSetTargetRef((FlowNode) otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION: + return basicSetConditionExpression(null, msgs); + case Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF: + return basicSetSourceRef(null, msgs); + case Bpmn2Package.SEQUENCE_FLOW__TARGET_REF: + return basicSetTargetRef(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION: + return getConditionExpression(); + case Bpmn2Package.SEQUENCE_FLOW__IS_IMMEDIATE: + return isIsImmediate(); + case Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF: + return getSourceRef(); + case Bpmn2Package.SEQUENCE_FLOW__TARGET_REF: + return getTargetRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION: + setConditionExpression((Expression) newValue); + return; + case Bpmn2Package.SEQUENCE_FLOW__IS_IMMEDIATE: + setIsImmediate((Boolean) newValue); + return; + case Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF: + setSourceRef((FlowNode) newValue); + return; + case Bpmn2Package.SEQUENCE_FLOW__TARGET_REF: + setTargetRef((FlowNode) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION: + setConditionExpression((Expression) null); + return; + case Bpmn2Package.SEQUENCE_FLOW__IS_IMMEDIATE: + setIsImmediate(IS_IMMEDIATE_EDEFAULT); + return; + case Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF: + setSourceRef((FlowNode) null); + return; + case Bpmn2Package.SEQUENCE_FLOW__TARGET_REF: + setTargetRef((FlowNode) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION: + return conditionExpression != null; + case Bpmn2Package.SEQUENCE_FLOW__IS_IMMEDIATE: + return isImmediate != IS_IMMEDIATE_EDEFAULT; + case Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF: + return sourceRef != null; + case Bpmn2Package.SEQUENCE_FLOW__TARGET_REF: + return targetRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (isImmediate: "); + result.append(isImmediate); + result.append(')'); + return result.toString(); + } + +} //SequenceFlowImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ServiceTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ServiceTaskImpl.java new file mode 100644 index 00000000000..e28b72d6ef6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ServiceTaskImpl.java @@ -0,0 +1,250 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Operation; +import org.eclipse.bpmn2.ServiceTask; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Service Task'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ServiceTaskImpl#getImplementation Implementation}
  • + *
  • {@link org.eclipse.bpmn2.impl.ServiceTaskImpl#getOperationRef Operation Ref}
  • + *
+ * + * @generated + */ +public class ServiceTaskImpl extends TaskImpl implements ServiceTask { + /** + * The default value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + protected static final String IMPLEMENTATION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + @GwtTransient + protected String implementation = IMPLEMENTATION_EDEFAULT; + + /** + * The cached value of the '{@link #getOperationRef() Operation Ref}' reference. + * + * + * @see #getOperationRef() + * @generated + * @ordered + */ + @GwtTransient + protected Operation operationRef; + + /** + * + * + * @generated + */ + protected ServiceTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.SERVICE_TASK; + } + + /** + * + * + * @generated + */ + @Override + public String getImplementation() { + return implementation; + } + + /** + * + * + * @generated + */ + @Override + public void setImplementation(String newImplementation) { + String oldImplementation = implementation; + implementation = newImplementation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SERVICE_TASK__IMPLEMENTATION, + oldImplementation, implementation)); + } + + /** + * + * + * @generated + */ + @Override + public Operation getOperationRef() { + if (operationRef != null && operationRef.eIsProxy()) { + InternalEObject oldOperationRef = (InternalEObject) operationRef; + operationRef = (Operation) eResolveProxy(oldOperationRef); + if (operationRef != oldOperationRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.SERVICE_TASK__OPERATION_REF, + oldOperationRef, operationRef)); + } + } + return operationRef; + } + + /** + * + * + * @generated + */ + public Operation basicGetOperationRef() { + return operationRef; + } + + /** + * + * + * @generated + */ + @Override + public void setOperationRef(Operation newOperationRef) { + Operation oldOperationRef = operationRef; + operationRef = newOperationRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SERVICE_TASK__OPERATION_REF, + oldOperationRef, operationRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.SERVICE_TASK__IMPLEMENTATION: + return getImplementation(); + case Bpmn2Package.SERVICE_TASK__OPERATION_REF: + if (resolve) + return getOperationRef(); + return basicGetOperationRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.SERVICE_TASK__IMPLEMENTATION: + setImplementation((String) newValue); + return; + case Bpmn2Package.SERVICE_TASK__OPERATION_REF: + setOperationRef((Operation) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.SERVICE_TASK__IMPLEMENTATION: + setImplementation(IMPLEMENTATION_EDEFAULT); + return; + case Bpmn2Package.SERVICE_TASK__OPERATION_REF: + setOperationRef((Operation) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.SERVICE_TASK__IMPLEMENTATION: + return IMPLEMENTATION_EDEFAULT == null ? implementation != null + : !IMPLEMENTATION_EDEFAULT.equals(implementation); + case Bpmn2Package.SERVICE_TASK__OPERATION_REF: + return operationRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (implementation: "); + result.append(implementation); + result.append(')'); + return result.toString(); + } + +} //ServiceTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SignalEventDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SignalEventDefinitionImpl.java new file mode 100644 index 00000000000..9eaf69a93cf --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SignalEventDefinitionImpl.java @@ -0,0 +1,181 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.SignalEventDefinition; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Signal Event Definition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.SignalEventDefinitionImpl#getSignalRef Signal Ref}
  • + *
+ * + * @generated + */ +public class SignalEventDefinitionImpl extends EventDefinitionImpl implements SignalEventDefinition { + /** + * The default value of the '{@link #getSignalRef() Signal Ref}' attribute. + * + * + * @see #getSignalRef() + * @generated + * @ordered + */ + protected static final String SIGNAL_REF_EDEFAULT = null; + + /** + * The cached value of the '{@link #getSignalRef() Signal Ref}' attribute. + * + * + * @see #getSignalRef() + * @generated + * @ordered + */ + @GwtTransient + protected String signalRef = SIGNAL_REF_EDEFAULT; + + /** + * + * + * @generated + */ + protected SignalEventDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.SIGNAL_EVENT_DEFINITION; + } + + /** + * + * + * @generated + */ + @Override + public String getSignalRef() { + return signalRef; + } + + /** + * + * + * @generated + */ + @Override + public void setSignalRef(String newSignalRef) { + String oldSignalRef = signalRef; + signalRef = newSignalRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SIGNAL_EVENT_DEFINITION__SIGNAL_REF, + oldSignalRef, signalRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.SIGNAL_EVENT_DEFINITION__SIGNAL_REF: + return getSignalRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.SIGNAL_EVENT_DEFINITION__SIGNAL_REF: + setSignalRef((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.SIGNAL_EVENT_DEFINITION__SIGNAL_REF: + setSignalRef(SIGNAL_REF_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.SIGNAL_EVENT_DEFINITION__SIGNAL_REF: + return SIGNAL_REF_EDEFAULT == null ? signalRef != null : !SIGNAL_REF_EDEFAULT.equals(signalRef); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (signalRef: "); + result.append(signalRef); + result.append(')'); + return result.toString(); + } + +} //SignalEventDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SignalImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SignalImpl.java new file mode 100644 index 00000000000..2cb593c0d7d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SignalImpl.java @@ -0,0 +1,248 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Signal; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Signal'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.SignalImpl#getName Name}
  • + *
  • {@link org.eclipse.bpmn2.impl.SignalImpl#getStructureRef Structure Ref}
  • + *
+ * + * @generated + */ +public class SignalImpl extends RootElementImpl implements Signal { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getStructureRef() Structure Ref}' reference. + * + * + * @see #getStructureRef() + * @generated + * @ordered + */ + @GwtTransient + protected ItemDefinition structureRef; + + /** + * + * + * @generated + */ + protected SignalImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.SIGNAL; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SIGNAL__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public ItemDefinition getStructureRef() { + if (structureRef != null && structureRef.eIsProxy()) { + InternalEObject oldStructureRef = (InternalEObject) structureRef; + structureRef = (ItemDefinition) eResolveProxy(oldStructureRef); + if (structureRef != oldStructureRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.SIGNAL__STRUCTURE_REF, + oldStructureRef, structureRef)); + } + } + return structureRef; + } + + /** + * + * + * @generated + */ + public ItemDefinition basicGetStructureRef() { + return structureRef; + } + + /** + * + * + * @generated + */ + @Override + public void setStructureRef(ItemDefinition newStructureRef) { + ItemDefinition oldStructureRef = structureRef; + structureRef = newStructureRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SIGNAL__STRUCTURE_REF, oldStructureRef, + structureRef)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.SIGNAL__NAME: + return getName(); + case Bpmn2Package.SIGNAL__STRUCTURE_REF: + if (resolve) + return getStructureRef(); + return basicGetStructureRef(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.SIGNAL__NAME: + setName((String) newValue); + return; + case Bpmn2Package.SIGNAL__STRUCTURE_REF: + setStructureRef((ItemDefinition) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.SIGNAL__NAME: + setName(NAME_EDEFAULT); + return; + case Bpmn2Package.SIGNAL__STRUCTURE_REF: + setStructureRef((ItemDefinition) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.SIGNAL__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case Bpmn2Package.SIGNAL__STRUCTURE_REF: + return structureRef != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //SignalImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/StandardLoopCharacteristicsImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/StandardLoopCharacteristicsImpl.java new file mode 100644 index 00000000000..4a253e7ba18 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/StandardLoopCharacteristicsImpl.java @@ -0,0 +1,350 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Expression; +import org.eclipse.bpmn2.StandardLoopCharacteristics; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Standard Loop Characteristics'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.StandardLoopCharacteristicsImpl#getLoopCondition Loop Condition}
  • + *
  • {@link org.eclipse.bpmn2.impl.StandardLoopCharacteristicsImpl#getLoopMaximum Loop Maximum}
  • + *
  • {@link org.eclipse.bpmn2.impl.StandardLoopCharacteristicsImpl#isTestBefore Test Before}
  • + *
+ * + * @generated + */ +public class StandardLoopCharacteristicsImpl extends LoopCharacteristicsImpl implements StandardLoopCharacteristics { + /** + * The cached value of the '{@link #getLoopCondition() Loop Condition}' containment reference. + * + * + * @see #getLoopCondition() + * @generated + * @ordered + */ + @GwtTransient + protected Expression loopCondition; + + /** + * The cached value of the '{@link #getLoopMaximum() Loop Maximum}' containment reference. + * + * + * @see #getLoopMaximum() + * @generated + * @ordered + */ + @GwtTransient + protected Expression loopMaximum; + + /** + * The default value of the '{@link #isTestBefore() Test Before}' attribute. + * + * + * @see #isTestBefore() + * @generated + * @ordered + */ + protected static final boolean TEST_BEFORE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isTestBefore() Test Before}' attribute. + * + * + * @see #isTestBefore() + * @generated + * @ordered + */ + @GwtTransient + protected boolean testBefore = TEST_BEFORE_EDEFAULT; + + /** + * + * + * @generated + */ + protected StandardLoopCharacteristicsImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.STANDARD_LOOP_CHARACTERISTICS; + } + + /** + * + * + * @generated + */ + @Override + public Expression getLoopCondition() { + return loopCondition; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLoopCondition(Expression newLoopCondition, NotificationChain msgs) { + Expression oldLoopCondition = loopCondition; + loopCondition = newLoopCondition; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_CONDITION, oldLoopCondition, newLoopCondition); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setLoopCondition(Expression newLoopCondition) { + if (newLoopCondition != loopCondition) { + NotificationChain msgs = null; + if (loopCondition != null) + msgs = ((InternalEObject) loopCondition).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_CONDITION, null, + msgs); + if (newLoopCondition != null) + msgs = ((InternalEObject) newLoopCondition).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_CONDITION, null, + msgs); + msgs = basicSetLoopCondition(newLoopCondition, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_CONDITION, newLoopCondition, newLoopCondition)); + } + + /** + * + * + * @generated + */ + @Override + public Expression getLoopMaximum() { + return loopMaximum; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLoopMaximum(Expression newLoopMaximum, NotificationChain msgs) { + Expression oldLoopMaximum = loopMaximum; + loopMaximum = newLoopMaximum; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_MAXIMUM, oldLoopMaximum, newLoopMaximum); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setLoopMaximum(Expression newLoopMaximum) { + if (newLoopMaximum != loopMaximum) { + NotificationChain msgs = null; + if (loopMaximum != null) + msgs = ((InternalEObject) loopMaximum).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_MAXIMUM, null, msgs); + if (newLoopMaximum != null) + msgs = ((InternalEObject) newLoopMaximum).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_MAXIMUM, null, msgs); + msgs = basicSetLoopMaximum(newLoopMaximum, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_MAXIMUM, newLoopMaximum, newLoopMaximum)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isTestBefore() { + return testBefore; + } + + /** + * + * + * @generated + */ + @Override + public void setTestBefore(boolean newTestBefore) { + boolean oldTestBefore = testBefore; + testBefore = newTestBefore; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__TEST_BEFORE, oldTestBefore, testBefore)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_CONDITION: + return basicSetLoopCondition(null, msgs); + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_MAXIMUM: + return basicSetLoopMaximum(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_CONDITION: + return getLoopCondition(); + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_MAXIMUM: + return getLoopMaximum(); + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__TEST_BEFORE: + return isTestBefore(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_CONDITION: + setLoopCondition((Expression) newValue); + return; + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_MAXIMUM: + setLoopMaximum((Expression) newValue); + return; + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__TEST_BEFORE: + setTestBefore((Boolean) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_CONDITION: + setLoopCondition((Expression) null); + return; + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_MAXIMUM: + setLoopMaximum((Expression) null); + return; + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__TEST_BEFORE: + setTestBefore(TEST_BEFORE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_CONDITION: + return loopCondition != null; + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__LOOP_MAXIMUM: + return loopMaximum != null; + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS__TEST_BEFORE: + return testBefore != TEST_BEFORE_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (testBefore: "); + result.append(testBefore); + result.append(')'); + return result.toString(); + } + +} //StandardLoopCharacteristicsImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/StartEventImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/StartEventImpl.java new file mode 100644 index 00000000000..72bd9674a98 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/StartEventImpl.java @@ -0,0 +1,181 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.StartEvent; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Start Event'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.StartEventImpl#isIsInterrupting Is Interrupting}
  • + *
+ * + * @generated + */ +public class StartEventImpl extends CatchEventImpl implements StartEvent { + /** + * The default value of the '{@link #isIsInterrupting() Is Interrupting}' attribute. + * + * + * @see #isIsInterrupting() + * @generated + * @ordered + */ + protected static final boolean IS_INTERRUPTING_EDEFAULT = true; + + /** + * The cached value of the '{@link #isIsInterrupting() Is Interrupting}' attribute. + * + * + * @see #isIsInterrupting() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isInterrupting = IS_INTERRUPTING_EDEFAULT; + + /** + * + * + * @generated + */ + protected StartEventImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.START_EVENT; + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsInterrupting() { + return isInterrupting; + } + + /** + * + * + * @generated + */ + @Override + public void setIsInterrupting(boolean newIsInterrupting) { + boolean oldIsInterrupting = isInterrupting; + isInterrupting = newIsInterrupting; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.START_EVENT__IS_INTERRUPTING, + oldIsInterrupting, isInterrupting)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.START_EVENT__IS_INTERRUPTING: + return isIsInterrupting(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.START_EVENT__IS_INTERRUPTING: + setIsInterrupting((Boolean) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.START_EVENT__IS_INTERRUPTING: + setIsInterrupting(IS_INTERRUPTING_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.START_EVENT__IS_INTERRUPTING: + return isInterrupting != IS_INTERRUPTING_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (isInterrupting: "); + result.append(isInterrupting); + result.append(')'); + return result.toString(); + } + +} //StartEventImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SubChoreographyImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SubChoreographyImpl.java new file mode 100644 index 00000000000..12721b6b87e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SubChoreographyImpl.java @@ -0,0 +1,288 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Artifact; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.FlowElementsContainer; +import org.eclipse.bpmn2.LaneSet; +import org.eclipse.bpmn2.SubChoreography; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Sub Choreography'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.SubChoreographyImpl#getLaneSets Lane Sets}
  • + *
  • {@link org.eclipse.bpmn2.impl.SubChoreographyImpl#getFlowElements Flow Elements}
  • + *
  • {@link org.eclipse.bpmn2.impl.SubChoreographyImpl#getArtifacts Artifacts}
  • + *
+ * + * @generated + */ +public class SubChoreographyImpl extends ChoreographyActivityImpl implements SubChoreography { + /** + * The cached value of the '{@link #getLaneSets() Lane Sets}' containment reference list. + * + * + * @see #getLaneSets() + * @generated + * @ordered + */ + @GwtTransient + protected EList laneSets; + + /** + * The cached value of the '{@link #getFlowElements() Flow Elements}' containment reference list. + * + * + * @see #getFlowElements() + * @generated + * @ordered + */ + @GwtTransient + protected EList flowElements; + + /** + * The cached value of the '{@link #getArtifacts() Artifacts}' containment reference list. + * + * + * @see #getArtifacts() + * @generated + * @ordered + */ + @GwtTransient + protected EList artifacts; + + /** + * + * + * @generated + */ + protected SubChoreographyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.SUB_CHOREOGRAPHY; + } + + /** + * + * + * @generated + */ + @Override + public EList getLaneSets() { + if (laneSets == null) { + laneSets = new EObjectContainmentEList(LaneSet.class, this, + Bpmn2Package.SUB_CHOREOGRAPHY__LANE_SETS); + } + return laneSets; + } + + /** + * + * + * @generated + */ + @Override + public EList getFlowElements() { + if (flowElements == null) { + flowElements = new EObjectContainmentEList(FlowElement.class, this, + Bpmn2Package.SUB_CHOREOGRAPHY__FLOW_ELEMENTS); + } + return flowElements; + } + + /** + * + * + * @generated + */ + @Override + public EList getArtifacts() { + if (artifacts == null) { + artifacts = new EObjectContainmentEList(Artifact.class, this, + Bpmn2Package.SUB_CHOREOGRAPHY__ARTIFACTS); + } + return artifacts; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.SUB_CHOREOGRAPHY__LANE_SETS: + return ((InternalEList) getLaneSets()).basicRemove(otherEnd, msgs); + case Bpmn2Package.SUB_CHOREOGRAPHY__FLOW_ELEMENTS: + return ((InternalEList) getFlowElements()).basicRemove(otherEnd, msgs); + case Bpmn2Package.SUB_CHOREOGRAPHY__ARTIFACTS: + return ((InternalEList) getArtifacts()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.SUB_CHOREOGRAPHY__LANE_SETS: + return getLaneSets(); + case Bpmn2Package.SUB_CHOREOGRAPHY__FLOW_ELEMENTS: + return getFlowElements(); + case Bpmn2Package.SUB_CHOREOGRAPHY__ARTIFACTS: + return getArtifacts(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.SUB_CHOREOGRAPHY__LANE_SETS: + getLaneSets().clear(); + getLaneSets().addAll((Collection) newValue); + return; + case Bpmn2Package.SUB_CHOREOGRAPHY__FLOW_ELEMENTS: + getFlowElements().clear(); + getFlowElements().addAll((Collection) newValue); + return; + case Bpmn2Package.SUB_CHOREOGRAPHY__ARTIFACTS: + getArtifacts().clear(); + getArtifacts().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.SUB_CHOREOGRAPHY__LANE_SETS: + getLaneSets().clear(); + return; + case Bpmn2Package.SUB_CHOREOGRAPHY__FLOW_ELEMENTS: + getFlowElements().clear(); + return; + case Bpmn2Package.SUB_CHOREOGRAPHY__ARTIFACTS: + getArtifacts().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.SUB_CHOREOGRAPHY__LANE_SETS: + return laneSets != null && !laneSets.isEmpty(); + case Bpmn2Package.SUB_CHOREOGRAPHY__FLOW_ELEMENTS: + return flowElements != null && !flowElements.isEmpty(); + case Bpmn2Package.SUB_CHOREOGRAPHY__ARTIFACTS: + return artifacts != null && !artifacts.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == FlowElementsContainer.class) { + switch (derivedFeatureID) { + case Bpmn2Package.SUB_CHOREOGRAPHY__LANE_SETS: + return Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS; + case Bpmn2Package.SUB_CHOREOGRAPHY__FLOW_ELEMENTS: + return Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == FlowElementsContainer.class) { + switch (baseFeatureID) { + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS: + return Bpmn2Package.SUB_CHOREOGRAPHY__LANE_SETS; + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS: + return Bpmn2Package.SUB_CHOREOGRAPHY__FLOW_ELEMENTS; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + +} //SubChoreographyImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SubConversationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SubConversationImpl.java new file mode 100644 index 00000000000..d5ac19520be --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SubConversationImpl.java @@ -0,0 +1,167 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ConversationNode; +import org.eclipse.bpmn2.SubConversation; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Sub Conversation'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.SubConversationImpl#getConversationNodes Conversation Nodes}
  • + *
+ * + * @generated + */ +public class SubConversationImpl extends ConversationNodeImpl implements SubConversation { + /** + * The cached value of the '{@link #getConversationNodes() Conversation Nodes}' containment reference list. + * + * + * @see #getConversationNodes() + * @generated + * @ordered + */ + @GwtTransient + protected EList conversationNodes; + + /** + * + * + * @generated + */ + protected SubConversationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.SUB_CONVERSATION; + } + + /** + * + * + * @generated + */ + @Override + public EList getConversationNodes() { + if (conversationNodes == null) { + conversationNodes = new EObjectContainmentEList(ConversationNode.class, this, + Bpmn2Package.SUB_CONVERSATION__CONVERSATION_NODES); + } + return conversationNodes; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.SUB_CONVERSATION__CONVERSATION_NODES: + return ((InternalEList) getConversationNodes()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.SUB_CONVERSATION__CONVERSATION_NODES: + return getConversationNodes(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.SUB_CONVERSATION__CONVERSATION_NODES: + getConversationNodes().clear(); + getConversationNodes().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.SUB_CONVERSATION__CONVERSATION_NODES: + getConversationNodes().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.SUB_CONVERSATION__CONVERSATION_NODES: + return conversationNodes != null && !conversationNodes.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //SubConversationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SubProcessImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SubProcessImpl.java new file mode 100644 index 00000000000..86ca371e7ca --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/SubProcessImpl.java @@ -0,0 +1,363 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Artifact; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.FlowElementsContainer; +import org.eclipse.bpmn2.LaneSet; +import org.eclipse.bpmn2.SubProcess; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Sub Process'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.SubProcessImpl#getLaneSets Lane Sets}
  • + *
  • {@link org.eclipse.bpmn2.impl.SubProcessImpl#getFlowElements Flow Elements}
  • + *
  • {@link org.eclipse.bpmn2.impl.SubProcessImpl#getArtifacts Artifacts}
  • + *
  • {@link org.eclipse.bpmn2.impl.SubProcessImpl#isTriggeredByEvent Triggered By Event}
  • + *
+ * + * @generated + */ +public class SubProcessImpl extends ActivityImpl implements SubProcess { + /** + * The cached value of the '{@link #getLaneSets() Lane Sets}' containment reference list. + * + * + * @see #getLaneSets() + * @generated + * @ordered + */ + @GwtTransient + protected EList laneSets; + + /** + * The cached value of the '{@link #getFlowElements() Flow Elements}' containment reference list. + * + * + * @see #getFlowElements() + * @generated + * @ordered + */ + @GwtTransient + protected EList flowElements; + + /** + * The cached value of the '{@link #getArtifacts() Artifacts}' containment reference list. + * + * + * @see #getArtifacts() + * @generated + * @ordered + */ + @GwtTransient + protected EList artifacts; + + /** + * The default value of the '{@link #isTriggeredByEvent() Triggered By Event}' attribute. + * + * + * @see #isTriggeredByEvent() + * @generated + * @ordered + */ + protected static final boolean TRIGGERED_BY_EVENT_EDEFAULT = false; + + /** + * The cached value of the '{@link #isTriggeredByEvent() Triggered By Event}' attribute. + * + * + * @see #isTriggeredByEvent() + * @generated + * @ordered + */ + @GwtTransient + protected boolean triggeredByEvent = TRIGGERED_BY_EVENT_EDEFAULT; + + /** + * + * + * @generated + */ + protected SubProcessImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.SUB_PROCESS; + } + + /** + * + * + * @generated + */ + @Override + public EList getLaneSets() { + if (laneSets == null) { + laneSets = new EObjectContainmentEList(LaneSet.class, this, Bpmn2Package.SUB_PROCESS__LANE_SETS); + } + return laneSets; + } + + /** + * + * + * @generated + */ + @Override + public EList getFlowElements() { + if (flowElements == null) { + flowElements = new EObjectContainmentEList(FlowElement.class, this, + Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS); + } + return flowElements; + } + + /** + * + * + * @generated + */ + @Override + public EList getArtifacts() { + if (artifacts == null) { + artifacts = new EObjectContainmentEList(Artifact.class, this, + Bpmn2Package.SUB_PROCESS__ARTIFACTS); + } + return artifacts; + } + + /** + * + * + * @generated + */ + @Override + public boolean isTriggeredByEvent() { + return triggeredByEvent; + } + + /** + * + * + * @generated + */ + @Override + public void setTriggeredByEvent(boolean newTriggeredByEvent) { + boolean oldTriggeredByEvent = triggeredByEvent; + triggeredByEvent = newTriggeredByEvent; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SUB_PROCESS__TRIGGERED_BY_EVENT, + oldTriggeredByEvent, triggeredByEvent)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.SUB_PROCESS__LANE_SETS: + return ((InternalEList) getLaneSets()).basicRemove(otherEnd, msgs); + case Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS: + return ((InternalEList) getFlowElements()).basicRemove(otherEnd, msgs); + case Bpmn2Package.SUB_PROCESS__ARTIFACTS: + return ((InternalEList) getArtifacts()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.SUB_PROCESS__LANE_SETS: + return getLaneSets(); + case Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS: + return getFlowElements(); + case Bpmn2Package.SUB_PROCESS__ARTIFACTS: + return getArtifacts(); + case Bpmn2Package.SUB_PROCESS__TRIGGERED_BY_EVENT: + return isTriggeredByEvent(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.SUB_PROCESS__LANE_SETS: + getLaneSets().clear(); + getLaneSets().addAll((Collection) newValue); + return; + case Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS: + getFlowElements().clear(); + getFlowElements().addAll((Collection) newValue); + return; + case Bpmn2Package.SUB_PROCESS__ARTIFACTS: + getArtifacts().clear(); + getArtifacts().addAll((Collection) newValue); + return; + case Bpmn2Package.SUB_PROCESS__TRIGGERED_BY_EVENT: + setTriggeredByEvent((Boolean) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.SUB_PROCESS__LANE_SETS: + getLaneSets().clear(); + return; + case Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS: + getFlowElements().clear(); + return; + case Bpmn2Package.SUB_PROCESS__ARTIFACTS: + getArtifacts().clear(); + return; + case Bpmn2Package.SUB_PROCESS__TRIGGERED_BY_EVENT: + setTriggeredByEvent(TRIGGERED_BY_EVENT_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.SUB_PROCESS__LANE_SETS: + return laneSets != null && !laneSets.isEmpty(); + case Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS: + return flowElements != null && !flowElements.isEmpty(); + case Bpmn2Package.SUB_PROCESS__ARTIFACTS: + return artifacts != null && !artifacts.isEmpty(); + case Bpmn2Package.SUB_PROCESS__TRIGGERED_BY_EVENT: + return triggeredByEvent != TRIGGERED_BY_EVENT_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == FlowElementsContainer.class) { + switch (derivedFeatureID) { + case Bpmn2Package.SUB_PROCESS__LANE_SETS: + return Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS; + case Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS: + return Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == FlowElementsContainer.class) { + switch (baseFeatureID) { + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS: + return Bpmn2Package.SUB_PROCESS__LANE_SETS; + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS: + return Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (triggeredByEvent: "); + result.append(triggeredByEvent); + result.append(')'); + return result.toString(); + } + +} //SubProcessImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TaskImpl.java new file mode 100644 index 00000000000..326d2d961bf --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TaskImpl.java @@ -0,0 +1,160 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.ConversationLink; +import org.eclipse.bpmn2.InteractionNode; +import org.eclipse.bpmn2.Task; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Task'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.TaskImpl#getIncomingConversationLinks Incoming Conversation Links}
  • + *
  • {@link org.eclipse.bpmn2.impl.TaskImpl#getOutgoingConversationLinks Outgoing Conversation Links}
  • + *
+ * + * @generated + */ +public class TaskImpl extends ActivityImpl implements Task { + /** + * + * + * @generated + */ + protected TaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.TASK; + } + + /** + * + * + * @generated + */ + @Override + public EList getIncomingConversationLinks() { + // TODO: implement this method to return the 'Incoming Conversation Links' reference list + // Ensure that you remove @generated or mark it @generated NOT + // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting + // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public EList getOutgoingConversationLinks() { + // TODO: implement this method to return the 'Outgoing Conversation Links' reference list + // Ensure that you remove @generated or mark it @generated NOT + // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting + // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.TASK__INCOMING_CONVERSATION_LINKS: + return getIncomingConversationLinks(); + case Bpmn2Package.TASK__OUTGOING_CONVERSATION_LINKS: + return getOutgoingConversationLinks(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.TASK__INCOMING_CONVERSATION_LINKS: + return !getIncomingConversationLinks().isEmpty(); + case Bpmn2Package.TASK__OUTGOING_CONVERSATION_LINKS: + return !getOutgoingConversationLinks().isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == InteractionNode.class) { + switch (derivedFeatureID) { + case Bpmn2Package.TASK__INCOMING_CONVERSATION_LINKS: + return Bpmn2Package.INTERACTION_NODE__INCOMING_CONVERSATION_LINKS; + case Bpmn2Package.TASK__OUTGOING_CONVERSATION_LINKS: + return Bpmn2Package.INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == InteractionNode.class) { + switch (baseFeatureID) { + case Bpmn2Package.INTERACTION_NODE__INCOMING_CONVERSATION_LINKS: + return Bpmn2Package.TASK__INCOMING_CONVERSATION_LINKS; + case Bpmn2Package.INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS: + return Bpmn2Package.TASK__OUTGOING_CONVERSATION_LINKS; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + +} //TaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TerminateEventDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TerminateEventDefinitionImpl.java new file mode 100644 index 00000000000..29d532f4eca --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TerminateEventDefinitionImpl.java @@ -0,0 +1,49 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.TerminateEventDefinition; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Terminate Event Definition'. + * + * + * @generated + */ +public class TerminateEventDefinitionImpl extends EventDefinitionImpl implements TerminateEventDefinition { + /** + * + * + * @generated + */ + protected TerminateEventDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.TERMINATE_EVENT_DEFINITION; + } + +} //TerminateEventDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TextAnnotationImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TextAnnotationImpl.java new file mode 100644 index 00000000000..66e58c2db88 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TextAnnotationImpl.java @@ -0,0 +1,238 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.TextAnnotation; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Text Annotation'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.TextAnnotationImpl#getText Text}
  • + *
  • {@link org.eclipse.bpmn2.impl.TextAnnotationImpl#getTextFormat Text Format}
  • + *
+ * + * @generated + */ +public class TextAnnotationImpl extends FlowNodeImpl implements TextAnnotation { + /** + * The default value of the '{@link #getText() Text}' attribute. + * + * + * @see #getText() + * @generated + * @ordered + */ + protected static final String TEXT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getText() Text}' attribute. + * + * + * @see #getText() + * @generated + * @ordered + */ + @GwtTransient + protected String text = TEXT_EDEFAULT; + + /** + * The default value of the '{@link #getTextFormat() Text Format}' attribute. + * + * + * @see #getTextFormat() + * @generated + * @ordered + */ + protected static final String TEXT_FORMAT_EDEFAULT = "text/plain"; + + /** + * The cached value of the '{@link #getTextFormat() Text Format}' attribute. + * + * + * @see #getTextFormat() + * @generated + * @ordered + */ + @GwtTransient + protected String textFormat = TEXT_FORMAT_EDEFAULT; + + /** + * + * + * @generated + */ + protected TextAnnotationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.TEXT_ANNOTATION; + } + + /** + * + * + * @generated + */ + @Override + public String getText() { + return text; + } + + /** + * + * + * @generated + */ + @Override + public void setText(String newText) { + String oldText = text; + text = newText; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.TEXT_ANNOTATION__TEXT, oldText, text)); + } + + /** + * + * + * @generated + */ + @Override + public String getTextFormat() { + return textFormat; + } + + /** + * + * + * @generated + */ + @Override + public void setTextFormat(String newTextFormat) { + String oldTextFormat = textFormat; + textFormat = newTextFormat; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT, + oldTextFormat, textFormat)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.TEXT_ANNOTATION__TEXT: + return getText(); + case Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT: + return getTextFormat(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.TEXT_ANNOTATION__TEXT: + setText((String) newValue); + return; + case Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT: + setTextFormat((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.TEXT_ANNOTATION__TEXT: + setText(TEXT_EDEFAULT); + return; + case Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT: + setTextFormat(TEXT_FORMAT_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.TEXT_ANNOTATION__TEXT: + return TEXT_EDEFAULT == null ? text != null : !TEXT_EDEFAULT.equals(text); + case Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT: + return TEXT_FORMAT_EDEFAULT == null ? textFormat != null : !TEXT_FORMAT_EDEFAULT.equals(textFormat); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (text: "); + result.append(text); + result.append(", textFormat: "); + result.append(textFormat); + result.append(')'); + return result.toString(); + } + +} //TextAnnotationImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ThrowEventImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ThrowEventImpl.java new file mode 100644 index 00000000000..6ba619fe7ea --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/ThrowEventImpl.java @@ -0,0 +1,365 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.ThrowEvent; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Throw Event'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.ThrowEventImpl#getDataInputs Data Inputs}
  • + *
  • {@link org.eclipse.bpmn2.impl.ThrowEventImpl#getDataInputAssociation Data Input Association}
  • + *
  • {@link org.eclipse.bpmn2.impl.ThrowEventImpl#getInputSet Input Set}
  • + *
  • {@link org.eclipse.bpmn2.impl.ThrowEventImpl#getEventDefinitions Event Definitions}
  • + *
  • {@link org.eclipse.bpmn2.impl.ThrowEventImpl#getEventDefinitionRefs Event Definition Refs}
  • + *
+ * + * @generated + */ +public abstract class ThrowEventImpl extends EventImpl implements ThrowEvent { + /** + * The cached value of the '{@link #getDataInputs() Data Inputs}' containment reference list. + * + * + * @see #getDataInputs() + * @generated + * @ordered + */ + @GwtTransient + protected EList dataInputs; + + /** + * The cached value of the '{@link #getDataInputAssociation() Data Input Association}' containment reference list. + * + * + * @see #getDataInputAssociation() + * @generated + * @ordered + */ + @GwtTransient + protected EList dataInputAssociation; + + /** + * The cached value of the '{@link #getInputSet() Input Set}' containment reference. + * + * + * @see #getInputSet() + * @generated + * @ordered + */ + @GwtTransient + protected InputSet inputSet; + + /** + * The cached value of the '{@link #getEventDefinitions() Event Definitions}' containment reference list. + * + * + * @see #getEventDefinitions() + * @generated + * @ordered + */ + @GwtTransient + protected EList eventDefinitions; + + /** + * The cached value of the '{@link #getEventDefinitionRefs() Event Definition Refs}' reference list. + * + * + * @see #getEventDefinitionRefs() + * @generated + * @ordered + */ + @GwtTransient + protected EList eventDefinitionRefs; + + /** + * + * + * @generated + */ + protected ThrowEventImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.THROW_EVENT; + } + + /** + * + * + * @generated + */ + @Override + public EList getDataInputs() { + if (dataInputs == null) { + dataInputs = new EObjectContainmentEList(DataInput.class, this, + Bpmn2Package.THROW_EVENT__DATA_INPUTS); + } + return dataInputs; + } + + /** + * + * + * @generated + */ + @Override + public EList getDataInputAssociation() { + if (dataInputAssociation == null) { + dataInputAssociation = new EObjectContainmentEList(DataInputAssociation.class, this, + Bpmn2Package.THROW_EVENT__DATA_INPUT_ASSOCIATION); + } + return dataInputAssociation; + } + + /** + * + * + * @generated + */ + @Override + public InputSet getInputSet() { + return inputSet; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetInputSet(InputSet newInputSet, NotificationChain msgs) { + InputSet oldInputSet = inputSet; + inputSet = newInputSet; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.THROW_EVENT__INPUT_SET, oldInputSet, newInputSet); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setInputSet(InputSet newInputSet) { + if (newInputSet != inputSet) { + NotificationChain msgs = null; + if (inputSet != null) + msgs = ((InternalEObject) inputSet).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.THROW_EVENT__INPUT_SET, null, msgs); + if (newInputSet != null) + msgs = ((InternalEObject) newInputSet).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.THROW_EVENT__INPUT_SET, null, msgs); + msgs = basicSetInputSet(newInputSet, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.THROW_EVENT__INPUT_SET, newInputSet, + newInputSet)); + } + + /** + * + * + * @generated + */ + @Override + public EList getEventDefinitions() { + if (eventDefinitions == null) { + eventDefinitions = new EObjectContainmentEList(EventDefinition.class, this, + Bpmn2Package.THROW_EVENT__EVENT_DEFINITIONS); + } + return eventDefinitions; + } + + /** + * + * + * @generated + */ + @Override + public EList getEventDefinitionRefs() { + if (eventDefinitionRefs == null) { + eventDefinitionRefs = new EObjectResolvingEList(EventDefinition.class, this, + Bpmn2Package.THROW_EVENT__EVENT_DEFINITION_REFS); + } + return eventDefinitionRefs; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.THROW_EVENT__DATA_INPUTS: + return ((InternalEList) getDataInputs()).basicRemove(otherEnd, msgs); + case Bpmn2Package.THROW_EVENT__DATA_INPUT_ASSOCIATION: + return ((InternalEList) getDataInputAssociation()).basicRemove(otherEnd, msgs); + case Bpmn2Package.THROW_EVENT__INPUT_SET: + return basicSetInputSet(null, msgs); + case Bpmn2Package.THROW_EVENT__EVENT_DEFINITIONS: + return ((InternalEList) getEventDefinitions()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.THROW_EVENT__DATA_INPUTS: + return getDataInputs(); + case Bpmn2Package.THROW_EVENT__DATA_INPUT_ASSOCIATION: + return getDataInputAssociation(); + case Bpmn2Package.THROW_EVENT__INPUT_SET: + return getInputSet(); + case Bpmn2Package.THROW_EVENT__EVENT_DEFINITIONS: + return getEventDefinitions(); + case Bpmn2Package.THROW_EVENT__EVENT_DEFINITION_REFS: + return getEventDefinitionRefs(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.THROW_EVENT__DATA_INPUTS: + getDataInputs().clear(); + getDataInputs().addAll((Collection) newValue); + return; + case Bpmn2Package.THROW_EVENT__DATA_INPUT_ASSOCIATION: + getDataInputAssociation().clear(); + getDataInputAssociation().addAll((Collection) newValue); + return; + case Bpmn2Package.THROW_EVENT__INPUT_SET: + setInputSet((InputSet) newValue); + return; + case Bpmn2Package.THROW_EVENT__EVENT_DEFINITIONS: + getEventDefinitions().clear(); + getEventDefinitions().addAll((Collection) newValue); + return; + case Bpmn2Package.THROW_EVENT__EVENT_DEFINITION_REFS: + getEventDefinitionRefs().clear(); + getEventDefinitionRefs().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.THROW_EVENT__DATA_INPUTS: + getDataInputs().clear(); + return; + case Bpmn2Package.THROW_EVENT__DATA_INPUT_ASSOCIATION: + getDataInputAssociation().clear(); + return; + case Bpmn2Package.THROW_EVENT__INPUT_SET: + setInputSet((InputSet) null); + return; + case Bpmn2Package.THROW_EVENT__EVENT_DEFINITIONS: + getEventDefinitions().clear(); + return; + case Bpmn2Package.THROW_EVENT__EVENT_DEFINITION_REFS: + getEventDefinitionRefs().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.THROW_EVENT__DATA_INPUTS: + return dataInputs != null && !dataInputs.isEmpty(); + case Bpmn2Package.THROW_EVENT__DATA_INPUT_ASSOCIATION: + return dataInputAssociation != null && !dataInputAssociation.isEmpty(); + case Bpmn2Package.THROW_EVENT__INPUT_SET: + return inputSet != null; + case Bpmn2Package.THROW_EVENT__EVENT_DEFINITIONS: + return eventDefinitions != null && !eventDefinitions.isEmpty(); + case Bpmn2Package.THROW_EVENT__EVENT_DEFINITION_REFS: + return eventDefinitionRefs != null && !eventDefinitionRefs.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //ThrowEventImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TimerEventDefinitionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TimerEventDefinitionImpl.java new file mode 100644 index 00000000000..0f9960c0955 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TimerEventDefinitionImpl.java @@ -0,0 +1,351 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Expression; +import org.eclipse.bpmn2.TimerEventDefinition; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Timer Event Definition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.TimerEventDefinitionImpl#getTimeDate Time Date}
  • + *
  • {@link org.eclipse.bpmn2.impl.TimerEventDefinitionImpl#getTimeDuration Time Duration}
  • + *
  • {@link org.eclipse.bpmn2.impl.TimerEventDefinitionImpl#getTimeCycle Time Cycle}
  • + *
+ * + * @generated + */ +public class TimerEventDefinitionImpl extends EventDefinitionImpl implements TimerEventDefinition { + /** + * The cached value of the '{@link #getTimeDate() Time Date}' containment reference. + * + * + * @see #getTimeDate() + * @generated + * @ordered + */ + @GwtTransient + protected Expression timeDate; + + /** + * The cached value of the '{@link #getTimeDuration() Time Duration}' containment reference. + * + * + * @see #getTimeDuration() + * @generated + * @ordered + */ + @GwtTransient + protected Expression timeDuration; + + /** + * The cached value of the '{@link #getTimeCycle() Time Cycle}' containment reference. + * + * + * @see #getTimeCycle() + * @generated + * @ordered + */ + @GwtTransient + protected Expression timeCycle; + + /** + * + * + * @generated + */ + protected TimerEventDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.TIMER_EVENT_DEFINITION; + } + + /** + * + * + * @generated + */ + @Override + public Expression getTimeDate() { + return timeDate; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTimeDate(Expression newTimeDate, NotificationChain msgs) { + Expression oldTimeDate = timeDate; + timeDate = newTimeDate; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DATE, oldTimeDate, newTimeDate); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setTimeDate(Expression newTimeDate) { + if (newTimeDate != timeDate) { + NotificationChain msgs = null; + if (timeDate != null) + msgs = ((InternalEObject) timeDate).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DATE, null, msgs); + if (newTimeDate != null) + msgs = ((InternalEObject) newTimeDate).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DATE, null, msgs); + msgs = basicSetTimeDate(newTimeDate, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DATE, + newTimeDate, newTimeDate)); + } + + /** + * + * + * @generated + */ + @Override + public Expression getTimeDuration() { + return timeDuration; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTimeDuration(Expression newTimeDuration, NotificationChain msgs) { + Expression oldTimeDuration = timeDuration; + timeDuration = newTimeDuration; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DURATION, oldTimeDuration, newTimeDuration); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setTimeDuration(Expression newTimeDuration) { + if (newTimeDuration != timeDuration) { + NotificationChain msgs = null; + if (timeDuration != null) + msgs = ((InternalEObject) timeDuration).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DURATION, null, msgs); + if (newTimeDuration != null) + msgs = ((InternalEObject) newTimeDuration).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DURATION, null, msgs); + msgs = basicSetTimeDuration(newTimeDuration, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DURATION, + newTimeDuration, newTimeDuration)); + } + + /** + * + * + * @generated + */ + @Override + public Expression getTimeCycle() { + return timeCycle; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTimeCycle(Expression newTimeCycle, NotificationChain msgs) { + Expression oldTimeCycle = timeCycle; + timeCycle = newTimeCycle; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_CYCLE, oldTimeCycle, newTimeCycle); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setTimeCycle(Expression newTimeCycle) { + if (newTimeCycle != timeCycle) { + NotificationChain msgs = null; + if (timeCycle != null) + msgs = ((InternalEObject) timeCycle).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_CYCLE, null, msgs); + if (newTimeCycle != null) + msgs = ((InternalEObject) newTimeCycle).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_CYCLE, null, msgs); + msgs = basicSetTimeCycle(newTimeCycle, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_CYCLE, + newTimeCycle, newTimeCycle)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DATE: + return basicSetTimeDate(null, msgs); + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DURATION: + return basicSetTimeDuration(null, msgs); + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_CYCLE: + return basicSetTimeCycle(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DATE: + return getTimeDate(); + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DURATION: + return getTimeDuration(); + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_CYCLE: + return getTimeCycle(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DATE: + setTimeDate((Expression) newValue); + return; + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DURATION: + setTimeDuration((Expression) newValue); + return; + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_CYCLE: + setTimeCycle((Expression) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DATE: + setTimeDate((Expression) null); + return; + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DURATION: + setTimeDuration((Expression) null); + return; + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_CYCLE: + setTimeCycle((Expression) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DATE: + return timeDate != null; + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_DURATION: + return timeDuration != null; + case Bpmn2Package.TIMER_EVENT_DEFINITION__TIME_CYCLE: + return timeCycle != null; + } + return super.eIsSet(featureID); + } + +} //TimerEventDefinitionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TransactionImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TransactionImpl.java new file mode 100644 index 00000000000..bd0f1b7d1ac --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/TransactionImpl.java @@ -0,0 +1,238 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Transaction; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Transaction'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.TransactionImpl#getProtocol Protocol}
  • + *
  • {@link org.eclipse.bpmn2.impl.TransactionImpl#getMethod Method}
  • + *
+ * + * @generated + */ +public class TransactionImpl extends SubProcessImpl implements Transaction { + /** + * The default value of the '{@link #getProtocol() Protocol}' attribute. + * + * + * @see #getProtocol() + * @generated + * @ordered + */ + protected static final String PROTOCOL_EDEFAULT = null; + + /** + * The cached value of the '{@link #getProtocol() Protocol}' attribute. + * + * + * @see #getProtocol() + * @generated + * @ordered + */ + @GwtTransient + protected String protocol = PROTOCOL_EDEFAULT; + + /** + * The default value of the '{@link #getMethod() Method}' attribute. + * + * + * @see #getMethod() + * @generated + * @ordered + */ + protected static final String METHOD_EDEFAULT = null; + + /** + * The cached value of the '{@link #getMethod() Method}' attribute. + * + * + * @see #getMethod() + * @generated + * @ordered + */ + @GwtTransient + protected String method = METHOD_EDEFAULT; + + /** + * + * + * @generated + */ + protected TransactionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.TRANSACTION; + } + + /** + * + * + * @generated + */ + @Override + public String getProtocol() { + return protocol; + } + + /** + * + * + * @generated + */ + @Override + public void setProtocol(String newProtocol) { + String oldProtocol = protocol; + protocol = newProtocol; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.TRANSACTION__PROTOCOL, oldProtocol, + protocol)); + } + + /** + * + * + * @generated + */ + @Override + public String getMethod() { + return method; + } + + /** + * + * + * @generated + */ + @Override + public void setMethod(String newMethod) { + String oldMethod = method; + method = newMethod; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.TRANSACTION__METHOD, oldMethod, method)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.TRANSACTION__PROTOCOL: + return getProtocol(); + case Bpmn2Package.TRANSACTION__METHOD: + return getMethod(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.TRANSACTION__PROTOCOL: + setProtocol((String) newValue); + return; + case Bpmn2Package.TRANSACTION__METHOD: + setMethod((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.TRANSACTION__PROTOCOL: + setProtocol(PROTOCOL_EDEFAULT); + return; + case Bpmn2Package.TRANSACTION__METHOD: + setMethod(METHOD_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.TRANSACTION__PROTOCOL: + return PROTOCOL_EDEFAULT == null ? protocol != null : !PROTOCOL_EDEFAULT.equals(protocol); + case Bpmn2Package.TRANSACTION__METHOD: + return METHOD_EDEFAULT == null ? method != null : !METHOD_EDEFAULT.equals(method); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (protocol: "); + result.append(protocol); + result.append(", method: "); + result.append(method); + result.append(')'); + return result.toString(); + } + +} //TransactionImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/UserTaskImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/UserTaskImpl.java new file mode 100644 index 00000000000..959f5d6dc9d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/impl/UserTaskImpl.java @@ -0,0 +1,244 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Collection; + +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.Rendering; +import org.eclipse.bpmn2.UserTask; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'User Task'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.bpmn2.impl.UserTaskImpl#getRenderings Renderings}
  • + *
  • {@link org.eclipse.bpmn2.impl.UserTaskImpl#getImplementation Implementation}
  • + *
+ * + * @generated + */ +public class UserTaskImpl extends TaskImpl implements UserTask { + /** + * The cached value of the '{@link #getRenderings() Renderings}' containment reference list. + * + * + * @see #getRenderings() + * @generated + * @ordered + */ + @GwtTransient + protected EList renderings; + + /** + * The default value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + protected static final String IMPLEMENTATION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getImplementation() Implementation}' attribute. + * + * + * @see #getImplementation() + * @generated + * @ordered + */ + @GwtTransient + protected String implementation = IMPLEMENTATION_EDEFAULT; + + /** + * + * + * @generated + */ + protected UserTaskImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Bpmn2Package.Literals.USER_TASK; + } + + /** + * + * + * @generated + */ + @Override + public EList getRenderings() { + if (renderings == null) { + renderings = new EObjectContainmentEList(Rendering.class, this, + Bpmn2Package.USER_TASK__RENDERINGS); + } + return renderings; + } + + /** + * + * + * @generated + */ + @Override + public String getImplementation() { + return implementation; + } + + /** + * + * + * @generated + */ + @Override + public void setImplementation(String newImplementation) { + String oldImplementation = implementation; + implementation = newImplementation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.USER_TASK__IMPLEMENTATION, + oldImplementation, implementation)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case Bpmn2Package.USER_TASK__RENDERINGS: + return ((InternalEList) getRenderings()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Bpmn2Package.USER_TASK__RENDERINGS: + return getRenderings(); + case Bpmn2Package.USER_TASK__IMPLEMENTATION: + return getImplementation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Bpmn2Package.USER_TASK__RENDERINGS: + getRenderings().clear(); + getRenderings().addAll((Collection) newValue); + return; + case Bpmn2Package.USER_TASK__IMPLEMENTATION: + setImplementation((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Bpmn2Package.USER_TASK__RENDERINGS: + getRenderings().clear(); + return; + case Bpmn2Package.USER_TASK__IMPLEMENTATION: + setImplementation(IMPLEMENTATION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Bpmn2Package.USER_TASK__RENDERINGS: + return renderings != null && !renderings.isEmpty(); + case Bpmn2Package.USER_TASK__IMPLEMENTATION: + return IMPLEMENTATION_EDEFAULT == null ? implementation != null + : !IMPLEMENTATION_EDEFAULT.equals(implementation); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (implementation: "); + result.append(implementation); + result.append(')'); + return result.toString(); + } + +} //UserTaskImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/util/Bpmn2AdapterFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/util/Bpmn2AdapterFactory.java new file mode 100644 index 00000000000..aee677261a5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/util/Bpmn2AdapterFactory.java @@ -0,0 +1,2890 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.util; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.Artifact; +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.Association; +import org.eclipse.bpmn2.Auditing; +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.BusinessRuleTask; +import org.eclipse.bpmn2.CallActivity; +import org.eclipse.bpmn2.CallChoreography; +import org.eclipse.bpmn2.CallConversation; +import org.eclipse.bpmn2.CallableElement; +import org.eclipse.bpmn2.CancelEventDefinition; +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.Category; +import org.eclipse.bpmn2.CategoryValue; +import org.eclipse.bpmn2.Choreography; +import org.eclipse.bpmn2.ChoreographyActivity; +import org.eclipse.bpmn2.ChoreographyTask; +import org.eclipse.bpmn2.Collaboration; +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.ComplexBehaviorDefinition; +import org.eclipse.bpmn2.ComplexGateway; +import org.eclipse.bpmn2.ConditionalEventDefinition; +import org.eclipse.bpmn2.Conversation; +import org.eclipse.bpmn2.ConversationAssociation; +import org.eclipse.bpmn2.ConversationLink; +import org.eclipse.bpmn2.ConversationNode; +import org.eclipse.bpmn2.CorrelationKey; +import org.eclipse.bpmn2.CorrelationProperty; +import org.eclipse.bpmn2.CorrelationPropertyBinding; +import org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression; +import org.eclipse.bpmn2.CorrelationSubscription; +import org.eclipse.bpmn2.DataAssociation; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataObject; +import org.eclipse.bpmn2.DataObjectReference; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.DataState; +import org.eclipse.bpmn2.DataStore; +import org.eclipse.bpmn2.DataStoreReference; +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.DocumentRoot; +import org.eclipse.bpmn2.Documentation; +import org.eclipse.bpmn2.EndEvent; +import org.eclipse.bpmn2.EndPoint; +import org.eclipse.bpmn2.ErrorEventDefinition; +import org.eclipse.bpmn2.Escalation; +import org.eclipse.bpmn2.EscalationEventDefinition; +import org.eclipse.bpmn2.Event; +import org.eclipse.bpmn2.EventBasedGateway; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.EventSubprocess; +import org.eclipse.bpmn2.ExclusiveGateway; +import org.eclipse.bpmn2.Expression; +import org.eclipse.bpmn2.Extension; +import org.eclipse.bpmn2.ExtensionAttributeDefinition; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.ExtensionDefinition; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.FlowElementsContainer; +import org.eclipse.bpmn2.FlowNode; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.Gateway; +import org.eclipse.bpmn2.GlobalBusinessRuleTask; +import org.eclipse.bpmn2.GlobalChoreographyTask; +import org.eclipse.bpmn2.GlobalConversation; +import org.eclipse.bpmn2.GlobalManualTask; +import org.eclipse.bpmn2.GlobalScriptTask; +import org.eclipse.bpmn2.GlobalTask; +import org.eclipse.bpmn2.GlobalUserTask; +import org.eclipse.bpmn2.Group; +import org.eclipse.bpmn2.HumanPerformer; +import org.eclipse.bpmn2.ImplicitThrowEvent; +import org.eclipse.bpmn2.Import; +import org.eclipse.bpmn2.InclusiveGateway; +import org.eclipse.bpmn2.InputOutputBinding; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.InteractionNode; +import org.eclipse.bpmn2.Interface; +import org.eclipse.bpmn2.IntermediateCatchEvent; +import org.eclipse.bpmn2.IntermediateThrowEvent; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.LaneSet; +import org.eclipse.bpmn2.LinkEventDefinition; +import org.eclipse.bpmn2.LoopCharacteristics; +import org.eclipse.bpmn2.ManualTask; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.MessageEventDefinition; +import org.eclipse.bpmn2.MessageFlow; +import org.eclipse.bpmn2.MessageFlowAssociation; +import org.eclipse.bpmn2.Monitoring; +import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics; +import org.eclipse.bpmn2.Operation; +import org.eclipse.bpmn2.OutputSet; +import org.eclipse.bpmn2.ParallelGateway; +import org.eclipse.bpmn2.Participant; +import org.eclipse.bpmn2.ParticipantAssociation; +import org.eclipse.bpmn2.ParticipantMultiplicity; +import org.eclipse.bpmn2.PartnerEntity; +import org.eclipse.bpmn2.PartnerRole; +import org.eclipse.bpmn2.Performer; +import org.eclipse.bpmn2.PotentialOwner; +import org.eclipse.bpmn2.Property; +import org.eclipse.bpmn2.ReceiveTask; +import org.eclipse.bpmn2.Relationship; +import org.eclipse.bpmn2.Rendering; +import org.eclipse.bpmn2.Resource; +import org.eclipse.bpmn2.ResourceAssignmentExpression; +import org.eclipse.bpmn2.ResourceParameter; +import org.eclipse.bpmn2.ResourceParameterBinding; +import org.eclipse.bpmn2.ResourceRole; +import org.eclipse.bpmn2.RootElement; +import org.eclipse.bpmn2.ScriptTask; +import org.eclipse.bpmn2.SendTask; +import org.eclipse.bpmn2.SequenceFlow; +import org.eclipse.bpmn2.ServiceTask; +import org.eclipse.bpmn2.Signal; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.bpmn2.StandardLoopCharacteristics; +import org.eclipse.bpmn2.StartEvent; +import org.eclipse.bpmn2.SubChoreography; +import org.eclipse.bpmn2.SubConversation; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.TerminateEventDefinition; +import org.eclipse.bpmn2.TextAnnotation; +import org.eclipse.bpmn2.ThrowEvent; +import org.eclipse.bpmn2.TimerEventDefinition; +import org.eclipse.bpmn2.Transaction; +import org.eclipse.bpmn2.UserTask; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see org.eclipse.bpmn2.Bpmn2Package + * @generated + */ +public class Bpmn2AdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static Bpmn2Package modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public Bpmn2AdapterFactory() { + if (modelPackage == null) { + modelPackage = Bpmn2Package.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject) object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected Bpmn2Switch modelSwitch = new Bpmn2Switch() { + @Override + public Adapter caseDocumentRoot(DocumentRoot object) { + return createDocumentRootAdapter(); + } + + @Override + public Adapter caseActivity(Activity object) { + return createActivityAdapter(); + } + + @Override + public Adapter caseAdHocSubProcess(AdHocSubProcess object) { + return createAdHocSubProcessAdapter(); + } + + @Override + public Adapter caseArtifact(Artifact object) { + return createArtifactAdapter(); + } + + @Override + public Adapter caseAssignment(Assignment object) { + return createAssignmentAdapter(); + } + + @Override + public Adapter caseAssociation(Association object) { + return createAssociationAdapter(); + } + + @Override + public Adapter caseAuditing(Auditing object) { + return createAuditingAdapter(); + } + + @Override + public Adapter caseBaseElement(BaseElement object) { + return createBaseElementAdapter(); + } + + @Override + public Adapter caseBoundaryEvent(BoundaryEvent object) { + return createBoundaryEventAdapter(); + } + + @Override + public Adapter caseBusinessRuleTask(BusinessRuleTask object) { + return createBusinessRuleTaskAdapter(); + } + + @Override + public Adapter caseCallActivity(CallActivity object) { + return createCallActivityAdapter(); + } + + @Override + public Adapter caseCallChoreography(CallChoreography object) { + return createCallChoreographyAdapter(); + } + + @Override + public Adapter caseCallConversation(CallConversation object) { + return createCallConversationAdapter(); + } + + @Override + public Adapter caseCallableElement(CallableElement object) { + return createCallableElementAdapter(); + } + + @Override + public Adapter caseCancelEventDefinition(CancelEventDefinition object) { + return createCancelEventDefinitionAdapter(); + } + + @Override + public Adapter caseCatchEvent(CatchEvent object) { + return createCatchEventAdapter(); + } + + @Override + public Adapter caseCategory(Category object) { + return createCategoryAdapter(); + } + + @Override + public Adapter caseCategoryValue(CategoryValue object) { + return createCategoryValueAdapter(); + } + + @Override + public Adapter caseChoreography(Choreography object) { + return createChoreographyAdapter(); + } + + @Override + public Adapter caseChoreographyActivity(ChoreographyActivity object) { + return createChoreographyActivityAdapter(); + } + + @Override + public Adapter caseChoreographyTask(ChoreographyTask object) { + return createChoreographyTaskAdapter(); + } + + @Override + public Adapter caseCollaboration(Collaboration object) { + return createCollaborationAdapter(); + } + + @Override + public Adapter caseCompensateEventDefinition(CompensateEventDefinition object) { + return createCompensateEventDefinitionAdapter(); + } + + @Override + public Adapter caseComplexBehaviorDefinition(ComplexBehaviorDefinition object) { + return createComplexBehaviorDefinitionAdapter(); + } + + @Override + public Adapter caseComplexGateway(ComplexGateway object) { + return createComplexGatewayAdapter(); + } + + @Override + public Adapter caseConditionalEventDefinition(ConditionalEventDefinition object) { + return createConditionalEventDefinitionAdapter(); + } + + @Override + public Adapter caseConversation(Conversation object) { + return createConversationAdapter(); + } + + @Override + public Adapter caseConversationAssociation(ConversationAssociation object) { + return createConversationAssociationAdapter(); + } + + @Override + public Adapter caseConversationLink(ConversationLink object) { + return createConversationLinkAdapter(); + } + + @Override + public Adapter caseConversationNode(ConversationNode object) { + return createConversationNodeAdapter(); + } + + @Override + public Adapter caseCorrelationKey(CorrelationKey object) { + return createCorrelationKeyAdapter(); + } + + @Override + public Adapter caseCorrelationProperty(CorrelationProperty object) { + return createCorrelationPropertyAdapter(); + } + + @Override + public Adapter caseCorrelationPropertyBinding(CorrelationPropertyBinding object) { + return createCorrelationPropertyBindingAdapter(); + } + + @Override + public Adapter caseCorrelationPropertyRetrievalExpression(CorrelationPropertyRetrievalExpression object) { + return createCorrelationPropertyRetrievalExpressionAdapter(); + } + + @Override + public Adapter caseCorrelationSubscription(CorrelationSubscription object) { + return createCorrelationSubscriptionAdapter(); + } + + @Override + public Adapter caseDataAssociation(DataAssociation object) { + return createDataAssociationAdapter(); + } + + @Override + public Adapter caseDataInput(DataInput object) { + return createDataInputAdapter(); + } + + @Override + public Adapter caseDataInputAssociation(DataInputAssociation object) { + return createDataInputAssociationAdapter(); + } + + @Override + public Adapter caseDataObject(DataObject object) { + return createDataObjectAdapter(); + } + + @Override + public Adapter caseDataObjectReference(DataObjectReference object) { + return createDataObjectReferenceAdapter(); + } + + @Override + public Adapter caseDataOutput(DataOutput object) { + return createDataOutputAdapter(); + } + + @Override + public Adapter caseDataOutputAssociation(DataOutputAssociation object) { + return createDataOutputAssociationAdapter(); + } + + @Override + public Adapter caseDataState(DataState object) { + return createDataStateAdapter(); + } + + @Override + public Adapter caseDataStore(DataStore object) { + return createDataStoreAdapter(); + } + + @Override + public Adapter caseDataStoreReference(DataStoreReference object) { + return createDataStoreReferenceAdapter(); + } + + @Override + public Adapter caseDefinitions(Definitions object) { + return createDefinitionsAdapter(); + } + + @Override + public Adapter caseDocumentation(Documentation object) { + return createDocumentationAdapter(); + } + + @Override + public Adapter caseEndEvent(EndEvent object) { + return createEndEventAdapter(); + } + + @Override + public Adapter caseEndPoint(EndPoint object) { + return createEndPointAdapter(); + } + + @Override + public Adapter caseError(org.eclipse.bpmn2.Error object) { + return createErrorAdapter(); + } + + @Override + public Adapter caseErrorEventDefinition(ErrorEventDefinition object) { + return createErrorEventDefinitionAdapter(); + } + + @Override + public Adapter caseEscalation(Escalation object) { + return createEscalationAdapter(); + } + + @Override + public Adapter caseEscalationEventDefinition(EscalationEventDefinition object) { + return createEscalationEventDefinitionAdapter(); + } + + @Override + public Adapter caseEvent(Event object) { + return createEventAdapter(); + } + + @Override + public Adapter caseEventBasedGateway(EventBasedGateway object) { + return createEventBasedGatewayAdapter(); + } + + @Override + public Adapter caseEventDefinition(EventDefinition object) { + return createEventDefinitionAdapter(); + } + + @Override + public Adapter caseExclusiveGateway(ExclusiveGateway object) { + return createExclusiveGatewayAdapter(); + } + + @Override + public Adapter caseExpression(Expression object) { + return createExpressionAdapter(); + } + + @Override + public Adapter caseExtension(Extension object) { + return createExtensionAdapter(); + } + + @Override + public Adapter caseExtensionAttributeDefinition(ExtensionAttributeDefinition object) { + return createExtensionAttributeDefinitionAdapter(); + } + + @Override + public Adapter caseExtensionAttributeValue(ExtensionAttributeValue object) { + return createExtensionAttributeValueAdapter(); + } + + @Override + public Adapter caseExtensionDefinition(ExtensionDefinition object) { + return createExtensionDefinitionAdapter(); + } + + @Override + public Adapter caseFlowElement(FlowElement object) { + return createFlowElementAdapter(); + } + + @Override + public Adapter caseFlowElementsContainer(FlowElementsContainer object) { + return createFlowElementsContainerAdapter(); + } + + @Override + public Adapter caseFlowNode(FlowNode object) { + return createFlowNodeAdapter(); + } + + @Override + public Adapter caseFormalExpression(FormalExpression object) { + return createFormalExpressionAdapter(); + } + + @Override + public Adapter caseGateway(Gateway object) { + return createGatewayAdapter(); + } + + @Override + public Adapter caseGlobalBusinessRuleTask(GlobalBusinessRuleTask object) { + return createGlobalBusinessRuleTaskAdapter(); + } + + @Override + public Adapter caseGlobalChoreographyTask(GlobalChoreographyTask object) { + return createGlobalChoreographyTaskAdapter(); + } + + @Override + public Adapter caseGlobalConversation(GlobalConversation object) { + return createGlobalConversationAdapter(); + } + + @Override + public Adapter caseGlobalManualTask(GlobalManualTask object) { + return createGlobalManualTaskAdapter(); + } + + @Override + public Adapter caseGlobalScriptTask(GlobalScriptTask object) { + return createGlobalScriptTaskAdapter(); + } + + @Override + public Adapter caseGlobalTask(GlobalTask object) { + return createGlobalTaskAdapter(); + } + + @Override + public Adapter caseGlobalUserTask(GlobalUserTask object) { + return createGlobalUserTaskAdapter(); + } + + @Override + public Adapter caseGroup(Group object) { + return createGroupAdapter(); + } + + @Override + public Adapter caseHumanPerformer(HumanPerformer object) { + return createHumanPerformerAdapter(); + } + + @Override + public Adapter caseImplicitThrowEvent(ImplicitThrowEvent object) { + return createImplicitThrowEventAdapter(); + } + + @Override + public Adapter caseImport(Import object) { + return createImportAdapter(); + } + + @Override + public Adapter caseInclusiveGateway(InclusiveGateway object) { + return createInclusiveGatewayAdapter(); + } + + @Override + public Adapter caseInputOutputBinding(InputOutputBinding object) { + return createInputOutputBindingAdapter(); + } + + @Override + public Adapter caseInputOutputSpecification(InputOutputSpecification object) { + return createInputOutputSpecificationAdapter(); + } + + @Override + public Adapter caseInputSet(InputSet object) { + return createInputSetAdapter(); + } + + @Override + public Adapter caseInteractionNode(InteractionNode object) { + return createInteractionNodeAdapter(); + } + + @Override + public Adapter caseInterface(Interface object) { + return createInterfaceAdapter(); + } + + @Override + public Adapter caseIntermediateCatchEvent(IntermediateCatchEvent object) { + return createIntermediateCatchEventAdapter(); + } + + @Override + public Adapter caseIntermediateThrowEvent(IntermediateThrowEvent object) { + return createIntermediateThrowEventAdapter(); + } + + @Override + public Adapter caseItemAwareElement(ItemAwareElement object) { + return createItemAwareElementAdapter(); + } + + @Override + public Adapter caseItemDefinition(ItemDefinition object) { + return createItemDefinitionAdapter(); + } + + @Override + public Adapter caseLane(Lane object) { + return createLaneAdapter(); + } + + @Override + public Adapter caseLaneSet(LaneSet object) { + return createLaneSetAdapter(); + } + + @Override + public Adapter caseLinkEventDefinition(LinkEventDefinition object) { + return createLinkEventDefinitionAdapter(); + } + + @Override + public Adapter caseLoopCharacteristics(LoopCharacteristics object) { + return createLoopCharacteristicsAdapter(); + } + + @Override + public Adapter caseManualTask(ManualTask object) { + return createManualTaskAdapter(); + } + + @Override + public Adapter caseMessage(Message object) { + return createMessageAdapter(); + } + + @Override + public Adapter caseMessageEventDefinition(MessageEventDefinition object) { + return createMessageEventDefinitionAdapter(); + } + + @Override + public Adapter caseMessageFlow(MessageFlow object) { + return createMessageFlowAdapter(); + } + + @Override + public Adapter caseMessageFlowAssociation(MessageFlowAssociation object) { + return createMessageFlowAssociationAdapter(); + } + + @Override + public Adapter caseMonitoring(Monitoring object) { + return createMonitoringAdapter(); + } + + @Override + public Adapter caseMultiInstanceLoopCharacteristics(MultiInstanceLoopCharacteristics object) { + return createMultiInstanceLoopCharacteristicsAdapter(); + } + + @Override + public Adapter caseOperation(Operation object) { + return createOperationAdapter(); + } + + @Override + public Adapter caseOutputSet(OutputSet object) { + return createOutputSetAdapter(); + } + + @Override + public Adapter caseParallelGateway(ParallelGateway object) { + return createParallelGatewayAdapter(); + } + + @Override + public Adapter caseParticipant(Participant object) { + return createParticipantAdapter(); + } + + @Override + public Adapter caseParticipantAssociation(ParticipantAssociation object) { + return createParticipantAssociationAdapter(); + } + + @Override + public Adapter caseParticipantMultiplicity(ParticipantMultiplicity object) { + return createParticipantMultiplicityAdapter(); + } + + @Override + public Adapter casePartnerEntity(PartnerEntity object) { + return createPartnerEntityAdapter(); + } + + @Override + public Adapter casePartnerRole(PartnerRole object) { + return createPartnerRoleAdapter(); + } + + @Override + public Adapter casePerformer(Performer object) { + return createPerformerAdapter(); + } + + @Override + public Adapter casePotentialOwner(PotentialOwner object) { + return createPotentialOwnerAdapter(); + } + + @Override + public Adapter caseProcess(org.eclipse.bpmn2.Process object) { + return createProcessAdapter(); + } + + @Override + public Adapter caseProperty(Property object) { + return createPropertyAdapter(); + } + + @Override + public Adapter caseReceiveTask(ReceiveTask object) { + return createReceiveTaskAdapter(); + } + + @Override + public Adapter caseRelationship(Relationship object) { + return createRelationshipAdapter(); + } + + @Override + public Adapter caseRendering(Rendering object) { + return createRenderingAdapter(); + } + + @Override + public Adapter caseResource(Resource object) { + return createResourceAdapter(); + } + + @Override + public Adapter caseResourceAssignmentExpression(ResourceAssignmentExpression object) { + return createResourceAssignmentExpressionAdapter(); + } + + @Override + public Adapter caseResourceParameter(ResourceParameter object) { + return createResourceParameterAdapter(); + } + + @Override + public Adapter caseResourceParameterBinding(ResourceParameterBinding object) { + return createResourceParameterBindingAdapter(); + } + + @Override + public Adapter caseResourceRole(ResourceRole object) { + return createResourceRoleAdapter(); + } + + @Override + public Adapter caseRootElement(RootElement object) { + return createRootElementAdapter(); + } + + @Override + public Adapter caseScriptTask(ScriptTask object) { + return createScriptTaskAdapter(); + } + + @Override + public Adapter caseSendTask(SendTask object) { + return createSendTaskAdapter(); + } + + @Override + public Adapter caseSequenceFlow(SequenceFlow object) { + return createSequenceFlowAdapter(); + } + + @Override + public Adapter caseServiceTask(ServiceTask object) { + return createServiceTaskAdapter(); + } + + @Override + public Adapter caseSignal(Signal object) { + return createSignalAdapter(); + } + + @Override + public Adapter caseSignalEventDefinition(SignalEventDefinition object) { + return createSignalEventDefinitionAdapter(); + } + + @Override + public Adapter caseStandardLoopCharacteristics(StandardLoopCharacteristics object) { + return createStandardLoopCharacteristicsAdapter(); + } + + @Override + public Adapter caseStartEvent(StartEvent object) { + return createStartEventAdapter(); + } + + @Override + public Adapter caseSubChoreography(SubChoreography object) { + return createSubChoreographyAdapter(); + } + + @Override + public Adapter caseSubConversation(SubConversation object) { + return createSubConversationAdapter(); + } + + @Override + public Adapter caseSubProcess(SubProcess object) { + return createSubProcessAdapter(); + } + + @Override + public Adapter caseTask(Task object) { + return createTaskAdapter(); + } + + @Override + public Adapter caseTerminateEventDefinition(TerminateEventDefinition object) { + return createTerminateEventDefinitionAdapter(); + } + + @Override + public Adapter caseTextAnnotation(TextAnnotation object) { + return createTextAnnotationAdapter(); + } + + @Override + public Adapter caseThrowEvent(ThrowEvent object) { + return createThrowEventAdapter(); + } + + @Override + public Adapter caseTimerEventDefinition(TimerEventDefinition object) { + return createTimerEventDefinitionAdapter(); + } + + @Override + public Adapter caseTransaction(Transaction object) { + return createTransactionAdapter(); + } + + @Override + public Adapter caseUserTask(UserTask object) { + return createUserTaskAdapter(); + } + + @Override + public Adapter caseEventSubprocess(EventSubprocess object) { + return createEventSubprocessAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject) target); + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.DocumentRoot Document Root}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.DocumentRoot + * @generated + */ + public Adapter createDocumentRootAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Activity Activity}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Activity + * @generated + */ + public Adapter createActivityAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.AdHocSubProcess Ad Hoc Sub Process}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.AdHocSubProcess + * @generated + */ + public Adapter createAdHocSubProcessAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Artifact Artifact}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Artifact + * @generated + */ + public Adapter createArtifactAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Assignment Assignment}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Assignment + * @generated + */ + public Adapter createAssignmentAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Association Association}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Association + * @generated + */ + public Adapter createAssociationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Auditing Auditing}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Auditing + * @generated + */ + public Adapter createAuditingAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.BaseElement Base Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.BaseElement + * @generated + */ + public Adapter createBaseElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.BoundaryEvent Boundary Event}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.BoundaryEvent + * @generated + */ + public Adapter createBoundaryEventAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.BusinessRuleTask Business Rule Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.BusinessRuleTask + * @generated + */ + public Adapter createBusinessRuleTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.CallActivity Call Activity}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.CallActivity + * @generated + */ + public Adapter createCallActivityAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.CallChoreography Call Choreography}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.CallChoreography + * @generated + */ + public Adapter createCallChoreographyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.CallConversation Call Conversation}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.CallConversation + * @generated + */ + public Adapter createCallConversationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.CallableElement Callable Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.CallableElement + * @generated + */ + public Adapter createCallableElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.CancelEventDefinition Cancel Event Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.CancelEventDefinition + * @generated + */ + public Adapter createCancelEventDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.CatchEvent Catch Event}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.CatchEvent + * @generated + */ + public Adapter createCatchEventAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Category Category}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Category + * @generated + */ + public Adapter createCategoryAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.CategoryValue Category Value}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.CategoryValue + * @generated + */ + public Adapter createCategoryValueAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Choreography Choreography}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Choreography + * @generated + */ + public Adapter createChoreographyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ChoreographyActivity Choreography Activity}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ChoreographyActivity + * @generated + */ + public Adapter createChoreographyActivityAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ChoreographyTask Choreography Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ChoreographyTask + * @generated + */ + public Adapter createChoreographyTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Collaboration Collaboration}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Collaboration + * @generated + */ + public Adapter createCollaborationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.CompensateEventDefinition Compensate Event Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.CompensateEventDefinition + * @generated + */ + public Adapter createCompensateEventDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ComplexBehaviorDefinition Complex Behavior Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ComplexBehaviorDefinition + * @generated + */ + public Adapter createComplexBehaviorDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ComplexGateway Complex Gateway}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ComplexGateway + * @generated + */ + public Adapter createComplexGatewayAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ConditionalEventDefinition Conditional Event Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ConditionalEventDefinition + * @generated + */ + public Adapter createConditionalEventDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Conversation Conversation}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Conversation + * @generated + */ + public Adapter createConversationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ConversationAssociation Conversation Association}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ConversationAssociation + * @generated + */ + public Adapter createConversationAssociationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ConversationLink Conversation Link}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ConversationLink + * @generated + */ + public Adapter createConversationLinkAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ConversationNode Conversation Node}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ConversationNode + * @generated + */ + public Adapter createConversationNodeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.CorrelationKey Correlation Key}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.CorrelationKey + * @generated + */ + public Adapter createCorrelationKeyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.CorrelationProperty Correlation Property}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.CorrelationProperty + * @generated + */ + public Adapter createCorrelationPropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.CorrelationPropertyBinding Correlation Property Binding}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.CorrelationPropertyBinding + * @generated + */ + public Adapter createCorrelationPropertyBindingAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression Correlation Property Retrieval Expression}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression + * @generated + */ + public Adapter createCorrelationPropertyRetrievalExpressionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.CorrelationSubscription Correlation Subscription}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.CorrelationSubscription + * @generated + */ + public Adapter createCorrelationSubscriptionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.DataAssociation Data Association}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.DataAssociation + * @generated + */ + public Adapter createDataAssociationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.DataInput Data Input}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.DataInput + * @generated + */ + public Adapter createDataInputAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.DataInputAssociation Data Input Association}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.DataInputAssociation + * @generated + */ + public Adapter createDataInputAssociationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.DataObject Data Object}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.DataObject + * @generated + */ + public Adapter createDataObjectAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.DataObjectReference Data Object Reference}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.DataObjectReference + * @generated + */ + public Adapter createDataObjectReferenceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.DataOutput Data Output}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.DataOutput + * @generated + */ + public Adapter createDataOutputAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.DataOutputAssociation Data Output Association}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.DataOutputAssociation + * @generated + */ + public Adapter createDataOutputAssociationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.DataState Data State}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.DataState + * @generated + */ + public Adapter createDataStateAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.DataStore Data Store}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.DataStore + * @generated + */ + public Adapter createDataStoreAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.DataStoreReference Data Store Reference}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.DataStoreReference + * @generated + */ + public Adapter createDataStoreReferenceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Definitions Definitions}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Definitions + * @generated + */ + public Adapter createDefinitionsAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Documentation Documentation}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Documentation + * @generated + */ + public Adapter createDocumentationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.EndEvent End Event}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.EndEvent + * @generated + */ + public Adapter createEndEventAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.EndPoint End Point}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.EndPoint + * @generated + */ + public Adapter createEndPointAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Error Error}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Error + * @generated + */ + public Adapter createErrorAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ErrorEventDefinition Error Event Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ErrorEventDefinition + * @generated + */ + public Adapter createErrorEventDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Escalation Escalation}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Escalation + * @generated + */ + public Adapter createEscalationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.EscalationEventDefinition Escalation Event Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.EscalationEventDefinition + * @generated + */ + public Adapter createEscalationEventDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Event Event}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Event + * @generated + */ + public Adapter createEventAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.EventBasedGateway Event Based Gateway}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.EventBasedGateway + * @generated + */ + public Adapter createEventBasedGatewayAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.EventDefinition Event Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.EventDefinition + * @generated + */ + public Adapter createEventDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ExclusiveGateway Exclusive Gateway}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ExclusiveGateway + * @generated + */ + public Adapter createExclusiveGatewayAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Expression Expression}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Expression + * @generated + */ + public Adapter createExpressionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Extension Extension}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Extension + * @generated + */ + public Adapter createExtensionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ExtensionAttributeDefinition Extension Attribute Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ExtensionAttributeDefinition + * @generated + */ + public Adapter createExtensionAttributeDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ExtensionAttributeValue Extension Attribute Value}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ExtensionAttributeValue + * @generated + */ + public Adapter createExtensionAttributeValueAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ExtensionDefinition Extension Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ExtensionDefinition + * @generated + */ + public Adapter createExtensionDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.FlowElement Flow Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.FlowElement + * @generated + */ + public Adapter createFlowElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.FlowElementsContainer Flow Elements Container}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.FlowElementsContainer + * @generated + */ + public Adapter createFlowElementsContainerAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.FlowNode Flow Node}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.FlowNode + * @generated + */ + public Adapter createFlowNodeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.FormalExpression Formal Expression}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.FormalExpression + * @generated + */ + public Adapter createFormalExpressionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Gateway Gateway}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Gateway + * @generated + */ + public Adapter createGatewayAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.GlobalBusinessRuleTask Global Business Rule Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.GlobalBusinessRuleTask + * @generated + */ + public Adapter createGlobalBusinessRuleTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.GlobalChoreographyTask Global Choreography Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.GlobalChoreographyTask + * @generated + */ + public Adapter createGlobalChoreographyTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.GlobalConversation Global Conversation}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.GlobalConversation + * @generated + */ + public Adapter createGlobalConversationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.GlobalManualTask Global Manual Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.GlobalManualTask + * @generated + */ + public Adapter createGlobalManualTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.GlobalScriptTask Global Script Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.GlobalScriptTask + * @generated + */ + public Adapter createGlobalScriptTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.GlobalTask Global Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.GlobalTask + * @generated + */ + public Adapter createGlobalTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.GlobalUserTask Global User Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.GlobalUserTask + * @generated + */ + public Adapter createGlobalUserTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Group Group}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Group + * @generated + */ + public Adapter createGroupAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.HumanPerformer Human Performer}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.HumanPerformer + * @generated + */ + public Adapter createHumanPerformerAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ImplicitThrowEvent Implicit Throw Event}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ImplicitThrowEvent + * @generated + */ + public Adapter createImplicitThrowEventAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Import Import}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Import + * @generated + */ + public Adapter createImportAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.InclusiveGateway Inclusive Gateway}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.InclusiveGateway + * @generated + */ + public Adapter createInclusiveGatewayAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.InputOutputBinding Input Output Binding}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.InputOutputBinding + * @generated + */ + public Adapter createInputOutputBindingAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.InputOutputSpecification Input Output Specification}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.InputOutputSpecification + * @generated + */ + public Adapter createInputOutputSpecificationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.InputSet Input Set}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.InputSet + * @generated + */ + public Adapter createInputSetAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.InteractionNode Interaction Node}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.InteractionNode + * @generated + */ + public Adapter createInteractionNodeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Interface Interface}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Interface + * @generated + */ + public Adapter createInterfaceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.IntermediateCatchEvent Intermediate Catch Event}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.IntermediateCatchEvent + * @generated + */ + public Adapter createIntermediateCatchEventAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.IntermediateThrowEvent Intermediate Throw Event}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.IntermediateThrowEvent + * @generated + */ + public Adapter createIntermediateThrowEventAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ItemAwareElement Item Aware Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ItemAwareElement + * @generated + */ + public Adapter createItemAwareElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ItemDefinition Item Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ItemDefinition + * @generated + */ + public Adapter createItemDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Lane Lane}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Lane + * @generated + */ + public Adapter createLaneAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.LaneSet Lane Set}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.LaneSet + * @generated + */ + public Adapter createLaneSetAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.LinkEventDefinition Link Event Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.LinkEventDefinition + * @generated + */ + public Adapter createLinkEventDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.LoopCharacteristics Loop Characteristics}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.LoopCharacteristics + * @generated + */ + public Adapter createLoopCharacteristicsAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ManualTask Manual Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ManualTask + * @generated + */ + public Adapter createManualTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Message Message}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Message + * @generated + */ + public Adapter createMessageAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.MessageEventDefinition Message Event Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.MessageEventDefinition + * @generated + */ + public Adapter createMessageEventDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.MessageFlow Message Flow}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.MessageFlow + * @generated + */ + public Adapter createMessageFlowAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.MessageFlowAssociation Message Flow Association}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.MessageFlowAssociation + * @generated + */ + public Adapter createMessageFlowAssociationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Monitoring Monitoring}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Monitoring + * @generated + */ + public Adapter createMonitoringAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.MultiInstanceLoopCharacteristics Multi Instance Loop Characteristics}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.MultiInstanceLoopCharacteristics + * @generated + */ + public Adapter createMultiInstanceLoopCharacteristicsAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Operation Operation}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Operation + * @generated + */ + public Adapter createOperationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.OutputSet Output Set}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.OutputSet + * @generated + */ + public Adapter createOutputSetAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ParallelGateway Parallel Gateway}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ParallelGateway + * @generated + */ + public Adapter createParallelGatewayAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Participant Participant}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Participant + * @generated + */ + public Adapter createParticipantAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ParticipantAssociation Participant Association}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ParticipantAssociation + * @generated + */ + public Adapter createParticipantAssociationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ParticipantMultiplicity Participant Multiplicity}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ParticipantMultiplicity + * @generated + */ + public Adapter createParticipantMultiplicityAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.PartnerEntity Partner Entity}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.PartnerEntity + * @generated + */ + public Adapter createPartnerEntityAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.PartnerRole Partner Role}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.PartnerRole + * @generated + */ + public Adapter createPartnerRoleAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Performer Performer}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Performer + * @generated + */ + public Adapter createPerformerAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.PotentialOwner Potential Owner}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.PotentialOwner + * @generated + */ + public Adapter createPotentialOwnerAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Process Process}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Process + * @generated + */ + public Adapter createProcessAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Property Property}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Property + * @generated + */ + public Adapter createPropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ReceiveTask Receive Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ReceiveTask + * @generated + */ + public Adapter createReceiveTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Relationship Relationship}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Relationship + * @generated + */ + public Adapter createRelationshipAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Rendering Rendering}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Rendering + * @generated + */ + public Adapter createRenderingAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Resource Resource}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Resource + * @generated + */ + public Adapter createResourceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ResourceAssignmentExpression Resource Assignment Expression}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ResourceAssignmentExpression + * @generated + */ + public Adapter createResourceAssignmentExpressionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ResourceParameter Resource Parameter}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ResourceParameter + * @generated + */ + public Adapter createResourceParameterAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ResourceParameterBinding Resource Parameter Binding}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ResourceParameterBinding + * @generated + */ + public Adapter createResourceParameterBindingAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ResourceRole Resource Role}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ResourceRole + * @generated + */ + public Adapter createResourceRoleAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.RootElement Root Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.RootElement + * @generated + */ + public Adapter createRootElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ScriptTask Script Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ScriptTask + * @generated + */ + public Adapter createScriptTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.SendTask Send Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.SendTask + * @generated + */ + public Adapter createSendTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.SequenceFlow Sequence Flow}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.SequenceFlow + * @generated + */ + public Adapter createSequenceFlowAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ServiceTask Service Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ServiceTask + * @generated + */ + public Adapter createServiceTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Signal Signal}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Signal + * @generated + */ + public Adapter createSignalAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.SignalEventDefinition Signal Event Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.SignalEventDefinition + * @generated + */ + public Adapter createSignalEventDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.StandardLoopCharacteristics Standard Loop Characteristics}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.StandardLoopCharacteristics + * @generated + */ + public Adapter createStandardLoopCharacteristicsAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.StartEvent Start Event}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.StartEvent + * @generated + */ + public Adapter createStartEventAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.SubChoreography Sub Choreography}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.SubChoreography + * @generated + */ + public Adapter createSubChoreographyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.SubConversation Sub Conversation}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.SubConversation + * @generated + */ + public Adapter createSubConversationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.SubProcess Sub Process}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.SubProcess + * @generated + */ + public Adapter createSubProcessAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Task Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Task + * @generated + */ + public Adapter createTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.TerminateEventDefinition Terminate Event Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.TerminateEventDefinition + * @generated + */ + public Adapter createTerminateEventDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.TextAnnotation Text Annotation}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.TextAnnotation + * @generated + */ + public Adapter createTextAnnotationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.ThrowEvent Throw Event}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.ThrowEvent + * @generated + */ + public Adapter createThrowEventAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.TimerEventDefinition Timer Event Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.TimerEventDefinition + * @generated + */ + public Adapter createTimerEventDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.Transaction Transaction}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.Transaction + * @generated + */ + public Adapter createTransactionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.UserTask User Task}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.UserTask + * @generated + */ + public Adapter createUserTaskAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.EventSubprocess Event Subprocess}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.bpmn2.EventSubprocess + * @generated + */ + public Adapter createEventSubprocessAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //Bpmn2AdapterFactory diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/util/Bpmn2Switch.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/util/Bpmn2Switch.java new file mode 100644 index 00000000000..01d93a591e4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/util/Bpmn2Switch.java @@ -0,0 +1,4031 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.bpmn2.util; + +import java.util.List; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.Artifact; +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.Association; +import org.eclipse.bpmn2.Auditing; +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.BusinessRuleTask; +import org.eclipse.bpmn2.CallActivity; +import org.eclipse.bpmn2.CallChoreography; +import org.eclipse.bpmn2.CallConversation; +import org.eclipse.bpmn2.CallableElement; +import org.eclipse.bpmn2.CancelEventDefinition; +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.Category; +import org.eclipse.bpmn2.CategoryValue; +import org.eclipse.bpmn2.Choreography; +import org.eclipse.bpmn2.ChoreographyActivity; +import org.eclipse.bpmn2.ChoreographyTask; +import org.eclipse.bpmn2.Collaboration; +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.ComplexBehaviorDefinition; +import org.eclipse.bpmn2.ComplexGateway; +import org.eclipse.bpmn2.ConditionalEventDefinition; +import org.eclipse.bpmn2.Conversation; +import org.eclipse.bpmn2.ConversationAssociation; +import org.eclipse.bpmn2.ConversationLink; +import org.eclipse.bpmn2.ConversationNode; +import org.eclipse.bpmn2.CorrelationKey; +import org.eclipse.bpmn2.CorrelationProperty; +import org.eclipse.bpmn2.CorrelationPropertyBinding; +import org.eclipse.bpmn2.CorrelationPropertyRetrievalExpression; +import org.eclipse.bpmn2.CorrelationSubscription; +import org.eclipse.bpmn2.DataAssociation; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataObject; +import org.eclipse.bpmn2.DataObjectReference; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.DataState; +import org.eclipse.bpmn2.DataStore; +import org.eclipse.bpmn2.DataStoreReference; +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.DocumentRoot; +import org.eclipse.bpmn2.Documentation; +import org.eclipse.bpmn2.EndEvent; +import org.eclipse.bpmn2.EndPoint; +import org.eclipse.bpmn2.ErrorEventDefinition; +import org.eclipse.bpmn2.Escalation; +import org.eclipse.bpmn2.EscalationEventDefinition; +import org.eclipse.bpmn2.Event; +import org.eclipse.bpmn2.EventBasedGateway; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.EventSubprocess; +import org.eclipse.bpmn2.ExclusiveGateway; +import org.eclipse.bpmn2.Expression; +import org.eclipse.bpmn2.Extension; +import org.eclipse.bpmn2.ExtensionAttributeDefinition; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.ExtensionDefinition; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.FlowElementsContainer; +import org.eclipse.bpmn2.FlowNode; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.Gateway; +import org.eclipse.bpmn2.GlobalBusinessRuleTask; +import org.eclipse.bpmn2.GlobalChoreographyTask; +import org.eclipse.bpmn2.GlobalConversation; +import org.eclipse.bpmn2.GlobalManualTask; +import org.eclipse.bpmn2.GlobalScriptTask; +import org.eclipse.bpmn2.GlobalTask; +import org.eclipse.bpmn2.GlobalUserTask; +import org.eclipse.bpmn2.Group; +import org.eclipse.bpmn2.HumanPerformer; +import org.eclipse.bpmn2.ImplicitThrowEvent; +import org.eclipse.bpmn2.Import; +import org.eclipse.bpmn2.InclusiveGateway; +import org.eclipse.bpmn2.InputOutputBinding; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.InteractionNode; +import org.eclipse.bpmn2.Interface; +import org.eclipse.bpmn2.IntermediateCatchEvent; +import org.eclipse.bpmn2.IntermediateThrowEvent; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.LaneSet; +import org.eclipse.bpmn2.LinkEventDefinition; +import org.eclipse.bpmn2.LoopCharacteristics; +import org.eclipse.bpmn2.ManualTask; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.MessageEventDefinition; +import org.eclipse.bpmn2.MessageFlow; +import org.eclipse.bpmn2.MessageFlowAssociation; +import org.eclipse.bpmn2.Monitoring; +import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics; +import org.eclipse.bpmn2.Operation; +import org.eclipse.bpmn2.OutputSet; +import org.eclipse.bpmn2.ParallelGateway; +import org.eclipse.bpmn2.Participant; +import org.eclipse.bpmn2.ParticipantAssociation; +import org.eclipse.bpmn2.ParticipantMultiplicity; +import org.eclipse.bpmn2.PartnerEntity; +import org.eclipse.bpmn2.PartnerRole; +import org.eclipse.bpmn2.Performer; +import org.eclipse.bpmn2.PotentialOwner; +import org.eclipse.bpmn2.Property; +import org.eclipse.bpmn2.ReceiveTask; +import org.eclipse.bpmn2.Relationship; +import org.eclipse.bpmn2.Rendering; +import org.eclipse.bpmn2.Resource; +import org.eclipse.bpmn2.ResourceAssignmentExpression; +import org.eclipse.bpmn2.ResourceParameter; +import org.eclipse.bpmn2.ResourceParameterBinding; +import org.eclipse.bpmn2.ResourceRole; +import org.eclipse.bpmn2.RootElement; +import org.eclipse.bpmn2.ScriptTask; +import org.eclipse.bpmn2.SendTask; +import org.eclipse.bpmn2.SequenceFlow; +import org.eclipse.bpmn2.ServiceTask; +import org.eclipse.bpmn2.Signal; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.bpmn2.StandardLoopCharacteristics; +import org.eclipse.bpmn2.StartEvent; +import org.eclipse.bpmn2.SubChoreography; +import org.eclipse.bpmn2.SubConversation; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.TerminateEventDefinition; +import org.eclipse.bpmn2.TextAnnotation; +import org.eclipse.bpmn2.ThrowEvent; +import org.eclipse.bpmn2.TimerEventDefinition; +import org.eclipse.bpmn2.Transaction; +import org.eclipse.bpmn2.UserTask; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see org.eclipse.bpmn2.Bpmn2Package + * @generated + */ +public class Bpmn2Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static Bpmn2Package modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public Bpmn2Switch() { + if (modelPackage == null) { + modelPackage = Bpmn2Package.eINSTANCE; + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + public T doSwitch(EObject theEObject) { + return doSwitch(theEObject.eClass(), theEObject); + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected T doSwitch(EClass theEClass, EObject theEObject) { + if (theEClass.eContainer() == modelPackage) { + return doSwitch(theEClass.getClassifierID(), theEObject); + } else { + List eSuperTypes = theEClass.getESuperTypes(); + return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case Bpmn2Package.DOCUMENT_ROOT: { + DocumentRoot documentRoot = (DocumentRoot) theEObject; + T result = caseDocumentRoot(documentRoot); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.ACTIVITY: { + Activity activity = (Activity) theEObject; + T result = caseActivity(activity); + if (result == null) + result = caseFlowNode(activity); + if (result == null) + result = caseFlowElement(activity); + if (result == null) + result = caseBaseElement(activity); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.AD_HOC_SUB_PROCESS: { + AdHocSubProcess adHocSubProcess = (AdHocSubProcess) theEObject; + T result = caseAdHocSubProcess(adHocSubProcess); + if (result == null) + result = caseSubProcess(adHocSubProcess); + if (result == null) + result = caseActivity(adHocSubProcess); + if (result == null) + result = caseFlowElementsContainer(adHocSubProcess); + if (result == null) + result = caseFlowNode(adHocSubProcess); + if (result == null) + result = caseFlowElement(adHocSubProcess); + if (result == null) + result = caseBaseElement(adHocSubProcess); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.ARTIFACT: { + Artifact artifact = (Artifact) theEObject; + T result = caseArtifact(artifact); + if (result == null) + result = caseBaseElement(artifact); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.ASSIGNMENT: { + Assignment assignment = (Assignment) theEObject; + T result = caseAssignment(assignment); + if (result == null) + result = caseBaseElement(assignment); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.ASSOCIATION: { + Association association = (Association) theEObject; + T result = caseAssociation(association); + if (result == null) + result = caseArtifact(association); + if (result == null) + result = caseBaseElement(association); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.AUDITING: { + Auditing auditing = (Auditing) theEObject; + T result = caseAuditing(auditing); + if (result == null) + result = caseBaseElement(auditing); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.BASE_ELEMENT: { + BaseElement baseElement = (BaseElement) theEObject; + T result = caseBaseElement(baseElement); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.BOUNDARY_EVENT: { + BoundaryEvent boundaryEvent = (BoundaryEvent) theEObject; + T result = caseBoundaryEvent(boundaryEvent); + if (result == null) + result = caseCatchEvent(boundaryEvent); + if (result == null) + result = caseEvent(boundaryEvent); + if (result == null) + result = caseFlowNode(boundaryEvent); + if (result == null) + result = caseInteractionNode(boundaryEvent); + if (result == null) + result = caseFlowElement(boundaryEvent); + if (result == null) + result = caseBaseElement(boundaryEvent); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.BUSINESS_RULE_TASK: { + BusinessRuleTask businessRuleTask = (BusinessRuleTask) theEObject; + T result = caseBusinessRuleTask(businessRuleTask); + if (result == null) + result = caseTask(businessRuleTask); + if (result == null) + result = caseActivity(businessRuleTask); + if (result == null) + result = caseInteractionNode(businessRuleTask); + if (result == null) + result = caseFlowNode(businessRuleTask); + if (result == null) + result = caseFlowElement(businessRuleTask); + if (result == null) + result = caseBaseElement(businessRuleTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CALL_ACTIVITY: { + CallActivity callActivity = (CallActivity) theEObject; + T result = caseCallActivity(callActivity); + if (result == null) + result = caseActivity(callActivity); + if (result == null) + result = caseFlowNode(callActivity); + if (result == null) + result = caseFlowElement(callActivity); + if (result == null) + result = caseBaseElement(callActivity); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CALL_CHOREOGRAPHY: { + CallChoreography callChoreography = (CallChoreography) theEObject; + T result = caseCallChoreography(callChoreography); + if (result == null) + result = caseChoreographyActivity(callChoreography); + if (result == null) + result = caseFlowNode(callChoreography); + if (result == null) + result = caseFlowElement(callChoreography); + if (result == null) + result = caseBaseElement(callChoreography); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CALL_CONVERSATION: { + CallConversation callConversation = (CallConversation) theEObject; + T result = caseCallConversation(callConversation); + if (result == null) + result = caseConversationNode(callConversation); + if (result == null) + result = caseBaseElement(callConversation); + if (result == null) + result = caseInteractionNode(callConversation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CALLABLE_ELEMENT: { + CallableElement callableElement = (CallableElement) theEObject; + T result = caseCallableElement(callableElement); + if (result == null) + result = caseRootElement(callableElement); + if (result == null) + result = caseBaseElement(callableElement); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CANCEL_EVENT_DEFINITION: { + CancelEventDefinition cancelEventDefinition = (CancelEventDefinition) theEObject; + T result = caseCancelEventDefinition(cancelEventDefinition); + if (result == null) + result = caseEventDefinition(cancelEventDefinition); + if (result == null) + result = caseRootElement(cancelEventDefinition); + if (result == null) + result = caseBaseElement(cancelEventDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CATCH_EVENT: { + CatchEvent catchEvent = (CatchEvent) theEObject; + T result = caseCatchEvent(catchEvent); + if (result == null) + result = caseEvent(catchEvent); + if (result == null) + result = caseFlowNode(catchEvent); + if (result == null) + result = caseInteractionNode(catchEvent); + if (result == null) + result = caseFlowElement(catchEvent); + if (result == null) + result = caseBaseElement(catchEvent); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CATEGORY: { + Category category = (Category) theEObject; + T result = caseCategory(category); + if (result == null) + result = caseRootElement(category); + if (result == null) + result = caseBaseElement(category); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CATEGORY_VALUE: { + CategoryValue categoryValue = (CategoryValue) theEObject; + T result = caseCategoryValue(categoryValue); + if (result == null) + result = caseBaseElement(categoryValue); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CHOREOGRAPHY: { + Choreography choreography = (Choreography) theEObject; + T result = caseChoreography(choreography); + if (result == null) + result = caseCollaboration(choreography); + if (result == null) + result = caseFlowElementsContainer(choreography); + if (result == null) + result = caseRootElement(choreography); + if (result == null) + result = caseBaseElement(choreography); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CHOREOGRAPHY_ACTIVITY: { + ChoreographyActivity choreographyActivity = (ChoreographyActivity) theEObject; + T result = caseChoreographyActivity(choreographyActivity); + if (result == null) + result = caseFlowNode(choreographyActivity); + if (result == null) + result = caseFlowElement(choreographyActivity); + if (result == null) + result = caseBaseElement(choreographyActivity); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CHOREOGRAPHY_TASK: { + ChoreographyTask choreographyTask = (ChoreographyTask) theEObject; + T result = caseChoreographyTask(choreographyTask); + if (result == null) + result = caseChoreographyActivity(choreographyTask); + if (result == null) + result = caseFlowNode(choreographyTask); + if (result == null) + result = caseFlowElement(choreographyTask); + if (result == null) + result = caseBaseElement(choreographyTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.COLLABORATION: { + Collaboration collaboration = (Collaboration) theEObject; + T result = caseCollaboration(collaboration); + if (result == null) + result = caseRootElement(collaboration); + if (result == null) + result = caseBaseElement(collaboration); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.COMPENSATE_EVENT_DEFINITION: { + CompensateEventDefinition compensateEventDefinition = (CompensateEventDefinition) theEObject; + T result = caseCompensateEventDefinition(compensateEventDefinition); + if (result == null) + result = caseEventDefinition(compensateEventDefinition); + if (result == null) + result = caseRootElement(compensateEventDefinition); + if (result == null) + result = caseBaseElement(compensateEventDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.COMPLEX_BEHAVIOR_DEFINITION: { + ComplexBehaviorDefinition complexBehaviorDefinition = (ComplexBehaviorDefinition) theEObject; + T result = caseComplexBehaviorDefinition(complexBehaviorDefinition); + if (result == null) + result = caseBaseElement(complexBehaviorDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.COMPLEX_GATEWAY: { + ComplexGateway complexGateway = (ComplexGateway) theEObject; + T result = caseComplexGateway(complexGateway); + if (result == null) + result = caseGateway(complexGateway); + if (result == null) + result = caseFlowNode(complexGateway); + if (result == null) + result = caseFlowElement(complexGateway); + if (result == null) + result = caseBaseElement(complexGateway); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CONDITIONAL_EVENT_DEFINITION: { + ConditionalEventDefinition conditionalEventDefinition = (ConditionalEventDefinition) theEObject; + T result = caseConditionalEventDefinition(conditionalEventDefinition); + if (result == null) + result = caseEventDefinition(conditionalEventDefinition); + if (result == null) + result = caseRootElement(conditionalEventDefinition); + if (result == null) + result = caseBaseElement(conditionalEventDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CONVERSATION: { + Conversation conversation = (Conversation) theEObject; + T result = caseConversation(conversation); + if (result == null) + result = caseConversationNode(conversation); + if (result == null) + result = caseBaseElement(conversation); + if (result == null) + result = caseInteractionNode(conversation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CONVERSATION_ASSOCIATION: { + ConversationAssociation conversationAssociation = (ConversationAssociation) theEObject; + T result = caseConversationAssociation(conversationAssociation); + if (result == null) + result = caseBaseElement(conversationAssociation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CONVERSATION_LINK: { + ConversationLink conversationLink = (ConversationLink) theEObject; + T result = caseConversationLink(conversationLink); + if (result == null) + result = caseBaseElement(conversationLink); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CONVERSATION_NODE: { + ConversationNode conversationNode = (ConversationNode) theEObject; + T result = caseConversationNode(conversationNode); + if (result == null) + result = caseBaseElement(conversationNode); + if (result == null) + result = caseInteractionNode(conversationNode); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CORRELATION_KEY: { + CorrelationKey correlationKey = (CorrelationKey) theEObject; + T result = caseCorrelationKey(correlationKey); + if (result == null) + result = caseBaseElement(correlationKey); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CORRELATION_PROPERTY: { + CorrelationProperty correlationProperty = (CorrelationProperty) theEObject; + T result = caseCorrelationProperty(correlationProperty); + if (result == null) + result = caseRootElement(correlationProperty); + if (result == null) + result = caseBaseElement(correlationProperty); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CORRELATION_PROPERTY_BINDING: { + CorrelationPropertyBinding correlationPropertyBinding = (CorrelationPropertyBinding) theEObject; + T result = caseCorrelationPropertyBinding(correlationPropertyBinding); + if (result == null) + result = caseBaseElement(correlationPropertyBinding); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CORRELATION_PROPERTY_RETRIEVAL_EXPRESSION: { + CorrelationPropertyRetrievalExpression correlationPropertyRetrievalExpression = (CorrelationPropertyRetrievalExpression) theEObject; + T result = caseCorrelationPropertyRetrievalExpression(correlationPropertyRetrievalExpression); + if (result == null) + result = caseBaseElement(correlationPropertyRetrievalExpression); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.CORRELATION_SUBSCRIPTION: { + CorrelationSubscription correlationSubscription = (CorrelationSubscription) theEObject; + T result = caseCorrelationSubscription(correlationSubscription); + if (result == null) + result = caseBaseElement(correlationSubscription); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.DATA_ASSOCIATION: { + DataAssociation dataAssociation = (DataAssociation) theEObject; + T result = caseDataAssociation(dataAssociation); + if (result == null) + result = caseBaseElement(dataAssociation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.DATA_INPUT: { + DataInput dataInput = (DataInput) theEObject; + T result = caseDataInput(dataInput); + if (result == null) + result = caseItemAwareElement(dataInput); + if (result == null) + result = caseBaseElement(dataInput); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.DATA_INPUT_ASSOCIATION: { + DataInputAssociation dataInputAssociation = (DataInputAssociation) theEObject; + T result = caseDataInputAssociation(dataInputAssociation); + if (result == null) + result = caseDataAssociation(dataInputAssociation); + if (result == null) + result = caseBaseElement(dataInputAssociation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.DATA_OBJECT: { + DataObject dataObject = (DataObject) theEObject; + T result = caseDataObject(dataObject); + if (result == null) + result = caseFlowElement(dataObject); + if (result == null) + result = caseItemAwareElement(dataObject); + if (result == null) + result = caseBaseElement(dataObject); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.DATA_OBJECT_REFERENCE: { + DataObjectReference dataObjectReference = (DataObjectReference) theEObject; + T result = caseDataObjectReference(dataObjectReference); + if (result == null) + result = caseFlowElement(dataObjectReference); + if (result == null) + result = caseItemAwareElement(dataObjectReference); + if (result == null) + result = caseBaseElement(dataObjectReference); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.DATA_OUTPUT: { + DataOutput dataOutput = (DataOutput) theEObject; + T result = caseDataOutput(dataOutput); + if (result == null) + result = caseItemAwareElement(dataOutput); + if (result == null) + result = caseBaseElement(dataOutput); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.DATA_OUTPUT_ASSOCIATION: { + DataOutputAssociation dataOutputAssociation = (DataOutputAssociation) theEObject; + T result = caseDataOutputAssociation(dataOutputAssociation); + if (result == null) + result = caseDataAssociation(dataOutputAssociation); + if (result == null) + result = caseBaseElement(dataOutputAssociation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.DATA_STATE: { + DataState dataState = (DataState) theEObject; + T result = caseDataState(dataState); + if (result == null) + result = caseBaseElement(dataState); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.DATA_STORE: { + DataStore dataStore = (DataStore) theEObject; + T result = caseDataStore(dataStore); + if (result == null) + result = caseItemAwareElement(dataStore); + if (result == null) + result = caseRootElement(dataStore); + if (result == null) + result = caseBaseElement(dataStore); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.DATA_STORE_REFERENCE: { + DataStoreReference dataStoreReference = (DataStoreReference) theEObject; + T result = caseDataStoreReference(dataStoreReference); + if (result == null) + result = caseFlowElement(dataStoreReference); + if (result == null) + result = caseItemAwareElement(dataStoreReference); + if (result == null) + result = caseBaseElement(dataStoreReference); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.DEFINITIONS: { + Definitions definitions = (Definitions) theEObject; + T result = caseDefinitions(definitions); + if (result == null) + result = caseBaseElement(definitions); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.DOCUMENTATION: { + Documentation documentation = (Documentation) theEObject; + T result = caseDocumentation(documentation); + if (result == null) + result = caseBaseElement(documentation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.END_EVENT: { + EndEvent endEvent = (EndEvent) theEObject; + T result = caseEndEvent(endEvent); + if (result == null) + result = caseThrowEvent(endEvent); + if (result == null) + result = caseEvent(endEvent); + if (result == null) + result = caseFlowNode(endEvent); + if (result == null) + result = caseInteractionNode(endEvent); + if (result == null) + result = caseFlowElement(endEvent); + if (result == null) + result = caseBaseElement(endEvent); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.END_POINT: { + EndPoint endPoint = (EndPoint) theEObject; + T result = caseEndPoint(endPoint); + if (result == null) + result = caseRootElement(endPoint); + if (result == null) + result = caseBaseElement(endPoint); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.ERROR: { + org.eclipse.bpmn2.Error error = (org.eclipse.bpmn2.Error) theEObject; + T result = caseError(error); + if (result == null) + result = caseRootElement(error); + if (result == null) + result = caseBaseElement(error); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.ERROR_EVENT_DEFINITION: { + ErrorEventDefinition errorEventDefinition = (ErrorEventDefinition) theEObject; + T result = caseErrorEventDefinition(errorEventDefinition); + if (result == null) + result = caseEventDefinition(errorEventDefinition); + if (result == null) + result = caseRootElement(errorEventDefinition); + if (result == null) + result = caseBaseElement(errorEventDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.ESCALATION: { + Escalation escalation = (Escalation) theEObject; + T result = caseEscalation(escalation); + if (result == null) + result = caseRootElement(escalation); + if (result == null) + result = caseBaseElement(escalation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.ESCALATION_EVENT_DEFINITION: { + EscalationEventDefinition escalationEventDefinition = (EscalationEventDefinition) theEObject; + T result = caseEscalationEventDefinition(escalationEventDefinition); + if (result == null) + result = caseEventDefinition(escalationEventDefinition); + if (result == null) + result = caseRootElement(escalationEventDefinition); + if (result == null) + result = caseBaseElement(escalationEventDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.EVENT: { + Event event = (Event) theEObject; + T result = caseEvent(event); + if (result == null) + result = caseFlowNode(event); + if (result == null) + result = caseInteractionNode(event); + if (result == null) + result = caseFlowElement(event); + if (result == null) + result = caseBaseElement(event); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.EVENT_BASED_GATEWAY: { + EventBasedGateway eventBasedGateway = (EventBasedGateway) theEObject; + T result = caseEventBasedGateway(eventBasedGateway); + if (result == null) + result = caseGateway(eventBasedGateway); + if (result == null) + result = caseFlowNode(eventBasedGateway); + if (result == null) + result = caseFlowElement(eventBasedGateway); + if (result == null) + result = caseBaseElement(eventBasedGateway); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.EVENT_DEFINITION: { + EventDefinition eventDefinition = (EventDefinition) theEObject; + T result = caseEventDefinition(eventDefinition); + if (result == null) + result = caseRootElement(eventDefinition); + if (result == null) + result = caseBaseElement(eventDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.EXCLUSIVE_GATEWAY: { + ExclusiveGateway exclusiveGateway = (ExclusiveGateway) theEObject; + T result = caseExclusiveGateway(exclusiveGateway); + if (result == null) + result = caseGateway(exclusiveGateway); + if (result == null) + result = caseFlowNode(exclusiveGateway); + if (result == null) + result = caseFlowElement(exclusiveGateway); + if (result == null) + result = caseBaseElement(exclusiveGateway); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.EXPRESSION: { + Expression expression = (Expression) theEObject; + T result = caseExpression(expression); + if (result == null) + result = caseBaseElement(expression); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.EXTENSION: { + Extension extension = (Extension) theEObject; + T result = caseExtension(extension); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.EXTENSION_ATTRIBUTE_DEFINITION: { + ExtensionAttributeDefinition extensionAttributeDefinition = (ExtensionAttributeDefinition) theEObject; + T result = caseExtensionAttributeDefinition(extensionAttributeDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.EXTENSION_ATTRIBUTE_VALUE: { + ExtensionAttributeValue extensionAttributeValue = (ExtensionAttributeValue) theEObject; + T result = caseExtensionAttributeValue(extensionAttributeValue); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.EXTENSION_DEFINITION: { + ExtensionDefinition extensionDefinition = (ExtensionDefinition) theEObject; + T result = caseExtensionDefinition(extensionDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.FLOW_ELEMENT: { + FlowElement flowElement = (FlowElement) theEObject; + T result = caseFlowElement(flowElement); + if (result == null) + result = caseBaseElement(flowElement); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.FLOW_ELEMENTS_CONTAINER: { + FlowElementsContainer flowElementsContainer = (FlowElementsContainer) theEObject; + T result = caseFlowElementsContainer(flowElementsContainer); + if (result == null) + result = caseBaseElement(flowElementsContainer); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.FLOW_NODE: { + FlowNode flowNode = (FlowNode) theEObject; + T result = caseFlowNode(flowNode); + if (result == null) + result = caseFlowElement(flowNode); + if (result == null) + result = caseBaseElement(flowNode); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.FORMAL_EXPRESSION: { + FormalExpression formalExpression = (FormalExpression) theEObject; + T result = caseFormalExpression(formalExpression); + if (result == null) + result = caseExpression(formalExpression); + if (result == null) + result = caseBaseElement(formalExpression); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.GATEWAY: { + Gateway gateway = (Gateway) theEObject; + T result = caseGateway(gateway); + if (result == null) + result = caseFlowNode(gateway); + if (result == null) + result = caseFlowElement(gateway); + if (result == null) + result = caseBaseElement(gateway); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.GLOBAL_BUSINESS_RULE_TASK: { + GlobalBusinessRuleTask globalBusinessRuleTask = (GlobalBusinessRuleTask) theEObject; + T result = caseGlobalBusinessRuleTask(globalBusinessRuleTask); + if (result == null) + result = caseGlobalTask(globalBusinessRuleTask); + if (result == null) + result = caseCallableElement(globalBusinessRuleTask); + if (result == null) + result = caseRootElement(globalBusinessRuleTask); + if (result == null) + result = caseBaseElement(globalBusinessRuleTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.GLOBAL_CHOREOGRAPHY_TASK: { + GlobalChoreographyTask globalChoreographyTask = (GlobalChoreographyTask) theEObject; + T result = caseGlobalChoreographyTask(globalChoreographyTask); + if (result == null) + result = caseChoreography(globalChoreographyTask); + if (result == null) + result = caseCollaboration(globalChoreographyTask); + if (result == null) + result = caseFlowElementsContainer(globalChoreographyTask); + if (result == null) + result = caseRootElement(globalChoreographyTask); + if (result == null) + result = caseBaseElement(globalChoreographyTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.GLOBAL_CONVERSATION: { + GlobalConversation globalConversation = (GlobalConversation) theEObject; + T result = caseGlobalConversation(globalConversation); + if (result == null) + result = caseCollaboration(globalConversation); + if (result == null) + result = caseRootElement(globalConversation); + if (result == null) + result = caseBaseElement(globalConversation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.GLOBAL_MANUAL_TASK: { + GlobalManualTask globalManualTask = (GlobalManualTask) theEObject; + T result = caseGlobalManualTask(globalManualTask); + if (result == null) + result = caseGlobalTask(globalManualTask); + if (result == null) + result = caseCallableElement(globalManualTask); + if (result == null) + result = caseRootElement(globalManualTask); + if (result == null) + result = caseBaseElement(globalManualTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.GLOBAL_SCRIPT_TASK: { + GlobalScriptTask globalScriptTask = (GlobalScriptTask) theEObject; + T result = caseGlobalScriptTask(globalScriptTask); + if (result == null) + result = caseGlobalTask(globalScriptTask); + if (result == null) + result = caseCallableElement(globalScriptTask); + if (result == null) + result = caseRootElement(globalScriptTask); + if (result == null) + result = caseBaseElement(globalScriptTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.GLOBAL_TASK: { + GlobalTask globalTask = (GlobalTask) theEObject; + T result = caseGlobalTask(globalTask); + if (result == null) + result = caseCallableElement(globalTask); + if (result == null) + result = caseRootElement(globalTask); + if (result == null) + result = caseBaseElement(globalTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.GLOBAL_USER_TASK: { + GlobalUserTask globalUserTask = (GlobalUserTask) theEObject; + T result = caseGlobalUserTask(globalUserTask); + if (result == null) + result = caseGlobalTask(globalUserTask); + if (result == null) + result = caseCallableElement(globalUserTask); + if (result == null) + result = caseRootElement(globalUserTask); + if (result == null) + result = caseBaseElement(globalUserTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.GROUP: { + Group group = (Group) theEObject; + T result = caseGroup(group); + if (result == null) + result = caseArtifact(group); + if (result == null) + result = caseBaseElement(group); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.HUMAN_PERFORMER: { + HumanPerformer humanPerformer = (HumanPerformer) theEObject; + T result = caseHumanPerformer(humanPerformer); + if (result == null) + result = casePerformer(humanPerformer); + if (result == null) + result = caseResourceRole(humanPerformer); + if (result == null) + result = caseBaseElement(humanPerformer); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.IMPLICIT_THROW_EVENT: { + ImplicitThrowEvent implicitThrowEvent = (ImplicitThrowEvent) theEObject; + T result = caseImplicitThrowEvent(implicitThrowEvent); + if (result == null) + result = caseThrowEvent(implicitThrowEvent); + if (result == null) + result = caseEvent(implicitThrowEvent); + if (result == null) + result = caseFlowNode(implicitThrowEvent); + if (result == null) + result = caseInteractionNode(implicitThrowEvent); + if (result == null) + result = caseFlowElement(implicitThrowEvent); + if (result == null) + result = caseBaseElement(implicitThrowEvent); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.IMPORT: { + Import import_ = (Import) theEObject; + T result = caseImport(import_); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.INCLUSIVE_GATEWAY: { + InclusiveGateway inclusiveGateway = (InclusiveGateway) theEObject; + T result = caseInclusiveGateway(inclusiveGateway); + if (result == null) + result = caseGateway(inclusiveGateway); + if (result == null) + result = caseFlowNode(inclusiveGateway); + if (result == null) + result = caseFlowElement(inclusiveGateway); + if (result == null) + result = caseBaseElement(inclusiveGateway); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.INPUT_OUTPUT_BINDING: { + InputOutputBinding inputOutputBinding = (InputOutputBinding) theEObject; + T result = caseInputOutputBinding(inputOutputBinding); + if (result == null) + result = caseBaseElement(inputOutputBinding); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.INPUT_OUTPUT_SPECIFICATION: { + InputOutputSpecification inputOutputSpecification = (InputOutputSpecification) theEObject; + T result = caseInputOutputSpecification(inputOutputSpecification); + if (result == null) + result = caseBaseElement(inputOutputSpecification); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.INPUT_SET: { + InputSet inputSet = (InputSet) theEObject; + T result = caseInputSet(inputSet); + if (result == null) + result = caseBaseElement(inputSet); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.INTERACTION_NODE: { + InteractionNode interactionNode = (InteractionNode) theEObject; + T result = caseInteractionNode(interactionNode); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.INTERFACE: { + Interface interface_ = (Interface) theEObject; + T result = caseInterface(interface_); + if (result == null) + result = caseRootElement(interface_); + if (result == null) + result = caseBaseElement(interface_); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.INTERMEDIATE_CATCH_EVENT: { + IntermediateCatchEvent intermediateCatchEvent = (IntermediateCatchEvent) theEObject; + T result = caseIntermediateCatchEvent(intermediateCatchEvent); + if (result == null) + result = caseCatchEvent(intermediateCatchEvent); + if (result == null) + result = caseEvent(intermediateCatchEvent); + if (result == null) + result = caseFlowNode(intermediateCatchEvent); + if (result == null) + result = caseInteractionNode(intermediateCatchEvent); + if (result == null) + result = caseFlowElement(intermediateCatchEvent); + if (result == null) + result = caseBaseElement(intermediateCatchEvent); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.INTERMEDIATE_THROW_EVENT: { + IntermediateThrowEvent intermediateThrowEvent = (IntermediateThrowEvent) theEObject; + T result = caseIntermediateThrowEvent(intermediateThrowEvent); + if (result == null) + result = caseThrowEvent(intermediateThrowEvent); + if (result == null) + result = caseEvent(intermediateThrowEvent); + if (result == null) + result = caseFlowNode(intermediateThrowEvent); + if (result == null) + result = caseInteractionNode(intermediateThrowEvent); + if (result == null) + result = caseFlowElement(intermediateThrowEvent); + if (result == null) + result = caseBaseElement(intermediateThrowEvent); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.ITEM_AWARE_ELEMENT: { + ItemAwareElement itemAwareElement = (ItemAwareElement) theEObject; + T result = caseItemAwareElement(itemAwareElement); + if (result == null) + result = caseBaseElement(itemAwareElement); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.ITEM_DEFINITION: { + ItemDefinition itemDefinition = (ItemDefinition) theEObject; + T result = caseItemDefinition(itemDefinition); + if (result == null) + result = caseRootElement(itemDefinition); + if (result == null) + result = caseBaseElement(itemDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.LANE: { + Lane lane = (Lane) theEObject; + T result = caseLane(lane); + if (result == null) + result = caseBaseElement(lane); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.LANE_SET: { + LaneSet laneSet = (LaneSet) theEObject; + T result = caseLaneSet(laneSet); + if (result == null) + result = caseBaseElement(laneSet); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.LINK_EVENT_DEFINITION: { + LinkEventDefinition linkEventDefinition = (LinkEventDefinition) theEObject; + T result = caseLinkEventDefinition(linkEventDefinition); + if (result == null) + result = caseEventDefinition(linkEventDefinition); + if (result == null) + result = caseRootElement(linkEventDefinition); + if (result == null) + result = caseBaseElement(linkEventDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.LOOP_CHARACTERISTICS: { + LoopCharacteristics loopCharacteristics = (LoopCharacteristics) theEObject; + T result = caseLoopCharacteristics(loopCharacteristics); + if (result == null) + result = caseBaseElement(loopCharacteristics); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.MANUAL_TASK: { + ManualTask manualTask = (ManualTask) theEObject; + T result = caseManualTask(manualTask); + if (result == null) + result = caseTask(manualTask); + if (result == null) + result = caseActivity(manualTask); + if (result == null) + result = caseInteractionNode(manualTask); + if (result == null) + result = caseFlowNode(manualTask); + if (result == null) + result = caseFlowElement(manualTask); + if (result == null) + result = caseBaseElement(manualTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.MESSAGE: { + Message message = (Message) theEObject; + T result = caseMessage(message); + if (result == null) + result = caseRootElement(message); + if (result == null) + result = caseBaseElement(message); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.MESSAGE_EVENT_DEFINITION: { + MessageEventDefinition messageEventDefinition = (MessageEventDefinition) theEObject; + T result = caseMessageEventDefinition(messageEventDefinition); + if (result == null) + result = caseEventDefinition(messageEventDefinition); + if (result == null) + result = caseRootElement(messageEventDefinition); + if (result == null) + result = caseBaseElement(messageEventDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.MESSAGE_FLOW: { + MessageFlow messageFlow = (MessageFlow) theEObject; + T result = caseMessageFlow(messageFlow); + if (result == null) + result = caseBaseElement(messageFlow); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.MESSAGE_FLOW_ASSOCIATION: { + MessageFlowAssociation messageFlowAssociation = (MessageFlowAssociation) theEObject; + T result = caseMessageFlowAssociation(messageFlowAssociation); + if (result == null) + result = caseBaseElement(messageFlowAssociation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.MONITORING: { + Monitoring monitoring = (Monitoring) theEObject; + T result = caseMonitoring(monitoring); + if (result == null) + result = caseBaseElement(monitoring); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.MULTI_INSTANCE_LOOP_CHARACTERISTICS: { + MultiInstanceLoopCharacteristics multiInstanceLoopCharacteristics = (MultiInstanceLoopCharacteristics) theEObject; + T result = caseMultiInstanceLoopCharacteristics(multiInstanceLoopCharacteristics); + if (result == null) + result = caseLoopCharacteristics(multiInstanceLoopCharacteristics); + if (result == null) + result = caseBaseElement(multiInstanceLoopCharacteristics); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.OPERATION: { + Operation operation = (Operation) theEObject; + T result = caseOperation(operation); + if (result == null) + result = caseBaseElement(operation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.OUTPUT_SET: { + OutputSet outputSet = (OutputSet) theEObject; + T result = caseOutputSet(outputSet); + if (result == null) + result = caseBaseElement(outputSet); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.PARALLEL_GATEWAY: { + ParallelGateway parallelGateway = (ParallelGateway) theEObject; + T result = caseParallelGateway(parallelGateway); + if (result == null) + result = caseGateway(parallelGateway); + if (result == null) + result = caseFlowNode(parallelGateway); + if (result == null) + result = caseFlowElement(parallelGateway); + if (result == null) + result = caseBaseElement(parallelGateway); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.PARTICIPANT: { + Participant participant = (Participant) theEObject; + T result = caseParticipant(participant); + if (result == null) + result = caseBaseElement(participant); + if (result == null) + result = caseInteractionNode(participant); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.PARTICIPANT_ASSOCIATION: { + ParticipantAssociation participantAssociation = (ParticipantAssociation) theEObject; + T result = caseParticipantAssociation(participantAssociation); + if (result == null) + result = caseBaseElement(participantAssociation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.PARTICIPANT_MULTIPLICITY: { + ParticipantMultiplicity participantMultiplicity = (ParticipantMultiplicity) theEObject; + T result = caseParticipantMultiplicity(participantMultiplicity); + if (result == null) + result = caseBaseElement(participantMultiplicity); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.PARTNER_ENTITY: { + PartnerEntity partnerEntity = (PartnerEntity) theEObject; + T result = casePartnerEntity(partnerEntity); + if (result == null) + result = caseRootElement(partnerEntity); + if (result == null) + result = caseBaseElement(partnerEntity); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.PARTNER_ROLE: { + PartnerRole partnerRole = (PartnerRole) theEObject; + T result = casePartnerRole(partnerRole); + if (result == null) + result = caseRootElement(partnerRole); + if (result == null) + result = caseBaseElement(partnerRole); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.PERFORMER: { + Performer performer = (Performer) theEObject; + T result = casePerformer(performer); + if (result == null) + result = caseResourceRole(performer); + if (result == null) + result = caseBaseElement(performer); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.POTENTIAL_OWNER: { + PotentialOwner potentialOwner = (PotentialOwner) theEObject; + T result = casePotentialOwner(potentialOwner); + if (result == null) + result = caseHumanPerformer(potentialOwner); + if (result == null) + result = casePerformer(potentialOwner); + if (result == null) + result = caseResourceRole(potentialOwner); + if (result == null) + result = caseBaseElement(potentialOwner); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.PROCESS: { + org.eclipse.bpmn2.Process process = (org.eclipse.bpmn2.Process) theEObject; + T result = caseProcess(process); + if (result == null) + result = caseCallableElement(process); + if (result == null) + result = caseFlowElementsContainer(process); + if (result == null) + result = caseRootElement(process); + if (result == null) + result = caseBaseElement(process); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.PROPERTY: { + Property property = (Property) theEObject; + T result = caseProperty(property); + if (result == null) + result = caseItemAwareElement(property); + if (result == null) + result = caseBaseElement(property); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.RECEIVE_TASK: { + ReceiveTask receiveTask = (ReceiveTask) theEObject; + T result = caseReceiveTask(receiveTask); + if (result == null) + result = caseTask(receiveTask); + if (result == null) + result = caseActivity(receiveTask); + if (result == null) + result = caseInteractionNode(receiveTask); + if (result == null) + result = caseFlowNode(receiveTask); + if (result == null) + result = caseFlowElement(receiveTask); + if (result == null) + result = caseBaseElement(receiveTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.RELATIONSHIP: { + Relationship relationship = (Relationship) theEObject; + T result = caseRelationship(relationship); + if (result == null) + result = caseBaseElement(relationship); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.RENDERING: { + Rendering rendering = (Rendering) theEObject; + T result = caseRendering(rendering); + if (result == null) + result = caseBaseElement(rendering); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.RESOURCE: { + Resource resource = (Resource) theEObject; + T result = caseResource(resource); + if (result == null) + result = caseRootElement(resource); + if (result == null) + result = caseBaseElement(resource); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.RESOURCE_ASSIGNMENT_EXPRESSION: { + ResourceAssignmentExpression resourceAssignmentExpression = (ResourceAssignmentExpression) theEObject; + T result = caseResourceAssignmentExpression(resourceAssignmentExpression); + if (result == null) + result = caseBaseElement(resourceAssignmentExpression); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.RESOURCE_PARAMETER: { + ResourceParameter resourceParameter = (ResourceParameter) theEObject; + T result = caseResourceParameter(resourceParameter); + if (result == null) + result = caseBaseElement(resourceParameter); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.RESOURCE_PARAMETER_BINDING: { + ResourceParameterBinding resourceParameterBinding = (ResourceParameterBinding) theEObject; + T result = caseResourceParameterBinding(resourceParameterBinding); + if (result == null) + result = caseBaseElement(resourceParameterBinding); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.RESOURCE_ROLE: { + ResourceRole resourceRole = (ResourceRole) theEObject; + T result = caseResourceRole(resourceRole); + if (result == null) + result = caseBaseElement(resourceRole); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.ROOT_ELEMENT: { + RootElement rootElement = (RootElement) theEObject; + T result = caseRootElement(rootElement); + if (result == null) + result = caseBaseElement(rootElement); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.SCRIPT_TASK: { + ScriptTask scriptTask = (ScriptTask) theEObject; + T result = caseScriptTask(scriptTask); + if (result == null) + result = caseTask(scriptTask); + if (result == null) + result = caseActivity(scriptTask); + if (result == null) + result = caseInteractionNode(scriptTask); + if (result == null) + result = caseFlowNode(scriptTask); + if (result == null) + result = caseFlowElement(scriptTask); + if (result == null) + result = caseBaseElement(scriptTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.SEND_TASK: { + SendTask sendTask = (SendTask) theEObject; + T result = caseSendTask(sendTask); + if (result == null) + result = caseTask(sendTask); + if (result == null) + result = caseActivity(sendTask); + if (result == null) + result = caseInteractionNode(sendTask); + if (result == null) + result = caseFlowNode(sendTask); + if (result == null) + result = caseFlowElement(sendTask); + if (result == null) + result = caseBaseElement(sendTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.SEQUENCE_FLOW: { + SequenceFlow sequenceFlow = (SequenceFlow) theEObject; + T result = caseSequenceFlow(sequenceFlow); + if (result == null) + result = caseFlowElement(sequenceFlow); + if (result == null) + result = caseBaseElement(sequenceFlow); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.SERVICE_TASK: { + ServiceTask serviceTask = (ServiceTask) theEObject; + T result = caseServiceTask(serviceTask); + if (result == null) + result = caseTask(serviceTask); + if (result == null) + result = caseActivity(serviceTask); + if (result == null) + result = caseInteractionNode(serviceTask); + if (result == null) + result = caseFlowNode(serviceTask); + if (result == null) + result = caseFlowElement(serviceTask); + if (result == null) + result = caseBaseElement(serviceTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.SIGNAL: { + Signal signal = (Signal) theEObject; + T result = caseSignal(signal); + if (result == null) + result = caseRootElement(signal); + if (result == null) + result = caseBaseElement(signal); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.SIGNAL_EVENT_DEFINITION: { + SignalEventDefinition signalEventDefinition = (SignalEventDefinition) theEObject; + T result = caseSignalEventDefinition(signalEventDefinition); + if (result == null) + result = caseEventDefinition(signalEventDefinition); + if (result == null) + result = caseRootElement(signalEventDefinition); + if (result == null) + result = caseBaseElement(signalEventDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.STANDARD_LOOP_CHARACTERISTICS: { + StandardLoopCharacteristics standardLoopCharacteristics = (StandardLoopCharacteristics) theEObject; + T result = caseStandardLoopCharacteristics(standardLoopCharacteristics); + if (result == null) + result = caseLoopCharacteristics(standardLoopCharacteristics); + if (result == null) + result = caseBaseElement(standardLoopCharacteristics); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.START_EVENT: { + StartEvent startEvent = (StartEvent) theEObject; + T result = caseStartEvent(startEvent); + if (result == null) + result = caseCatchEvent(startEvent); + if (result == null) + result = caseEvent(startEvent); + if (result == null) + result = caseFlowNode(startEvent); + if (result == null) + result = caseInteractionNode(startEvent); + if (result == null) + result = caseFlowElement(startEvent); + if (result == null) + result = caseBaseElement(startEvent); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.SUB_CHOREOGRAPHY: { + SubChoreography subChoreography = (SubChoreography) theEObject; + T result = caseSubChoreography(subChoreography); + if (result == null) + result = caseChoreographyActivity(subChoreography); + if (result == null) + result = caseFlowElementsContainer(subChoreography); + if (result == null) + result = caseFlowNode(subChoreography); + if (result == null) + result = caseFlowElement(subChoreography); + if (result == null) + result = caseBaseElement(subChoreography); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.SUB_CONVERSATION: { + SubConversation subConversation = (SubConversation) theEObject; + T result = caseSubConversation(subConversation); + if (result == null) + result = caseConversationNode(subConversation); + if (result == null) + result = caseBaseElement(subConversation); + if (result == null) + result = caseInteractionNode(subConversation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.SUB_PROCESS: { + SubProcess subProcess = (SubProcess) theEObject; + T result = caseSubProcess(subProcess); + if (result == null) + result = caseActivity(subProcess); + if (result == null) + result = caseFlowElementsContainer(subProcess); + if (result == null) + result = caseFlowNode(subProcess); + if (result == null) + result = caseFlowElement(subProcess); + if (result == null) + result = caseBaseElement(subProcess); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.TASK: { + Task task = (Task) theEObject; + T result = caseTask(task); + if (result == null) + result = caseActivity(task); + if (result == null) + result = caseInteractionNode(task); + if (result == null) + result = caseFlowNode(task); + if (result == null) + result = caseFlowElement(task); + if (result == null) + result = caseBaseElement(task); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.TERMINATE_EVENT_DEFINITION: { + TerminateEventDefinition terminateEventDefinition = (TerminateEventDefinition) theEObject; + T result = caseTerminateEventDefinition(terminateEventDefinition); + if (result == null) + result = caseEventDefinition(terminateEventDefinition); + if (result == null) + result = caseRootElement(terminateEventDefinition); + if (result == null) + result = caseBaseElement(terminateEventDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.TEXT_ANNOTATION: { + TextAnnotation textAnnotation = (TextAnnotation) theEObject; + T result = caseTextAnnotation(textAnnotation); + if (result == null) + result = caseFlowNode(textAnnotation); + if (result == null) + result = caseFlowElement(textAnnotation); + if (result == null) + result = caseBaseElement(textAnnotation); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.THROW_EVENT: { + ThrowEvent throwEvent = (ThrowEvent) theEObject; + T result = caseThrowEvent(throwEvent); + if (result == null) + result = caseEvent(throwEvent); + if (result == null) + result = caseFlowNode(throwEvent); + if (result == null) + result = caseInteractionNode(throwEvent); + if (result == null) + result = caseFlowElement(throwEvent); + if (result == null) + result = caseBaseElement(throwEvent); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.TIMER_EVENT_DEFINITION: { + TimerEventDefinition timerEventDefinition = (TimerEventDefinition) theEObject; + T result = caseTimerEventDefinition(timerEventDefinition); + if (result == null) + result = caseEventDefinition(timerEventDefinition); + if (result == null) + result = caseRootElement(timerEventDefinition); + if (result == null) + result = caseBaseElement(timerEventDefinition); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.TRANSACTION: { + Transaction transaction = (Transaction) theEObject; + T result = caseTransaction(transaction); + if (result == null) + result = caseSubProcess(transaction); + if (result == null) + result = caseActivity(transaction); + if (result == null) + result = caseFlowElementsContainer(transaction); + if (result == null) + result = caseFlowNode(transaction); + if (result == null) + result = caseFlowElement(transaction); + if (result == null) + result = caseBaseElement(transaction); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.USER_TASK: { + UserTask userTask = (UserTask) theEObject; + T result = caseUserTask(userTask); + if (result == null) + result = caseTask(userTask); + if (result == null) + result = caseActivity(userTask); + if (result == null) + result = caseInteractionNode(userTask); + if (result == null) + result = caseFlowNode(userTask); + if (result == null) + result = caseFlowElement(userTask); + if (result == null) + result = caseBaseElement(userTask); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Bpmn2Package.EVENT_SUBPROCESS: { + EventSubprocess eventSubprocess = (EventSubprocess) theEObject; + T result = caseEventSubprocess(eventSubprocess); + if (result == null) + result = caseSubProcess(eventSubprocess); + if (result == null) + result = caseActivity(eventSubprocess); + if (result == null) + result = caseFlowElementsContainer(eventSubprocess); + if (result == null) + result = caseFlowNode(eventSubprocess); + if (result == null) + result = caseFlowElement(eventSubprocess); + if (result == null) + result = caseBaseElement(eventSubprocess); + if (result == null) + result = defaultCase(theEObject); + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Document Root'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Document Root'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDocumentRoot(DocumentRoot object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Activity'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Activity'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseActivity(Activity object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Ad Hoc Sub Process'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Ad Hoc Sub Process'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseAdHocSubProcess(AdHocSubProcess object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Artifact'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Artifact'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseArtifact(Artifact object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Assignment'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Assignment'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseAssignment(Assignment object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Association'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Association'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseAssociation(Association object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Auditing'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Auditing'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseAuditing(Auditing object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Base Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Base Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBaseElement(BaseElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Boundary Event'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Boundary Event'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBoundaryEvent(BoundaryEvent object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Business Rule Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Business Rule Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBusinessRuleTask(BusinessRuleTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Call Activity'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Call Activity'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCallActivity(CallActivity object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Call Choreography'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Call Choreography'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCallChoreography(CallChoreography object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Call Conversation'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Call Conversation'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCallConversation(CallConversation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Callable Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Callable Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCallableElement(CallableElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Cancel Event Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Cancel Event Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCancelEventDefinition(CancelEventDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Catch Event'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Catch Event'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCatchEvent(CatchEvent object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Category'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Category'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCategory(Category object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Category Value'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Category Value'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCategoryValue(CategoryValue object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Choreography'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Choreography'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseChoreography(Choreography object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Choreography Activity'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Choreography Activity'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseChoreographyActivity(ChoreographyActivity object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Choreography Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Choreography Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseChoreographyTask(ChoreographyTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Collaboration'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Collaboration'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCollaboration(Collaboration object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Compensate Event Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Compensate Event Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCompensateEventDefinition(CompensateEventDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Complex Behavior Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Complex Behavior Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseComplexBehaviorDefinition(ComplexBehaviorDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Complex Gateway'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Complex Gateway'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseComplexGateway(ComplexGateway object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Conditional Event Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Conditional Event Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConditionalEventDefinition(ConditionalEventDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Conversation'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Conversation'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConversation(Conversation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Conversation Association'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Conversation Association'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConversationAssociation(ConversationAssociation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Conversation Link'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Conversation Link'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConversationLink(ConversationLink object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Conversation Node'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Conversation Node'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConversationNode(ConversationNode object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Correlation Key'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Correlation Key'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCorrelationKey(CorrelationKey object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Correlation Property'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Correlation Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCorrelationProperty(CorrelationProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Correlation Property Binding'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Correlation Property Binding'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCorrelationPropertyBinding(CorrelationPropertyBinding object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Correlation Property Retrieval Expression'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Correlation Property Retrieval Expression'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCorrelationPropertyRetrievalExpression(CorrelationPropertyRetrievalExpression object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Correlation Subscription'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Correlation Subscription'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCorrelationSubscription(CorrelationSubscription object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Data Association'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Data Association'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDataAssociation(DataAssociation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Data Input'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Data Input'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDataInput(DataInput object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Data Input Association'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Data Input Association'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDataInputAssociation(DataInputAssociation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Data Object'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Data Object'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDataObject(DataObject object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Data Object Reference'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Data Object Reference'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDataObjectReference(DataObjectReference object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Data Output'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Data Output'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDataOutput(DataOutput object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Data Output Association'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Data Output Association'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDataOutputAssociation(DataOutputAssociation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Data State'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Data State'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDataState(DataState object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Data Store'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Data Store'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDataStore(DataStore object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Data Store Reference'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Data Store Reference'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDataStoreReference(DataStoreReference object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Definitions'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Definitions'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDefinitions(Definitions object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Documentation'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Documentation'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDocumentation(Documentation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'End Event'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'End Event'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEndEvent(EndEvent object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'End Point'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'End Point'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEndPoint(EndPoint object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Error'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Error'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseError(org.eclipse.bpmn2.Error object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Error Event Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Error Event Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseErrorEventDefinition(ErrorEventDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Escalation'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Escalation'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEscalation(Escalation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Escalation Event Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Escalation Event Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEscalationEventDefinition(EscalationEventDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Event'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Event'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEvent(Event object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Event Based Gateway'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Event Based Gateway'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEventBasedGateway(EventBasedGateway object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Event Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Event Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEventDefinition(EventDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Exclusive Gateway'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Exclusive Gateway'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseExclusiveGateway(ExclusiveGateway object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Expression'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Expression'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseExpression(Expression object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Extension'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Extension'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseExtension(Extension object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Extension Attribute Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Extension Attribute Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseExtensionAttributeDefinition(ExtensionAttributeDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Extension Attribute Value'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Extension Attribute Value'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseExtensionAttributeValue(ExtensionAttributeValue object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Extension Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Extension Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseExtensionDefinition(ExtensionDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Flow Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Flow Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFlowElement(FlowElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Flow Elements Container'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Flow Elements Container'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFlowElementsContainer(FlowElementsContainer object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Flow Node'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Flow Node'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFlowNode(FlowNode object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Formal Expression'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Formal Expression'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFormalExpression(FormalExpression object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Gateway'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Gateway'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGateway(Gateway object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Global Business Rule Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Global Business Rule Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGlobalBusinessRuleTask(GlobalBusinessRuleTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Global Choreography Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Global Choreography Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGlobalChoreographyTask(GlobalChoreographyTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Global Conversation'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Global Conversation'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGlobalConversation(GlobalConversation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Global Manual Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Global Manual Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGlobalManualTask(GlobalManualTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Global Script Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Global Script Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGlobalScriptTask(GlobalScriptTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Global Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Global Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGlobalTask(GlobalTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Global User Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Global User Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGlobalUserTask(GlobalUserTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Group'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Group'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGroup(Group object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Human Performer'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Human Performer'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseHumanPerformer(HumanPerformer object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Implicit Throw Event'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Implicit Throw Event'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseImplicitThrowEvent(ImplicitThrowEvent object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Import'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Import'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseImport(Import object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Inclusive Gateway'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Inclusive Gateway'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInclusiveGateway(InclusiveGateway object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Input Output Binding'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Input Output Binding'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInputOutputBinding(InputOutputBinding object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Input Output Specification'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Input Output Specification'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInputOutputSpecification(InputOutputSpecification object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Input Set'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Input Set'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInputSet(InputSet object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Interaction Node'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Interaction Node'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInteractionNode(InteractionNode object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Interface'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Interface'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInterface(Interface object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Intermediate Catch Event'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Intermediate Catch Event'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseIntermediateCatchEvent(IntermediateCatchEvent object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Intermediate Throw Event'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Intermediate Throw Event'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseIntermediateThrowEvent(IntermediateThrowEvent object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Item Aware Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Item Aware Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseItemAwareElement(ItemAwareElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Item Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Item Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseItemDefinition(ItemDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Lane'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Lane'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseLane(Lane object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Lane Set'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Lane Set'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseLaneSet(LaneSet object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Link Event Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Link Event Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseLinkEventDefinition(LinkEventDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Loop Characteristics'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Loop Characteristics'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseLoopCharacteristics(LoopCharacteristics object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Manual Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Manual Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseManualTask(ManualTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Message'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Message'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseMessage(Message object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Message Event Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Message Event Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseMessageEventDefinition(MessageEventDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Message Flow'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Message Flow'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseMessageFlow(MessageFlow object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Message Flow Association'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Message Flow Association'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseMessageFlowAssociation(MessageFlowAssociation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Monitoring'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Monitoring'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseMonitoring(Monitoring object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Multi Instance Loop Characteristics'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Multi Instance Loop Characteristics'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseMultiInstanceLoopCharacteristics(MultiInstanceLoopCharacteristics object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Operation'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Operation'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseOperation(Operation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Output Set'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Output Set'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseOutputSet(OutputSet object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Parallel Gateway'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Parallel Gateway'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseParallelGateway(ParallelGateway object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Participant'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Participant'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseParticipant(Participant object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Participant Association'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Participant Association'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseParticipantAssociation(ParticipantAssociation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Participant Multiplicity'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Participant Multiplicity'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseParticipantMultiplicity(ParticipantMultiplicity object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Partner Entity'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Partner Entity'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePartnerEntity(PartnerEntity object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Partner Role'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Partner Role'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePartnerRole(PartnerRole object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Performer'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Performer'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePerformer(Performer object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Potential Owner'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Potential Owner'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePotentialOwner(PotentialOwner object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Process'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Process'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseProcess(org.eclipse.bpmn2.Process object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Property'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseProperty(Property object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Receive Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Receive Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseReceiveTask(ReceiveTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Relationship'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Relationship'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRelationship(Relationship object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Rendering'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Rendering'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRendering(Rendering object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Resource'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Resource'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseResource(Resource object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Resource Assignment Expression'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Resource Assignment Expression'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseResourceAssignmentExpression(ResourceAssignmentExpression object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Resource Parameter'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Resource Parameter'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseResourceParameter(ResourceParameter object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Resource Parameter Binding'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Resource Parameter Binding'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseResourceParameterBinding(ResourceParameterBinding object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Resource Role'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Resource Role'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseResourceRole(ResourceRole object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Root Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Root Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRootElement(RootElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Script Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Script Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseScriptTask(ScriptTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Send Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Send Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSendTask(SendTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Sequence Flow'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Sequence Flow'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSequenceFlow(SequenceFlow object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Service Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Service Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseServiceTask(ServiceTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Signal'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Signal'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSignal(Signal object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Signal Event Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Signal Event Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSignalEventDefinition(SignalEventDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Standard Loop Characteristics'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Standard Loop Characteristics'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseStandardLoopCharacteristics(StandardLoopCharacteristics object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Start Event'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Start Event'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseStartEvent(StartEvent object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Sub Choreography'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Sub Choreography'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSubChoreography(SubChoreography object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Sub Conversation'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Sub Conversation'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSubConversation(SubConversation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Sub Process'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Sub Process'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSubProcess(SubProcess object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTask(Task object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Terminate Event Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Terminate Event Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTerminateEventDefinition(TerminateEventDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Text Annotation'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Text Annotation'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTextAnnotation(TextAnnotation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Throw Event'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Throw Event'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseThrowEvent(ThrowEvent object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Timer Event Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Timer Event Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTimerEventDefinition(TimerEventDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Transaction'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Transaction'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTransaction(Transaction object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'User Task'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'User Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseUserTask(UserTask object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Event Subprocess'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Event Subprocess'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEventSubprocess(EventSubprocess object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + public T defaultCase(EObject object) { + return null; + } + +} //Bpmn2Switch diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/Bounds.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/Bounds.java new file mode 100644 index 00000000000..3703425551e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/Bounds.java @@ -0,0 +1,133 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Bounds'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.dd.dc.Bounds#getHeight Height}
  • + *
  • {@link org.eclipse.dd.dc.Bounds#getWidth Width}
  • + *
  • {@link org.eclipse.dd.dc.Bounds#getX X}
  • + *
  • {@link org.eclipse.dd.dc.Bounds#getY Y}
  • + *
+ * + * @see org.eclipse.dd.dc.DcPackage#getBounds() + * @model extendedMetaData="name='Bounds' kind='empty'" + * @generated + */ +public interface Bounds extends EObject { + /** + * Returns the value of the 'Height' attribute. + * + * + * @return the value of the 'Height' attribute. + * @see #setHeight(float) + * @see org.eclipse.dd.dc.DcPackage#getBounds_Height() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='height'" + * @generated + */ + float getHeight(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.Bounds#getHeight Height}' attribute. + * + * + * @param value the new value of the 'Height' attribute. + * @see #getHeight() + * @generated + */ + void setHeight(float value); + + /** + * Returns the value of the 'Width' attribute. + * + * + * @return the value of the 'Width' attribute. + * @see #setWidth(float) + * @see org.eclipse.dd.dc.DcPackage#getBounds_Width() + * @model required="true" ordered="false" + * extendedMetaData="kind='attribute' name='width'" + * @generated + */ + float getWidth(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.Bounds#getWidth Width}' attribute. + * + * + * @param value the new value of the 'Width' attribute. + * @see #getWidth() + * @generated + */ + void setWidth(float value); + + /** + * Returns the value of the 'X' attribute. + * The default value is "0". + * + * + * @return the value of the 'X' attribute. + * @see #setX(float) + * @see org.eclipse.dd.dc.DcPackage#getBounds_X() + * @model default="0" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='x'" + * @generated + */ + float getX(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.Bounds#getX X}' attribute. + * + * + * @param value the new value of the 'X' attribute. + * @see #getX() + * @generated + */ + void setX(float value); + + /** + * Returns the value of the 'Y' attribute. + * The default value is "0". + * + * + * @return the value of the 'Y' attribute. + * @see #setY(float) + * @see org.eclipse.dd.dc.DcPackage#getBounds_Y() + * @model default="0" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='y'" + * @generated + */ + float getY(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.Bounds#getY Y}' attribute. + * + * + * @param value the new value of the 'Y' attribute. + * @see #getY() + * @generated + */ + void setY(float value); + +} // Bounds diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/DcFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/DcFactory.java new file mode 100644 index 00000000000..d7d790ff10d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/DcFactory.java @@ -0,0 +1,81 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see org.eclipse.dd.dc.DcPackage + * @generated + */ +public interface DcFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + DcFactory eINSTANCE = org.eclipse.dd.dc.impl.DcFactoryImpl.init(); + + /** + * Returns a new object of class 'Document Root'. + * + * + * @return a new object of class 'Document Root'. + * @generated + */ + DocumentRoot createDocumentRoot(); + + /** + * Returns a new object of class 'Bounds'. + * + * + * @return a new object of class 'Bounds'. + * @generated + */ + Bounds createBounds(); + + /** + * Returns a new object of class 'Font'. + * + * + * @return a new object of class 'Font'. + * @generated + */ + Font createFont(); + + /** + * Returns a new object of class 'Point'. + * + * + * @return a new object of class 'Point'. + * @generated + */ + Point createPoint(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + DcPackage getDcPackage(); + +} //DcFactory diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/DcPackage.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/DcPackage.java new file mode 100644 index 00000000000..1789833173a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/DcPackage.java @@ -0,0 +1,754 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see org.eclipse.dd.dc.DcFactory + * @model kind="package" + * @generated + */ +public interface DcPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "dc"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.omg.org/spec/DD/20100524/DC-XMI"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "dc"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + DcPackage eINSTANCE = org.eclipse.dd.dc.impl.DcPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.dd.dc.impl.DocumentRootImpl Document Root}' class. + * + * + * @see org.eclipse.dd.dc.impl.DocumentRootImpl + * @see org.eclipse.dd.dc.impl.DcPackageImpl#getDocumentRoot() + * @generated + */ + int DOCUMENT_ROOT = 0; + + /** + * The feature id for the 'Mixed' attribute list. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__MIXED = 0; + + /** + * The feature id for the 'XMLNS Prefix Map' map. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1; + + /** + * The feature id for the 'XSI Schema Location' map. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2; + + /** + * The feature id for the 'Bounds' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__BOUNDS = 3; + + /** + * The feature id for the 'Font' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__FONT = 4; + + /** + * The feature id for the 'Point' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__POINT = 5; + + /** + * The number of structural features of the 'Document Root' class. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT_FEATURE_COUNT = 6; + + /** + * The meta object id for the '{@link org.eclipse.dd.dc.impl.BoundsImpl Bounds}' class. + * + * + * @see org.eclipse.dd.dc.impl.BoundsImpl + * @see org.eclipse.dd.dc.impl.DcPackageImpl#getBounds() + * @generated + */ + int BOUNDS = 1; + + /** + * The feature id for the 'Height' attribute. + * + * + * @generated + * @ordered + */ + int BOUNDS__HEIGHT = 0; + + /** + * The feature id for the 'Width' attribute. + * + * + * @generated + * @ordered + */ + int BOUNDS__WIDTH = 1; + + /** + * The feature id for the 'X' attribute. + * + * + * @generated + * @ordered + */ + int BOUNDS__X = 2; + + /** + * The feature id for the 'Y' attribute. + * + * + * @generated + * @ordered + */ + int BOUNDS__Y = 3; + + /** + * The number of structural features of the 'Bounds' class. + * + * + * @generated + * @ordered + */ + int BOUNDS_FEATURE_COUNT = 4; + + /** + * The meta object id for the '{@link org.eclipse.dd.dc.impl.FontImpl Font}' class. + * + * + * @see org.eclipse.dd.dc.impl.FontImpl + * @see org.eclipse.dd.dc.impl.DcPackageImpl#getFont() + * @generated + */ + int FONT = 2; + + /** + * The feature id for the 'Is Bold' attribute. + * + * + * @generated + * @ordered + */ + int FONT__IS_BOLD = 0; + + /** + * The feature id for the 'Is Italic' attribute. + * + * + * @generated + * @ordered + */ + int FONT__IS_ITALIC = 1; + + /** + * The feature id for the 'Is Strike Through' attribute. + * + * + * @generated + * @ordered + */ + int FONT__IS_STRIKE_THROUGH = 2; + + /** + * The feature id for the 'Is Underline' attribute. + * + * + * @generated + * @ordered + */ + int FONT__IS_UNDERLINE = 3; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int FONT__NAME = 4; + + /** + * The feature id for the 'Size' attribute. + * + * + * @generated + * @ordered + */ + int FONT__SIZE = 5; + + /** + * The number of structural features of the 'Font' class. + * + * + * @generated + * @ordered + */ + int FONT_FEATURE_COUNT = 6; + + /** + * The meta object id for the '{@link org.eclipse.dd.dc.impl.PointImpl Point}' class. + * + * + * @see org.eclipse.dd.dc.impl.PointImpl + * @see org.eclipse.dd.dc.impl.DcPackageImpl#getPoint() + * @generated + */ + int POINT = 3; + + /** + * The feature id for the 'X' attribute. + * + * + * @generated + * @ordered + */ + int POINT__X = 0; + + /** + * The feature id for the 'Y' attribute. + * + * + * @generated + * @ordered + */ + int POINT__Y = 1; + + /** + * The number of structural features of the 'Point' class. + * + * + * @generated + * @ordered + */ + int POINT_FEATURE_COUNT = 2; + + /** + * Returns the meta object for class '{@link org.eclipse.dd.dc.DocumentRoot Document Root}'. + * + * + * @return the meta object for class 'Document Root'. + * @see org.eclipse.dd.dc.DocumentRoot + * @generated + */ + EClass getDocumentRoot(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.dd.dc.DocumentRoot#getMixed Mixed}'. + * + * + * @return the meta object for the attribute list 'Mixed'. + * @see org.eclipse.dd.dc.DocumentRoot#getMixed() + * @see #getDocumentRoot() + * @generated + */ + EAttribute getDocumentRoot_Mixed(); + + /** + * Returns the meta object for the map '{@link org.eclipse.dd.dc.DocumentRoot#getXMLNSPrefixMap XMLNS Prefix Map}'. + * + * + * @return the meta object for the map 'XMLNS Prefix Map'. + * @see org.eclipse.dd.dc.DocumentRoot#getXMLNSPrefixMap() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_XMLNSPrefixMap(); + + /** + * Returns the meta object for the map '{@link org.eclipse.dd.dc.DocumentRoot#getXSISchemaLocation XSI Schema Location}'. + * + * + * @return the meta object for the map 'XSI Schema Location'. + * @see org.eclipse.dd.dc.DocumentRoot#getXSISchemaLocation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_XSISchemaLocation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.dc.DocumentRoot#getBounds Bounds}'. + * + * + * @return the meta object for the containment reference 'Bounds'. + * @see org.eclipse.dd.dc.DocumentRoot#getBounds() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Bounds(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.dc.DocumentRoot#getFont Font}'. + * + * + * @return the meta object for the containment reference 'Font'. + * @see org.eclipse.dd.dc.DocumentRoot#getFont() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Font(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.dc.DocumentRoot#getPoint Point}'. + * + * + * @return the meta object for the containment reference 'Point'. + * @see org.eclipse.dd.dc.DocumentRoot#getPoint() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Point(); + + /** + * Returns the meta object for class '{@link org.eclipse.dd.dc.Bounds Bounds}'. + * + * + * @return the meta object for class 'Bounds'. + * @see org.eclipse.dd.dc.Bounds + * @generated + */ + EClass getBounds(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Bounds#getHeight Height}'. + * + * + * @return the meta object for the attribute 'Height'. + * @see org.eclipse.dd.dc.Bounds#getHeight() + * @see #getBounds() + * @generated + */ + EAttribute getBounds_Height(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Bounds#getWidth Width}'. + * + * + * @return the meta object for the attribute 'Width'. + * @see org.eclipse.dd.dc.Bounds#getWidth() + * @see #getBounds() + * @generated + */ + EAttribute getBounds_Width(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Bounds#getX X}'. + * + * + * @return the meta object for the attribute 'X'. + * @see org.eclipse.dd.dc.Bounds#getX() + * @see #getBounds() + * @generated + */ + EAttribute getBounds_X(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Bounds#getY Y}'. + * + * + * @return the meta object for the attribute 'Y'. + * @see org.eclipse.dd.dc.Bounds#getY() + * @see #getBounds() + * @generated + */ + EAttribute getBounds_Y(); + + /** + * Returns the meta object for class '{@link org.eclipse.dd.dc.Font Font}'. + * + * + * @return the meta object for class 'Font'. + * @see org.eclipse.dd.dc.Font + * @generated + */ + EClass getFont(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Font#isIsBold Is Bold}'. + * + * + * @return the meta object for the attribute 'Is Bold'. + * @see org.eclipse.dd.dc.Font#isIsBold() + * @see #getFont() + * @generated + */ + EAttribute getFont_IsBold(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Font#isIsItalic Is Italic}'. + * + * + * @return the meta object for the attribute 'Is Italic'. + * @see org.eclipse.dd.dc.Font#isIsItalic() + * @see #getFont() + * @generated + */ + EAttribute getFont_IsItalic(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Font#isIsStrikeThrough Is Strike Through}'. + * + * + * @return the meta object for the attribute 'Is Strike Through'. + * @see org.eclipse.dd.dc.Font#isIsStrikeThrough() + * @see #getFont() + * @generated + */ + EAttribute getFont_IsStrikeThrough(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Font#isIsUnderline Is Underline}'. + * + * + * @return the meta object for the attribute 'Is Underline'. + * @see org.eclipse.dd.dc.Font#isIsUnderline() + * @see #getFont() + * @generated + */ + EAttribute getFont_IsUnderline(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Font#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.dd.dc.Font#getName() + * @see #getFont() + * @generated + */ + EAttribute getFont_Name(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Font#getSize Size}'. + * + * + * @return the meta object for the attribute 'Size'. + * @see org.eclipse.dd.dc.Font#getSize() + * @see #getFont() + * @generated + */ + EAttribute getFont_Size(); + + /** + * Returns the meta object for class '{@link org.eclipse.dd.dc.Point Point}'. + * + * + * @return the meta object for class 'Point'. + * @see org.eclipse.dd.dc.Point + * @generated + */ + EClass getPoint(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Point#getX X}'. + * + * + * @return the meta object for the attribute 'X'. + * @see org.eclipse.dd.dc.Point#getX() + * @see #getPoint() + * @generated + */ + EAttribute getPoint_X(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Point#getY Y}'. + * + * + * @return the meta object for the attribute 'Y'. + * @see org.eclipse.dd.dc.Point#getY() + * @see #getPoint() + * @generated + */ + EAttribute getPoint_Y(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + DcFactory getDcFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.dd.dc.impl.DocumentRootImpl Document Root}' class. + * + * + * @see org.eclipse.dd.dc.impl.DocumentRootImpl + * @see org.eclipse.dd.dc.impl.DcPackageImpl#getDocumentRoot() + * @generated + */ + EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot(); + + /** + * The meta object literal for the 'Mixed' attribute list feature. + * + * + * @generated + */ + EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed(); + + /** + * The meta object literal for the 'XMLNS Prefix Map' map feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap(); + + /** + * The meta object literal for the 'XSI Schema Location' map feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation(); + + /** + * The meta object literal for the 'Bounds' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__BOUNDS = eINSTANCE.getDocumentRoot_Bounds(); + + /** + * The meta object literal for the 'Font' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__FONT = eINSTANCE.getDocumentRoot_Font(); + + /** + * The meta object literal for the 'Point' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__POINT = eINSTANCE.getDocumentRoot_Point(); + + /** + * The meta object literal for the '{@link org.eclipse.dd.dc.impl.BoundsImpl Bounds}' class. + * + * + * @see org.eclipse.dd.dc.impl.BoundsImpl + * @see org.eclipse.dd.dc.impl.DcPackageImpl#getBounds() + * @generated + */ + EClass BOUNDS = eINSTANCE.getBounds(); + + /** + * The meta object literal for the 'Height' attribute feature. + * + * + * @generated + */ + EAttribute BOUNDS__HEIGHT = eINSTANCE.getBounds_Height(); + + /** + * The meta object literal for the 'Width' attribute feature. + * + * + * @generated + */ + EAttribute BOUNDS__WIDTH = eINSTANCE.getBounds_Width(); + + /** + * The meta object literal for the 'X' attribute feature. + * + * + * @generated + */ + EAttribute BOUNDS__X = eINSTANCE.getBounds_X(); + + /** + * The meta object literal for the 'Y' attribute feature. + * + * + * @generated + */ + EAttribute BOUNDS__Y = eINSTANCE.getBounds_Y(); + + /** + * The meta object literal for the '{@link org.eclipse.dd.dc.impl.FontImpl Font}' class. + * + * + * @see org.eclipse.dd.dc.impl.FontImpl + * @see org.eclipse.dd.dc.impl.DcPackageImpl#getFont() + * @generated + */ + EClass FONT = eINSTANCE.getFont(); + + /** + * The meta object literal for the 'Is Bold' attribute feature. + * + * + * @generated + */ + EAttribute FONT__IS_BOLD = eINSTANCE.getFont_IsBold(); + + /** + * The meta object literal for the 'Is Italic' attribute feature. + * + * + * @generated + */ + EAttribute FONT__IS_ITALIC = eINSTANCE.getFont_IsItalic(); + + /** + * The meta object literal for the 'Is Strike Through' attribute feature. + * + * + * @generated + */ + EAttribute FONT__IS_STRIKE_THROUGH = eINSTANCE.getFont_IsStrikeThrough(); + + /** + * The meta object literal for the 'Is Underline' attribute feature. + * + * + * @generated + */ + EAttribute FONT__IS_UNDERLINE = eINSTANCE.getFont_IsUnderline(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute FONT__NAME = eINSTANCE.getFont_Name(); + + /** + * The meta object literal for the 'Size' attribute feature. + * + * + * @generated + */ + EAttribute FONT__SIZE = eINSTANCE.getFont_Size(); + + /** + * The meta object literal for the '{@link org.eclipse.dd.dc.impl.PointImpl Point}' class. + * + * + * @see org.eclipse.dd.dc.impl.PointImpl + * @see org.eclipse.dd.dc.impl.DcPackageImpl#getPoint() + * @generated + */ + EClass POINT = eINSTANCE.getPoint(); + + /** + * The meta object literal for the 'X' attribute feature. + * + * + * @generated + */ + EAttribute POINT__X = eINSTANCE.getPoint_X(); + + /** + * The meta object literal for the 'Y' attribute feature. + * + * + * @generated + */ + EAttribute POINT__Y = eINSTANCE.getPoint_Y(); + + } + +} //DcPackage diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/DocumentRoot.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/DocumentRoot.java new file mode 100644 index 00000000000..05f2c829e50 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/DocumentRoot.java @@ -0,0 +1,155 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc; + +import org.eclipse.emf.common.util.EMap; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * + * A representation of the model object 'Document Root'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.dd.dc.DocumentRoot#getMixed Mixed}
  • + *
  • {@link org.eclipse.dd.dc.DocumentRoot#getXMLNSPrefixMap XMLNS Prefix Map}
  • + *
  • {@link org.eclipse.dd.dc.DocumentRoot#getXSISchemaLocation XSI Schema Location}
  • + *
  • {@link org.eclipse.dd.dc.DocumentRoot#getBounds Bounds}
  • + *
  • {@link org.eclipse.dd.dc.DocumentRoot#getFont Font}
  • + *
  • {@link org.eclipse.dd.dc.DocumentRoot#getPoint Point}
  • + *
+ * + * @see org.eclipse.dd.dc.DcPackage#getDocumentRoot() + * @model extendedMetaData="name='' kind='mixed'" + * @generated + */ +public interface DocumentRoot extends EObject { + /** + * Returns the value of the 'Mixed' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * + * + * @return the value of the 'Mixed' attribute list. + * @see org.eclipse.dd.dc.DcPackage#getDocumentRoot_Mixed() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='elementWildcard' name=':mixed'" + * @generated + */ + FeatureMap getMixed(); + + /** + * Returns the value of the 'XMLNS Prefix Map' map. + * The key is of type {@link java.lang.String}, + * and the value is of type {@link java.lang.String}, + * + * + * @return the value of the 'XMLNS Prefix Map' map. + * @see org.eclipse.dd.dc.DcPackage#getDocumentRoot_XMLNSPrefixMap() + * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>" transient="true" + * extendedMetaData="kind='attribute' name='xmlns:prefix'" + * @generated + */ + EMap getXMLNSPrefixMap(); + + /** + * Returns the value of the 'XSI Schema Location' map. + * The key is of type {@link java.lang.String}, + * and the value is of type {@link java.lang.String}, + * + * + * @return the value of the 'XSI Schema Location' map. + * @see org.eclipse.dd.dc.DcPackage#getDocumentRoot_XSISchemaLocation() + * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>" transient="true" + * extendedMetaData="kind='attribute' name='xsi:schemaLocation'" + * @generated + */ + EMap getXSISchemaLocation(); + + /** + * Returns the value of the 'Bounds' containment reference. + * + * + * @return the value of the 'Bounds' containment reference. + * @see #setBounds(Bounds) + * @see org.eclipse.dd.dc.DcPackage#getDocumentRoot_Bounds() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='Bounds' namespace='http://www.omg.org/spec/DD/20100524/DC'" + * @generated + */ + Bounds getBounds(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.DocumentRoot#getBounds Bounds}' containment reference. + * + * + * @param value the new value of the 'Bounds' containment reference. + * @see #getBounds() + * @generated + */ + void setBounds(Bounds value); + + /** + * Returns the value of the 'Font' containment reference. + * + * + * @return the value of the 'Font' containment reference. + * @see #setFont(Font) + * @see org.eclipse.dd.dc.DcPackage#getDocumentRoot_Font() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='Font' namespace='http://www.omg.org/spec/DD/20100524/DC'" + * @generated + */ + Font getFont(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.DocumentRoot#getFont Font}' containment reference. + * + * + * @param value the new value of the 'Font' containment reference. + * @see #getFont() + * @generated + */ + void setFont(Font value); + + /** + * Returns the value of the 'Point' containment reference. + * + * + * @return the value of the 'Point' containment reference. + * @see #setPoint(Point) + * @see org.eclipse.dd.dc.DcPackage#getDocumentRoot_Point() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='Point' namespace='http://www.omg.org/spec/DD/20100524/DC'" + * @generated + */ + Point getPoint(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.DocumentRoot#getPoint Point}' containment reference. + * + * + * @param value the new value of the 'Point' containment reference. + * @see #getPoint() + * @generated + */ + void setPoint(Point value); + +} // DocumentRoot diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/Font.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/Font.java new file mode 100644 index 00000000000..749203f43af --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/Font.java @@ -0,0 +1,196 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc; + +import java.util.Map; + +import org.eclipse.emf.common.util.DiagnosticChain; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Font'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.dd.dc.Font#isIsBold Is Bold}
  • + *
  • {@link org.eclipse.dd.dc.Font#isIsItalic Is Italic}
  • + *
  • {@link org.eclipse.dd.dc.Font#isIsStrikeThrough Is Strike Through}
  • + *
  • {@link org.eclipse.dd.dc.Font#isIsUnderline Is Underline}
  • + *
  • {@link org.eclipse.dd.dc.Font#getName Name}
  • + *
  • {@link org.eclipse.dd.dc.Font#getSize Size}
  • + *
+ * + * @see org.eclipse.dd.dc.DcPackage#getFont() + * @model extendedMetaData="name='Font' kind='empty'" + * @generated + */ +public interface Font extends EObject { + /** + * Returns the value of the 'Is Bold' attribute. + * + * + * @return the value of the 'Is Bold' attribute. + * @see #setIsBold(boolean) + * @see org.eclipse.dd.dc.DcPackage#getFont_IsBold() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='isBold'" + * @generated + */ + boolean isIsBold(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.Font#isIsBold Is Bold}' attribute. + * + * + * @param value the new value of the 'Is Bold' attribute. + * @see #isIsBold() + * @generated + */ + void setIsBold(boolean value); + + /** + * Returns the value of the 'Is Italic' attribute. + * + * + * @return the value of the 'Is Italic' attribute. + * @see #setIsItalic(boolean) + * @see org.eclipse.dd.dc.DcPackage#getFont_IsItalic() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='isItalic'" + * @generated + */ + boolean isIsItalic(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.Font#isIsItalic Is Italic}' attribute. + * + * + * @param value the new value of the 'Is Italic' attribute. + * @see #isIsItalic() + * @generated + */ + void setIsItalic(boolean value); + + /** + * Returns the value of the 'Is Strike Through' attribute. + * + * + * @return the value of the 'Is Strike Through' attribute. + * @see #setIsStrikeThrough(boolean) + * @see org.eclipse.dd.dc.DcPackage#getFont_IsStrikeThrough() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='isStrikeThrough'" + * @generated + */ + boolean isIsStrikeThrough(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.Font#isIsStrikeThrough Is Strike Through}' attribute. + * + * + * @param value the new value of the 'Is Strike Through' attribute. + * @see #isIsStrikeThrough() + * @generated + */ + void setIsStrikeThrough(boolean value); + + /** + * Returns the value of the 'Is Underline' attribute. + * + * + * @return the value of the 'Is Underline' attribute. + * @see #setIsUnderline(boolean) + * @see org.eclipse.dd.dc.DcPackage#getFont_IsUnderline() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='isUnderline'" + * @generated + */ + boolean isIsUnderline(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.Font#isIsUnderline Is Underline}' attribute. + * + * + * @param value the new value of the 'Is Underline' attribute. + * @see #isIsUnderline() + * @generated + */ + void setIsUnderline(boolean value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.dd.dc.DcPackage#getFont_Name() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.Font#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Size' attribute. + * + * + * @return the value of the 'Size' attribute. + * @see #setSize(float) + * @see org.eclipse.dd.dc.DcPackage#getFont_Size() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='size'" + * @generated + */ + float getSize(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.Font#getSize Size}' attribute. + * + * + * @param value the new value of the 'Size' attribute. + * @see #getSize() + * @generated + */ + void setSize(float value); + + /** + * + * + * + * size >= 0 + * @param diagnostics The chain of diagnostics to which problems are to be appended. + * @param context The cache of context-specific information. + * + * @model + * @generated + */ + boolean non_negative_size(DiagnosticChain diagnostics, Map context); + +} // Font diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/Point.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/Point.java new file mode 100644 index 00000000000..5ecb8f979be --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/Point.java @@ -0,0 +1,85 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Point'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.dd.dc.Point#getX X}
  • + *
  • {@link org.eclipse.dd.dc.Point#getY Y}
  • + *
+ * + * @see org.eclipse.dd.dc.DcPackage#getPoint() + * @model extendedMetaData="name='Point' kind='empty'" + * @generated + */ +public interface Point extends EObject { + /** + * Returns the value of the 'X' attribute. + * The default value is "0". + * + * + * @return the value of the 'X' attribute. + * @see #setX(float) + * @see org.eclipse.dd.dc.DcPackage#getPoint_X() + * @model default="0" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='x'" + * @generated + */ + float getX(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.Point#getX X}' attribute. + * + * + * @param value the new value of the 'X' attribute. + * @see #getX() + * @generated + */ + void setX(float value); + + /** + * Returns the value of the 'Y' attribute. + * The default value is "0". + * + * + * @return the value of the 'Y' attribute. + * @see #setY(float) + * @see org.eclipse.dd.dc.DcPackage#getPoint_Y() + * @model default="0" required="true" ordered="false" + * extendedMetaData="kind='attribute' name='y'" + * @generated + */ + float getY(); + + /** + * Sets the value of the '{@link org.eclipse.dd.dc.Point#getY Y}' attribute. + * + * + * @param value the new value of the 'Y' attribute. + * @see #getY() + * @generated + */ + void setY(float value); + +} // Point diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/BoundsImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/BoundsImpl.java new file mode 100644 index 00000000000..6b535ca55be --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/BoundsImpl.java @@ -0,0 +1,352 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.dd.dc.Bounds; +import org.eclipse.dd.dc.DcPackage; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Bounds'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.dd.dc.impl.BoundsImpl#getHeight Height}
  • + *
  • {@link org.eclipse.dd.dc.impl.BoundsImpl#getWidth Width}
  • + *
  • {@link org.eclipse.dd.dc.impl.BoundsImpl#getX X}
  • + *
  • {@link org.eclipse.dd.dc.impl.BoundsImpl#getY Y}
  • + *
+ * + * @generated + */ +public class BoundsImpl extends EObjectImpl implements Bounds { + /** + * The default value of the '{@link #getHeight() Height}' attribute. + * + * + * @see #getHeight() + * @generated + * @ordered + */ + protected static final float HEIGHT_EDEFAULT = 0.0F; + + /** + * The cached value of the '{@link #getHeight() Height}' attribute. + * + * + * @see #getHeight() + * @generated + * @ordered + */ + @GwtTransient + protected float height = HEIGHT_EDEFAULT; + + /** + * The default value of the '{@link #getWidth() Width}' attribute. + * + * + * @see #getWidth() + * @generated + * @ordered + */ + protected static final float WIDTH_EDEFAULT = 0.0F; + + /** + * The cached value of the '{@link #getWidth() Width}' attribute. + * + * + * @see #getWidth() + * @generated + * @ordered + */ + @GwtTransient + protected float width = WIDTH_EDEFAULT; + + /** + * The default value of the '{@link #getX() X}' attribute. + * + * + * @see #getX() + * @generated + * @ordered + */ + protected static final float X_EDEFAULT = 0.0F; + + /** + * The cached value of the '{@link #getX() X}' attribute. + * + * + * @see #getX() + * @generated + * @ordered + */ + @GwtTransient + protected float x = X_EDEFAULT; + + /** + * The default value of the '{@link #getY() Y}' attribute. + * + * + * @see #getY() + * @generated + * @ordered + */ + protected static final float Y_EDEFAULT = 0.0F; + + /** + * The cached value of the '{@link #getY() Y}' attribute. + * + * + * @see #getY() + * @generated + * @ordered + */ + @GwtTransient + protected float y = Y_EDEFAULT; + + /** + * + * + * @generated + */ + protected BoundsImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DcPackage.Literals.BOUNDS; + } + + /** + * + * + * @generated + */ + @Override + public float getHeight() { + return height; + } + + /** + * + * + * @generated + */ + @Override + public void setHeight(float newHeight) { + float oldHeight = height; + height = newHeight; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.BOUNDS__HEIGHT, oldHeight, height)); + } + + /** + * + * + * @generated + */ + @Override + public float getWidth() { + return width; + } + + /** + * + * + * @generated + */ + @Override + public void setWidth(float newWidth) { + float oldWidth = width; + width = newWidth; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.BOUNDS__WIDTH, oldWidth, width)); + } + + /** + * + * + * @generated + */ + @Override + public float getX() { + return x; + } + + /** + * + * + * @generated + */ + @Override + public void setX(float newX) { + float oldX = x; + x = newX; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.BOUNDS__X, oldX, x)); + } + + /** + * + * + * @generated + */ + @Override + public float getY() { + return y; + } + + /** + * + * + * @generated + */ + @Override + public void setY(float newY) { + float oldY = y; + y = newY; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.BOUNDS__Y, oldY, y)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DcPackage.BOUNDS__HEIGHT: + return getHeight(); + case DcPackage.BOUNDS__WIDTH: + return getWidth(); + case DcPackage.BOUNDS__X: + return getX(); + case DcPackage.BOUNDS__Y: + return getY(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DcPackage.BOUNDS__HEIGHT: + setHeight((Float) newValue); + return; + case DcPackage.BOUNDS__WIDTH: + setWidth((Float) newValue); + return; + case DcPackage.BOUNDS__X: + setX((Float) newValue); + return; + case DcPackage.BOUNDS__Y: + setY((Float) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DcPackage.BOUNDS__HEIGHT: + setHeight(HEIGHT_EDEFAULT); + return; + case DcPackage.BOUNDS__WIDTH: + setWidth(WIDTH_EDEFAULT); + return; + case DcPackage.BOUNDS__X: + setX(X_EDEFAULT); + return; + case DcPackage.BOUNDS__Y: + setY(Y_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DcPackage.BOUNDS__HEIGHT: + return height != HEIGHT_EDEFAULT; + case DcPackage.BOUNDS__WIDTH: + return width != WIDTH_EDEFAULT; + case DcPackage.BOUNDS__X: + return x != X_EDEFAULT; + case DcPackage.BOUNDS__Y: + return y != Y_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (height: "); + result.append(height); + result.append(", width: "); + result.append(width); + result.append(", x: "); + result.append(x); + result.append(", y: "); + result.append(y); + result.append(')'); + return result.toString(); + } + +} //BoundsImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/DcFactoryImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/DcFactoryImpl.java new file mode 100644 index 00000000000..39a43558215 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/DcFactoryImpl.java @@ -0,0 +1,148 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc.impl; + +import org.eclipse.dd.dc.*; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class DcFactoryImpl extends EFactoryImpl implements DcFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static DcFactory init() { + try { + DcFactory theDcFactory = (DcFactory) EPackage.Registry.INSTANCE.getEFactory(DcPackage.eNS_URI); + if (theDcFactory != null) { + return theDcFactory; + } + } catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new DcFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public DcFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case DcPackage.DOCUMENT_ROOT: + return createDocumentRoot(); + case DcPackage.BOUNDS: + return createBounds(); + case DcPackage.FONT: + return createFont(); + case DcPackage.POINT: + return createPoint(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public DocumentRoot createDocumentRoot() { + DocumentRootImpl documentRoot = new DocumentRootImpl(); + return documentRoot; + } + + /** + * + * + * @generated + */ + @Override + public Bounds createBounds() { + BoundsImpl bounds = new BoundsImpl(); + return bounds; + } + + /** + * + * + * @generated + */ + @Override + public Font createFont() { + FontImpl font = new FontImpl(); + return font; + } + + /** + * + * + * @generated + */ + @Override + public Point createPoint() { + PointImpl point = new PointImpl(); + return point; + } + + /** + * + * + * @generated + */ + @Override + public DcPackage getDcPackage() { + return (DcPackage) getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static DcPackage getPackage() { + return DcPackage.eINSTANCE; + } + +} //DcFactoryImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/DcPackageImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/DcPackageImpl.java new file mode 100644 index 00000000000..693aa3afb50 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/DcPackageImpl.java @@ -0,0 +1,677 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc.impl; + +import com.google.gwt.user.client.rpc.IsSerializable; + +import org.eclipse.bpmn2.Bpmn2Package; + +import org.eclipse.bpmn2.di.BpmnDiPackage; + +import org.eclipse.bpmn2.di.impl.BpmnDiPackageImpl; + +import org.eclipse.bpmn2.impl.Bpmn2PackageImpl; + +import org.eclipse.dd.dc.Bounds; +import org.eclipse.dd.dc.DcFactory; +import org.eclipse.dd.dc.DcPackage; +import org.eclipse.dd.dc.DocumentRoot; +import org.eclipse.dd.dc.Font; +import org.eclipse.dd.dc.Point; + +import org.eclipse.dd.dc.util.DcValidator; + +import org.eclipse.dd.di.DiPackage; + +import org.eclipse.dd.di.impl.DiPackageImpl; + +import org.eclipse.emf.common.util.Reflect; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EGenericType; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EValidator; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class DcPackageImpl extends EPackageImpl implements DcPackage { + /** + * + * + * @generated + */ + private EClass documentRootEClass = null; + + /** + * + * + * @generated + */ + private EClass boundsEClass = null; + + /** + * + * + * @generated + */ + private EClass fontEClass = null; + + /** + * + * + * @generated + */ + private EClass pointEClass = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.dd.dc.DcPackage#eNS_URI + * @see #init() + * @generated + */ + private DcPackageImpl() { + super(eNS_URI, DcFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link DcPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static DcPackage init() { + if (isInited) + return (DcPackage) EPackage.Registry.INSTANCE.getEPackage(DcPackage.eNS_URI); + + initializeRegistryHelpers(); + + // Obtain or create and register package + Object registeredDcPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + DcPackageImpl theDcPackage = registeredDcPackage instanceof DcPackageImpl ? (DcPackageImpl) registeredDcPackage + : new DcPackageImpl(); + + isInited = true; + + // Obtain or create and register interdependencies + Object registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Bpmn2Package.eNS_URI); + Bpmn2PackageImpl theBpmn2Package = (Bpmn2PackageImpl) (registeredPackage instanceof Bpmn2PackageImpl + ? registeredPackage + : Bpmn2Package.eINSTANCE); + registeredPackage = EPackage.Registry.INSTANCE.getEPackage(BpmnDiPackage.eNS_URI); + BpmnDiPackageImpl theBpmnDiPackage = (BpmnDiPackageImpl) (registeredPackage instanceof BpmnDiPackageImpl + ? registeredPackage + : BpmnDiPackage.eINSTANCE); + registeredPackage = EPackage.Registry.INSTANCE.getEPackage(DiPackage.eNS_URI); + DiPackageImpl theDiPackage = (DiPackageImpl) (registeredPackage instanceof DiPackageImpl ? registeredPackage + : DiPackage.eINSTANCE); + + // Create package meta-data objects + theDcPackage.createPackageContents(); + theBpmn2Package.createPackageContents(); + theBpmnDiPackage.createPackageContents(); + theDiPackage.createPackageContents(); + + // Initialize created meta-data + theDcPackage.initializePackageContents(); + theBpmn2Package.initializePackageContents(); + theBpmnDiPackage.initializePackageContents(); + theDiPackage.initializePackageContents(); + + // Register package validator + EValidator.Registry.INSTANCE.put(theDcPackage, new EValidator.Descriptor() { + @Override + public EValidator getEValidator() { + return DcValidator.INSTANCE; + } + }); + + // Mark meta-data to indicate it can't be changed + theDcPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(DcPackage.eNS_URI, theDcPackage); + return theDcPackage; + } + + /** + * + * + * @generated + */ + public static void initializeRegistryHelpers() { + Reflect.register(DocumentRoot.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof DocumentRoot; + } + + public Object newArrayInstance(int size) { + return new DocumentRoot[size]; + } + }); + Reflect.register(Bounds.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Bounds; + } + + public Object newArrayInstance(int size) { + return new Bounds[size]; + } + }); + Reflect.register(Font.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Font; + } + + public Object newArrayInstance(int size) { + return new Font[size]; + } + }); + Reflect.register(Point.class, new Reflect.Helper() { + public boolean isInstance(Object instance) { + return instance instanceof Point; + } + + public Object newArrayInstance(int size) { + return new Point[size]; + } + }); + } + + /** + * + * + * @generated + */ + public static class WhiteList implements IsSerializable, EBasicWhiteList { + /** + * + * + * @generated + */ + protected DocumentRoot documentRoot; + + /** + * + * + * @generated + */ + protected Bounds bounds; + + /** + * + * + * @generated + */ + protected Font font; + + /** + * + * + * @generated + */ + protected Point point; + + } + + /** + * + * + * @generated + */ + @Override + public EClass getDocumentRoot() { + return documentRootEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getDocumentRoot_Mixed() { + return (EAttribute) documentRootEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_XMLNSPrefixMap() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_XSISchemaLocation() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Bounds() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Font() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDocumentRoot_Point() { + return (EReference) documentRootEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBounds() { + return boundsEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBounds_Height() { + return (EAttribute) boundsEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBounds_Width() { + return (EAttribute) boundsEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBounds_X() { + return (EAttribute) boundsEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getBounds_Y() { + return (EAttribute) boundsEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getFont() { + return fontEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFont_IsBold() { + return (EAttribute) fontEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFont_IsItalic() { + return (EAttribute) fontEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFont_IsStrikeThrough() { + return (EAttribute) fontEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFont_IsUnderline() { + return (EAttribute) fontEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFont_Name() { + return (EAttribute) fontEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFont_Size() { + return (EAttribute) fontEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPoint() { + return pointEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getPoint_X() { + return (EAttribute) pointEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getPoint_Y() { + return (EAttribute) pointEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public DcFactory getDcFactory() { + return (DcFactory) getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) + return; + isCreated = true; + + // Create classes and their features + documentRootEClass = createEClass(DOCUMENT_ROOT); + createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED); + createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP); + createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__BOUNDS); + createEReference(documentRootEClass, DOCUMENT_ROOT__FONT); + createEReference(documentRootEClass, DOCUMENT_ROOT__POINT); + + boundsEClass = createEClass(BOUNDS); + createEAttribute(boundsEClass, BOUNDS__HEIGHT); + createEAttribute(boundsEClass, BOUNDS__WIDTH); + createEAttribute(boundsEClass, BOUNDS__X); + createEAttribute(boundsEClass, BOUNDS__Y); + + fontEClass = createEClass(FONT); + createEAttribute(fontEClass, FONT__IS_BOLD); + createEAttribute(fontEClass, FONT__IS_ITALIC); + createEAttribute(fontEClass, FONT__IS_STRIKE_THROUGH); + createEAttribute(fontEClass, FONT__IS_UNDERLINE); + createEAttribute(fontEClass, FONT__NAME); + createEAttribute(fontEClass, FONT__SIZE); + + pointEClass = createEClass(POINT); + createEAttribute(pointEClass, POINT__X); + createEAttribute(pointEClass, POINT__Y); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) + return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes and features; add operations and parameters + initEClass(documentRootEClass, DocumentRoot.class, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, + "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, + "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_Bounds(), this.getBounds(), null, "bounds", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_Font(), this.getFont(), null, "font", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEReference(getDocumentRoot_Point(), this.getPoint(), null, "point", null, 0, -2, null, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + + initEClass(boundsEClass, Bounds.class, "Bounds", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getBounds_Height(), ecorePackage.getEFloat(), "height", null, 1, 1, Bounds.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getBounds_Width(), ecorePackage.getEFloat(), "width", null, 1, 1, Bounds.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getBounds_X(), ecorePackage.getEFloat(), "x", "0", 1, 1, Bounds.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getBounds_Y(), ecorePackage.getEFloat(), "y", "0", 1, 1, Bounds.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(fontEClass, Font.class, "Font", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getFont_IsBold(), ecorePackage.getEBoolean(), "isBold", null, 0, 1, Font.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getFont_IsItalic(), ecorePackage.getEBoolean(), "isItalic", null, 0, 1, Font.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getFont_IsStrikeThrough(), ecorePackage.getEBoolean(), "isStrikeThrough", null, 0, 1, Font.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getFont_IsUnderline(), ecorePackage.getEBoolean(), "isUnderline", null, 0, 1, Font.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getFont_Name(), ecorePackage.getEString(), "name", null, 0, 1, Font.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getFont_Size(), ecorePackage.getEFloat(), "size", null, 0, 1, Font.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + EOperation op = addEOperation(fontEClass, ecorePackage.getEBoolean(), "non_negative_size", 0, 1, IS_UNIQUE, + IS_ORDERED); + addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); + EGenericType g1 = createEGenericType(ecorePackage.getEMap()); + EGenericType g2 = createEGenericType(ecorePackage.getEJavaObject()); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(ecorePackage.getEJavaObject()); + g1.getETypeArguments().add(g2); + addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEClass(pointEClass, Point.class, "Point", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getPoint_X(), ecorePackage.getEFloat(), "x", "0", 1, 1, Point.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getPoint_Y(), ecorePackage.getEFloat(), "y", "0", 1, 1, Point.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http:///org/eclipse/emf/ecore/util/ExtendedMetaData + createExtendedMetaDataAnnotations(); + } + + /** + * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. + * + * + * @generated + */ + protected void createExtendedMetaDataAnnotations() { + String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; + addAnnotation(documentRootEClass, source, new String[] { "name", "", "kind", "mixed" }); + addAnnotation(getDocumentRoot_Mixed(), source, new String[] { "kind", "elementWildcard", "name", ":mixed" }); + addAnnotation(getDocumentRoot_XMLNSPrefixMap(), source, + new String[] { "kind", "attribute", "name", "xmlns:prefix" }); + addAnnotation(getDocumentRoot_XSISchemaLocation(), source, + new String[] { "kind", "attribute", "name", "xsi:schemaLocation" }); + addAnnotation(getDocumentRoot_Bounds(), source, new String[] { "kind", "element", "name", "Bounds", "namespace", + "http://www.omg.org/spec/DD/20100524/DC" }); + addAnnotation(getDocumentRoot_Font(), source, new String[] { "kind", "element", "name", "Font", "namespace", + "http://www.omg.org/spec/DD/20100524/DC" }); + addAnnotation(getDocumentRoot_Point(), source, new String[] { "kind", "element", "name", "Point", "namespace", + "http://www.omg.org/spec/DD/20100524/DC" }); + addAnnotation(boundsEClass, source, new String[] { "name", "Bounds", "kind", "empty" }); + addAnnotation(getBounds_Height(), source, new String[] { "kind", "attribute", "name", "height" }); + addAnnotation(getBounds_Width(), source, new String[] { "kind", "attribute", "name", "width" }); + addAnnotation(getBounds_X(), source, new String[] { "kind", "attribute", "name", "x" }); + addAnnotation(getBounds_Y(), source, new String[] { "kind", "attribute", "name", "y" }); + addAnnotation(fontEClass, source, new String[] { "name", "Font", "kind", "empty" }); + addAnnotation(getFont_IsBold(), source, new String[] { "kind", "attribute", "name", "isBold" }); + addAnnotation(getFont_IsItalic(), source, new String[] { "kind", "attribute", "name", "isItalic" }); + addAnnotation(getFont_IsStrikeThrough(), source, + new String[] { "kind", "attribute", "name", "isStrikeThrough" }); + addAnnotation(getFont_IsUnderline(), source, new String[] { "kind", "attribute", "name", "isUnderline" }); + addAnnotation(getFont_Name(), source, new String[] { "kind", "attribute", "name", "name" }); + addAnnotation(getFont_Size(), source, new String[] { "kind", "attribute", "name", "size" }); + addAnnotation(pointEClass, source, new String[] { "name", "Point", "kind", "empty" }); + addAnnotation(getPoint_X(), source, new String[] { "kind", "attribute", "name", "x" }); + addAnnotation(getPoint_Y(), source, new String[] { "kind", "attribute", "name", "y" }); + } + +} //DcPackageImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/DocumentRootImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/DocumentRootImpl.java new file mode 100644 index 00000000000..572fae4c573 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/DocumentRootImpl.java @@ -0,0 +1,398 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.dd.dc.Bounds; +import org.eclipse.dd.dc.DcPackage; +import org.eclipse.dd.dc.DocumentRoot; +import org.eclipse.dd.dc.Font; +import org.eclipse.dd.dc.Point; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EMap; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.EcoreEMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Document Root'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.dd.dc.impl.DocumentRootImpl#getMixed Mixed}
  • + *
  • {@link org.eclipse.dd.dc.impl.DocumentRootImpl#getXMLNSPrefixMap XMLNS Prefix Map}
  • + *
  • {@link org.eclipse.dd.dc.impl.DocumentRootImpl#getXSISchemaLocation XSI Schema Location}
  • + *
  • {@link org.eclipse.dd.dc.impl.DocumentRootImpl#getBounds Bounds}
  • + *
  • {@link org.eclipse.dd.dc.impl.DocumentRootImpl#getFont Font}
  • + *
  • {@link org.eclipse.dd.dc.impl.DocumentRootImpl#getPoint Point}
  • + *
+ * + * @generated + */ +public class DocumentRootImpl extends EObjectImpl implements DocumentRoot { + /** + * The cached value of the '{@link #getMixed() Mixed}' attribute list. + * + * + * @see #getMixed() + * @generated + * @ordered + */ + @GwtTransient + protected FeatureMap mixed; + + /** + * The cached value of the '{@link #getXMLNSPrefixMap() XMLNS Prefix Map}' map. + * + * + * @see #getXMLNSPrefixMap() + * @generated + * @ordered + */ + @GwtTransient + protected EMap xMLNSPrefixMap; + + /** + * The cached value of the '{@link #getXSISchemaLocation() XSI Schema Location}' map. + * + * + * @see #getXSISchemaLocation() + * @generated + * @ordered + */ + @GwtTransient + protected EMap xSISchemaLocation; + + /** + * + * + * @generated + */ + protected DocumentRootImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DcPackage.Literals.DOCUMENT_ROOT; + } + + /** + * + * + * @generated + */ + @Override + public FeatureMap getMixed() { + if (mixed == null) { + mixed = new BasicFeatureMap(this, DcPackage.DOCUMENT_ROOT__MIXED); + } + return mixed; + } + + /** + * + * + * @generated + */ + @Override + public EMap getXMLNSPrefixMap() { + if (xMLNSPrefixMap == null) { + xMLNSPrefixMap = new EcoreEMap(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, + EStringToStringMapEntryImpl.class, this, DcPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP); + } + return xMLNSPrefixMap; + } + + /** + * + * + * @generated + */ + @Override + public EMap getXSISchemaLocation() { + if (xSISchemaLocation == null) { + xSISchemaLocation = new EcoreEMap(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, + EStringToStringMapEntryImpl.class, this, DcPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); + } + return xSISchemaLocation; + } + + /** + * + * + * @generated + */ + @Override + public Bounds getBounds() { + return (Bounds) getMixed().get(DcPackage.Literals.DOCUMENT_ROOT__BOUNDS, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBounds(Bounds newBounds, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(DcPackage.Literals.DOCUMENT_ROOT__BOUNDS, newBounds, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setBounds(Bounds newBounds) { + ((FeatureMap.Internal) getMixed()).set(DcPackage.Literals.DOCUMENT_ROOT__BOUNDS, newBounds); + } + + /** + * + * + * @generated + */ + @Override + public Font getFont() { + return (Font) getMixed().get(DcPackage.Literals.DOCUMENT_ROOT__FONT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFont(Font newFont, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(DcPackage.Literals.DOCUMENT_ROOT__FONT, newFont, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setFont(Font newFont) { + ((FeatureMap.Internal) getMixed()).set(DcPackage.Literals.DOCUMENT_ROOT__FONT, newFont); + } + + /** + * + * + * @generated + */ + @Override + public Point getPoint() { + return (Point) getMixed().get(DcPackage.Literals.DOCUMENT_ROOT__POINT, true); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetPoint(Point newPoint, NotificationChain msgs) { + return ((FeatureMap.Internal) getMixed()).basicAdd(DcPackage.Literals.DOCUMENT_ROOT__POINT, newPoint, msgs); + } + + /** + * + * + * @generated + */ + @Override + public void setPoint(Point newPoint) { + ((FeatureMap.Internal) getMixed()).set(DcPackage.Literals.DOCUMENT_ROOT__POINT, newPoint); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case DcPackage.DOCUMENT_ROOT__MIXED: + return ((InternalEList) getMixed()).basicRemove(otherEnd, msgs); + case DcPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + return ((InternalEList) getXMLNSPrefixMap()).basicRemove(otherEnd, msgs); + case DcPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + return ((InternalEList) getXSISchemaLocation()).basicRemove(otherEnd, msgs); + case DcPackage.DOCUMENT_ROOT__BOUNDS: + return basicSetBounds(null, msgs); + case DcPackage.DOCUMENT_ROOT__FONT: + return basicSetFont(null, msgs); + case DcPackage.DOCUMENT_ROOT__POINT: + return basicSetPoint(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DcPackage.DOCUMENT_ROOT__MIXED: + if (coreType) + return getMixed(); + return ((FeatureMap.Internal) getMixed()).getWrapper(); + case DcPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + if (coreType) + return getXMLNSPrefixMap(); + else + return getXMLNSPrefixMap().map(); + case DcPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + if (coreType) + return getXSISchemaLocation(); + else + return getXSISchemaLocation().map(); + case DcPackage.DOCUMENT_ROOT__BOUNDS: + return getBounds(); + case DcPackage.DOCUMENT_ROOT__FONT: + return getFont(); + case DcPackage.DOCUMENT_ROOT__POINT: + return getPoint(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DcPackage.DOCUMENT_ROOT__MIXED: + ((FeatureMap.Internal) getMixed()).set(newValue); + return; + case DcPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + ((EStructuralFeature.Setting) getXMLNSPrefixMap()).set(newValue); + return; + case DcPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + ((EStructuralFeature.Setting) getXSISchemaLocation()).set(newValue); + return; + case DcPackage.DOCUMENT_ROOT__BOUNDS: + setBounds((Bounds) newValue); + return; + case DcPackage.DOCUMENT_ROOT__FONT: + setFont((Font) newValue); + return; + case DcPackage.DOCUMENT_ROOT__POINT: + setPoint((Point) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DcPackage.DOCUMENT_ROOT__MIXED: + getMixed().clear(); + return; + case DcPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + getXMLNSPrefixMap().clear(); + return; + case DcPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + getXSISchemaLocation().clear(); + return; + case DcPackage.DOCUMENT_ROOT__BOUNDS: + setBounds((Bounds) null); + return; + case DcPackage.DOCUMENT_ROOT__FONT: + setFont((Font) null); + return; + case DcPackage.DOCUMENT_ROOT__POINT: + setPoint((Point) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DcPackage.DOCUMENT_ROOT__MIXED: + return mixed != null && !mixed.isEmpty(); + case DcPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty(); + case DcPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + return xSISchemaLocation != null && !xSISchemaLocation.isEmpty(); + case DcPackage.DOCUMENT_ROOT__BOUNDS: + return getBounds() != null; + case DcPackage.DOCUMENT_ROOT__FONT: + return getFont() != null; + case DcPackage.DOCUMENT_ROOT__POINT: + return getPoint() != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (mixed: "); + result.append(mixed); + result.append(')'); + return result.toString(); + } + +} //DocumentRootImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/FontImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/FontImpl.java new file mode 100644 index 00000000000..a48859038fb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/FontImpl.java @@ -0,0 +1,504 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import java.util.Map; + +import org.eclipse.dd.dc.DcPackage; +import org.eclipse.dd.dc.Font; + +import org.eclipse.dd.dc.util.DcValidator; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.DiagnosticChain; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +import org.eclipse.emf.ecore.util.EObjectValidator; + +/** + * + * An implementation of the model object 'Font'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.dd.dc.impl.FontImpl#isIsBold Is Bold}
  • + *
  • {@link org.eclipse.dd.dc.impl.FontImpl#isIsItalic Is Italic}
  • + *
  • {@link org.eclipse.dd.dc.impl.FontImpl#isIsStrikeThrough Is Strike Through}
  • + *
  • {@link org.eclipse.dd.dc.impl.FontImpl#isIsUnderline Is Underline}
  • + *
  • {@link org.eclipse.dd.dc.impl.FontImpl#getName Name}
  • + *
  • {@link org.eclipse.dd.dc.impl.FontImpl#getSize Size}
  • + *
+ * + * @generated + */ +public class FontImpl extends EObjectImpl implements Font { + /** + * The default value of the '{@link #isIsBold() Is Bold}' attribute. + * + * + * @see #isIsBold() + * @generated + * @ordered + */ + protected static final boolean IS_BOLD_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsBold() Is Bold}' attribute. + * + * + * @see #isIsBold() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isBold = IS_BOLD_EDEFAULT; + + /** + * The default value of the '{@link #isIsItalic() Is Italic}' attribute. + * + * + * @see #isIsItalic() + * @generated + * @ordered + */ + protected static final boolean IS_ITALIC_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsItalic() Is Italic}' attribute. + * + * + * @see #isIsItalic() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isItalic = IS_ITALIC_EDEFAULT; + + /** + * The default value of the '{@link #isIsStrikeThrough() Is Strike Through}' attribute. + * + * + * @see #isIsStrikeThrough() + * @generated + * @ordered + */ + protected static final boolean IS_STRIKE_THROUGH_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsStrikeThrough() Is Strike Through}' attribute. + * + * + * @see #isIsStrikeThrough() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isStrikeThrough = IS_STRIKE_THROUGH_EDEFAULT; + + /** + * The default value of the '{@link #isIsUnderline() Is Underline}' attribute. + * + * + * @see #isIsUnderline() + * @generated + * @ordered + */ + protected static final boolean IS_UNDERLINE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsUnderline() Is Underline}' attribute. + * + * + * @see #isIsUnderline() + * @generated + * @ordered + */ + @GwtTransient + protected boolean isUnderline = IS_UNDERLINE_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + @GwtTransient + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getSize() Size}' attribute. + * + * + * @see #getSize() + * @generated + * @ordered + */ + protected static final float SIZE_EDEFAULT = 0.0F; + + /** + * The cached value of the '{@link #getSize() Size}' attribute. + * + * + * @see #getSize() + * @generated + * @ordered + */ + @GwtTransient + protected float size = SIZE_EDEFAULT; + + /** + * + * + * @generated + */ + protected FontImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DcPackage.Literals.FONT; + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsBold() { + return isBold; + } + + /** + * + * + * @generated + */ + @Override + public void setIsBold(boolean newIsBold) { + boolean oldIsBold = isBold; + isBold = newIsBold; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.FONT__IS_BOLD, oldIsBold, isBold)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsItalic() { + return isItalic; + } + + /** + * + * + * @generated + */ + @Override + public void setIsItalic(boolean newIsItalic) { + boolean oldIsItalic = isItalic; + isItalic = newIsItalic; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.FONT__IS_ITALIC, oldIsItalic, isItalic)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsStrikeThrough() { + return isStrikeThrough; + } + + /** + * + * + * @generated + */ + @Override + public void setIsStrikeThrough(boolean newIsStrikeThrough) { + boolean oldIsStrikeThrough = isStrikeThrough; + isStrikeThrough = newIsStrikeThrough; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.FONT__IS_STRIKE_THROUGH, oldIsStrikeThrough, + isStrikeThrough)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsUnderline() { + return isUnderline; + } + + /** + * + * + * @generated + */ + @Override + public void setIsUnderline(boolean newIsUnderline) { + boolean oldIsUnderline = isUnderline; + isUnderline = newIsUnderline; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.FONT__IS_UNDERLINE, oldIsUnderline, + isUnderline)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.FONT__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public float getSize() { + return size; + } + + /** + * + * + * @generated + */ + @Override + public void setSize(float newSize) { + float oldSize = size; + size = newSize; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.FONT__SIZE, oldSize, size)); + } + + /** + * + * + * @generated + */ + @Override + public boolean non_negative_size(DiagnosticChain diagnostics, Map context) { + // TODO: implement this method + // -> specify the condition that violates the invariant + // -> verify the details of the diagnostic, including severity and message + // Ensure that you remove @generated or mark it @generated NOT + if (false) { + if (diagnostics != null) { + diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR, DcValidator.DIAGNOSTIC_SOURCE, + DcValidator.FONT__NON_NEGATIVE_SIZE, + EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", + new Object[] { "non_negative_size", EObjectValidator.getObjectLabel(this, context) }), + new Object[] { this })); + } + return false; + } + return true; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DcPackage.FONT__IS_BOLD: + return isIsBold(); + case DcPackage.FONT__IS_ITALIC: + return isIsItalic(); + case DcPackage.FONT__IS_STRIKE_THROUGH: + return isIsStrikeThrough(); + case DcPackage.FONT__IS_UNDERLINE: + return isIsUnderline(); + case DcPackage.FONT__NAME: + return getName(); + case DcPackage.FONT__SIZE: + return getSize(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DcPackage.FONT__IS_BOLD: + setIsBold((Boolean) newValue); + return; + case DcPackage.FONT__IS_ITALIC: + setIsItalic((Boolean) newValue); + return; + case DcPackage.FONT__IS_STRIKE_THROUGH: + setIsStrikeThrough((Boolean) newValue); + return; + case DcPackage.FONT__IS_UNDERLINE: + setIsUnderline((Boolean) newValue); + return; + case DcPackage.FONT__NAME: + setName((String) newValue); + return; + case DcPackage.FONT__SIZE: + setSize((Float) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DcPackage.FONT__IS_BOLD: + setIsBold(IS_BOLD_EDEFAULT); + return; + case DcPackage.FONT__IS_ITALIC: + setIsItalic(IS_ITALIC_EDEFAULT); + return; + case DcPackage.FONT__IS_STRIKE_THROUGH: + setIsStrikeThrough(IS_STRIKE_THROUGH_EDEFAULT); + return; + case DcPackage.FONT__IS_UNDERLINE: + setIsUnderline(IS_UNDERLINE_EDEFAULT); + return; + case DcPackage.FONT__NAME: + setName(NAME_EDEFAULT); + return; + case DcPackage.FONT__SIZE: + setSize(SIZE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DcPackage.FONT__IS_BOLD: + return isBold != IS_BOLD_EDEFAULT; + case DcPackage.FONT__IS_ITALIC: + return isItalic != IS_ITALIC_EDEFAULT; + case DcPackage.FONT__IS_STRIKE_THROUGH: + return isStrikeThrough != IS_STRIKE_THROUGH_EDEFAULT; + case DcPackage.FONT__IS_UNDERLINE: + return isUnderline != IS_UNDERLINE_EDEFAULT; + case DcPackage.FONT__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case DcPackage.FONT__SIZE: + return size != SIZE_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (isBold: "); + result.append(isBold); + result.append(", isItalic: "); + result.append(isItalic); + result.append(", isStrikeThrough: "); + result.append(isStrikeThrough); + result.append(", isUnderline: "); + result.append(isUnderline); + result.append(", name: "); + result.append(name); + result.append(", size: "); + result.append(size); + result.append(')'); + return result.toString(); + } + +} //FontImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/PointImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/PointImpl.java new file mode 100644 index 00000000000..02741c447d1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/impl/PointImpl.java @@ -0,0 +1,238 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc.impl; + +import com.google.gwt.user.client.rpc.GwtTransient; + +import org.eclipse.dd.dc.DcPackage; +import org.eclipse.dd.dc.Point; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Point'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.dd.dc.impl.PointImpl#getX X}
  • + *
  • {@link org.eclipse.dd.dc.impl.PointImpl#getY Y}
  • + *
+ * + * @generated + */ +public class PointImpl extends EObjectImpl implements Point { + /** + * The default value of the '{@link #getX() X}' attribute. + * + * + * @see #getX() + * @generated + * @ordered + */ + protected static final float X_EDEFAULT = 0.0F; + + /** + * The cached value of the '{@link #getX() X}' attribute. + * + * + * @see #getX() + * @generated + * @ordered + */ + @GwtTransient + protected float x = X_EDEFAULT; + + /** + * The default value of the '{@link #getY() Y}' attribute. + * + * + * @see #getY() + * @generated + * @ordered + */ + protected static final float Y_EDEFAULT = 0.0F; + + /** + * The cached value of the '{@link #getY() Y}' attribute. + * + * + * @see #getY() + * @generated + * @ordered + */ + @GwtTransient + protected float y = Y_EDEFAULT; + + /** + * + * + * @generated + */ + protected PointImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DcPackage.Literals.POINT; + } + + /** + * + * + * @generated + */ + @Override + public float getX() { + return x; + } + + /** + * + * + * @generated + */ + @Override + public void setX(float newX) { + float oldX = x; + x = newX; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.POINT__X, oldX, x)); + } + + /** + * + * + * @generated + */ + @Override + public float getY() { + return y; + } + + /** + * + * + * @generated + */ + @Override + public void setY(float newY) { + float oldY = y; + y = newY; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.POINT__Y, oldY, y)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DcPackage.POINT__X: + return getX(); + case DcPackage.POINT__Y: + return getY(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DcPackage.POINT__X: + setX((Float) newValue); + return; + case DcPackage.POINT__Y: + setY((Float) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DcPackage.POINT__X: + setX(X_EDEFAULT); + return; + case DcPackage.POINT__Y: + setY(Y_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DcPackage.POINT__X: + return x != X_EDEFAULT; + case DcPackage.POINT__Y: + return y != Y_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (x: "); + result.append(x); + result.append(", y: "); + result.append(y); + result.append(')'); + return result.toString(); + } + +} //PointImpl diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/util/DcAdapterFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/util/DcAdapterFactory.java new file mode 100644 index 00000000000..3b8f0866e5d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/util/DcAdapterFactory.java @@ -0,0 +1,188 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc.util; + +import org.eclipse.dd.dc.*; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see org.eclipse.dd.dc.DcPackage + * @generated + */ +public class DcAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static DcPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public DcAdapterFactory() { + if (modelPackage == null) { + modelPackage = DcPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject) object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected DcSwitch modelSwitch = new DcSwitch() { + @Override + public Adapter caseDocumentRoot(DocumentRoot object) { + return createDocumentRootAdapter(); + } + + @Override + public Adapter caseBounds(Bounds object) { + return createBoundsAdapter(); + } + + @Override + public Adapter caseFont(Font object) { + return createFontAdapter(); + } + + @Override + public Adapter casePoint(Point object) { + return createPointAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject) target); + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.dc.DocumentRoot Document Root}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.dc.DocumentRoot + * @generated + */ + public Adapter createDocumentRootAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.dc.Bounds Bounds}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.dc.Bounds + * @generated + */ + public Adapter createBoundsAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.dc.Font Font}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.dc.Font + * @generated + */ + public Adapter createFontAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.dd.dc.Point Point}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.dd.dc.Point + * @generated + */ + public Adapter createPointAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //DcAdapterFactory diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/util/DcSwitch.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/util/DcSwitch.java new file mode 100644 index 00000000000..2f18fe812c8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/util/DcSwitch.java @@ -0,0 +1,202 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc.util; + +import java.util.List; + +import org.eclipse.dd.dc.*; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see org.eclipse.dd.dc.DcPackage + * @generated + */ +public class DcSwitch { + /** + * The cached model package + * + * + * @generated + */ + protected static DcPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public DcSwitch() { + if (modelPackage == null) { + modelPackage = DcPackage.eINSTANCE; + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + public T doSwitch(EObject theEObject) { + return doSwitch(theEObject.eClass(), theEObject); + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected T doSwitch(EClass theEClass, EObject theEObject) { + if (theEClass.eContainer() == modelPackage) { + return doSwitch(theEClass.getClassifierID(), theEObject); + } else { + List eSuperTypes = theEClass.getESuperTypes(); + return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case DcPackage.DOCUMENT_ROOT: { + DocumentRoot documentRoot = (DocumentRoot) theEObject; + T result = caseDocumentRoot(documentRoot); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case DcPackage.BOUNDS: { + Bounds bounds = (Bounds) theEObject; + T result = caseBounds(bounds); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case DcPackage.FONT: { + Font font = (Font) theEObject; + T result = caseFont(font); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case DcPackage.POINT: { + Point point = (Point) theEObject; + T result = casePoint(point); + if (result == null) + result = defaultCase(theEObject); + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Document Root'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Document Root'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDocumentRoot(DocumentRoot object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Bounds'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Bounds'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBounds(Bounds object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Font'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Font'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFont(Font object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Point'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Point'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePoint(Point object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + public T defaultCase(EObject object) { + return null; + } + +} //DcSwitch diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/util/DcValidator.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/util/DcValidator.java new file mode 100644 index 00000000000..572c438522e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/dc/util/DcValidator.java @@ -0,0 +1,202 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.dc.util; + +import java.util.Map; + +import org.eclipse.dd.dc.*; + +import org.eclipse.emf.common.util.DiagnosticChain; +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.EObjectValidator; + +/** + * + * The Validator for the model. + * + * @see org.eclipse.dd.dc.DcPackage + * @generated + */ +public class DcValidator extends EObjectValidator { + /** + * The cached model package + * + * + * @generated + */ + public static final DcValidator INSTANCE = new DcValidator(); + + /** + * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package. + * + * + * @see org.eclipse.emf.common.util.Diagnostic#getSource() + * @see org.eclipse.emf.common.util.Diagnostic#getCode() + * @generated + */ + public static final String DIAGNOSTIC_SOURCE = "org.eclipse.dd.dc"; + + /** + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Non negative size' of 'Font'. + * + * + * @generated + */ + public static final int FONT__NON_NEGATIVE_SIZE = 1; + + /** + * A constant with a fixed name that can be used as the base value for additional hand written constants. + * + * + * @generated + */ + private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 1; + + /** + * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class. + * + * + * @generated + */ + protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public DcValidator() { + super(); + } + + /** + * Returns the package of this validator switch. + * + * + * @generated + */ + @Override + protected EPackage getEPackage() { + return DcPackage.eINSTANCE; + } + + /** + * Calls validateXXX for the corresponding classifier of the model. + * + * + * @generated + */ + @Override + protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, + Map context) { + switch (classifierID) { + case DcPackage.DOCUMENT_ROOT: + return validateDocumentRoot((DocumentRoot) value, diagnostics, context); + case DcPackage.BOUNDS: + return validateBounds((Bounds) value, diagnostics, context); + case DcPackage.FONT: + return validateFont((Font) value, diagnostics, context); + case DcPackage.POINT: + return validatePoint((Point) value, diagnostics, context); + default: + return true; + } + } + + /** + * + * + * @generated + */ + public boolean validateDocumentRoot(DocumentRoot documentRoot, DiagnosticChain diagnostics, + Map context) { + return validate_EveryDefaultConstraint(documentRoot, diagnostics, context); + } + + /** + * + * + * @generated + */ + public boolean validateBounds(Bounds bounds, DiagnosticChain diagnostics, Map context) { + return validate_EveryDefaultConstraint(bounds, diagnostics, context); + } + + /** + * + * + * @generated + */ + public boolean validateFont(Font font, DiagnosticChain diagnostics, Map context) { + if (!validate_NoCircularContainment(font, diagnostics, context)) + return false; + boolean result = validate_EveryMultiplicityConforms(font, diagnostics, context); + if (result || diagnostics != null) + result &= validate_EveryDataValueConforms(font, diagnostics, context); + if (result || diagnostics != null) + result &= validate_EveryReferenceIsContained(font, diagnostics, context); + if (result || diagnostics != null) + result &= validate_EveryBidirectionalReferenceIsPaired(font, diagnostics, context); + if (result || diagnostics != null) + result &= validate_EveryProxyResolves(font, diagnostics, context); + if (result || diagnostics != null) + result &= validate_UniqueID(font, diagnostics, context); + if (result || diagnostics != null) + result &= validate_EveryKeyUnique(font, diagnostics, context); + if (result || diagnostics != null) + result &= validate_EveryMapEntryUnique(font, diagnostics, context); + if (result || diagnostics != null) + result &= validateFont_non_negative_size(font, diagnostics, context); + return result; + } + + /** + * Validates the non_negative_size constraint of 'Font'. + * + * + * @generated + */ + public boolean validateFont_non_negative_size(Font font, DiagnosticChain diagnostics, Map context) { + return font.non_negative_size(diagnostics, context); + } + + /** + * + * + * @generated + */ + public boolean validatePoint(Point point, DiagnosticChain diagnostics, Map context) { + return validate_EveryDefaultConstraint(point, diagnostics, context); + } + + /** + * Returns the resource locator that will be used to fetch messages for this validator's diagnostics. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + // TODO + // Specialize this to return a resource locator for messages specific to this validator. + // Ensure that you remove @generated or mark it @generated NOT + return super.getResourceLocator(); + } + +} //DcValidator diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/di/DiFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/di/DiFactory.java new file mode 100644 index 00000000000..3af6dc1d9f5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/di/DiFactory.java @@ -0,0 +1,63 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.di; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see org.eclipse.dd.di.DiPackage + * @generated + */ +public interface DiFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + DiFactory eINSTANCE = org.eclipse.dd.di.impl.DiFactoryImpl.init(); + + /** + * Returns a new object of class 'Document Root'. + * + * + * @return a new object of class 'Document Root'. + * @generated + */ + DocumentRoot createDocumentRoot(); + + /** + * Returns a new object of class 'Diagram Element'. + * + * + * @return a new object of class 'Diagram Element'. + * @generated + */ + DiagramElement createDiagramElement(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + DiPackage getDiPackage(); + +} //DiFactory diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/di/DiPackage.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/di/DiPackage.java new file mode 100644 index 00000000000..4e0d444d9f3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/di/DiPackage.java @@ -0,0 +1,1889 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.di; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see org.eclipse.dd.di.DiFactory + * @model kind="package" + * @generated + */ +public interface DiPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "di"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.omg.org/spec/DD/20100524/DI-XMI"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "di"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + DiPackage eINSTANCE = org.eclipse.dd.di.impl.DiPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.dd.di.impl.DocumentRootImpl Document Root}' class. + * + * + * @see org.eclipse.dd.di.impl.DocumentRootImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getDocumentRoot() + * @generated + */ + int DOCUMENT_ROOT = 0; + + /** + * The feature id for the 'Mixed' attribute list. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__MIXED = 0; + + /** + * The feature id for the 'XMLNS Prefix Map' map. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1; + + /** + * The feature id for the 'XSI Schema Location' map. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2; + + /** + * The feature id for the 'Diagram Element' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DIAGRAM_ELEMENT = 3; + + /** + * The feature id for the 'Diagram' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__DIAGRAM = 4; + + /** + * The feature id for the 'Edge' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__EDGE = 5; + + /** + * The feature id for the 'Label' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__LABEL = 6; + + /** + * The feature id for the 'Labeled Edge' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__LABELED_EDGE = 7; + + /** + * The feature id for the 'Labeled Shape' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__LABELED_SHAPE = 8; + + /** + * The feature id for the 'Node' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__NODE = 9; + + /** + * The feature id for the 'Plane' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__PLANE = 10; + + /** + * The feature id for the 'Shape' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__SHAPE = 11; + + /** + * The feature id for the 'Style' containment reference. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT__STYLE = 12; + + /** + * The number of structural features of the 'Document Root' class. + * + * + * @generated + * @ordered + */ + int DOCUMENT_ROOT_FEATURE_COUNT = 13; + + /** + * The meta object id for the '{@link org.eclipse.dd.di.impl.DiagramImpl Diagram}' class. + * + * + * @see org.eclipse.dd.di.impl.DiagramImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getDiagram() + * @generated + */ + int DIAGRAM = 1; + + /** + * The feature id for the 'Documentation' attribute. + * + * + * @generated + * @ordered + */ + int DIAGRAM__DOCUMENTATION = 0; + + /** + * The feature id for the 'Owned Style' reference list. + * + * + * @generated + * @ordered + */ + int DIAGRAM__OWNED_STYLE = 1; + + /** + * The feature id for the 'Root Element' reference. + * + * + * @generated + * @ordered + */ + int DIAGRAM__ROOT_ELEMENT = 2; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DIAGRAM__ID = 3; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int DIAGRAM__NAME = 4; + + /** + * The feature id for the 'Resolution' attribute. + * + * + * @generated + * @ordered + */ + int DIAGRAM__RESOLUTION = 5; + + /** + * The number of structural features of the 'Diagram' class. + * + * + * @generated + * @ordered + */ + int DIAGRAM_FEATURE_COUNT = 6; + + /** + * The meta object id for the '{@link org.eclipse.dd.di.impl.DiagramElementImpl Diagram Element}' class. + * + * + * @see org.eclipse.dd.di.impl.DiagramElementImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getDiagramElement() + * @generated + */ + int DIAGRAM_ELEMENT = 2; + + /** + * The feature id for the 'Owning Diagram' reference. + * + * + * @generated + * @ordered + */ + int DIAGRAM_ELEMENT__OWNING_DIAGRAM = 0; + + /** + * The feature id for the 'Owning Element' reference. + * + * + * @generated + * @ordered + */ + int DIAGRAM_ELEMENT__OWNING_ELEMENT = 1; + + /** + * The feature id for the 'Owned Element' reference list. + * + * + * @generated + * @ordered + */ + int DIAGRAM_ELEMENT__OWNED_ELEMENT = 2; + + /** + * The feature id for the 'Model Element' reference. + * + * + * @generated + * @ordered + */ + int DIAGRAM_ELEMENT__MODEL_ELEMENT = 3; + + /** + * The feature id for the 'Style' reference. + * + * + * @generated + * @ordered + */ + int DIAGRAM_ELEMENT__STYLE = 4; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int DIAGRAM_ELEMENT__ID = 5; + + /** + * The number of structural features of the 'Diagram Element' class. + * + * + * @generated + * @ordered + */ + int DIAGRAM_ELEMENT_FEATURE_COUNT = 6; + + /** + * The meta object id for the '{@link org.eclipse.dd.di.impl.EdgeImpl Edge}' class. + * + * + * @see org.eclipse.dd.di.impl.EdgeImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getEdge() + * @generated + */ + int EDGE = 3; + + /** + * The feature id for the 'Owning Diagram' reference. + * + * + * @generated + * @ordered + */ + int EDGE__OWNING_DIAGRAM = DIAGRAM_ELEMENT__OWNING_DIAGRAM; + + /** + * The feature id for the 'Owning Element' reference. + * + * + * @generated + * @ordered + */ + int EDGE__OWNING_ELEMENT = DIAGRAM_ELEMENT__OWNING_ELEMENT; + + /** + * The feature id for the 'Owned Element' reference list. + * + * + * @generated + * @ordered + */ + int EDGE__OWNED_ELEMENT = DIAGRAM_ELEMENT__OWNED_ELEMENT; + + /** + * The feature id for the 'Model Element' reference. + * + * + * @generated + * @ordered + */ + int EDGE__MODEL_ELEMENT = DIAGRAM_ELEMENT__MODEL_ELEMENT; + + /** + * The feature id for the 'Style' reference. + * + * + * @generated + * @ordered + */ + int EDGE__STYLE = DIAGRAM_ELEMENT__STYLE; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int EDGE__ID = DIAGRAM_ELEMENT__ID; + + /** + * The feature id for the 'Source' reference. + * + * + * @generated + * @ordered + */ + int EDGE__SOURCE = DIAGRAM_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int EDGE__TARGET = DIAGRAM_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Waypoint' containment reference list. + * + * + * @generated + * @ordered + */ + int EDGE__WAYPOINT = DIAGRAM_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Edge' class. + * + * + * @generated + * @ordered + */ + int EDGE_FEATURE_COUNT = DIAGRAM_ELEMENT_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.dd.di.impl.NodeImpl Node}' class. + * + * + * @see org.eclipse.dd.di.impl.NodeImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getNode() + * @generated + */ + int NODE = 7; + + /** + * The feature id for the 'Owning Diagram' reference. + * + * + * @generated + * @ordered + */ + int NODE__OWNING_DIAGRAM = DIAGRAM_ELEMENT__OWNING_DIAGRAM; + + /** + * The feature id for the 'Owning Element' reference. + * + * + * @generated + * @ordered + */ + int NODE__OWNING_ELEMENT = DIAGRAM_ELEMENT__OWNING_ELEMENT; + + /** + * The feature id for the 'Owned Element' reference list. + * + * + * @generated + * @ordered + */ + int NODE__OWNED_ELEMENT = DIAGRAM_ELEMENT__OWNED_ELEMENT; + + /** + * The feature id for the 'Model Element' reference. + * + * + * @generated + * @ordered + */ + int NODE__MODEL_ELEMENT = DIAGRAM_ELEMENT__MODEL_ELEMENT; + + /** + * The feature id for the 'Style' reference. + * + * + * @generated + * @ordered + */ + int NODE__STYLE = DIAGRAM_ELEMENT__STYLE; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int NODE__ID = DIAGRAM_ELEMENT__ID; + + /** + * The number of structural features of the 'Node' class. + * + * + * @generated + * @ordered + */ + int NODE_FEATURE_COUNT = DIAGRAM_ELEMENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.dd.di.impl.LabelImpl Label}' class. + * + * + * @see org.eclipse.dd.di.impl.LabelImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getLabel() + * @generated + */ + int LABEL = 4; + + /** + * The feature id for the 'Owning Diagram' reference. + * + * + * @generated + * @ordered + */ + int LABEL__OWNING_DIAGRAM = NODE__OWNING_DIAGRAM; + + /** + * The feature id for the 'Owning Element' reference. + * + * + * @generated + * @ordered + */ + int LABEL__OWNING_ELEMENT = NODE__OWNING_ELEMENT; + + /** + * The feature id for the 'Owned Element' reference list. + * + * + * @generated + * @ordered + */ + int LABEL__OWNED_ELEMENT = NODE__OWNED_ELEMENT; + + /** + * The feature id for the 'Model Element' reference. + * + * + * @generated + * @ordered + */ + int LABEL__MODEL_ELEMENT = NODE__MODEL_ELEMENT; + + /** + * The feature id for the 'Style' reference. + * + * + * @generated + * @ordered + */ + int LABEL__STYLE = NODE__STYLE; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int LABEL__ID = NODE__ID; + + /** + * The feature id for the 'Bounds' containment reference. + * + * + * @generated + * @ordered + */ + int LABEL__BOUNDS = NODE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Label' class. + * + * + * @generated + * @ordered + */ + int LABEL_FEATURE_COUNT = NODE_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.dd.di.impl.LabeledEdgeImpl Labeled Edge}' class. + * + * + * @see org.eclipse.dd.di.impl.LabeledEdgeImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getLabeledEdge() + * @generated + */ + int LABELED_EDGE = 5; + + /** + * The feature id for the 'Owning Diagram' reference. + * + * + * @generated + * @ordered + */ + int LABELED_EDGE__OWNING_DIAGRAM = EDGE__OWNING_DIAGRAM; + + /** + * The feature id for the 'Owning Element' reference. + * + * + * @generated + * @ordered + */ + int LABELED_EDGE__OWNING_ELEMENT = EDGE__OWNING_ELEMENT; + + /** + * The feature id for the 'Owned Element' reference list. + * + * + * @generated + * @ordered + */ + int LABELED_EDGE__OWNED_ELEMENT = EDGE__OWNED_ELEMENT; + + /** + * The feature id for the 'Model Element' reference. + * + * + * @generated + * @ordered + */ + int LABELED_EDGE__MODEL_ELEMENT = EDGE__MODEL_ELEMENT; + + /** + * The feature id for the 'Style' reference. + * + * + * @generated + * @ordered + */ + int LABELED_EDGE__STYLE = EDGE__STYLE; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int LABELED_EDGE__ID = EDGE__ID; + + /** + * The feature id for the 'Source' reference. + * + * + * @generated + * @ordered + */ + int LABELED_EDGE__SOURCE = EDGE__SOURCE; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int LABELED_EDGE__TARGET = EDGE__TARGET; + + /** + * The feature id for the 'Waypoint' containment reference list. + * + * + * @generated + * @ordered + */ + int LABELED_EDGE__WAYPOINT = EDGE__WAYPOINT; + + /** + * The feature id for the 'Owned Label' reference list. + * + * + * @generated + * @ordered + */ + int LABELED_EDGE__OWNED_LABEL = EDGE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Labeled Edge' class. + * + * + * @generated + * @ordered + */ + int LABELED_EDGE_FEATURE_COUNT = EDGE_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.dd.di.impl.ShapeImpl Shape}' class. + * + * + * @see org.eclipse.dd.di.impl.ShapeImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getShape() + * @generated + */ + int SHAPE = 9; + + /** + * The feature id for the 'Owning Diagram' reference. + * + * + * @generated + * @ordered + */ + int SHAPE__OWNING_DIAGRAM = NODE__OWNING_DIAGRAM; + + /** + * The feature id for the 'Owning Element' reference. + * + * + * @generated + * @ordered + */ + int SHAPE__OWNING_ELEMENT = NODE__OWNING_ELEMENT; + + /** + * The feature id for the 'Owned Element' reference list. + * + * + * @generated + * @ordered + */ + int SHAPE__OWNED_ELEMENT = NODE__OWNED_ELEMENT; + + /** + * The feature id for the 'Model Element' reference. + * + * + * @generated + * @ordered + */ + int SHAPE__MODEL_ELEMENT = NODE__MODEL_ELEMENT; + + /** + * The feature id for the 'Style' reference. + * + * + * @generated + * @ordered + */ + int SHAPE__STYLE = NODE__STYLE; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int SHAPE__ID = NODE__ID; + + /** + * The feature id for the 'Bounds' containment reference. + * + * + * @generated + * @ordered + */ + int SHAPE__BOUNDS = NODE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Shape' class. + * + * + * @generated + * @ordered + */ + int SHAPE_FEATURE_COUNT = NODE_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.dd.di.impl.LabeledShapeImpl Labeled Shape}' class. + * + * + * @see org.eclipse.dd.di.impl.LabeledShapeImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getLabeledShape() + * @generated + */ + int LABELED_SHAPE = 6; + + /** + * The feature id for the 'Owning Diagram' reference. + * + * + * @generated + * @ordered + */ + int LABELED_SHAPE__OWNING_DIAGRAM = SHAPE__OWNING_DIAGRAM; + + /** + * The feature id for the 'Owning Element' reference. + * + * + * @generated + * @ordered + */ + int LABELED_SHAPE__OWNING_ELEMENT = SHAPE__OWNING_ELEMENT; + + /** + * The feature id for the 'Owned Element' reference list. + * + * + * @generated + * @ordered + */ + int LABELED_SHAPE__OWNED_ELEMENT = SHAPE__OWNED_ELEMENT; + + /** + * The feature id for the 'Model Element' reference. + * + * + * @generated + * @ordered + */ + int LABELED_SHAPE__MODEL_ELEMENT = SHAPE__MODEL_ELEMENT; + + /** + * The feature id for the 'Style' reference. + * + * + * @generated + * @ordered + */ + int LABELED_SHAPE__STYLE = SHAPE__STYLE; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int LABELED_SHAPE__ID = SHAPE__ID; + + /** + * The feature id for the 'Bounds' containment reference. + * + * + * @generated + * @ordered + */ + int LABELED_SHAPE__BOUNDS = SHAPE__BOUNDS; + + /** + * The feature id for the 'Owned Label' reference list. + * + * + * @generated + * @ordered + */ + int LABELED_SHAPE__OWNED_LABEL = SHAPE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Labeled Shape' class. + * + * + * @generated + * @ordered + */ + int LABELED_SHAPE_FEATURE_COUNT = SHAPE_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.dd.di.impl.PlaneImpl Plane}' class. + * + * + * @see org.eclipse.dd.di.impl.PlaneImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getPlane() + * @generated + */ + int PLANE = 8; + + /** + * The feature id for the 'Owning Diagram' reference. + * + * + * @generated + * @ordered + */ + int PLANE__OWNING_DIAGRAM = NODE__OWNING_DIAGRAM; + + /** + * The feature id for the 'Owning Element' reference. + * + * + * @generated + * @ordered + */ + int PLANE__OWNING_ELEMENT = NODE__OWNING_ELEMENT; + + /** + * The feature id for the 'Owned Element' reference list. + * + * + * @generated + * @ordered + */ + int PLANE__OWNED_ELEMENT = NODE__OWNED_ELEMENT; + + /** + * The feature id for the 'Model Element' reference. + * + * + * @generated + * @ordered + */ + int PLANE__MODEL_ELEMENT = NODE__MODEL_ELEMENT; + + /** + * The feature id for the 'Style' reference. + * + * + * @generated + * @ordered + */ + int PLANE__STYLE = NODE__STYLE; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int PLANE__ID = NODE__ID; + + /** + * The feature id for the 'Plane Element' containment reference list. + * + * + * @generated + * @ordered + */ + int PLANE__PLANE_ELEMENT = NODE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Plane' class. + * + * + * @generated + * @ordered + */ + int PLANE_FEATURE_COUNT = NODE_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.dd.di.impl.StyleImpl Style}' class. + * + * + * @see org.eclipse.dd.di.impl.StyleImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getStyle() + * @generated + */ + int STYLE = 10; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int STYLE__ID = 0; + + /** + * The number of structural features of the 'Style' class. + * + * + * @generated + * @ordered + */ + int STYLE_FEATURE_COUNT = 1; + + /** + * Returns the meta object for class '{@link org.eclipse.dd.di.DocumentRoot Document Root}'. + * + * + * @return the meta object for class 'Document Root'. + * @see org.eclipse.dd.di.DocumentRoot + * @generated + */ + EClass getDocumentRoot(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.dd.di.DocumentRoot#getMixed Mixed}'. + * + * + * @return the meta object for the attribute list 'Mixed'. + * @see org.eclipse.dd.di.DocumentRoot#getMixed() + * @see #getDocumentRoot() + * @generated + */ + EAttribute getDocumentRoot_Mixed(); + + /** + * Returns the meta object for the map '{@link org.eclipse.dd.di.DocumentRoot#getXMLNSPrefixMap XMLNS Prefix Map}'. + * + * + * @return the meta object for the map 'XMLNS Prefix Map'. + * @see org.eclipse.dd.di.DocumentRoot#getXMLNSPrefixMap() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_XMLNSPrefixMap(); + + /** + * Returns the meta object for the map '{@link org.eclipse.dd.di.DocumentRoot#getXSISchemaLocation XSI Schema Location}'. + * + * + * @return the meta object for the map 'XSI Schema Location'. + * @see org.eclipse.dd.di.DocumentRoot#getXSISchemaLocation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_XSISchemaLocation(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.di.DocumentRoot#getDiagramElement Diagram Element}'. + * + * + * @return the meta object for the containment reference 'Diagram Element'. + * @see org.eclipse.dd.di.DocumentRoot#getDiagramElement() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_DiagramElement(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.di.DocumentRoot#getDiagram Diagram}'. + * + * + * @return the meta object for the containment reference 'Diagram'. + * @see org.eclipse.dd.di.DocumentRoot#getDiagram() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Diagram(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.di.DocumentRoot#getEdge Edge}'. + * + * + * @return the meta object for the containment reference 'Edge'. + * @see org.eclipse.dd.di.DocumentRoot#getEdge() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Edge(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.di.DocumentRoot#getLabel Label}'. + * + * + * @return the meta object for the containment reference 'Label'. + * @see org.eclipse.dd.di.DocumentRoot#getLabel() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Label(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.di.DocumentRoot#getLabeledEdge Labeled Edge}'. + * + * + * @return the meta object for the containment reference 'Labeled Edge'. + * @see org.eclipse.dd.di.DocumentRoot#getLabeledEdge() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_LabeledEdge(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.di.DocumentRoot#getLabeledShape Labeled Shape}'. + * + * + * @return the meta object for the containment reference 'Labeled Shape'. + * @see org.eclipse.dd.di.DocumentRoot#getLabeledShape() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_LabeledShape(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.di.DocumentRoot#getNode Node}'. + * + * + * @return the meta object for the containment reference 'Node'. + * @see org.eclipse.dd.di.DocumentRoot#getNode() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Node(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.di.DocumentRoot#getPlane Plane}'. + * + * + * @return the meta object for the containment reference 'Plane'. + * @see org.eclipse.dd.di.DocumentRoot#getPlane() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Plane(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.di.DocumentRoot#getShape Shape}'. + * + * + * @return the meta object for the containment reference 'Shape'. + * @see org.eclipse.dd.di.DocumentRoot#getShape() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Shape(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.di.DocumentRoot#getStyle Style}'. + * + * + * @return the meta object for the containment reference 'Style'. + * @see org.eclipse.dd.di.DocumentRoot#getStyle() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_Style(); + + /** + * Returns the meta object for class '{@link org.eclipse.dd.di.Diagram Diagram}'. + * + * + * @return the meta object for class 'Diagram'. + * @see org.eclipse.dd.di.Diagram + * @generated + */ + EClass getDiagram(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.di.Diagram#getDocumentation Documentation}'. + * + * + * @return the meta object for the attribute 'Documentation'. + * @see org.eclipse.dd.di.Diagram#getDocumentation() + * @see #getDiagram() + * @generated + */ + EAttribute getDiagram_Documentation(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.dd.di.Diagram#getOwnedStyle Owned Style}'. + * + * + * @return the meta object for the reference list 'Owned Style'. + * @see org.eclipse.dd.di.Diagram#getOwnedStyle() + * @see #getDiagram() + * @generated + */ + EReference getDiagram_OwnedStyle(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.dd.di.Diagram#getRootElement Root Element}'. + * + * + * @return the meta object for the reference 'Root Element'. + * @see org.eclipse.dd.di.Diagram#getRootElement() + * @see #getDiagram() + * @generated + */ + EReference getDiagram_RootElement(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.di.Diagram#getId Id}'. + * + * + * @return the meta object for the attribute 'Id'. + * @see org.eclipse.dd.di.Diagram#getId() + * @see #getDiagram() + * @generated + */ + EAttribute getDiagram_Id(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.di.Diagram#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.dd.di.Diagram#getName() + * @see #getDiagram() + * @generated + */ + EAttribute getDiagram_Name(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.di.Diagram#getResolution Resolution}'. + * + * + * @return the meta object for the attribute 'Resolution'. + * @see org.eclipse.dd.di.Diagram#getResolution() + * @see #getDiagram() + * @generated + */ + EAttribute getDiagram_Resolution(); + + /** + * Returns the meta object for class '{@link org.eclipse.dd.di.DiagramElement Diagram Element}'. + * + * + * @return the meta object for class 'Diagram Element'. + * @see org.eclipse.dd.di.DiagramElement + * @generated + */ + EClass getDiagramElement(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.dd.di.DiagramElement#getOwningDiagram Owning Diagram}'. + * + * + * @return the meta object for the reference 'Owning Diagram'. + * @see org.eclipse.dd.di.DiagramElement#getOwningDiagram() + * @see #getDiagramElement() + * @generated + */ + EReference getDiagramElement_OwningDiagram(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.dd.di.DiagramElement#getOwningElement Owning Element}'. + * + * + * @return the meta object for the reference 'Owning Element'. + * @see org.eclipse.dd.di.DiagramElement#getOwningElement() + * @see #getDiagramElement() + * @generated + */ + EReference getDiagramElement_OwningElement(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.dd.di.DiagramElement#getOwnedElement Owned Element}'. + * + * + * @return the meta object for the reference list 'Owned Element'. + * @see org.eclipse.dd.di.DiagramElement#getOwnedElement() + * @see #getDiagramElement() + * @generated + */ + EReference getDiagramElement_OwnedElement(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.dd.di.DiagramElement#getModelElement Model Element}'. + * + * + * @return the meta object for the reference 'Model Element'. + * @see org.eclipse.dd.di.DiagramElement#getModelElement() + * @see #getDiagramElement() + * @generated + */ + EReference getDiagramElement_ModelElement(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.dd.di.DiagramElement#getStyle Style}'. + * + * + * @return the meta object for the reference 'Style'. + * @see org.eclipse.dd.di.DiagramElement#getStyle() + * @see #getDiagramElement() + * @generated + */ + EReference getDiagramElement_Style(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.di.DiagramElement#getId Id}'. + * + * + * @return the meta object for the attribute 'Id'. + * @see org.eclipse.dd.di.DiagramElement#getId() + * @see #getDiagramElement() + * @generated + */ + EAttribute getDiagramElement_Id(); + + /** + * Returns the meta object for class '{@link org.eclipse.dd.di.Edge Edge}'. + * + * + * @return the meta object for class 'Edge'. + * @see org.eclipse.dd.di.Edge + * @generated + */ + EClass getEdge(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.dd.di.Edge#getSource Source}'. + * + * + * @return the meta object for the reference 'Source'. + * @see org.eclipse.dd.di.Edge#getSource() + * @see #getEdge() + * @generated + */ + EReference getEdge_Source(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.dd.di.Edge#getTarget Target}'. + * + * + * @return the meta object for the reference 'Target'. + * @see org.eclipse.dd.di.Edge#getTarget() + * @see #getEdge() + * @generated + */ + EReference getEdge_Target(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.dd.di.Edge#getWaypoint Waypoint}'. + * + * + * @return the meta object for the containment reference list 'Waypoint'. + * @see org.eclipse.dd.di.Edge#getWaypoint() + * @see #getEdge() + * @generated + */ + EReference getEdge_Waypoint(); + + /** + * Returns the meta object for class '{@link org.eclipse.dd.di.Label Label}'. + * + * + * @return the meta object for class 'Label'. + * @see org.eclipse.dd.di.Label + * @generated + */ + EClass getLabel(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.di.Label#getBounds Bounds}'. + * + * + * @return the meta object for the containment reference 'Bounds'. + * @see org.eclipse.dd.di.Label#getBounds() + * @see #getLabel() + * @generated + */ + EReference getLabel_Bounds(); + + /** + * Returns the meta object for class '{@link org.eclipse.dd.di.LabeledEdge Labeled Edge}'. + * + * + * @return the meta object for class 'Labeled Edge'. + * @see org.eclipse.dd.di.LabeledEdge + * @generated + */ + EClass getLabeledEdge(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.dd.di.LabeledEdge#getOwnedLabel Owned Label}'. + * + * + * @return the meta object for the reference list 'Owned Label'. + * @see org.eclipse.dd.di.LabeledEdge#getOwnedLabel() + * @see #getLabeledEdge() + * @generated + */ + EReference getLabeledEdge_OwnedLabel(); + + /** + * Returns the meta object for class '{@link org.eclipse.dd.di.LabeledShape Labeled Shape}'. + * + * + * @return the meta object for class 'Labeled Shape'. + * @see org.eclipse.dd.di.LabeledShape + * @generated + */ + EClass getLabeledShape(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.dd.di.LabeledShape#getOwnedLabel Owned Label}'. + * + * + * @return the meta object for the reference list 'Owned Label'. + * @see org.eclipse.dd.di.LabeledShape#getOwnedLabel() + * @see #getLabeledShape() + * @generated + */ + EReference getLabeledShape_OwnedLabel(); + + /** + * Returns the meta object for class '{@link org.eclipse.dd.di.Node Node}'. + * + * + * @return the meta object for class 'Node'. + * @see org.eclipse.dd.di.Node + * @generated + */ + EClass getNode(); + + /** + * Returns the meta object for class '{@link org.eclipse.dd.di.Plane Plane}'. + * + * + * @return the meta object for class 'Plane'. + * @see org.eclipse.dd.di.Plane + * @generated + */ + EClass getPlane(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.dd.di.Plane#getPlaneElement Plane Element}'. + * + * + * @return the meta object for the containment reference list 'Plane Element'. + * @see org.eclipse.dd.di.Plane#getPlaneElement() + * @see #getPlane() + * @generated + */ + EReference getPlane_PlaneElement(); + + /** + * Returns the meta object for class '{@link org.eclipse.dd.di.Shape Shape}'. + * + * + * @return the meta object for class 'Shape'. + * @see org.eclipse.dd.di.Shape + * @generated + */ + EClass getShape(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.dd.di.Shape#getBounds Bounds}'. + * + * + * @return the meta object for the containment reference 'Bounds'. + * @see org.eclipse.dd.di.Shape#getBounds() + * @see #getShape() + * @generated + */ + EReference getShape_Bounds(); + + /** + * Returns the meta object for class '{@link org.eclipse.dd.di.Style Style}'. + * + * + * @return the meta object for class 'Style'. + * @see org.eclipse.dd.di.Style + * @generated + */ + EClass getStyle(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.dd.di.Style#getId Id}'. + * + * + * @return the meta object for the attribute 'Id'. + * @see org.eclipse.dd.di.Style#getId() + * @see #getStyle() + * @generated + */ + EAttribute getStyle_Id(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + DiFactory getDiFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.dd.di.impl.DocumentRootImpl Document Root}' class. + * + * + * @see org.eclipse.dd.di.impl.DocumentRootImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getDocumentRoot() + * @generated + */ + EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot(); + + /** + * The meta object literal for the 'Mixed' attribute list feature. + * + * + * @generated + */ + EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed(); + + /** + * The meta object literal for the 'XMLNS Prefix Map' map feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap(); + + /** + * The meta object literal for the 'XSI Schema Location' map feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation(); + + /** + * The meta object literal for the 'Diagram Element' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DIAGRAM_ELEMENT = eINSTANCE.getDocumentRoot_DiagramElement(); + + /** + * The meta object literal for the 'Diagram' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__DIAGRAM = eINSTANCE.getDocumentRoot_Diagram(); + + /** + * The meta object literal for the 'Edge' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__EDGE = eINSTANCE.getDocumentRoot_Edge(); + + /** + * The meta object literal for the 'Label' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__LABEL = eINSTANCE.getDocumentRoot_Label(); + + /** + * The meta object literal for the 'Labeled Edge' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__LABELED_EDGE = eINSTANCE.getDocumentRoot_LabeledEdge(); + + /** + * The meta object literal for the 'Labeled Shape' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__LABELED_SHAPE = eINSTANCE.getDocumentRoot_LabeledShape(); + + /** + * The meta object literal for the 'Node' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__NODE = eINSTANCE.getDocumentRoot_Node(); + + /** + * The meta object literal for the 'Plane' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__PLANE = eINSTANCE.getDocumentRoot_Plane(); + + /** + * The meta object literal for the 'Shape' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__SHAPE = eINSTANCE.getDocumentRoot_Shape(); + + /** + * The meta object literal for the 'Style' containment reference feature. + * + * + * @generated + */ + EReference DOCUMENT_ROOT__STYLE = eINSTANCE.getDocumentRoot_Style(); + + /** + * The meta object literal for the '{@link org.eclipse.dd.di.impl.DiagramImpl Diagram}' class. + * + * + * @see org.eclipse.dd.di.impl.DiagramImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getDiagram() + * @generated + */ + EClass DIAGRAM = eINSTANCE.getDiagram(); + + /** + * The meta object literal for the 'Documentation' attribute feature. + * + * + * @generated + */ + EAttribute DIAGRAM__DOCUMENTATION = eINSTANCE.getDiagram_Documentation(); + + /** + * The meta object literal for the 'Owned Style' reference list feature. + * + * + * @generated + */ + EReference DIAGRAM__OWNED_STYLE = eINSTANCE.getDiagram_OwnedStyle(); + + /** + * The meta object literal for the 'Root Element' reference feature. + * + * + * @generated + */ + EReference DIAGRAM__ROOT_ELEMENT = eINSTANCE.getDiagram_RootElement(); + + /** + * The meta object literal for the 'Id' attribute feature. + * + * + * @generated + */ + EAttribute DIAGRAM__ID = eINSTANCE.getDiagram_Id(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute DIAGRAM__NAME = eINSTANCE.getDiagram_Name(); + + /** + * The meta object literal for the 'Resolution' attribute feature. + * + * + * @generated + */ + EAttribute DIAGRAM__RESOLUTION = eINSTANCE.getDiagram_Resolution(); + + /** + * The meta object literal for the '{@link org.eclipse.dd.di.impl.DiagramElementImpl Diagram Element}' class. + * + * + * @see org.eclipse.dd.di.impl.DiagramElementImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getDiagramElement() + * @generated + */ + EClass DIAGRAM_ELEMENT = eINSTANCE.getDiagramElement(); + + /** + * The meta object literal for the 'Owning Diagram' reference feature. + * + * + * @generated + */ + EReference DIAGRAM_ELEMENT__OWNING_DIAGRAM = eINSTANCE.getDiagramElement_OwningDiagram(); + + /** + * The meta object literal for the 'Owning Element' reference feature. + * + * + * @generated + */ + EReference DIAGRAM_ELEMENT__OWNING_ELEMENT = eINSTANCE.getDiagramElement_OwningElement(); + + /** + * The meta object literal for the 'Owned Element' reference list feature. + * + * + * @generated + */ + EReference DIAGRAM_ELEMENT__OWNED_ELEMENT = eINSTANCE.getDiagramElement_OwnedElement(); + + /** + * The meta object literal for the 'Model Element' reference feature. + * + * + * @generated + */ + EReference DIAGRAM_ELEMENT__MODEL_ELEMENT = eINSTANCE.getDiagramElement_ModelElement(); + + /** + * The meta object literal for the 'Style' reference feature. + * + * + * @generated + */ + EReference DIAGRAM_ELEMENT__STYLE = eINSTANCE.getDiagramElement_Style(); + + /** + * The meta object literal for the 'Id' attribute feature. + * + * + * @generated + */ + EAttribute DIAGRAM_ELEMENT__ID = eINSTANCE.getDiagramElement_Id(); + + /** + * The meta object literal for the '{@link org.eclipse.dd.di.impl.EdgeImpl Edge}' class. + * + * + * @see org.eclipse.dd.di.impl.EdgeImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getEdge() + * @generated + */ + EClass EDGE = eINSTANCE.getEdge(); + + /** + * The meta object literal for the 'Source' reference feature. + * + * + * @generated + */ + EReference EDGE__SOURCE = eINSTANCE.getEdge_Source(); + + /** + * The meta object literal for the 'Target' reference feature. + * + * + * @generated + */ + EReference EDGE__TARGET = eINSTANCE.getEdge_Target(); + + /** + * The meta object literal for the 'Waypoint' containment reference list feature. + * + * + * @generated + */ + EReference EDGE__WAYPOINT = eINSTANCE.getEdge_Waypoint(); + + /** + * The meta object literal for the '{@link org.eclipse.dd.di.impl.LabelImpl Label}' class. + * + * + * @see org.eclipse.dd.di.impl.LabelImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getLabel() + * @generated + */ + EClass LABEL = eINSTANCE.getLabel(); + + /** + * The meta object literal for the 'Bounds' containment reference feature. + * + * + * @generated + */ + EReference LABEL__BOUNDS = eINSTANCE.getLabel_Bounds(); + + /** + * The meta object literal for the '{@link org.eclipse.dd.di.impl.LabeledEdgeImpl Labeled Edge}' class. + * + * + * @see org.eclipse.dd.di.impl.LabeledEdgeImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getLabeledEdge() + * @generated + */ + EClass LABELED_EDGE = eINSTANCE.getLabeledEdge(); + + /** + * The meta object literal for the 'Owned Label' reference list feature. + * + * + * @generated + */ + EReference LABELED_EDGE__OWNED_LABEL = eINSTANCE.getLabeledEdge_OwnedLabel(); + + /** + * The meta object literal for the '{@link org.eclipse.dd.di.impl.LabeledShapeImpl Labeled Shape}' class. + * + * + * @see org.eclipse.dd.di.impl.LabeledShapeImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getLabeledShape() + * @generated + */ + EClass LABELED_SHAPE = eINSTANCE.getLabeledShape(); + + /** + * The meta object literal for the 'Owned Label' reference list feature. + * + * + * @generated + */ + EReference LABELED_SHAPE__OWNED_LABEL = eINSTANCE.getLabeledShape_OwnedLabel(); + + /** + * The meta object literal for the '{@link org.eclipse.dd.di.impl.NodeImpl Node}' class. + * + * + * @see org.eclipse.dd.di.impl.NodeImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getNode() + * @generated + */ + EClass NODE = eINSTANCE.getNode(); + + /** + * The meta object literal for the '{@link org.eclipse.dd.di.impl.PlaneImpl Plane}' class. + * + * + * @see org.eclipse.dd.di.impl.PlaneImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getPlane() + * @generated + */ + EClass PLANE = eINSTANCE.getPlane(); + + /** + * The meta object literal for the 'Plane Element' containment reference list feature. + * + * + * @generated + */ + EReference PLANE__PLANE_ELEMENT = eINSTANCE.getPlane_PlaneElement(); + + /** + * The meta object literal for the '{@link org.eclipse.dd.di.impl.ShapeImpl Shape}' class. + * + * + * @see org.eclipse.dd.di.impl.ShapeImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getShape() + * @generated + */ + EClass SHAPE = eINSTANCE.getShape(); + + /** + * The meta object literal for the 'Bounds' containment reference feature. + * + * + * @generated + */ + EReference SHAPE__BOUNDS = eINSTANCE.getShape_Bounds(); + + /** + * The meta object literal for the '{@link org.eclipse.dd.di.impl.StyleImpl Style}' class. + * + * + * @see org.eclipse.dd.di.impl.StyleImpl + * @see org.eclipse.dd.di.impl.DiPackageImpl#getStyle() + * @generated + */ + EClass STYLE = eINSTANCE.getStyle(); + + /** + * The meta object literal for the 'Id' attribute feature. + * + * + * @generated + */ + EAttribute STYLE__ID = eINSTANCE.getStyle_Id(); + + } + +} //DiPackage diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/di/Diagram.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/di/Diagram.java new file mode 100644 index 00000000000..b59e997c9cf --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/di/Diagram.java @@ -0,0 +1,161 @@ +/** + * + * + * Copyright (c) 2010 SAP AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation + * + * + */ +package org.eclipse.dd.di; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Diagram'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.dd.di.Diagram#getDocumentation Documentation}
  • + *
  • {@link org.eclipse.dd.di.Diagram#getOwnedStyle Owned Style}
  • + *
  • {@link org.eclipse.dd.di.Diagram#getRootElement Root Element}
  • + *
  • {@link org.eclipse.dd.di.Diagram#getId Id}
  • + *
  • {@link org.eclipse.dd.di.Diagram#getName Name}
  • + *
  • {@link org.eclipse.dd.di.Diagram#getResolution Resolution}
  • + *
+ * + * @see org.eclipse.dd.di.DiPackage#getDiagram() + * @model abstract="true" + * extendedMetaData="name='Diagram' kind='empty'" + * @generated + */ +public interface Diagram extends EObject { + /** + * Returns the value of the 'Documentation' attribute. + * + * + * @return the value of the 'Documentation' attribute. + * @see #setDocumentation(String) + * @see org.eclipse.dd.di.DiPackage#getDiagram_Documentation() + * @model ordered="false" + * extendedMetaData="kind='attribute' name='documentation'" + * @generated + */ + String getDocumentation(); + + /** + * Sets the value of the '{@link org.eclipse.dd.di.Diagram#getDocumentation Documentation}' attribute. + * + * + * @param value the new value of the 'Documentation' attribute. + * @see #getDocumentation() + * @generated + */ + void setDocumentation(String value); + + /** + * Returns the value of the 'Owned Style' reference list. + * The list contents are of type {@link org.eclipse.dd.di.Style}. + * + * + * @return the value of the 'Owned Style' reference list. + * @see org.eclipse.dd.di.DiPackage#getDiagram_OwnedStyle() + * @model transient="true" changeable="false" derived="true" ordered="false" + * @generated + */ + EList + + + + org.kie.soup:kie-soup-commons + + + org.uberfire:uberfire-commons + org.uberfire:uberfire-nio2-model + org.uberfire:uberfire-io + org.uberfire:uberfire-api + org.uberfire:uberfire-js + org.uberfire:uberfire-security-api + org.uberfire:uberfire-security-client + org.uberfire:uberfire-client-api + org.uberfire:uberfire-workbench-client + org.uberfire:uberfire-workbench-client-views-patternfly + org.uberfire:uberfire-simple-docks-client + org.uberfire:uberfire-backend-api + org.uberfire:uberfire-project-api + org.uberfire:uberfire-project-client + org.uberfire:uberfire-services-api + org.uberfire:uberfire-structure-api + org.uberfire:uberfire-message-console-api + org.uberfire:uberfire-message-console-client + + + org.jboss.errai:errai-data-binding + org.kie.workbench.widgets:kie-wb-common-ui + org.kie.workbench.profile:kie-wb-common-profile-api + org.kie.workbench.services:kie-wb-common-datamodel-api + org.kie.workbench.services:kie-wb-common-services-api + org.kie.workbench:kie-wb-common-kogito-client + + + org.uberfire:uberfire-runtime-plugins-api + org.uberfire:uberfire-runtime-plugins-client + org.uberfire:uberfire-commons-editor-api + org.uberfire:uberfire-commons-editor-client + org.uberfire:uberfire-widgets-commons + org.uberfire:uberfire-widgets-table + org.uberfire:uberfire-widgets-properties-editor-api + org.uberfire:uberfire-widgets-properties-editor-client + org.uberfire:uberfire-widgets-service-api + org.uberfire:uberfire-widgets-core-client + + + org.uberfire:uberfire-preferences-api + org.uberfire:uberfire-preferences-client + org.uberfire:uberfire-preferences-ui-client + + + org.uberfire:uberfire-experimental-api + org.uberfire:uberfire-experimental-client + + + org.kie.workbench.forms:kie-wb-common-forms-api + org.kie.workbench.forms:kie-wb-common-forms-adf-base + org.kie.workbench.forms:kie-wb-common-forms-adf-engine-api + org.kie.workbench.forms:kie-wb-common-forms-adf-engine-client + org.kie.workbench.forms:kie-wb-common-forms-fields + org.kie.workbench.forms:kie-wb-common-forms-processing-engine + org.kie.workbench.forms:kie-wb-common-forms-common-rendering-shared + org.kie.workbench.forms:kie-wb-common-forms-common-rendering-client + org.kie.workbench.forms:kie-wb-common-forms-crud-component + org.kie.workbench.forms:kie-wb-common-dynamic-forms-api + org.kie.workbench.forms:kie-wb-common-dynamic-forms-client + + + org.kie.workbench.stunner:kie-wb-common-stunner-core-api + org.kie.workbench.stunner:kie-wb-common-stunner-backend-api + org.kie.workbench.stunner:kie-wb-common-stunner-client-api + org.kie.workbench.stunner:kie-wb-common-stunner-core-common + org.kie.workbench.stunner:kie-wb-common-stunner-client-common + org.kie.workbench.stunner:kie-wb-common-stunner-lienzo + org.kie.workbench.stunner:kie-wb-common-stunner-shapes-api + org.kie.workbench.stunner:kie-wb-common-stunner-shapes-client + org.kie.workbench.stunner:kie-wb-common-stunner-lienzo-extensions + org.kie.workbench.stunner:kie-wb-common-stunner-svg-client + org.kie.workbench.stunner:kie-wb-common-stunner-widgets + org.kie.workbench.stunner:kie-wb-common-stunner-bpmn-api + org.kie.workbench.stunner:kie-wb-common-stunner-bpmn-emf + org.kie.workbench.stunner:kie-wb-common-stunner-bpmn-marshalling + org.kie.workbench.stunner:kie-wb-common-stunner-bpmn-client + org.kie.workbench.stunner:kie-wb-common-stunner-forms-api + org.kie.workbench.stunner:kie-wb-common-stunner-forms-client + org.kie.workbench.stunner:kie-wb-common-stunner-kogito-api + org.kie.workbench.stunner:kie-wb-common-stunner-kogito-client + + org.uberfire:appformer-js-bridge + + + + + + gwt-clean + clean + + clean + + + + gwt-compile + + resources + compile + + + + + + + maven-war-plugin + + **/javax/**/*.*,**/client/**/*.class,**/*.symbolMap + + false + + + + + + maven-clean-plugin + + false + + + ${basedir} + + www-test/** + src/main/webapp/org.kie.workbench.common.stunner.kogito.KogitoBPMNEditor/ + src/main/webapp/WEB-INF/classes/ + src/main/webapp/WEB-INF/deploy/ + src/main/webapp/WEB-INF/lib/ + **/gwt-unitCache/** + .gwt/** + .errai/ + .security/ + .niogit/** + .index/** + **/*.JUnit/** + repositories/ + + + + /tmp/project/dir/ + false + + .niogit/** + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + process-resources + + unpack + + + + + org.jboss.errai + wildfly-dist + ${version.org.jboss.errai.wildfly} + zip + false + ${project.build.directory} + + + + + + + + + + + + + + + + sources + + + + org.codehaus.mojo + gwt-maven-plugin + + org.kie.workbench.common.stunner.kogito.KogitoBPMNEditorWithSourceMap + true + + + + org.apache.maven.plugins + maven-war-plugin + + + add-source-maps + package + + war + + + + + ${basedir}/target/extra/org.kie.workbench.common.stunner.kogito.KogitoBPMNEditor/src + sourcemaps + + + ${basedir}/target/extra/org.kie.workbench.common.stunner.kogito.KogitoBPMNEditor/symbolMaps + + *.json + + sourcemaps + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/BPMNDiagramEditor.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/BPMNDiagramEditor.java new file mode 100644 index 00000000000..16efaa1cefb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/editor/BPMNDiagramEditor.java @@ -0,0 +1,288 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.editor; + +import java.util.Optional; +import java.util.function.Consumer; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.event.Event; +import javax.inject.Inject; + +import com.google.gwt.user.client.ui.IsWidget; +import elemental2.promise.Promise; +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.kie.workbench.common.kogito.client.editor.MultiPageEditorContainerView; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; +import org.kie.workbench.common.stunner.core.client.annotation.DiagramEditor; +import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; +import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; +import org.kie.workbench.common.stunner.core.client.command.SessionCommandManager; +import org.kie.workbench.common.stunner.core.client.components.layout.LayoutHelper; +import org.kie.workbench.common.stunner.core.client.components.layout.OpenDiagramLayoutExecutor; +import org.kie.workbench.common.stunner.core.client.error.DiagramClientErrorHandler; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.kie.workbench.common.stunner.core.client.session.Session; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.documentation.DocumentationView; +import org.kie.workbench.common.stunner.kogito.client.docks.DiagramEditorPreviewAndExplorerDock; +import org.kie.workbench.common.stunner.kogito.client.docks.DiagramEditorPropertiesDock; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.menus.BPMNStandaloneEditorMenuSessionItems; +import org.kie.workbench.common.stunner.kogito.client.perspectives.AuthoringPerspective; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientDiagramService; +import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; +import org.uberfire.backend.vfs.Path; +import org.uberfire.backend.vfs.PathFactory; +import org.uberfire.client.annotations.WorkbenchClientEditor; +import org.uberfire.client.annotations.WorkbenchMenu; +import org.uberfire.client.annotations.WorkbenchPartTitle; +import org.uberfire.client.annotations.WorkbenchPartTitleDecoration; +import org.uberfire.client.annotations.WorkbenchPartView; +import org.uberfire.client.mvp.PlaceManager; +import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; +import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; +import org.uberfire.lifecycle.GetContent; +import org.uberfire.lifecycle.IsDirty; +import org.uberfire.lifecycle.OnClose; +import org.uberfire.lifecycle.OnFocus; +import org.uberfire.lifecycle.OnLostFocus; +import org.uberfire.lifecycle.OnMayClose; +import org.uberfire.lifecycle.OnOpen; +import org.uberfire.lifecycle.OnStartup; +import org.uberfire.lifecycle.SetContent; +import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.events.NotificationEvent; +import org.uberfire.workbench.model.menu.Menus; + +@ApplicationScoped +@DiagramEditor +@WorkbenchClientEditor(identifier = BPMNDiagramEditor.EDITOR_ID) +public class BPMNDiagramEditor extends AbstractDiagramEditor { + + public static final String EDITOR_ID = "BPMNDiagramEditor"; + + private final DiagramEditorPreviewAndExplorerDock diagramPreviewAndExplorerDock; + private final DiagramEditorPropertiesDock diagramPropertiesDock; + + private final LayoutHelper layoutHelper; + private final OpenDiagramLayoutExecutor openDiagramLayoutExecutor; + + private final KogitoClientDiagramService diagramServices; + + @Inject + public BPMNDiagramEditor(final View view, + final FileMenuBuilder fileMenuBuilder, + final PlaceManager placeManager, + final MultiPageEditorContainerView multiPageEditorContainerView, + final Event changeTitleNotificationEvent, + final Event notificationEvent, + final Event onDiagramFocusEvent, + final TextEditorView xmlEditorView, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final BPMNStandaloneEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService, + final DocumentationView documentationView, + final @Session SessionCommandManager sessionCommandManager, + final DiagramEditorPreviewAndExplorerDock diagramPreviewAndExplorerDock, + final DiagramEditorPropertiesDock diagramPropertiesDock, + final LayoutHelper layoutHelper, + final OpenDiagramLayoutExecutor openDiagramLayoutExecutor, + final KogitoClientDiagramService diagramServices) { + super(view, + fileMenuBuilder, + placeManager, + multiPageEditorContainerView, + changeTitleNotificationEvent, + notificationEvent, + onDiagramFocusEvent, + xmlEditorView, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService, + documentationView); + this.diagramPreviewAndExplorerDock = diagramPreviewAndExplorerDock; + this.diagramPropertiesDock = diagramPropertiesDock; + + this.layoutHelper = layoutHelper; + this.openDiagramLayoutExecutor = openDiagramLayoutExecutor; + + this.diagramServices = diagramServices; + } + + @OnStartup + @SuppressWarnings("unused") + public void onStartup(final PlaceRequest place) { + superDoStartUp(place); + + diagramPreviewAndExplorerDock.init(AuthoringPerspective.PERSPECTIVE_ID); + diagramPropertiesDock.init(AuthoringPerspective.PERSPECTIVE_ID); + + getWidget().init(this); + } + + void superDoStartUp(final PlaceRequest place) { + super.doStartUp(place); + } + + @Override + public void open(final Diagram diagram) { + this.layoutHelper.applyLayout(diagram, openDiagramLayoutExecutor); + super.open(diagram); + } + + @OnOpen + @SuppressWarnings("unused") + public void onOpen() { + super.doOpen(); + } + + @OnClose + @SuppressWarnings("unused") + public void onClose() { + superOnClose(); + diagramPreviewAndExplorerDock.close(); + diagramPropertiesDock.close(); + } + + void superOnClose() { + super.doClose(); + } + + @Override + public void onDiagramLoad() { + final Optional canvasHandler = Optional.ofNullable(getCanvasHandler()); + + canvasHandler.ifPresent(c -> { + final Metadata metadata = c.getDiagram().getMetadata(); + metadata.setPath(makeMetadataPath(metadata.getRoot(), metadata.getTitle())); + diagramPreviewAndExplorerDock.open(); + diagramPropertiesDock.open(); + }); + } + + private Path makeMetadataPath(final Path root, + final String title) { + final String uri = root.toURI(); + return PathFactory.newPath(title, uri + "/" + title + ".bpmn"); + } + + @OnFocus + @SuppressWarnings("unused") + public void onFocus() { + superDoFocus(); + onDiagramLoad(); + } + + void superDoFocus() { + super.doFocus(); + } + + @OnLostFocus + @SuppressWarnings("unused") + public void onLostFocus() { + super.doLostFocus(); + } + + @Override + @WorkbenchPartTitleDecoration + public IsWidget getTitle() { + return super.getTitle(); + } + + @WorkbenchPartTitle + public String getTitleText() { + return ""; + } + + @WorkbenchMenu + public void getMenus(final Consumer menusConsumer) { + menusConsumer.accept(super.getMenus()); + } + + @Override + protected void makeMenuBar() { + if (!menuBarInitialized) { + getMenuSessionItems().populateMenu(getFileMenuBuilder()); + makeAdditionalStunnerMenus(getFileMenuBuilder()); + menuBarInitialized = true; + } + } + + @Override + @WorkbenchPartView + public IsWidget asWidget() { + return super.asWidget(); + } + + @OnMayClose + public boolean onMayClose() { + return super.mayClose(); + } + + @Override + public String getEditorIdentifier() { + return EDITOR_ID; + } + + @GetContent + @Override + public Promise getContent() { + return diagramServices.transform(getEditor().getEditorProxy().getContentSupplier().get()); + } + + @Override + @IsDirty + public boolean isDirty() { + return super.isDirty(); + } + + @SetContent + @Override + public void setContent(final String value) { + diagramServices.transform(value, + new ServiceCallback() { + + @Override + public void onSuccess(final Diagram diagram) { + getEditor().open(diagram); + } + + @Override + public void onError(final ClientRuntimeError error) { + BPMNDiagramEditor.this.getEditor().onLoadError(error); + } + }); + } + + @Override + public void resetContentHash() { + setOriginalContentHash(getCurrentDiagramHash()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/menus/BPMNStandaloneEditorMenuItemsBuilder.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/menus/BPMNStandaloneEditorMenuItemsBuilder.java new file mode 100644 index 00000000000..8610655778a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/menus/BPMNStandaloneEditorMenuItemsBuilder.java @@ -0,0 +1,43 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.menus; + +import javax.enterprise.context.Dependent; +import javax.enterprise.inject.Typed; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuItemsBuilder; + +@Dependent +@Typed(BPMNStandaloneEditorMenuItemsBuilder.class) +public class BPMNStandaloneEditorMenuItemsBuilder extends AbstractDiagramEditorMenuItemsBuilder { + + @SuppressWarnings("unused") + protected BPMNStandaloneEditorMenuItemsBuilder() { + //CDI proxy + super(); + } + + @Inject + public BPMNStandaloneEditorMenuItemsBuilder(final ClientTranslationService translationService, + final PopupUtil popupUtil) { + super(translationService, + popupUtil); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/menus/BPMNStandaloneEditorMenuSessionItems.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/menus/BPMNStandaloneEditorMenuSessionItems.java new file mode 100644 index 00000000000..0d3af773b73 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/menus/BPMNStandaloneEditorMenuSessionItems.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.menus; + +import javax.enterprise.context.Dependent; +import javax.enterprise.inject.Typed; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.bpmn.qualifiers.BPMN; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; + +@Dependent +@Typed(BPMNStandaloneEditorMenuSessionItems.class) +public class BPMNStandaloneEditorMenuSessionItems extends AbstractDiagramEditorMenuSessionItems { + + @Inject + public BPMNStandaloneEditorMenuSessionItems(final BPMNStandaloneEditorMenuItemsBuilder itemsBuilder, + final @BPMN BPMNStandaloneEditorSessionCommands sessionCommands) { + super(itemsBuilder, + sessionCommands); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/menus/BPMNStandaloneEditorSessionCommands.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/menus/BPMNStandaloneEditorSessionCommands.java new file mode 100644 index 00000000000..b9aaa55e0ee --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/menus/BPMNStandaloneEditorSessionCommands.java @@ -0,0 +1,34 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.menus; + +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.bpmn.qualifiers.BPMN; +import org.kie.workbench.common.stunner.core.client.session.command.ManagedClientSessionCommands; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; + +@Dependent +@BPMN +public class BPMNStandaloneEditorSessionCommands extends EditorSessionCommands { + + @Inject + public BPMNStandaloneEditorSessionCommands(final ManagedClientSessionCommands commands) { + super(commands); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/perspectives/AuthoringPerspective.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/perspectives/AuthoringPerspective.java new file mode 100644 index 00000000000..51f40b63d0a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/perspectives/AuthoringPerspective.java @@ -0,0 +1,42 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.kogito.client.perspectives; + +import javax.enterprise.context.ApplicationScoped; + +import org.kie.workbench.common.stunner.kogito.client.editor.BPMNDiagramEditor; +import org.uberfire.client.annotations.Perspective; +import org.uberfire.client.annotations.WorkbenchPerspective; +import org.uberfire.client.workbench.panels.impl.SimpleNoExpandWorkbenchPanelPresenter; +import org.uberfire.mvp.impl.DefaultPlaceRequest; +import org.uberfire.workbench.model.PerspectiveDefinition; +import org.uberfire.workbench.model.impl.PartDefinitionImpl; +import org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl; + +@ApplicationScoped +@WorkbenchPerspective(identifier = AuthoringPerspective.PERSPECTIVE_ID, isDefault = true, isTransient = true) +public class AuthoringPerspective { + + public static final String PERSPECTIVE_ID = "AuthoringPerspective"; + + @Perspective + public PerspectiveDefinition buildPerspective() { + final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(SimpleNoExpandWorkbenchPanelPresenter.class.getName()); + perspective.setName("Authoring"); + perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest(BPMNDiagramEditor.EDITOR_ID))); + return perspective; + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/AssigneeLiveSearchStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/AssigneeLiveSearchStandaloneService.java new file mode 100644 index 00000000000..5e31956da75 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/AssigneeLiveSearchStandaloneService.java @@ -0,0 +1,84 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.services; + +import java.util.function.Consumer; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.AssigneeLiveSearchService; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.AssigneeLocalSearchService; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.widget.AssigneeLiveSearchEntryCreationEditor; +import org.kie.workbench.common.stunner.bpmn.forms.model.AssigneeType; +import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchCallback; + +@Dependent +public class AssigneeLiveSearchStandaloneService implements AssigneeLiveSearchService { + + private final AssigneeLiveSearchEntryCreationEditor editor; + private AssigneeLocalSearchService localSearchService; + + @Inject + public AssigneeLiveSearchStandaloneService(final AssigneeLiveSearchEntryCreationEditor editor) { + this.editor = editor; + } + + @PostConstruct + public void postConstruct() { + this.localSearchService = AssigneeLocalSearchService.build(editor); + } + + @Override + public void init(final AssigneeType type) { + } + + @Override + public void addCustomEntry(final String customEntry) { + localSearchService.addCustomEntry(customEntry); + } + + @Override + public void setSearchErrorHandler(final Consumer searchErrorHandler) { + } + + @Override + public void search(final String pattern, + final int maxResults, + final LiveSearchCallback callback) { + localSearchService.search(pattern, maxResults, callback); + } + + @Override + public void searchEntry(final String key, + final LiveSearchCallback callback) { + localSearchService.searchEntry(key, callback); + } + + @Override + public AssigneeLiveSearchEntryCreationEditor getEditor() { + return editor; + } + + @PreDestroy + public void destroy() { + localSearchService.destroy(); + localSearchService = null; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/ConditionEditorAvailableFunctionsStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/ConditionEditorAvailableFunctionsStandaloneService.java new file mode 100644 index 00000000000..2a389631fc4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/ConditionEditorAvailableFunctionsStandaloneService.java @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.services; + +import java.util.Collections; +import java.util.List; + +import javax.enterprise.context.ApplicationScoped; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorAvailableFunctionsService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.FunctionDef; + +@ApplicationScoped +public class ConditionEditorAvailableFunctionsStandaloneService implements ConditionEditorAvailableFunctionsService { + + @Override + public Promise> call(final Input input) { + return Promise.resolve(Collections.emptyList()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/ConditionEditorGeneratorStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/ConditionEditorGeneratorStandaloneService.java new file mode 100644 index 00000000000..6f9ede15ca1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/ConditionEditorGeneratorStandaloneService.java @@ -0,0 +1,33 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.services; + +import javax.enterprise.context.ApplicationScoped; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorGeneratorService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.Condition; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.GenerateConditionResult; + +@ApplicationScoped +public class ConditionEditorGeneratorStandaloneService implements ConditionEditorGeneratorService { + + @Override + public Promise call(final Condition condition) { + return Promise.resolve(new GenerateConditionResult("")); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/ConditionEditorMetadataStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/ConditionEditorMetadataStandaloneService.java new file mode 100644 index 00000000000..8e3dc1ab899 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/ConditionEditorMetadataStandaloneService.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.services; + +import java.util.Collections; + +import javax.enterprise.context.ApplicationScoped; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorMetadataService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQuery; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQueryResult; + +@ApplicationScoped +public class ConditionEditorMetadataStandaloneService implements ConditionEditorMetadataService { + + @Override + public Promise call(final TypeMetadataQuery query) { + return Promise.resolve(new TypeMetadataQueryResult(Collections.emptySet(), + Collections.emptySet())); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/ConditionEditorParsingStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/ConditionEditorParsingStandaloneService.java new file mode 100644 index 00000000000..cb29a82705e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/ConditionEditorParsingStandaloneService.java @@ -0,0 +1,33 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.services; + +import javax.enterprise.context.ApplicationScoped; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorParsingService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.Condition; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.ParseConditionResult; + +@ApplicationScoped +public class ConditionEditorParsingStandaloneService implements ConditionEditorParsingService { + + @Override + public Promise call(final String input) { + return Promise.resolve(new ParseConditionResult(new Condition("return false;"))); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/DataTypeNamesStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/DataTypeNamesStandaloneService.java new file mode 100644 index 00000000000..3ee856e56eb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/DataTypeNamesStandaloneService.java @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.services; + +import java.util.Collections; +import java.util.List; + +import javax.enterprise.context.ApplicationScoped; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.forms.DataTypeNamesService; +import org.uberfire.backend.vfs.Path; + +@ApplicationScoped +public class DataTypeNamesStandaloneService implements DataTypeNamesService { + + @Override + public Promise> call(final Path path) { + return Promise.resolve(Collections.emptyList()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/DiagramTypeClientStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/DiagramTypeClientStandaloneService.java new file mode 100644 index 00000000000..7ebde13dd51 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/DiagramTypeClientStandaloneService.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.services; + +import javax.enterprise.context.ApplicationScoped; + +import org.kie.workbench.common.stunner.bpmn.client.diagram.DiagramTypeClientService; +import org.kie.workbench.common.stunner.bpmn.service.ProjectType; +import org.kie.workbench.common.stunner.core.diagram.Metadata; + +@ApplicationScoped +public class DiagramTypeClientStandaloneService implements DiagramTypeClientService { + + @Override + public void loadDiagramType(final Metadata metadata) { + } + + @Override + public ProjectType getProjectType(final Metadata metadata) { + return ProjectType.BPMN; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/WorkItemDefinitionStandaloneClientService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/WorkItemDefinitionStandaloneClientService.java new file mode 100644 index 00000000000..b01200fd7ae --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/java/org/kie/workbench/common/stunner/kogito/client/services/WorkItemDefinitionStandaloneClientService.java @@ -0,0 +1,58 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.kogito.client.services; + +import java.util.Collection; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.inject.Default; +import javax.enterprise.inject.Produces; +import javax.inject.Inject; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.workitem.WorkItemDefinitionClientService; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistry; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.uberfire.client.promise.Promises; + +@ApplicationScoped +public class WorkItemDefinitionStandaloneClientService implements WorkItemDefinitionClientService { + + private final Promises promises; + private final WorkItemDefinitionCacheRegistry registry; + + @Inject + public WorkItemDefinitionStandaloneClientService(final Promises promises, + final WorkItemDefinitionCacheRegistry registry) { + this.promises = promises; + this.registry = registry; + } + + @Override + public Promise> call(final Metadata input) { + return promises.resolve(registry.items()); + } + + @Produces + @Default + @Override + public WorkItemDefinitionRegistry getRegistry() { + return registry; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/META-INF/ErraiApp.properties b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/META-INF/ErraiApp.properties new file mode 100644 index 00000000000..5805712ce82 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/META-INF/ErraiApp.properties @@ -0,0 +1,43 @@ +# +# Copyright 2016 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +# +# ErraiApp.properties +# +# Do not remove, even if empty! +# +# This is a marker file. When it is detected inside a JAR or at the +# top of any classpath, the subdirectories are scanned for deployable +# components. As such, all Errai application modules in a project +# should contain an ErraiApp.properties at the root of all classpaths +# that you wish to be scanned. +# +# There are also some configuration options that can be set in this +# file, although it is rarely necessary. See the documentation at +# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties +# for details. +errai.ioc.enabled.alternatives=org.uberfire.client.plugin.RuntimePluginsServiceProxyClientImpl \ + org.uberfire.client.workbench.WorkbenchServicesProxyClientImpl \ + org.uberfire.client.workbench.VFSServiceProxyClientImpl \ + org.uberfire.client.workbench.VFSLockServiceProxyClientImpl \ + org.uberfire.preferences.client.store.PreferenceBeanStoreClientImpl + +errai.ioc.blacklist=org.uberfire.preferences.client.store.PreferenceBeanStoreImpl \ + org.uberfire.client.RuntimePluginsServiceProxyBackendImpl \ + org.uberfire.client.WorkbenchServicesProxyBackendImpl + +errai.marshalling.use_static_marshallers=false + +errai.marshalling.force_static_marshallers=false \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/META-INF/services/org.uberfire.java.nio.file.spi.FileSystemProvider b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/META-INF/services/org.uberfire.java.nio.file.spi.FileSystemProvider new file mode 100644 index 00000000000..a841dd260e1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/META-INF/services/org.uberfire.java.nio.file.spi.FileSystemProvider @@ -0,0 +1,2 @@ +org.uberfire.java.nio.fs.jgit.JGitFileSystemProvider # file system provider, also default (1st) +org.uberfire.java.nio.fs.file.SimpleFileSystemProvider diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/application-roles.properties b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/application-roles.properties new file mode 100644 index 00000000000..cd002df720f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/application-roles.properties @@ -0,0 +1,17 @@ +# +# Copyright 2016 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# + +admin=admin diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/application-users.properties b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/application-users.properties new file mode 100644 index 00000000000..03902e91328 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/application-users.properties @@ -0,0 +1,17 @@ +# +# Copyright 2016 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# + +admin=207b6e0cc556d7084b5e2db7d822555c diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/log4j.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/log4j.xml new file mode 100644 index 00000000000..b01063e0a6d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/log4j.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/logback.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/logback.xml new file mode 100644 index 00000000000..ef2106e5322 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/logback.xml @@ -0,0 +1,34 @@ + + + + + + + + + + %d [%t] %-5p %m%n + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/org/kie/workbench/common/stunner/kogito/KogitoBPMNEditor.gwt.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/org/kie/workbench/common/stunner/kogito/KogitoBPMNEditor.gwt.xml new file mode 100644 index 00000000000..de267326f2c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/org/kie/workbench/common/stunner/kogito/KogitoBPMNEditor.gwt.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/org/kie/workbench/common/stunner/kogito/KogitoBPMNEditorWithSourceMap.gwt.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/org/kie/workbench/common/stunner/kogito/KogitoBPMNEditorWithSourceMap.gwt.xml new file mode 100644 index 00000000000..b1c14389ed3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/org/kie/workbench/common/stunner/kogito/KogitoBPMNEditorWithSourceMap.gwt.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/org/uberfire/UberfireClientBackend.gwt.xml1 b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/org/uberfire/UberfireClientBackend.gwt.xml1 new file mode 100644 index 00000000000..e28b89ae7e9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/org/uberfire/UberfireClientBackend.gwt.xml1 @@ -0,0 +1,19 @@ + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/org/uberfire/preferences/UberfirePreferencesClientBackend.gwt.xml1 b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/org/uberfire/preferences/UberfirePreferencesClientBackend.gwt.xml1 new file mode 100644 index 00000000000..e28b89ae7e9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/org/uberfire/preferences/UberfirePreferencesClientBackend.gwt.xml1 @@ -0,0 +1,19 @@ + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/project-defaults.yml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/project-defaults.yml new file mode 100644 index 00000000000..e380166f27f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/project-defaults.yml @@ -0,0 +1,56 @@ +# Sample Swarm config for KIE Drools Workbench +swarm: + management: + blocking: + timeout: 900 # This might need to be higher if the jar has timeout issues on startup + security-realms: + ApplicationRealm: # almost the same as default config in WildFly 10.1.0.Final + local-authentication: + default-user: local + allowed-users: local + skip-group-loading: true + sasasasasasasasasasasasasasasasasasasasasasasasasasasaproperties-authentication: + path: application-users.properties + plain-text: true + properties-authorization: + path: application-roles.properties +# Optional logging + logging: + console-handlers: + CONSOLE: + level: INFO + named-formatter: COLOR_PATTERN + pattern-formatters: + PATTERN: + pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n" + COLOR_PATTERN: + pattern: "%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n" + periodic-rotating-file-handlers: + FILE: + file: + path: server.log + suffix: .yyyy-MM-dd + named-formatter: PATTERN + root-logger: + handlers: + - CONSOLE + - FILE + security: + security-domains: + other: + classic-authentication: + login-modules: + kieLoginModule: + code: org.kie.security.jaas.KieLoginModule + flag: optional + module: deployment.standalone-editor.war + +# This configuration is required to make the users system work. +org: + uberfire: + ext: + security: + management: + wildfly: + cli: + user: admin diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/security-management.properties b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/security-management.properties new file mode 100644 index 00000000000..48efe4f3922 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/security-management.properties @@ -0,0 +1,16 @@ +# +# Copyright 2016 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# +org.uberfire.ext.security.management.api.userManagementServices=WildflyCLIUserManagementService diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/security-policy.properties b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/security-policy.properties new file mode 100644 index 00000000000..30d7ab450c8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/resources/security-policy.properties @@ -0,0 +1,47 @@ +# +# Copyright 2017 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# + +# +# Authorization Policy +# +# The entries in this file must comply with the following format: +# +# "classifier.identifier.setting.extra=value" +# +# classifier = role|group +# identifier = An existing role or group identifier (depending on the classifier type) +# setting = home|priority|permission +# extra = Extra setting information. Mandatory, for instance, to define a permission's name +# value = The setting value (depends on the setting selected). Value expected per setting type: +# +# - home: An existing perspective identifier to redirect after login +# - priority: An integer indicating how priority is this role|group compared to others. Used for conflict resolution. +# - permission: A name representing a specific feature or capability over a given resource. +# + +# Default settings +default.home=AuthoringPerspective +default.permission.perspective.create=true +default.permission.perspective.update=true +default.permission.perspective.delete=true +default.permission.perspective.read=true +default.permission.perspective.read.HomePerspective=true + +# Role "admin" +role.admin.permission.perspective.create=true +role.admin.permission.perspective.update=true +role.admin.permission.perspective.delete=true +role.admin.permission.perspective.read=true diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/WEB-INF/.gitignore b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/WEB-INF/.gitignore new file mode 100644 index 00000000000..d087d9ff8d6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/WEB-INF/.gitignore @@ -0,0 +1,3 @@ +# generated files +classes/ +/classes/ diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/WEB-INF/beans.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 00000000000..6fc0e5c7077 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/WEB-INF/jboss-deployment-structure.xml new file mode 100644 index 00000000000..18a5015367f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/WEB-INF/jboss-deployment-structure.xml @@ -0,0 +1,24 @@ + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/WEB-INF/web.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000000..ed6dcfc25eb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,27 @@ + + + + + + + index.html + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/afjs-manifest.json b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/afjs-manifest.json new file mode 100644 index 00000000000..68c3ea0ba67 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/afjs-manifest.json @@ -0,0 +1,9 @@ +{ + "name": "demo", + "editors": [ + { + "regex": "*.bpmn", + "editor": "BPMNStandaloneDiagramEditor" + } + ] +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/favicon.ico b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/favicon.ico new file mode 100644 index 00000000000..cefe23f9c00 Binary files /dev/null and b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/favicon.ico differ diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/images/default-diagram-thumbnail.png b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/images/default-diagram-thumbnail.png new file mode 100644 index 00000000000..d032580aef4 Binary files /dev/null and b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/images/default-diagram-thumbnail.png differ diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/index.html b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/index.html new file mode 100644 index 00000000000..185f8f69826 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/index.html @@ -0,0 +1,45 @@ + + + + + + + + BPMN Editor Showcase + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/test.html b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/test.html new file mode 100644 index 00000000000..f7520d61445 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/src/main/webapp/test.html @@ -0,0 +1,47 @@ + + + + + + + BPMN Editor Test + + + + + + +
+ Wait until the editor is loaded to open a BPMN file:
+ +
+ + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/.gitignore b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/.gitignore new file mode 100644 index 00000000000..94ef3ba19a4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/.gitignore @@ -0,0 +1,15 @@ +/target +/local + +# Eclipse, Netbeans and IntelliJ files +/.* +/**/.* +!.gitignore +/nbproject +*.ipr +*.iws +*.iml + +# Repository wide ignore mac DS_Store files +.DS_Store + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/README.md b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/README.md new file mode 100644 index 00000000000..e9db5eaf0c4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/README.md @@ -0,0 +1,27 @@ +Stunner - BPMN - Client side marshalling +======================================== + +Introduction +------------ +The goal for this module is to provide the capability to transform BPMN2 Eclipse models into the Stunner BPMN ones, and vice-versa. + +This way, by relying on top of the [Eclipse EMF/XMI - GWT support modules](../kie-wb-common-stunner-bpmn-emf), the Stunner's BPMN2 domain un/marshalling can be properly exposed to the GWT compiler, so making it also available on client side. + + +Implementation details +---------------------- + +This module contains the necessary services and marshalling dependencies to perform end to end client side marshalling for the BPMN2 domain. + +Considerations: +* Most stuff has been created from the already existing code for the BPMN marshallers, which are properly working for backend side (see [kie-wb-common-stunner-bpmn-backend](../kie-wb-common-stunner-bpmn-backend)), but applying the necessary changes for making it available on client side +* It means that this module **MUST BE MANUALLY synchronized** and up to date with any changes on the same code for server side (see [kie-wb-common-stunner-bpmn-backend](../kie-wb-common-stunner-bpmn-backend)) + + +Last synchronization from master has been done on top of the following commit (included): + + From TiagoD + Aug 20, 2019 + https://github.com/kiegroup/kie-wb-common/commit/d35034c145755e4c9dc5435f97e41068bafdb904 + +**IMPORTANT**: Please remember to update the above commit information, if necessary, to keep track of changes and be able to properly synchronize the codebase. \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/pom.xml new file mode 100644 index 00000000000..bd8686d21ea --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/pom.xml @@ -0,0 +1,321 @@ + + + + + + kie-wb-common-stunner-bpmn + org.kie.workbench.stunner + 7.29.0-SNAPSHOT + + 4.0.0 + + kie-wb-common-stunner-bpmn-marshalling + Kie Workbench - Common - Stunner - BPMN Definition Set - Marshalling + Kie Workbench - Common - Stunner - BPMN Definition Set - Marshalling + jar + + + + + javax.validation + validation-api + + + + org.hibernate + hibernate-validator + + + + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-api + + + + org.kie.workbench.stunner + kie-wb-common-stunner-client-api + + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-common + + + + org.kie.workbench.stunner + kie-wb-common-stunner-shapes-api + + + + org.kie.workbench.stunner + kie-wb-common-stunner-forms-api + + + + org.kie.workbench.stunner + kie-wb-common-stunner-bpmn-api + + + + + + com.google.gwt + gwt-user + provided + + + + com.google.jsinterop + jsinterop-annotations + + + + + + org.jboss.errai + errai-bus + + + + org.jboss.errai + errai-common + + + + org.jboss.errai + errai-ioc + + + + org.jboss.errai + errai-data-binding + + + + org.uberfire + uberfire-api + + + + org.uberfire + uberfire-commons + + + + org.kie.soup + kie-soup-commons + + + + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-api + + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client + + + + org.kie.workbench.stunner + kie-wb-common-stunner-backend-api + + + + + + org.kie.workbench.stunner + kie-wb-common-stunner-bpmn-emf + + + + org.eclipselabs + org.eclipse.emf.gwt.ecore + + + + org.eclipselabs + org.eclipse.emf.gwt.common + + + + + + + junit + junit + test + + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-common + test + test-jar + + + + org.kie.workbench.stunner + kie-wb-common-stunner-backend-common + test + + + + org.kie.workbench.stunner + kie-wb-common-stunner-backend-common + test + test-jar + + + + org.kie.workbench.stunner + kie-wb-common-stunner-bpmn-api + test + test-jar + + + + org.uberfire + uberfire-testing-utils + test + + + + org.uberfire + uberfire-metadata-commons-io + test + + + + org.slf4j + slf4j-simple + test + + + + org.mockito + mockito-core + test + + + + org.powermock + powermock-api-mockito + test + + + + org.powermock + powermock-module-junit4 + test + + + + org.drools + jbpm-simulation + test + + + + org.assertj + assertj-core + test + + + + + org.jboss.spec.javax.xml.bind + jboss-jaxb-api_2.3_spec + test + + + + org.kie.soup + kie-soup-commons + sources + test + + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-api + sources + test + + + + org.kie.workbench.stunner + kie-wb-common-stunner-core-common + sources + test + + + + com.google.gwt + gwt-dev + test + + + org.mortbay.jasper + apache-el + + + + + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + ban-duplicated-classes + none + + enforce + + + + + + + org.eclipse.emf.gwt.ecore + + org.eclipse.emf.ecore.util.* + + + + + + true + + + + + + + + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingMessage.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingMessage.java new file mode 100644 index 00000000000..fc6f376faf4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingMessage.java @@ -0,0 +1,164 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +import org.jboss.errai.common.client.api.annotations.MapsTo; +import org.jboss.errai.common.client.api.annotations.Portable; +import org.kie.workbench.common.stunner.core.util.HashUtil; +import org.kie.workbench.common.stunner.core.validation.DomainViolation; + +@Portable +public class MarshallingMessage implements DomainViolation { + + private final String elementUUID; + private final int code; + private final Type type; + private final String message; + private final String messageKey; + private final List messageArguments; + + public String getUUID() { + return elementUUID; + } + + @Override + public String getMessage() { + return message; + } + + @Override + public Type getViolationType() { + return type; + } + + public int getCode() { + return code; + } + + public String getMessageKey() { + return messageKey; + } + + public List getMessageArguments() { + return messageArguments; + } + + public MarshallingMessage(@MapsTo("elementUUID") String elementUUID, @MapsTo("code") int code, + @MapsTo("type") Type type, @MapsTo("message") String message, + @MapsTo("messageKey") String messageKey, + @MapsTo("messageArguments") List messageArguments) { + this.elementUUID = elementUUID; + this.code = code; + this.type = type; + this.message = message; + this.messageKey = messageKey; + this.messageArguments = messageArguments; + } + + public static MarshallingMessageBuilder builder() { + return new MarshallingMessageBuilder(); + } + + public static class MarshallingMessageBuilder { + + private String elementUUID; + private int code; + private Type type = Type.ERROR; + private String message; + private String messageKey; + private List messageArguments = Collections.emptyList(); + + public MarshallingMessageBuilder elementUUID(String elementUUID) { + this.elementUUID = elementUUID; + return this; + } + + public MarshallingMessageBuilder code(int code) { + this.code = code; + return this; + } + + public MarshallingMessageBuilder type(Type type) { + this.type = type; + return this; + } + + public MarshallingMessageBuilder message(String message) { + this.message = message; + return this; + } + + public MarshallingMessageBuilder messageKey(String messageKey) { + this.messageKey = messageKey; + return this; + } + + public MarshallingMessageBuilder messageArguments(List messageArguments) { + this.messageArguments = messageArguments; + return this; + } + + public MarshallingMessageBuilder messageArguments(String... messageArguments) { + return this.messageArguments(Arrays.asList(messageArguments)); + } + + public MarshallingMessage build() { + return new MarshallingMessage(elementUUID, code, type, message, messageKey, messageArguments); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarshallingMessage that = (MarshallingMessage) o; + return code == that.code && + Objects.equals(elementUUID, that.elementUUID) && + type == that.type && + Objects.equals(message, that.message) && + Objects.equals(messageKey, that.messageKey) && + Objects.equals(messageArguments, that.messageArguments); + } + + @Override + public int hashCode() { + return HashUtil.combineHashCodes(Objects.hashCode(getUUID()), Objects.hashCode(getCode()), + Objects.hashCode(type), Objects.hashCode(getMessage()), + Objects.hashCode(getMessageKey()), Objects.hashCode(getMessageArguments())); + } + + @Override + public String toString() { + return "MarshallingMessage{" + + "elementUUID='" + elementUUID + '\'' + + ", code=" + code + + ", type=" + type + + ", message='" + message + '\'' + + ", messageKey='" + messageKey + '\'' + + ", messageArguments=" + messageArguments + + '}'; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingMessageDecorator.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingMessageDecorator.java new file mode 100644 index 00000000000..8cc80e6a46c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingMessageDecorator.java @@ -0,0 +1,42 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall; + +import java.util.function.Function; + +public class MarshallingMessageDecorator { + + private final Function name; + private final Function type; + + public MarshallingMessageDecorator(Function name, Function type) { + this.name = name; + this.type = type; + } + + public static MarshallingMessageDecorator of(Function name, Function type) { + return new MarshallingMessageDecorator<>(name, type); + } + + public String getName(T object) { + return name.apply(object); + } + + public String getType(T object) { + return type.apply(object); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingMessageKeys.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingMessageKeys.java new file mode 100644 index 00000000000..5c13a9becbb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingMessageKeys.java @@ -0,0 +1,34 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall; + +public final class MarshallingMessageKeys { + + public static final String boundaryIgnored = "MarshallingMessage.boundaryIgnored"; + public static final String associationIgnored = "MarshallingMessage.associationIgnored"; + public static final String sequenceFlowIgnored = "MarshallingMessage.sequenceFlowIgnored"; + + public static final String collapsedElementExpanded = "MarshallingMessage.collapsedElementExpanded"; + + public static final String ignoredElement = "MarshallingMessage.ignoredElement"; + public static final String ignoredUnknownElement = "MarshallingMessage.ignoredUnknownElement"; + + public static final String childLaneSetConverted = "MarshallingMessage.childLaneSetConverted"; + public static final String convertedElement = "MarshallingMessage.convertedElement"; + + public static final String elementFailure = "MarshallingMessage.elementFailure"; +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingRequest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingRequest.java new file mode 100644 index 00000000000..ae27a78e5ca --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingRequest.java @@ -0,0 +1,136 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall; + +import java.util.Objects; + +import org.jboss.errai.common.client.api.annotations.MapsTo; +import org.jboss.errai.common.client.api.annotations.Portable; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.util.HashUtil; + +/** + * Encapsulates the attributes required on a marshalling process. + * Includes the {@link Mode} that represents how the marshaller should handle errors and exceptions. + * @param represents the input type + * @param represents the metadata type + */ +@Portable +public class MarshallingRequest { + + /** + * Mode of the marshalling process + *

+ * ERROR: + * - return errors when it has unsupported nodes + * - return ERROR messages + * AUTO: + * - try to adapt and convert unsupported nodes to generic ones + * - return warn messages + * - ignore unsupported nodes that doesn't have options to be converted + * IGNORE: + * - remove all unsupported nodes and relationships to them + * - warn messages + */ + public enum Mode { + ERROR, + AUTO, + IGNORE + } + + private final I input; + private final M metadata; + private final Mode mode; + + public MarshallingRequest(@MapsTo("input") I input, @MapsTo("metadata") M metadata, @MapsTo("mode") Mode mode) { + this.input = input; + this.metadata = metadata; + this.mode = mode; + } + + public I getInput() { + return input; + } + + public M getMetadata() { + return metadata; + } + + public Mode getMode() { + return mode; + } + + public static MarshallingRequestBuilder builder() { + return new MarshallingRequestBuilder<>(); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("MarshallingRequest{"); + sb.append("input=").append(input); + sb.append(", metadata=").append(metadata); + sb.append(", mode=").append(mode); + sb.append('}'); + return sb.toString(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof MarshallingRequest)) { + return false; + } + MarshallingRequest that = (MarshallingRequest) o; + return Objects.equals(getInput(), that.getInput()) && + Objects.equals(getMetadata(), that.getMetadata()) && + getMode() == that.getMode(); + } + + @Override + public int hashCode() { + return HashUtil.combineHashCodes(Objects.hashCode(getInput()), Objects.hashCode(getMetadata()), + Objects.hashCode(getMode())); + } + + public static class MarshallingRequestBuilder { + + private I input; + private M metadata; + private Mode mode; + + public MarshallingRequestBuilder input(I input) { + this.input = input; + return this; + } + + public MarshallingRequestBuilder metadata(M metadata) { + this.metadata = metadata; + return this; + } + + public MarshallingRequestBuilder mode(Mode mode) { + this.mode = mode; + return this; + } + + public MarshallingRequest build() { + return new MarshallingRequest(input, metadata, mode); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingResponse.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingResponse.java new file mode 100644 index 00000000000..a0b2add3761 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/MarshallingResponse.java @@ -0,0 +1,134 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +import org.jboss.errai.common.client.api.annotations.MapsTo; +import org.jboss.errai.common.client.api.annotations.Portable; +import org.kie.workbench.common.stunner.core.util.HashUtil; + +/** + * Encapsulates the response of a marshalling process, containing messages details and the respective {@link State}. + * @param result type in case of marshalling success. + */ +@Portable +public class MarshallingResponse { + + public enum State { + ERROR, + SUCCESS + } + + private final List messages; + private final State state; + private final T result; + + private MarshallingResponse(@MapsTo("messages") List messages, + @MapsTo("state") State state, @MapsTo("result") T result) { + this.messages = messages; + this.state = state; + this.result = result; + } + + public List getMessages() { + return messages; + } + + public State getState() { + return state; + } + + public T getResult() { + return result; + } + + public static MarshallingResponseBuilder builder() { + return new MarshallingResponseBuilder<>(); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("MarshallingResponse{"); + sb.append("messages=").append(messages); + sb.append(", state=").append(state); + sb.append(", result=").append(result); + sb.append('}'); + return sb.toString(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof MarshallingResponse)) { + return false; + } + MarshallingResponse that = (MarshallingResponse) o; + return Objects.equals(getMessages(), that.getMessages()) && + getState() == that.getState() && + Objects.equals(getResult(), that.getResult()); + } + + @Override + public int hashCode() { + return HashUtil.combineHashCodes(Objects.hashCode(getMessages()), Objects.hashCode(getState()), + Objects.hashCode(getResult())); + } + + public boolean isSuccess() { + return State.SUCCESS.equals(state); + } + + public boolean isError() { + return State.ERROR.equals(state); + } + + public static class MarshallingResponseBuilder { + + private final List messages = new ArrayList<>(); + private State state; + private T result; + + public MarshallingResponseBuilder messages(List messages) { + this.messages.addAll(messages); + return this; + } + + public MarshallingResponseBuilder addMessage(MarshallingMessage message) { + messages.add(message); + return this; + } + + public MarshallingResponseBuilder state(State state) { + this.state = state; + return this; + } + + public MarshallingResponseBuilder result(T result) { + this.result = result; + return this; + } + + public MarshallingResponse build() { + return new MarshallingResponse(messages, state, result); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/BPMNElementDecorators.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/BPMNElementDecorators.java new file mode 100644 index 00000000000..60fb52d4ddd --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/BPMNElementDecorators.java @@ -0,0 +1,76 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters; + +import java.util.Optional; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.FlowElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessageDecorator; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; + +public class BPMNElementDecorators { + + public static MarshallingMessageDecorator flowElementDecorator() { + return MarshallingMessageDecorator.of(o -> Optional.ofNullable(o.getName()) + .orElseGet(o::getId), + g -> g.getClass().getName()); + } + + public static MarshallingMessageDecorator baseElementDecorator() { + return MarshallingMessageDecorator.of(BaseElement::getId, + g -> g.getClass().getName()); + } + + public static MarshallingMessageDecorator bpmnNodeDecorator() { + return MarshallingMessageDecorator.of(o -> + Optional.ofNullable(o.value() + .getContent() + .getDefinition() + .getGeneral() + .getName() + .getValue()) + .orElseGet(() -> o.value().getUUID()), + bpmnNode -> bpmnNode.value() + .getContent() + .getDefinition() + .getClass() + .getName()); + } + + public static MarshallingMessageDecorator> resultBpmnDecorator() { + return MarshallingMessageDecorator.of(r -> + { + BpmnNode o = (BpmnNode) r.value(); + return Optional.ofNullable(o.value() + .getContent() + .getDefinition() + .getGeneral() + .getName() + .getValue()) + .orElseGet(() -> o.value().getUUID()); + }, + r -> { + BpmnNode o1 = (BpmnNode) r.value(); + return o1.value() + .getContent() + .getDefinition() + .getClass() + .getName(); + }); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/Match.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/Match.java new file mode 100644 index 00000000000..b92aff2fcf4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/Match.java @@ -0,0 +1,254 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters; + +import java.util.LinkedList; +import java.util.List; +import java.util.Optional; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Stream; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessage; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessageDecorator; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessageKeys; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest.Mode; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.validation.Violation; + +/** + * Creates a pattern matching function. + *

+ * Example usage: + * + *

+ *     // let be T1 a class, and let be T1a, T1b subclasses of T1
+ *     // then, let be T2 a class, and let be T2a, T2b subclasses of T2
+ *     // such that T1a corresponds to T2a, T1b corresponds to T2b:
+ *     Match m =
+ *         Match.of(T1.class, T2.class)
+ *           .when(T1a.class, t1aInstance -> ... create an equivalent t2a instance)
+ *           .when(T1b.class, t1bInstance -> ... create an equivalent t2b instance)
+ *     T1 myT1 = ...;
+ *
+ *     Result result = myT1.apply(myT1);
+ *     // unwrap the result on success, raise an exception otherwise
+ *     T2 t2 = result.value();
+ * 
+ * @param the input type of the match + * @param the type of the result of the match + */ +public class Match { + + private final LinkedList cases = new LinkedList<>(); + private final LinkedList strictCases = new LinkedList<>(); + private Function orElse; + private Out defaultValue; + private Optional inputDecorator = Optional.empty(); + private Optional outputDecorator = Optional.empty(); + private Mode mode = Mode.AUTO; + + public Match() { + } + + public static Match of() { + return new Match<>(); + } + + public static Match, ?>> ofNode(Class inputType, Class outputType) { + return new Match<>(); + } + + public static Match, ?>, Out> fromNode(Class inputType, Class outputType) { + return new Match<>(); + } + + public static Match, ?>> ofEdge(Class inputType, Class outputType) { + return new Match<>(); + } + + private static Function> reportMissing(Class expectedClass) { + return t -> + Result.failure( + "Not yet implemented: " + + Optional.ofNullable(t) + .map(o -> o.getClass().getCanonicalName()) + .orElse("null -- expected " + expectedClass.getCanonicalName())); + } + + private Function> ignored(Class expectedClass) { + return t -> + Result.ignored( + "Ignored: " + + Optional.ofNullable(t) + .map(o -> o.getClass().getCanonicalName()) + .orElse("null -- expected " + expectedClass.getCanonicalName()), + defaultValue, MarshallingMessage.builder().message("Ignored " + t).build()); + } + + public Match when(Function type, Function then) { + Function> thenWrapped = sub -> Result.of(then.apply(sub)); + return when_(type, thenWrapped); + } + + private Match when_(Function type, Function> then) { + cases.add(new Case(type, then)); + return this; + } + + /** + * handle a type by throwing an error. + * Use when the implementation is still missing, but expected to exist + */ + public Match missing(Function type, Class clazz) { + return when_(type, reportMissing(clazz)); + } + + public Match ignore(Function type, Class clazz) { + return when_(type, ignored(clazz)); + } + + public Match orElse(Function then) { + this.orElse = then; + return this; + } + + public Match inputDecorator(MarshallingMessageDecorator decorator) { + this.inputDecorator = Optional.ofNullable(decorator); + return this; + } + + public Match outputDecorator(MarshallingMessageDecorator decorator) { + this.outputDecorator = Optional.ofNullable(decorator); + return this; + } + + public Match defaultValue(Out value) { + this.defaultValue = value; + return this; + } + + public Match mode(Mode mode) { + this.mode = mode; + return this; + } + + private Result apply(T value, List cases, Supplier> fallback) { + return cases.stream() + .map(c -> c.match(value)) + .filter(Result::isSuccess) + .findFirst() + .orElseGet(fallback); + } + + public Result apply(T value) { + //First apply strict cases if matches, Second the generic cases, and as default the fallback + return apply(value, + strictCases, + () -> apply(value, + cases, + () -> applyFallback(value))); + } + + private Result applyFallback(T value) { + if (Mode.ERROR.equals(mode)) { + //throw an Exception in case the mode is set to ERROR, avoid to apply the fallback + //throw new IllegalStateException("Element has no match on marshalling: " + value); + return getFailure(value); + } + + if (orElse == null || Mode.IGNORE.equals(mode)) { + return Stream.concat(cases.stream(), strictCases.stream()) + .map(c -> c.match(value)) + .filter(Result::isIgnored) + .map(r -> { + //handling value as Result setting the specific ignore message + if (r.value() instanceof Result) { + ((Result) r.value()).setMessages(getIgnoreMessage(value)); + } + return r; + }) + .findFirst() + .orElseGet(() -> Result.failure(value == null ? "Null value" : value.getClass().getName(), + defaultValue, + getIgnoreMessage(value))); + } else { + //fallback is applied only in case of AUTO mode. + final Out result = orElse.apply((In)value); + return Result.of(result, + MarshallingMessage.builder() + .message("Converted element: " + value + "to: " + result) + .messageKey(MarshallingMessageKeys.convertedElement) + .messageArguments(getValueName(value, inputDecorator), + getValueType(value, inputDecorator), + getValueType(result, outputDecorator)) + .type(Violation.Type.WARNING) + .build()); + } + } + + private MarshallingMessage getIgnoreMessage(T value) { + return MarshallingMessage.builder() + .message("Ignored element " + value) + .messageKey(MarshallingMessageKeys.ignoredElement) + .messageArguments(getValueName(value, inputDecorator), + getValueType(value, inputDecorator)) + .type(Violation.Type.WARNING) + .build(); + } + + private Result getFailure(Object value) { + return Result.failure(value.getClass().getName(), defaultValue, + MarshallingMessage.builder() + .type(Violation.Type.ERROR) + .message("Failure there is no match for element " + value) + .messageKey(MarshallingMessageKeys.elementFailure) + .messageArguments(String.valueOf(value)) + .build()); + } + + private String getValueType(T value, Optional decorator) { + return decorator + .map(d -> d.getType(value)) + .orElseGet(() -> Optional.ofNullable(value) + .map(Object::getClass) + .map(Class::getSimpleName) + .orElse("")); + } + + private String getValueName(T value, Optional decorator) { + return decorator.map(d -> d.getName(value)).orElseGet(() -> String.valueOf(value)); + } + + private class Case { + + public final Function when; + public final Function> then; + + private Case(Function when, Function> then) { + this.when = when; + this.then = then; + } + + public Result match(In value) { + return when.apply(value) ? + then.apply(value) : getFailure(value); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/Result.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/Result.java new file mode 100644 index 00000000000..48e1ef47ee3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/Result.java @@ -0,0 +1,253 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessage; + +public interface Result { + + static Result of(R value, MarshallingMessage... messages) { + return success(value, messages); + } + + static Result success(R value, MarshallingMessage... messages) { + return new Success<>(value, messages); + } + + static Result failure(String reason, MarshallingMessage... messages) { + return new Failure<>(reason, messages); + } + + static Result failure(String reason, R defaultValue, MarshallingMessage... messages) { + return new Failure<>(reason, defaultValue, messages); + } + + static Result ignored(String reason, MarshallingMessage... messages) { + return new Ignored<>(reason, messages); + } + + static Result ignored(String reason, U defaultValue, MarshallingMessage... messages) { + return new Ignored<>(reason, defaultValue, messages); + } + + boolean isFailure(); + + boolean isIgnored(); + + boolean isSuccess(); + + default boolean nonFailure() { + return !isFailure(); + } + + default boolean notIgnored() { + return !isIgnored(); + } + + T value(); + + List messages(); + + Result setMessages(MarshallingMessage... messages); + + default void ifSuccess(Consumer consumer) { + Optional.ofNullable(value()).ifPresent(consumer::accept); + } + + default void ifFailure(Consumer consumer) { + if (isFailure()) { + consumer.accept(asFailure().reason()); + } + } + + Success asSuccess(); + + Failure asFailure(); + + Ignored asIgnored(); + + abstract class AbstractResult implements Result { + + private List messages; + + AbstractResult(MarshallingMessage... messages) { + this.messages = new ArrayList<>(); + this.messages.addAll(Arrays.asList(messages)); + } + + @Override + public List messages() { + return messages; + } + + @Override + public Result setMessages(MarshallingMessage... messages) { + this.messages = Stream.of(messages).collect(Collectors.toList()); + return this; + } + } + + class Success extends AbstractResult { + + private final T value; + + Success(T value, MarshallingMessage... messages) { + super((messages)); + this.value = value; + } + + public T value() { + return value; + } + + public Success asSuccess() { + return this; + } + + public Ignored asIgnored() { + throw new ClassCastException("Could not convert Success to Ignored"); + } + + public Failure asFailure() { + throw new ClassCastException("Could not convert Success to Failure"); + } + + @Override + public boolean isSuccess() { + return true; + } + + public boolean isIgnored() { + return false; + } + + public boolean isFailure() { + return false; + } + } + + class Ignored extends AbstractResult { + + private final String reason; + private final T defaultValue; + + Ignored(String reason, MarshallingMessage... messages) { + this(reason, null, messages); + } + + Ignored(String reason, T defaultValue, MarshallingMessage... messages) { + super(messages); + this.reason = reason; + this.defaultValue = defaultValue; + } + + public String reason() { + return reason; + } + + public Success asSuccess() { + throw new NoSuchElementException(reason); + } + + public Ignored asIgnored() { + return this; + } + + public Failure asFailure() { + throw new ClassCastException("Could not convert Ignored to Success"); + } + + @Override + public boolean isSuccess() { + return false; + } + + public boolean isIgnored() { + return true; + } + + public boolean isFailure() { + return false; + } + + @Override + public T value() { + return defaultValue; + } + } + + class Failure extends AbstractResult { + + private final String reason; + private final T defaultValue; + + Failure(String reason, MarshallingMessage... messages) { + this(reason, null, messages); + } + + Failure(String reason, T defaultValue, MarshallingMessage... messages) { + super(messages); + this.reason = reason; + this.defaultValue = defaultValue; + } + + public String reason() { + return reason; + } + + public Success asSuccess() { + throw new NoSuchElementException(reason); + } + + public Ignored asIgnored() { + throw new ClassCastException("Could not convert Failure to Ignored"); + } + + public Failure asFailure() { + return this; + } + + @Override + public boolean isSuccess() { + return false; + } + + public boolean isIgnored() { + return false; + } + + public boolean isFailure() { + return true; + } + + @Override + public T value() { + return defaultValue; + } + } +} + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/ResultComposer.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/ResultComposer.java new file mode 100644 index 00000000000..c55e7f18d38 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/ResultComposer.java @@ -0,0 +1,42 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessage; + +public class ResultComposer { + + public static Result composeResults(T value, Collection>... results) { + List messages = Stream.of(results).flatMap(Collection::stream) + .map(Result::messages) + .flatMap(List::stream) + .collect(Collectors.toList()); + return Result.success(value, messages.stream().toArray(MarshallingMessage[]::new)); + } + + @SuppressWarnings("unchecked") + public static Result compose(T value, Result... result) { + List> results = Arrays.asList(result); + return composeResults(value, results); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/TypedFactoryManager.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/TypedFactoryManager.java new file mode 100644 index 00000000000..50144e25520 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/TypedFactoryManager.java @@ -0,0 +1,63 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters; + +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId; +import static org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionSetId; + +/** + * A type-safe wrapper to a FactoryManager. + *

+ * Returns nodes, edges and graphs of the requested type. + * It is a + */ +public class TypedFactoryManager { + + private final FactoryManager factoryManager; + + public TypedFactoryManager(FactoryManager factoryManager) { + this.factoryManager = factoryManager; + } + + public FactoryManager untyped() { + return factoryManager; + } + + @SuppressWarnings("unchecked") + public Node, Edge> newNode(String s, Class aClass) { + return (Node, Edge>) factoryManager.newElement(s, getDefinitionId(aClass)); + } + + @SuppressWarnings("unchecked") + public Edge, Node> newEdge(String s, Class aClass) { + return (Edge, Node>) factoryManager.newElement(s, getDefinitionId(aClass)); + } + + @SuppressWarnings("unchecked") + public Diagram, Metadata> newDiagram(String s, Class aClass, Metadata metadata) { + return factoryManager.newDiagram(s, getDefinitionSetId(aClass), metadata); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AssociationDeclaration.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AssociationDeclaration.java new file mode 100644 index 00000000000..e5221c9e2fa --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AssociationDeclaration.java @@ -0,0 +1,147 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import java.util.Objects; +import java.util.Optional; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.AssociationDeclaration.Type.FromTo; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.AssociationDeclaration.Type.SourceTarget; + +public class AssociationDeclaration { + + private Direction direction; + private Type type; + private String source; + private String target; + + public AssociationDeclaration(Direction direction, Type type, String source, String target) { + this.direction = direction; + this.type = type; + this.source = source; + this.target = target; + } + + public static AssociationDeclaration fromString(String encoded) { + return AssociationParser.parse(encoded); + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public String getTarget() { + return target; + } + + public void setTarget(String target) { + this.target = target; + } + + public Direction getDirection() { + return direction; + } + + public void setDirection(Direction direction) { + this.direction = direction; + } + + public void setType(Type type) { + this.type = type; + } + + public Type getType() { + return type; + } + + @Override + public String toString() { + return direction.prefix() + + (type.equals(Type.FromTo) ? + (target + type.op() + source) + : (source + type.op() + target)); + } + + public enum Direction { + Input("[din]"), + Output("[dout]"); + + private final String prefix; + + Direction(String prefix) { + this.prefix = prefix; + } + + public String prefix() { + return prefix; + } + } + + public enum Type { + FromTo("="), + SourceTarget("->"); + + private final String op; + + Type(String op) { + this.op = op; + } + + public String op() { + return op; + } + } +} + +class AssociationParser { + + public static AssociationDeclaration parse(String encoded) { + if (Objects.nonNull(encoded)) { + for (AssociationDeclaration.Direction direction : AssociationDeclaration.Direction.values()) { + if (encoded.startsWith(direction.prefix())) { + String rest = encoded.substring(direction.prefix().length()); + return parseAssociation(direction, rest); + } + } + } + + throw new IllegalArgumentException("Cannot parse " + encoded); + } + + private static AssociationDeclaration parseAssociation(AssociationDeclaration.Direction direction, String rest) { + final AssociationDeclaration.Type type = + Optional.ofNullable(rest) + .filter(s -> s.contains(SourceTarget.op())) + .map(s -> SourceTarget) + .orElseGet(() -> Optional.ofNullable(rest) + .filter(s -> s.contains(FromTo.op())) + .map(s -> FromTo) + .orElseThrow(() -> new IllegalArgumentException("Cannot parse " + rest))); + + final String[] association = rest.split(type.op()); + final String param1 = association.length > 0 ? association[0] : ""; + final String param2 = association.length > 1 ? association[1] : ""; + + return SourceTarget.equals(type) + ? new AssociationDeclaration(direction, type, param1, param2) + : new AssociationDeclaration(direction, type, param2, param1); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AssociationList.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AssociationList.java new file mode 100644 index 00000000000..ef9977f308b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AssociationList.java @@ -0,0 +1,95 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.kie.workbench.common.stunner.core.util.StringUtils; +import org.uberfire.commons.uuid.UUID; + +import static java.util.stream.Collectors.toList; + +public class AssociationList { + + public static final String REGEX_DELIMITER = ",\\["; + public static final String RANDOM_DELIMITER = UUID.uuid(); + public static final String REPLACE_DELIMITER_AVOID_CONFLICTS = RANDOM_DELIMITER + ",["; + public static final String REPLACED_DELIMITER = RANDOM_DELIMITER + ","; + private final List inputs; + private final List outputs; + + public AssociationList(List inputs, List outputs) { + this.inputs = inputs; + this.outputs = outputs; + } + + public AssociationList(List all) { + this.inputs = new ArrayList<>(); + this.outputs = new ArrayList<>(); + for (AssociationDeclaration associationDeclaration : all) { + if (associationDeclaration.getDirection() == AssociationDeclaration.Direction.Input) { + inputs.add(associationDeclaration); + } else { + outputs.add(associationDeclaration); + } + } + } + + public AssociationList() { + this.inputs = new ArrayList<>(); + this.outputs = new ArrayList<>(); + } + + public static AssociationList fromString(String encoded) { + return Optional.ofNullable(encoded) + .filter(StringUtils::nonEmpty) + .map(s -> new AssociationList( + Arrays.stream(s.replaceAll(REGEX_DELIMITER, REPLACE_DELIMITER_AVOID_CONFLICTS) + .split(REPLACED_DELIMITER)) + .map(AssociationDeclaration::fromString) + .collect(toList()))) + .orElse(new AssociationList()); + } + + public List getInputs() { + return inputs; + } + + public AssociationDeclaration lookupInput(String id) { + return inputs.stream().filter(in -> in.getTarget().equals(id)).findFirst().orElse(null); + } + + public AssociationDeclaration lookupOutput(String id) { + return outputs.stream().filter(in -> in.getSource().equals(id)).findFirst().orElse(null); + } + + public List getOutputs() { + return outputs; + } + + @Override + public String toString() { + return Stream.concat(inputs.stream(), outputs.stream()) + .map(AssociationDeclaration::toString) + .collect(Collectors.joining(",")); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AttributeDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AttributeDefinition.java new file mode 100644 index 00000000000..5653cc54b7a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AttributeDefinition.java @@ -0,0 +1,109 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import java.util.Optional; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.emf.ecore.impl.EAttributeImpl; +import org.eclipse.emf.ecore.impl.EStructuralFeatureImpl; +import org.eclipse.emf.ecore.util.FeatureMap; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.metaData; + +public abstract class AttributeDefinition { + + protected final T defaultValue; + private final String namespace; + private final String name; + + public AttributeDefinition(String namespace, String name, T defaultValue) { + this.namespace = namespace; + this.name = name; + this.defaultValue = defaultValue; + } + + public String name() { + return name; + } + + public abstract T getValue(BaseElement element); + + public abstract void setValue(BaseElement element, T value); + + Optional getStringValue(BaseElement element) { + return element.getAnyAttribute().stream() + .filter(e -> this.name().equals(e.getEStructuralFeature().getName())) + .map(FeatureMap.Entry::getValue) + .map(String::valueOf) + .findFirst(); + } + + void setStringValue(BaseElement element, String value) { + EAttributeImpl extensionAttribute = (EAttributeImpl) metaData.demandFeature( + "http://www.jboss.org/drools", + name, + false, + false); + + EStructuralFeatureImpl.SimpleFeatureMapEntry feature = + new EStructuralFeatureImpl.SimpleFeatureMapEntry(extensionAttribute, value); + + element.getAnyAttribute().add(feature); + } + + public CustomAttribute of(BaseElement element) { + return new CustomAttribute<>(this, element); + } +} + +class BooleanAttribute extends AttributeDefinition { + + BooleanAttribute(String namespace, String name, Boolean defaultValue) { + super(namespace, name, defaultValue); + } + + @Override + public Boolean getValue(BaseElement element) { + return getStringValue(element) + .map(Boolean::parseBoolean) + .orElse(defaultValue); + } + + @Override + public void setValue(BaseElement element, Boolean value) { + setStringValue(element, String.valueOf(value)); + } +} + +class StringAttribute extends AttributeDefinition { + + StringAttribute(String namespace, String name, String defaultValue) { + super(namespace, name, defaultValue); + } + + @Override + public String getValue(BaseElement element) { + return getStringValue(element) + .orElse(defaultValue); + } + + @Override + public void setValue(BaseElement element, String value) { + setStringValue(element, value); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/ColorAttribute.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/ColorAttribute.java new file mode 100644 index 00000000000..b655e9beb5b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/ColorAttribute.java @@ -0,0 +1,40 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import org.omg.spec.bpmn.non.normative.color.ColorPackage; + +public class ColorAttribute { + + private static final String colorns = ColorPackage.eNS_URI; + + public static final AttributeDefinition BgActivities = new StringAttribute(colorns, "background-color", "#fafad2"); + public static final AttributeDefinition BgEvents = new StringAttribute(colorns, "background-color", "#f5deb3"); + public static final AttributeDefinition BgStartEvents = new StringAttribute(colorns, "background-color", "#9acd32"); + public static final AttributeDefinition BgEndEvents = new StringAttribute(colorns, "background-color", "#ff6347"); + public static final AttributeDefinition BgDataObjects = new StringAttribute(colorns, "background-color", "#C0C0C0"); + public static final AttributeDefinition BgCatchingEvents = new StringAttribute(colorns, "background-color", "#f5deb3"); + public static final AttributeDefinition BgThrowingEvents = new StringAttribute(colorns, "background-color", "#8cabff"); + public static final AttributeDefinition BgGateways = new StringAttribute(colorns, "background-color", "#f0e68c"); + public static final AttributeDefinition BgSwimlanes = new StringAttribute(colorns, "background-color", "#ffffff"); + public static final AttributeDefinition DefaultBr = new StringAttribute(colorns, "border-color", "#000000"); + public static final AttributeDefinition BrCatchingEvents = new StringAttribute(colorns, "border-color", "#a0522d"); + public static final AttributeDefinition BrThrowingEvents = new StringAttribute(colorns, "border-color", "#008cec"); + public static final AttributeDefinition BrGateways = new StringAttribute(colorns, "border-color", "#a67f00"); + public static final AttributeDefinition DefaultFont = new StringAttribute(colorns, "font-color", "#000000"); + public static final AttributeDefinition DefaultSeqwuenceFlow = new StringAttribute(colorns, "border-color", "#000000"); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomAttribute.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomAttribute.java new file mode 100644 index 00000000000..34d886e8a30 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomAttribute.java @@ -0,0 +1,127 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import java.util.Optional; + +import org.eclipse.bpmn2.BaseElement; +import org.jboss.drools.DroolsPackage; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; + +public class CustomAttribute { + + private static final String droolsns = DroolsPackage.eNS_URI; + public static final AttributeDefinition independent = new BooleanAttribute(droolsns, "independent", false); + public static final AttributeDefinition adHoc = new BooleanAttribute(droolsns, "adHoc", false); + public static final AttributeDefinition waitForCompletion = new BooleanAttribute(droolsns, "waitForCompletion", false); + public static final AttributeDefinition serviceTaskName = new StringAttribute(droolsns, "taskName", ""); + public static final AttributeDefinition ruleFlowGroup = new StringAttribute(droolsns, "ruleFlowGroup", ""); + public static final AttributeDefinition packageName = new StringAttribute(droolsns, "packageName", null) { + @Override + public void setValue(BaseElement element, String value) { + // do not set if null or the XML serializer will NPE + if (value != null) { + super.setValue(element, value.isEmpty() ? Package.DEFAULT_PACKAGE : value); + } + } + }; + public static final AttributeDefinition version = new StringAttribute(droolsns, "version", "1.0"); + public static final AttributeDefinition errorName = new StringAttribute(droolsns, "erefname", ""); + public static final AttributeDefinition msgref = new StringAttribute(droolsns, "msgref", ""); + public static final AttributeDefinition esccode = new StringAttribute(droolsns, "esccode", ""); + public static final AttributeDefinition boundarycaForBoundaryEvent = new BooleanAttribute(droolsns, "boundaryca", false) { + @Override + public Boolean getValue(BaseElement element) { + // this is for compatibility with legacy marshallers + // always return the default regardless the string was empty in the file + // or it was actually undefined + String value = super.getStringValue(element).orElse(""); + return value.isEmpty() ? defaultValue : Boolean.parseBoolean(value); + } + }; + public static final AttributeDefinition boundarycaForEvent = new BooleanAttribute(droolsns, "boundaryca", true) { + @Override + public Boolean getValue(BaseElement element) { + // this is for compatibility with legacy marshallers + // always return the default regardless the string was empty in the file + // or it was actually undefined + String value = super.getStringValue(element).orElse(""); + return value.isEmpty() ? defaultValue : Boolean.parseBoolean(value); + } + }; + public static final AttributeDefinition priority = new StringAttribute(droolsns, "priority", null); + public static final AttributeDefinition dtype = new StringAttribute(droolsns, "dtype", ""); + public static final AttributeDefinition dg = new StringAttribute(droolsns, "dg", "") { + @Override + public String getValue(BaseElement element) { + // this is for compatibility with legacy marshallers + // always return null regardless the string was empty in the file + // or it was actually undefined + String value = super.getValue(element); + return value.isEmpty() ? null : value; + } + }; + public static final AttributeDefinition dockerInfo = new AttributeDefinition(droolsns, "dockerinfo", Point2D.create(0, 0)) { + @Override + public Point2D getValue(BaseElement element) { + Optional attribute = getStringValue(element); + + if (attribute.isPresent()) { + String dockerInfoStr = attribute.get(); + dockerInfoStr = dockerInfoStr.substring(0, dockerInfoStr.length() - 1); + String[] dockerInfoParts = dockerInfoStr.split("\\|"); + String infoPartsToUse = dockerInfoParts[0]; + String[] infoPartsToUseParts = infoPartsToUse.split("\\^"); + + double x = Double.valueOf(infoPartsToUseParts[0]); + double y = Double.valueOf(infoPartsToUseParts[1]); + + return Point2D.create(x, y); + } else { + return Point2D.create(0, 0); + } + } + + @Override + public void setValue(BaseElement element, Point2D value) { + setStringValue(element, value.getX() + "^" + value.getY() + "|"); + } + }; + + public static final AttributeDefinition serviceOperation = new StringAttribute(droolsns, "serviceoperation", ""); + public static final AttributeDefinition serviceImplementation = new StringAttribute(droolsns, "serviceimplementation", ""); + public static final AttributeDefinition serviceInterface = new StringAttribute(droolsns, "serviceinterface", ""); + + private final AttributeDefinition attributeDefinition; + private final BaseElement element; + + public CustomAttribute(AttributeDefinition attributeDefinition, BaseElement element) { + this.attributeDefinition = attributeDefinition; + this.element = element; + } + + public T get() { + return attributeDefinition.getValue(element); + } + + public void set(T value) { + if (value != null) { + attributeDefinition.setValue(element, value); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomElement.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomElement.java new file mode 100644 index 00000000000..a3abad3e615 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomElement.java @@ -0,0 +1,72 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.FlowElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements.BooleanElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements.ElementDefinition; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements.GlobalVariablesElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements.MetadataTypeDefinition; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements.StringElement; + +public class CustomElement { + + public static final MetadataTypeDefinition async = new BooleanElement("customAsync", false); + public static final MetadataTypeDefinition autoStart = new BooleanElement("customAutoStart", false); + public static final MetadataTypeDefinition autoConnectionSource = new BooleanElement("isAutoConnection.source", false); + public static final MetadataTypeDefinition autoConnectionTarget = new BooleanElement("isAutoConnection.target", false); + public static final MetadataTypeDefinition customKPI = new BooleanElement("customKPI", false); + public static final MetadataTypeDefinition description = new StringElement("customDescription", ""); + public static final MetadataTypeDefinition scope = new StringElement("customScope", ""); + public static final MetadataTypeDefinition name = new StringElement("elementname", "") { + @Override + public String getValue(BaseElement element) { + String defaultValue = + element instanceof FlowElement ? + ((FlowElement) element).getName() + : this.getDefaultValue(); + + return getStringValue(element).orElse(defaultValue); + } + }; + public static final MetadataTypeDefinition caseIdPrefix = new StringElement("customCaseIdPrefix", ""); + public static final MetadataTypeDefinition caseRole = new StringElement("customCaseRoles", ""); + public static final MetadataTypeDefinition slaDueDate = new StringElement("customSLADueDate", ""); + public static final GlobalVariablesElement globalVariables = new GlobalVariablesElement("customGlobalVariables"); + public static final MetadataTypeDefinition isCase = new BooleanElement("case", Boolean.FALSE); + public static final MetadataTypeDefinition customActivationCondition = new StringElement("customActivationCondition", ""); + public static final MetadataTypeDefinition abortParent = new BooleanElement("customAbortParent", true); + + private final ElementDefinition elementDefinition; + private final BaseElement element; + + public CustomElement(ElementDefinition elementDefinition, BaseElement element) { + this.elementDefinition = elementDefinition; + this.element = element; + } + + public T get() { + return elementDefinition.getValue(element); + } + + public void set(T value) { + if (value != null && !value.equals(elementDefinition.getDefaultValue())) { + elementDefinition.setValue(element, value); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomInput.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomInput.java new file mode 100644 index 00000000000..d86990785d1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomInput.java @@ -0,0 +1,156 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import java.util.List; + +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Task; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Ids; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; + +public class CustomInput { + + public static final CustomInputDefinition taskName = new StringInput("TaskName", "Task"); + public static final CustomInputDefinition priority = new StringInput("Priority", ""); + public static final CustomInputDefinition subject = new StringInput("Comment", ""); + public static final CustomInputDefinition description = new StringInput("Description", ""); + public static final CustomInputDefinition createdBy = new StringInput("CreatedBy", ""); + public static final CustomInputDefinition groupId = new StringInput("GroupId", ""); + public static final CustomInputDefinition skippable = new BooleanInput("Skippable", false); + public static final CustomInputDefinition content = new StringInput("Content", ""); + public static final CustomInputDefinition namespace = new StringInput("namespace", "java.lang.String", ""); + public static final CustomInputDefinition dmnModelName = new StringInput("model", "java.lang.String", ""); + public static final CustomInputDefinition decisionName = new StringInput("decision", "java.lang.String", ""); + public static final CustomInputDefinition notStartedReassign = new StringInput("NotStartedReassign", ""); + public static final CustomInputDefinition notCompletedReassign = new StringInput("NotCompletedReassign", ""); + public static final CustomInputDefinition notStartedNotify = new StringInput("NotStartedNotify", ""); + public static final CustomInputDefinition notCompletedNotify = new StringInput("NotCompletedNotify", ""); + + private final CustomInputDefinition inputDefinition; + private final Task element; + private final ItemDefinition typeDef; + + public CustomInput(CustomInputDefinition inputDefinition, Task element) { + this.inputDefinition = inputDefinition; + this.element = element; + this.typeDef = typedefInput(inputDefinition.name(), inputDefinition.type()); + } + + public ItemDefinition typeDef() { + return typeDef; + } + + public T get() { + return inputDefinition.getValue(element); + } + + public void set(T value) { + setStringValue(String.valueOf(value)); + } + + private void setStringValue(String value) { + if (value == null || value.isEmpty()) { + return; + } + DataInputAssociation input = input(value); + DataInput targetRef = (DataInput) input.getTargetRef(); + getIoSpecification(element).getDataInputs().add(targetRef); + getIoSpecification(element).getInputSets().get(0).getDataInputRefs().add(targetRef); + element.getDataInputAssociations().add(input); + } + + private InputOutputSpecification getIoSpecification(Task element) { + InputOutputSpecification ioSpecification = element.getIoSpecification(); + if (ioSpecification == null) { + ioSpecification = bpmn2.createInputOutputSpecification(); + element.setIoSpecification(ioSpecification); + } + List inputSets = ioSpecification.getInputSets(); + if (inputSets.isEmpty()) { + inputSets.add(bpmn2.createInputSet()); + } + return ioSpecification; + } + + private DataInputAssociation input(Object value) { + // first we declare the type of this assignment + +// // then we declare the input that will provide +// // the value that we assign to `source` +// // e.g. myInput + DataInput target = readInputFrom(inputDefinition.name(), typeDef); + + Assignment assignment = assignment(value.toString(), target.getId()); + + // then we create the actual association between the two + // e.g. foo := myInput (or, to put it differently, myInput -> foo) + DataInputAssociation association = + associationOf(assignment, target); + + return association; + } + + private DataInput readInputFrom(String targetName, ItemDefinition typeDef) { + DataInput dataInput = bpmn2.createDataInput(); + dataInput.setName(targetName); + // the id is an encoding of the node id + the name of the input + dataInput.setId(Ids.dataInput(element.getId(), targetName)); + dataInput.setItemSubjectRef(typeDef); + CustomAttribute.dtype.of(dataInput).set(typeDef.getStructureRef()); + return dataInput; + } + + private Assignment assignment(String from, String to) { + Assignment assignment = bpmn2.createAssignment(); + FormalExpression fromExpr = bpmn2.createFormalExpression(); + FormalExpressionBodyHandler.of(fromExpr).setBody(asCData(from)); + assignment.setFrom(fromExpr); + FormalExpression toExpr = bpmn2.createFormalExpression(); + FormalExpressionBodyHandler.of(toExpr).setBody(asCData(to)); + assignment.setTo(toExpr); + return assignment; + } + + private DataInputAssociation associationOf(Assignment assignment, DataInput dataInput) { + DataInputAssociation dataInputAssociation = + bpmn2.createDataInputAssociation(); + + dataInputAssociation.getAssignment() + .add(assignment); + + dataInputAssociation + .setTargetRef(dataInput); + return dataInputAssociation; + } + + private ItemDefinition typedefInput(String name, String type) { + ItemDefinition typeDef = bpmn2.createItemDefinition(); + typeDef.setId(Ids.dataInputItem(element.getId(), name)); + typeDef.setStructureRef(type); + return typeDef; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomInputDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomInputDefinition.java new file mode 100644 index 00000000000..2314aedd883 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomInputDefinition.java @@ -0,0 +1,100 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import java.util.Optional; + +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.Task; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; + +public abstract class CustomInputDefinition { + + protected final T defaultValue; + private final String name; + private final String type; + + public CustomInputDefinition(String name, String type, T defaultValue) { + this.name = name; + this.type = type; + this.defaultValue = defaultValue; + } + + private static Object evaluate(Assignment assignment) { + FormalExpression expr = (FormalExpression) assignment.getFrom(); + return FormalExpressionBodyHandler.of(expr).getBody(); + } + + public String name() { + return name; + } + + public String type() { + return type; + } + + public abstract T getValue(Task element); + + Optional getStringValue(Task element) { + for (DataInputAssociation din : element.getDataInputAssociations()) { + DataInput targetRef = (DataInput) (din.getTargetRef()); + if (targetRef.getName().equalsIgnoreCase(name) && !din.getAssignment().isEmpty()) { + Assignment assignment = din.getAssignment().get(0); + return Optional.of(evaluate(assignment).toString()); + } + } + return Optional.empty(); + } + + public CustomInput of(Task element) { + return new CustomInput<>(this, element); + } +} + +class BooleanInput extends CustomInputDefinition { + + BooleanInput(String name, Boolean defaultValue) { + super(name, "Object", defaultValue); + } + + @Override + public Boolean getValue(Task element) { + return getStringValue(element) + .map(Boolean::parseBoolean) + .orElse(defaultValue); + } +} + +class StringInput extends CustomInputDefinition { + + StringInput(String name, String type, String defaultValue) { + super(name, type, defaultValue); + } + + StringInput(String name, String defaultValue) { + this(name, "Object", defaultValue); + } + + @Override + public String getValue(Task element) { + return getStringValue(element) + .orElse(defaultValue); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/DeclarationList.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/DeclarationList.java new file mode 100644 index 00000000000..57b35d5946c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/DeclarationList.java @@ -0,0 +1,61 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.stream.Collectors; + +public class DeclarationList { + + private final List declarations; + + public DeclarationList() { + this.declarations = Collections.emptyList(); + } + + public DeclarationList(List declarations) { + this.declarations = declarations; + } + + public static DeclarationList fromString(String encoded) { + return new DeclarationList( + Arrays.stream(encoded.split(",")) + .filter(s -> !s.isEmpty()) // "" makes no sense + .map(VariableDeclaration::fromString) + .collect(Collectors.toList())); + } + + public VariableDeclaration lookup(String identifier) { + return declarations.stream().filter(d -> identifier.equals(d.getIdentifier())) + .findFirst().orElseThrow(() -> new NoSuchElementException("Cannot find binding for identifier: " + identifier)); + } + + public Collection getDeclarations() { + return declarations; + } + + @Override + public String toString() { + return declarations.stream() + .map(VariableDeclaration::toString) + .collect(Collectors.joining(",")); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/InitializedVariable.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/InitializedVariable.java new file mode 100644 index 00000000000..4a976d193eb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/InitializedVariable.java @@ -0,0 +1,297 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import com.google.gwt.http.client.URL; +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Property; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Ids; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.VariableScope; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; + +public abstract class InitializedVariable { + + private final String identifier; + private final String type; + private ItemDefinition itemDefinition; + + public InitializedVariable(String parentId, VariableDeclaration varDecl) { + this.identifier = varDecl.getIdentifier(); + this.type = varDecl.getType(); + this.itemDefinition = bpmn2.createItemDefinition(); + itemDefinition.setId(Ids.item(parentId)); + itemDefinition.setStructureRef(getType()); + } + + public static InitializedInputVariable inputOf( + String parentId, + VariableScope variableScope, + VariableDeclaration varDecl, + AssociationDeclaration associationDeclaration) { + + if (associationDeclaration == null) { + return new InputEmpty(parentId, varDecl); + } + AssociationDeclaration.Type type = associationDeclaration.getType(); + switch (type) { + case FromTo: + if (associationDeclaration.getTarget() == null) { + return new InputEmpty(parentId, varDecl); + } else { + return new InputConstant(parentId, varDecl, associationDeclaration.getSource()); + } + case SourceTarget: + return new InputVariableReference(parentId, variableScope, varDecl, associationDeclaration.getSource()); + default: + throw new IllegalArgumentException("Unknown type " + type); + } + } + + public static InitializedOutputVariable outputOf( + String parentId, + VariableScope variableScope, + VariableDeclaration varDecl, + AssociationDeclaration associationDeclaration) { + + if (associationDeclaration == null) { + return new OutputEmpty(parentId, varDecl); + } + AssociationDeclaration.Type type = associationDeclaration.getType(); + switch (type) { + case FromTo: + if (associationDeclaration.getTarget() == null) { + return new OutputEmpty(parentId, varDecl); + } else { + throw new IllegalArgumentException("Cannot assign constant to output variable"); + } + case SourceTarget: + return new OutputVariableReference(parentId, variableScope, varDecl, associationDeclaration.getTarget()); + default: + throw new IllegalArgumentException("Unknown type " + type); + } + } + + public String getIdentifier() { + return identifier; + } + + public String getType() { + return type; + } + + public ItemDefinition getItemDefinition() { + return itemDefinition; + } + + public static abstract class InitializedInputVariable extends InitializedVariable { + + private final DataInput dataInput; + + public InitializedInputVariable(String parentId, VariableDeclaration varDecl) { + super(parentId, varDecl); + getItemDefinition().setId(Ids.dataInputItem(parentId, varDecl.getIdentifier())); + this.dataInput = dataInputOf( + parentId, + varDecl.getIdentifier(), + varDecl.getTypedIdentifier().getName(), + getItemDefinition()); + } + + public DataInput getDataInput() { + return dataInput; + } + + public abstract DataInputAssociation getDataInputAssociation(); + } + + public static abstract class InitializedOutputVariable extends InitializedVariable { + + private final DataOutput dataOutput; + + public InitializedOutputVariable(String parentId, VariableDeclaration varDecl) { + super(parentId, varDecl); + getItemDefinition().setId(Ids.dataOutputItem(parentId, varDecl.getIdentifier())); + this.dataOutput = dataOutputOf( + parentId, + varDecl.getIdentifier(), + varDecl.getTypedIdentifier().getName(), + getItemDefinition()); + } + + public DataOutput getDataOutput() { + return dataOutput; + } + + public abstract DataOutputAssociation getDataOutputAssociation(); + } + + public static class InputVariableReference extends InitializedInputVariable { + + private final String sourceVariable; + private final VariableScope scope; + + public InputVariableReference(String parentId, VariableScope variableScope, VariableDeclaration varDecl, String sourceVariable) { + super(parentId, varDecl); + this.scope = variableScope; + this.sourceVariable = sourceVariable; + } + + public DataInputAssociation getDataInputAssociation() { + DataInputAssociation dataInputAssociation = bpmn2.createDataInputAssociation(); + return scope.lookup(sourceVariable) + .map(variable -> dataInputAssociation.getSourceRef().add(variable.getTypedIdentifier())) + .map(added -> { + dataInputAssociation.setTargetRef(getDataInput()); + return added; + }) + .map(added -> dataInputAssociation) + .orElse(null); + } + } + + public static class OutputVariableReference extends InitializedOutputVariable { + + private final DataOutput dataOutput; + private final String targetVariable; + private final VariableScope scope; + + public OutputVariableReference(String parentId, VariableScope scope, VariableDeclaration varDecl, String targetVariable) { + super(parentId, varDecl); + this.scope = scope; + this.targetVariable = targetVariable; + this.dataOutput = dataOutputOf( + parentId, + varDecl.getIdentifier(), + varDecl.getTypedIdentifier().getName(), + getItemDefinition()); + } + + public DataOutput getDataOutput() { + return dataOutput; + } + + public DataOutputAssociation getDataOutputAssociation() { + return scope.lookup(targetVariable) + .map(variable -> associationOf(variable.getTypedIdentifier(), dataOutput)) + .orElse(null); + } + } + + public static class InputEmpty extends InitializedInputVariable { + + public InputEmpty(String parentId, VariableDeclaration varDecl) { + super(parentId, varDecl); + } + + @Override + public DataInputAssociation getDataInputAssociation() { + return null; + } + } + + public static class InputConstant extends InitializedInputVariable { + + final String expression; + + public InputConstant(String parentId, VariableDeclaration varDecl, String expression) { + super(parentId, varDecl); + this.expression = expression; + } + + public DataInputAssociation getDataInputAssociation() { + DataInputAssociation dataInputAssociation = + bpmn2.createDataInputAssociation(); + + Assignment assignment = bpmn2.createAssignment(); + String id = getDataInput().getId(); + + FormalExpression toExpr = bpmn2.createFormalExpression(); + FormalExpressionBodyHandler.of(toExpr).setBody(id); + assignment.setTo(toExpr); + + FormalExpression fromExpr = bpmn2.createFormalExpression(); + // this should be handled **outside** the marshallers! + String decodedExpression = decode(expression); + String cdataExpression = asCData(decodedExpression); + FormalExpressionBodyHandler.of(fromExpr).setBody(cdataExpression); + assignment.setFrom(fromExpr); + + dataInputAssociation + .getAssignment().add(assignment); + + dataInputAssociation + .setTargetRef(getDataInput()); + return dataInputAssociation; + } + + private String decode(String text) { + return URL.decode(text); + } + } + + public static class OutputEmpty extends InitializedOutputVariable { + + public OutputEmpty(String parentId, VariableDeclaration varDecl) { + super(parentId, varDecl); + } + + @Override + public DataOutputAssociation getDataOutputAssociation() { + return null; + } + } + + private static DataInput dataInputOf(String parentId, String identifier, String name, ItemDefinition itemDefinition) { + DataInput dataInput = bpmn2.createDataInput(); + dataInput.setId(Ids.dataInput(parentId, identifier)); + dataInput.setName(name); + dataInput.setItemSubjectRef(itemDefinition); + CustomAttribute.dtype.of(dataInput).set(itemDefinition.getStructureRef()); + return dataInput; + } + + private static DataOutput dataOutputOf(String parentId, String identifier, String name, ItemDefinition itemDefinition) { + DataOutput dataOutput = bpmn2.createDataOutput(); + dataOutput.setId(Ids.dataOutput(parentId, identifier)); + dataOutput.setName(name); + dataOutput.setItemSubjectRef(itemDefinition); + CustomAttribute.dtype.of(dataOutput).set(itemDefinition.getStructureRef()); + return dataOutput; + } + + private static DataOutputAssociation associationOf(Property source, DataOutput dataOutput) { + DataOutputAssociation dataOutputAssociation = + bpmn2.createDataOutputAssociation(); + + dataOutputAssociation + .getSourceRef() + .add(dataOutput); + + dataOutputAssociation + .setTargetRef(source); + return dataOutputAssociation; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/ParsedAssignmentsInfo.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/ParsedAssignmentsInfo.java new file mode 100644 index 00000000000..9928ade3161 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/ParsedAssignmentsInfo.java @@ -0,0 +1,226 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.InitializedVariable.InitializedInputVariable; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.InitializedVariable.InitializedOutputVariable; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.VariableScope; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; + +/** + * Parses and generate the AssignmentsInfo string + *

+ * AssignmentsInfo represents variables, their types, and their assignments + * in a Task. + *

+ * It has historically been represented through a delimited String. + * The format of such a String follows the following EBNF: + * + *

+ * AssignmentInfoString ::= InputDeclarations ‘|’ OutputDeclarations ‘|’ Assignments
+ * InputDeclarations ::= (Declaration (‘,’ Declaration)*)?
+ * OutputDeclarations ::= (Declaration (‘,’ Declaration)*)?
+ * Declaration ::= ( identifier ( ‘:’ type )? )
+ * Assignments ::= (Assignment (‘,’ Assignment)* )?;
+ * Assignment ::= InputAssignment | OutputAssignment;
+ * InputAssignment ::= ‘[din]’ identifier ‘->’ identifier;
+ * OutputAssignment ::= ‘[dout]’ identifier ‘->’ identifier;
+ *
+ * 
+ * Where identifier is a valid identifier, and type is a valid identifier + * representing a data type. + * Semantically, the identifiers that has been declared in an InputDeclaration + * or an OutputDeclaration, or in a ProcessVariable that contains this Task + *

+ *

+ * The input String follows the following rules: + * + *

+ * |      | in | inSet | out | outSet | assignments |
+ * +------+----+-------+-----+--------+-------------+
+ * |Catch |    |       |  x  |        |      x      |
+ * |Throw | x  |       |     |        |      x      |
+ * |Other |    |  x    |     |  x     |      x      |
+ * +------+----+-------+-----+--------+-------------+
+ * 
+ *

+ * Where Other are CallActivity, Task, SubProcess. + *

+ * The distinction between input/inputSet, + * and output/outputSet is really not necessary + * because we just need to know what are the inputs + * and what are the outputs. + *

+ * Thus, we can just use one field for inputs, and one field for outputs. + */ +public class ParsedAssignmentsInfo { + + private final DeclarationList inputs; + private final DeclarationList outputs; + private final AssociationList associations; + private final boolean alternativeEncoding; + + public ParsedAssignmentsInfo(DeclarationList inputs, DeclarationList outputs, AssociationList associations, boolean alternativeEncoding) { + this.inputs = inputs; + this.outputs = outputs; + this.associations = associations; + this.alternativeEncoding = alternativeEncoding; + } + + public static ParsedAssignmentsInfo of(AssignmentsInfo assignmentsInfo) { + return fromString(assignmentsInfo.getValue()); + } + + public static ParsedAssignmentsInfo fromString(String encoded) { + DeclarationList inputs = new DeclarationList(); + DeclarationList outputs = new DeclarationList(); + AssociationList associations = new AssociationList(); + + if (encoded.isEmpty()) { + return new ParsedAssignmentsInfo( + inputs, + outputs, + associations, + false + ); + } + + String[] split = encoded.split("\\|", -1 /* preserve empty fields */); + if (split.length == 0) { + return new ParsedAssignmentsInfo( + inputs, + outputs, + associations, + false + ); + } + + if (split.length < 5) { + throw new IllegalArgumentException(encoded); + } + + boolean alternativeEncoding = false; + String in = split[0]; + String out = split[2]; + String assoc = split[4]; + + if (in.isEmpty() && out.isEmpty()) { + if (!split[1].isEmpty() || !split[3].isEmpty()) { + alternativeEncoding = true; + in = split[1]; + out = split[3]; + } + } + + DeclarationList inputList = DeclarationList.fromString(in); + DeclarationList outputList = DeclarationList.fromString(out); + AssociationList associationList = AssociationList.fromString(assoc); + return new ParsedAssignmentsInfo( + inputList, + outputList, + associationList, + alternativeEncoding); + } + + private static String encodeStringRepresentation( + DeclarationList inputs, + DeclarationList outputs, + AssociationList associations, + boolean alternativeEncoding) { + if (alternativeEncoding) { + return nonCanonicalEncoding(inputs, outputs, associations); + } else { + return canonicalEncoding(inputs, outputs, associations); + } + } + + private static String canonicalEncoding(DeclarationList inputs, DeclarationList outputs, AssociationList associations) { + return Stream.of( + inputs.toString(), + "", + outputs.toString(), + "", + associations.toString()) + .collect(Collectors.joining("|")); + } + + private static String nonCanonicalEncoding(DeclarationList inputs, DeclarationList outputs, AssociationList associations) { + return Stream.of("", + inputs.toString(), + "", + outputs.toString(), + associations.toString()) + .collect(Collectors.joining("|")); + } + + public DeclarationList getInputs() { + return inputs; + } + + public DeclarationList getOutputs() { + return outputs; + } + + public AssociationList getAssociations() { + return associations; + } + + public List createInitializedInputVariables(String parentId, VariableScope variableScope) { + return getInputs() + .getDeclarations() + .stream() + .map(varDecl -> InitializedVariable.inputOf( + parentId, + variableScope, + varDecl, + associations.lookupInput(varDecl.getTypedIdentifier().getName()))) + .collect(Collectors.toList()); + } + + public List createInitializedOutputVariables(String parentId, VariableScope variableScope) { + return getOutputs() + .getDeclarations() + .stream() + .map(varDecl -> InitializedVariable.outputOf( + parentId, + variableScope, + varDecl, + associations.lookupOutput(varDecl.getTypedIdentifier().getName()))) + .collect(Collectors.toList()); + } + + public boolean isEmpty() { + return inputs.getDeclarations().isEmpty() && outputs.getDeclarations().isEmpty() && + associations.getInputs().isEmpty() && associations.getOutputs().isEmpty(); + } + + @Override + public String toString() { + if (isEmpty()) { + return ""; + } + return encodeStringRepresentation( + inputs, + outputs, + associations, + alternativeEncoding); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/ParsedNotificationsInfos.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/ParsedNotificationsInfos.java new file mode 100644 index 00000000000..95344508042 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/ParsedNotificationsInfos.java @@ -0,0 +1,136 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations.AssociationType; +import org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationTypeListValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue; + +public class ParsedNotificationsInfos { + + NotificationValue notification = new NotificationValue(); + + private ParsedNotificationsInfos(String type, String body) { + notification.setType(type); + + if (body != null && !body.isEmpty()) { + String temp; + if (body.contains("@")) { + String[] parts = body.split("@"); + parsePeriod(notification, parts[1]); + temp = parts[0]; + } else { + temp = body; + } + temp = replaceBracket(temp); + + getFrom(notification, temp); + getUsers(notification, temp); + getGroups(notification, temp); + getReplyTo(notification, temp); + getSubject(notification, temp); + getBody(notification, temp); + } + } + + private static void getFrom(NotificationValue notification, String body) { + notification.setFrom(parseElement(body, "from", 0)); + } + + private static String parseElement(String group, String type, int position) { + if (group.contains(type)) { + String result = group + .split("\\|")[position] + .replace(type + ":", ""); + if (!result.isEmpty()) { + return result; + } + } + return null; + } + + private static void getUsers(NotificationValue notification, String body) { + notification.setUsers(parseGroup(body, "tousers", 1)); + } + + private static List parseGroup(String group, String type, int position) { + if (group.contains(type)) { + String result = group + .split("\\|")[position] + .replace(type + ":", ""); + if (!result.isEmpty()) { + return Arrays.stream(result.split(",")).collect(Collectors.toList()); + } + } + return new ArrayList<>(); + } + + private static void getGroups(NotificationValue notification, String body) { + notification.setGroups(parseGroup(body, "togroups", 2)); + } + + private static void getReplyTo(NotificationValue notification, String body) { + notification.setReplyTo(parseElement(body, "replyTo", 3)); + } + + private static void getSubject(NotificationValue notification, String body) { + notification.setSubject(parseElement(body, "subject", 4)); + } + + private static void getBody(NotificationValue notification, String body) { + notification.setBody(parseElement(body, "body", 5)); + } + + private static void parsePeriod(NotificationValue notification, String part) { + notification.setExpiresAt(replaceBracket(part)); + } + + private static String replaceBracket(String original) { + return original.replaceFirst("\\[", "").replace("]", ""); + } + + public static NotificationValue of(String type, String body) { + return new ParsedNotificationsInfos(type, body).notification; + } + + public static String ofCDATA(NotificationTypeListValue values, AssociationType type) { + return new ParsedNotificationsInfos.CDATA(values, type).get(); + } + + private static class CDATA { + + private List notifications; + + private AssociationType type; + + CDATA(NotificationTypeListValue value, AssociationType type) { + this.type = type; + notifications = value.getValues(); + } + + String get() { + return notifications.stream().filter(m -> m.getType().equals(type.getName())) + .map(m -> m.toCDATAFormat()) + .collect(Collectors.joining("^")); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/ParsedReassignmentsInfos.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/ParsedReassignmentsInfos.java new file mode 100644 index 00000000000..6a260c5540f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/ParsedReassignmentsInfos.java @@ -0,0 +1,104 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations.AssociationType; +import org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentTypeListValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue; + +public class ParsedReassignmentsInfos { + + ReassignmentValue reassignment = new ReassignmentValue(); + + public static ReassignmentValue of(String type, String body) { + return new ParsedReassignmentsInfos(type, body).reassignment; + } + + public static String ofCDATA(ReassignmentTypeListValue value, AssociationType type) { + return new CDATA(value, type).get(); + } + + private ParsedReassignmentsInfos(String type, String body) { + reassignment.setType(type); + + if (body != null && !body.isEmpty()) { + String usersAndGroups; + if (body.contains("@")) { + String[] parts = body.split("@"); + parsePeriod(reassignment, parts[1]); + usersAndGroups = parts[0]; + } else { + usersAndGroups = body; + } + usersAndGroups = replaceBracket(usersAndGroups); + + getUsers(reassignment, usersAndGroups); + getGroups(reassignment, usersAndGroups); + } + } + + private static void getUsers(ReassignmentValue reassignment, String usersAndGroups) { + reassignment.setUsers(parseGroup(usersAndGroups, "users", 0)); + } + + private static void getGroups(ReassignmentValue reassignment, String usersAndGroups) { + reassignment.setGroups(parseGroup(usersAndGroups, "groups", 1)); + } + + private static List parseGroup(String group, String type, int position) { + if (group.contains(type)) { + String result = group + .split("\\|")[position] + .replace(type + ":", ""); + if (!result.isEmpty()) { + return Arrays.stream(result.split(",")).collect(Collectors.toList()); + } + } + return new ArrayList<>(); + } + + private static void parsePeriod(ReassignmentValue reassignment, String part) { + reassignment.setDuration(replaceBracket(part)); + } + + private static String replaceBracket(String original) { + return original.replaceFirst("\\[", "").replace("]", ""); + } + + private static class CDATA { + + private List reassignments; + + private AssociationType type; + + CDATA(ReassignmentTypeListValue value, AssociationType type) { + this.type = type; + reassignments = value.getValues(); + } + + String get() { + return reassignments.stream().filter(m -> m.getType().equals(type.getName())) + .map(m -> m.toCDATAFormat()) + .collect(Collectors.joining("^")); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/VariableDeclaration.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/VariableDeclaration.java new file mode 100644 index 00000000000..a152ff7298f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/VariableDeclaration.java @@ -0,0 +1,135 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import java.util.Objects; + +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Property; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Ids; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class VariableDeclaration { + + private final ItemDefinition typeDeclaration; + private final Property typedIdentifier; + private String identifier; + private String type; + private String kpi; + + public VariableDeclaration(String identifier, String type) { + this(identifier, type, ""); + } + + public VariableDeclaration(String identifier, String type, String kpi) { + this.setIdentifier(identifier); + this.type = type; + + this.typeDeclaration = bpmn2.createItemDefinition(); + this.typeDeclaration.setId(Ids.item(this.getIdentifier())); + this.typeDeclaration.setStructureRef(type); + + this.typedIdentifier = bpmn2.createProperty(); + this.typedIdentifier.setId(Ids.typedIdentifier("GLOBAL", this.getIdentifier())); + this.typedIdentifier.setName(identifier); + this.typedIdentifier.setItemSubjectRef(typeDeclaration); + this.kpi = kpi; + } + + public static VariableDeclaration fromString(String encoded) { + String[] split = encoded.split(":"); + String identifier = split[0]; + String type = (split.length == 2 || split.length == 3) ? split[1] : ""; + if (identifier.isEmpty()) { + throw new IllegalArgumentException("Variable identifier cannot be empty. Given: '" + encoded + "'"); + } + String kpi = ""; + + if (split.length == 3) { + kpi = split[2]; + } + + return new VariableDeclaration(identifier, type, kpi); + } + + public String getKpi() { + return kpi; + } + + public void setKpi(String kpi) { + this.kpi = kpi; + } + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + String safeIdentifier = identifier.replaceAll(" ", "-"); + this.identifier = safeIdentifier; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public ItemDefinition getTypeDeclaration() { + return typeDeclaration; + } + + public Property getTypedIdentifier() { + return typedIdentifier; + } + + @Override + public String toString() { + String kpiString = ""; + if (kpi != null && !kpi.isEmpty()) { + kpiString = ":" + kpi; + } + if (type == null || type.isEmpty()) { + return typedIdentifier.getName() + kpiString; + } else { + return typedIdentifier.getName() + ":" + type + kpiString; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VariableDeclaration that = (VariableDeclaration) o; + return Objects.equals(identifier, that.identifier) && + Objects.equals(type, that.type) && + Objects.equals(kpi, that.kpi); + } + + @Override + public int hashCode() { + return Objects.hash(identifier, type, kpi); + } +} + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/BooleanElement.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/BooleanElement.java new file mode 100644 index 00000000000..c627ec7169b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/BooleanElement.java @@ -0,0 +1,39 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements; + +import org.eclipse.bpmn2.BaseElement; + +public class BooleanElement extends MetadataTypeDefinition { + + public BooleanElement(String name, Boolean defaultValue) { + super(name, defaultValue); + } + + @Override + public Boolean getValue(BaseElement element) { + return getStringValue(element) + .map(this::stripCData) + .map(Boolean::parseBoolean) + .orElse(getDefaultValue()); + } + + @Override + public void setValue(BaseElement element, Boolean value) { + setStringValue(element, String.valueOf(value)); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/ElementDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/ElementDefinition.java new file mode 100644 index 00000000000..c7855fe6865 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/ElementDefinition.java @@ -0,0 +1,99 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements; + +import java.util.List; +import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Stream; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.Bpmn2Factory; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.jboss.drools.DroolsPackage; +import org.jboss.drools.MetaDataType; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; + +public abstract class ElementDefinition { + + private final T defaultValue; + private final String name; + + public ElementDefinition(String name, T defaultValue) { + this.name = name; + this.defaultValue = defaultValue; + } + + public String name() { + return name; + } + + public final T getDefaultValue() { + return defaultValue; + } + + public abstract T getValue(BaseElement element); + + public abstract void setValue(BaseElement element, T value); + + protected Optional getStringValue(BaseElement element) { + return Optional.ofNullable(getMetaDataValue(element.getExtensionValues(), name)); + } + + protected abstract void setStringValue(BaseElement element, String value); + + protected FeatureMap getExtensionElements(BaseElement element) { + if (element.getExtensionValues() == null || element.getExtensionValues().isEmpty()) { + ExtensionAttributeValue eav = Bpmn2Factory.eINSTANCE.createExtensionAttributeValue(); + element.getExtensionValues().add(eav); + return eav.getValue(); + } else { + return element.getExtensionValues().get(0).getValue(); + } + } + + public CustomElement of(BaseElement element) { + return new CustomElement<>(this, element); + } + + @SuppressWarnings("unchecked") + private static String getMetaDataValue(final List extensionValues, + final String metaDataName) { + if (extensionValues != null) { + return extensionValues.stream() + .map(ExtensionAttributeValue::getValue) + .flatMap((Function>) extensionElements -> { + List o = (List) extensionElements.get(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, true); + return o.stream(); + }) + .filter(metaType -> isMetaType((MetaDataType) metaType, metaDataName)) + .findFirst() + .map(m -> ((MetaDataType) m).getMetaValue()) + .orElse(null); + } + return null; + } + + private static boolean isMetaType(MetaDataType metaType, + final String metaDataName) { + return metaType.getName() != null && + metaType.getName().equals(metaDataName) && + metaType.getMetaValue() != null && + metaType.getMetaValue().length() > 0; + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/GlobalVariablesElement.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/GlobalVariablesElement.java new file mode 100644 index 00000000000..4f9fa57abb7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/GlobalVariablesElement.java @@ -0,0 +1,97 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements; + +import java.util.Collection; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.impl.EStructuralFeatureImpl; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.jboss.drools.DroolsFactory; +import org.jboss.drools.GlobalType; + +import static org.jboss.drools.DroolsPackage.Literals.DOCUMENT_ROOT__GLOBAL; + +public class GlobalVariablesElement extends ElementDefinition { + + public GlobalVariablesElement(String name) { + super(name, ""); + } + + @Override + public String getValue(BaseElement element) { + return getStringValue(element) + .orElse(getDefaultValue()); + } + + @Override + public void setValue(BaseElement element, String value) { + setStringValue(element, value); + } + + @Override + protected void setStringValue(BaseElement element, String value) { + Stream.of(value.split(",")) + .map(this::extensionOf) + .forEach(getExtensionElements(element)::add); + } + + @Override + protected Optional getStringValue(BaseElement element) { + List extValues = element.getExtensionValues(); + + List extElementsList = extValues.stream() + .map(extAttrVal -> extAttrVal.getValue()) + .collect(Collectors.toList()); + + List globalExtensions = extElementsList.stream() + .map(extAttrVal -> (List) extAttrVal.get(DOCUMENT_ROOT__GLOBAL, true)) + .flatMap(Collection::stream) + .collect(Collectors.toList()); + + String globalVariables = globalExtensions.stream() + .filter(globalType -> globalType.getIdentifier() != null && + globalType.getIdentifier().length() > 0 && + globalType.getType() != null && + globalType.getType().length() > 0) + .map(globalType -> globalType.getIdentifier() + ":" + globalType.getType()) + .collect(Collectors.joining(",")); + + return Optional.ofNullable(globalVariables); + } + + private FeatureMap.Entry extensionOf(String variable) { + return new EStructuralFeatureImpl.SimpleFeatureMapEntry( + (EStructuralFeature.Internal) DOCUMENT_ROOT__GLOBAL, + globalTypeDataOf(variable)); + } + + private GlobalType globalTypeDataOf(String variable) { + GlobalType globalType = DroolsFactory.eINSTANCE.createGlobalType(); + String[] properties = variable.split(":"); + globalType.setIdentifier(properties[0]); + globalType.setType(properties[1]); + + return globalType; + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/MetadataTypeDefinition.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/MetadataTypeDefinition.java new file mode 100644 index 00000000000..2108fa93e3d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/MetadataTypeDefinition.java @@ -0,0 +1,65 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.impl.EStructuralFeatureImpl; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.jboss.drools.DroolsFactory; +import org.jboss.drools.MetaDataType; + +import static org.jboss.drools.DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; + +public abstract class MetadataTypeDefinition extends ElementDefinition { + + public MetadataTypeDefinition(String name, T defaultValue) { + super(name, defaultValue); + } + + @Override + public abstract T getValue(BaseElement element); + + @Override + public abstract void setValue(BaseElement element, T value); + + @Override + protected void setStringValue(BaseElement element, String value) { + FeatureMap.Entry extension = extensionOf( + DOCUMENT_ROOT__META_DATA, metaDataOf(value)); + getExtensionElements(element).add(extension); + } + + private FeatureMap.Entry extensionOf(EReference eref, MetaDataType eleMetadata) { + return new EStructuralFeatureImpl.SimpleFeatureMapEntry((EStructuralFeature.Internal) eref, eleMetadata); + } + + private MetaDataType metaDataOf(String value) { + MetaDataType eleMetadata = DroolsFactory.eINSTANCE.createMetaDataType(); + eleMetadata.setName(this.name()); + eleMetadata.setMetaValue(asCData(value)); + return eleMetadata; + } + + public String stripCData(String s) { + String BEGIN_CDATA = ""; + return s.startsWith(BEGIN_CDATA) && s.endsWith(END_CDATA) ? s.substring(BEGIN_CDATA.length(), s.length() - END_CDATA.length()) : s; + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/StringElement.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/StringElement.java new file mode 100644 index 00000000000..a8078da6e3d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/StringElement.java @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements; + +import org.eclipse.bpmn2.BaseElement; + +public class StringElement extends MetadataTypeDefinition { + + public StringElement(String name, String defaultValue) { + super(name, defaultValue); + } + + @Override + public String getValue(BaseElement element) { + return getStringValue(element) + .orElse(getDefaultValue()); + } + + @Override + public void setValue(BaseElement element, String value) { + setStringValue(element, value); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/ConverterFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/ConverterFactory.java new file mode 100644 index 00000000000..f111e975ead --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/ConverterFactory.java @@ -0,0 +1,133 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.activities.ReusableSubprocessConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations.AssociationConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events.EndEventConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events.IntermediateCatchEventConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events.IntermediateThrowEventConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events.StartEventConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.gateways.GatewayConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.lanes.LaneConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.processes.RootProcessConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.processes.SubProcessConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.sequenceflows.SequenceFlowConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.tasks.TaskConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.textannotation.TextAnnotationConverter; + +public class ConverterFactory { + + protected final PropertyWriterFactory propertyWriterFactory; + protected final DefinitionsBuildingContext context; + private final TaskConverter taskConverter; + private final FlowElementConverter flowElementConverter; + private final StartEventConverter startEventConverter; + private final IntermediateCatchEventConverter intermediateCatchEventConverter; + private final IntermediateThrowEventConverter intermediateThrowEventConverter; + private final EndEventConverter endEventConverter; + private final LaneConverter laneConverter; + private final GatewayConverter gatewayConverter; + private final ReusableSubprocessConverter reusableSubprocessConverter; + private final EdgeConverter edgeConverter; + private final FlowElementPostConverter flowElementPostConverter; + private final TextAnnotationConverter textAnnotationConverter; + + public ConverterFactory(DefinitionsBuildingContext context, + PropertyWriterFactory propertyWriterFactory) { + this.context = context; + this.propertyWriterFactory = propertyWriterFactory; + + this.taskConverter = new TaskConverter(propertyWriterFactory); + this.startEventConverter = new StartEventConverter(propertyWriterFactory); + this.intermediateCatchEventConverter = new IntermediateCatchEventConverter(propertyWriterFactory); + this.intermediateThrowEventConverter = new IntermediateThrowEventConverter(propertyWriterFactory); + this.endEventConverter = new EndEventConverter(propertyWriterFactory); + this.laneConverter = new LaneConverter(propertyWriterFactory); + this.gatewayConverter = new GatewayConverter(propertyWriterFactory); + + this.flowElementConverter = new FlowElementConverter(this); + this.reusableSubprocessConverter = new ReusableSubprocessConverter(propertyWriterFactory); + this.edgeConverter = new EdgeConverter(this); + this.flowElementPostConverter = new FlowElementPostConverter(); + this.textAnnotationConverter = new TextAnnotationConverter(propertyWriterFactory); + } + + public TaskConverter taskConverter() { + return taskConverter; + } + + public FlowElementConverter viewDefinitionConverter() { + return flowElementConverter; + } + + public StartEventConverter startEventConverter() { + return startEventConverter; + } + + public IntermediateCatchEventConverter intermediateCatchEventConverter() { + return intermediateCatchEventConverter; + } + + public IntermediateThrowEventConverter intermediateThrowEventConverter() { + return intermediateThrowEventConverter; + } + + public EndEventConverter endEventConverter() { + return endEventConverter; + } + + public LaneConverter laneConverter() { + return laneConverter; + } + + public GatewayConverter gatewayConverter() { + return gatewayConverter; + } + + public ReusableSubprocessConverter reusableSubprocessConverter() { + return reusableSubprocessConverter; + } + + public RootProcessConverter processConverter() { + return new RootProcessConverter(context, propertyWriterFactory, this); + } + + public SubProcessConverter subProcessConverter() { + return new SubProcessConverter(context, propertyWriterFactory, this); + } + + public EdgeConverter edgeElementConverter() { + return edgeConverter; + } + + public SequenceFlowConverter sequenceFlowConverter() { + return new SequenceFlowConverter(propertyWriterFactory); + } + + public AssociationConverter associationFlowConverter() { + return new AssociationConverter(propertyWriterFactory); + } + + public FlowElementPostConverter flowElementPostConverter() { + return flowElementPostConverter; + } + + public TextAnnotationConverter textAnnotationConverter() { + return textAnnotationConverter; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/DefinitionsBuildingContext.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/DefinitionsBuildingContext.java new file mode 100644 index 00000000000..b87c68ecf35 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/DefinitionsBuildingContext.java @@ -0,0 +1,203 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; + +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.Lane; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Child; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Dock; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; +import org.kie.workbench.common.stunner.core.graph.util.GraphUtils; + +// +// the implementation for this class is in the package-private +// abstract class below. We are using type parameters to fake type aliases. +// Scroll down for details +// +public class DefinitionsBuildingContext + extends DefinitionsContextHelper< + /*EdgeT = */ + Edge, + Node, ?>>, + + /*NodeT = */ + Node, + Edge, + Node, ?>>> + > { + + // constructor uses raw Graph for convenience + + public DefinitionsBuildingContext( + Graph, + Edge, + Node, ?>>>> graph) { + super(graph); + } + + public DefinitionsBuildingContext( + Graph, + Edge, + Node, ?>>>> graph, + Class nodeType) { + super(graph, nodeType); + } + + public DefinitionsBuildingContext( + Node firstNode, + Map nodes) { + super(firstNode, nodes); + } +} + +// +// this is sort-of a hack: we don't have type aliases in Java +// so we use this abstract class to bind a type-parameter to this horribly long +// Node, Edge declarations (because Node, Edge are... mutually recursive... erm) +// so we declare EdgeT, NodeT to "extend" the type we want to alias +// then in the concrete instance we actually **bind** them to the exact type +// +abstract class DefinitionsContextHelper< + EdgeT extends + Edge, + Node, ?>>, + NodeT extends + Node, EdgeT> + > { + + private final Map nodes; + + private final Node firstNode; + + public DefinitionsContextHelper(Graph graph) { + this(graph, BPMNDiagramImpl.class); + } + + public DefinitionsContextHelper(Graph graph, + Class nodeType) { + this.firstNode = + GraphUtils.getFirstNode((Graph) graph, nodeType); + + this.nodes = + StreamSupport + .stream(graph.nodes().spliterator(), false) + .filter(n -> !firstNode.getUUID().equals(n.getUUID())) + .collect(Collectors.toMap(Node::getUUID, Function.identity())); + } + + public DefinitionsContextHelper( + Node firstNode, + Map nodes) { + this.firstNode = firstNode; + this.nodes = (Map) nodes; + } + + public Stream nodes() { + return nodes.values().stream(); + } + + public NodeT getNode(String id) { + return nodes.get(id); + } + + public Node firstNode() { + return firstNode; + } + + public Stream edges() { + return nodes() + .flatMap(e -> Stream.concat( + e.getInEdges().stream(), + e.getOutEdges().stream())) + .distinct() + .filter(e -> (isViewConnector(e))); + } + + public Stream dockEdges() { + return nodes() + .flatMap(e -> Stream.concat( + e.getInEdges().stream(), + e.getOutEdges().stream())) + .distinct() + .filter(e -> (isDock(e))); + } + + public Stream childEdges() { + return nodes() + .flatMap(e -> Stream.concat( + e.getInEdges().stream(), + e.getOutEdges().stream())) + .distinct() + .filter(e -> (isChild(e))); + } + + public Stream childNodes() { + return childEdges().map(edgeT -> (NodeT) (edgeT.getTargetNode())); + } + + public DefinitionsBuildingContext withRootNode(String nodeId) { + return new DefinitionsBuildingContext(getNode(nodeId), findEdgesBydId(nodeId)); + } + + public DefinitionsBuildingContext withRootNode(Node node) { + return new DefinitionsBuildingContext(node, findEdgesBydId(node.getUUID())); + } + + private Map findEdgesBydId(String nodeId) { + Map nodes = new HashMap<>(); + childEdges() + .filter(e -> e.getSourceNode().getUUID().equals(nodeId)) + .map(Edge::getTargetNode) + .forEach(n -> nodes.put(n.getUUID(), n)); // use forEach instead of collect to avoid issues with type inference + return nodes; + } + + private boolean isChild(EdgeT e) { + return e.getContent() instanceof Child; + } + + private boolean isDock(EdgeT e) { + return e.getContent() instanceof Dock; + } + + private boolean isViewConnector(EdgeT e) { + return e.getContent() instanceof ViewConnector; + } + + public Stream lanes() { + return nodes().filter(this::isLane); + } + + private boolean isLane(NodeT n) { + return n.getContent().getDefinition() instanceof Lane; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/DefinitionsConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/DefinitionsConverter.java new file mode 100644 index 00000000000..8020279b650 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/DefinitionsConverter.java @@ -0,0 +1,64 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner; + +import org.eclipse.bpmn2.Definitions; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.processes.RootProcessConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.DefinitionsPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.core.graph.Graph; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class DefinitionsConverter { + + private final ConverterFactory converterFactory; + private final PropertyWriterFactory propertyWriterFactory; + private final RootProcessConverter processConverter; + + public DefinitionsConverter(ConverterFactory converterFactory, PropertyWriterFactory propertyWriterFactory) { + this.propertyWriterFactory = propertyWriterFactory; + this.converterFactory = converterFactory; + this.processConverter = converterFactory.processConverter(); + } + + public DefinitionsConverter(Graph graph) { + this.propertyWriterFactory = new PropertyWriterFactory(); + this.converterFactory = new ConverterFactory(new DefinitionsBuildingContext(graph), propertyWriterFactory); + this.processConverter = this.converterFactory.processConverter(); + } + + public Definitions toDefinitions() { + Definitions definitions = bpmn2.createDefinitions(); + DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); + + ProcessPropertyWriter pp = + processConverter.convertProcess(); + + p.setExporter("jBPM Process Modeler"); + p.setExporterVersion("2.0"); + p.setProcess(pp.getProcess()); + p.setDiagram(pp.getBpmnDiagram()); + p.setRelationship(pp.getRelationship()); + p.addAllRootElements(pp.getItemDefinitions()); + p.addAllRootElements(pp.getRootElements()); + p.addAllRootElements(pp.getInterfaces()); + + return definitions; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/EdgeConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/EdgeConverter.java new file mode 100644 index 00000000000..5770df5cfb0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/EdgeConverter.java @@ -0,0 +1,45 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.Association; +import org.kie.workbench.common.stunner.bpmn.definition.SequenceFlow; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; + +public class EdgeConverter { + + private final ConverterFactory converterFactory; + + public EdgeConverter(ConverterFactory converterFactory) { + this.converterFactory = converterFactory; + } + + public Result toFlowElement(Edge edge, + ElementContainer process) { + if (edge.getContent() instanceof ViewConnector && ((ViewConnector) edge.getContent()).getDefinition() instanceof SequenceFlow) { + return converterFactory.sequenceFlowConverter().toFlowElement(edge, + process); + } else if (edge.getContent() instanceof ViewConnector && ((ViewConnector) edge.getContent()).getDefinition() instanceof Association) { + return converterFactory.associationFlowConverter().toFlowElement(edge, + process); + } + return Result.failure("Converter is not implemented for edge content type: " + edge.getContent()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/ElementContainer.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/ElementContainer.java new file mode 100644 index 00000000000..7e3e4693c1c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/ElementContainer.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner; + +import java.util.Collection; + +import org.eclipse.bpmn2.di.BPMNEdge; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.LanePropertyWriter; + +public interface ElementContainer { + + BasePropertyWriter getChildElement(String uuid); + + void addChildElement(BasePropertyWriter p); + + Collection getChildElements(); + + void addChildEdge(BPMNEdge edge); + + void addLaneSet(Collection lanes); +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/Factories.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/Factories.java new file mode 100644 index 00000000000..9bc422d4568 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/Factories.java @@ -0,0 +1,34 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner; + +import bpsim.BpsimFactory; +import org.eclipse.bpmn2.Bpmn2Factory; +import org.eclipse.bpmn2.di.BpmnDiFactory; +import org.eclipse.dd.dc.DcFactory; +import org.eclipse.emf.ecore.util.ExtendedMetaData; +import org.jboss.drools.DroolsFactory; + +public interface Factories { + + Bpmn2Factory bpmn2 = Bpmn2Factory.eINSTANCE; + BpsimFactory bpsim = BpsimFactory.eINSTANCE; + BpmnDiFactory di = BpmnDiFactory.eINSTANCE; + DcFactory dc = DcFactory.eINSTANCE; + ExtendedMetaData metaData = ExtendedMetaData.INSTANCE; + DroolsFactory droolsFactory = DroolsFactory.eINSTANCE; +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/FlowElementConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/FlowElementConverter.java new file mode 100644 index 00000000000..e7873d9fd2f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/FlowElementConverter.java @@ -0,0 +1,77 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.BaseCatchingIntermediateEvent; +import org.kie.workbench.common.stunner.bpmn.definition.BaseEndEvent; +import org.kie.workbench.common.stunner.bpmn.definition.BaseGateway; +import org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent; +import org.kie.workbench.common.stunner.bpmn.definition.BaseSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.BaseTask; +import org.kie.workbench.common.stunner.bpmn.definition.BaseThrowingIntermediateEvent; +import org.kie.workbench.common.stunner.bpmn.definition.Lane; +import org.kie.workbench.common.stunner.bpmn.definition.TextAnnotation; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils.cast; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils.resultIgnored; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils.resultNotSupported; + +public class FlowElementConverter { + + private final ConverterFactory converterFactory; + + public FlowElementConverter(ConverterFactory converterFactory) { + this.converterFactory = converterFactory; + } + + public Result toFlowElement(Node, ?> node) { + BPMNViewDefinition def = node.getContent().getDefinition(); + if (def instanceof BaseStartEvent) { + return Result.success(converterFactory.startEventConverter().toFlowElement(cast(node))); + } + if (def instanceof BaseCatchingIntermediateEvent) { + return Result.success(converterFactory.intermediateCatchEventConverter().toFlowElement(cast(node))); + } + if (def instanceof BaseThrowingIntermediateEvent) { + return Result.success(converterFactory.intermediateThrowEventConverter().toFlowElement(cast(node))); + } + if (def instanceof BaseEndEvent) { + return Result.success(converterFactory.endEventConverter().toFlowElement(cast(node))); + } + if (def instanceof BaseTask) { + return Result.success(converterFactory.taskConverter().toFlowElement(cast(node))); + } + if (def instanceof BaseGateway) { + return Result.success(converterFactory.gatewayConverter().toFlowElement(cast(node))); + } + if (def instanceof BaseReusableSubprocess) { + return Result.success(converterFactory.reusableSubprocessConverter().toFlowElement(cast(node))); + } + if (def instanceof TextAnnotation) { + return Result.success(converterFactory.textAnnotationConverter().toElement(cast(node))); + } + if (def instanceof BaseSubprocess || def instanceof Lane) { + return resultIgnored(def); + } + return resultNotSupported(def); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/FlowElementPostConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/FlowElementPostConverter.java new file mode 100644 index 00000000000..039ba2de93e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/FlowElementPostConverter.java @@ -0,0 +1,66 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events.EndCompensationEventPostConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events.IntermediateCompensationEventPostConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events.IntermediateThrowCompensationEventPostConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.processes.EventSubProcessPostConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.EndCompensationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class FlowElementPostConverter { + + private final Map, PostConverterProcessor> postConverters = new HashMap<>(); + + public FlowElementPostConverter() { + postConverters.put(IntermediateCompensationEvent.class, + new IntermediateCompensationEventPostConverter()); + postConverters.put(IntermediateCompensationEventThrowing.class, + new IntermediateThrowCompensationEventPostConverter()); + postConverters.put(EndCompensationEvent.class, + new EndCompensationEventPostConverter()); + postConverters.put(EventSubprocess.class, + new EventSubProcessPostConverter()); + } + + public void postConvert(ProcessPropertyWriter processWriter, + BasePropertyWriter nodeWriter, + Node, ?> node) { + Optional postConverter = getPostConverter(node); + if (postConverter.isPresent()) { + postConverter.get().process(processWriter, + nodeWriter, + node); + } + } + + private Optional getPostConverter(Node, ?> node) { + return Optional.ofNullable(postConverters.get(node.getContent().getDefinition().getClass())); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/Ids.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/Ids.java new file mode 100644 index 00000000000..4dfadb35206 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/Ids.java @@ -0,0 +1,64 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner; + +public class Ids { + + public static String fromString(String myString) { + return "_" + myString.hashCode(); + } + + public static String item(String itemId) { + return "_" + itemId + "Item"; + } + + public static String typedIdentifier(String parentScopeId, String identifier) { + return identifier; + } + + public static String dataInput(String parentId, String inputId) { + return parentId + "_" + inputId + "InputX"; + } + + public static String dataInputItem(String parentId, String inputId) { + return "_" + dataInput(parentId, inputId) + "Item"; + } + + public static String dataOutput(String parentId, String outputId) { + return parentId + "_" + outputId + "OutputX"; + } + + public static String dataOutputItem(String parentId, String outputId) { + return "_" + Ids.dataOutput(parentId, outputId) + "Item"; + } + + public static String bpmnShape(String parentId) { + return "shape_" + parentId; + } + + public static String bpmnEdge(String source, String target) { + return "edge_" + source + "_to_" + target; + } + + public static String multiInstanceItemType(String parentId, String id) { + return parentId + "_multiInstanceItemType_" + id; + } + + public static String messageItem(String name) { + return name + "Type"; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/PostConverterProcessor.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/PostConverterProcessor.java new file mode 100644 index 00000000000..9cedbfad18b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/PostConverterProcessor.java @@ -0,0 +1,41 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +/** + * Contract for a component that implements post conversion operations on a node. Ideally all conversion operations + * must be resolved within the converters, but there are some edge cases were a node needs a second pass after the full + * nodes tree has been completed. + */ +public interface PostConverterProcessor { + + /** + * Executes the node post conversion processing. + * @param processWriter the top level process property writer. + * @param nodeWriter current node property writer. + * @param node the node to be post processed. + */ + void process(ProcessPropertyWriter processWriter, + BasePropertyWriter nodeWriter, + Node, ?> node); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/activities/ReusableSubprocessConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/activities/ReusableSubprocessConverter.java new file mode 100644 index 00000000000..75b06241fde --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/activities/ReusableSubprocessConverter.java @@ -0,0 +1,83 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.activities; + +import org.eclipse.bpmn2.CallActivity; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.CallActivityPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class ReusableSubprocessConverter { + + private final PropertyWriterFactory propertyWriterFactory; + + public ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory) { + this.propertyWriterFactory = propertyWriterFactory; + } + + public PropertyWriter toFlowElement(Node, ?> n) { + CallActivity activity = bpmn2.createCallActivity(); + activity.setId(n.getUUID()); + + CallActivityPropertyWriter p = propertyWriterFactory.of(activity); + + BaseReusableSubprocess definition = n.getContent().getDefinition(); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); + p.setOnEntryAction(executionSet.getOnEntryAction()); + p.setOnExitAction(executionSet.getOnExitAction()); + p.setCalledElement(executionSet.getCalledElement().getValue()); + p.setAsync(executionSet.getIsAsync().getValue()); + p.setIndependent(executionSet.getIndependent().getValue()); + if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { + p.setAbortParent(executionSet.getAbortParent().getValue()); + } + p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); + p.setSlaDueDate(executionSet.getSlaDueDate()); + + p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); + + if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { + p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); + p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); + p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); + p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); + p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); + p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); + } + + p.setSimulationSet(definition.getSimulationSet()); + + p.setAbsoluteBounds(n); + + p.setCase(executionSet.getIsCase().getValue()); + p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); + + return p; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AssociationConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AssociationConverter.java new file mode 100644 index 00000000000..6fa8779894b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AssociationConverter.java @@ -0,0 +1,67 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.ElementContainer; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.AssociationPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.definition.Association; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class AssociationConverter { + + private final PropertyWriterFactory propertyWriterFactory; + + public AssociationConverter(PropertyWriterFactory propertyWriterFactory) { + this.propertyWriterFactory = propertyWriterFactory; + } + + public Result toFlowElement(Edge edge, ElementContainer process) { + ViewConnector connector = (ViewConnector) edge.getContent(); + Association definition = connector.getDefinition(); + org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); + AssociationPropertyWriter p = propertyWriterFactory.of(association); + + association.setId(edge.getUUID()); + + BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); + + BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); + + if (pSrc == null || pTgt == null) { + String msg = "BasePropertyWriter was not found for source node or target node at edge: " + edge.getUUID() + ", pSrc = " + pSrc + ", pTgt = " + pTgt; + return Result.failure(msg); + } + + p.setSource(pSrc); + p.setTarget(pTgt); + + p.setConnection(connector); + + BPMNGeneralSet general = definition.getGeneral(); + p.setDocumentation(general.getDocumentation().getValue()); + p.setDirectionAssociation(definition); + + return Result.of(p); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AssociationType.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AssociationType.java new file mode 100644 index 00000000000..0b8f16a65b2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AssociationType.java @@ -0,0 +1,34 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations; + +public enum AssociationType { + NOT_STARTED_REASSIGN("NotStartedReassign"), + NOT_COMPLETED_REASSIGN("NotCompletedReassign"), + NOT_STARTED_NOTIFY("NotStartedNotify"), + NOT_COMPLETED_NOTIFY("NotCompletedNotify"); + + private String name; + + AssociationType(String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/AbstractCompensationEventPostConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/AbstractCompensationEventPostConverter.java new file mode 100644 index 00000000000..ccbbd30fa2d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/AbstractCompensationEventPostConverter.java @@ -0,0 +1,52 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.FlowElementsContainer; +import org.eclipse.bpmn2.SubProcess; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.PostConverterProcessor; + +public abstract class AbstractCompensationEventPostConverter implements PostConverterProcessor { + + protected Activity findActivity(FlowElementsContainer container, + String uuid) { + final List subContainers = new ArrayList<>(); + for (FlowElement flowElement : container.getFlowElements()) { + if (flowElement instanceof Activity) { + if (flowElement.getId().equals(uuid)) { + return (Activity) flowElement; + } else if (flowElement instanceof SubProcess) { + subContainers.add((SubProcess) flowElement); + } + } + } + Activity result; + for (FlowElementsContainer subContainer : subContainers) { + result = findActivity(subContainer, + uuid); + if (result != null) { + return result; + } + } + return null; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/AbstractThrowEventCompensationEventPostConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/AbstractThrowEventCompensationEventPostConverter.java new file mode 100644 index 00000000000..f4767b95423 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/AbstractThrowEventCompensationEventPostConverter.java @@ -0,0 +1,43 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.Process; +import org.eclipse.bpmn2.ThrowEvent; +import org.kie.workbench.common.stunner.bpmn.client.emf.Bpmn2Marshalling; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils.isEmpty; + +public abstract class AbstractThrowEventCompensationEventPostConverter extends AbstractCompensationEventPostConverter { + + protected void linkActivityRef(Process process, + ThrowEvent throwEvent, + String activityRef) { + if (!isEmpty(activityRef)) { + final CompensateEventDefinition compensateEvent = (CompensateEventDefinition) throwEvent.getEventDefinitions().get(0); + final Activity activity = findActivity(process, + activityRef); + if (activity != null) { + compensateEvent.setActivityRef(activity); + } else { + Bpmn2Marshalling.logError("Referred activity: " + activityRef + " was not found for event: id: " + throwEvent.getId() + ", name: " + throwEvent.getName()); + } + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/EndCompensationEventPostConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/EndCompensationEventPostConverter.java new file mode 100644 index 00000000000..4261a03aacc --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/EndCompensationEventPostConverter.java @@ -0,0 +1,40 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events; + +import org.eclipse.bpmn2.ThrowEvent; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.EndCompensationEvent; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class EndCompensationEventPostConverter + extends AbstractThrowEventCompensationEventPostConverter { + + @Override + public void process(ProcessPropertyWriter processWriter, + BasePropertyWriter nodeWriter, + Node, ?> node) { + final ThrowEvent throwEvent = (ThrowEvent) nodeWriter.getElement(); + final String activityRef = ((EndCompensationEvent) node.getContent().getDefinition()).getExecutionSet().getActivityRef().getValue(); + linkActivityRef(processWriter.getProcess(), + throwEvent, + activityRef); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/EndEventConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/EndEventConverter.java new file mode 100644 index 00000000000..c32a136cff5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/EndEventConverter.java @@ -0,0 +1,210 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events; + +import org.eclipse.bpmn2.EndEvent; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ThrowEventPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils; +import org.kie.workbench.common.stunner.bpmn.definition.BaseEndEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndCompensationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndEscalationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndMessageEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndSignalEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndTerminateEvent; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils.cast; + +public class EndEventConverter { + + private final PropertyWriterFactory propertyWriterFactory; + + public EndEventConverter(PropertyWriterFactory propertyWriterFactory) { + this.propertyWriterFactory = propertyWriterFactory; + } + + public PropertyWriter toFlowElement(Node, ?> node) { + BaseEndEvent def = node.getContent().getDefinition(); + if (def instanceof EndNoneEvent) { + return noneEvent(cast(node)); + } + if (def instanceof EndMessageEvent) { + return messageEvent(cast(node)); + } + if (def instanceof EndSignalEvent) { + return signalEvent(cast(node)); + } + if (def instanceof EndTerminateEvent) { + return terminateEvent(cast(node)); + } + if (def instanceof EndErrorEvent) { + return errorEvent(cast(node)); + } + if (def instanceof EndEscalationEvent) { + return escalationEvent(cast(node)); + } + if (def instanceof EndCompensationEvent) { + return compensationEvent(cast(node)); + } + return ConverterUtils.notSupported(def); + } + + private PropertyWriter errorEvent(Node, ?> n) { + EndEvent event = bpmn2.createEndEvent(); + event.setId(n.getUUID()); + + EndErrorEvent definition = n.getContent().getDefinition(); + ThrowEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo( + definition.getDataIOSet().getAssignmentsinfo()); + + ErrorEventExecutionSet executionSet = definition.getExecutionSet(); + p.addError(executionSet.getErrorRef()); + + p.setAbsoluteBounds(n); + return p; + } + + private PropertyWriter terminateEvent(Node, ?> n) { + EndEvent event = bpmn2.createEndEvent(); + event.setId(n.getUUID()); + + EndTerminateEvent definition = n.getContent().getDefinition(); + ThrowEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.addTerminate(); + + p.setAbsoluteBounds(n); + return p; + } + + private PropertyWriter signalEvent(Node, ?> n) { + EndEvent event = bpmn2.createEndEvent(); + event.setId(n.getUUID()); + + EndSignalEvent definition = n.getContent().getDefinition(); + ThrowEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo( + definition.getDataIOSet().getAssignmentsinfo()); + + p.addSignal(definition.getExecutionSet().getSignalRef()); + p.addSignalScope(definition.getExecutionSet().getSignalScope()); + + p.setAbsoluteBounds(n); + return p; + } + + private PropertyWriter messageEvent(Node, ?> n) { + EndEvent event = bpmn2.createEndEvent(); + event.setId(n.getUUID()); + + EndMessageEvent definition = n.getContent().getDefinition(); + ThrowEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo( + definition.getDataIOSet().getAssignmentsinfo()); + + MessageEventExecutionSet executionSet = + definition.getExecutionSet(); + + p.addMessage(executionSet.getMessageRef()); + + p.setAbsoluteBounds(n); + return p; + } + + private PropertyWriter noneEvent(Node, ?> n) { + EndEvent event = bpmn2.createEndEvent(); + event.setId(n.getUUID()); + + BaseEndEvent definition = n.getContent().getDefinition(); + ThrowEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAbsoluteBounds(n); + return p; + } + + private PropertyWriter escalationEvent(Node, ?> n) { + EndEvent event = bpmn2.createEndEvent(); + event.setId(n.getUUID()); + + EndEscalationEvent definition = n.getContent().getDefinition(); + ThrowEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo( + definition.getDataIOSet().getAssignmentsinfo()); + + EscalationEventExecutionSet executionSet = definition.getExecutionSet(); + p.addEscalation(executionSet.getEscalationRef()); + + p.setAbsoluteBounds(n); + return p; + } + + private PropertyWriter compensationEvent(Node, ?> n) { + EndEvent event = bpmn2.createEndEvent(); + event.setId(n.getUUID()); + + EndCompensationEvent definition = n.getContent().getDefinition(); + ThrowEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.addCompensation(); + + p.setAbsoluteBounds(n); + return p; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/IntermediateCatchEventConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/IntermediateCatchEventConverter.java new file mode 100644 index 00000000000..6e362a83d79 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/IntermediateCatchEventConverter.java @@ -0,0 +1,238 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.CatchEventPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils; +import org.kie.workbench.common.stunner.bpmn.definition.BaseCatchingIntermediateEvent; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.BaseCancellingEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.conditional.CancellingConditionalEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.error.CancellingErrorEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.CancellingEscalationEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.CancellingSignalEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.CancellingTimerEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.util.PropertyWriterUtils.getDockSourceNode; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils.cast; + +public class IntermediateCatchEventConverter { + + private final PropertyWriterFactory propertyWriterFactory; + + public IntermediateCatchEventConverter(PropertyWriterFactory propertyWriterFactory) { + this.propertyWriterFactory = propertyWriterFactory; + } + + public PropertyWriter toFlowElement(Node, ?> node) { + BaseCatchingIntermediateEvent def = node.getContent().getDefinition(); + if (def instanceof IntermediateMessageEventCatching) { + return messageEvent(cast(node)); + } + if (def instanceof IntermediateSignalEventCatching) { + return signalEvent(cast(node)); + } + if (def instanceof IntermediateErrorEventCatching) { + return errorEvent(cast(node)); + } + if (def instanceof IntermediateTimerEvent) { + return timerEvent(cast(node)); + } + if (def instanceof IntermediateConditionalEvent) { + return conditionalEvent(cast(node)); + } + if (def instanceof IntermediateEscalationEvent) { + return escalationEvent(cast(node)); + } + if (def instanceof IntermediateCompensationEvent) { + return compensationEvent(cast(node)); + } + return ConverterUtils.notSupported(def); + } + + private PropertyWriter errorEvent(Node, ?> n) { + CatchEventPropertyWriter p = createCatchEventPropertyWriter(n); + p.getFlowElement().setId(n.getUUID()); + + IntermediateErrorEventCatching definition = n.getContent().getDefinition(); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); + + CancellingErrorEventExecutionSet executionSet = definition.getExecutionSet(); + p.setCancelActivity(executionSet.getCancelActivity().getValue()); + p.addSlaDueDate(executionSet.getSlaDueDate()); + + p.setAbsoluteBounds(n); + + p.addError(executionSet.getErrorRef()); + + return p; + } + + private PropertyWriter signalEvent(Node, ?> n) { + CatchEventPropertyWriter p = createCatchEventPropertyWriter(n); + p.getFlowElement().setId(n.getUUID()); + + IntermediateSignalEventCatching definition = n.getContent().getDefinition(); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo( + definition.getDataIOSet().getAssignmentsinfo()); + + CancellingSignalEventExecutionSet executionSet = definition.getExecutionSet(); + p.setCancelActivity(executionSet.getCancelActivity().getValue()); + p.addSlaDueDate(executionSet.getSlaDueDate()); + + p.setAbsoluteBounds(n); + + p.addSignal(definition.getExecutionSet().getSignalRef()); + + return p; + } + + private PropertyWriter timerEvent(Node, ?> n) { + CatchEventPropertyWriter p = createCatchEventPropertyWriter(n); + p.getFlowElement().setId(n.getUUID()); + + IntermediateTimerEvent definition = n.getContent().getDefinition(); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + CancellingTimerEventExecutionSet executionSet = definition.getExecutionSet(); + p.setCancelActivity(executionSet.getCancelActivity().getValue()); + p.addSlaDueDate(executionSet.getSlaDueDate()); + + p.setAbsoluteBounds(n); + + p.addTimer(executionSet.getTimerSettings()); + + return p; + } + + private PropertyWriter messageEvent(Node, ?> n) { + CatchEventPropertyWriter p = createCatchEventPropertyWriter(n); + p.getFlowElement().setId(n.getUUID()); + + IntermediateMessageEventCatching definition = n.getContent().getDefinition(); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); + + CancellingMessageEventExecutionSet executionSet = definition.getExecutionSet(); + p.setCancelActivity(executionSet.getCancelActivity().getValue()); + p.addSlaDueDate(executionSet.getSlaDueDate()); + + p.setAbsoluteBounds(n); + + p.addMessage(executionSet.getMessageRef()); + + return p; + } + + private PropertyWriter conditionalEvent(Node, ?> n) { + CatchEventPropertyWriter p = createCatchEventPropertyWriter(n); + p.getFlowElement().setId(n.getUUID()); + + IntermediateConditionalEvent definition = n.getContent().getDefinition(); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + CancellingConditionalEventExecutionSet executionSet = definition.getExecutionSet(); + p.setCancelActivity(executionSet.getCancelActivity().getValue()); + p.addSlaDueDate(executionSet.getSlaDueDate()); + + p.setAbsoluteBounds(n); + + p.addCondition(executionSet.getConditionExpression()); + return p; + } + + private PropertyWriter escalationEvent(Node, ?> n) { + CatchEventPropertyWriter p = createCatchEventPropertyWriter(n); + p.getFlowElement().setId(n.getUUID()); + + IntermediateEscalationEvent definition = n.getContent().getDefinition(); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo( + definition.getDataIOSet().getAssignmentsinfo()); + + CancellingEscalationEventExecutionSet executionSet = definition.getExecutionSet(); + p.setCancelActivity(executionSet.getCancelActivity().getValue()); + p.addSlaDueDate(executionSet.getSlaDueDate()); + + p.setAbsoluteBounds(n); + + p.addEscalation(executionSet.getEscalationRef()); + return p; + } + + private PropertyWriter compensationEvent(Node, ?> n) { + CatchEventPropertyWriter p = createCatchEventPropertyWriter(n); + p.getFlowElement().setId(n.getUUID()); + + IntermediateCompensationEvent definition = n.getContent().getDefinition(); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + BaseCancellingEventExecutionSet executionSet = definition.getExecutionSet(); + p.addSlaDueDate(executionSet.getSlaDueDate()); + p.setAbsoluteBounds(n); + + p.addCompensation(); + + return p; + } + + private CatchEventPropertyWriter createCatchEventPropertyWriter(Node n) { + return getDockSourceNode(n).isPresent() ? + propertyWriterFactory.of(bpmn2.createBoundaryEvent()) : + propertyWriterFactory.of(bpmn2.createIntermediateCatchEvent()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/IntermediateCompensationEventPostConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/IntermediateCompensationEventPostConverter.java new file mode 100644 index 00000000000..31001ff9e89 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/IntermediateCompensationEventPostConverter.java @@ -0,0 +1,45 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events; + +import org.eclipse.bpmn2.Activity; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class IntermediateCompensationEventPostConverter + extends AbstractCompensationEventPostConverter { + + @Override + public void process(ProcessPropertyWriter processWriter, + BasePropertyWriter nodeWriter, + Node, ?> node) { + if (!node.getOutEdges().isEmpty()) { + final Edge edge = node.getOutEdges().iterator().next(); + if (edge != null && edge.getTargetNode() != null) { + final Activity activity = findActivity(processWriter.getProcess(), + edge.getTargetNode().getUUID()); + if (activity != null) { + activity.setIsForCompensation(true); + } + } + } + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/IntermediateThrowCompensationEventPostConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/IntermediateThrowCompensationEventPostConverter.java new file mode 100644 index 00000000000..871e8b056cf --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/IntermediateThrowCompensationEventPostConverter.java @@ -0,0 +1,39 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events; + +import org.eclipse.bpmn2.ThrowEvent; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class IntermediateThrowCompensationEventPostConverter extends AbstractThrowEventCompensationEventPostConverter { + + @Override + public void process(ProcessPropertyWriter processWriter, + BasePropertyWriter nodeWriter, + Node, ?> node) { + final ThrowEvent throwEvent = (ThrowEvent) nodeWriter.getElement(); + final String activityRef = ((IntermediateCompensationEventThrowing) node.getContent().getDefinition()).getExecutionSet().getActivityRef().getValue(); + linkActivityRef(processWriter.getProcess(), + throwEvent, + activityRef); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/IntermediateThrowEventConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/IntermediateThrowEventConverter.java new file mode 100644 index 00000000000..4e55d814e08 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/IntermediateThrowEventConverter.java @@ -0,0 +1,141 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events; + +import org.eclipse.bpmn2.IntermediateThrowEvent; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ThrowEventPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils; +import org.kie.workbench.common.stunner.bpmn.definition.BaseThrowingIntermediateEvent; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEventThrowing; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventThrowing; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventThrowing; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils.cast; + +public class IntermediateThrowEventConverter { + + private final PropertyWriterFactory propertyWriterFactory; + + public IntermediateThrowEventConverter(PropertyWriterFactory propertyWriterFactory) { + this.propertyWriterFactory = propertyWriterFactory; + } + + public PropertyWriter toFlowElement(Node, ?> node) { + BaseThrowingIntermediateEvent def = node.getContent().getDefinition(); + if (def instanceof IntermediateMessageEventThrowing) { + return messageEvent(cast(node)); + } + if (def instanceof IntermediateSignalEventThrowing) { + return signalEvent(cast(node)); + } + if (def instanceof IntermediateEscalationEventThrowing) { + return escalationEvent(cast(node)); + } + if (def instanceof IntermediateCompensationEventThrowing) { + return compensationEvent(cast(node)); + } + return ConverterUtils.notSupported(def); + } + + private PropertyWriter signalEvent(Node, ?> n) { + IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent(); + event.setId(n.getUUID()); + + IntermediateSignalEventThrowing definition = n.getContent().getDefinition(); + ThrowEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo( + definition.getDataIOSet().getAssignmentsinfo()); + + p.addSignal(definition.getExecutionSet().getSignalRef()); + p.addSignalScope(definition.getExecutionSet().getSignalScope()); + + p.setAbsoluteBounds(n); + return p; + } + + private PropertyWriter messageEvent(Node, ?> n) { + IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent(); + event.setId(n.getUUID()); + + IntermediateMessageEventThrowing definition = n.getContent().getDefinition(); + ThrowEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo( + definition.getDataIOSet().getAssignmentsinfo()); + + MessageEventExecutionSet executionSet = definition.getExecutionSet(); + + p.addMessage(executionSet.getMessageRef()); + + p.setAbsoluteBounds(n); + return p; + } + + private PropertyWriter escalationEvent(Node, ?> n) { + IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent(); + event.setId(n.getUUID()); + + IntermediateEscalationEventThrowing definition = n.getContent().getDefinition(); + ThrowEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo( + definition.getDataIOSet().getAssignmentsinfo()); + + p.addEscalation(definition.getExecutionSet().getEscalationRef()); + + p.setAbsoluteBounds(n); + return p; + } + + private PropertyWriter compensationEvent(Node, ?> n) { + IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent(); + event.setId(n.getUUID()); + + IntermediateCompensationEventThrowing definition = n.getContent().getDefinition(); + ThrowEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.addCompensation(); + + p.setAbsoluteBounds(n); + return p; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/StartEventConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/StartEventConverter.java new file mode 100644 index 00000000000..27973711788 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/events/StartEventConverter.java @@ -0,0 +1,268 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events; + +import org.eclipse.bpmn2.StartEvent; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.CatchEventPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils; +import org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartEscalationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.BaseStartEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.conditional.InterruptingConditionalEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.InterruptingEscalationEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.InterruptingTimerEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils.cast; + +public class StartEventConverter { + + private final PropertyWriterFactory propertyWriterFactory; + + public StartEventConverter(PropertyWriterFactory propertyWriterFactory) { + this.propertyWriterFactory = propertyWriterFactory; + } + + public PropertyWriter toFlowElement(Node, ?> node) { + BaseStartEvent def = node.getContent().getDefinition(); + if (def instanceof StartNoneEvent) { + return noneEvent(cast(node)); + } + if (def instanceof StartSignalEvent) { + return signalEvent(cast(node)); + } + if (def instanceof StartTimerEvent) { + return timerEvent(cast(node)); + } + if (def instanceof StartErrorEvent) { + return errorEvent(cast(node)); + } + if (def instanceof StartMessageEvent) { + return messageEvent(cast(node)); + } + if (def instanceof StartConditionalEvent) { + return conditionalEvent(cast(node)); + } + if (def instanceof StartEscalationEvent) { + return escalationEvent(cast(node)); + } + if (def instanceof StartCompensationEvent) { + return compensationEvent(cast(node)); + } + return ConverterUtils.notSupported(def); + } + + private PropertyWriter noneEvent(Node, ?> n) { + StartEvent event = bpmn2.createStartEvent(); + event.setId(n.getUUID()); + + StartNoneEvent definition = n.getContent().getDefinition(); + CatchEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setSimulationSet(definition.getSimulationSet()); + + BaseStartEventExecutionSet executionSet = definition.getExecutionSet(); + event.setIsInterrupting(executionSet.getIsInterrupting().getValue()); + p.addSlaDueDate(executionSet.getSlaDueDate()); + + p.setAbsoluteBounds(n); + + return p; + } + + private PropertyWriter compensationEvent(Node, ?> n) { + StartEvent event = bpmn2.createStartEvent(); + event.setId(n.getUUID()); + + StartCompensationEvent definition = n.getContent().getDefinition(); + CatchEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setSimulationSet(definition.getSimulationSet()); + + BaseStartEventExecutionSet executionSet = definition.getExecutionSet(); + event.setIsInterrupting(executionSet.getIsInterrupting().getValue()); + p.addSlaDueDate(executionSet.getSlaDueDate()); + p.setAbsoluteBounds(n); + + p.addCompensation(); + + return p; + } + + private PropertyWriter signalEvent(Node, ?> n) { + StartEvent event = bpmn2.createStartEvent(); + event.setId(n.getUUID()); + + StartSignalEvent definition = n.getContent().getDefinition(); + CatchEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); + + InterruptingSignalEventExecutionSet executionSet = definition.getExecutionSet(); + event.setIsInterrupting(executionSet.getIsInterrupting().getValue()); + p.addSlaDueDate(executionSet.getSlaDueDate()); + p.setAbsoluteBounds(n); + + p.addSignal(executionSet.getSignalRef()); + + return p; + } + + private PropertyWriter timerEvent(Node, ?> n) { + StartEvent event = bpmn2.createStartEvent(); + event.setId(n.getUUID()); + + StartTimerEvent definition = n.getContent().getDefinition(); + CatchEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setSimulationSet(definition.getSimulationSet()); + + InterruptingTimerEventExecutionSet executionSet = definition.getExecutionSet(); + event.setIsInterrupting(executionSet.getIsInterrupting().getValue()); + p.addSlaDueDate(executionSet.getSlaDueDate()); + p.setAbsoluteBounds(n); + + p.addTimer(executionSet.getTimerSettings()); + + return p; + } + + private PropertyWriter conditionalEvent(Node, ?> n) { + StartEvent event = bpmn2.createStartEvent(); + event.setId(n.getUUID()); + + StartConditionalEvent definition = n.getContent().getDefinition(); + CatchEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setSimulationSet(definition.getSimulationSet()); + + InterruptingConditionalEventExecutionSet executionSet = definition.getExecutionSet(); + event.setIsInterrupting(executionSet.getIsInterrupting().getValue()); + p.addSlaDueDate(executionSet.getSlaDueDate()); + p.setAbsoluteBounds(n); + + p.addCondition(executionSet.getConditionExpression()); + + return p; + } + + private PropertyWriter errorEvent(Node, ?> n) { + StartEvent event = bpmn2.createStartEvent(); + event.setId(n.getUUID()); + + StartErrorEvent definition = n.getContent().getDefinition(); + CatchEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); + + InterruptingErrorEventExecutionSet executionSet = definition.getExecutionSet(); + event.setIsInterrupting(executionSet.getIsInterrupting().getValue()); + p.addSlaDueDate(executionSet.getSlaDueDate()); + p.setAbsoluteBounds(n); + + p.addError(executionSet.getErrorRef()); + + return p; + } + + private PropertyWriter escalationEvent(Node, ?> n) { + StartEvent event = bpmn2.createStartEvent(); + event.setId(n.getUUID()); + + StartEscalationEvent definition = n.getContent().getDefinition(); + CatchEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setSimulationSet(definition.getSimulationSet()); + + p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); + + InterruptingEscalationEventExecutionSet executionSet = definition.getExecutionSet(); + event.setIsInterrupting(executionSet.getIsInterrupting().getValue()); + p.addSlaDueDate(executionSet.getSlaDueDate()); + p.setAbsoluteBounds(n); + + p.addEscalation(executionSet.getEscalationRef()); + + return p; + } + + private PropertyWriter messageEvent(Node, ?> n) { + StartEvent event = bpmn2.createStartEvent(); + event.setId(n.getUUID()); + + StartMessageEvent definition = n.getContent().getDefinition(); + CatchEventPropertyWriter p = propertyWriterFactory.of(event); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); + + InterruptingMessageEventExecutionSet executionSet = definition.getExecutionSet(); + event.setIsInterrupting(executionSet.getIsInterrupting().getValue()); + p.addSlaDueDate((executionSet.getSlaDueDate())); + p.setAbsoluteBounds(n); + + p.addMessage(executionSet.getMessageRef()); + + return p; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/gateways/GatewayConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/gateways/GatewayConverter.java new file mode 100644 index 00000000000..7509ddc13e9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/gateways/GatewayConverter.java @@ -0,0 +1,134 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.gateways; + +import org.eclipse.bpmn2.GatewayDirection; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.GatewayPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils; +import org.kie.workbench.common.stunner.bpmn.definition.BaseGateway; +import org.kie.workbench.common.stunner.bpmn.definition.EventGateway; +import org.kie.workbench.common.stunner.bpmn.definition.ExclusiveGateway; +import org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway; +import org.kie.workbench.common.stunner.bpmn.definition.ParallelGateway; +import org.kie.workbench.common.stunner.bpmn.definition.property.gateway.GatewayExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils.cast; + +public class GatewayConverter { + + private final PropertyWriterFactory propertyWriterFactory; + + public GatewayConverter(PropertyWriterFactory propertyWriterFactory) { + this.propertyWriterFactory = propertyWriterFactory; + } + + public PropertyWriter toFlowElement(Node, ?> node) { + BaseGateway def = node.getContent().getDefinition(); + if (def instanceof ParallelGateway) { + return parallel(cast(node)); + } + if (def instanceof ExclusiveGateway) { + return exclusive(cast(node)); + } + if (def instanceof InclusiveGateway) { + return inclusive(cast(node)); + } + if (def instanceof EventGateway) { + return event(cast(node)); + } + return ConverterUtils.notSupported(def); + } + + private PropertyWriter inclusive(Node, ?> n) { + GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createInclusiveGateway()); + p.setId(n.getUUID()); + + InclusiveGateway definition = n.getContent().getDefinition(); + + p.setGatewayDirection(n); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + GatewayExecutionSet executionSet = definition.getExecutionSet(); + p.setDefaultRoute(executionSet.getDefaultRoute().getValue()); + + p.setAbsoluteBounds(n); + + return p; + } + + private PropertyWriter exclusive(Node, ?> n) { + GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createExclusiveGateway()); + p.setId(n.getUUID()); + + ExclusiveGateway definition = n.getContent().getDefinition(); + + p.setGatewayDirection(n); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + GatewayExecutionSet executionSet = definition.getExecutionSet(); + p.setDefaultRoute(executionSet.getDefaultRoute().getValue()); + + p.setAbsoluteBounds(n); + + return p; + } + + private PropertyWriter parallel(Node, ?> n) { + GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createParallelGateway()); + p.setId(n.getUUID()); + + ParallelGateway definition = n.getContent().getDefinition(); + + p.setGatewayDirection(n); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAbsoluteBounds(n); + + return p; + } + + private PropertyWriter event(Node, ?> n) { + GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createEventBasedGateway()); + p.setId(n.getUUID()); + p.setGatewayDirection(GatewayDirection.DIVERGING); + + EventGateway definition = n.getContent().getDefinition(); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAbsoluteBounds(n); + + return p; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/lanes/LaneConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/lanes/LaneConverter.java new file mode 100644 index 00000000000..cd58c8b854d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/lanes/LaneConverter.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.lanes; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.LanePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.Lane; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class LaneConverter { + + private final PropertyWriterFactory propertyWriterFactory; + + public LaneConverter(PropertyWriterFactory propertyWriterFactory) { + this.propertyWriterFactory = propertyWriterFactory; + } + + public Result toElement(Node, ?> node) { + final BPMNViewDefinition def = node.getContent().getDefinition(); + if (def instanceof Lane) { + Lane definition = (Lane) def; + org.eclipse.bpmn2.Lane lane = bpmn2.createLane(); + lane.setId(node.getUUID()); + + LanePropertyWriter p = propertyWriterFactory.of(lane); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAbsoluteBounds(node); + + return Result.success(p); + } + return Result.ignored("not a lane"); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/EventSubProcessPostConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/EventSubProcessPostConverter.java new file mode 100644 index 00000000000..d3e3112876b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/EventSubProcessPostConverter.java @@ -0,0 +1,43 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.processes; + +import org.eclipse.bpmn2.SubProcess; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.PostConverterProcessor; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.util.GraphUtils; + +public class EventSubProcessPostConverter implements PostConverterProcessor { + + @Override + public void process(ProcessPropertyWriter processWriter, + BasePropertyWriter nodeWriter, + Node, ?> node) { + boolean isForCompensation = GraphUtils.getChildNodes(node).stream() + .filter(currentNode -> currentNode.getContent() instanceof View && ((View) currentNode.getContent()).getDefinition() instanceof StartCompensationEvent) + .findFirst() + .isPresent(); + if (isForCompensation) { + ((SubProcess) nodeWriter.getElement()).setIsForCompensation(true); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/ProcessConverterDelegate.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/ProcessConverterDelegate.java new file mode 100644 index 00000000000..b11bb086204 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/ProcessConverterDelegate.java @@ -0,0 +1,141 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.processes; + +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.ConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.DefinitionsBuildingContext; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.ElementContainer; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.lanes.LaneConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ActivityPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BoundaryEventPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.LanePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.SubProcessPropertyWriter; + +import static java.util.stream.Collectors.toList; +import static java.util.stream.Collectors.toSet; + +class ProcessConverterDelegate { + + private final ConverterFactory converterFactory; + + ProcessConverterDelegate(ConverterFactory converterFactory) { + this.converterFactory = converterFactory; + } + + void convertChildNodes( + ElementContainer p, + DefinitionsBuildingContext context) { + + List subprocesses = + context.nodes().map(converterFactory.subProcessConverter()::convertSubProcess) + .filter(Result::notIgnored) + .map(Result::value) + .collect(toList()); + + // keep track of nested children to avoid adding them again to ancestors + Set processed = subprocesses.stream() + .flatMap(sub -> sub.getChildElements().stream().map(BasePropertyWriter::getId)) + .collect(toSet()); + + subprocesses.stream() + .filter(e -> !processed.contains(e.getId())) // skip processed + .forEach(p::addChildElement); + + context.nodes() + .filter(e -> !processed.contains(e.getUUID())) // skip processed + .map(converterFactory.viewDefinitionConverter()::toFlowElement) + .filter(Result::notIgnored) + .map(Result::value) + .forEach(p::addChildElement); + + convertLanes(context, processed, p); + } + + private void convertLanes( + DefinitionsBuildingContext context, + Set processed, ElementContainer p) { + LaneConverter laneConverter = converterFactory.laneConverter(); + List convertedLanes = context.lanes() + .map(laneConverter::toElement) + .filter(Result::isSuccess) + .map(Result::value) + .peek(convertedLane -> { + // for each lane, we get the child nodes in the graph + context.withRootNode(convertedLane.getId()).childNodes() + .filter(n -> !processed.contains(n.getUUID())) + // then for each converted element, we re-set its parent to the converted lane + .forEach(n -> p.getChildElement(n.getUUID()).setParent(convertedLane)); + }) + .collect(toList()); + + p.addLaneSet(convertedLanes); + } + + void convertEdges(ElementContainer p, DefinitionsBuildingContext context) { + context.dockEdges() + .forEach(e -> { + ActivityPropertyWriter pSrc = + (ActivityPropertyWriter) p.getChildElement(e.getSourceNode().getUUID()); + BoundaryEventPropertyWriter pTgt = + (BoundaryEventPropertyWriter) p.getChildElement(e.getTargetNode().getUUID()); + // if it's null, then this edge is not related to this process. ignore. + if (pTgt != null) { + pTgt.setParentActivity(pSrc); + } + }); + + context.edges() + .map(e -> converterFactory.edgeElementConverter().toFlowElement(e, p)) + .filter(Result::isSuccess) + .map(Result::value) + .forEach(p::addChildElement); + } + + void postConvertChildNodes(ProcessPropertyWriter processWriter, + DefinitionsBuildingContext context) { + final Map propertyWriters = collectPropertyWriters(processWriter); + context.nodes().forEach(node -> converterFactory.flowElementPostConverter().postConvert(processWriter, + propertyWriters.get(node.getUUID()), + node)); + } + + private Map collectPropertyWriters(ElementContainer container) { + + final Map result = container.getChildElements() + .stream() + .collect(Collectors.toMap(BasePropertyWriter::getId, + p -> p)); + + container.getChildElements() + .stream() + .filter(e -> e instanceof ElementContainer) + .map(e -> (ElementContainer) e) + .map(this::collectPropertyWriters) + .collect(Collectors.toList()) + .forEach(result::putAll); + + return result; + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/RootProcessConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/RootProcessConverter.java new file mode 100644 index 00000000000..71051a950c9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/RootProcessConverter.java @@ -0,0 +1,100 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.processes; + +import org.eclipse.bpmn2.Process; +import org.eclipse.bpmn2.ProcessType; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.ConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.DefinitionsBuildingContext; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.BaseDiagramSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseProcessData; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.definition.Definition; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class RootProcessConverter { + + private final ProcessConverterDelegate delegate; + private final DefinitionsBuildingContext context; + private final PropertyWriterFactory propertyWriterFactory; + + public RootProcessConverter(DefinitionsBuildingContext context, + PropertyWriterFactory propertyWriterFactory, + ConverterFactory converterFactory) { + this.delegate = new ProcessConverterDelegate(converterFactory); + this.context = context; + this.propertyWriterFactory = propertyWriterFactory; + } + + public ProcessPropertyWriter convertProcess() { + ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); + + delegate.convertChildNodes(processRoot, context); + delegate.convertEdges(processRoot, context); + delegate.postConvertChildNodes(processRoot, context); + return processRoot; + } + + private ProcessPropertyWriter convertProcessNode(Node, ?> node) { + Process process = bpmn2.createProcess(); + + //FIXME: Important + //ProcessType is hard coded to "Public" because this is necessary on kogito runtime + //to expose the REST endpoints + //when the property is configured see https://issues.jboss.org/browse/JBPM-8749 this should be removed + process.setProcessType(ProcessType.PUBLIC); + + ProcessPropertyWriter p = propertyWriterFactory.of(process); + BPMNDiagram definition = node.getContent().getDefinition(); + + BaseDiagramSet diagramSet = definition.getDiagramSet(); + + p.setName(diagramSet.getName().getValue()); + p.setDocumentation(diagramSet.getDocumentation().getValue()); + + p.setId(diagramSet.getId().getValue()); + p.setPackage(diagramSet.getPackageProperty().getValue()); + p.setVersion(diagramSet.getVersion().getValue()); + p.setAdHoc(diagramSet.getAdHoc().getValue()); + p.setDescription(diagramSet.getProcessInstanceDescription().getValue()); + p.setGlobalVariables(diagramSet.getGlobalVariables()); + p.setExecutable(diagramSet.getExecutable().getValue()); + p.setSlaDueDate(diagramSet.getSlaDueDate()); + + BaseProcessData processData = definition.getProcessData(); + p.setProcessVariables(processData.getProcessVariables()); + + //Case Management + final CaseIdPrefix caseIdPrefix = definition.getCaseManagementSet().getCaseIdPrefix(); + p.setCaseIdPrefix(caseIdPrefix); + + final CaseRoles caseRoles = definition.getCaseManagementSet().getCaseRoles(); + p.setCaseRoles(caseRoles); + + final CaseFileVariables caseFileVariables = definition.getCaseManagementSet().getCaseFileVariables(); + p.setCaseFileVariables(caseFileVariables); + + return p; + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/SubProcessConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/SubProcessConverter.java new file mode 100644 index 00000000000..5c1789be9d4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/SubProcessConverter.java @@ -0,0 +1,201 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.processes; + +import org.eclipse.bpmn2.SubProcess; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.ConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.DefinitionsBuildingContext; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.AdHocSubProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.MultipleInstanceSubProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.SubProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.BaseAdHocSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.MultipleInstanceSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.subProcess.execution.EmbeddedSubprocessExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.subProcess.execution.EventSubprocessExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseAdHocSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseProcessData; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils.cast; + +public class SubProcessConverter extends ProcessConverterDelegate { + + private final DefinitionsBuildingContext context; + private final PropertyWriterFactory propertyWriterFactory; + + public SubProcessConverter(DefinitionsBuildingContext context, + PropertyWriterFactory propertyWriterFactory, + ConverterFactory converterFactory) { + super(converterFactory); + this.context = context; + this.propertyWriterFactory = propertyWriterFactory; + } + + public Result convertSubProcess(Node, ?> node) { + final Result processRootResult; + final BPMNViewDefinition def = node.getContent().getDefinition(); + if (def instanceof EmbeddedSubprocess) { + processRootResult = Result.success(convertEmbeddedSubprocessNode(cast(node))); + } else if (def instanceof EventSubprocess) { + processRootResult = Result.success(convertEventSubprocessNode(cast(node))); + } else if (def instanceof BaseAdHocSubprocess) { + processRootResult = Result.success(convertAdHocSubprocessNode(cast(node))); + } else if (def instanceof MultipleInstanceSubprocess) { + processRootResult = Result.success(convertMultipleInstanceSubprocessNode(cast(node))); + } else { + return Result.ignored("unknown type"); + } + + DefinitionsBuildingContext subContext = context.withRootNode(node); + SubProcessPropertyWriter processRoot = processRootResult.value(); + + super.convertChildNodes(processRoot, subContext); + super.convertEdges(processRoot, subContext); + + return processRootResult; + } + + protected SubProcessPropertyWriter convertMultipleInstanceSubprocessNode(Node, ?> n) { + SubProcess process = bpmn2.createSubProcess(); + process.setId(n.getUUID()); + + MultipleInstanceSubProcessPropertyWriter p = propertyWriterFactory.ofMultipleInstanceSubProcess(process); + + MultipleInstanceSubprocess definition = n.getContent().getDefinition(); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + ProcessData processData = definition.getProcessData(); + p.setProcessVariables(processData.getProcessVariables()); + + MultipleInstanceSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); + p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); + p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); + p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); + p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); + p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); + p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); + p.setOnEntryAction(executionSet.getOnEntryAction()); + p.setOnExitAction(executionSet.getOnExitAction()); + p.setAsync(executionSet.getIsAsync().getValue()); + p.setSlaDueDate(executionSet.getSlaDueDate()); + + p.setSimulationSet(definition.getSimulationSet()); + + p.setAbsoluteBounds(n); + + return p; + } + + protected SubProcessPropertyWriter convertAdHocSubprocessNode(Node, ?> n) { + org.eclipse.bpmn2.AdHocSubProcess process = bpmn2.createAdHocSubProcess(); + process.setId(n.getUUID()); + + AdHocSubProcessPropertyWriter p = propertyWriterFactory.of(process); + BaseAdHocSubprocess definition = n.getContent().getDefinition(); + + BPMNGeneralSet general = definition.getGeneral(); + + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + BaseProcessData processData = definition.getProcessData(); + p.setProcessVariables(processData.getProcessVariables()); + + BaseAdHocSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); + p.setAdHocActivationCondition(executionSet.getAdHocActivationCondition()); + p.setAdHocCompletionCondition(executionSet.getAdHocCompletionCondition()); + p.setAdHocOrdering(executionSet.getAdHocOrdering()); + p.setOnEntryAction(executionSet.getOnEntryAction()); + p.setOnExitAction(executionSet.getOnExitAction()); + p.setAsync(executionSet.getIsAsync().getValue()); + p.setSlaDueDate(executionSet.getSlaDueDate()); + + p.setSimulationSet(definition.getSimulationSet()); + + p.setAbsoluteBounds(n); + + p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); + + return p; + } + + protected SubProcessPropertyWriter convertEventSubprocessNode(Node, ?> n) { + SubProcess process = bpmn2.createSubProcess(); + process.setId(n.getUUID()); + + SubProcessPropertyWriter p = propertyWriterFactory.of(process); + + EventSubprocess definition = n.getContent().getDefinition(); + process.setTriggeredByEvent(true); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + ProcessData processData = definition.getProcessData(); + p.setProcessVariables(processData.getProcessVariables()); + + EventSubprocessExecutionSet executionSet = definition.getExecutionSet(); + p.setAsync(executionSet.getIsAsync().getValue()); + p.setSlaDueDate(executionSet.getSlaDueDate()); + + p.setSimulationSet(definition.getSimulationSet()); + + p.setAbsoluteBounds(n); + + return p; + } + + protected SubProcessPropertyWriter convertEmbeddedSubprocessNode(Node, ?> n) { + SubProcess process = bpmn2.createSubProcess(); + process.setId(n.getUUID()); + + SubProcessPropertyWriter p = propertyWriterFactory.of(process); + + EmbeddedSubprocess definition = n.getContent().getDefinition(); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + EmbeddedSubprocessExecutionSet executionSet = definition.getExecutionSet(); + + p.setOnEntryAction(executionSet.getOnEntryAction()); + p.setOnExitAction(executionSet.getOnExitAction()); + p.setAsync(executionSet.getIsAsync().getValue()); + p.setSlaDueDate(executionSet.getSlaDueDate()); + + ProcessData processData = definition.getProcessData(); + p.setProcessVariables(processData.getProcessVariables()); + + p.setSimulationSet(definition.getSimulationSet()); + p.setAbsoluteBounds(n); + return p; + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ActivityPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ActivityPropertyWriter.java new file mode 100644 index 00000000000..9f452250da9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ActivityPropertyWriter.java @@ -0,0 +1,135 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.List; + +import bpsim.ElementParameters; +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.OutputSet; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.InitializedVariable.InitializedInputVariable; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.InitializedVariable.InitializedOutputVariable; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.ParsedAssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.SimulationSets; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.AssignmentsInfos.isReservedIdentifier; + +public class ActivityPropertyWriter extends PropertyWriter { + + protected final Activity activity; + private ElementParameters simulationParameters; + + public ActivityPropertyWriter(Activity activity, VariableScope variableScope) { + super(activity, variableScope); + this.activity = activity; + } + + @Override + public Activity getFlowElement() { + return activity; + } + + public void setSimulationSet(SimulationSet simulationSet) { + this.simulationParameters = SimulationSets.toElementParameters(simulationSet); + simulationParameters.setElementRef(activity.getId()); + } + + public ElementParameters getSimulationParameters() { + return simulationParameters; + } + + public void setAssignmentsInfo(AssignmentsInfo info) { + final ParsedAssignmentsInfo assignmentsInfo = ParsedAssignmentsInfo.of(info); + final InputOutputSpecification ioSpec = getIoSpecification(); + + List inputs = + assignmentsInfo.createInitializedInputVariables(getId(), variableScope); + + for (InitializedInputVariable input : inputs) { + if (isReservedIdentifier(input.getIdentifier())) { + continue; + } + + DataInput dataInput = input.getDataInput(); + getInputSet(ioSpec).getDataInputRefs().add(dataInput); + ioSpec.getDataInputs().add(dataInput); + + this.addItemDefinition(input.getItemDefinition()); + DataInputAssociation dataInputAssociation = input.getDataInputAssociation(); + if (dataInputAssociation != null) { + activity.getDataInputAssociations().add(dataInputAssociation); + } + } + + List outputs = + assignmentsInfo.createInitializedOutputVariables(getId(), variableScope); + + for (InitializedOutputVariable output : outputs) { + DataOutput dataOutput = output.getDataOutput(); + getOutputSet(ioSpec).getDataOutputRefs().add(dataOutput); + ioSpec.getDataOutputs().add(dataOutput); + + this.addItemDefinition(output.getItemDefinition()); + DataOutputAssociation dataOutputAssociation = output.getDataOutputAssociation(); + if (dataOutputAssociation != null) { + activity.getDataOutputAssociations().add(dataOutputAssociation); + } + } + } + + protected InputOutputSpecification getIoSpecification() { + InputOutputSpecification ioSpecification = activity.getIoSpecification(); + if (ioSpecification == null) { + ioSpecification = bpmn2.createInputOutputSpecification(); + activity.setIoSpecification(ioSpecification); + } + return ioSpecification; + } + + protected InputSet getInputSet(InputOutputSpecification ioSpecification) { + List inputSets = ioSpecification.getInputSets(); + InputSet inputSet; + if (inputSets.isEmpty()) { + inputSet = bpmn2.createInputSet(); + inputSets.add(inputSet); + } else { + inputSet = inputSets.get(0); + } + return inputSet; + } + + protected OutputSet getOutputSet(InputOutputSpecification ioSpecification) { + List outputSets = ioSpecification.getOutputSets(); + OutputSet outputSet; + if (outputSets.isEmpty()) { + outputSet = bpmn2.createOutputSet(); + outputSets.add(outputSet); + } else { + outputSet = outputSets.get(0); + } + return outputSet; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/AdHocSubProcessPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/AdHocSubProcessPropertyWriter.java new file mode 100644 index 00000000000..338d1be121e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/AdHocSubProcessPropertyWriter.java @@ -0,0 +1,63 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.AdHocOrdering; +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.FormalExpression; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseAdHocActivationCondition; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseAdHocCompletionCondition; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.scriptLanguageToUri; + +public class AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { + + private final AdHocSubProcess process; + + public AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope) { + super(process, variableScope); + this.process = process; + } + + public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { + if (ConverterUtils.nonEmpty(adHocActivationCondition.getValue())) { + CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); + } + } + + public void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value) { + process.setOrdering(AdHocOrdering.getByName(value.getValue())); + } + + public void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition) { + FormalExpression e = bpmn2.createFormalExpression(); + ScriptTypeValue s = adHocCompletionCondition.getValue(); + e.setLanguage(scriptLanguageToUri(s.getLanguage())); + FormalExpressionBodyHandler.of(e).setBody(asCData(s.getScript())); + process.setCompletionCondition(e); + } + + public void setAdHocAutostart(boolean autoStart) { + CustomElement.autoStart.of(flowElement).set(autoStart); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/AssociationPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/AssociationPropertyWriter.java new file mode 100644 index 00000000000..3753f89e78c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/AssociationPropertyWriter.java @@ -0,0 +1,81 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.Association; +import org.eclipse.bpmn2.AssociationDirection; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.util.PropertyWriterUtils; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.NonDirectionalAssociation; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.ControlPoint; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; + +public class AssociationPropertyWriter extends BasePropertyWriter { + + private Association association; + private BasePropertyWriter source; + private BasePropertyWriter target; + private BPMNEdge bpmnEdge; + + public AssociationPropertyWriter(Association association, + VariableScope variableScope) { + super(association, + variableScope); + this.association = association; + } + + public void setConnection(ViewConnector connector) { + if (connector.getSourceConnection().isPresent() && connector.getTargetConnection().isPresent()) { + Connection sourceConnection = connector.getSourceConnection().get(); + Connection targetConnection = connector.getTargetConnection().get(); + + ControlPoint[] controlPoints = connector.getControlPoints(); + bpmnEdge = PropertyWriterUtils.createBPMNEdge(source, + target, + sourceConnection, + controlPoints, + targetConnection); + bpmnEdge.setBpmnElement(association); + } + } + + public BPMNEdge getEdge() { + return bpmnEdge; + } + + public void setSource(BasePropertyWriter pSrc) { + this.source = pSrc; + association.setSourceRef(pSrc.getElement()); + pSrc.setTarget(this); + } + + public void setTarget(BasePropertyWriter pTgt) { + this.target = pTgt; + association.setTargetRef(pTgt.getElement()); + pTgt.setSource(this); + } + + public void setDirectionAssociation(org.kie.workbench.common.stunner.bpmn.definition.Association definition) { + AssociationDirection direction = AssociationDirection.ONE; + if (definition instanceof NonDirectionalAssociation) { + direction = AssociationDirection.NONE; + } + association.setAssociationDirection(direction); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BasePropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BasePropertyWriter.java new file mode 100644 index 00000000000..51c38dffa57 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BasePropertyWriter.java @@ -0,0 +1,162 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.Documentation; +import org.eclipse.bpmn2.Interface; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.RootElement; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.di.BPMNShape; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Ids; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.DocumentationTextHandler; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bound; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.util.GraphUtils; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.dc; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.di; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils.isEmpty; + +public abstract class BasePropertyWriter { + + protected final BaseElement baseElement; + protected final VariableScope variableScope; + protected final List itemDefinitions = new ArrayList<>(); + protected final List rootElements = new ArrayList<>(); + protected final List interfaces = new ArrayList<>(); + protected BPMNShape shape; + + public BasePropertyWriter(BaseElement baseElement, VariableScope variableScope) { + this.baseElement = baseElement; + this.variableScope = variableScope; + } + + public String getId() { + return this.baseElement.getId(); + } + + public void setId(String id) { + baseElement.setId(id); + } + + protected void setBounds(Bounds rect) { + this.shape = di.createBPMNShape(); + shape.setId(Ids.bpmnShape(getId())); + shape.setBpmnElement(baseElement); + + org.eclipse.dd.dc.Bounds bounds = dc.createBounds(); + + Bound upperLeft = rect.getUpperLeft(); + Bound lowerRight = rect.getLowerRight(); + + bounds.setX(upperLeft.getX().floatValue()); + bounds.setY(upperLeft.getY().floatValue()); + bounds.setWidth(lowerRight.getX().floatValue() - upperLeft.getX().floatValue()); + bounds.setHeight(lowerRight.getY().floatValue() - upperLeft.getY().floatValue()); + + shape.setBounds(bounds); + } + + public void setAbsoluteBounds(Node node) { + setBounds(absoluteBounds(node)); + } + + public BaseElement getElement() { + return baseElement; + } + + public void setDocumentation(String value) { + if (!isEmpty(value)) { + Documentation documentation = bpmn2.createDocumentation(); + DocumentationTextHandler.of(documentation).setText(asCData(value)); + baseElement.getDocumentation().add(documentation); + } + } + + /** + * @return the shape associated to this element, shape if it's not an edge + */ + public BPMNShape getShape() { + return shape; + } + + /** + * @return the edge associated to this element, null if it's not an edge + */ + public BPMNEdge getEdge() { + return null; + } + + public void setSource(BasePropertyWriter source) { + + } + + public void setTarget(BasePropertyWriter target) { + + } + + public void addChild(BasePropertyWriter child) { + + } + + public void setParent(BasePropertyWriter parent) { + parent.addChild(this); + } + + protected void addItemDefinition(ItemDefinition itemDefinition) { + this.itemDefinitions.add(itemDefinition); + } + + protected void addInterfaceDefinition(Interface iface) { + this.interfaces.add(iface); + } + + protected void addRootElement(RootElement rootElement) { + this.rootElements.add(rootElement); + } + + public List getItemDefinitions() { + return itemDefinitions; + } + + public List getRootElements() { + return rootElements; + } + + public List getInterfaces() { + return interfaces; + } + + public static org.kie.workbench.common.stunner.core.graph.content.Bounds absoluteBounds(final Node node) { + final Point2D point2D = GraphUtils.getComputedPosition(node); + final org.kie.workbench.common.stunner.core.graph.content.Bounds bounds = node.getContent().getBounds(); + return org.kie.workbench.common.stunner.core.graph.content.Bounds.create(point2D.getX(), + point2D.getY(), + point2D.getX() + bounds.getWidth(), + point2D.getY() + bounds.getHeight()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BoundaryEventPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BoundaryEventPropertyWriter.java new file mode 100644 index 00000000000..6055be6b767 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BoundaryEventPropertyWriter.java @@ -0,0 +1,81 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.Optional; + +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.EventDefinition; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bound; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.util.PropertyWriterUtils.getDockSourceNode; + +public class BoundaryEventPropertyWriter extends CatchEventPropertyWriter { + + private final BoundaryEvent event; + + public BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope) { + super(event, variableScope); + this.event = event; + } + + @Override + public void setCancelActivity(Boolean value) { + CustomAttribute.boundarycaForEvent.of(flowElement).set(value); + event.setCancelActivity(value); + } + + public void setParentActivity(ActivityPropertyWriter parent) { + event.setAttachedToRef(parent.getFlowElement()); + } + + @Override + public void addEventDefinition(EventDefinition eventDefinition) { + this.event.getEventDefinitions().add(eventDefinition); + } + + @Override + public void setAbsoluteBounds(Node node) { + Bound ul = node.getContent().getBounds().getUpperLeft(); + //docker information is relative + setDockerInfo(Point2D.create(ul.getX(), ul.getY())); + + Optional> dockSourceNode = getDockSourceNode(node); + if (dockSourceNode.isPresent()) { + //docked node bounds are relative to the dockSourceNode in Stunner, but not in bpmn2 standard so the node + //absolute bounds must be calculated by using hte dockSourceNode absolute coordinates. + Bounds dockSourceNodeBounds = absoluteBounds(dockSourceNode.get()); + Bounds nodeBounds = node.getContent().getBounds(); + double x = dockSourceNodeBounds.getX() + nodeBounds.getUpperLeft().getX(); + double y = dockSourceNodeBounds.getY() + nodeBounds.getUpperLeft().getY(); + super.setBounds(Bounds.create(x, y, x + nodeBounds.getWidth(), y + nodeBounds.getHeight())); + } else { + //uncommon case + super.setAbsoluteBounds(node); + } + } + + private void setDockerInfo(Point2D docker) { + CustomAttribute.dockerInfo.of(event).set(docker); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BusinessRuleTaskPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BusinessRuleTaskPropertyWriter.java new file mode 100644 index 00000000000..c9b021f1620 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BusinessRuleTaskPropertyWriter.java @@ -0,0 +1,92 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.BusinessRuleTask; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomInput; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.DecisionName; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.DmnModelName; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.Namespace; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.RuleFlowGroup; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.RuleLanguage; + +public class BusinessRuleTaskPropertyWriter extends ActivityPropertyWriter { + + private final BusinessRuleTask task; + private final CustomInput namespace; + private final CustomInput dmnModelName; + private final CustomInput decisionName; + + public BusinessRuleTaskPropertyWriter(BusinessRuleTask task, VariableScope variableScope) { + super(task, variableScope); + this.task = task; + + this.namespace = CustomInput.namespace.of(task); + this.addItemDefinition(this.namespace.typeDef()); + + this.dmnModelName = CustomInput.dmnModelName.of(task); + this.addItemDefinition(this.dmnModelName.typeDef()); + + this.decisionName = CustomInput.decisionName.of(task); + this.addItemDefinition(this.decisionName.typeDef()); + } + + public void setImplementation(RuleLanguage ruleLanguage) { + task.setImplementation(ruleLanguage.getValue()); + } + + public void setRuleFlowGroup(RuleFlowGroup ruleFlowGroup) { + CustomAttribute.ruleFlowGroup.of(baseElement).set(ruleFlowGroup.getValue()); + } + + public void setNamespace(Namespace namespace) { + this.namespace.set(namespace.getValue()); + } + + public void setDmnModelName(DmnModelName dmnModelName) { + this.dmnModelName.set(dmnModelName.getValue()); + } + + public void setDecisionName(DecisionName decisionName) { + this.decisionName.set(decisionName.getValue()); + } + + public void setOnEntryAction(OnEntryAction onEntryAction) { + Scripts.setOnEntryAction(flowElement, onEntryAction); + } + + public void setOnExitAction(OnExitAction onExitAction) { + Scripts.setOnExitAction(flowElement, onExitAction); + } + + public void setAsync(Boolean value) { + CustomElement.async.of(baseElement).set(value); + } + + public void setAdHocAutostart(Boolean value) { + CustomElement.autoStart.of(baseElement).set(value); + } + + public void setSlaDueDate(String value) { + CustomElement.slaDueDate.of(baseElement).set(value); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/CallActivityPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/CallActivityPropertyWriter.java new file mode 100644 index 00000000000..ec9f7388f39 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/CallActivityPropertyWriter.java @@ -0,0 +1,75 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.CallActivity; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; + +public class CallActivityPropertyWriter extends MultipleInstanceActivityPropertyWriter { + + private final CallActivity activity; + + public CallActivityPropertyWriter(CallActivity activity, VariableScope variableScope) { + super(activity, variableScope); + this.activity = activity; + } + + public void setOnEntryAction(OnEntryAction onEntryAction) { + Scripts.setOnEntryAction(activity, onEntryAction); + } + + public void setOnExitAction(OnExitAction onExitAction) { + Scripts.setOnExitAction(activity, onExitAction); + } + + public void setIndependent(Boolean independent) { + CustomAttribute.independent.of(activity).set(independent); + } + + public void setAbortParent(Boolean abortParent) { + CustomElement.abortParent.of(activity).set(abortParent); + } + + public void setWaitForCompletion(Boolean waitForCompletion) { + CustomAttribute.waitForCompletion.of(activity).set(waitForCompletion); + } + + public void setAsync(Boolean async) { + CustomElement.async.of(activity).set(async); + } + + public void setCalledElement(String value) { + activity.setCalledElement(value); + } + + public void setCase(Boolean isCase) { + CustomElement.isCase.of(flowElement).set(isCase); + } + + public void setAdHocAutostart(boolean autoStart) { + CustomElement.autoStart.of(flowElement).set(autoStart); + } + + public void setSlaDueDate(SLADueDate slaDueDate) { + CustomElement.slaDueDate.of(flowElement).set(slaDueDate.getValue()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/CatchEventPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/CatchEventPropertyWriter.java new file mode 100644 index 00000000000..db3cc55ee2c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/CatchEventPropertyWriter.java @@ -0,0 +1,98 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.List; + +import bpsim.ElementParameters; +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.OutputSet; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.InitializedVariable.InitializedOutputVariable; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.ParsedAssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.SimulationAttributeSets; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationAttributeSet; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class CatchEventPropertyWriter extends EventPropertyWriter { + + private final CatchEvent event; + private ElementParameters simulationParameters; + + public CatchEventPropertyWriter(CatchEvent event, VariableScope variableScope) { + super(event, variableScope); + this.event = event; + } + + public void setAssignmentsInfo(AssignmentsInfo info) { + ParsedAssignmentsInfo assignmentsInfo = ParsedAssignmentsInfo.of(info); + List outputs = + assignmentsInfo.createInitializedOutputVariables( + getId(), variableScope); + + if (outputs.isEmpty()) { + return; + } + if (outputs.size() > 1) { + throw new IllegalArgumentException("Output Associations should be at most 1 in Catch Events"); + } + + InitializedOutputVariable output = outputs.get(0); + + DataOutput dataOutput = output.getDataOutput(); + event.getDataOutputs().add(dataOutput); + getOutputSet().getDataOutputRefs().add(dataOutput); + + this.addItemDefinition(dataOutput.getItemSubjectRef()); + DataOutputAssociation dataOutputAssociation = output.getDataOutputAssociation(); + if (dataOutputAssociation != null) { + event.getDataOutputAssociation().add(dataOutputAssociation); + } + } + + private OutputSet getOutputSet() { + OutputSet outputSet = event.getOutputSet(); + if (outputSet == null) { + outputSet = bpmn2.createOutputSet(); + event.setOutputSet(outputSet); + } + return outputSet; + } + + public void setSimulationSet(SimulationAttributeSet simulationSet) { + this.simulationParameters = + SimulationAttributeSets.toElementParameters(simulationSet); + simulationParameters.setElementRef(getId()); + } + + public ElementParameters getSimulationParameters() { + return simulationParameters; + } + + @Override + public void addEventDefinition(EventDefinition eventDefinition) { + this.event.getEventDefinitions().add(eventDefinition); + } + + public void setCancelActivity(Boolean value) { + // this only makes sense for boundary events: ignore + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/DefinitionsPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/DefinitionsPropertyWriter.java new file mode 100644 index 00000000000..edd10eaffd3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/DefinitionsPropertyWriter.java @@ -0,0 +1,84 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.Collection; + +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.Process; +import org.eclipse.bpmn2.Relationship; +import org.eclipse.bpmn2.RootElement; +import org.eclipse.bpmn2.di.BPMNDiagram; + +public class DefinitionsPropertyWriter { + + private final Definitions definitions; + + public DefinitionsPropertyWriter(Definitions definitions) { + this.definitions = definitions; + definitions.setTargetNamespace("http://www.omg.org/bpmn20"); + setSchemaLocation(definitions); + } + + private static void setSchemaLocation(Definitions definitions) { + // TODO: Kogito - Demanding the "xsi" feature at this point fails, as the feature/package has not yet been resolved, and results on an invalid uri generated on the XML file. + /*ExtendedMetaData metadata = ExtendedMetaData.INSTANCE; + EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature( + "xsi", + "schemaLocation", + false, + false); + SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry( + extensionAttribute, + "http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd " + + "http://www.jboss.org/drools drools.xsd " + + "http://www.bpsim.org/schemas/1.0 bpsim.xsd " + + "http://www.omg.org/spec/DD/20100524/DC DC.xsd " + + "http://www.omg.org/spec/DD/20100524/DI DI.xsd "); + definitions.getAnyAttribute().add(extensionEntry);*/ + } + + public void setExporter(String exporter) { + definitions.setExporter(exporter); + } + + public void setExporterVersion(String version) { + definitions.setExporterVersion(version); + } + + public void setProcess(Process process) { + definitions.getRootElements().add(process); + } + + public void setDiagram(BPMNDiagram bpmnDiagram) { + definitions.getDiagrams().add(bpmnDiagram); + } + + public void setRelationship(Relationship relationship) { + relationship.getSources().add(definitions); + relationship.getTargets().add(definitions); + definitions.getRelationships().add(relationship); + } + + public void addAllRootElements(Collection rootElements) { + definitions.getRootElements().addAll(rootElements); + } + + public Definitions getDefinitions() { + return definitions; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/EventPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/EventPropertyWriter.java new file mode 100644 index 00000000000..93ba731ef45 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/EventPropertyWriter.java @@ -0,0 +1,212 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.ConditionalEventDefinition; +import org.eclipse.bpmn2.Error; +import org.eclipse.bpmn2.ErrorEventDefinition; +import org.eclipse.bpmn2.Escalation; +import org.eclipse.bpmn2.EscalationEventDefinition; +import org.eclipse.bpmn2.Event; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.MessageEventDefinition; +import org.eclipse.bpmn2.Signal; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.bpmn2.TerminateEventDefinition; +import org.eclipse.bpmn2.TimerEventDefinition; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Ids; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; +import org.kie.workbench.common.stunner.bpmn.definition.property.common.ConditionExpression; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalScope; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettings; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; + +public abstract class EventPropertyWriter extends PropertyWriter { + + public EventPropertyWriter(Event event, VariableScope variableScope) { + super(event, variableScope); + } + + public abstract void setAssignmentsInfo(AssignmentsInfo assignmentsInfo); + + public void addMessage(MessageRef messageRef) { + MessageEventDefinition messageEventDefinition = + bpmn2.createMessageEventDefinition(); + addEventDefinition(messageEventDefinition); + + String name = messageRef.getValue(); + if (name == null || name.isEmpty()) { + return; + } + + ItemDefinition itemDefinition = bpmn2.createItemDefinition(); + itemDefinition.setId(Ids.messageItem(name)); + itemDefinition.setStructureRef(messageRef.getStructure()); + + Message message = bpmn2.createMessage(); + message.setName(name); + message.setItemRef(itemDefinition); + messageEventDefinition.setMessageRef(message); + CustomAttribute.msgref.of(messageEventDefinition).set(name); + + addItemDefinition(itemDefinition); + addRootElement(message); + } + + public void addSignal(SignalRef signalRef) { + SignalEventDefinition signalEventDefinition = + bpmn2.createSignalEventDefinition(); + addEventDefinition(signalEventDefinition); + + Signal signal = bpmn2.createSignal(); + String name = signalRef.getValue(); + if (name == null || name.isEmpty()) { + return; + } + + signal.setName(name); + signal.setId(Ids.fromString(name)); + signalEventDefinition.setSignalRef(signal.getId()); + + addRootElement(signal); + } + + public void addSignalScope(SignalScope signalScope) { + CustomElement.scope.of(flowElement).set(signalScope.getValue()); + } + + public void addError(ErrorRef errorRef) { + Error error = bpmn2.createError(); + ErrorEventDefinition errorEventDefinition = + bpmn2.createErrorEventDefinition(); + addEventDefinition(errorEventDefinition); + + String errorCode = errorRef.getValue(); + if (errorCode == null || errorCode.isEmpty()) { + return; + } + + error.setId(errorCode); + error.setErrorCode(errorCode); + errorEventDefinition.setErrorRef(error); + + CustomAttribute.errorName.of(errorEventDefinition).set(errorCode); + addRootElement(error); + } + + public void addTerminate() { + TerminateEventDefinition terminateEventDefinition = + bpmn2.createTerminateEventDefinition(); + addEventDefinition(terminateEventDefinition); + } + + public void addTimer(TimerSettings timerSettings) { + TimerEventDefinition eventDefinition = + bpmn2.createTimerEventDefinition(); + + TimerSettingsValue timerSettingsValue = timerSettings.getValue(); + + String date = timerSettingsValue.getTimeDate(); + if (date != null) { + FormalExpression timeDate = bpmn2.createFormalExpression(); + FormalExpressionBodyHandler.of(timeDate).setBody(date); + eventDefinition.setTimeDate(timeDate); + } + + String duration = timerSettingsValue.getTimeDuration(); + if (duration != null) { + FormalExpression timeDuration = bpmn2.createFormalExpression(); + FormalExpressionBodyHandler.of(timeDuration).setBody(duration); + eventDefinition.setTimeDuration(timeDuration); + } + + String cycle = timerSettingsValue.getTimeCycle(); + String cycleLanguage = timerSettingsValue.getTimeCycleLanguage(); + if (cycle != null && cycleLanguage != null) { + FormalExpression timeCycleExpression = bpmn2.createFormalExpression(); + FormalExpressionBodyHandler.of(timeCycleExpression).setBody(cycle); + timeCycleExpression.setLanguage(cycleLanguage); + eventDefinition.setTimeCycle(timeCycleExpression); + } + + addEventDefinition(eventDefinition); + } + + public void addCondition(ConditionExpression condition) { + ConditionalEventDefinition conditionalEventDefinition = bpmn2.createConditionalEventDefinition(); + FormalExpression conditionExpression = bpmn2.createFormalExpression(); + + String languageFormat = Scripts.scriptLanguageToUri(condition.getValue().getLanguage(), + Scripts.LANGUAGE.DROOLS.format()); + conditionExpression.setLanguage(languageFormat); + + String conditionScript = condition.getValue().getScript(); + if (conditionScript != null && !conditionScript.isEmpty()) { + FormalExpressionBodyHandler.of(conditionExpression).setBody(asCData(conditionScript)); + } + + conditionalEventDefinition.setCondition(conditionExpression); + addEventDefinition(conditionalEventDefinition); + } + + public void addEscalation(EscalationRef escalationRef) { + EscalationEventDefinition escalationEventDefinition = + bpmn2.createEscalationEventDefinition(); + addEventDefinition(escalationEventDefinition); + + Escalation escalation = bpmn2.createEscalation(); + String escalationCode = escalationRef.getValue(); + if (escalationCode == null || escalationCode.isEmpty()) { + return; + } + + escalation.setId(Ids.fromString(escalationCode)); + escalation.setEscalationCode(escalationCode); + escalationEventDefinition.setEscalationRef(escalation); + + CustomAttribute.esccode.of(escalationEventDefinition).set(escalationCode); + addRootElement(escalation); + } + + public void addCompensation() { + CompensateEventDefinition compensationEventDefinition = + bpmn2.createCompensateEventDefinition(); + addEventDefinition(compensationEventDefinition); + } + + public void addSlaDueDate(SLADueDate slaDueDate) { + CustomElement.slaDueDate.of(flowElement).set(slaDueDate.getValue()); + } + + protected abstract void addEventDefinition(EventDefinition eventDefinition); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/FlatVariableScope.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/FlatVariableScope.java new file mode 100644 index 00000000000..68e171684fb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/FlatVariableScope.java @@ -0,0 +1,83 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * A flat variable scope, where no nesting information is used. + *

+ * In a flat scope there is no nesting. E.g.: + *

+ * Process P defines variables x,y + *

    + *
  • SubProcess P1 nested in P defines P1_x, P2_y
  • + *
  • SubProcess P2 nested in P defines P2_x
  • + *
+ *

+ * The FlatScope contains: + * + *

    + *
  • x
  • + *
  • y
  • + *
  • P1_x
  • + *
  • P1_y
  • + *
  • P2_x
  • + *
+ *

+ * Also, P1 may refer to x, y, P1_x, P1_y, but also to P2_x, P2_y + *

+ * In a flat scope, names can easily clash, + * but it's simple to implement (it's a Map). + *

+ * In future versions we might want to implement a more refined + * Scope notion with nesting; in this case, + * P1 may refer to x, y P1_x, P1_y, but NOT to P2_x, P2_y, because + * P2 does not nest in P1 + */ +public class FlatVariableScope implements VariableScope { + + private Map variables = new HashMap<>(); + + public Variable declare(String scopeId, String identifier, String type) { + Variable variable = new Variable(scopeId, identifier, type); + variables.put(identifier, variable); + return variable; + } + + public Variable declare(String scopeId, String identifier, String type, String kpi) { + Variable variable = new Variable(scopeId, identifier, type, kpi); + variables.put(identifier, variable); + return variable; + } + + public Optional lookup(String identifier) { + return Optional.ofNullable(variables.get(identifier)); + } + + public Collection getVariables(String scopeId) { + return variables.values() + .stream() + .filter(v -> v.getParentScopeId().equals(scopeId)) + .collect(Collectors.toList()); + } +} + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/GatewayPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/GatewayPropertyWriter.java new file mode 100644 index 00000000000..3c612f3c4e5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/GatewayPropertyWriter.java @@ -0,0 +1,106 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.List; + +import org.eclipse.bpmn2.ExclusiveGateway; +import org.eclipse.bpmn2.Gateway; +import org.eclipse.bpmn2.GatewayDirection; +import org.eclipse.bpmn2.InclusiveGateway; +import org.eclipse.bpmn2.SequenceFlow; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; + +public class GatewayPropertyWriter extends PropertyWriter { + + private final Gateway gateway; + private String defaultGatewayId; + + public GatewayPropertyWriter(Gateway gateway, VariableScope variableScope) { + super(gateway, variableScope); + this.gateway = gateway; + } + + public void setDefaultRoute(String defaultRouteExpression) { + if (defaultRouteExpression == null) { + return; + } + CustomAttribute.dg.of(gateway).set(defaultRouteExpression); + + String[] split = defaultRouteExpression.split(" : "); + this.defaultGatewayId = (split.length == 1) ? split[0] : split[1]; + } + + public void setSource(BasePropertyWriter source) { + setDefaultGateway(source); + } + + public void setTarget(BasePropertyWriter target) { + setDefaultGateway(target); + } + + private void setDefaultGateway(BasePropertyWriter propertyWriter) { + if (propertyWriter.getElement().getId().equals(defaultGatewayId)) { + if (gateway instanceof ExclusiveGateway) { + ((ExclusiveGateway) gateway).setDefault((SequenceFlow) propertyWriter.getElement()); + } else if (gateway instanceof InclusiveGateway) { + ((InclusiveGateway) gateway).setDefault((SequenceFlow) propertyWriter.getElement()); + } + } + } + + public void setGatewayDirection(Node n) { + long incoming = countEdges(n.getInEdges()); + long outgoing = countEdges(n.getOutEdges()); + + if (incoming <= 1 && outgoing > 1) { + gateway.setGatewayDirection(GatewayDirection.DIVERGING); + } else if (incoming > 1 && outgoing <= 1) { + gateway.setGatewayDirection(GatewayDirection.CONVERGING); + } + // temp. removing support for mixed gateway direction (not supported by runtime yet) +// else if (incoming > 1 && outgoing > 1) { +// gateway.setGatewayDirection(GatewayDirection.MIXED); +// } +// else if (incoming == 1 && outgoing == 1) { +// // this handles the 1:1 case of the diverging gateways +// } + else { + gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); + } + } + + public void setGatewayDirection(GatewayDirection direction) { + gateway.setGatewayDirection(direction); + } + + private long countEdges(List inEdges) { + return inEdges.stream() + .filter(e -> e.getContent() instanceof ViewConnector) + .count(); + } + + /** + * For testing purposes. + */ + String getDefaultGatewayId() { + return defaultGatewayId; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/GenericServiceTaskPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/GenericServiceTaskPropertyWriter.java new file mode 100644 index 00000000000..ab5b6b5870e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/GenericServiceTaskPropertyWriter.java @@ -0,0 +1,123 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.Interface; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.Operation; +import org.eclipse.bpmn2.ServiceTask; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.GenericServiceTaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts; +import org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class GenericServiceTaskPropertyWriter extends MultipleInstanceActivityPropertyWriter { + + private final ServiceTask task; + private final Interface iface; + + public GenericServiceTaskPropertyWriter(ServiceTask task, VariableScope variableScope) { + super(task, variableScope); + this.task = task; + this.iface = bpmn2.createInterface(); + } + + public void setValue(GenericServiceTaskValue value) { + //1 Implementation + String serviceImplementation = value.getServiceImplementation(); + task.setImplementation(GenericServiceTaskPropertyReader.getServiceImplementation(serviceImplementation)); + CustomAttribute.serviceImplementation.of(task).set(serviceImplementation); + + //------------------------------------------------------------- + + //2 Interface + String serviceInterface = value.getServiceInterface(); + + //in message + final Message inMessage; + ItemDefinition itemDefinitionInMsg = bpmn2.createItemDefinition(); + itemDefinitionInMsg.setId(task.getId() + "_InMessageType"); + itemDefinitionInMsg.setStructureRef(value.getInMessageStructure()); + addItemDefinition(itemDefinitionInMsg); + + inMessage = bpmn2.createMessage(); + inMessage.setId(task.getId() + "_InMessage"); + inMessage.setItemRef(itemDefinitionInMsg); + addRootElement(inMessage); + + //out message + final Message outMessage; + ItemDefinition itemDefinitionOutMsg = bpmn2.createItemDefinition(); + itemDefinitionOutMsg.setId(task.getId() + "_OutMessageType"); + itemDefinitionOutMsg.setStructureRef(value.getOutMessagetructure()); + addItemDefinition(itemDefinitionOutMsg); + + outMessage = bpmn2.createMessage(); + outMessage.setId(task.getId() + "_OutMessage"); + outMessage.setItemRef(itemDefinitionOutMsg); + addRootElement(outMessage); + + //custom attribute + CustomAttribute.serviceInterface.of(task).set(serviceInterface); + iface.setImplementationRef(serviceInterface); + iface.setName(serviceInterface); + iface.setId(task.getId() + "_ServiceInterface"); + + //------------------------------------------------------------- + + //3 Operation + String serviceOperation = value.getServiceOperation(); + CustomAttribute.serviceOperation.of(task).set(serviceOperation); + + Operation operation = bpmn2.createOperation(); + operation.setId(task.getId() + "_ServiceOperation"); + operation.setName(serviceOperation); + operation.setImplementationRef(serviceOperation); + + iface.getOperations().add(operation); + task.setOperationRef(operation); + addInterfaceDefinition(iface); + operation.setInMessageRef(inMessage); + operation.setOutMessageRef(outMessage); + } + + public void setAdHocAutostart(boolean autoStart) { + CustomElement.autoStart.of(task).set(autoStart); + } + + public void setAsync(boolean async) { + CustomElement.async.of(task).set(async); + } + + public void setSLADueDate(String slaDueDate) { + CustomElement.slaDueDate.of(task).set(slaDueDate); + } + + public void setOnEntryAction(OnEntryAction onEntryAction) { + Scripts.setOnEntryAction(task, onEntryAction); + } + + public void setOnExitAction(OnExitAction onExitAction) { + Scripts.setOnExitAction(task, onExitAction); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/LanePropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/LanePropertyWriter.java new file mode 100644 index 00000000000..84c43326a2a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/LanePropertyWriter.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import com.google.gwt.safehtml.shared.SafeHtmlUtils; +import org.eclipse.bpmn2.FlowNode; +import org.eclipse.bpmn2.Lane; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; + +public class LanePropertyWriter extends BasePropertyWriter { + + private final Lane lane; + + public LanePropertyWriter(Lane lane, VariableScope variableScope) { + super(lane, variableScope); + this.lane = lane; + } + + public void setName(String value) { + lane.setName(SafeHtmlUtils.htmlEscape(value.trim())); + CustomElement.name.of(lane).set(value); + } + + @Override + public Lane getElement() { + return (Lane) super.getElement(); + } + + @Override + public void addChild(BasePropertyWriter child) { + lane.getFlowNodeRefs().add((FlowNode) child.getElement()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/MultipleInstanceActivityPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/MultipleInstanceActivityPropertyWriter.java new file mode 100644 index 00000000000..a9339f014d7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/MultipleInstanceActivityPropertyWriter.java @@ -0,0 +1,234 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.List; +import java.util.Optional; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.Bpmn2Factory; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics; +import org.eclipse.bpmn2.OutputSet; +import org.eclipse.bpmn2.Property; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Ids; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils.isEmpty; + +public class MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { + + private MultiInstanceLoopCharacteristics miloop; + private InputOutputSpecification ioSpec; + private InputSet inputSet; + private OutputSet outputSet; + + public MultipleInstanceActivityPropertyWriter(Activity activity, VariableScope variableScope) { + super(activity, variableScope); + } + + public void setCollectionInput(String collectionInput) { + if (isEmpty(collectionInput)) { + return; + } + + setUpLoopCharacteristics(); + String suffix = "IN_COLLECTION"; + String id = Ids.dataInput(activity.getId(), suffix); + DataInput dataInputElement = createDataInput(id, suffix); + ioSpec.getDataInputs().add(dataInputElement); + + // check whether this exist + findPropertyById(collectionInput).ifPresent(prop -> { + dataInputElement.setItemSubjectRef(prop.getItemSubjectRef()); + + miloop.setLoopDataInputRef(dataInputElement); + + addSafe(inputSet.getDataInputRefs(), dataInputElement); + + DataInputAssociation dia = Bpmn2Factory.eINSTANCE.createDataInputAssociation(); + dia.getSourceRef().add(prop); + dia.setTargetRef(dataInputElement); + addSafe(activity.getDataInputAssociations(), dia); + }); + } + + public void setCollectionOutput(String collectionOutput) { + if (isEmpty(collectionOutput)) { + return; + } + + setUpLoopCharacteristics(); + String suffix = "OUT_COLLECTION"; + String id = Ids.dataOutput(activity.getId(), suffix); + DataOutput dataOutputElement = createDataOutput(id, suffix); + addSafe(ioSpec.getDataOutputs(), dataOutputElement); + + // check whether this exist or throws + findPropertyById(collectionOutput).ifPresent(prop -> { + dataOutputElement.setItemSubjectRef(prop.getItemSubjectRef()); + + miloop.setLoopDataOutputRef(dataOutputElement); + + addSafe(outputSet.getDataOutputRefs(), dataOutputElement); + + DataOutputAssociation doa = Bpmn2Factory.eINSTANCE.createDataOutputAssociation(); + doa.getSourceRef().add(dataOutputElement); + doa.setTargetRef(prop); + addSafe(activity.getDataOutputAssociations(), doa); + }); + } + + public void setInput(String name) { + setInput(name, true); + } + + protected void setInput(String name, boolean addDataInputAssociation) { + if (isEmpty(name)) { + return; + } + + setUpLoopCharacteristics(); + DataInput miDataInputElement = createDataInput(name, name); + ItemDefinition item = createItemDefinition(name); + addItemDefinition(item); + miDataInputElement.setItemSubjectRef(item); + miloop.setInputDataItem(miDataInputElement); + + String id = Ids.dataInput(activity.getId(), name); + DataInput dataInputElement = createDataInput(id, name); + dataInputElement.setItemSubjectRef(item); + addSafe(ioSpec.getDataInputs(), dataInputElement); + addSafe(inputSet.getDataInputRefs(), dataInputElement); + + if (addDataInputAssociation) { + DataInputAssociation dia = Bpmn2Factory.eINSTANCE.createDataInputAssociation(); + dia.getSourceRef().add(miDataInputElement); + dia.setTargetRef(dataInputElement); + addSafe(activity.getDataInputAssociations(), dia); + } + } + + public void setOutput(String name) { + setOutput(name, true); + } + + public void setOutput(String name, boolean addDataOutputAssociation) { + if (isEmpty(name)) { + return; + } + + setUpLoopCharacteristics(); + DataOutput miDataOutputElement = createDataOutput(name, name); + ItemDefinition item = createItemDefinition(name); + addItemDefinition(item); + miDataOutputElement.setItemSubjectRef(item); + miloop.setOutputDataItem(miDataOutputElement); + + String id = Ids.dataOutput(activity.getId(), name); + DataOutput dataOutputElement = createDataOutput(id, name); + dataOutputElement.setItemSubjectRef(item); + addSafe(ioSpec.getDataOutputs(), dataOutputElement); + addSafe(outputSet.getDataOutputRefs(), dataOutputElement); + + if (addDataOutputAssociation) { + DataOutputAssociation doa = Bpmn2Factory.eINSTANCE.createDataOutputAssociation(); + doa.getSourceRef().add(dataOutputElement); + doa.setTargetRef(miDataOutputElement); + addSafe(activity.getDataOutputAssociations(), doa); + } + } + + public void setCompletionCondition(String expression) { + if (!isEmpty(expression)) { + setUpLoopCharacteristics(); + FormalExpression formalExpression = bpmn2.createFormalExpression(); + FormalExpressionBodyHandler.of(formalExpression).setBody(asCData(expression)); + miloop.setCompletionCondition(formalExpression); + } + } + + public void setIsSequential(boolean sequential) { + setUpLoopCharacteristics(); + miloop.setIsSequential(sequential); + } + + protected void setUpLoopCharacteristics() { + if (miloop == null) { + miloop = bpmn2.createMultiInstanceLoopCharacteristics(); + activity.setLoopCharacteristics(miloop); + ioSpec = getIoSpecification(); + inputSet = getInputSet(ioSpec); + outputSet = getOutputSet(ioSpec); + } + } + + protected static DataInput createDataInput(String id, String name) { + DataInput dataInput = bpmn2.createDataInput(); + dataInput.setId(id); + dataInput.setName(name); + return dataInput; + } + + protected static DataOutput createDataOutput(String id, String name) { + DataOutput dataOutput = bpmn2.createDataOutput(); + dataOutput.setId(id); + dataOutput.setName(name); + return dataOutput; + } + + protected ItemDefinition createItemDefinition(String name) { + ItemDefinition item = bpmn2.createItemDefinition(); + item.setId(Ids.multiInstanceItemType(activity.getId(), name)); + item.setStructureRef(Object.class.getName()); + return item; + } + + protected static void addSafe(List inputs, DataInput dataInput) { + inputs.removeIf(existingDataInput -> dataInput.getId().equals(existingDataInput.getId())); + inputs.add(dataInput); + } + + protected static void addSafe(List associations, DataInputAssociation inputAssociation) { + associations.removeIf(existingDia -> inputAssociation.getTargetRef().getId().equals(existingDia.getTargetRef().getId())); + associations.add(inputAssociation); + } + + protected static void addSafe(List outputs, DataOutput dataOutput) { + outputs.removeIf(existingDataOutput -> dataOutput.getId().equals(existingDataOutput.getId())); + outputs.add(dataOutput); + } + + protected static void addSafe(List associations, DataOutputAssociation outputAssociation) { + associations.removeIf(existingDoa -> existingDoa.getSourceRef() != null && !existingDoa.getSourceRef().isEmpty() && outputAssociation.getSourceRef().get(0).getId().equals(existingDoa.getSourceRef().get(0).getId())); + associations.add(outputAssociation); + } + + private Optional findPropertyById(String id) { + return variableScope.lookup(id) + .map(VariableScope.Variable::getTypedIdentifier); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/MultipleInstanceSubProcessPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/MultipleInstanceSubProcessPropertyWriter.java new file mode 100644 index 00000000000..12d2e17ad06 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/MultipleInstanceSubProcessPropertyWriter.java @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.SubProcess; + +public class MultipleInstanceSubProcessPropertyWriter extends SubProcessPropertyWriter { + + public MultipleInstanceSubProcessPropertyWriter(SubProcess process, VariableScope variableScope) { + super(process, variableScope); + setUpLoopCharacteristics(); + } + + @Override + public void setInput(String name) { + setInput(name, false); + } + + @Override + public void setOutput(String name) { + setOutput(name, false); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ProcessPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ProcessPropertyWriter.java new file mode 100644 index 00000000000..dd09484a9d8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ProcessPropertyWriter.java @@ -0,0 +1,268 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +import bpsim.BPSimDataType; +import bpsim.BpsimPackage; +import bpsim.ElementParameters; +import bpsim.Scenario; +import bpsim.ScenarioParameters; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.LaneSet; +import org.eclipse.bpmn2.Process; +import org.eclipse.bpmn2.Property; +import org.eclipse.bpmn2.Relationship; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.di.BPMNPlane; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.dd.di.DiagramElement; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.impl.EStructuralFeatureImpl; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.DeclarationList; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.ElementContainer; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseProcessVariables; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpsim; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.di; + +public class ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { + + private static final String defaultRelationshipType = "BPSimData"; + private final Process process; + private final BPMNDiagram bpmnDiagram; + private final BPMNPlane bpmnPlane; + private Map childElements = new HashMap<>(); + private Collection simulationParameters = new ArrayList<>(); + + public ProcessPropertyWriter(Process process, VariableScope variableScope) { + super(process, variableScope); + this.process = process; + + this.bpmnDiagram = di.createBPMNDiagram(); + bpmnDiagram.setId(process.getId()); + + this.bpmnPlane = di.createBPMNPlane(); + bpmnDiagram.setPlane(bpmnPlane); + } + + public void setId(String value) { + // ids should be properly sanitized at a higher level + String sanitized = Objects.nonNull(value) ? value.replaceAll("\\s", "") : value; + process.setId(sanitized); + } + + public Process getProcess() { + return process; + } + + public void addChildShape(BPMNShape shape) { + if (shape == null) { + return; + } + List planeElement = bpmnPlane.getPlaneElement(); + if (planeElement.contains(shape)) { + throw new IllegalArgumentException("Cannot add the same shape twice: " + shape.getId()); + } + planeElement.add(shape); + } + + public void addChildEdge(BPMNEdge edge) { + if (edge == null) { + return; + } + List planeElement = bpmnPlane.getPlaneElement(); + if (planeElement.contains(edge)) { + throw new IllegalArgumentException("Cannot add the same edge twice: " + edge.getId()); + } + planeElement.add(edge); + } + + public BPMNDiagram getBpmnDiagram() { + bpmnDiagram.getPlane().setBpmnElement(process); + return bpmnDiagram; + } + + public void addChildElement(BasePropertyWriter p) { + Processes.addChildElement( + p, + childElements, + process, + simulationParameters, + itemDefinitions, + rootElements); + + addChildShape(p.getShape()); + addChildEdge(p.getEdge()); + + if (p instanceof SubProcessPropertyWriter) { + addSubProcess((SubProcessPropertyWriter) p); + } + } + + // recursively add all child shapes and edges (`di:` namespace) + // because these DO NOT nest (as opposed to `bpmn2:` namespace where subProcesses nest) + private void addSubProcess(SubProcessPropertyWriter p) { + Collection childElements = + p.getChildElements(); + + childElements.forEach(el -> { + addChildShape(el.getShape()); + addChildEdge(el.getEdge()); + if (el instanceof SubProcessPropertyWriter) { + addSubProcess((SubProcessPropertyWriter) el); + } + }); + } + + @Override + public Collection getChildElements() { + return this.childElements.values(); + } + + public BasePropertyWriter getChildElement(String id) { + BasePropertyWriter propertyWriter = this.childElements.get(id); + return propertyWriter; + } + + public void setName(String value) { + process.setName(value); + } + + public void setExecutable(Boolean value) { + process.setIsExecutable(value); + } + + public void setPackage(String value) { + CustomAttribute.packageName.of(process).set(value); + } + + public void setVersion(String value) { + CustomAttribute.version.of(process).set(value); + } + + public void setAdHoc(Boolean adHoc) { + CustomAttribute.adHoc.of(process).set(adHoc); + } + + public void setDescription(String value) { + CustomElement.description.of(process).set(value); + } + + public void setProcessVariables(BaseProcessVariables processVariables) { + String value = processVariables.getValue(); + DeclarationList declarationList = DeclarationList.fromString(value); + + List properties = process.getProperties(); + declarationList.getDeclarations().forEach(decl -> { + VariableScope.Variable variable = + variableScope.declare(this.process.getId(), decl.getIdentifier(), decl.getType(), decl.getKpi()); + if (Boolean.parseBoolean(decl.getKpi())) { + CustomElement.customKPI.of(variable.getTypedIdentifier()).set(true); + } + properties.add(variable.getTypedIdentifier()); + this.itemDefinitions.add(variable.getTypeDeclaration()); + }); + } + + public void setCaseFileVariables(CaseFileVariables caseFileVariables) { + String value = caseFileVariables.getValue(); + DeclarationList declarationList = DeclarationList.fromString(value); + + List properties = process.getProperties(); + declarationList.getDeclarations().forEach(decl -> { + VariableScope.Variable variable = + variableScope.declare(this.process.getId(), + CaseFileVariables.CASE_FILE_PREFIX + decl.getIdentifier(), + decl.getType()); + properties.add(variable.getTypedIdentifier()); + this.itemDefinitions.add(variable.getTypeDeclaration()); + }); + } + + public void setCaseIdPrefix(CaseIdPrefix caseIdPrefix) { + CustomElement.caseIdPrefix.of(process).set(caseIdPrefix.getValue()); + } + + public void setCaseRoles(CaseRoles roles) { + CustomElement.caseRole.of(process).set(roles.getValue()); + } + + public void setGlobalVariables(GlobalVariables globalVariables) { + CustomElement.globalVariables.of(process).set(globalVariables.getValue()); + } + + public void setSlaDueDate(SLADueDate slaDueDate) { + CustomElement.slaDueDate.of(process).set(slaDueDate.getValue()); + } + + public void addLaneSet(Collection lanes) { + if (lanes.isEmpty()) { + return; + } + LaneSet laneSet = bpmn2.createLaneSet(); + List laneList = laneSet.getLanes(); + lanes.forEach(l -> laneList.add(l.getElement())); + process.getLaneSets().add(laneSet); + lanes.forEach(l -> { + this.childElements.put(l.getElement().getId(), l); + addChildShape(l.getShape()); + }); + } + + public Collection getSimulationParameters() { + return simulationParameters; + } + + public Relationship getRelationship() { + Relationship relationship = bpmn2.createRelationship(); + relationship.setType(defaultRelationshipType); + BPSimDataType simDataType = bpsim.createBPSimDataType(); + // currently support single scenario + Scenario defaultScenario = bpsim.createScenario(); + ScenarioParameters scenarioParameters = bpsim.createScenarioParameters(); + defaultScenario.setId("default"); // single scenario suppoert + defaultScenario.setName("Simulationscenario"); // single scenario support + defaultScenario.setScenarioParameters(scenarioParameters); + simDataType.getScenario().add(defaultScenario); + ExtensionAttributeValue extensionElement = bpmn2.createExtensionAttributeValue(); + relationship.getExtensionValues().add(extensionElement); + FeatureMap.Entry extensionElementEntry = new EStructuralFeatureImpl.SimpleFeatureMapEntry( + (EStructuralFeature.Internal) BpsimPackage.Literals.DOCUMENT_ROOT__BP_SIM_DATA, + simDataType); + relationship.getExtensionValues().get(0).getValue().add(extensionElementEntry); + defaultScenario.getElementParameters().addAll(simulationParameters); + + return relationship; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/Processes.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/Processes.java new file mode 100644 index 00000000000..d6d842ac8ac --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/Processes.java @@ -0,0 +1,70 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import bpsim.ElementParameters; +import org.eclipse.bpmn2.Artifact; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.FlowElementsContainer; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Process; +import org.eclipse.bpmn2.RootElement; +import org.eclipse.bpmn2.SubProcess; + +class Processes { + + static void addChildElement( + BasePropertyWriter p, + Map childElements, + FlowElementsContainer process, + Collection simulationParameters, + List itemDefinitions, + List rootElements) { + childElements.put(p.getElement().getId(), p); + + if (p.getElement() instanceof FlowElement) { + // compatibility fix: boundary events should always occur at the bottom + // otherwise they will be drawn at an incorrect position on load + if (p instanceof BoundaryEventPropertyWriter) { + process.getFlowElements().add((FlowElement) p.getElement()); + } else { + process.getFlowElements().add(0, (FlowElement) p.getElement()); + p.getElement(); + } + } else if (p.getElement() instanceof Artifact) { + if (process instanceof Process) { + ((Process) process).getArtifacts().add((Artifact) p.getElement()); + } else if (process instanceof SubProcess) { + ((SubProcess) process).getArtifacts().add((Artifact) p.getElement()); + } + } + + if (p instanceof PropertyWriter) { + ElementParameters sp = ((PropertyWriter) p).getSimulationParameters(); + if (sp != null) { + simulationParameters.add(sp); + } + } + itemDefinitions.addAll(p.getItemDefinitions()); + rootElements.addAll(p.getRootElements()); + rootElements.addAll(p.getInterfaces()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/PropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/PropertyWriter.java new file mode 100644 index 00000000000..28f628a9525 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/PropertyWriter.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import bpsim.ElementParameters; +import com.google.gwt.safehtml.shared.SafeHtmlUtils; +import org.eclipse.bpmn2.FlowElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; + +public class PropertyWriter extends BasePropertyWriter { + + protected final FlowElement flowElement; + + public PropertyWriter(FlowElement flowElement, VariableScope variableScope) { + super(flowElement, variableScope); + this.flowElement = flowElement; + } + + public FlowElement getFlowElement() { + return flowElement; + } + + public void setName(String value) { + if (value == null || value.isEmpty()) { + return; + } + flowElement.setName(SafeHtmlUtils.htmlEscape(value.trim())); + CustomElement.name.of(flowElement).set(value); + } + + public ElementParameters getSimulationParameters() { + return null; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/PropertyWriterFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/PropertyWriterFactory.java new file mode 100644 index 00000000000..c9e0833377f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/PropertyWriterFactory.java @@ -0,0 +1,127 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.Association; +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.BusinessRuleTask; +import org.eclipse.bpmn2.CallActivity; +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.Gateway; +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.Process; +import org.eclipse.bpmn2.ScriptTask; +import org.eclipse.bpmn2.SequenceFlow; +import org.eclipse.bpmn2.ServiceTask; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.TextAnnotation; +import org.eclipse.bpmn2.ThrowEvent; +import org.eclipse.bpmn2.UserTask; + +public class PropertyWriterFactory { + + protected final VariableScope variableScope = new FlatVariableScope(); + + public UserTaskPropertyWriter of(UserTask e) { + return new UserTaskPropertyWriter(e, variableScope); + } + + public ThrowEventPropertyWriter of(ThrowEvent e) { + return new ThrowEventPropertyWriter(e, variableScope); + } + + public PropertyWriter of(FlowElement e) { + return new PropertyWriter(e, variableScope); + } + + public CallActivityPropertyWriter of(CallActivity e) { + return new CallActivityPropertyWriter(e, variableScope); + } + + public BoundaryEventPropertyWriter of(BoundaryEvent e) { + return new BoundaryEventPropertyWriter(e, variableScope); + } + + public CatchEventPropertyWriter of(CatchEvent e) { + return new CatchEventPropertyWriter(e, variableScope); + } + + public BusinessRuleTaskPropertyWriter of(BusinessRuleTask e) { + return new BusinessRuleTaskPropertyWriter(e, variableScope); + } + + public DefinitionsPropertyWriter of(Definitions e) { + return new DefinitionsPropertyWriter(e); + } + + public AdHocSubProcessPropertyWriter of(AdHocSubProcess e) { + return new AdHocSubProcessPropertyWriter(e, variableScope); + } + + public MultipleInstanceSubProcessPropertyWriter ofMultipleInstanceSubProcess(SubProcess e) { + return new MultipleInstanceSubProcessPropertyWriter(e, variableScope); + } + + public SubProcessPropertyWriter of(SubProcess e) { + return new SubProcessPropertyWriter(e, variableScope); + } + + public ProcessPropertyWriter of(Process e) { + return new ProcessPropertyWriter(e, variableScope); + } + + public SequenceFlowPropertyWriter of(SequenceFlow e) { + return new SequenceFlowPropertyWriter(e, variableScope); + } + + public AssociationPropertyWriter of(Association e) { + return new AssociationPropertyWriter(e, variableScope); + } + + public GatewayPropertyWriter of(Gateway e) { + return new GatewayPropertyWriter(e, variableScope); + } + + public LanePropertyWriter of(Lane e) { + return new LanePropertyWriter(e, variableScope); + } + + public ActivityPropertyWriter of(Activity e) { + return new ActivityPropertyWriter(e, variableScope); + } + + public ScriptTaskPropertyWriter of(ScriptTask e) { + return new ScriptTaskPropertyWriter(e, variableScope); + } + + public ServiceTaskPropertyWriter of(Task e) { + return new ServiceTaskPropertyWriter(e, variableScope); + } + + public GenericServiceTaskPropertyWriter of(ServiceTask e) { + return new GenericServiceTaskPropertyWriter(e, variableScope); + } + + public TextAnnotationPropertyWriter of(TextAnnotation e) { + return new TextAnnotationPropertyWriter(e, variableScope); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ScriptTaskPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ScriptTaskPropertyWriter.java new file mode 100644 index 00000000000..10f63de3e2e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ScriptTaskPropertyWriter.java @@ -0,0 +1,51 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.ScriptTask; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; + +public class ScriptTaskPropertyWriter extends ActivityPropertyWriter { + + private final ScriptTask scriptTask; + + public ScriptTaskPropertyWriter(ScriptTask scriptTask, VariableScope variableScope) { + super(scriptTask, variableScope); + this.scriptTask = scriptTask; + } + + public void setScript(ScriptTypeValue script) { + scriptTask.setScriptFormat( + Scripts.scriptLanguageToUri(script.getLanguage())); + String scriptText = script.getScript(); + if (scriptText != null && !scriptText.isEmpty()) { + scriptTask.setScript(asCData(scriptText)); + } + } + + public void setAsync(Boolean async) { + CustomElement.async.of(scriptTask).set(async); + } + + public void setAdHocAutostart(Boolean value) { + CustomElement.autoStart.of(scriptTask).set(value); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/SequenceFlowPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/SequenceFlowPropertyWriter.java new file mode 100644 index 00000000000..96e1ddc0a30 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/SequenceFlowPropertyWriter.java @@ -0,0 +1,106 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.FlowNode; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.SequenceFlow; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.util.PropertyWriterUtils; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.ControlPoint; +import org.kie.workbench.common.stunner.core.graph.content.view.DiscreteConnection; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; + +public class SequenceFlowPropertyWriter extends PropertyWriter { + + private final SequenceFlow sequenceFlow; + private BasePropertyWriter source; + private BasePropertyWriter target; + private BPMNEdge bpmnEdge; + + public SequenceFlowPropertyWriter(SequenceFlow sequenceFlow, VariableScope variableScope) { + super(sequenceFlow, variableScope); + this.sequenceFlow = sequenceFlow; + } + + public void setAutoConnectionSource(Connection connection) { + DiscreteConnection c = (DiscreteConnection) connection; + CustomElement.autoConnectionSource.of(sequenceFlow).set(c.isAuto()); + } + + public void setAutoConnectionTarget(Connection connection) { + DiscreteConnection c = (DiscreteConnection) connection; + CustomElement.autoConnectionTarget.of(sequenceFlow).set(c.isAuto()); + } + + public void setConnection(ViewConnector connector) { + Connection sourceConnection = connector.getSourceConnection().get(); + Connection targetConnection = connector.getTargetConnection().get(); + + setAutoConnectionSource(sourceConnection); + setAutoConnectionTarget(targetConnection); + + ControlPoint[] controlPoints = connector.getControlPoints(); + bpmnEdge = PropertyWriterUtils.createBPMNEdge(source, target, sourceConnection, controlPoints, targetConnection); + bpmnEdge.setBpmnElement(sequenceFlow); + } + + public void setSource(BasePropertyWriter pSrc) { + this.source = pSrc; + sequenceFlow.setSourceRef((FlowNode) pSrc.getElement()); + pSrc.setTarget(this); + } + + public void setTarget(BasePropertyWriter pTgt) { + this.target = pTgt; + sequenceFlow.setTargetRef((FlowNode) pTgt.getElement()); + pTgt.setSource(this); + } + + public BPMNEdge getEdge() { + return bpmnEdge; + } + + public void setPriority(String value) { + if (value != null && !value.isEmpty()) { + CustomAttribute.priority.of(sequenceFlow).set(value); + } + } + + public void setConditionExpression(ScriptTypeValue scriptTypeValue) { + String language = scriptTypeValue.getLanguage(); + String script = scriptTypeValue.getScript(); + + if (script != null && !script.isEmpty()) { + FormalExpression formalExpression = bpmn2.createFormalExpression(); + String uri = Scripts.scriptLanguageToUri(language); + formalExpression.setLanguage(uri); + FormalExpressionBodyHandler.of(formalExpression).setBody(asCData(script)); + sequenceFlow.setConditionExpression(formalExpression); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ServiceTaskPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ServiceTaskPropertyWriter.java new file mode 100644 index 00000000000..e1d611846cd --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ServiceTaskPropertyWriter.java @@ -0,0 +1,63 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.Task; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomInput; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; + +public class ServiceTaskPropertyWriter extends ActivityPropertyWriter { + + private final Task task; + + public ServiceTaskPropertyWriter(Task task, VariableScope variableScope) { + super(task, variableScope); + this.task = task; + } + + public void setAsync(Boolean value) { + CustomElement.async.of(baseElement).set(value); + } + + public void setAdHocAutostart(Boolean value) { + CustomElement.autoStart.of(baseElement).set(value); + } + + public void setOnEntryAction(OnEntryAction onEntryAction) { + Scripts.setOnEntryAction(flowElement, onEntryAction); + } + + public void setOnExitAction(OnExitAction onExitAction) { + Scripts.setOnExitAction(flowElement, onExitAction); + } + + public void setServiceTaskName(String name) { + CustomAttribute.serviceTaskName.of(flowElement).set(name); + } + + public void setTaskName(String value) { + CustomInput.taskName.of(task).set(value); + } + + public void setSlaDueDate(String value) { + CustomElement.slaDueDate.of(baseElement).set(value); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/SubProcessPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/SubProcessPropertyWriter.java new file mode 100644 index 00000000000..5ed1dd11bc6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/SubProcessPropertyWriter.java @@ -0,0 +1,149 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import bpsim.ElementParameters; +import org.eclipse.bpmn2.LaneSet; +import org.eclipse.bpmn2.Property; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.DeclarationList; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.ElementContainer; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.SimulationSets; +import org.kie.workbench.common.stunner.bpmn.definition.BaseAdHocSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseProcessVariables; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class SubProcessPropertyWriter extends MultipleInstanceActivityPropertyWriter implements ElementContainer { + + protected final SubProcess process; + private Collection simulationParameters = new ArrayList<>(); + private Map childElements = new HashMap<>(); + + public SubProcessPropertyWriter(SubProcess process, VariableScope variableScope) { + super(process, variableScope); + this.process = process; + } + + public void addChildElement(BasePropertyWriter p) { + p.setParent(this); + Processes.addChildElement( + p, + childElements, + process, + simulationParameters, + itemDefinitions, + rootElements); + } + + @Override + public Collection getChildElements() { + return childElements.values(); + } + + public BasePropertyWriter getChildElement(String id) { + return this.childElements.get(id); + } + + @Override + public void addChildEdge(BPMNEdge edge) { + + } + + public void setDescription(String value) { + CustomElement.description.of(flowElement).set(value); + } + + public void setSimulationSet(SimulationSet simulations) { + ElementParameters elementParameters = SimulationSets.toElementParameters(simulations); + elementParameters.setElementRef(this.baseElement.getId()); + this.simulationParameters.add(elementParameters); + } + + public void setProcessVariables(BaseProcessVariables processVariables) { + String value = processVariables.getValue(); + DeclarationList declarationList = DeclarationList.fromString(value); + + List properties = process.getProperties(); + declarationList.getDeclarations().forEach(decl -> { + VariableScope.Variable variable = + variableScope.declare(this.process.getId(), decl.getIdentifier(), decl.getType()); + if (Boolean.parseBoolean(decl.getKpi())) { + CustomElement.customKPI.of(variable.getTypedIdentifier()).set(true); + } + properties.add(variable.getTypedIdentifier()); + this.itemDefinitions.add(variable.getTypeDeclaration()); + }); + } + + public void addLaneSet(Collection lanes) { + if (lanes.isEmpty()) { + return; + } + LaneSet laneSet = bpmn2.createLaneSet(); + List laneList = laneSet.getLanes(); + lanes.forEach(l -> laneList.add(l.getElement())); + process.getLaneSets().add(laneSet); + lanes.forEach(l -> { + this.childElements.put(l.getElement().getId(), l); + }); + } + + public void setOnEntryAction(OnEntryAction onEntryAction) { + Scripts.setOnEntryAction(process, onEntryAction); + } + + public void setOnExitAction(OnExitAction onExitAction) { + Scripts.setOnExitAction(process, onExitAction); + } + + public void setAsync(Boolean isAsync) { + CustomElement.async.of(flowElement).set(isAsync); + } + + public void setSlaDueDate(SLADueDate slaDueDate) { + CustomElement.slaDueDate.of(flowElement).set(slaDueDate.getValue()); + } + + @Override + public void setAbsoluteBounds(Node node) { + super.setAbsoluteBounds(node); + Object definition = node.getContent().getDefinition(); + if (definition instanceof BaseAdHocSubprocess || + definition instanceof EventSubprocess || + definition instanceof EmbeddedSubprocess) { + shape.setIsExpanded(true); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/TextAnnotationPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/TextAnnotationPropertyWriter.java new file mode 100644 index 00000000000..ca1edad19c0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/TextAnnotationPropertyWriter.java @@ -0,0 +1,43 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import com.google.gwt.safehtml.shared.SafeHtmlUtils; +import org.eclipse.bpmn2.TextAnnotation; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; + +public class TextAnnotationPropertyWriter extends PropertyWriter { + + private final TextAnnotation element; + + public TextAnnotationPropertyWriter(TextAnnotation element, VariableScope variableScope) { + super(element, variableScope); + this.element = element; + } + + public void setName(String value) { + final String escaped = SafeHtmlUtils.htmlEscape(value.trim()); + element.setText(escaped); + element.setName(escaped); + CustomElement.name.of(element).set(value); + } + + @Override + public TextAnnotation getElement() { + return (TextAnnotation) super.getElement(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ThrowEventPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ThrowEventPropertyWriter.java new file mode 100644 index 00000000000..3c2e6b169fa --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ThrowEventPropertyWriter.java @@ -0,0 +1,85 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.List; + +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.ThrowEvent; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.InitializedVariable.InitializedInputVariable; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.ParsedAssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.AssignmentsInfos.isReservedIdentifier; + +public class ThrowEventPropertyWriter extends EventPropertyWriter { + + private final ThrowEvent throwEvent; + + public ThrowEventPropertyWriter(ThrowEvent flowElement, VariableScope variableScope) { + super(flowElement, variableScope); + this.throwEvent = flowElement; + } + + @Override + public void setAssignmentsInfo(AssignmentsInfo info) { + ParsedAssignmentsInfo assignmentsInfo = ParsedAssignmentsInfo.of(info); + List inputs = + assignmentsInfo.createInitializedInputVariables(getId(), variableScope); + + if (inputs.isEmpty()) { + return; + } + if (inputs.size() > 1) { + throw new IllegalArgumentException("Input Associations should be at most 1 in Throw Events"); + } + + InitializedInputVariable input = inputs.get(0); + + if (isReservedIdentifier(input.getIdentifier())) { + return; + } + + DataInput dataInput = input.getDataInput(); + throwEvent.getDataInputs().add(dataInput); + getInputSet().getDataInputRefs().add(dataInput); + + this.addItemDefinition(input.getItemDefinition()); + DataInputAssociation dataInputAssociation = input.getDataInputAssociation(); + if (dataInputAssociation != null) { + throwEvent.getDataInputAssociation().add(dataInputAssociation); + } + } + + private InputSet getInputSet() { + InputSet inputSet = throwEvent.getInputSet(); + if (inputSet == null) { + inputSet = bpmn2.createInputSet(); + throwEvent.setInputSet(inputSet); + } + return inputSet; + } + + @Override + protected void addEventDefinition(EventDefinition eventDefinition) { + this.throwEvent.getEventDefinitions().add(eventDefinition); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/UserTaskPropertyWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/UserTaskPropertyWriter.java new file mode 100644 index 00000000000..3786274ff30 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/UserTaskPropertyWriter.java @@ -0,0 +1,202 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.PotentialOwner; +import org.eclipse.bpmn2.ResourceAssignmentExpression; +import org.eclipse.bpmn2.UserTask; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomInput; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.ParsedNotificationsInfos; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.ParsedReassignmentsInfos; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations.AssociationType; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; +import org.kie.workbench.common.stunner.bpmn.definition.property.assignee.Actors; +import org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationTypeListValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentTypeListValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; +import org.uberfire.commons.uuid.UUID; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class UserTaskPropertyWriter extends MultipleInstanceActivityPropertyWriter { + + private final UserTask task; + private final CustomInput description; + private final CustomInput createdBy; + private final CustomInput taskName; + private final CustomInput groupId; + private final CustomInput skippable; + private final CustomInput priority; + private final CustomInput subject; + private final CustomInput content; + private final CustomInput notStartedReassign; + private final CustomInput notCompletedReassign; + private final CustomInput notStartedNotify; + private final CustomInput notCompletedNotify; + + public UserTaskPropertyWriter(UserTask task, VariableScope variableScope) { + super(task, variableScope); + this.task = task; + + this.skippable = CustomInput.skippable.of(task); + this.addItemDefinition(this.skippable.typeDef()); + + this.priority = CustomInput.priority.of(task); + this.addItemDefinition(this.priority.typeDef()); + + this.subject = CustomInput.subject.of(task); + this.addItemDefinition(this.subject.typeDef()); + + this.description = CustomInput.description.of(task); + this.addItemDefinition(this.description.typeDef()); + + this.createdBy = CustomInput.createdBy.of(task); + this.addItemDefinition(this.createdBy.typeDef()); + + this.taskName = CustomInput.taskName.of(task); + this.addItemDefinition(this.taskName.typeDef()); + + this.groupId = CustomInput.groupId.of(task); + this.addItemDefinition(this.groupId.typeDef()); + + this.content = CustomInput.content.of(task); + this.addItemDefinition(this.content.typeDef()); + + this.notStartedReassign = CustomInput.notStartedReassign.of(task); + this.addItemDefinition(this.notStartedReassign.typeDef()); + + this.notCompletedReassign = CustomInput.notCompletedReassign.of(task); + this.addItemDefinition(this.notCompletedReassign.typeDef()); + + this.notStartedNotify = CustomInput.notStartedNotify.of(task); + this.addItemDefinition(this.notStartedNotify.typeDef()); + + this.notCompletedNotify = CustomInput.notCompletedNotify.of(task); + this.addItemDefinition(this.notCompletedNotify.typeDef()); + } + + public void setAsync(boolean async) { + CustomElement.async.of(task).set(async); + } + + public void setSkippable(boolean skippable) { + this.skippable.set(skippable); + } + + public void setPriority(String priority) { + this.priority.set(priority); + } + + public void setSubject(String subject) { + this.subject.set(subject); + } + + public void setDescription(String description) { + this.description.set(description); + } + + public void setCreatedBy(String createdBy) { + this.createdBy.set(createdBy); + } + + public void setAdHocAutostart(boolean autoStart) { + CustomElement.autoStart.of(task).set(autoStart); + } + + public void setTaskName(String taskName) { + this.taskName.set(taskName); + } + + public void setActors(Actors actors) { + for (String actor : fromActorString(actors.getValue())) { + PotentialOwner potentialOwner = bpmn2.createPotentialOwner(); + potentialOwner.setId(UUID.uuid()); + + FormalExpression formalExpression = bpmn2.createFormalExpression(); + FormalExpressionBodyHandler.of(formalExpression).setBody(actor); + + ResourceAssignmentExpression resourceAssignmentExpression = + bpmn2.createResourceAssignmentExpression(); + resourceAssignmentExpression.setExpression(formalExpression); + + potentialOwner.setResourceAssignmentExpression(resourceAssignmentExpression); + + task.getResources().add(potentialOwner); + } + } + + public void setReassignments(ReassignmentsInfo reassignments) { + fromReassignment(reassignments.getValue()); + } + + private List fromActorString(String delimitedActors) { + String[] split = delimitedActors.split(","); + if (split.length == 1 && split[0].isEmpty()) { + return Collections.emptyList(); + } else { + return Arrays.asList(split); + } + } + + private void fromReassignment(ReassignmentTypeListValue value) { + if (value != null && !value.getValues().isEmpty()) { + notStartedReassign.set(ParsedReassignmentsInfos.ofCDATA(value, AssociationType.NOT_STARTED_REASSIGN)); + notCompletedReassign.set(ParsedReassignmentsInfos.ofCDATA(value, AssociationType.NOT_COMPLETED_REASSIGN)); + } + } + + public void setGroupId(String value) { + groupId.set(value); + } + + public void setOnEntryAction(OnEntryAction onEntryAction) { + Scripts.setOnEntryAction(task, onEntryAction); + } + + public void setOnExitAction(OnExitAction onExitAction) { + Scripts.setOnExitAction(task, onExitAction); + } + + public void setContent(String content) { + this.content.set(content); + } + + public void setSLADueDate(String slaDueDate) { + CustomElement.slaDueDate.of(task).set(slaDueDate); + } + + public void setNotifications(NotificationsInfo notificationsInfo) { + fromNotification(notificationsInfo.getValue()); + } + + private void fromNotification(NotificationTypeListValue value) { + if (value != null && !value.getValues().isEmpty()) { + notStartedNotify.set(ParsedNotificationsInfos.ofCDATA(value, AssociationType.NOT_STARTED_NOTIFY)); + notCompletedNotify.set(ParsedNotificationsInfos.ofCDATA(value, AssociationType.NOT_COMPLETED_NOTIFY)); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/VariableScope.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/VariableScope.java new file mode 100644 index 00000000000..e2e90de53d0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/VariableScope.java @@ -0,0 +1,78 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.Collection; +import java.util.Optional; + +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Property; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.VariableDeclaration; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Ids; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public interface VariableScope { + + Variable declare(String scopeId, String identifier, String type); + + Optional lookup(String identifier); + + Variable declare(String scopeId, String identifier, String type, String kpi); + + Collection getVariables(String scopeId); + + class Variable { + + String parentScopeId; + VariableDeclaration declaration; + ItemDefinition typeDeclaration; + Property typedIdentifier; + String kpi; + + Variable(String parentScopeId, String identifier, String type) { + this.parentScopeId = parentScopeId; + this.declaration = new VariableDeclaration(identifier, type); + + this.typeDeclaration = bpmn2.createItemDefinition(); + this.typeDeclaration.setId(Ids.item(identifier)); + this.typeDeclaration.setStructureRef(type); + + this.typedIdentifier = bpmn2.createProperty(); + this.typedIdentifier.setId(Ids.typedIdentifier(parentScopeId, identifier)); + this.typedIdentifier.setName(identifier); + this.typedIdentifier.setItemSubjectRef(typeDeclaration); + } + + Variable(String parentScopeId, String identifier, String type, String kpi) { + this(parentScopeId, identifier, type); + this.kpi = kpi; + } + + public ItemDefinition getTypeDeclaration() { + return typeDeclaration; + } + + public Property getTypedIdentifier() { + return typedIdentifier; + } + + public String getParentScopeId() { + return parentScopeId; + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/util/PropertyWriterUtils.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/util/PropertyWriterUtils.java new file mode 100644 index 00000000000..cdede08a176 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/util/PropertyWriterUtils.java @@ -0,0 +1,123 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.util; + +import java.util.List; +import java.util.Optional; + +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.dd.dc.Bounds; +import org.eclipse.dd.dc.Point; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Ids; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Dock; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.ControlPoint; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.dc; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.di; + +public class PropertyWriterUtils { + + public static BPMNEdge createBPMNEdge(BasePropertyWriter source, + BasePropertyWriter target, + Connection sourceConnection, + ControlPoint[] mid, + Connection targetConnection) { + BPMNEdge bpmnEdge = di.createBPMNEdge(); + bpmnEdge.setId(Ids.bpmnEdge(source.getShape().getId(), + target.getShape().getId())); + + Point2D sourcePt = getSourceLocation(source, + sourceConnection); + Point2D targetPt = getTargetLocation(target, + targetConnection); + + Point sourcePoint = pointOf( + source.getShape().getBounds().getX() + sourcePt.getX(), + source.getShape().getBounds().getY() + sourcePt.getY()); + + Point targetPoint = pointOf( + target.getShape().getBounds().getX() + targetPt.getX(), + target.getShape().getBounds().getY() + targetPt.getY()); + + List waypoints = bpmnEdge.getWaypoint(); + waypoints.add(sourcePoint); + + if (null != mid) { + for (ControlPoint controlPoint : mid) { + waypoints.add(pointOf(controlPoint.getLocation().getX(), + controlPoint.getLocation().getY())); + } + } + + waypoints.add(targetPoint); + + return bpmnEdge; + } + + @SuppressWarnings("unchecked") + public static Optional> getDockSourceNode(final Node node) { + return node.getInEdges().stream() + .filter(PropertyWriterUtils::isDockEdge) + .map(Edge::getSourceNode) + .map(n -> (Node) n) + .findFirst(); + } + + private static boolean isDockEdge(final Edge edge) { + return edge.getContent() instanceof Dock; + } + + private static Point2D getSourceLocation(BasePropertyWriter source, + Connection sourceConnection) { + Point2D location = sourceConnection.getLocation(); + if (location == null) { + Bounds bounds = source.getShape().getBounds(); + location = Point2D.create( + bounds.getWidth(), + bounds.getHeight() / 2 + ); + } + return location; + } + + private static Point2D getTargetLocation(BasePropertyWriter target, + Connection targetConnection) { + Point2D location = targetConnection.getLocation(); + if (location == null) { + Bounds bounds = target.getShape().getBounds(); + location = Point2D.create( + 0, + bounds.getHeight() / 2 + ); + } + return location; + } + + private static Point pointOf(double x, + double y) { + Point pt = dc.createPoint(); + pt.setX((float) x); + pt.setY((float) y); + return pt; + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/sequenceflows/SequenceFlowConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/sequenceflows/SequenceFlowConverter.java new file mode 100644 index 00000000000..9cd0fbccc0e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/sequenceflows/SequenceFlowConverter.java @@ -0,0 +1,71 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.sequenceflows; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.ElementContainer; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.SequenceFlowPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.SequenceFlow; +import org.kie.workbench.common.stunner.bpmn.definition.property.connectors.SequenceFlowExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class SequenceFlowConverter { + + private final PropertyWriterFactory propertyWriterFactory; + + public SequenceFlowConverter(PropertyWriterFactory propertyWriterFactory) { + this.propertyWriterFactory = propertyWriterFactory; + } + + public Result toFlowElement(Edge edge, ElementContainer process) { + ViewConnector connector = (ViewConnector) edge.getContent(); + SequenceFlow definition = connector.getDefinition(); + org.eclipse.bpmn2.SequenceFlow seq = bpmn2.createSequenceFlow(); + SequenceFlowPropertyWriter p = propertyWriterFactory.of(seq); + + seq.setId(edge.getUUID()); + + BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); + BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); + + if (pSrc == null || pTgt == null) { + String msg = "pSrc = " + pSrc + ", pTgt = " + pTgt; + return Result.failure(msg); + } + + p.setSource(pSrc); + p.setTarget(pTgt); + + p.setConnection(connector); + + BPMNGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + SequenceFlowExecutionSet executionSet = definition.getExecutionSet(); + p.setPriority(executionSet.getPriority().getValue()); + p.setConditionExpression(executionSet.getConditionExpression().getValue()); + + return Result.of(p); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/tasks/TaskConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/tasks/TaskConverter.java new file mode 100644 index 00000000000..b98315f90e3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/tasks/TaskConverter.java @@ -0,0 +1,265 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.tasks; + +import org.eclipse.bpmn2.Task; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ActivityPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BusinessRuleTaskPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.GenericServiceTaskPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ScriptTaskPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ServiceTaskPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.UserTaskPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils; +import org.kie.workbench.common.stunner.bpmn.definition.BaseTask; +import org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask; +import org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask; +import org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask; +import org.kie.workbench.common.stunner.bpmn.definition.NoneTask; +import org.kie.workbench.common.stunner.bpmn.definition.ScriptTask; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseUserTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BusinessRuleTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.RuleLanguage; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTask; +import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTaskExecutionSet; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils.cast; + +public class TaskConverter { + + private final PropertyWriterFactory propertyWriterFactory; + + public TaskConverter(PropertyWriterFactory propertyWriterFactory) { + this.propertyWriterFactory = propertyWriterFactory; + } + + public PropertyWriter toFlowElement(Node, ?> node) { + BaseTask def = node.getContent().getDefinition(); + if (def instanceof NoneTask) { + return noneTask(cast(node)); + } + if (def instanceof ScriptTask) { + return scriptTask(cast(node)); + } + if (def instanceof BusinessRuleTask) { + return businessRuleTask(cast(node)); + } + if (def instanceof BaseUserTask) { + return userTask(cast(node)); + } + if (def instanceof ServiceTask) { + return serviceTask(cast(node)); + } + if (def instanceof GenericServiceTask) { + return genericServiceTask(cast(node)); + } + return ConverterUtils.notSupported(def); + } + + private PropertyWriter genericServiceTask(Node, ?> n) { + org.eclipse.bpmn2.ServiceTask task = bpmn2.createServiceTask(); + task.setId(n.getUUID()); + + GenericServiceTask definition = n.getContent().getDefinition(); + GenericServiceTaskPropertyWriter p = propertyWriterFactory.of(task); + + TaskGeneralSet general = definition.getGeneral(); + GenericServiceTaskExecutionSet executionSet = + definition.getExecutionSet(); + + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + p.setAbsoluteBounds(n); + p.setSimulationSet(definition.getSimulationSet()); + p.setValue(executionSet.getGenericServiceTaskInfo().getValue()); + p.setAsync(executionSet.getIsAsync().getValue()); + p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); + if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { + p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); + p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); + p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); + p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); + p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); + p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); + } + p.setOnEntryAction(executionSet.getOnEntryAction()); + p.setOnExitAction(executionSet.getOnExitAction()); + p.setSLADueDate(executionSet.getSlaDueDate().getValue()); + p.setAssignmentsInfo(executionSet.getAssignmentsinfo()); + return p; + } + + private PropertyWriter serviceTask(Node, ?> n) { + Task task = bpmn2.createTask(); + task.setId(n.getUUID()); + + ServiceTask definition = n.getContent().getDefinition(); + ServiceTaskPropertyWriter p = propertyWriterFactory.of(task); + + p.setServiceTaskName(definition.getName()); + + TaskGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAssignmentsInfo( + definition.getDataIOSet().getAssignmentsinfo()); + + ServiceTaskExecutionSet executionSet = + definition.getExecutionSet(); + + p.setTaskName(executionSet.getTaskName().getValue()); + p.setAsync(executionSet.getIsAsync().getValue()); + p.setOnEntryAction(executionSet.getOnEntryAction()); + p.setOnExitAction(executionSet.getOnExitAction()); + p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); + p.setSlaDueDate(executionSet.getSlaDueDate().getValue()); + + p.setSimulationSet(definition.getSimulationSet()); + + p.setAbsoluteBounds(n); + return p; + } + + private PropertyWriter userTask(Node, ?> n) { + org.eclipse.bpmn2.UserTask task = bpmn2.createUserTask(); + task.setId(n.getUUID()); + BaseUserTask definition = n.getContent().getDefinition(); + UserTaskPropertyWriter p = propertyWriterFactory.of(task); + + TaskGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setSimulationSet(definition.getSimulationSet()); + + BaseUserTaskExecutionSet executionSet = definition.getExecutionSet(); + + p.setTaskName(executionSet.getTaskName().getValue()); + p.setActors(executionSet.getActors()); + p.setAssignmentsInfo(executionSet.getAssignmentsinfo()); + p.setReassignments(executionSet.getReassignmentsInfo()); + p.setNotifications(executionSet.getNotificationsInfo()); + p.setSkippable(executionSet.getSkippable().getValue()); + p.setGroupId(executionSet.getGroupid().getValue()); + p.setSubject(executionSet.getSubject().getValue()); + p.setDescription(executionSet.getDescription().getValue()); + p.setPriority(executionSet.getPriority().getValue()); + p.setAsync(executionSet.getIsAsync().getValue()); + p.setCreatedBy(executionSet.getCreatedBy().getValue()); + p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); + if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { + p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); + p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); + p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); + p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); + p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); + p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); + } + p.setOnEntryAction(executionSet.getOnEntryAction()); + p.setOnExitAction(executionSet.getOnExitAction()); + p.setContent(executionSet.getContent().getValue()); + p.setSLADueDate(executionSet.getSlaDueDate().getValue()); + + p.setAbsoluteBounds(n); + + return p; + } + + private PropertyWriter businessRuleTask(Node, ?> n) { + org.eclipse.bpmn2.BusinessRuleTask task = bpmn2.createBusinessRuleTask(); + task.setId(n.getUUID()); + BusinessRuleTask definition = n.getContent().getDefinition(); + BusinessRuleTaskPropertyWriter p = propertyWriterFactory.of(task); + + TaskGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + BusinessRuleTaskExecutionSet executionSet = + definition.getExecutionSet(); + + p.setAsync(executionSet.getIsAsync().getValue()); + p.setOnEntryAction(executionSet.getOnEntryAction()); + p.setOnExitAction(executionSet.getOnExitAction()); + p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); + p.setSlaDueDate(executionSet.getSlaDueDate().getValue()); + + RuleLanguage ruleLanguage = executionSet.getRuleLanguage(); + p.setImplementation(ruleLanguage); + + if (ruleLanguage.getValue().equals(RuleLanguage.DRL)) { + p.setRuleFlowGroup(executionSet.getRuleFlowGroup()); + } else if (ruleLanguage.getValue().equals(RuleLanguage.DMN)) { + p.setNamespace(executionSet.getNamespace()); + p.setDecisionName(executionSet.getDecisionName()); + p.setDmnModelName(executionSet.getDmnModelName()); + } + + p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); + + p.setSimulationSet(definition.getSimulationSet()); + + p.setAbsoluteBounds(n); + return p; + } + + private PropertyWriter scriptTask(Node, ?> n) { + org.eclipse.bpmn2.ScriptTask task = bpmn2.createScriptTask(); + task.setId(n.getUUID()); + ScriptTask definition = n.getContent().getDefinition(); + ScriptTaskPropertyWriter p = propertyWriterFactory.of(task); + + TaskGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + ScriptTaskExecutionSet executionSet = definition.getExecutionSet(); + + p.setScript(executionSet.getScript().getValue()); + p.setAsync(executionSet.getIsAsync().getValue()); + p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); + + p.setSimulationSet(definition.getSimulationSet()); + + p.setAbsoluteBounds(n); + return p; + } + + private PropertyWriter noneTask(Node, ?> n) { + Task task = bpmn2.createTask(); + task.setId(n.getUUID()); + NoneTask definition = n.getContent().getDefinition(); + ActivityPropertyWriter p = propertyWriterFactory.of(task); + + TaskGeneralSet general = definition.getGeneral(); + p.setName(general.getName().getValue()); + p.setDocumentation(general.getDocumentation().getValue()); + + p.setAbsoluteBounds(n); + + p.setSimulationSet(definition.getSimulationSet()); + return p; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/textannotation/TextAnnotationConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/textannotation/TextAnnotationConverter.java new file mode 100644 index 00000000000..b371ef15487 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/textannotation/TextAnnotationConverter.java @@ -0,0 +1,58 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.textannotation; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.TextAnnotationPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils; +import org.kie.workbench.common.stunner.bpmn.definition.TextAnnotation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class TextAnnotationConverter { + + private final PropertyWriterFactory propertyWriterFactory; + + public TextAnnotationConverter(PropertyWriterFactory propertyWriterFactory) { + this.propertyWriterFactory = propertyWriterFactory; + } + + public PropertyWriter toElement(Node, ?> node) { + + final TextAnnotation def = node.getContent().getDefinition(); + if (def instanceof TextAnnotation) { + TextAnnotation definition = node.getContent().getDefinition(); + + org.eclipse.bpmn2.TextAnnotation element = bpmn2.createTextAnnotation(); + element.setId(node.getUUID()); + + TextAnnotationPropertyWriter writer = propertyWriterFactory.of(element); + + BPMNGeneralSet general = definition.getGeneral(); + writer.setName(general.getName().getValue()); + writer.setDocumentation(general.getDocumentation().getValue()); + writer.setAbsoluteBounds(node); + + return writer; + } + return ConverterUtils.notSupported(def); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/AbstractConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/AbstractConverter.java new file mode 100644 index 00000000000..781be60c497 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/AbstractConverter.java @@ -0,0 +1,45 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import org.eclipse.bpmn2.BaseElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessage; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessageKeys; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest.Mode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.BPMNElementDecorators; +import org.kie.workbench.common.stunner.core.validation.Violation; + +public abstract class AbstractConverter { + + private final Mode mode; + + public AbstractConverter(Mode mode) { + this.mode = mode; + } + + public Mode getMode() { + return mode; + } + + protected MarshallingMessage getNotFoundMessage(BaseElement baseElement) { + return MarshallingMessage.builder() + .type(Violation.Type.WARNING) + .messageKey(MarshallingMessageKeys.ignoredUnknownElement) + .messageArguments(BPMNElementDecorators.baseElementDecorator().getName(baseElement)) + .build(); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/BaseConverterFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/BaseConverterFactory.java new file mode 100644 index 00000000000..cba9041c7a9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/BaseConverterFactory.java @@ -0,0 +1,124 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.activities.BaseCallActivityConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events.EndEventConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events.IntermediateCatchEventConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events.IntermediateThrowEventConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events.StartEventConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.gateways.GatewayConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.lanes.LaneConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.processes.BaseRootProcessConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.processes.BaseSubProcessConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.tasks.BaseTaskConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.textannotation.TextAnnotationConverter; + +public abstract class BaseConverterFactory { + + protected final DefinitionResolver definitionResolver; + protected final TypedFactoryManager factoryManager; + protected final PropertyReaderFactory propertyReaderFactory; + + private final EdgeConverterManager edgeConverter; + + private final FlowElementConverter flowElementConverter; + private final StartEventConverter startEventConverter; + private final IntermediateCatchEventConverter intermediateCatchEventConverter; + private final IntermediateThrowEventConverter intermediateThrowEventConverter; + private final EndEventConverter endEventConverter; + private final LaneConverter laneConverter; + private final GatewayConverter gatewayConverter; + private final TextAnnotationConverter textAnnotationConverter; + + public BaseConverterFactory(DefinitionResolver definitionResolver, + TypedFactoryManager factoryManager, + PropertyReaderFactory propertyReaderFactory) { + this.definitionResolver = definitionResolver; + this.factoryManager = factoryManager; + this.propertyReaderFactory = propertyReaderFactory; + + final MarshallingRequest.Mode mode = definitionResolver.getMode(); + this.flowElementConverter = new FlowElementConverter(this); + + this.startEventConverter = new StartEventConverter(factoryManager, propertyReaderFactory, + mode); + this.intermediateCatchEventConverter = new IntermediateCatchEventConverter(factoryManager, + propertyReaderFactory, mode); + this.intermediateThrowEventConverter = new IntermediateThrowEventConverter(factoryManager, + propertyReaderFactory, mode); + this.endEventConverter = new EndEventConverter(factoryManager, propertyReaderFactory, mode); + this.laneConverter = new LaneConverter(factoryManager, propertyReaderFactory); + this.gatewayConverter = new GatewayConverter(factoryManager, propertyReaderFactory, mode); + this.edgeConverter = new EdgeConverterManager(factoryManager, propertyReaderFactory, mode); + this.textAnnotationConverter = new TextAnnotationConverter(factoryManager, propertyReaderFactory); + } + + public FlowElementConverter flowElementConverter() { + return flowElementConverter; + } + + public EdgeConverterManager edgeConverter() { + return edgeConverter; + } + + public StartEventConverter startEventConverter() { + return startEventConverter; + } + + public IntermediateCatchEventConverter intermediateCatchEventConverter() { + return intermediateCatchEventConverter; + } + + public IntermediateThrowEventConverter intermediateThrowEventConverter() { + return intermediateThrowEventConverter; + } + + public EndEventConverter endEventConverter() { + return endEventConverter; + } + + public abstract BaseCallActivityConverter callActivityConverter(); + + public abstract BaseRootProcessConverter rootProcessConverter(); + + public abstract BaseSubProcessConverter subProcessConverter(); + + public LaneConverter laneConverter() { + return laneConverter; + } + + public GatewayConverter gatewayConverter() { + return gatewayConverter; + } + + public abstract BaseTaskConverter taskConverter(); + + public ProcessPostConverter newProcessPostConverter() { + return new ProcessPostConverter(); + } + + public DefinitionResolver getDefinitionResolver() { + return definitionResolver; + } + + public TextAnnotationConverter textAnnotationConverter() { + return textAnnotationConverter; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/BpmnEdge.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/BpmnEdge.java new file mode 100644 index 00000000000..db4e89bd7b8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/BpmnEdge.java @@ -0,0 +1,128 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import java.util.List; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReader; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public interface BpmnEdge { + + static BpmnEdge.Simple of( + Edge, Node> edge, + BpmnNode source, Connection sourceConnection, + List controlPoints, + BpmnNode target, Connection targetConnection, + PropertyReader propertyReader) { + return new BpmnEdge.Simple(edge, source, sourceConnection, controlPoints, target, targetConnection, propertyReader); + } + + static BpmnEdge.Docked docked(BpmnNode source, BpmnNode target) { + return new Docked(source, target); + } + + BpmnNode getSource(); + + BpmnNode getTarget(); + + boolean isDocked(); + + class Simple implements BpmnEdge { + + private final Edge, Node> edge; + private final BpmnNode source; + private final Connection sourceConnection; + private final List controlPoints; + private final BpmnNode target; + private final Connection targetConnection; + private final PropertyReader propertyReader; + + private Simple(Edge, Node> edge, BpmnNode source, Connection sourceConnection, List controlPoints, BpmnNode target, Connection targetConnection, PropertyReader propertyReader) { + this.edge = edge; + this.source = source; + this.sourceConnection = sourceConnection; + this.controlPoints = controlPoints; + this.target = target; + this.targetConnection = targetConnection; + this.propertyReader = propertyReader; + } + + public Edge, Node> getEdge() { + return edge; + } + + public BpmnNode getSource() { + return source; + } + + public Connection getSourceConnection() { + return sourceConnection; + } + + public List getControlPoints() { + return controlPoints; + } + + public BpmnNode getTarget() { + return target; + } + + public Connection getTargetConnection() { + return targetConnection; + } + + @Override + public boolean isDocked() { + return false; + } + + public PropertyReader getPropertyReader() { + return propertyReader; + } + } + + class Docked implements BpmnEdge { + + private final BpmnNode source; + private final BpmnNode target; + + private Docked(BpmnNode source, BpmnNode target) { + this.source = source; + this.target = target; + } + + @Override + public BpmnNode getSource() { + return source; + } + + @Override + public BpmnNode getTarget() { + return target; + } + + @Override + public boolean isDocked() { + return true; + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/BpmnNode.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/BpmnNode.java new file mode 100644 index 00000000000..6e7236105e8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/BpmnNode.java @@ -0,0 +1,148 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.BasePropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.core.graph.Element; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +/** + * The result of a Converter (to Stunner) is always a BpmnNode. + * It wraps the underlying Stunner node into a data structure + * that also encodes + *

+ * 1) parent/child relationships + * 2) other edges (and therefore, implicitly, other nodes) + * that may be contained inside the node (e.g. in the case of a (Sub)Process) + */ +public abstract class BpmnNode { + + private final Node, ?> value; + private final List children = new ArrayList<>(); + private List edges = new ArrayList<>(); + private BpmnNode parent; + private BasePropertyReader propertyReader; + + protected BpmnNode(Node, ?> value, BasePropertyReader propertyReader) { + this.value = value; + this.propertyReader = propertyReader; + } + + public abstract boolean isDocked(); + + public static class Simple extends BpmnNode { + + public Simple(Node, ?> value, BasePropertyReader propertyReader) { + super(value, propertyReader); + } + + @Override + public boolean isDocked() { + return false; + } + } + + public static class Docked extends BpmnNode { + + public Docked(Node, ?> value, BasePropertyReader propertyReader) { + super(value, propertyReader); + } + + @Override + public boolean isDocked() { + return true; + } + } + + public static BpmnNode of(Node, ?> value, BasePropertyReader propertyReader) { + return new BpmnNode.Simple(value, propertyReader); + } + + public BpmnNode docked() { + return new BpmnNode.Docked(this.value, this.propertyReader); + } + + public BpmnNode getParent() { + return parent; + } + + public void setParent(BpmnNode parent) { + if (this.parent != null) { + this.parent.removeChild(this); + } + this.parent = parent; + parent.addChild(this); + } + + public void addChild(BpmnNode child) { + this.children.add(child); + } + + public void removeChild(BpmnNode child) { + this.children.remove(child); + } + + public List getChildren() { + return children; + } + + public boolean hasChildren() { + return !children.isEmpty(); + } + + public Node, ?> value() { + return value; + } + + public BasePropertyReader getPropertyReader() { + return propertyReader; + } + + public void addAllEdges(Collection bpmnEdges) { + this.edges.addAll(bpmnEdges); + } + + public List getEdges() { + return edges; + } + + public boolean addEdge(BpmnEdge bpmnEdge) { + return edges.add(bpmnEdge); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("BpmnNode{"); + sb.append("value=").append(Optional.ofNullable(value) + .map(Element::getContent) + .filter(Objects::nonNull) + .map(View::getDefinition) + .filter(Objects::nonNull) + .map(BPMNViewDefinition::toString) + .orElse("")); + sb.append('}'); + return sb.toString(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/ConverterFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/ConverterFactory.java new file mode 100644 index 00000000000..0da26350a81 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/ConverterFactory.java @@ -0,0 +1,56 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.activities.CallActivityConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.processes.RootProcessConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.processes.SubProcessConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.tasks.TaskConverter; + +public class ConverterFactory + extends BaseConverterFactory { + + public ConverterFactory(DefinitionResolver definitionResolver, + TypedFactoryManager factoryManager) { + super(definitionResolver, factoryManager, new PropertyReaderFactory(definitionResolver)); + } + + @Override + public CallActivityConverter callActivityConverter() { + return new CallActivityConverter(factoryManager, propertyReaderFactory); + } + + @Override + public RootProcessConverter rootProcessConverter() { + return new RootProcessConverter(factoryManager, propertyReaderFactory, definitionResolver, this); + } + + @Override + public SubProcessConverter subProcessConverter() { + return new SubProcessConverter(factoryManager, + propertyReaderFactory, + definitionResolver, + this); + } + + @Override + public TaskConverter taskConverter() { + return new TaskConverter(factoryManager, propertyReaderFactory, definitionResolver.getMode()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/DefinitionResolver.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/DefinitionResolver.java new file mode 100644 index 00000000000..cbc41241cef --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/DefinitionResolver.java @@ -0,0 +1,250 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +import bpsim.BPSimDataType; +import bpsim.BpsimPackage; +import bpsim.ElementParameters; +import bpsim.Scenario; +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.Process; +import org.eclipse.bpmn2.Relationship; +import org.eclipse.bpmn2.RootElement; +import org.eclipse.bpmn2.Signal; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.di.BPMNPlane; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest.Mode; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; + +/** + * An object that resolves child definitions. + *

+ * Because the Stunner model aggregates different aspects of a node, + * while the Eclipse model keeps them in separate sections, we use this + * object to access such aspects, namely + *

+ *

    + *
  • shapes
  • + *
  • simulation parameters
  • + *
. + *

+ * signal concern is due to a bug in current Eclipse BPMN2 implementation, + * which is outdated w.r.t. upstream. + */ +public class DefinitionResolver { + + static final double DEFAULT_RESOLUTION = 112.5d; + + private final Map signals; + private final Map simulationParameters; + private final Collection workItemDefinitions; + private final Definitions definitions; + private final Process process; + private final BPMNDiagram diagram; + private final double resolutionFactor; + private final boolean jbpm; + private final Mode mode; + + public DefinitionResolver( + Definitions definitions, + Collection workItemDefinitions, + boolean jbpm, + Mode mode) { + this.definitions = definitions; + this.signals = initSignals(definitions); + this.simulationParameters = initSimulationParameters(definitions); + this.workItemDefinitions = workItemDefinitions; + this.process = findProcess(); + this.diagram = findDiagram(); + this.resolutionFactor = calculateResolutionFactor(diagram); + this.jbpm = jbpm; + this.mode = mode; + } + + public DefinitionResolver(Definitions definitions, + Collection workItemDefinitions) { + this(definitions, workItemDefinitions, true, Mode.AUTO); + } + + public BPMNDiagram getDiagram() { + return diagram; + } + + public double getResolutionFactor() { + return resolutionFactor; + } + + public boolean isJbpm() { + return jbpm; + } + + public Definitions getDefinitions() { + return definitions; + } + + public Process getProcess() { + return process; + } + + public Mode getMode() { + return mode; + } + + public Collection getWorkItemDefinitions() { + return workItemDefinitions; + } + + /** + * A helper method to return a Signal instance for a given Signal ID. + *

+ * The reason we only have Signal resolution and we do not have + * Message, Error, Timer resolution, is that Message, Error, Timer + * instances are usually attached to the events that refer them, + * so that we can do: + *

+ *

+     *     Message mySignal = myEvent.getMessageRef()
+     * 
+ *

+ * this isn't so for Signal, due to a bug in the method signature/impl. + * getSignalRef() actually returns the reference (the String ID) + * to the Signal instead of resolving it to the Signal instnace. + *

+ * This method can be safely dropped as soon as we find a way to upgrade + * the underlying BPMN2 Eclipse parser without breaking the rest of the code base. + */ + public Optional resolveSignal(String id) { + return Optional.ofNullable(signals.get(id)); + } + + /** + * A utility to return Signal#getName for a given Signal ID. + */ + public String resolveSignalName(String id) { + return resolveSignal(id).map(Signal::getName).orElse(""); + } + + /** + * Returns the simulation parameters attached to a given ID + */ + public Optional resolveSimulationParameters(String id) { + return Optional.ofNullable(simulationParameters.get(id)); + } + + private Map initSignals(Definitions definitions) { + Map signals = new HashMap<>(); + for (RootElement el : definitions.getRootElements()) { + if (el instanceof Signal) { + signals.put(el.getId(), (Signal) el); + } + } + return signals; + } + + @SuppressWarnings("unchecked") + private Map initSimulationParameters(Definitions definitions) { + Map simulationParameters = new HashMap<>(); + List relationships = definitions.getRelationships(); + if (relationships.isEmpty()) { + return Collections.emptyMap(); + } + FeatureMap value = + relationships.get(0) + .getExtensionValues().get(0) + .getValue(); + + Object simData = + value.get(BpsimPackage.Literals.DOCUMENT_ROOT__BP_SIM_DATA, true); + List bpsimExtensions = (List) simData; + + Scenario scenario = bpsimExtensions.get(0).getScenario().get(0); + + for (ElementParameters parameters : scenario.getElementParameters()) { + simulationParameters.put(parameters.getElementRef(), parameters); + } + + return simulationParameters; + } + + private Process findProcess() { + return (Process) definitions.getRootElements().stream() + .filter(el -> el instanceof Process) + .findFirst().get(); + } + + private BPMNDiagram findDiagram() { + return definitions.getDiagrams().get(0); + } + + public BPMNShape getShape(String elementId) { + return definitions.getDiagrams().stream() + .map(BPMNDiagram::getPlane) + .map(plane -> getShape(plane, elementId)) + .filter(Objects::nonNull) + .findFirst().orElse(null); + } + + private static BPMNShape getShape(BPMNPlane plane, String elementId) { + return plane.getPlaneElement().stream() + .filter(dia -> dia instanceof BPMNShape) + .map(shape -> (BPMNShape) shape) + .filter(shape -> shape.getBpmnElement().getId().equals(elementId)) + .findFirst().orElse(null); + } + + public BPMNEdge getEdge(String elementId) { + return definitions.getDiagrams().stream() + .map(BPMNDiagram::getPlane) + .map(plane -> getEdge(plane, elementId)) + .filter(Objects::nonNull) + .findFirst().orElse(null); + } + + private static BPMNEdge getEdge(BPMNPlane plane, String elementId) { + return plane.getPlaneElement().stream() + .filter(dia -> dia instanceof BPMNEdge) + .map(edge -> (BPMNEdge) edge) + .filter(edge -> edge.getBpmnElement() != null) + .filter(edge -> edge.getBpmnElement().getId() != null) + .filter(edge -> edge.getBpmnElement().getId().equals(elementId)) + + .findFirst().orElse(null); + } + + static double calculateResolutionFactor(final BPMNDiagram diagram) { + final float resolution = diagram.getResolution(); + // If no resolution set on the model, the eclipse parsers default to 0.0F. + return resolution == 0 ? + 1 : + obtainResolutionFactor() / resolution; + } + + static double obtainResolutionFactor() { + return DEFAULT_RESOLUTION; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/EdgeConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/EdgeConverter.java new file mode 100644 index 00000000000..94f1c3fe626 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/EdgeConverter.java @@ -0,0 +1,59 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import java.util.Map; + +import org.eclipse.bpmn2.BaseElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessage; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EdgePropertyReader; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.validation.Violation; + +public interface EdgeConverter { + + Result convertEdge(T element, Map nodes); + + default Result result(Map nodes, Edge, Node> edge, + EdgePropertyReader p, String errorMessage, String messageKey) { + return valid(nodes, p.getSourceId(), p.getTargetId()) ? + Result.success(BpmnEdge.of( + edge, + nodes.get(p.getSourceId()), + p.getSourceConnection(), + p.getControlPoints(), + nodes.get(p.getTargetId()), + p.getTargetConnection(), + p)) + : Result.ignored(errorMessage, + MarshallingMessage + .builder() + .message(errorMessage) + .messageKey(messageKey) + .messageArguments(p.getSourceId(), + p.getTargetId()) + .type(Violation.Type.WARNING) + .build()); + } + + default boolean valid(Map nodes, String parentId, String childId) { + return nodes.containsKey(parentId) && nodes.containsKey(childId); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/EdgeConverterManager.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/EdgeConverterManager.java new file mode 100644 index 00000000000..e666d796b7c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/EdgeConverterManager.java @@ -0,0 +1,59 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import java.util.Map; + +import org.eclipse.bpmn2.Association; +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.SequenceFlow; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest.Mode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Match; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.associations.AssociationConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events.BoundaryEventConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.sequenceflows.SequenceFlowConverter; + +public class EdgeConverterManager extends AbstractConverter { + + private final SequenceFlowConverter sequenceFlowConverter; + private final BoundaryEventConverter boundaryEventConverter; + private final AssociationConverter associationConverter; + + public EdgeConverterManager( + TypedFactoryManager factoryManager, + PropertyReaderFactory propertyReaderFactory, + Mode mode) { + super(mode); + this.sequenceFlowConverter = new SequenceFlowConverter(factoryManager, propertyReaderFactory); + this.boundaryEventConverter = new BoundaryEventConverter(); + this.associationConverter = new AssociationConverter(factoryManager, propertyReaderFactory); + } + + public Result convertEdge(BaseElement baseElement, Map nodes) { + return Match.>of() + .when(e -> e instanceof SequenceFlow, e -> sequenceFlowConverter.convertEdge(e, nodes)) + .when(e -> e instanceof BoundaryEvent, e -> boundaryEventConverter.convertEdge(e, nodes)) + .when(e -> e instanceof Association, e -> associationConverter.convertEdge(e, nodes)) + .defaultValue(Result.ignored("Not an Edge element", getNotFoundMessage(baseElement))) + .apply(baseElement) + .value(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/FlowElementConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/FlowElementConverter.java new file mode 100644 index 00000000000..d30df4ba8da --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/FlowElementConverter.java @@ -0,0 +1,78 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.CallActivity; +import org.eclipse.bpmn2.DataObject; +import org.eclipse.bpmn2.DataObjectReference; +import org.eclipse.bpmn2.DataStoreReference; +import org.eclipse.bpmn2.EndEvent; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.Gateway; +import org.eclipse.bpmn2.IntermediateCatchEvent; +import org.eclipse.bpmn2.IntermediateThrowEvent; +import org.eclipse.bpmn2.StartEvent; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.TextAnnotation; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.BPMNElementDecorators; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Match; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; + +public class FlowElementConverter extends AbstractConverter { + + private final BaseConverterFactory converterFactory; + + public FlowElementConverter(BaseConverterFactory converterFactory) { + super(converterFactory.getDefinitionResolver().getMode()); + this.converterFactory = converterFactory; + } + + public Result convertNode(FlowElement flowElement) { + return Match.>of() + .when(e -> e instanceof StartEvent, + converterFactory.startEventConverter()::convert) + .when(e -> e instanceof EndEvent, + converterFactory.endEventConverter()::convert) + .when(e -> e instanceof BoundaryEvent, + converterFactory.intermediateCatchEventConverter()::convertBoundaryEvent) + .when(e -> e instanceof IntermediateCatchEvent, + converterFactory.intermediateCatchEventConverter()::convert) + .when(e -> e instanceof IntermediateThrowEvent, + converterFactory.intermediateThrowEventConverter()::convert) + .when(e -> e instanceof Task, + converterFactory.taskConverter()::convert) + .when(e -> e instanceof Gateway, + converterFactory.gatewayConverter()::convert) + .when(e -> e instanceof SubProcess, + converterFactory.subProcessConverter()::convertSubProcess) + .when(e -> e instanceof CallActivity, + converterFactory.callActivityConverter()::convert) + .when(e -> e instanceof TextAnnotation, + converterFactory.textAnnotationConverter()::convert) + .ignore(e -> e instanceof DataStoreReference, DataStoreReference.class) + .ignore(e -> e instanceof DataObjectReference, DataObjectReference.class) + .ignore(e -> e instanceof DataObject, DataObject.class) + .defaultValue(Result.ignored("FlowElement not found", getNotFoundMessage(flowElement))) + .inputDecorator(BPMNElementDecorators.flowElementDecorator()) + .outputDecorator(BPMNElementDecorators.resultBpmnDecorator()) + .mode(getMode()) + .apply(flowElement) + .value(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/GraphBuilder.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/GraphBuilder.java new file mode 100644 index 00000000000..933d1120f32 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/GraphBuilder.java @@ -0,0 +1,273 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import java.util.ArrayDeque; +import java.util.Collection; +import java.util.Deque; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.core.api.DefinitionManager; +import org.kie.workbench.common.stunner.core.command.Command; +import org.kie.workbench.common.stunner.core.command.CommandResult; +import org.kie.workbench.common.stunner.core.command.impl.DeferredCompositeCommand; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.command.DirectGraphCommandExecutionContext; +import org.kie.workbench.common.stunner.core.graph.command.GraphCommandExecutionContext; +import org.kie.workbench.common.stunner.core.graph.command.GraphCommandManager; +import org.kie.workbench.common.stunner.core.graph.command.impl.AddChildNodeCommand; +import org.kie.workbench.common.stunner.core.graph.command.impl.AddDockedNodeCommand; +import org.kie.workbench.common.stunner.core.graph.command.impl.AddNodeCommand; +import org.kie.workbench.common.stunner.core.graph.command.impl.GraphCommandFactory; +import org.kie.workbench.common.stunner.core.graph.command.impl.UpdateElementPositionCommand; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.ControlPoint; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.processing.index.map.MapIndexBuilder; +import org.kie.workbench.common.stunner.core.rule.RuleManager; +import org.kie.workbench.common.stunner.core.rule.RuleViolation; + +/** + * A wrapper for graph command execution, + * exposing a simple, method-based API. + *

+ * A `GraphBuilder` object issues commands to the canvas while building the graph. + * It is a wrapper around + *

    + *
  • GraphCommandExecutionContext
  • + *
  • GraphCommandFactory
  • + *
  • GraphCommandManager
  • + *
+ *

+ * `GraphBuilder` is used for convenience, to avoid explicitly creating command instances. + * It also implements custom logic for some actions. For example, in the case of adding child nodes, + * it translates the coordinates of a child node into the new reference system (the parent boundaries). + *

+ * `GraphBuilder` builds the entire graph {@link GraphBuilder#buildGraph(BpmnNode)} + * once all the conversions have took place: it traverses the entire directed graph described by the `BPMNNode`s + * starting from the "root node", which represents the root of the diagram, and visiting + * the parent/child relations in each BPMNNode and the `BPMNEdge` they may contain. + */ +public class GraphBuilder { + + private final GraphCommandExecutionContext executionContext; + private final GraphCommandFactory commandFactory; + private final GraphCommandManager commandManager; + private final Graph graph; + + public GraphBuilder( + Graph graph, + DefinitionManager definitionManager, + TypedFactoryManager typedFactoryManager, + RuleManager ruleManager, + GraphCommandFactory commandFactory, + GraphCommandManager commandManager) { + this.graph = graph; + this.executionContext = new DirectGraphCommandExecutionContext( + definitionManager, + typedFactoryManager.untyped(), + new MapIndexBuilder().build(graph)); + this.commandFactory = commandFactory; + this.commandManager = commandManager; + } + + /** + * Clears the context and then walks the graph root + * to draw it on the canvas + */ + public void render(BpmnNode root) { + clearGraph(); + buildGraph(root); + } + + /** + * Starting from the given root node, + * it walks the graph breadth-first and issues + * all the required commands to draw it on the canvas + */ + public void buildGraph(BpmnNode rootNode) { + this.addNode(rootNode.value()); + rootNode.getEdges().forEach(this::addEdge); + List nodes = rootNode.getChildren(); + + Deque workingSet = + new ArrayDeque<>(prioritized(nodes)); + + Set workedOff = new HashSet<>(); + while (!workingSet.isEmpty()) { + BpmnNode current = workingSet.pop(); + // ensure we visit this node only once + if (workedOff.contains(current)) { + continue; + } + workedOff.add(current); + workingSet.addAll( + prioritized(current.getChildren())); + + this.addChildNode(current); + current.getEdges().forEach(this::addEdge); + } + } + + // make sure that docked nodes are processed *after* its siblings + // for compat with drawing routines + private Collection prioritized(List children) { + ArrayDeque prioritized = new ArrayDeque<>(); + for (BpmnNode node : children) { + if (node.isDocked()) { + prioritized.add(node); + } else { + prioritized.push(node); + } + } + return prioritized; + } + + private void addDockedNode(Node parent, Node candidate) { + AddDockedNodeCommand addNodeCommand = commandFactory.addDockedNode(parent, candidate); + execute(addNodeCommand); + } + + private void addChildNode(BpmnNode current) { + addChildNode(current.getParent().value(), current.value()); + if (!current.isDocked()) { + Point2D translationFactors = calculateTranslationFactors(current); + translate( + current.value(), + translationFactors.getX(), translationFactors.getY()); + } + } + + private Point2D calculateTranslationFactors(BpmnNode current) { + double xFactor = 0; + double yFactor = 0; + Bounds bounds; + BpmnNode parent = current.getParent(); + while (parent != null) { + bounds = parent.value().getContent().getBounds(); + xFactor += bounds.getX(); + yFactor += bounds.getY(); + parent = parent.getParent(); + } + return Point2D.create(xFactor, yFactor); + } + + private void addChildNode(Node parent, Node child) { + AddChildNodeCommand addChildNodeCommand = commandFactory.addChildNode(parent, child); + execute(addChildNodeCommand); + } + + /** + * Move node into a new coordinate system with origin in newOrigin. + *

+ * E.g., assume origin is currently (0,0), and consider node at (10,11). + * If we move node into a new coordinate system where the origin is in (3, 4) + * then the new coordinates for node are: (10-3, 11-4) = (7,7) + */ + private void translate(Node node, double deltaX, double deltaY) { + + Bounds childBounds = node.getContent().getBounds(); + double constrainedX = childBounds.getUpperLeft().getX() - deltaX; + double constrainedY = childBounds.getUpperLeft().getY() - deltaY; + + Point2D coords = Point2D.create(constrainedX, constrainedY); + updatePosition(node, coords); + } + + private void updatePosition(Node node, Point2D position) { + UpdateElementPositionCommand updateElementPositionCommand = + commandFactory.updatePosition(node, position); + execute(updateElementPositionCommand); + } + + private void addNode(Node node) { + AddNodeCommand addNodeCommand = commandFactory.addNode(node); + execute(addNodeCommand); + } + + @SuppressWarnings("unchecked") + private void addEdge( + Edge, Node> edge, + Node source, + Connection sourceConnection, + List controlPoints, + Node target, + Connection targetConnection) { + final DeferredCompositeCommand.Builder commandBuilder = + new DeferredCompositeCommand.Builder<>(); + addConnector(commandBuilder, source, edge, sourceConnection); + final ControlPoint[] cps = new ControlPoint[controlPoints.size()]; + for (int i = 0; i < cps.length; i++) { + final ControlPoint cp = ControlPoint.build(controlPoints.get(i)); + addControlPoint(commandBuilder, edge, cp, i); + } + setTargetNode(commandBuilder, target, edge, targetConnection); + execute(commandBuilder.build()); + } + + private void addConnector(final DeferredCompositeCommand.Builder commandBuilder, + final Node, Edge> sourceNode, + final Edge, Node> edge, + final Connection connection) { + commandBuilder.deferCommand(() -> commandFactory.addConnector(sourceNode, edge, connection)); + } + + private void setTargetNode(final DeferredCompositeCommand.Builder commandBuilder, + final Node, Edge> targetNode, + final Edge, Node> edge, + final Connection connection) { + commandBuilder.deferCommand(() -> commandFactory.setTargetNode(targetNode, edge, connection)); + } + + private void addControlPoint(final DeferredCompositeCommand.Builder commandBuilder, + final Edge edge, + final ControlPoint controlPoint, + final int index) { + commandBuilder.deferCommand(() -> commandFactory.addControlPoint(edge, controlPoint, index)); + } + + private CommandResult execute(Command command) { + return commandManager.execute(executionContext, command); + } + + private CommandResult clearGraph() { + return commandManager.execute(executionContext, commandFactory.clearGraph()); + } + + private void addEdge(BpmnEdge edge) { + if (edge.isDocked()) { + addDockedNode(edge.getSource().value(), + edge.getTarget().value()); + } else { + final BpmnEdge.Simple e = (BpmnEdge.Simple) edge; + addEdge(e.getEdge(), + e.getSource().value(), + e.getSourceConnection(), + e.getControlPoints(), + e.getTarget().value(), + e.getTargetConnection()); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/NodeConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/NodeConverter.java new file mode 100644 index 00000000000..19469979c99 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/NodeConverter.java @@ -0,0 +1,25 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import org.eclipse.bpmn2.BaseElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; + +public interface NodeConverter { + + Result convert(T element); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/ProcessPostConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/ProcessPostConverter.java new file mode 100644 index 00000000000..a9449fd784f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/ProcessPostConverter.java @@ -0,0 +1,692 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.dd.dc.Point; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessage; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessageKeys; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EdgePropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNBaseInfo; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.BaseSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.Lane; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.Height; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.Width; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bound; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.MagnetConnection; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.validation.Violation; + +public class ProcessPostConverter { + + private static double PRECISION = 1; + private PostConverterContext context; + + ProcessPostConverter() { + } + + public Result postConvert(BpmnNode rootNode, DefinitionResolver definitionResolver) { + if (definitionResolver.getResolutionFactor() != 1) { + context = PostConverterContext.of(rootNode, definitionResolver.isJbpm()); + adjustAllEdgeConnections(rootNode, true); + if (context.hasCollapsedNodes()) { + + List laneInfos = new ArrayList<>(); + new ArrayList<>(rootNode.getChildren()).stream() + .filter(ProcessPostConverter::isLane) + .filter(BpmnNode::hasChildren) + .forEach(lane -> { + LaneInfo laneInfo = new LaneInfo(lane, Padding.of(lane), new ArrayList<>(lane.getChildren())); + laneInfos.add(laneInfo); + laneInfo.getChildren().forEach(child -> child.setParent(rootNode)); + rootNode.removeChild(lane); + }); + + rootNode.getChildren().stream() + .filter(ProcessPostConverter::isSubProcess) + .forEach(this::postConvertSubProcess); + + List resizedChildren = context.getResizedChildren(rootNode); + resizedChildren.forEach(resizedChild -> applyNodeResize(rootNode, resizedChild)); + + laneInfos.forEach(laneInfo -> { + laneInfo.getLane().setParent(rootNode); + laneInfo.getChildren().forEach(node -> node.setParent(laneInfo.getLane())); + adjustLane(laneInfo.getLane(), laneInfo.getPadding()); + }); + adjustAllEdgeConnections(rootNode, false); + + return Result.success(rootNode, resizedChildren.stream() + .map(n -> MarshallingMessage.builder() + .message("Collapsed node was resized " + n.value().getContent().getDefinition()) + .messageKey(MarshallingMessageKeys.collapsedElementExpanded) + .messageArguments(n.value().getUUID(), + Optional.ofNullable(n.value()) + .map(Node::getContent) + .map(View::getDefinition) + .map(BPMNViewDefinition::getGeneral) + .map(BPMNBaseInfo::getName) + .map(Name::getValue) + .orElse("")) + .type(Violation.Type.WARNING) + .build()) + .toArray(MarshallingMessage[]::new)); + } + } + return Result.success(rootNode); + } + + private static class PostConverterContext { + + private HashMap collapsedNodes; + private HashMap resizedNodes = new HashMap<>(); + + private PostConverterContext(HashMap collapsedNodes) { + this.collapsedNodes = collapsedNodes; + } + + public boolean isCollapsed(BpmnNode node) { + return collapsedNodes.getOrDefault(node, false); + } + + public void setCollapsed(BpmnNode node, boolean collapsed) { + collapsedNodes.put(node, collapsed); + } + + public boolean hasCollapsedNodes() { + return collapsedNodes.values().stream() + .filter(value -> value).findFirst() + .orElse(false); + } + + public boolean isResized(BpmnNode node) { + return resizedNodes.getOrDefault(node, false); + } + + public void setResized(BpmnNode node, boolean resized) { + resizedNodes.put(node, resized); + } + + public List getResizedChildren(BpmnNode node) { + return node.getChildren().stream() + .filter(this::isResized) + .collect(Collectors.toList()); + } + + public static PostConverterContext of(BpmnNode rootNode, boolean jbpmnModel) { + HashMap collapsedNodes = new HashMap<>(); + calculateCollapsedNodes(rootNode, jbpmnModel, collapsedNodes); + return new PostConverterContext(collapsedNodes); + } + + private static void calculateCollapsedNodes(BpmnNode rootNode, + boolean jbpmnModel, + HashMap collapsedNodes) { + if (jbpmnModel) { + return; + } + for (BpmnNode child : rootNode.getChildren()) { + if (isLane(child)) { + calculateCollapsedNodes(child, jbpmnModel, collapsedNodes); + } else if (isSubProcess(child)) { + //this calculation can't be done for jBPM processes since this expanded attribute wasn't properly + //set for jBPM Designer or initial Stunner versions. + boolean collapsed = !child.getPropertyReader().isExpanded(); + collapsedNodes.put(child, collapsed); + calculateCollapsedNodes(child, jbpmnModel, collapsedNodes); + } + } + } + } + + private void postConvertSubProcess(BpmnNode subProcess) { + subProcess.getChildren().stream() + .filter(ProcessPostConverter::isSubProcess) + .forEach(this::postConvertSubProcess); + + List resizedChildren = context.getResizedChildren(subProcess); + resizedChildren.forEach(resizedChild -> applyNodeResize(subProcess, resizedChild)); + if ((context.isCollapsed(subProcess) && subProcess.hasChildren()) || !resizedChildren.isEmpty()) { + resizeSubProcess(subProcess); + } + if (context.isCollapsed(subProcess)) { + Bound subProcessUl = subProcess.value().getContent().getBounds().getUpperLeft(); + //boundary elements are relative to the target node, translation is no applied for this elements. + subProcess.getChildren().stream() + .filter(child -> !child.isDocked()) + .forEach(child -> translate(child, subProcessUl.getX(), subProcessUl.getY())); + translate(subProcess.getEdges(), subProcessUl.getX(), subProcessUl.getY()); + context.setCollapsed(subProcess, false); + } + } + + private void resizeSubProcess(BpmnNode subProcess) { + if (subProcess.hasChildren()) { + ViewPort viewPort = ViewPort.of(subProcess, true); + double leftPadding = viewPort.getUpperLeftX(); + double topPadding = viewPort.getUpperLeftY(); + double width = viewPort.getLowerRightX() + leftPadding; + double height = viewPort.getLowerRightY() + topPadding; + + Bounds subProcessBounds = subProcess.value().getContent().getBounds(); + Bound subProcessUl = subProcessBounds.getUpperLeft(); + Bound subProcessLr = subProcessBounds.getLowerRight(); + Bounds subProcessOriginalBounds = Bounds.create(subProcessUl.getX(), subProcessUl.getY(), subProcessLr.getX(), subProcessLr.getY()); + double originalWidth = subProcessBounds.getWidth(); + double originalHeight = subProcessBounds.getHeight(); + subProcessLr.setX(subProcessUl.getX() + width); + subProcessLr.setY(subProcessUl.getY() + height); + + RectangleDimensionsSet subProcessRectangle = ((BaseSubprocess) subProcess.value().getContent().getDefinition()).getDimensionsSet(); + subProcessRectangle.setWidth(new Width(width)); + subProcessRectangle.setHeight(new Height(height)); + context.setResized(subProcess, true); + + double widthFactor = width / originalWidth; + double heightFactor = height / originalHeight; + //incoming connections has the target point relative to subProcess so they needs to be scaled. + inEdges(subProcess.getParent(), subProcess).forEach(edge -> scale(edge.getTargetConnection().getLocation(), widthFactor, heightFactor)); + //outgoing connections has source point relative to the subProcess so they needs to be scaled. + outEdges(subProcess.getParent(), subProcess).forEach(edge -> scale(edge.getSourceConnection().getLocation(), widthFactor, heightFactor)); + //boundary elements are relative to the target subProcess so they needs to be scaled. + dockedNodes(subProcess.getParent(), subProcess).forEach(node -> scaleBoundaryEventPosition(node, subProcessOriginalBounds, subProcessBounds, widthFactor, heightFactor)); + } + } + + /** + * Scales a boundary event position accordingly with his positioning on the target node. + */ + private static void scaleBoundaryEventPosition(BpmnNode boundaryEvent, Bounds subProcessOriginalBounds, Bounds subProcessCurrentBounds, double widthFactor, double heightFactor) { + Bounds bounds = boundaryEvent.value().getContent().getBounds(); + Bound ul = bounds.getUpperLeft(); + Bound lr = bounds.getLowerRight(); + double width = bounds.getWidth(); + double height = bounds.getHeight(); + if (ul.getX() > 0 && ul.getY() <= 0) { + ul.setX(ul.getX() * widthFactor); + } else if (ul.getX() >= (subProcessOriginalBounds.getWidth() - width / 2) && ul.getY() > 0) { + ul.setX(ul.getX() + subProcessCurrentBounds.getWidth() - subProcessOriginalBounds.getWidth()); + ul.setY(ul.getY() * heightFactor); + } else if (ul.getX() > 0 && ul.getY() >= (subProcessOriginalBounds.getHeight() - height / 2)) { + ul.setX(ul.getX() * widthFactor); + ul.setY(ul.getY() + subProcessCurrentBounds.getHeight() - subProcessOriginalBounds.getHeight()); + } else if (ul.getX() <= 0 && ul.getY() > 0) { + ul.setY(ul.getY() * heightFactor); + } + lr.setX(ul.getX() + width); + lr.setY(ul.getY() + height); + } + + private static void adjustLane(BpmnNode lane, Padding padding) { + if (lane.hasChildren()) { + ViewPort viewPort = ViewPort.of(lane, false); + Bounds laneBounds = lane.value().getContent().getBounds(); + Bound laneUl = laneBounds.getUpperLeft(); + Bound laneLr = laneBounds.getLowerRight(); + laneUl.setX(viewPort.getUpperLeftX() - padding.getLeft()); + laneUl.setY(viewPort.getUpperLeftY() - padding.getTop()); + laneLr.setX(viewPort.getLowerRightX() + padding.getRight()); + laneLr.setY(viewPort.getLowerRightY() + padding.getBottom()); + + RectangleDimensionsSet laneRectangle = ((Lane) lane.value().getContent().getDefinition()).getDimensionsSet(); + laneRectangle.setWidth(new Width(laneBounds.getWidth())); + laneRectangle.setHeight(new Height(laneBounds.getHeight())); + } + } + + private static void adjustEdgeConnections(BpmnEdge.Simple edge, boolean includeMagnets) { + if (includeMagnets) { + adjustMagnet(edge, true); + adjustMagnet(edge, false); + } + adjustEdgeConnection(edge, true); + adjustEdgeConnection(edge, false); + } + + private static void adjustMagnet(BpmnEdge.Simple edge, boolean targetConnection) { + EdgePropertyReader propertyReader = (EdgePropertyReader) edge.getPropertyReader(); + BPMNEdge bpmnEdge = propertyReader.getDefinitionResolver().getEdge(propertyReader.getElement().getId()); + + if (bpmnEdge.getWaypoint().size() >= 2) { + Point wayPoint; + org.eclipse.dd.dc.Bounds bounds; + Bounds nodeBounds; + Connection magnetConnection; + Point2D magnetLocation; + + if (targetConnection) { + wayPoint = bpmnEdge.getWaypoint().get(bpmnEdge.getWaypoint().size() - 1); + bounds = edge.getTarget().getPropertyReader().getShape().getBounds(); + magnetConnection = edge.getTargetConnection(); + magnetLocation = magnetConnection.getLocation(); + nodeBounds = edge.getTarget().value().getContent().getBounds(); + } else { + wayPoint = bpmnEdge.getWaypoint().get(0); + bounds = edge.getSource().getPropertyReader().getShape().getBounds(); + magnetConnection = edge.getSourceConnection(); + magnetLocation = magnetConnection.getLocation(); + nodeBounds = edge.getSource().value().getContent().getBounds(); + } + //establish the magnet location using original elements for safety, since elements like events and gateways have + //fixed sizes in Stunner. + double wayPointX = wayPoint.getX(); + double wayPointY = wayPoint.getY(); + double boundX = bounds.getX(); + double boundY = bounds.getY(); + double width = bounds.getWidth(); + double height = bounds.getHeight(); + + if (equals(wayPointY, boundY, PRECISION)) { + //magnet is on top in the aris node + magnetLocation.setX(nodeBounds.getWidth() / 2); + magnetLocation.setY(0); + } else if (equals(wayPointY, boundY + height, PRECISION)) { + //magnet is on bottom in the aris node + magnetLocation.setX(nodeBounds.getWidth() / 2); + magnetLocation.setY(nodeBounds.getHeight()); + } else if (equals(wayPointX, boundX, PRECISION)) { + //magnet is on the left in the aris node + magnetLocation.setX(0); + magnetLocation.setY(nodeBounds.getHeight() / 2); + } else if (equals(wayPointX, boundX + width, PRECISION)) { + //magnet is on the right the aris node + magnetLocation.setX(nodeBounds.getWidth()); + magnetLocation.setY(nodeBounds.getHeight() / 2); + } else { + if (magnetConnection instanceof MagnetConnection) { + ((MagnetConnection) magnetConnection).setAuto(true); + } + } + } + } + + private static void adjustAllEdgeConnections(BpmnNode parentNode, boolean includeMagnets) { + parentNode.getChildren().stream() + .filter(child -> !child.isDocked()) + .forEach(node -> adjustAllEdgeConnections(node, includeMagnets)); + simpleEdges(parentNode.getEdges()).forEach(edge -> adjustEdgeConnections(edge, includeMagnets)); + } + + private static void adjustEdgeConnection(BpmnEdge.Simple edge, boolean targetConnection) { + Point2D siblingPoint = null; + Connection magnetConnection; + Point2D magnetPoint; + BpmnNode connectionPointNode; + List controlPoints = edge.getControlPoints(); + if (targetConnection) { + magnetConnection = edge.getTargetConnection(); + magnetPoint = magnetConnection.getLocation(); + connectionPointNode = edge.getTarget(); + if (controlPoints.size() >= 1) { + siblingPoint = controlPoints.get(controlPoints.size() - 1); + } + } else { + magnetConnection = edge.getSourceConnection(); + magnetPoint = magnetConnection.getLocation(); + connectionPointNode = edge.getSource(); + if (controlPoints.size() >= 1) { + siblingPoint = controlPoints.get(0); + } + } + if (siblingPoint != null) { + Bounds bounds = connectionPointNode.value().getContent().getBounds(); + Bound nodeUl = bounds.getUpperLeft(); + if (connectionPointNode.isDocked()) { + //boundary nodes coordinates are relative to the target node, so we need to de-relativize the coordinates. + BpmnNode dockedNodeTarget = findDockedNodeTarget(connectionPointNode); + if (dockedNodeTarget != null) { + double width = bounds.getWidth(); + double height = bounds.getHeight(); + Bounds dockedNodeTargetBounds = dockedNodeTarget.value().getContent().getBounds(); + Bound dockingNodeUL = dockedNodeTargetBounds.getUpperLeft(); + //translate to absolute coordinates + nodeUl = new Bound(nodeUl.getX() + dockingNodeUL.getX(), + nodeUl.getY() + dockingNodeUL.getY()); + Bound nodeLr = new Bound(nodeUl.getX() + width, nodeUl.getY() + height); + bounds = Bounds.create(nodeUl, nodeLr); + } + } + if (!(magnetConnection instanceof MagnetConnection && ((MagnetConnection) magnetConnection).isAuto())) { + if (equals(magnetPoint.getY(), 0, PRECISION) || equals(magnetPoint.getY(), bounds.getHeight(), PRECISION)) { + //magnet point is on top or bottom + if (siblingPoint.getY() != (magnetPoint.getY() + nodeUl.getY())) { + siblingPoint.setX(nodeUl.getX() + (bounds.getWidth() / 2)); + } + } else { + //magnet point is on left or right + if (siblingPoint.getX() != (magnetPoint.getX() + nodeUl.getX())) { + siblingPoint.setY(nodeUl.getY() + (bounds.getHeight() / 2)); + } + } + } + } + } + + /** + * @return The node to which a docked/boundary node is attached. + */ + private static BpmnNode findDockedNodeTarget(BpmnNode dockedNode) { + BpmnNode parent = dockedNode.getParent(); + while (parent != null && isLane(parent)) { + //lanes has no edges, so we need to reach first non lane parent to get the edges. + parent = parent.getParent(); + } + if (parent != null) { + return parent.getEdges().stream() + .filter(BpmnEdge::isDocked) + .filter(edge -> edge.getTarget() == dockedNode) + .map(BpmnEdge::getSource) + .findFirst().orElse(null); + } + return null; + } + + private void applyNodeResize(BpmnNode container, BpmnNode resizedChild) { + Bounds originalBounds = resizedChild.getPropertyReader().getBounds(); + Bounds currentBounds = resizedChild.value().getContent().getBounds(); + double deltaX = currentBounds.getWidth() - originalBounds.getWidth(); + double deltaY = currentBounds.getHeight() - originalBounds.getHeight(); + //boundary elements are relative to the target node, translation is no applied for this elements. + container.getChildren().stream() + .filter(child -> child != resizedChild) + .filter(child -> !child.isDocked()) + .forEach(child -> applyTranslationIfRequired(currentBounds.getX(), currentBounds.getY(), deltaX, deltaY, child)); + + simpleEdges(container.getEdges()).forEach(edge -> { + applyTranslationIfRequired(currentBounds.getX(), currentBounds.getY(), deltaX, deltaY, edge); + adjustEdgeConnections(edge, false); + }); + } + + private void translate(BpmnNode node, double deltaX, double deltaY) { + Bounds childBounds = node.value().getContent().getBounds(); + translate(childBounds.getUpperLeft(), deltaX, deltaY); + translate(childBounds.getLowerRight(), deltaX, deltaY); + if (!context.isCollapsed(node)) { + node.getChildren().forEach(child -> translate(child, deltaX, deltaY)); + translate(node.getEdges(), deltaX, deltaY); + } + } + + private static void translate(List edges, double deltaX, double deltaY) { + simpleEdges(edges).forEach(edge -> translate(edge, deltaX, deltaY)); + } + + private static void translate(BpmnEdge.Simple edge, double deltaX, double deltaY) { + //source and target connections points are relative to the respective source and target node, no translation is required for them, + //only the control points are translated. + edge.getControlPoints().forEach(controlPoint -> translate(controlPoint, deltaX, deltaY)); + } + + private static void translate(Point2D point, double deltaX, double deltaY) { + point.setX(point.getX() + deltaX); + point.setY(point.getY() + deltaY); + } + + private static void translate(Bound bound, double deltaX, double deltaY) { + bound.setX(bound.getX() + deltaX); + bound.setY(bound.getY() + deltaY); + } + + private static void scale(Point2D point2D, double widthFactor, double heightFactor) { + point2D.setX(point2D.getX() * widthFactor); + point2D.setY(point2D.getY() * heightFactor); + } + + private void applyTranslationIfRequired(double x, double y, double deltaX, double deltaY, BpmnNode node) { + Bounds bounds = node.value().getContent().getBounds(); + Bound ul = bounds.getUpperLeft(); + if (ul.getX() >= x && ul.getY() >= y) { + translate(node, deltaX, deltaY); + } else if (ul.getX() >= x && ul.getY() < y) { + translate(node, deltaX, 0); + } else if (ul.getX() < x && ul.getY() >= y) { + translate(node, 0, deltaY); + } + } + + private static void applyTranslationIfRequired(double x, double y, double deltaX, double deltaY, BpmnEdge.Simple edge) { + edge.getControlPoints().forEach(point -> applyTranslationIfRequired(x, y, deltaX, deltaY, point)); + } + + private static void applyTranslationIfRequired(double x, double y, double deltaX, double deltaY, Point2D point) { + if (point.getX() >= x && point.getY() >= y) { + translate(point, deltaX, deltaY); + } else if (point.getX() >= x && point.getY() < y) { + translate(point, deltaX, 0); + } else if (point.getX() < x && point.getY() >= y) { + translate(point, 0, deltaY); + } + } + + private static boolean isSubProcess(BpmnNode node) { + return node.value().getContent().getDefinition() instanceof EmbeddedSubprocess || + node.value().getContent().getDefinition() instanceof EventSubprocess || + node.value().getContent().getDefinition() instanceof AdHocSubprocess; + } + + private static boolean isLane(BpmnNode node) { + return node.value().getContent().getDefinition() instanceof Lane; + } + + /** + * @return The list of incoming edges for the targetNode. + */ + private static List inEdges(BpmnNode container, BpmnNode targetNode) { + return simpleEdges(container.getEdges()) + .filter(edge -> edge.getTarget() == targetNode) + .collect(Collectors.toList()); + } + + /** + * @return The list of outgoing edges for the sourceNode. + */ + private static List outEdges(BpmnNode container, BpmnNode sourceNode) { + return simpleEdges(container.getEdges()) + .filter(edge -> edge.getSource() == sourceNode) + .collect(Collectors.toList()); + } + + /** + * @return The list of nodes that are docked, typically the boundary events, on the given node. + */ + private static Stream dockedNodes(BpmnNode container, BpmnNode node) { + return container.getEdges().stream() + .filter(BpmnEdge::isDocked) + .filter(edge -> edge.getSource() == node) + .map(BpmnEdge::getTarget); + } + + private static Stream simpleEdges(List edges) { + return edges.stream() + .filter(edge -> edge instanceof BpmnEdge.Simple) + .map(edge -> (BpmnEdge.Simple) edge); + } + + private static > T min(List values, Function mapper) { + return Collections.min(values.stream().map(mapper).collect(Collectors.toList())); + } + + private static > T max(List values, Function mapper) { + return Collections.max(values.stream().map(mapper).collect(Collectors.toList())); + } + + private static boolean equals(double a, double b, double delta) { + if (Double.compare(a, b) == 0) { + return true; + } else { + return Math.abs(a - b) < delta; + } + } + + private static class LaneInfo { + + private BpmnNode lane; + private Padding padding; + private List children; + + public LaneInfo(BpmnNode lane, Padding padding, List children) { + this.lane = lane; + this.padding = padding; + this.children = children; + } + + public BpmnNode getLane() { + return lane; + } + + public Padding getPadding() { + return padding; + } + + public List getChildren() { + return children; + } + } + + private static class Padding { + + private double top; + private double right; + private double bottom; + private double left; + + public Padding() { + } + + public Padding(double top, double right, double bottom, double left) { + this.top = top; + this.right = right; + this.bottom = bottom; + this.left = left; + } + + public double getTop() { + return top; + } + + public double getRight() { + return right; + } + + public double getBottom() { + return bottom; + } + + public double getLeft() { + return left; + } + + public static Padding of(BpmnNode node) { + if (!node.hasChildren()) { + return new Padding(); + } + ViewPort viewPort = ViewPort.of(node, false); + Bounds bounds = node.value().getContent().getBounds(); + double topPadding = Math.abs(viewPort.getUpperLeftY() - bounds.getUpperLeft().getY()); + double rightPadding = Math.abs(viewPort.getLowerRightX() - bounds.getLowerRight().getX()); + double bottomPadding = Math.abs(viewPort.getLowerRightY() - bounds.getLowerRight().getY()); + double leftPadding = Math.abs(viewPort.getUpperLeftX() - bounds.getUpperLeft().getX()); + return new Padding(topPadding, rightPadding, bottomPadding, leftPadding); + } + } + + private static class ViewPort { + + private double ulx; + private double uly; + private double lrx; + private double lry; + + public ViewPort(double ulx, double uly, double lrx, double lry) { + this.ulx = ulx; + this.uly = uly; + this.lrx = lrx; + this.lry = lry; + } + + public double getUpperLeftX() { + return ulx; + } + + public double getUpperLeftY() { + return uly; + } + + public double getLowerRightX() { + return lrx; + } + + public double getLowerRightY() { + return lry; + } + + public static ViewPort of(BpmnNode node, boolean includeEdges) { + final List ulBounds = node.getChildren().stream() + .filter(child -> !child.isDocked()) + .map(child -> child.value().getContent().getBounds().getUpperLeft()) + .collect(Collectors.toList()); + final List lrBounds = node.getChildren().stream() + .filter(child -> !child.isDocked()) + .map(child -> child.value().getContent().getBounds().getLowerRight()) + .collect(Collectors.toList()); + List controlPoints; + if (includeEdges) { + controlPoints = simpleEdges(node.getEdges()) + .map(BpmnEdge.Simple::getControlPoints) + .flatMap(Collection::stream) + .collect(Collectors.toList()); + } else { + controlPoints = Collections.emptyList(); + } + + double ulx = min(ulBounds, Bound::getX); + double uly = min(ulBounds, Bound::getY); + double lrx = max(lrBounds, Bound::getX); + double lry = max(lrBounds, Bound::getY); + + if (!controlPoints.isEmpty()) { + ulx = Math.min(ulx, min(controlPoints, Point2D::getX)); + uly = Math.min(uly, min(controlPoints, Point2D::getY)); + lrx = Math.max(lrx, max(controlPoints, Point2D::getX)); + lry = Math.max(lry, max(controlPoints, Point2D::getY)); + } + return new ViewPort(ulx, uly, lrx, lry); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/activities/BaseCallActivityConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/activities/BaseCallActivityConverter.java new file mode 100644 index 00000000000..bb41772dbae --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/activities/BaseCallActivityConverter.java @@ -0,0 +1,79 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.activities; + +import org.eclipse.bpmn2.CallActivity; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.NodeConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.CallActivityPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public abstract class BaseCallActivityConverter implements NodeConverter { + + protected final TypedFactoryManager factoryManager; + private final PropertyReaderFactory propertyReaderFactory; + + public BaseCallActivityConverter(TypedFactoryManager factoryManager, + PropertyReaderFactory propertyReaderFactory) { + this.factoryManager = factoryManager; + this.propertyReaderFactory = propertyReaderFactory; + } + + @SuppressWarnings("unchecked") + public Result convert(CallActivity activity) { + CallActivityPropertyReader p = propertyReaderFactory.of(activity); + + Node, Edge> node = createNode(activity, p); + + R definition = node.getContent().getDefinition(); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setExecutionSet(createReusableSubprocessTaskExecutionSet(activity, p)); + + definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo())); + + node.getContent().setBounds(p.getBounds()); + + definition.setSimulationSet(p.getSimulationSet()); + + definition.setDimensionsSet(p.getRectangleDimensionsSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return Result.success(BpmnNode.of(node, p)); + } + + protected abstract Node, Edge> createNode(CallActivity activity, CallActivityPropertyReader p); + + protected abstract E createReusableSubprocessTaskExecutionSet(CallActivity activity, + CallActivityPropertyReader p); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/activities/CallActivityConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/activities/CallActivityConverter.java new file mode 100644 index 00000000000..d765bdaa8d9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/activities/CallActivityConverter.java @@ -0,0 +1,79 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.activities; + +import org.eclipse.bpmn2.CallActivity; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.CallActivityPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.bpmn.definition.property.subProcess.IsCase; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AbortParent; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.CalledElement; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.Independent; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceExecutionMode; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ReusableSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.WaitForCompletion; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class CallActivityConverter extends BaseCallActivityConverter { + + public CallActivityConverter(TypedFactoryManager factoryManager, + PropertyReaderFactory propertyReaderFactory) { + super(factoryManager, propertyReaderFactory); + } + + @Override + protected Node, Edge> createNode(CallActivity activity, CallActivityPropertyReader p) { + return factoryManager.newNode(activity.getId(), ReusableSubprocess.class); + } + + @Override + protected ReusableSubprocessTaskExecutionSet createReusableSubprocessTaskExecutionSet(CallActivity activity, + CallActivityPropertyReader p) { + return new ReusableSubprocessTaskExecutionSet(new CalledElement(activity.getCalledElement()), + new IsCase(p.isCase()), + new Independent(p.isIndependent()), + new AbortParent(p.isAbortParent()), + new WaitForCompletion(p.isWaitForCompletion()), + new IsAsync(p.isAsync()), + new AdHocAutostart(p.isAdHocAutostart()), + new IsMultipleInstance(p.isMultipleInstance()), + new MultipleInstanceExecutionMode(p.isSequential()), + new MultipleInstanceCollectionInput(p.getCollectionInput()), + new MultipleInstanceDataInput(p.getDataInput()), + new MultipleInstanceCollectionOutput(p.getCollectionOutput()), + new MultipleInstanceDataOutput(p.getDataOutput()), + new MultipleInstanceCompletionCondition(p.getCompletionCondition()), + new OnEntryAction(p.getOnEntryAction()), + new OnExitAction(p.getOnExitAction()), + new SLADueDate(p.getSlaDueDate())); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/associations/AssociationConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/associations/AssociationConverter.java new file mode 100644 index 00000000000..964b56abf5c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/associations/AssociationConverter.java @@ -0,0 +1,66 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.associations; + +import java.util.Map; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessageKeys; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnEdge; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.EdgeConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.AssociationPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.definition.Association; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class AssociationConverter implements EdgeConverter { + + private final PropertyReaderFactory propertyReaderFactory; + private TypedFactoryManager factoryManager; + + public AssociationConverter(TypedFactoryManager factoryManager, + PropertyReaderFactory propertyReaderFactory) { + this.factoryManager = factoryManager; + this.propertyReaderFactory = propertyReaderFactory; + } + + @Override + @SuppressWarnings("unchecked") + public Result convertEdge(org.eclipse.bpmn2.Association association, + Map nodes) { + AssociationPropertyReader p = propertyReaderFactory.of(association); + + Edge, Node> edge = factoryManager.newEdge(association.getId(), p.getAssociationByDirection()); + + Association definition = edge.getContent().getDefinition(); + + definition.setGeneral(new BPMNGeneralSet( + new Name(""), + new Documentation(p.getDocumentation()) + )); + + return result(nodes, edge, p, "Association ignored from " + p.getSourceId() + " to " + p.getTargetId(), + MarshallingMessageKeys.associationIgnored); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/BoundaryEventConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/BoundaryEventConverter.java new file mode 100644 index 00000000000..4f217c22cf9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/BoundaryEventConverter.java @@ -0,0 +1,51 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events; + +import java.util.Map; + +import org.eclipse.bpmn2.BoundaryEvent; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessage; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessageKeys; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnEdge; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.EdgeConverter; +import org.kie.workbench.common.stunner.core.validation.Violation; + +/** + * A boundary event is also a sort-of-edge. + * This converter generates the "edge" part of a boundary event. + * The node part is converted by the {@link IntermediateCatchEventConverter} + */ +public class BoundaryEventConverter implements EdgeConverter { + + @Override + public Result convertEdge(BoundaryEvent event, Map nodes) { + String parentId = event.getAttachedToRef().getId(); + String childId = event.getId(); + return valid(nodes, parentId, childId) + ? Result.success(BpmnEdge.docked(nodes.get(parentId), nodes.get(childId))) + : Result.ignored("Boundary ignored", + MarshallingMessage.builder() + .message("Boundary ignored") + .messageKey(MarshallingMessageKeys.boundaryIgnored) + .messageArguments(childId, parentId) + .type(Violation.Type.WARNING) + .build()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/EndEventConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/EndEventConverter.java new file mode 100644 index 00000000000..c27ede7ef5d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/EndEventConverter.java @@ -0,0 +1,294 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events; + +import java.util.List; + +import org.eclipse.bpmn2.CancelEventDefinition; +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.EndEvent; +import org.eclipse.bpmn2.ErrorEventDefinition; +import org.eclipse.bpmn2.EscalationEventDefinition; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.MessageEventDefinition; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.bpmn2.TerminateEventDefinition; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest.Mode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Match; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.AbstractConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.NodeConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EventDefinitionReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EventPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.ThrowEventPropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.EndCompensationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndEscalationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndMessageEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndSignalEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndTerminateEvent; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.ActivityRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.CompensationEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.ScopedSignalEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalScope; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class EndEventConverter extends AbstractConverter implements NodeConverter { + + private final TypedFactoryManager factoryManager; + private final PropertyReaderFactory propertyReaderFactory; + + public EndEventConverter(TypedFactoryManager factoryManager, PropertyReaderFactory propertyReaderFactory, + Mode mode) { + super(mode); + this.factoryManager = factoryManager; + this.propertyReaderFactory = propertyReaderFactory; + } + + public Result convert(EndEvent event) { + ThrowEventPropertyReader p = propertyReaderFactory.of(event); + List eventDefinitions = p.getEventDefinitions(); + switch (eventDefinitions.size()) { + case 0: + return Result.success(endNoneEvent(event)); + case 1: + return Match.of() + .when(e -> e instanceof TerminateEventDefinition, + e -> terminateEndEvent(event, e)) + .when(e -> e instanceof SignalEventDefinition, + e -> signalEventDefinition(event, e)) + .when(e -> e instanceof MessageEventDefinition, + e -> messageEventDefinition(event, e)) + .when(e -> e instanceof ErrorEventDefinition, + e -> errorEventDefinition(event, e)) + .when(e -> e instanceof EscalationEventDefinition, + e -> escalationEventDefinition(event, e)) + .when(e -> e instanceof CompensateEventDefinition, + e -> compensationEventDefinition(event, e)) + .missing(e -> e instanceof CancelEventDefinition, CancelEventDefinition.class) + .mode(getMode()) + .apply(eventDefinitions.get(0)); + default: + throw new UnsupportedOperationException("Multiple event definitions not supported for end event"); + } + } + + private BpmnNode messageEventDefinition(EndEvent event, MessageEventDefinition e) { + Node, Edge> node = + factoryManager.newNode(event.getId(), EndMessageEvent.class); + + EndMessageEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setDataIOSet(new DataIOSet( + p.getAssignmentsInfo() + )); + + definition.setExecutionSet(new MessageEventExecutionSet( + new MessageRef(EventDefinitionReader.messageRefOf(e), + EventDefinitionReader.messageRefStructureOf(e)) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode signalEventDefinition(EndEvent event, SignalEventDefinition nodeId) { + Node, Edge> node = + factoryManager.newNode(event.getId(), EndSignalEvent.class); + + EndSignalEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setDataIOSet(new DataIOSet( + p.getAssignmentsInfo() + )); + + definition.setExecutionSet(new ScopedSignalEventExecutionSet( + new SignalRef(p.getSignalRef()), + new SignalScope(p.getSignalScope()) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode terminateEndEvent(EndEvent event, TerminateEventDefinition e) { + Node, Edge> node = + factoryManager.newNode(event.getId(), EndTerminateEvent.class); + + EndTerminateEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode endNoneEvent(EndEvent event) { + Node, Edge> node = + factoryManager.newNode(event.getId(), EndNoneEvent.class); + EndNoneEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode errorEventDefinition(EndEvent event, ErrorEventDefinition e) { + Node, Edge> node = + factoryManager.newNode(event.getId(), EndErrorEvent.class); + + EndErrorEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setDataIOSet(new DataIOSet( + p.getAssignmentsInfo() + )); + + definition.setExecutionSet(new ErrorEventExecutionSet( + new ErrorRef(EventDefinitionReader.errorRefOf(e)) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode escalationEventDefinition(EndEvent event, + EscalationEventDefinition e) { + Node, Edge> node = + factoryManager.newNode(event.getId(), + EndEscalationEvent.class); + + EndEscalationEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setDataIOSet(new DataIOSet( + p.getAssignmentsInfo() + )); + + definition.setExecutionSet(new EscalationEventExecutionSet( + new EscalationRef(EventDefinitionReader.escalationRefOf(e)) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode compensationEventDefinition(EndEvent event, + CompensateEventDefinition eventDefinition) { + Node, Edge> node = + factoryManager.newNode(event.getId(), + EndCompensationEvent.class); + + EndCompensationEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setExecutionSet(new CompensationEventExecutionSet( + new ActivityRef(EventDefinitionReader.activityRefOf(eventDefinition)) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return BpmnNode.of(node, p); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/IntermediateCatchEventConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/IntermediateCatchEventConverter.java new file mode 100644 index 00000000000..c2f78075fb8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/IntermediateCatchEventConverter.java @@ -0,0 +1,375 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.ConditionalEventDefinition; +import org.eclipse.bpmn2.ErrorEventDefinition; +import org.eclipse.bpmn2.EscalationEventDefinition; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.IntermediateCatchEvent; +import org.eclipse.bpmn2.MessageEventDefinition; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.bpmn2.TimerEventDefinition; +import org.eclipse.bpmn2.impl.EventDefinitionImpl; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest.Mode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Match; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.AbstractConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.NodeConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.CatchEventPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EventDefinitionReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.BaseCancellingEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.conditional.CancellingConditionalEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.error.CancellingErrorEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.CancellingEscalationEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.CancellingSignalEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.CancellingTimerEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettings; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class IntermediateCatchEventConverter extends AbstractConverter implements NodeConverter { + + private final TypedFactoryManager factoryManager; + private final PropertyReaderFactory propertyReaderFactory; + + public IntermediateCatchEventConverter(TypedFactoryManager factoryManager, + PropertyReaderFactory propertyReaderFactory, + Mode mode) { + super(mode); + this.factoryManager = factoryManager; + this.propertyReaderFactory = propertyReaderFactory; + } + + public Result convert(IntermediateCatchEvent event) { + CatchEventPropertyReader p = propertyReaderFactory.of(event); + List eventDefinitions = p.getEventDefinitions(); + switch (eventDefinitions.size()) { + case 0: + throw new UnsupportedOperationException("An intermediate catch event should contain exactly one definition"); + case 1: + return Match.>of() + .when(e -> e instanceof TimerEventDefinition, e -> timerEvent(event, e)) + .when(e -> e instanceof SignalEventDefinition, e -> signalEvent(event, e)) + .when(e -> e instanceof MessageEventDefinition, e -> messageEvent(event, e)) + .when(e -> e instanceof ErrorEventDefinition, e -> errorEvent(event, e)) + .when(e -> e instanceof ConditionalEventDefinition, e -> conditionalEvent(event, e)) + .when(e -> e instanceof EscalationEventDefinition, e -> escalationEvent(event, e)) + .when(e -> e instanceof CompensateEventDefinition, + e -> compensationEvent(event, e)) + .defaultValue(Result.ignored("Ignored IntermediateCatchEvent", getNotFoundMessage(event))) + .mode(getMode()) + .apply(eventDefinitions.get(0)) + .value(); + default: + throw new UnsupportedOperationException("Multiple definitions not supported for intermediate catch event"); + } + } + + public Result convertBoundaryEvent(BoundaryEvent event) { + CatchEventPropertyReader p = propertyReaderFactory.of(event); + List eventDefinitions = p.getEventDefinitions(); + switch (eventDefinitions.size()) { + case 0: + throw new UnsupportedOperationException("A boundary event should contain exactly one definition"); + case 1: + Result result = Match.>of() + .when(e -> e instanceof SignalEventDefinition, e -> signalEvent(event, e)) + .when(e -> e instanceof TimerEventDefinition, e -> timerEvent(event, e)) + .when(e -> e instanceof MessageEventDefinition, e -> messageEvent(event, e)) + .when(e -> e instanceof ErrorEventDefinition, e -> errorEvent(event, e)) + .when(e -> e instanceof ConditionalEventDefinition, e -> conditionalEvent(event, e)) + .when(e -> e instanceof EscalationEventDefinition, e -> escalationEvent(event, e)) + .when(e -> e instanceof CompensateEventDefinition, e -> compensationEvent(event, e)) + //TODO:kogito verify this ignore + //.ignore(e -> e instanceof BoundaryEventImpl,BoundaryEventImpl.class) + .ignore(e -> event.getClass().equals(EventDefinitionImpl.class), + EventDefinitionImpl.class) + .defaultValue(Result.ignored("BoundaryEvent ignored", getNotFoundMessage(event))) + .mode(getMode()) + .apply(eventDefinitions.get(0)) + .value(); + return Optional.of(result) + .map(Result::value) + .filter(Objects::nonNull) + .map(BpmnNode::docked) + .map(node -> Result.success(node)) + .orElse(result); + + default: + throw new UnsupportedOperationException("Multiple definitions not supported for boundary event"); + } + } + + private Result errorEvent(CatchEvent event, ErrorEventDefinition e) { + String nodeId = event.getId(); + Node, Edge> node = factoryManager.newNode(nodeId, IntermediateErrorEventCatching.class); + + IntermediateErrorEventCatching definition = node.getContent().getDefinition(); + CatchEventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral( + new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + ) + ); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + + definition.setDataIOSet( + new DataIOSet(p.getAssignmentsInfo()) + ); + + definition.setExecutionSet( + new CancellingErrorEventExecutionSet( + new CancelActivity(p.isCancelActivity()), + new SLADueDate(p.getSlaDueDate()), + new ErrorRef(EventDefinitionReader.errorRefOf(e)) + ) + ); + + node.getContent().setBounds(p.getBounds()); + + return Result.success(BpmnNode.of(node, p)); + } + + private Result signalEvent(CatchEvent event, SignalEventDefinition e) { + String nodeId = event.getId(); + Node, Edge> node = factoryManager.newNode(nodeId, IntermediateSignalEventCatching.class); + + IntermediateSignalEventCatching definition = node.getContent().getDefinition(); + CatchEventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral( + new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + ) + ); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + + definition.setDataIOSet(new DataIOSet( + p.getAssignmentsInfo() + )); + + definition.setExecutionSet( + new CancellingSignalEventExecutionSet( + new CancelActivity(p.isCancelActivity()), + new SLADueDate(p.getSlaDueDate()), + new SignalRef(p.getSignalRef()) + ) + ); + + node.getContent().setBounds(p.getBounds()); + + return Result.success(BpmnNode.of(node, p)); + } + + private Result timerEvent(CatchEvent event, TimerEventDefinition e) { + String nodeId = event.getId(); + Node, Edge> node = factoryManager.newNode(nodeId, IntermediateTimerEvent.class); + + IntermediateTimerEvent definition = node.getContent().getDefinition(); + CatchEventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral( + new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + ) + ); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + + definition.setExecutionSet( + new CancellingTimerEventExecutionSet( + new CancelActivity(p.isCancelActivity()), + new SLADueDate(p.getSlaDueDate()), + new TimerSettings(p.getTimerSettings(e)) + ) + ); + + node.getContent().setBounds(p.getBounds()); + + return Result.success(BpmnNode.of(node, p)); + } + + private Result messageEvent(CatchEvent event, MessageEventDefinition e) { + String nodeId = event.getId(); + Node, Edge> node = factoryManager.newNode(nodeId, IntermediateMessageEventCatching.class); + + IntermediateMessageEventCatching definition = node.getContent().getDefinition(); + CatchEventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral( + new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + ) + ); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + + definition.setDataIOSet( + new DataIOSet(p.getAssignmentsInfo()) + ); + + definition.setExecutionSet( + new CancellingMessageEventExecutionSet( + new CancelActivity(p.isCancelActivity()), + new SLADueDate(p.getSlaDueDate()), + new MessageRef(EventDefinitionReader.messageRefOf(e), + EventDefinitionReader.messageRefStructureOf(e)) + ) + ); + + node.getContent().setBounds(p.getBounds()); + + return Result.success(BpmnNode.of(node, p)); + } + + private Result conditionalEvent(CatchEvent event, ConditionalEventDefinition e) { + String nodeId = event.getId(); + Node, Edge> node = factoryManager.newNode(nodeId, IntermediateConditionalEvent.class); + + IntermediateConditionalEvent definition = node.getContent().getDefinition(); + CatchEventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral( + new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + ) + ); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + + definition.setExecutionSet( + new CancellingConditionalEventExecutionSet( + new CancelActivity(p.isCancelActivity()), + new SLADueDate(p.getSlaDueDate()), + p.getConditionExpression(e) + ) + ); + + node.getContent().setBounds(p.getBounds()); + + return Result.success(BpmnNode.of(node, p)); + } + + private Result escalationEvent(CatchEvent event, + EscalationEventDefinition e) { + String nodeId = event.getId(); + Node, Edge> node = factoryManager.newNode(nodeId, + IntermediateEscalationEvent.class); + + IntermediateEscalationEvent definition = node.getContent().getDefinition(); + CatchEventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral( + new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + ) + ); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + + definition.setDataIOSet( + new DataIOSet(p.getAssignmentsInfo()) + ); + + definition.setExecutionSet( + new CancellingEscalationEventExecutionSet( + new CancelActivity(p.isCancelActivity()), + new SLADueDate(p.getSlaDueDate()), + new EscalationRef(EventDefinitionReader.escalationRefOf(e)) + ) + ); + + node.getContent().setBounds(p.getBounds()); + + return Result.success(BpmnNode.of(node, p)); + } + + private Result compensationEvent(CatchEvent event, + CompensateEventDefinition e) { + String nodeId = event.getId(); + Node, Edge> node = factoryManager.newNode(nodeId, + IntermediateCompensationEvent.class); + + IntermediateCompensationEvent definition = node.getContent().getDefinition(); + CatchEventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral( + new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + ) + ); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + + CancelActivity cancelActivity = new CancelActivity(false); + SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate()); + BaseCancellingEventExecutionSet executionSet = + new BaseCancellingEventExecutionSet(cancelActivity, slaDueDate); + definition.setExecutionSet(executionSet); + + node.getContent().setBounds(p.getBounds()); + + return Result.success(BpmnNode.of(node, p)); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/IntermediateThrowEventConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/IntermediateThrowEventConverter.java new file mode 100644 index 00000000000..d65b9ae8555 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/IntermediateThrowEventConverter.java @@ -0,0 +1,219 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events; + +import java.util.List; + +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.ConditionalEventDefinition; +import org.eclipse.bpmn2.ErrorEventDefinition; +import org.eclipse.bpmn2.EscalationEventDefinition; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.IntermediateThrowEvent; +import org.eclipse.bpmn2.MessageEventDefinition; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest.Mode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Match; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.AbstractConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.NodeConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EventDefinitionReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EventPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.ThrowEventPropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEventThrowing; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventThrowing; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventThrowing; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.ActivityRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.CompensationEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.ScopedSignalEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalScope; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class IntermediateThrowEventConverter extends AbstractConverter implements NodeConverter { + + private final TypedFactoryManager factoryManager; + private final PropertyReaderFactory propertyReaderFactory; + + public IntermediateThrowEventConverter(TypedFactoryManager factoryManager, + PropertyReaderFactory propertyReaderFactory, + Mode mode) { + super(mode); + this.factoryManager = factoryManager; + this.propertyReaderFactory = propertyReaderFactory; + } + + public Result convert(IntermediateThrowEvent event) { + ThrowEventPropertyReader p = propertyReaderFactory.of(event); + List eventDefinitions = p.getEventDefinitions(); + switch (eventDefinitions.size()) { + case 0: + throw new UnsupportedOperationException("An intermediate throw event should contain exactly one definition"); + case 1: + return Match.of() + .when(e -> e instanceof SignalEventDefinition, e -> signalEvent(event, e)) + .when(e -> e instanceof MessageEventDefinition, e -> messageEvent(event, e)) + .when(e -> e instanceof EscalationEventDefinition, e -> escalationEvent(event, e)) + .when(e -> e instanceof CompensateEventDefinition, e -> compensationEvent(event, e)) + .missing(e -> e instanceof ErrorEventDefinition, ErrorEventDefinition.class) + .missing(e -> e instanceof ConditionalEventDefinition, ConditionalEventDefinition.class) + .mode(getMode()) + .apply(eventDefinitions.get(0)); + default: + throw new UnsupportedOperationException("Multiple definitions not supported for intermediate throw event"); + } + } + + private BpmnNode messageEvent( + IntermediateThrowEvent event, MessageEventDefinition eventDefinition) { + Node, Edge> node = + factoryManager.newNode(event.getId(), IntermediateMessageEventThrowing.class); + + IntermediateMessageEventThrowing definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setDataIOSet(new DataIOSet( + p.getAssignmentsInfo() + )); + + definition.setExecutionSet(new MessageEventExecutionSet( + new MessageRef(EventDefinitionReader.messageRefOf(eventDefinition), + EventDefinitionReader.messageRefStructureOf(eventDefinition)) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode signalEvent( + IntermediateThrowEvent event, + SignalEventDefinition eventDefinition) { + + Node, Edge> node = + factoryManager.newNode(event.getId(), IntermediateSignalEventThrowing.class); + + IntermediateSignalEventThrowing definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setDataIOSet(new DataIOSet( + p.getAssignmentsInfo() + )); + + definition.setExecutionSet(new ScopedSignalEventExecutionSet( + new SignalRef(p.getSignalRef()), + new SignalScope(p.getSignalScope()) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode escalationEvent( + IntermediateThrowEvent event, + EscalationEventDefinition eventDefinition) { + + Node, Edge> node = + factoryManager.newNode(event.getId(), + IntermediateEscalationEventThrowing.class); + + IntermediateEscalationEventThrowing definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setDataIOSet(new DataIOSet( + p.getAssignmentsInfo() + )); + + definition.setExecutionSet(new EscalationEventExecutionSet( + new EscalationRef(EventDefinitionReader.escalationRefOf(eventDefinition)) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode compensationEvent(IntermediateThrowEvent event, + CompensateEventDefinition eventDefinition) { + + Node, Edge> node = + factoryManager.newNode(event.getId(), + IntermediateCompensationEventThrowing.class); + + IntermediateCompensationEventThrowing definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setExecutionSet(new CompensationEventExecutionSet( + new ActivityRef(EventDefinitionReader.activityRefOf(eventDefinition)) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return BpmnNode.of(node, p); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/StartEventConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/StartEventConverter.java new file mode 100644 index 00000000000..b544686bc26 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/StartEventConverter.java @@ -0,0 +1,299 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events; + +import java.util.List; + +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.ConditionalEventDefinition; +import org.eclipse.bpmn2.ErrorEventDefinition; +import org.eclipse.bpmn2.EscalationEventDefinition; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.MessageEventDefinition; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.bpmn2.StartEvent; +import org.eclipse.bpmn2.TimerEventDefinition; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest.Mode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Match; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.AbstractConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.NodeConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.CatchEventPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EventDefinitionReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EventPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartEscalationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent; +import org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.BaseStartEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.conditional.InterruptingConditionalEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.InterruptingEscalationEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.InterruptingTimerEventExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettings; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class StartEventConverter extends AbstractConverter implements NodeConverter { + + private final TypedFactoryManager factoryManager; + private final PropertyReaderFactory propertyReaderFactory; + + public StartEventConverter(TypedFactoryManager factoryManager, PropertyReaderFactory propertyReaderFactory, + Mode mode) { + super(mode); + this.factoryManager = factoryManager; + this.propertyReaderFactory = propertyReaderFactory; + } + + public Result convert(StartEvent event) { + CatchEventPropertyReader p = propertyReaderFactory.of(event); + List eventDefinitions = p.getEventDefinitions(); + switch (eventDefinitions.size()) { + case 0: + return Result.success(noneEvent(event)); + case 1: + return Match.of() + .when(e -> e instanceof SignalEventDefinition, e -> signalEvent(event, e)) + .when(e -> e instanceof MessageEventDefinition, e -> messageEvent(event, e)) + .when(e -> e instanceof TimerEventDefinition, e -> timerEvent(event, e)) + .when(e -> e instanceof ErrorEventDefinition, e -> errorEvent(event, e)) + .when(e -> e instanceof ConditionalEventDefinition, e -> conditionalEvent(event, e)) + .when(e -> e instanceof EscalationEventDefinition, e -> escalationEvent(event, e)) + .when(e -> e instanceof CompensateEventDefinition, e -> compensationEvent(event, e)) + .mode(getMode()) + .apply(eventDefinitions.get(0)); + default: + throw new UnsupportedOperationException("Multiple event definitions not supported for start event"); + } + } + + private BpmnNode noneEvent(StartEvent event) { + Node, Edge> node = factoryManager.newNode(event.getId(), StartNoneEvent.class); + + StartNoneEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation()))); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setSimulationSet(p.getSimulationSet()); + + IsInterrupting isInterrupting = new IsInterrupting(event.isIsInterrupting()); + SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate()); + BaseStartEventExecutionSet baseStartEventExecutionSet = + new BaseStartEventExecutionSet(isInterrupting, slaDueDate); + definition.setExecutionSet(baseStartEventExecutionSet); + + node.getContent().setBounds(p.getBounds()); + + return BpmnNode.of(node, p); + } + + private BpmnNode compensationEvent(StartEvent event, CompensateEventDefinition e) { + Node, Edge> node = + factoryManager.newNode(event.getId(), StartCompensationEvent.class); + + StartCompensationEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation()))); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setSimulationSet(p.getSimulationSet()); + + IsInterrupting isInterrupting = new IsInterrupting(event.isIsInterrupting()); + SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate()); + BaseStartEventExecutionSet baseStartEventExecutionSet = + new BaseStartEventExecutionSet(isInterrupting, slaDueDate); + definition.setExecutionSet(baseStartEventExecutionSet); + + node.getContent().setBounds(p.getBounds()); + + return BpmnNode.of(node, p); + } + + private BpmnNode signalEvent(StartEvent event, SignalEventDefinition e) { + Node, Edge> node = factoryManager.newNode(event.getId(), StartSignalEvent.class); + + StartSignalEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation()))); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setSimulationSet(p.getSimulationSet()); + definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo())); + + IsInterrupting isInterrupting = new IsInterrupting(event.isIsInterrupting()); + SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate()); + SignalRef signalRef = new SignalRef(p.getSignalRef()); + InterruptingSignalEventExecutionSet executionSet = + new InterruptingSignalEventExecutionSet(isInterrupting, slaDueDate, signalRef); + definition.setExecutionSet(executionSet); + + node.getContent().setBounds(p.getBounds()); + + return BpmnNode.of(node, p); + } + + private BpmnNode timerEvent(StartEvent event, TimerEventDefinition e) { + Node, Edge> node = factoryManager.newNode(event.getId(), StartTimerEvent.class); + + StartTimerEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation()))); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setSimulationSet(p.getSimulationSet()); + + IsInterrupting isInterrupting = new IsInterrupting(event.isIsInterrupting()); + SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate()); + TimerSettings timerSettings = new TimerSettings(p.getTimerSettings(e)); + InterruptingTimerEventExecutionSet executionSet = + new InterruptingTimerEventExecutionSet(isInterrupting, slaDueDate, timerSettings); + definition.setExecutionSet(executionSet); + + node.getContent().setBounds(p.getBounds()); + + return BpmnNode.of(node, p); + } + + private BpmnNode conditionalEvent(StartEvent event, ConditionalEventDefinition e) { + Node, Edge> node = factoryManager.newNode(event.getId(), StartConditionalEvent.class); + + StartConditionalEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation()))); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setSimulationSet(p.getSimulationSet()); + + IsInterrupting isInterrupting = new IsInterrupting(event.isIsInterrupting()); + SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate()); + InterruptingConditionalEventExecutionSet executionSet = + new InterruptingConditionalEventExecutionSet(isInterrupting, slaDueDate, p.getConditionExpression(e)); + definition.setExecutionSet(executionSet); + + node.getContent().setBounds(p.getBounds()); + + return BpmnNode.of(node, p); + } + + private BpmnNode errorEvent(StartEvent event, ErrorEventDefinition e) { + Node, Edge> node = factoryManager.newNode(event.getId(), StartErrorEvent.class); + + StartErrorEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation()))); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setSimulationSet(p.getSimulationSet()); + definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo())); + + IsInterrupting isInterrupting = new IsInterrupting(event.isIsInterrupting()); + SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate()); + ErrorRef errorRef = new ErrorRef(EventDefinitionReader.errorRefOf(e)); + InterruptingErrorEventExecutionSet executionSet = + new InterruptingErrorEventExecutionSet(isInterrupting, slaDueDate, errorRef); + definition.setExecutionSet(executionSet); + + node.getContent().setBounds(p.getBounds()); + + return BpmnNode.of(node, p); + } + + private BpmnNode escalationEvent(StartEvent event, EscalationEventDefinition e) { + Node, Edge> node = factoryManager.newNode(event.getId(), StartEscalationEvent.class); + + StartEscalationEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation()))); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setSimulationSet(p.getSimulationSet()); + definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo())); + + IsInterrupting isInterrupting = new IsInterrupting(event.isIsInterrupting()); + SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate()); + EscalationRef escalationRef = new EscalationRef(EventDefinitionReader.escalationRefOf(e)); + InterruptingEscalationEventExecutionSet executionSet = + new InterruptingEscalationEventExecutionSet(isInterrupting, slaDueDate, escalationRef); + definition.setExecutionSet(executionSet); + + node.getContent().setBounds(p.getBounds()); + + return BpmnNode.of(node, p); + } + + private BpmnNode messageEvent(StartEvent event, MessageEventDefinition e) { + Node, Edge> node = factoryManager.newNode(event.getId(), StartMessageEvent.class); + + StartMessageEvent definition = node.getContent().getDefinition(); + EventPropertyReader p = propertyReaderFactory.of(event); + + definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation()))); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setSimulationSet(p.getSimulationSet()); + definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo())); + + IsInterrupting isInterrupting = new IsInterrupting(event.isIsInterrupting()); + SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate()); + MessageRef messageRef = new MessageRef(EventDefinitionReader.messageRefOf(e), + EventDefinitionReader.messageRefStructureOf(e)); + InterruptingMessageEventExecutionSet executionSet = + new InterruptingMessageEventExecutionSet(isInterrupting, slaDueDate, messageRef); + definition.setExecutionSet(executionSet); + + node.getContent().setBounds(p.getBounds()); + + return BpmnNode.of(node, p); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/gateways/GatewayConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/gateways/GatewayConverter.java new file mode 100644 index 00000000000..348f7423aa9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/gateways/GatewayConverter.java @@ -0,0 +1,158 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.gateways; + +import org.eclipse.bpmn2.Gateway; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest.Mode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.BPMNElementDecorators; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Match; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.AbstractConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.NodeConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.GatewayPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.definition.EventGateway; +import org.kie.workbench.common.stunner.bpmn.definition.ExclusiveGateway; +import org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway; +import org.kie.workbench.common.stunner.bpmn.definition.ParallelGateway; +import org.kie.workbench.common.stunner.bpmn.definition.property.gateway.DefaultRoute; +import org.kie.workbench.common.stunner.bpmn.definition.property.gateway.GatewayExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class GatewayConverter extends AbstractConverter implements NodeConverter { + + private final TypedFactoryManager factoryManager; + private final PropertyReaderFactory propertyReaderFactory; + + public GatewayConverter(TypedFactoryManager factoryManager, PropertyReaderFactory propertyReaderFactory, + Mode mode) { + super(mode); + this.factoryManager = factoryManager; + this.propertyReaderFactory = propertyReaderFactory; + } + + public Result convert(org.eclipse.bpmn2.Gateway gateway) { + return Match.>of() + .when(e -> e instanceof org.eclipse.bpmn2.ParallelGateway, + this::parallelGateway) + .when(e -> e instanceof org.eclipse.bpmn2.ExclusiveGateway, + this::exclusiveGateway) + .when(e -> e instanceof org.eclipse.bpmn2.InclusiveGateway, + this::inclusiveGateway) + .when(e -> e instanceof org.eclipse.bpmn2.EventBasedGateway, + this::eventGateway) + .defaultValue(Result.ignored("Gateway not found")) + .inputDecorator(BPMNElementDecorators.flowElementDecorator()) + .outputDecorator(BPMNElementDecorators.resultBpmnDecorator()) + .mode(getMode()) + .apply(gateway) + .value(); + } + + private Result inclusiveGateway(Gateway gateway) { + Node, Edge> node = factoryManager.newNode(gateway.getId(), InclusiveGateway.class); + + InclusiveGateway definition = node.getContent().getDefinition(); + GatewayPropertyReader p = propertyReaderFactory.of(gateway); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setExecutionSet(new GatewayExecutionSet( + new DefaultRoute(p.getDefaultRoute()) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return Result.success(BpmnNode.of(node, p)); + } + + private Result exclusiveGateway(Gateway gateway) { + Node, Edge> node = factoryManager.newNode(gateway.getId(), ExclusiveGateway.class); + + ExclusiveGateway definition = node.getContent().getDefinition(); + GatewayPropertyReader p = propertyReaderFactory.of(gateway); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setExecutionSet(new GatewayExecutionSet( + new DefaultRoute(p.getDefaultRoute()) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return Result.success(BpmnNode.of(node, p)); + } + + private Result parallelGateway(Gateway gateway) { + Node, Edge> node = factoryManager.newNode(gateway.getId(), ParallelGateway.class); + GatewayPropertyReader p = propertyReaderFactory.of(gateway); + + node.getContent().setBounds(p.getBounds()); + ParallelGateway definition = node.getContent().getDefinition(); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return Result.success(BpmnNode.of(node, p)); + } + + private Result eventGateway(Gateway eventGateway) { + Node, Edge> node = factoryManager.newNode(eventGateway.getId(), EventGateway.class); + GatewayPropertyReader p = propertyReaderFactory.of(eventGateway); + + node.getContent().setBounds(p.getBounds()); + EventGateway definition = node.getContent().getDefinition(); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setDimensionsSet(p.getCircleDimensionSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return Result.success(BpmnNode.of(node, p)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/lanes/LaneConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/lanes/LaneConverter.java new file mode 100644 index 00000000000..c01755e5dc2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/lanes/LaneConverter.java @@ -0,0 +1,81 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.lanes; + +import java.util.Optional; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessage; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessageKeys; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.NodeConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.LanePropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.definition.Lane; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.validation.Violation; + +public class LaneConverter implements NodeConverter { + + private final TypedFactoryManager typedFactoryManager; + private PropertyReaderFactory propertyReaderFactory; + + public LaneConverter(TypedFactoryManager typedFactoryManager, PropertyReaderFactory propertyReaderFactory) { + this.typedFactoryManager = typedFactoryManager; + this.propertyReaderFactory = propertyReaderFactory; + } + + public Result convert(org.eclipse.bpmn2.Lane lane) { + return convert(lane, propertyReaderFactory.of(lane)); + } + + public Result convert(org.eclipse.bpmn2.Lane lane, org.eclipse.bpmn2.Lane parent) { + final Result result = convert(lane, propertyReaderFactory.of(lane, parent)); + return Optional.ofNullable(result.value()) + .map(value -> Result.success(value, MarshallingMessage.builder() + .message("Child Lane Set " + lane.getName() + " Converted to Lane " + parent.getName()) + .messageKey(MarshallingMessageKeys.childLaneSetConverted) + .messageArguments(lane.getName(), parent.getName()) + .type(Violation.Type.WARNING) + .build())) + .get(); + } + + private Result convert(org.eclipse.bpmn2.Lane lane, LanePropertyReader p) { + Node, Edge> node = typedFactoryManager.newNode(lane.getId(), Lane.class); + Lane definition = node.getContent().getDefinition(); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getRectangleDimensionsSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return Result.success(BpmnNode.of(node, p)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/BaseRootProcessConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/BaseRootProcessConverter.java new file mode 100644 index 00000000000..37f2484ff13 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/BaseRootProcessConverter.java @@ -0,0 +1,109 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.processes; + +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.bpmn2.Process; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.ResultComposer; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BaseConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.ProcessPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseManagementSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.BaseDiagramSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseProcessData; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +/** + * Convert the root Process with all its children to a BPMNDiagram + */ +public abstract class BaseRootProcessConverter, + S extends BaseDiagramSet, P extends BaseProcessData> { + + final ProcessConverterDelegate delegate; + + public BaseRootProcessConverter(TypedFactoryManager typedFactoryManager, + PropertyReaderFactory propertyReaderFactory, + DefinitionResolver definitionResolver, + BaseConverterFactory factory) { + this.delegate = new ProcessConverterDelegate(typedFactoryManager, + propertyReaderFactory, + definitionResolver, + factory); + } + + public Result convertProcess() { + Process process = delegate.definitionResolver.getProcess(); + String definitionsId = delegate.definitionResolver.getDefinitions().getId(); + BpmnNode processRoot = convertProcessNode(definitionsId, process); + + Result> nodesResult = delegate.convertChildNodes(processRoot, + process.getFlowElements(), + process.getLaneSets()); + Map nodes = nodesResult.value(); + + Result edgesResult = delegate.convertEdges(processRoot, + Stream.concat(process.getFlowElements().stream(), + process.getArtifacts().stream()).collect(Collectors.toList()), + nodes); + + Result postConvertResult = delegate.postConvert(processRoot); + + return ResultComposer.compose(processRoot, nodesResult, edgesResult, postConvertResult); + } + + private BpmnNode convertProcessNode(String id, Process process) { + Node, Edge> diagramNode = createNode(id); + D definition = diagramNode.getContent().getDefinition(); + + ProcessPropertyReader e = delegate.propertyReaderFactory.of(process); + + definition.setDiagramSet(createDiagramSet(process, e)); + + definition.setCaseManagementSet(new CaseManagementSet(new CaseIdPrefix(e.getCaseIdPrefix()), + new CaseRoles(e.getCaseRoles()), + new CaseFileVariables(e.getCaseFileVariables()) + )); + + definition.setProcessData(createProcessData(e.getProcessVariables())); + + diagramNode.getContent().setBounds(e.getBounds()); + + definition.setFontSet(e.getFontSet()); + definition.setBackgroundSet(e.getBackgroundSet()); + + return BpmnNode.of(diagramNode, e); + } + + protected abstract Node, Edge> createNode(String id); + + protected abstract S createDiagramSet(Process process, ProcessPropertyReader e); + + protected abstract P createProcessData(String processVariables); +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/BaseSubProcessConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/BaseSubProcessConverter.java new file mode 100644 index 00000000000..0e496c17966 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/BaseSubProcessConverter.java @@ -0,0 +1,226 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.processes; + +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.bpmn2.SubProcess; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.ResultComposer; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BaseConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.AdHocSubProcessPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.MultipleInstanceSubProcessPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.SubProcessPropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.BaseAdHocSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.MultipleInstanceSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.bpmn.definition.property.subProcess.execution.EmbeddedSubprocessExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.subProcess.execution.EventSubprocessExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseAdHocSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceExecutionMode; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseProcessData; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public abstract class BaseSubProcessConverter, + P extends BaseProcessData, S extends BaseAdHocSubprocessTaskExecutionSet> { + + final ProcessConverterDelegate delegate; + + public BaseSubProcessConverter(TypedFactoryManager typedFactoryManager, + PropertyReaderFactory propertyReaderFactory, + DefinitionResolver definitionResolver, + BaseConverterFactory converterFactory) { + this.delegate = new ProcessConverterDelegate(typedFactoryManager, + propertyReaderFactory, + definitionResolver, + converterFactory); + } + + public Result convertSubProcess(SubProcess subProcess) { + BpmnNode subProcessRoot; + if (subProcess instanceof org.eclipse.bpmn2.AdHocSubProcess) { + subProcessRoot = convertAdHocSubProcess((org.eclipse.bpmn2.AdHocSubProcess) subProcess); + } else if (subProcess.getLoopCharacteristics() != null) { + subProcessRoot = convertMultInstanceSubprocessNode(subProcess); + } else if (subProcess.isTriggeredByEvent()) { + subProcessRoot = convertEventSubprocessNode(subProcess); + } else { + subProcessRoot = convertEmbeddedSubprocessNode(subProcess); + } + + Result> nodesResult = delegate.convertChildNodes(subProcessRoot, + subProcess.getFlowElements(), + subProcess.getLaneSets()); + Map nodes = nodesResult.value(); + + Result edgesResult = delegate.convertEdges(subProcessRoot, + Stream.concat(subProcess.getFlowElements().stream(), + subProcess.getArtifacts().stream()).collect(Collectors.toList()), + nodes); + + return ResultComposer.compose(subProcessRoot, nodesResult, edgesResult); + } + + private BpmnNode convertMultInstanceSubprocessNode(SubProcess subProcess) { + Node, Edge> node = delegate.factoryManager.newNode(subProcess.getId(), + MultipleInstanceSubprocess.class); + + MultipleInstanceSubprocess definition = node.getContent().getDefinition(); + MultipleInstanceSubProcessPropertyReader p = delegate.propertyReaderFactory.ofMultipleInstance(subProcess); + + definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setExecutionSet( + new MultipleInstanceSubprocessTaskExecutionSet(new MultipleInstanceExecutionMode(p.isSequential()), + new MultipleInstanceCollectionInput(p.getCollectionInput()), + new MultipleInstanceCollectionOutput(p.getCollectionOutput()), + new MultipleInstanceDataInput(p.getDataInput()), + new MultipleInstanceDataOutput(p.getDataOutput()), + new MultipleInstanceCompletionCondition(p.getCompletionCondition()), + new OnEntryAction(p.getOnEntryAction()), + new OnExitAction(p.getOnExitAction()), + new IsMultipleInstance(true), + new IsAsync(p.isAsync()), + new SLADueDate(p.getSlaDueDate()) + )); + + definition.setProcessData(new ProcessData(new ProcessVariables(p.getProcessVariables()))); + + definition.setSimulationSet(p.getSimulationSet()); + + definition.setDimensionsSet(p.getRectangleDimensionsSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + node.getContent().setBounds(p.getBounds()); + + return BpmnNode.of(node, p); + } + + private BpmnNode convertAdHocSubProcess(org.eclipse.bpmn2.AdHocSubProcess subProcess) { + Node, Edge> node = createNode(subProcess.getId()); + A definition = node.getContent().getDefinition(); + AdHocSubProcessPropertyReader p = delegate.propertyReaderFactory.of(subProcess); + + definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setProcessData(createProcessData(p.getProcessVariables())); + + definition.setExecutionSet(createAdHocSubprocessTaskExecutionSet(p)); + + definition.setSimulationSet(p.getSimulationSet()); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getRectangleDimensionsSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode convertEmbeddedSubprocessNode(SubProcess subProcess) { + Node, Edge> node = delegate.factoryManager.newNode(subProcess.getId(), + EmbeddedSubprocess.class); + + EmbeddedSubprocess definition = node.getContent().getDefinition(); + SubProcessPropertyReader p = delegate.propertyReaderFactory.of(subProcess); + + definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setExecutionSet(new EmbeddedSubprocessExecutionSet(new OnEntryAction(p.getOnEntryAction()), + new OnExitAction(p.getOnExitAction()), + new IsAsync(p.isAsync()), + new SLADueDate(p.getSlaDueDate()) + )); + + definition.setProcessData(new ProcessData(new ProcessVariables(p.getProcessVariables()))); + + definition.setSimulationSet(p.getSimulationSet()); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getRectangleDimensionsSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode convertEventSubprocessNode(SubProcess subProcess) { + Node, Edge> node = delegate.factoryManager.newNode(subProcess.getId(), + EventSubprocess.class); + + EventSubprocess definition = node.getContent().getDefinition(); + SubProcessPropertyReader p = delegate.propertyReaderFactory.of(subProcess); + + definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setExecutionSet(new EventSubprocessExecutionSet(new IsAsync(p.isAsync()), + new SLADueDate(p.getSlaDueDate()))); + + definition.setProcessData(new ProcessData(new ProcessVariables(p.getProcessVariables()))); + + definition.setSimulationSet(p.getSimulationSet()); + + definition.setDimensionsSet(p.getRectangleDimensionsSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + node.getContent().setBounds(p.getBounds()); + + return BpmnNode.of(node, p); + } + + protected abstract Node, Edge> createNode(String id); + + protected abstract P createProcessData(String processVariables); + + protected abstract S createAdHocSubprocessTaskExecutionSet(AdHocSubProcessPropertyReader p); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/ProcessConverterDelegate.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/ProcessConverterDelegate.java new file mode 100644 index 00000000000..3907f0b725f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/ProcessConverterDelegate.java @@ -0,0 +1,170 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.processes; + +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.LaneSet; +import org.eclipse.emf.common.util.EList; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.ResultComposer; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BaseConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnEdge; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; + +/** + * Creates converters for Processes and SubProcesses + *

+ * Processes and SubProcesses are alike, but are not exactly compatible + * type-wise. However, they may contain the same type of nodes. + * ProcessConverterFactory returns instances of ProcessConverters + * and SubprocessConverters. + */ +final class ProcessConverterDelegate { + + protected final TypedFactoryManager factoryManager; + protected final PropertyReaderFactory propertyReaderFactory; + protected final DefinitionResolver definitionResolver; + private final BaseConverterFactory converterFactory; + + ProcessConverterDelegate( + TypedFactoryManager typedFactoryManager, + PropertyReaderFactory propertyReaderFactory, + DefinitionResolver definitionResolver, + BaseConverterFactory factory) { + + this.factoryManager = typedFactoryManager; + this.definitionResolver = definitionResolver; + this.propertyReaderFactory = propertyReaderFactory; + this.converterFactory = factory; + } + + Result> convertChildNodes( + BpmnNode firstNode, + List flowElements, + List laneSets) { + + final Result> flowElementsResult = convertFlowElements(flowElements); + final Map freeFloatingNodes = flowElementsResult.value(); + + freeFloatingNodes + .values() + .forEach(n -> n.setParent(firstNode)); + + final Result[] laneSetsResult = convertLaneSets(laneSets, freeFloatingNodes, firstNode); + + final Map lanesMap = Stream.of(laneSetsResult) + .filter(Objects::nonNull).map(v -> v.value()) + .collect(Collectors.toMap(n -> n.value().getUUID(), n -> n)); + freeFloatingNodes.putAll(lanesMap); + + return ResultComposer.compose(freeFloatingNodes, flowElementsResult, ResultComposer.compose(laneSets, laneSetsResult)); + } + + Result convertEdges(BpmnNode processRoot, List flowElements, Map nodes) { + + List> results = flowElements.stream() + .map(e -> converterFactory.edgeConverter().convertEdge(e, nodes)) + .filter(Result::isSuccess) + .collect(Collectors.toList()); + + boolean value = results.size() > 0 ? + results.stream() + .map(Result::value) + .filter(Objects::nonNull) + .map(processRoot::addEdge) + .allMatch(Boolean.TRUE::equals) + : false; + + return ResultComposer.composeResults(value, results); + } + + private Result> convertFlowElements(List flowElements) { + final List> results = flowElements + .stream() + .map(converterFactory.flowElementConverter()::convertNode) + .collect(Collectors.toList()); + + final Map resultMap = results.stream() + .map(Result::value) + .filter(Objects::nonNull) + .collect(Collectors.toMap(n -> n.value().getUUID(), n -> n)); + + return ResultComposer.composeResults(resultMap, results); + } + + private Result[] convertLane(Lane lane, List parents, Map freeFloatingNodes, BpmnNode firstDiagramNode) { + if (lane.getChildLaneSet() != null) { + parents.add(lane); + Result[] laneSetResult = convertLaneSet(lane.getChildLaneSet(), parents, freeFloatingNodes, firstDiagramNode); + parents.removeIf(parent -> Objects.equals(parent.getId(), lane.getId())); + return laneSetResult; + } else { + Result laneResult; + if (!parents.isEmpty() && lane != parents.get(0)) { + laneResult = converterFactory.laneConverter().convert(lane, parents.get(0)); + } else { + laneResult = converterFactory.laneConverter().convert(lane); + } + final Optional value = Optional.ofNullable(laneResult.value()); + value.ifPresent(laneNode -> laneNode.setParent(firstDiagramNode)); + value.ifPresent(laneNode -> lane.getFlowNodeRefs() + .forEach(node -> freeFloatingNodes.get(node.getId()).setParent(laneNode))); + return new Result[]{laneResult}; + } + } + + @SuppressWarnings("unchecked") + private Result[] convertLaneSets(List laneSets, Map freeFloatingNodes, BpmnNode firstDiagramNode) { + + final List> result = new LinkedList<>(); + for (LaneSet laneSet : laneSets) { + final Result[] converted = convertLaneSet(laneSet, new LinkedList<>(), freeFloatingNodes, firstDiagramNode); + result.addAll(Arrays.asList(converted)); + } + return result.toArray(new Result[result.size()]); + } + + @SuppressWarnings("unchecked") + private Result[] convertLaneSet(LaneSet laneSet, List parents, Map freeFloatingNodes, + BpmnNode firstDiagramNode) { + final EList lanes = laneSet.getLanes(); + final List> result = new LinkedList<>(); + for (Lane lane : lanes) { + final Result[] converted = convertLane(lane, parents, freeFloatingNodes, firstDiagramNode); + result.addAll(Arrays.asList(converted)); + } + return result.toArray(new Result[result.size()]); + } + + Result postConvert(BpmnNode processRoot) { + return converterFactory.newProcessPostConverter().postConvert(processRoot, definitionResolver); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/RootProcessConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/RootProcessConverter.java new file mode 100644 index 00000000000..fe46b6631f1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/RootProcessConverter.java @@ -0,0 +1,76 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.processes; + +import org.eclipse.bpmn2.Process; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BaseConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.ProcessPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Executable; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessInstanceDescription; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Version; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class RootProcessConverter extends BaseRootProcessConverter { + + public RootProcessConverter(TypedFactoryManager typedFactoryManager, + PropertyReaderFactory propertyReaderFactory, + DefinitionResolver definitionResolver, + BaseConverterFactory factory) { + super(typedFactoryManager, propertyReaderFactory, definitionResolver, factory); + } + + @Override + protected Node, Edge> createNode(String id) { + return delegate.factoryManager.newNode(id, BPMNDiagramImpl.class); + } + + @Override + protected DiagramSet createDiagramSet(Process process, ProcessPropertyReader e) { + return new DiagramSet(new Name(process.getName()), + new Documentation(e.getDocumentation()), + new Id(process.getId()), + new Package(e.getPackage()), + new Version(e.getVersion()), + new AdHoc(e.isAdHoc()), + new ProcessInstanceDescription(e.getDescription()), + new GlobalVariables(e.getGlobalVariables()), + new Imports(), + new Executable(process.isIsExecutable()), + new SLADueDate(e.getSlaDueDate())); + } + + @Override + protected ProcessData createProcessData(String processVariables) { + return new ProcessData(new ProcessVariables(processVariables)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/SubProcessConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/SubProcessConverter.java new file mode 100644 index 00000000000..74be01ca2dc --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/SubProcessConverter.java @@ -0,0 +1,73 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.processes; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.ConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.AdHocSubProcessPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocActivationCondition; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocCompletionCondition; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class SubProcessConverter extends BaseSubProcessConverter { + + public SubProcessConverter(TypedFactoryManager typedFactoryManager, + PropertyReaderFactory propertyReaderFactory, + DefinitionResolver definitionResolver, + ConverterFactory converterFactory) { + super(typedFactoryManager, + propertyReaderFactory, + definitionResolver, + converterFactory); + } + + @Override + protected Node, Edge> createNode(String id) { + return delegate.factoryManager.newNode(id, AdHocSubprocess.class); + } + + @Override + protected ProcessData createProcessData(String processVariables) { + return new ProcessData(new ProcessVariables(processVariables)); + } + + @Override + protected AdHocSubprocessTaskExecutionSet createAdHocSubprocessTaskExecutionSet(AdHocSubProcessPropertyReader p) { + return new AdHocSubprocessTaskExecutionSet(new AdHocActivationCondition(p.getAdHocActivationCondition()), + new AdHocCompletionCondition(p.getAdHocCompletionCondition()), + new AdHocOrdering(p.getAdHocOrdering()), + new AdHocAutostart(p.isAdHocAutostart()), + new OnEntryAction(p.getOnEntryAction()), + new OnExitAction(p.getOnExitAction()), + new IsAsync(p.isAsync()), + new SLADueDate(p.getSlaDueDate())); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ActivityPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ActivityPropertyReader.java new file mode 100644 index 00000000000..1c10c25378a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ActivityPropertyReader.java @@ -0,0 +1,94 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.List; +import java.util.Optional; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.emf.common.util.ECollections; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue; + +public class ActivityPropertyReader extends FlowElementPropertyReader { + + protected static final String EMPTY_ASSIGNMENTS = "||||"; + protected final Activity activity; + protected final DefinitionResolver definitionResolver; + + public ActivityPropertyReader(Activity activity, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(activity, diagram, definitionResolver.getShape(activity.getId()), definitionResolver.getResolutionFactor()); + this.activity = activity; + this.definitionResolver = definitionResolver; + } + + public ScriptTypeListValue getOnEntryAction() { + return Scripts.onEntry(element.getExtensionValues()); + } + + public ScriptTypeListValue getOnExitAction() { + return Scripts.onExit(element.getExtensionValues()); + } + + public SimulationSet getSimulationSet() { + return definitionResolver.resolveSimulationParameters(activity.getId()) + .map(SimulationSets::of) + .orElse(new SimulationSet()); + } + + public AssignmentsInfo getAssignmentsInfo() { + AssignmentsInfo info = AssignmentsInfos.of(getDataInputs(), + getDataInputAssociations(), + getDataOutputs(), + getDataOutputAssociations(), + getIOSpecification().isPresent()); + // do not break compatibility with old marshallers: return + // empty delimited fields instead of empty string + if (info.getValue().isEmpty()) { + info.setValue(EMPTY_ASSIGNMENTS); + } + return info; + } + + protected Optional getIOSpecification() { + return Optional.ofNullable(activity.getIoSpecification()); + } + + protected List getDataInputs() { + return getIOSpecification().map(InputOutputSpecification::getDataInputs).orElse(ECollections.emptyEList()); + } + + protected List getDataOutputs() { + return getIOSpecification().map(InputOutputSpecification::getDataOutputs).orElse(ECollections.emptyEList()); + } + + protected List getDataInputAssociations() { + return activity.getDataInputAssociations(); + } + + protected List getDataOutputAssociations() { + return activity.getDataOutputAssociations(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AdHocSubProcessPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AdHocSubProcessPropertyReader.java new file mode 100644 index 00000000000..682669d5655 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AdHocSubProcessPropertyReader.java @@ -0,0 +1,59 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; + +public class AdHocSubProcessPropertyReader extends SubProcessPropertyReader { + + private final AdHocSubProcess process; + + public AdHocSubProcessPropertyReader(AdHocSubProcess element, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(element, diagram, definitionResolver); + this.process = element; + } + + public String getAdHocActivationCondition() { + return CustomElement.customActivationCondition.of(element).get(); + } + + public ScriptTypeValue getAdHocCompletionCondition() { + if (process.getCompletionCondition() instanceof FormalExpression) { + FormalExpression completionCondition = (FormalExpression) process.getCompletionCondition(); + return new ScriptTypeValue( + Scripts.scriptLanguageFromUri(completionCondition.getLanguage(), Scripts.LANGUAGE.MVEL.language()), + FormalExpressionBodyHandler.of(completionCondition).getBody() + ); + } else { + return new ScriptTypeValue(Scripts.LANGUAGE.MVEL.language(), "autocomplete"); + } + } + + public String getAdHocOrdering() { + return process.getOrdering().toString(); + } + + public boolean isAdHocAutostart() { + return CustomElement.autoStart.of(element).get(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AssignmentsInfos.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AssignmentsInfos.java new file mode 100644 index 00000000000..fd803377104 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AssignmentsInfos.java @@ -0,0 +1,155 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.ItemDefinition; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.AssociationDeclaration; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.AssociationList; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.DeclarationList; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.ParsedAssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.VariableDeclaration; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +import static java.util.Arrays.asList; + +public class AssignmentsInfos { + + private static Set RESERVED_DECLARATIONS = new HashSet<>(asList( + "TaskName")); + + private static Set RESERVED_ASSIGNMENTS = new HashSet<>(asList( + "GroupId", + "Skippable", + "Comment", + "Description", + "Priority", + "Content", + "TaskName", + "Locale", + "CreatedBy", + "NotCompletedReassign", + "NotStartedReassign", + "NotCompletedNotify", + "NotStartedNotify")); + + public static AssignmentsInfo of( + final List datainput, + final List inputAssociations, + final List dataoutput, + final List outputAssociations, + boolean alternativeEncoding) { + + ParsedAssignmentsInfo parsedAssignmentsInfo = parsed( + datainput, + inputAssociations, + dataoutput, + outputAssociations, + alternativeEncoding); + + return new AssignmentsInfo(parsedAssignmentsInfo.toString()); + } + + public static ParsedAssignmentsInfo parsed( + List datainput, + List inputAssociations, + List dataoutput, + List outputAssociations, + boolean alternativeEncoding) { + DeclarationList inputs = dataInputDeclarations(datainput); + DeclarationList outputs = dataOutputDeclarations(dataoutput); + + AssociationList associations = new AssociationList( + inAssociationDeclarations(inputAssociations), + outAssociationDeclarations(outputAssociations)); + + return new ParsedAssignmentsInfo( + inputs, outputs, associations, alternativeEncoding); + } + + public static boolean isReservedDeclaration(DataInput o) { + return RESERVED_DECLARATIONS.contains(o.getName()); + } + + public static boolean isReservedIdentifier(String targetName) { + return RESERVED_ASSIGNMENTS.contains(targetName); + } + + private static DeclarationList dataInputDeclarations(List dataInputs) { + return new DeclarationList( + dataInputs.stream() + .filter(o -> !isReservedDeclaration(o)) + .map(in -> new VariableDeclaration( + in.getName(), + getDataType(in))) + .collect(Collectors.toList())); + } + + private static DeclarationList dataOutputDeclarations(List dataOutputs) { + return new DeclarationList( + dataOutputs.stream() + .map(out -> new VariableDeclaration( + out.getName(), + getDataType(out))) + .collect(Collectors.toList())); + } + + /** Returns the Data Type based on the CustomAttribute dtype and in case it does not exist use the ItemSubjectRef. + * @param element the Data Input/Output element + * @return the given element type + */ + private static String getDataType(ItemAwareElement element) { + return Optional + .ofNullable(CustomAttribute.dtype.of(element).get()) + .filter(StringUtils::nonEmpty) + .orElseGet(() -> Optional + .ofNullable(element.getItemSubjectRef()) + .map(ItemDefinition::getStructureRef) + .orElse("")); + } + + private static List inAssociationDeclarations(List inputAssociations) { + return inputAssociations + .stream() + .map(InputAssignmentReader::fromAssociation) + .filter(Objects::nonNull) + .map(InputAssignmentReader::getAssociationDeclaration) + .collect(Collectors.toList()); + } + + private static List outAssociationDeclarations(List outputAssociations) { + return outputAssociations + .stream() + .map(OutputAssignmentReader::fromAssociation) + .filter(Objects::nonNull) + .map(OutputAssignmentReader::getAssociationDeclaration) + .collect(Collectors.toList()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AssociationPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AssociationPropertyReader.java new file mode 100644 index 00000000000..6989f0eab31 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AssociationPropertyReader.java @@ -0,0 +1,98 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.List; + +import org.eclipse.bpmn2.Association; +import org.eclipse.bpmn2.AssociationDirection; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.util.PropertyReaderUtils; +import org.kie.workbench.common.stunner.bpmn.definition.DirectionalAssociation; +import org.kie.workbench.common.stunner.bpmn.definition.NonDirectionalAssociation; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.MagnetConnection; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; + +public class AssociationPropertyReader extends BasePropertyReader implements EdgePropertyReader { + + private final DefinitionResolver definitionResolver; + private final Association association; + + public AssociationPropertyReader(Association association, + BPMNDiagram diagram, + DefinitionResolver definitionResolver) { + super(association, + diagram, + definitionResolver.getShape(association.getId()), + definitionResolver.getResolutionFactor()); + this.association = association; + this.definitionResolver = definitionResolver; + } + + @Override + public String getSourceId() { + return association.getSourceRef().getId(); + } + + @Override + public String getTargetId() { + return association.getTargetRef().getId(); + } + + public Class getAssociationByDirection() { + AssociationDirection d = association.getAssociationDirection(); + if (!AssociationDirection.NONE.equals(d)) { + return DirectionalAssociation.class; + } + return NonDirectionalAssociation.class; + } + + @Override + public Connection getSourceConnection() { + Point2D sourcePosition = PropertyReaderUtils.getSourcePosition(definitionResolver, + element.getId(), + getSourceId()); + return MagnetConnection.Builder + .at(sourcePosition.getX(), + sourcePosition.getY()) + .setAuto(PropertyReaderUtils.isAutoConnectionSource(element)); + } + + @Override + public Connection getTargetConnection() { + Point2D targetPosition = PropertyReaderUtils.getTargetPosition(definitionResolver, + element.getId(), + getTargetId()); + return MagnetConnection.Builder + .at(targetPosition.getX(), + targetPosition.getY()) + .setAuto(PropertyReaderUtils.isAutoConnectionTarget(element)); + } + + @Override + public List getControlPoints() { + return PropertyReaderUtils.getControlPoints(definitionResolver, + element.getId()); + } + + @Override + public DefinitionResolver getDefinitionResolver() { + return definitionResolver; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BasePropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BasePropertyReader.java new file mode 100644 index 00000000000..c1bd7981842 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BasePropertyReader.java @@ -0,0 +1,172 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNShape; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.DocumentationTextHandler; +import org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor; +import org.kie.workbench.common.stunner.bpmn.definition.property.background.BorderColor; +import org.kie.workbench.common.stunner.bpmn.definition.property.background.BorderSize; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.CircleDimensionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.Radius; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.font.FontBorderColor; +import org.kie.workbench.common.stunner.bpmn.definition.property.font.FontBorderSize; +import org.kie.workbench.common.stunner.bpmn.definition.property.font.FontColor; +import org.kie.workbench.common.stunner.bpmn.definition.property.font.FontFamily; +import org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSize; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; + +public class BasePropertyReader implements PropertyReader { + + protected final BaseElement element; + protected final BPMNShape shape; + protected final BPMNDiagram diagram; + protected final double resolutionFactor; + + public BasePropertyReader(final BaseElement element, + final BPMNDiagram diagram, + final BPMNShape shape, + final double resolutionFactor) { + this.element = element; + this.diagram = diagram; + this.shape = shape; + this.resolutionFactor = resolutionFactor; + } + + @Override + public String getDocumentation() { + return element.getDocumentation().stream() + .findFirst() + .map(BasePropertyReader::getDocumentationText) + .orElse(""); + } + + private static String getDocumentationText(org.eclipse.bpmn2.Documentation documentation) { + return DocumentationTextHandler.of(documentation).getText(); + } + + @Override + public String getDescription() { + return CustomElement.description.of(element).get(); + } + + @Override + public FontSet getFontSet() { + final FontFamily fontFamily = new FontFamily(); + final FontColor fontColor = new FontColor(optionalAttribute("fontcolor") + .orElse(colorsDefaultFont())); + final FontSize fontSize = new FontSize(optionalAttribute("fontsize") + .map(Double::parseDouble).orElse(null)); + final FontBorderSize fontBorderSize = new FontBorderSize(); + final FontBorderColor fontBorderColor = new FontBorderColor(); + return new FontSet(fontFamily, fontColor, fontSize, fontBorderSize, fontBorderColor); + } + + @Override + public BackgroundSet getBackgroundSet() { + return new BackgroundSet( + new BgColor(optionalAttribute("bgcolor") + .orElse(colorsDefaultBg())), + new BorderColor(optionalAttribute("bordercolor") + .orElse(colorsDefaultBr())), + new BorderSize() + ); + } + + protected String colorsDefaultBg() { + return null; + } + + protected String colorsDefaultBr() { + return null; + } + + protected String colorsDefaultFont() { + return null; + } + + protected Optional optionalAttribute(String... attributeIds) { + if (element.getAnyAttribute().isEmpty()) { + return Optional.empty(); + } + final List attributes = Arrays.asList(attributeIds); + return element.getAnyAttribute().stream() + .filter(e -> attributes.contains(e.getEStructuralFeature().getName())) + .map(e -> e.getValue().toString()) + .findFirst(); + } + + @Override + public Bounds getBounds() { + if (shape == null) { + return Bounds.create(); + } + return computeBounds(shape.getBounds()); + } + + protected Bounds computeBounds(final org.eclipse.dd.dc.Bounds bounds) { + final double x = bounds.getX() * resolutionFactor; + final double y = bounds.getY() * resolutionFactor; + final double width = bounds.getWidth() * resolutionFactor; + final double height = bounds.getHeight() * resolutionFactor; + return Bounds.create(x, y, x + width, y + height); + } + + @Override + public CircleDimensionSet getCircleDimensionSet() { + if (shape == null) { + return new CircleDimensionSet(); + } + return new CircleDimensionSet(new Radius( + shape.getBounds().getWidth() * resolutionFactor / 2d)); + } + + @Override + public RectangleDimensionsSet getRectangleDimensionsSet() { + if (shape == null) { + return new RectangleDimensionsSet(); + } + org.eclipse.dd.dc.Bounds bounds = shape.getBounds(); + return new RectangleDimensionsSet(bounds.getWidth() * resolutionFactor, + bounds.getHeight() * resolutionFactor); + } + + @Override + public boolean isExpanded() { + return shape.isIsExpanded(); + } + + @Override + public BaseElement getElement() { + return element; + } + + @Override + public BPMNShape getShape() { + return shape; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BoundaryEventPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BoundaryEventPropertyReader.java new file mode 100644 index 00000000000..591c08e9778 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BoundaryEventPropertyReader.java @@ -0,0 +1,73 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; + +public class BoundaryEventPropertyReader extends CatchEventPropertyReader { + + private final BoundaryEvent event; + + public BoundaryEventPropertyReader(BoundaryEvent event, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(event, diagram, definitionResolver); + this.event = event; + } + + @Override + public boolean isCancelActivity() { + return event.isCancelActivity(); + } + + @Override + protected Bounds computeBounds(final org.eclipse.dd.dc.Bounds bounds) { + final Point2D docker = getDockerInfo(); + double x = 0; + double y = 0; + if (docker.getX() != 0 && docker.getY() != 0) { + x = docker.getX() * resolutionFactor; + y = docker.getY() * resolutionFactor; + } else if (event.getAttachedToRef() != null) { + //when the node was generated in other tool than Stunner/jBPM designer the dockerInfo attribute don't exists + //and we need to use attachedToRef activity position to calculate the bounded event relative coordinates. + String activityId = event.getAttachedToRef().getId(); + org.eclipse.dd.dc.Bounds activityBounds = definitionResolver.getShape(activityId).getBounds(); + x = bounds.getX() * resolutionFactor - activityBounds.getX() * resolutionFactor; + y = bounds.getY() * resolutionFactor - activityBounds.getY() * resolutionFactor; + //if required adjust the event relative position according with the positioning supported by Stunner. + if (x < -WIDTH / 2) { + x = -WIDTH / 2; + } else if (x > (activityBounds.getWidth() * resolutionFactor) - WIDTH / 2) { + x = activityBounds.getWidth() * resolutionFactor - WIDTH / 2; + } + if (y < -HEIGHT / 2) { + y = -HEIGHT / 2; + } else if (y > (activityBounds.getHeight() * resolutionFactor) - HEIGHT / 2) { + y = activityBounds.getHeight() * resolutionFactor - HEIGHT / 2; + } + } + return Bounds.create(x, y, x + WIDTH, y + HEIGHT); + } + + Point2D getDockerInfo() { + return CustomAttribute.dockerInfo.of(element).get(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BusinessRuleTaskPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BusinessRuleTaskPropertyReader.java new file mode 100644 index 00000000000..f7a96eb1aba --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BusinessRuleTaskPropertyReader.java @@ -0,0 +1,164 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.List; +import java.util.stream.Collectors; + +import org.eclipse.bpmn2.BusinessRuleTask; +import org.eclipse.bpmn2.DataAssociation; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomInput; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; + +public class BusinessRuleTaskPropertyReader extends TaskPropertyReader { + + private final BusinessRuleTask task; + + public BusinessRuleTaskPropertyReader(BusinessRuleTask task, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(task, diagram, definitionResolver); + this.task = task; + } + + public String getImplementation() { + return task.getImplementation(); + } + + public String getRuleFlowGroup() { + return CustomAttribute.ruleFlowGroup.of(element).get(); + } + + public String getNamespace() { + return CustomInput.namespace.of(task).get(); + } + + public String getDecisionName() { + return CustomInput.decisionName.of(task).get(); + } + + public String getDmnModelName() { + return CustomInput.dmnModelName.of(task).get(); + } + + public boolean isAsync() { + return CustomElement.async.of(element).get(); + } + + public boolean isAdHocAutoStart() { + return CustomElement.autoStart.of(element).get(); + } + + public String getSlaDueDate() { + return CustomElement.slaDueDate.of(element).get(); + } + + @Override + protected List getDataInputs() { + List filteredInputs = super.getDataInputs().stream() + .filter(dataInput -> !isReservedDataInput(dataInput)) + .collect(Collectors.toList()); + + return filteredInputs; + } + + @Override + protected List getDataInputAssociations() { + List rawDataInputs = super.getDataInputs(); + List filteredInputs = super.getDataInputAssociations().stream() + .filter(dia -> !isReservedDataInputAssociation(rawDataInputs, dia)) + .collect(Collectors.toList()); + + return filteredInputs; + } + + @Override + protected List getDataOutputs() { + List filterOutputs = super.getDataOutputs().stream() + .filter(dataOutput -> !isReservedDataOutput(dataOutput)) + .collect(Collectors.toList()); + + return filterOutputs; + } + + @Override + protected List getDataOutputAssociations() { + List rawDataOutputs = super.getDataOutputs(); + List filteredOutputs = super.getDataOutputAssociations().stream() + .filter(doa -> !isReservedDataOutputAssociation(rawDataOutputs, doa)) + .collect(Collectors.toList()); + + return filteredOutputs; + } + + private static String getTargetRefID(DataAssociation dataAssociation) { + return dataAssociation.getTargetRef() != null ? dataAssociation.getTargetRef().getId() : ""; + } + + private static boolean isReservedDataInputAssociation(List dataInputs, + DataInputAssociation dataInputAssociation) { + DataInput dataInput = dataInputs.stream() + .filter(input -> input.getId().equals(getTargetRefID(dataInputAssociation))) + .findFirst() + .orElse(null); + + return isReservedDataInput(dataInput); + } + + private static boolean isReservedDataOutputAssociation(List dataOutputs, + DataOutputAssociation dataOutputAssociation) { + DataOutput dataOutput = dataOutputs.stream() + .filter(output -> output.getId().equals(getTargetRefID(dataOutputAssociation))) + .findFirst() + .orElse(null); + + return isReservedDataOutput(dataOutput); + } + + private static boolean isReservedDataInput(DataInput dataInput) { + if (dataInput == null) { + return false; + } + + String dataName = dataInput.getName(); + return isReservedDataName(dataName); + } + + private static boolean isReservedDataOutput(DataOutput dataOutput) { + if (dataOutput == null) { + return false; + } + + String dataName = dataOutput.getName(); + return isReservedDataName(dataName); + } + + private static boolean isReservedDataName(String dataName) { + if (dataName.isEmpty()) { + return false; + } + + return dataName.equals("namespace") || + dataName.equals("model") || + dataName.equals("decision"); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CallActivityPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CallActivityPropertyReader.java new file mode 100644 index 00000000000..762d0885459 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CallActivityPropertyReader.java @@ -0,0 +1,65 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.CallActivity; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; + +public class CallActivityPropertyReader extends MultipleInstanceActivityPropertyReader { + + protected final CallActivity callActivity; + + public CallActivityPropertyReader(CallActivity callActivity, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(callActivity, diagram, definitionResolver); + this.callActivity = callActivity; + } + + public String getCalledElement() { + return callActivity.getCalledElement(); + } + + public boolean isIndependent() { + return CustomAttribute.independent.of(element).get(); + } + + public boolean isAbortParent() { + return CustomElement.abortParent.of(element).get(); + } + + public boolean isWaitForCompletion() { + return CustomAttribute.waitForCompletion.of(element).get(); + } + + public boolean isAsync() { + return CustomElement.async.of(element).get(); + } + + public boolean isCase() { + return CustomElement.isCase.of(element).get(); + } + + public boolean isAdHocAutostart() { + return CustomElement.autoStart.of(element).get(); + } + + public String getSlaDueDate() { + return CustomElement.slaDueDate.of(element).get(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CaseFileVariableReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CaseFileVariableReader.java new file mode 100644 index 00000000000..d84ee22020b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CaseFileVariableReader.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Property; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables; + +class CaseFileVariableReader { + + static String getCaseFileVariables(List properties) { + return properties + .stream() + .filter(CaseFileVariableReader::isCaseFileVariable) + .map(CaseFileVariableReader::toCaseFileVariableString) + .collect(Collectors.joining(",")); + } + + private static String toCaseFileVariableString(Property p) { + String variableName = getCaseFileVariableName(p); + String caseFileVariableName = variableName.substring(CaseFileVariables.CASE_FILE_PREFIX.length()); + + return Optional.ofNullable(p.getItemSubjectRef()) + .map(ItemDefinition::getStructureRef) + .map(type -> caseFileVariableName + ":" + type) + .orElse(caseFileVariableName); + } + + private static String getCaseFileVariableName(Property p) { + String name = p.getName(); + // legacy uses ID instead of name + return name == null ? p.getId() : name; + } + + public static boolean isCaseFileVariable(Property p) { + String name = getCaseFileVariableName(p); + return name.startsWith(CaseFileVariables.CASE_FILE_PREFIX); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CatchEventPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CatchEventPropertyReader.java new file mode 100644 index 00000000000..1c37be25489 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CatchEventPropertyReader.java @@ -0,0 +1,56 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; + +public class CatchEventPropertyReader extends EventPropertyReader { + + private final CatchEvent catchEvent; + + public CatchEventPropertyReader(CatchEvent catchEvent, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(catchEvent, diagram, definitionResolver); + this.catchEvent = catchEvent; + } + + public boolean isCancelActivity() { + // return default value (only used in boundary) + return true; + } + + @Override + public AssignmentsInfo getAssignmentsInfo() { + return AssignmentsInfos.of( + Collections.emptyList(), + Collections.emptyList(), + catchEvent.getDataOutputs(), + catchEvent.getDataOutputAssociation(), + false); + } + + @Override + public List getEventDefinitions() { + return combineEventDefinitions(catchEvent.getEventDefinitions(), catchEvent.getEventDefinitionRefs()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EdgePropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EdgePropertyReader.java new file mode 100644 index 00000000000..588861cb2fe --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EdgePropertyReader.java @@ -0,0 +1,38 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.List; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; + +public interface EdgePropertyReader extends PropertyReader { + + String getSourceId(); + + String getTargetId(); + + Connection getSourceConnection(); + + Connection getTargetConnection(); + + List getControlPoints(); + + DefinitionResolver getDefinitionResolver(); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EventDefinitionReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EventDefinitionReader.java new file mode 100644 index 00000000000..e48ea3b0dd2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EventDefinitionReader.java @@ -0,0 +1,63 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Optional; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.Error; +import org.eclipse.bpmn2.ErrorEventDefinition; +import org.eclipse.bpmn2.Escalation; +import org.eclipse.bpmn2.EscalationEventDefinition; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.MessageEventDefinition; + +public class EventDefinitionReader { + + public static String errorRefOf(ErrorEventDefinition e) { + return Optional.ofNullable(e.getErrorRef()) + .map(Error::getErrorCode) + .orElse(""); + } + + public static String messageRefOf(MessageEventDefinition e) { + return Optional.ofNullable(e.getMessageRef()) + .map(Message::getName) + .orElse(""); + } + + public static String messageRefStructureOf(MessageEventDefinition e) { + return Optional.ofNullable(e.getMessageRef()) + .map(Message::getItemRef) + .map(ItemDefinition::getStructureRef) + .orElse(""); + } + + public static String escalationRefOf(EscalationEventDefinition e) { + return Optional.ofNullable(e.getEscalationRef()) + .map(Escalation::getEscalationCode) + .orElse(""); + } + + public static String activityRefOf(CompensateEventDefinition e) { + return Optional.ofNullable(e.getActivityRef()) + .map(Activity::getId) + .orElse(null); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EventPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EventPropertyReader.java new file mode 100644 index 00000000000..4396a1eaf53 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EventPropertyReader.java @@ -0,0 +1,136 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.bpmn2.ConditionalEventDefinition; +import org.eclipse.bpmn2.Event; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.Expression; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.bpmn2.TimerEventDefinition; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; +import org.kie.workbench.common.stunner.bpmn.definition.property.common.ConditionExpression; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationAttributeSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; + +public abstract class EventPropertyReader extends FlowElementPropertyReader { + + // These values are present in the SVG declaration for the event shape. + static final double WIDTH = 56d; + static final double HEIGHT = 56d; + + protected final DefinitionResolver definitionResolver; + + EventPropertyReader(Event element, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(element, diagram, definitionResolver.getShape(element.getId()), definitionResolver.getResolutionFactor()); + this.definitionResolver = definitionResolver; + } + + @Override + protected Bounds computeBounds(final org.eclipse.dd.dc.Bounds bounds) { + final double x = bounds.getX() * resolutionFactor; + final double y = bounds.getY() * resolutionFactor; + return Bounds.create(x, y, x + WIDTH, y + HEIGHT); + } + + public String getSignalScope() { + return CustomElement.scope.of(element).get(); + } + + public abstract List getEventDefinitions(); + + public abstract AssignmentsInfo getAssignmentsInfo(); + + public static TimerSettingsValue getTimerSettings(TimerEventDefinition eventDefinition) { + TimerSettingsValue timerSettingsValue = new TimerSettingsValue(); + toFormalExpression(eventDefinition.getTimeCycle()).ifPresent(timeCycle -> { + timerSettingsValue.setTimeCycle(FormalExpressionBodyHandler.of(timeCycle).getBody()); + timerSettingsValue.setTimeCycleLanguage(timeCycle.getLanguage()); + }); + + toFormalExpression(eventDefinition.getTimeDate()).ifPresent(timeDate -> { + timerSettingsValue.setTimeDate(FormalExpressionBodyHandler.of(timeDate).getBody()); + }); + + toFormalExpression(eventDefinition.getTimeDuration()).ifPresent(timeDateDuration -> { + timerSettingsValue.setTimeDuration(FormalExpressionBodyHandler.of(timeDateDuration).getBody()); + }); + return timerSettingsValue; + } + + private static Optional toFormalExpression(Expression e) { + if (e instanceof FormalExpression) { + return Optional.of((FormalExpression) e); + } else { + return Optional.empty(); + } + } + + public String getSignalRef() { + List eventDefinitions = getEventDefinitions(); + if (eventDefinitions.size() == 1 && eventDefinitions.get(0) instanceof SignalEventDefinition) { + String signalRefId = ((SignalEventDefinition) eventDefinitions.get(0)).getSignalRef(); + return signalRefId != null ? definitionResolver.resolveSignalName(signalRefId) : ""; + } + return ""; + } + + public SimulationAttributeSet getSimulationSet() { + return definitionResolver.resolveSimulationParameters(element.getId()) + .map(SimulationAttributeSets::of) + .orElse(new SimulationAttributeSet()); + } + + public String getSlaDueDate() { + return CustomElement.slaDueDate.of(element).get(); + } + + public static ConditionExpression getConditionExpression(ConditionalEventDefinition conditionalEvent) { + if (conditionalEvent.getCondition() instanceof FormalExpression) { + FormalExpression formalExpression = (FormalExpression) conditionalEvent.getCondition(); + String language = Scripts.scriptLanguageFromUri(formalExpression.getLanguage(), Scripts.LANGUAGE.DROOLS.language()); + String script = FormalExpressionBodyHandler.of(formalExpression).getBody(); + return new ConditionExpression(new ScriptTypeValue(language, script)); + } else { + return new ConditionExpression(new ScriptTypeValue(Scripts.LANGUAGE.DROOLS.language(), "")); + } + } + + protected static List combineEventDefinitions(List eventDefinitions, List eventDefinitionRefs) { + //combine the event definitions by filtering the eventDefinitionRefs that points to nowhere for avoiding edge + //cases detected when importing bpmn files generated in ARIS (https://issues.jboss.org/browse/JBPM-6758). + //Stunner doesn't generate eventDefinitionRefs so this filtering can't introduce issues in Stunner. + return Stream.concat(eventDefinitions.stream(), + eventDefinitionRefs.stream() + .filter(Objects::nonNull) + .filter(eventDefinition -> Objects.nonNull(eventDefinition.getId()))) + .collect(Collectors.toList()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/FlowElementPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/FlowElementPropertyReader.java new file mode 100644 index 00000000000..0364d489e65 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/FlowElementPropertyReader.java @@ -0,0 +1,41 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Optional; + +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNShape; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; + +public class FlowElementPropertyReader extends BasePropertyReader { + + private final FlowElement flowElement; + + public FlowElementPropertyReader(FlowElement element, BPMNDiagram diagram, BPMNShape shape, double resolutionFactor) { + super(element, diagram, shape, resolutionFactor); + this.flowElement = element; + } + + public String getName() { + String extendedName = CustomElement.name.of(element).get(); + return extendedName == null || extendedName.isEmpty() ? + Optional.ofNullable(flowElement.getName()).orElse("") + : extendedName; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/GatewayPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/GatewayPropertyReader.java new file mode 100644 index 00000000000..df97bf5c705 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/GatewayPropertyReader.java @@ -0,0 +1,45 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.Gateway; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNShape; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; + +public class GatewayPropertyReader extends FlowElementPropertyReader { + + // These values are present in the SVG declaration for the gateway shape. + static final double WIDTH = 56d; + static final double HEIGHT = 56d; + + public GatewayPropertyReader(Gateway element, BPMNDiagram diagram, BPMNShape shape, double resolutionFactor) { + super(element, diagram, shape, resolutionFactor); + } + + @Override + protected Bounds computeBounds(org.eclipse.dd.dc.Bounds bounds) { + final double x = bounds.getX() * resolutionFactor; + final double y = bounds.getY() * resolutionFactor; + return Bounds.create(x, y, x + WIDTH, y + HEIGHT); + } + + public String getDefaultRoute() { + return CustomAttribute.dg.of(element).get(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/GenericServiceTaskPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/GenericServiceTaskPropertyReader.java new file mode 100644 index 00000000000..d183e5e9cfc --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/GenericServiceTaskPropertyReader.java @@ -0,0 +1,104 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Optional; + +import org.eclipse.bpmn2.Interface; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.Operation; +import org.eclipse.bpmn2.ServiceTask; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +public class GenericServiceTaskPropertyReader extends MultipleInstanceActivityPropertyReader { + + public static final String JAVA = GenericServiceTaskValue.JAVA; + public static final String WEB_SERVICE = "WebService"; + private final ServiceTask task; + + public GenericServiceTaskPropertyReader(ServiceTask task, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(task, diagram, definitionResolver); + this.task = task; + } + + public GenericServiceTaskValue getGenericServiceTask() { + GenericServiceTaskValue value = new GenericServiceTaskValue(); + final String implementation = Optional.ofNullable(CustomAttribute.serviceImplementation.of(task).get()) + .filter(StringUtils::nonEmpty) + .orElseGet(() -> task.getImplementation()); + value.setServiceImplementation(getServiceImplementation(implementation)); + + final String operation = Optional.ofNullable(CustomAttribute.serviceOperation.of(task).get()) + .filter(StringUtils::nonEmpty) + .orElseGet(() -> Optional + .ofNullable(task.getOperationRef()) + .map(Operation::getName) + .orElse(null)); + value.setServiceOperation(operation); + + value.setInMessageStructure(Optional.ofNullable(task.getOperationRef()) + .map(Operation::getInMessageRef) + .map(Message::getItemRef) + .map(ItemDefinition::getStructureRef) + .orElse(null)); + + value.setOutMessagetructure(Optional.ofNullable(task.getOperationRef()) + .map(Operation::getOutMessageRef) + .map(Message::getItemRef) + .map(ItemDefinition::getStructureRef) + .orElse(null)); + + final String serviceInterface = Optional.ofNullable(CustomAttribute.serviceInterface.of(task).get()) + .filter(StringUtils::nonEmpty) + .orElseGet(() -> Optional + .ofNullable(task.getOperationRef()) + .map(Operation::eContainer) + .filter(container -> container instanceof Interface) + .map(container -> (Interface) container) + .map(Interface::getName) + .orElse(null)); + value.setServiceInterface(serviceInterface); + + return value; + } + + public static String getServiceImplementation(String implementation) { + return Optional.ofNullable(implementation) + .filter(StringUtils::nonEmpty) + .filter(impl -> JAVA.equalsIgnoreCase(impl)) + .map(java -> JAVA)//assert that matches "Java" + .orElse(WEB_SERVICE); + } + + public boolean isAsync() { + return CustomElement.async.of(element).get(); + } + + public boolean isAdHocAutostart() { + return CustomElement.autoStart.of(element).get(); + } + + public String getSLADueDate() { + return CustomElement.slaDueDate.of(element).get(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/InputAssignmentReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/InputAssignmentReader.java new file mode 100644 index 00000000000..1be5ab1c0ee --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/InputAssignmentReader.java @@ -0,0 +1,84 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.List; +import java.util.Optional; + +import com.google.gwt.http.client.URL; +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.ItemAwareElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.AssociationDeclaration; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.AssignmentsInfos.isReservedIdentifier; + +public class InputAssignmentReader { + + private final AssociationDeclaration associationDeclaration; + + public static InputAssignmentReader fromAssociation(DataInputAssociation in) { + List sourceList = in.getSourceRef(); + List assignmentList = in.getAssignment(); + String targetName = ((DataInput) in.getTargetRef()).getName(); + if (isReservedIdentifier(targetName)) { + return null; + } + + if (!sourceList.isEmpty()) { + return new InputAssignmentReader(sourceList.get(0), targetName); + } else if (!assignmentList.isEmpty()) { + return new InputAssignmentReader(assignmentList.get(0), targetName); + } else { + throw new IllegalArgumentException("Cannot find SourceRef or Assignment for Target " + targetName); + } + } + + InputAssignmentReader(Assignment assignment, String targetName) { + FormalExpression from = (FormalExpression) assignment.getFrom(); + String body = FormalExpressionBodyHandler.of(from).getBody(); + String encodedBody = encode(body); + this.associationDeclaration = new AssociationDeclaration( + AssociationDeclaration.Direction.Input, + AssociationDeclaration.Type.FromTo, + encodedBody, + targetName); + } + + InputAssignmentReader(ItemAwareElement source, String targetName) { + this.associationDeclaration = new AssociationDeclaration( + AssociationDeclaration.Direction.Input, + AssociationDeclaration.Type.SourceTarget, + ItemNameReader.from(source).getName(), + targetName); + } + + private String encode(String body) { + return Optional + .ofNullable(body) + .filter(b -> !"null".equals(b)) + .map(URL::encode) + .orElse(""); + } + + public AssociationDeclaration getAssociationDeclaration() { + return associationDeclaration; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ItemNameReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ItemNameReader.java new file mode 100644 index 00000000000..623613f3603 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ItemNameReader.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.Property; + +public class ItemNameReader { + + String name; + + public static ItemNameReader from(ItemAwareElement element) { + return new ItemNameReader(element); + } + + private ItemNameReader(ItemAwareElement element) { + if (element instanceof Property) { + name = ((Property) element).getName(); + } else if (element instanceof DataInput) { + name = ((DataInput) element).getName(); + } else if (element instanceof DataOutput) { + name = ((DataOutput) element).getName(); + } + // legacy uses ID instead of name + name = name == null ? element.getId() : name; + } + + public String getName() { + return name; + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/LanePropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/LanePropertyReader.java new file mode 100644 index 00000000000..cdac192bbb1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/LanePropertyReader.java @@ -0,0 +1,73 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Optional; + +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNShape; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; + +public class LanePropertyReader extends BasePropertyReader { + + private final Lane lane; + private final BPMNShape parentLaneShape; + + public LanePropertyReader(Lane el, BPMNDiagram diagram, BPMNShape shape, BPMNShape parentLaneShape, double resolutionFactor) { + super(el, diagram, shape, resolutionFactor); + this.lane = el; + this.parentLaneShape = parentLaneShape; + } + + public LanePropertyReader(Lane el, BPMNDiagram diagram, BPMNShape shape, double resolutionFactor) { + this(el, diagram, shape, null, resolutionFactor); + } + + public String getName() { + String extendedName = CustomElement.name.of(element).get(); + return extendedName.isEmpty() ? + Optional.ofNullable(lane.getName()).orElse("") + : extendedName; + } + + @Override + protected Bounds computeBounds(org.eclipse.dd.dc.Bounds bounds) { + if (shape == null || parentLaneShape == null) { + return super.computeBounds(bounds); + } else { + org.eclipse.dd.dc.Bounds parentLaneBounds = parentLaneShape.getBounds(); + final double x = parentLaneBounds.getX() * resolutionFactor; + final double y = bounds.getY() * resolutionFactor; + final double width = parentLaneBounds.getWidth() * resolutionFactor; + final double height = bounds.getHeight() * resolutionFactor; + return Bounds.create(x, y, x + width, y + height); + } + } + + @Override + public RectangleDimensionsSet getRectangleDimensionsSet() { + if (shape == null || parentLaneShape == null) { + return super.getRectangleDimensionsSet(); + } + org.eclipse.dd.dc.Bounds bounds = shape.getBounds(); + return new RectangleDimensionsSet(parentLaneShape.getBounds().getWidth() * resolutionFactor, + bounds.getHeight() * resolutionFactor); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/MultipleInstanceActivityPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/MultipleInstanceActivityPropertyReader.java new file mode 100644 index 00000000000..2213e71366e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/MultipleInstanceActivityPropertyReader.java @@ -0,0 +1,222 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.DataAssociation; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics; +import org.eclipse.bpmn2.Property; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; + +public class MultipleInstanceActivityPropertyReader extends ActivityPropertyReader { + + public MultipleInstanceActivityPropertyReader(Activity activity, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(activity, diagram, definitionResolver); + } + + public boolean isMultipleInstance() { + return getMultiInstanceLoopCharacteristics().isPresent(); + } + + public String getCollectionInput() { + String ieDataInputId = getLoopDataInputRefId(); + return super.getDataInputAssociations().stream() + .filter(dia -> hasTargetRef(dia, ieDataInputId)) + .filter(MultipleInstanceActivityPropertyReader::hasSourceRefs) + .map(dia -> ItemNameReader.from(dia.getSourceRef().get(0)).getName()) + .findFirst() + .orElse(null); + } + + public String getCollectionOutput() { + String ieDataOutputId = getLoopDataOutputRefId(); + return super.getDataOutputAssociations().stream() + .filter(doa -> hasSourceRef(doa, ieDataOutputId)) + .map(doa -> ItemNameReader.from(doa.getTargetRef()).getName()) + .findFirst() + .orElse(null); + } + + public String getDataInput() { + return getMultiInstanceLoopCharacteristics() + .map(MultiInstanceLoopCharacteristics::getInputDataItem) + .map(d -> Optional.ofNullable(d.getName()).orElse(d.getId())) + .orElse(""); + } + + public String getDataOutput() { + return getMultiInstanceLoopCharacteristics() + .map(MultiInstanceLoopCharacteristics::getOutputDataItem) + .map(d -> Optional.ofNullable(d.getName()).orElse(d.getId())) + .orElse(""); + } + + public String getCompletionCondition() { + return getMultiInstanceLoopCharacteristics() + .map(miloop -> (FormalExpression) miloop.getCompletionCondition()) + .map(fe -> FormalExpressionBodyHandler.of(fe).getBody()) + .orElse(""); + } + + public boolean isSequential() { + return getMultiInstanceLoopCharacteristics() + .map(MultiInstanceLoopCharacteristics::isIsSequential) + .orElse(false); + } + + private Optional getMultiInstanceLoopCharacteristics() { + return Optional.ofNullable((MultiInstanceLoopCharacteristics) activity.getLoopCharacteristics()); + } + + private static String getVariableName(Property property) { + return ProcessVariableReader.getProcessVariableName(property); + } + + @Override + protected List getDataInputs() { + if (getMultiInstanceLoopCharacteristics().isPresent()) { + String dataInputIdForInputVariable = getDataInputIdForDataInputVariable(); + String dataInputIdForInputCollection = getLoopDataInputRefId(); + return super.getDataInputs().stream() + .filter(di -> !di.getId().equals(dataInputIdForInputVariable)) + .filter(di -> !di.getId().equals(dataInputIdForInputCollection)) + .collect(Collectors.toList()); + } + return super.getDataInputs(); + } + + @Override + protected List getDataOutputs() { + if (getMultiInstanceLoopCharacteristics().isPresent()) { + String dataOuputIdForOutputVariable = getDataOutputIdForDataOutputVariable(); + String dataOutputIdForCollection = getLoopDataOutputRefId(); + return super.getDataOutputs().stream() + .filter(dout -> !dout.getId().equals(dataOuputIdForOutputVariable)) + .filter(dout -> !dout.getId().equals(dataOutputIdForCollection)) + .collect(Collectors.toList()); + } + return super.getDataOutputs(); + } + + @Override + protected List getDataInputAssociations() { + if (getMultiInstanceLoopCharacteristics().isPresent()) { + String dataInputIdForInputVariable = getDataInputIdForDataInputVariable(); + String dataInputIdForInputCollection = getLoopDataInputRefId(); + return super.getDataInputAssociations().stream() + .filter(dia -> !hasTargetRef(dia, dataInputIdForInputVariable)) + .filter(dia -> !hasTargetRef(dia, dataInputIdForInputCollection)) + .collect(Collectors.toList()); + } + return super.getDataInputAssociations(); + } + + @Override + protected List getDataOutputAssociations() { + if (getMultiInstanceLoopCharacteristics().isPresent()) { + String dataOutputIdForOutputVariable = getDataOutputIdForDataOutputVariable(); + String dataOutputIdForOutputCollection = getLoopDataOutputRefId(); + return super.getDataOutputAssociations().stream() + .filter(doa -> !hasSourceRef(doa, dataOutputIdForOutputVariable)) + .filter(doa -> !hasSourceRef(doa, dataOutputIdForOutputCollection)) + .collect(Collectors.toList()); + } + return super.getDataOutputAssociations(); + } + + protected String getDataInputIdForDataInputVariable() { + String dataInputVariableId = null; + DataInput variableDataInput = getMultiInstanceLoopCharacteristics() + .map(MultiInstanceLoopCharacteristics::getInputDataItem) + .orElse(null); + if (variableDataInput != null) { + String itemSubjectRef = getItemSubjectRef(variableDataInput); + String variableId = ItemNameReader.from(variableDataInput).getName(); + dataInputVariableId = super.getDataInputs().stream() + .filter(input -> Objects.equals(variableId, input.getName())) + .filter(input -> hasItemSubjectRef(input, itemSubjectRef)) + .map(BaseElement::getId) + .findFirst().orElse(null); + } + return dataInputVariableId; + } + + protected String getDataOutputIdForDataOutputVariable() { + String dataOutputVariableId = null; + DataOutput variableDataOutput = getMultiInstanceLoopCharacteristics() + .map(MultiInstanceLoopCharacteristics::getOutputDataItem) + .orElse(null); + if (variableDataOutput != null) { + String itemSubjectRef = getItemSubjectRef(variableDataOutput); + String variableId = ItemNameReader.from(variableDataOutput).getName(); + dataOutputVariableId = super.getDataOutputs().stream() + .filter(output -> Objects.equals(variableId, output.getName())) + .filter(output -> hasItemSubjectRef(output, itemSubjectRef)) + .map(BaseElement::getId) + .findFirst().orElse(null); + } + return dataOutputVariableId; + } + + protected String getLoopDataInputRefId() { + return getMultiInstanceLoopCharacteristics() + .map(MultiInstanceLoopCharacteristics::getLoopDataInputRef) + .map(ItemAwareElement::getId) + .orElse(null); + } + + protected String getLoopDataOutputRefId() { + return getMultiInstanceLoopCharacteristics() + .map(MultiInstanceLoopCharacteristics::getLoopDataOutputRef) + .map(ItemAwareElement::getId) + .orElse(null); + } + + static boolean hasSourceRefs(DataAssociation dataAssociation) { + return dataAssociation.getSourceRef() != null && !dataAssociation.getSourceRef().isEmpty(); + } + + static boolean hasSourceRef(DataAssociation dataAssociation, String id) { + return hasSourceRefs(dataAssociation) && Objects.equals(dataAssociation.getSourceRef().get(0).getId(), id); + } + + static boolean hasTargetRef(DataAssociation dataAssociation, String id) { + return dataAssociation.getTargetRef() != null && Objects.equals(dataAssociation.getTargetRef().getId(), id); + } + + static boolean hasItemSubjectRef(ItemAwareElement element, String itemSubjectRef) { + return element.getItemSubjectRef() != null && Objects.equals(element.getItemSubjectRef().getId(), itemSubjectRef); + } + + static String getItemSubjectRef(ItemAwareElement element) { + return element.getItemSubjectRef() != null ? element.getItemSubjectRef().getId() : null; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/MultipleInstanceSubProcessPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/MultipleInstanceSubProcessPropertyReader.java new file mode 100644 index 00000000000..036e0ec0517 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/MultipleInstanceSubProcessPropertyReader.java @@ -0,0 +1,28 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; + +public class MultipleInstanceSubProcessPropertyReader extends SubProcessPropertyReader { + + public MultipleInstanceSubProcessPropertyReader(SubProcess element, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(element, diagram, definitionResolver); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/NotificationsInfos.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/NotificationsInfos.java new file mode 100644 index 00000000000..9d9097d6dbf --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/NotificationsInfos.java @@ -0,0 +1,73 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.FormalExpression; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.ParsedNotificationsInfos; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations.AssociationType; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; +import org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationTypeListValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationsInfo; + +import static java.util.Arrays.asList; + +public class NotificationsInfos { + + private static Set RESERVED_ASSIGNMENTS = new HashSet<>(asList( + AssociationType.NOT_COMPLETED_NOTIFY.getName(), + AssociationType.NOT_STARTED_NOTIFY.getName())); + + public static NotificationsInfo of(List dataInputAssociations) { + NotificationTypeListValue notifications = new NotificationTypeListValue(); + dataInputAssociations.forEach(din -> { + DataInput targetRef = (DataInput) (din.getTargetRef()); + if (isReservedIdentifier(targetRef.getName())) { + if (!din.getAssignment().isEmpty()) { + Assignment assignment = din.getAssignment().get(0); + if (assignment != null) { + FormalExpression expr = (FormalExpression) assignment.getFrom(); + String body = FormalExpressionBodyHandler.of(expr).getBody(); + + if (body != null) { + Arrays.stream(replaceBracket(body).split("\\^")).forEach(b -> { + notifications.addValue(ParsedNotificationsInfos.of(targetRef.getName(), b)); + }); + } + } + } + } + }); + + return new NotificationsInfo(notifications); + } + + public static boolean isReservedIdentifier(String targetName) { + return RESERVED_ASSIGNMENTS.contains(targetName); + } + + private static String replaceBracket(String original) { + return original.replaceFirst("\\[", "").replace("]", ""); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/OutputAssignmentReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/OutputAssignmentReader.java new file mode 100644 index 00000000000..795e1e96bd6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/OutputAssignmentReader.java @@ -0,0 +1,53 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.Property; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.AssociationDeclaration; + +public class OutputAssignmentReader { + + private final AssociationDeclaration associationDeclaration; + + public static OutputAssignmentReader fromAssociation(DataOutputAssociation out) { + String sourceName = ((DataOutput) out.getSourceRef().get(0)).getName(); + if (out.getTargetRef() instanceof Property) { + return new OutputAssignmentReader(sourceName, (Property) out.getTargetRef()); + } + return null; + } + + OutputAssignmentReader(String sourceName, Property target) { + String propertyName = getPropertyName(target); + this.associationDeclaration = new AssociationDeclaration( + AssociationDeclaration.Direction.Output, + AssociationDeclaration.Type.SourceTarget, + sourceName, + propertyName); + } + + public AssociationDeclaration getAssociationDeclaration() { + return associationDeclaration; + } + + // fallback to ID for https://issues.jboss.org/browse/JBPM-6708 + private static String getPropertyName(Property prop) { + return prop.getName() == null ? prop.getId() : prop.getName(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ProcessPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ProcessPropertyReader.java new file mode 100644 index 00000000000..31c6144d29e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ProcessPropertyReader.java @@ -0,0 +1,88 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.Process; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNShape; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; + +public class ProcessPropertyReader extends BasePropertyReader { + + private final Process process; + private final Map flowElements; + + public ProcessPropertyReader(Process element, BPMNDiagram diagram, BPMNShape shape, double resolutionFactor) { + super(element, diagram, shape, resolutionFactor); + this.process = element; + this.flowElements = + process.getFlowElements().stream() + .collect(Collectors.toMap(FlowElement::getId, Function.identity())); + } + + public String getPackage() { + return CustomAttribute.packageName.of(element).get(); + } + + public String getVersion() { + return CustomAttribute.version.of(element).get(); + } + + public boolean isAdHoc() { + return CustomAttribute.adHoc.of(element).get(); + } + + @Override + public Bounds getBounds() { + return Bounds.create(0d, 0d, 950d, 950d); + } + + public String getProcessVariables() { + return ProcessVariableReader.getProcessVariables(process.getProperties()); + } + + public String getCaseIdPrefix() { + return CustomElement.caseIdPrefix.of(process).get(); + } + + public String getCaseFileVariables() { + return CaseFileVariableReader.getCaseFileVariables(process.getProperties()); + } + + public String getCaseRoles() { + return CustomElement.caseRole.of(process).get(); + } + + public FlowElement getFlowElement(String id) { + return flowElements.get(id); + } + + public String getGlobalVariables() { + return CustomElement.globalVariables.of(process).get(); + } + + public String getSlaDueDate() { + return CustomElement.slaDueDate.of(process).get(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ProcessVariableReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ProcessVariableReader.java new file mode 100644 index 00000000000..5def83e5e78 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ProcessVariableReader.java @@ -0,0 +1,55 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Property; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; + +class ProcessVariableReader { + + static String getProcessVariables(List properties) { + return properties + .stream() + .filter(ProcessVariableReader::isProcessVariable) + .map(ProcessVariableReader::toProcessVariableString) + .collect(Collectors.joining(",")); + } + + private static String toProcessVariableString(Property p) { + String processVariableName = getProcessVariableName(p); + boolean kpi = CustomElement.customKPI.of(p).get(); + return Optional.ofNullable(p.getItemSubjectRef()) + .map(ItemDefinition::getStructureRef) + .map(type -> processVariableName + ":" + type + ":" + kpi) + .orElse(processVariableName); + } + + public static String getProcessVariableName(Property p) { + String name = p.getName(); + // legacy uses ID instead of name + return name == null ? p.getId() : name; + } + + public static boolean isProcessVariable(Property p) { + return !CaseFileVariableReader.isCaseFileVariable(p); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/PropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/PropertyReader.java new file mode 100644 index 00000000000..6db1d149990 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/PropertyReader.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.di.BPMNShape; +import org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.CircleDimensionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; + +public interface PropertyReader { + + String getDocumentation(); + + String getDescription(); + + FontSet getFontSet(); + + BackgroundSet getBackgroundSet(); + + Bounds getBounds(); + + CircleDimensionSet getCircleDimensionSet(); + + RectangleDimensionsSet getRectangleDimensionsSet(); + + boolean isExpanded(); + + BaseElement getElement(); + + BPMNShape getShape(); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/PropertyReaderFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/PropertyReaderFactory.java new file mode 100644 index 00000000000..86b1dde91d6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/PropertyReaderFactory.java @@ -0,0 +1,143 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Objects; +import java.util.Optional; + +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.Association; +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.BusinessRuleTask; +import org.eclipse.bpmn2.CallActivity; +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.Gateway; +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.Process; +import org.eclipse.bpmn2.ScriptTask; +import org.eclipse.bpmn2.SequenceFlow; +import org.eclipse.bpmn2.ServiceTask; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.TextAnnotation; +import org.eclipse.bpmn2.ThrowEvent; +import org.eclipse.bpmn2.UserTask; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; + +public class PropertyReaderFactory { + + protected final BPMNDiagram diagram; + protected final DefinitionResolver definitionResolver; + + public PropertyReaderFactory(DefinitionResolver definitionResolver) { + this.diagram = definitionResolver.getDiagram(); + this.definitionResolver = definitionResolver; + } + + public FlowElementPropertyReader of(FlowElement el) { + return new FlowElementPropertyReader(el, diagram, definitionResolver.getShape(el.getId()), definitionResolver.getResolutionFactor()); + } + + public LanePropertyReader of(Lane el) { + return new LanePropertyReader(el, diagram, definitionResolver.getShape(el.getId()), definitionResolver.getResolutionFactor()); + } + + public LanePropertyReader of(Lane el, Lane elParent) { + return new LanePropertyReader(el, diagram, definitionResolver.getShape(el.getId()), definitionResolver.getShape(elParent.getId()), definitionResolver.getResolutionFactor()); + } + + public SequenceFlowPropertyReader of(SequenceFlow el) { + return new SequenceFlowPropertyReader(el, diagram, definitionResolver); + } + + public AssociationPropertyReader of(Association el) { + return new AssociationPropertyReader(el, diagram, definitionResolver); + } + + public GatewayPropertyReader of(Gateway el) { + return new GatewayPropertyReader(el, diagram, definitionResolver.getShape(el.getId()), definitionResolver.getResolutionFactor()); + } + + public TaskPropertyReader of(Task el) { + return new TaskPropertyReader(el, diagram, definitionResolver); + } + + public UserTaskPropertyReader of(UserTask el) { + return new UserTaskPropertyReader(el, diagram, definitionResolver); + } + + public ScriptTaskPropertyReader of(ScriptTask el) { + return new ScriptTaskPropertyReader(el, diagram, definitionResolver); + } + + public GenericServiceTaskPropertyReader of(ServiceTask el) { + return new GenericServiceTaskPropertyReader(el, diagram, definitionResolver); + } + + public BusinessRuleTaskPropertyReader of(BusinessRuleTask el) { + return new BusinessRuleTaskPropertyReader(el, diagram, definitionResolver); + } + + public Optional ofCustom(Task el) { + String serviceTaskName = CustomAttribute.serviceTaskName.of(el).get(); + return definitionResolver + .getWorkItemDefinitions() + .stream() + .filter(wid -> Objects.equals(wid.getName(), serviceTaskName)) + .findFirst() + .map(def -> new ServiceTaskPropertyReader(el, def, diagram, definitionResolver)); + } + + public CallActivityPropertyReader of(CallActivity el) { + return new CallActivityPropertyReader(el, diagram, definitionResolver); + } + + public CatchEventPropertyReader of(CatchEvent el) { + if (el instanceof BoundaryEvent) { + return new BoundaryEventPropertyReader((BoundaryEvent) el, diagram, definitionResolver); + } else { + return new CatchEventPropertyReader(el, diagram, definitionResolver); + } + } + + public ThrowEventPropertyReader of(ThrowEvent el) { + return new ThrowEventPropertyReader(el, diagram, definitionResolver); + } + + public SubProcessPropertyReader of(SubProcess el) { + return new SubProcessPropertyReader(el, diagram, definitionResolver); + } + + public AdHocSubProcessPropertyReader of(AdHocSubProcess el) { + return new AdHocSubProcessPropertyReader(el, diagram, definitionResolver); + } + + public MultipleInstanceSubProcessPropertyReader ofMultipleInstance(SubProcess el) { + return new MultipleInstanceSubProcessPropertyReader(el, diagram, definitionResolver); + } + + public ProcessPropertyReader of(Process el) { + return new ProcessPropertyReader(el, diagram, definitionResolver.getShape(el.getId()), definitionResolver.getResolutionFactor()); + } + + public TextAnnotationPropertyReader of(TextAnnotation el) { + return new TextAnnotationPropertyReader(el, diagram, definitionResolver.getShape(el.getId()), definitionResolver.getResolutionFactor()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ReassignmentsInfos.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ReassignmentsInfos.java new file mode 100644 index 00000000000..643b45c18bd --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ReassignmentsInfos.java @@ -0,0 +1,72 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.FormalExpression; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.ParsedReassignmentsInfos; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations.AssociationType; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; +import org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentTypeListValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentsInfo; + +import static java.util.Arrays.asList; + +public class ReassignmentsInfos { + + private static Set RESERVED_ASSIGNMENTS = new HashSet<>(asList( + AssociationType.NOT_COMPLETED_REASSIGN.getName(), + AssociationType.NOT_STARTED_REASSIGN.getName())); + + public static ReassignmentsInfo of(List dataInputAssociations) { + ReassignmentTypeListValue reassignments = new ReassignmentTypeListValue(); + dataInputAssociations.forEach(din -> { + DataInput targetRef = (DataInput) (din.getTargetRef()); + if (isReservedIdentifier(targetRef.getName())) { + if (!din.getAssignment().isEmpty()) { + Assignment assignment = din.getAssignment().get(0); + if (assignment != null) { + FormalExpression expr = (FormalExpression) assignment.getFrom(); + String body = FormalExpressionBodyHandler.of(expr).getBody(); + if (body != null) { + Arrays.stream(replaceBracket(body).split("\\^")).forEach(b -> { + reassignments.addValue(ParsedReassignmentsInfos.of(targetRef.getName(), b)); + }); + } + } + } + } + }); + + return new ReassignmentsInfo(reassignments); + } + + public static boolean isReservedIdentifier(String targetName) { + return RESERVED_ASSIGNMENTS.contains(targetName); + } + + private static String replaceBracket(String original) { + return original.replaceFirst("\\[", "").replace("]", ""); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ScriptTaskPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ScriptTaskPropertyReader.java new file mode 100644 index 00000000000..43cbc17c2ae --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ScriptTaskPropertyReader.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Optional; + +import org.eclipse.bpmn2.ScriptTask; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; + +public class ScriptTaskPropertyReader extends TaskPropertyReader { + + private final ScriptTask task; + + public ScriptTaskPropertyReader(ScriptTask task, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(task, diagram, definitionResolver); + this.task = task; + } + + public ScriptTypeValue getScript() { + return new ScriptTypeValue( + Scripts.scriptLanguageFromUri(task.getScriptFormat(), Scripts.LANGUAGE.JAVA.language()), + Optional.ofNullable(task.getScript()).orElse(null) + ); + } + + public boolean isAsync() { + return CustomElement.async.of(element).get(); + } + + public boolean isAdHocAutoStart() { + return CustomElement.autoStart.of(element).get(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/Scripts.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/Scripts.java new file mode 100644 index 00000000000..d928be0e858 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/Scripts.java @@ -0,0 +1,239 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.List; +import java.util.stream.Collectors; + +import org.eclipse.bpmn2.Bpmn2Factory; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.Task; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.impl.EStructuralFeatureImpl; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.jboss.drools.DroolsPackage; +import org.jboss.drools.OnEntryScriptType; +import org.jboss.drools.OnExitScriptType; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; + +import static org.jboss.drools.DroolsPackage.Literals.DOCUMENT_ROOT__ON_ENTRY_SCRIPT; +import static org.jboss.drools.DroolsPackage.Literals.DOCUMENT_ROOT__ON_EXIT_SCRIPT; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.droolsFactory; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.LANGUAGE.DROOLS; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.LANGUAGE.FEEL; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.LANGUAGE.JAVA; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.LANGUAGE.JAVASCRIPT; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.LANGUAGE.MVEL; + +public class Scripts { + + public enum LANGUAGE { + JAVA("java", "http://www.java.com/java"), + JAVASCRIPT("javascript", "http://www.javascript.com/javascript"), + MVEL("mvel", "http://www.mvel.org/2.0"), + DROOLS("drools", "http://www.jboss.org/drools/rule"), + FEEL("feel", "http://www.omg.org/spec/FEEL/20140401"); + + private final String language; + + private final String format; + + LANGUAGE(String language, + String format) { + this.language = language; + this.format = format; + } + + public String language() { + return language; + } + + public String format() { + return format; + } + } + + public static OnEntryAction onEntry(Task task) { + return new OnEntryAction(onEntry(task.getExtensionValues())); + } + + public static ScriptTypeListValue onEntry(List extensions) { + if (extensions.isEmpty()) { + return new ScriptTypeListValue() + .addValue(new ScriptTypeValue("java", "")); + } + + @SuppressWarnings("unchecked") + List onEntryExtensions = + (List) extensions.get(0).getValue() + .get(DroolsPackage.Literals.DOCUMENT_ROOT__ON_ENTRY_SCRIPT, true); + + if (!onEntryExtensions.isEmpty()) { + List scripts = + onEntryExtensions.stream() + .map(onEntryScriptType -> + new ScriptTypeValue( + scriptLanguageFromUri(onEntryScriptType.getScriptFormat()), + onEntryScriptType.getScript() + )) + .collect(Collectors.toList()); + return new ScriptTypeListValue(scripts); + } + + return new ScriptTypeListValue() + .addValue(new ScriptTypeValue("java", "")); + } + + public static String scriptLanguageToUri(String language) { + return scriptLanguageToUri(language, JAVA.format()); + } + + public static String scriptLanguageToUri(String language, String defaultValue) { + if (language == null) { + return defaultValue; + } + + if (JAVA.language().equals(language)) { + return JAVA.format(); + } else if (MVEL.language().equals(language)) { + return MVEL.format(); + } else if (JAVASCRIPT.language().equals(language)) { + return JAVASCRIPT.format(); + } else if (DROOLS.language().equals(language)) { + return DROOLS.format(); + } else if (FEEL.language().equals(language)) { + return FEEL.format(); + } else { + return defaultValue; + } + } + + public static String scriptLanguageFromUri(String format) { + return scriptLanguageFromUri(format, null); + } + + public static String scriptLanguageFromUri(String format, String defaultValue) { + if (format == null) { + return defaultValue; + } + + if (JAVA.format().equals(format)) { + return JAVA.language(); + } else if (MVEL.format().equals(format)) { + return MVEL.language(); + } else if (JAVASCRIPT.format().equals(format)) { + return JAVASCRIPT.language(); + } else if (DROOLS.format().equals(format)) { + return DROOLS.language(); + } else if (FEEL.format().equals(format)) { + return FEEL.language(); + } else { + return defaultValue; + } + } + + public static ScriptTypeListValue onExit(List extensions) { + if (extensions.isEmpty()) { + return new ScriptTypeListValue() + .addValue(new ScriptTypeValue("java", "")); + } + + @SuppressWarnings("unchecked") + List onExitExtensions = + (List) extensions.get(0).getValue() + .get(DroolsPackage.Literals.DOCUMENT_ROOT__ON_EXIT_SCRIPT, true); + + if (!onExitExtensions.isEmpty()) { + List scripts = onExitExtensions.stream() + .map(onExitScriptType -> + new ScriptTypeValue( + scriptLanguageFromUri(onExitScriptType.getScriptFormat()), + onExitScriptType.getScript() + )) + .collect(Collectors.toList()); + return new ScriptTypeListValue(scripts); + } + + return new ScriptTypeListValue() + .addValue(new ScriptTypeValue("java", "")); + } + + public static void setOnEntryAction(FlowElement flowElement, OnEntryAction onEntryAction) { + ScriptTypeListValue value = onEntryAction.getValue(); + for (ScriptTypeValue scriptTypeValue : value.getValues()) { + String scriptText = scriptTypeValue.getScript(); + if (scriptText == null || scriptText.isEmpty()) { + continue; + } + OnEntryScriptType script = droolsFactory.createOnEntryScriptType(); + script.setScript(asCData(scriptTypeValue.getScript())); + String scriptLanguage = Scripts.scriptLanguageToUri(scriptTypeValue.getLanguage()); + script.setScriptFormat(scriptLanguage); + addExtensionValue(flowElement, DOCUMENT_ROOT__ON_ENTRY_SCRIPT, script); + } + } + + public static void setOnExitAction(FlowElement flowElement, OnExitAction onExitAction) { + ScriptTypeListValue value = onExitAction.getValue(); + for (ScriptTypeValue scriptTypeValue : value.getValues()) { + String scriptText = scriptTypeValue.getScript(); + if (scriptText == null || scriptText.isEmpty()) { + continue; + } + OnExitScriptType script = droolsFactory.createOnExitScriptType(); + script.setScript(asCData(scriptText)); + String scriptLanguage = Scripts.scriptLanguageToUri(scriptTypeValue.getLanguage()); + script.setScriptFormat(scriptLanguage); + addExtensionValue(flowElement, DOCUMENT_ROOT__ON_EXIT_SCRIPT, script); + } + } + + private static void addExtensionValue(FlowElement flowElement, EReference eref, Object value) { + FeatureMap.Entry entry = entryOf(eref, value); + addExtensionValue(flowElement, entry); + } + + private static EStructuralFeatureImpl.SimpleFeatureMapEntry entryOf(EReference eref, Object script) { + return new EStructuralFeatureImpl.SimpleFeatureMapEntry( + (EStructuralFeature.Internal) eref, + script); + } + + private static void addExtensionValue(FlowElement flowElement, FeatureMap.Entry value) { + extensionFor(flowElement).getValue().add(value); + } + + private static ExtensionAttributeValue extensionFor(FlowElement flowElement) { + if (flowElement.getExtensionValues() == null || flowElement.getExtensionValues().isEmpty()) { + ExtensionAttributeValue eav = Bpmn2Factory.eINSTANCE.createExtensionAttributeValue(); + flowElement.getExtensionValues().add(eav); + return eav; + } else { + return flowElement.getExtensionValues().get(0); + } + } + + // apparently the only way to wrap into CDATA is to do it with string concatenation + public static String asCData(String original) { + return ""; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SequenceFlowPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SequenceFlowPropertyReader.java new file mode 100644 index 00000000000..bf2b6ac9cd0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SequenceFlowPropertyReader.java @@ -0,0 +1,105 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.List; + +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.SequenceFlow; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.util.PropertyReaderUtils; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.MagnetConnection; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; + +public class SequenceFlowPropertyReader extends FlowElementPropertyReader implements EdgePropertyReader { + + private final DefinitionResolver definitionResolver; + private final SequenceFlow seq; + + public SequenceFlowPropertyReader(SequenceFlow seq, + BPMNDiagram diagram, + DefinitionResolver definitionResolver) { + super(seq, + diagram, + definitionResolver.getShape(seq.getId()), + definitionResolver.getResolutionFactor()); + this.seq = seq; + this.definitionResolver = definitionResolver; + } + + public String getPriority() { + return CustomAttribute.priority.of(element).get(); + } + + public ScriptTypeValue getConditionExpression() { + if (seq.getConditionExpression() instanceof FormalExpression) { + FormalExpression conditionExpression = (FormalExpression) seq.getConditionExpression(); + return new ScriptTypeValue( + Scripts.scriptLanguageFromUri(conditionExpression.getLanguage()), + FormalExpressionBodyHandler.of(conditionExpression).getBody()); + } else { + return new ScriptTypeValue("java", ""); + } + } + + @Override + public String getSourceId() { + return seq.getSourceRef().getId(); + } + + @Override + public String getTargetId() { + return seq.getTargetRef().getId(); + } + + @Override + public Connection getSourceConnection() { + Point2D sourcePosition = PropertyReaderUtils.getSourcePosition(definitionResolver, + element.getId(), + getSourceId()); + return MagnetConnection.Builder + .at(sourcePosition.getX(), + sourcePosition.getY()) + .setAuto(PropertyReaderUtils.isAutoConnectionSource(element)); + } + + @Override + public Connection getTargetConnection() { + Point2D targetPosition = PropertyReaderUtils.getTargetPosition(definitionResolver, + element.getId(), + getTargetId()); + return MagnetConnection.Builder + .at(targetPosition.getX(), + targetPosition.getY()) + .setAuto(PropertyReaderUtils.isAutoConnectionTarget(element)); + } + + @Override + public List getControlPoints() { + return PropertyReaderUtils.getControlPoints(definitionResolver, + element.getId()); + } + + public DefinitionResolver getDefinitionResolver() { + return definitionResolver; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ServiceTaskPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ServiceTaskPropertyReader.java new file mode 100644 index 00000000000..8c494a9fee3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ServiceTaskPropertyReader.java @@ -0,0 +1,88 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomInput; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; + +public class ServiceTaskPropertyReader extends TaskPropertyReader { + + private final WorkItemDefinition workItemDefinition; + + public ServiceTaskPropertyReader(Task task, WorkItemDefinition workItemDefinition, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(task, diagram, definitionResolver); + this.workItemDefinition = workItemDefinition; + } + + @Override + public String getName() { + String name = super.getName(); + if (ConverterUtils.isEmpty(name)) { + return ""; + } else { + return name; + } + } + + @Override + public String getDocumentation() { + String documentation = super.getDocumentation(); + if (ConverterUtils.isEmpty(documentation)) { + String defaultDocumentation = workItemDefinition.getDocumentation(); + return defaultDocumentation == null ? "" : defaultDocumentation; + } else { + return documentation; + } + } + + public String getTaskName() { + return CustomInput.taskName.of(task).get(); + } + + public boolean isAsync() { + return CustomElement.async.of(element).get(); + } + + public boolean isAdHocAutoStart() { + return CustomElement.autoStart.of(element).get(); + } + + public String getServiceTaskName() { + return workItemDefinition.getName(); + } + + public String getServiceTaskCategory() { + return workItemDefinition.getCategory(); + } + + public String getServiceTaskDefaultHandler() { + return workItemDefinition.getDefaultHandler(); + } + + public String getServiceTaskDescription() { + return workItemDefinition.getDescription(); + } + + public String getSlaDueDate() { + return CustomElement.slaDueDate.of(element).get(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SimulationAttributeSets.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SimulationAttributeSets.java new file mode 100644 index 00000000000..602794031d9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SimulationAttributeSets.java @@ -0,0 +1,100 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import bpsim.ElementParameters; +import bpsim.NormalDistributionType; +import bpsim.Parameter; +import bpsim.ParameterValue; +import bpsim.PoissonDistributionType; +import bpsim.TimeParameters; +import bpsim.UniformDistributionType; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Match; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationAttributeSet; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpsim; + +public class SimulationAttributeSets { + + public static SimulationAttributeSet of(ElementParameters eleType) { + TimeParameters timeParams = eleType.getTimeParameters(); + if (timeParams == null) { + return new SimulationAttributeSet(); + } + Parameter processingTime = timeParams.getProcessingTime(); + ParameterValue paramValue = processingTime.getParameterValue().get(0); + + return Match.of() + .when(e -> e instanceof NormalDistributionType, ndt -> { + SimulationAttributeSet simulationSet = new SimulationAttributeSet(); + simulationSet.getMean().setValue(ndt.getMean()); + simulationSet.getStandardDeviation().setValue(ndt.getStandardDeviation()); + simulationSet.getDistributionType().setValue("normal"); + return simulationSet; + }) + .when(e -> e instanceof UniformDistributionType, udt -> { + SimulationAttributeSet simulationSet = new SimulationAttributeSet(); + simulationSet.getMin().setValue(udt.getMin()); + simulationSet.getMax().setValue(udt.getMax()); + simulationSet.getDistributionType().setValue("uniform"); + return simulationSet; + }) + .when(e -> e instanceof PoissonDistributionType, pdt -> { + SimulationAttributeSet simulationSet = new SimulationAttributeSet(); + simulationSet.getMean().setValue(pdt.getMean()); + simulationSet.getDistributionType().setValue("poisson"); + return simulationSet; + }) + .apply(paramValue) + .asSuccess() + .value(); + } + + public static ElementParameters toElementParameters(SimulationAttributeSet simulationSet) { + ElementParameters elementParameters = bpsim.createElementParameters(); + + TimeParameters timeParameters = bpsim.createTimeParameters(); + Parameter processingTime = bpsim.createParameter(); + timeParameters.setProcessingTime(processingTime); + + switch (simulationSet.getDistributionType().getValue()) { + case "normal": + NormalDistributionType ndt = bpsim.createNormalDistributionType(); + ndt.setMean(simulationSet.getMean().getValue()); + ndt.setStandardDeviation(simulationSet.getStandardDeviation().getValue()); + processingTime.getParameterValue().add(ndt); + + break; + case "uniform": + UniformDistributionType udt = bpsim.createUniformDistributionType(); + udt.setMin(simulationSet.getMin().getValue()); + udt.setMax(simulationSet.getMax().getValue()); + processingTime.getParameterValue().add(udt); + + break; + case "poisson": + PoissonDistributionType pdt = bpsim.createPoissonDistributionType(); + pdt.setMean(simulationSet.getMean().getValue()); + processingTime.getParameterValue().add(pdt); + + break; + } + + elementParameters.setTimeParameters(timeParameters); + return elementParameters; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SimulationSets.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SimulationSets.java new file mode 100644 index 00000000000..f6b93c8837e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SimulationSets.java @@ -0,0 +1,159 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import bpsim.CostParameters; +import bpsim.ElementParameters; +import bpsim.FloatingParameterType; +import bpsim.NormalDistributionType; +import bpsim.Parameter; +import bpsim.ParameterValue; +import bpsim.PoissonDistributionType; +import bpsim.ResourceParameters; +import bpsim.TimeParameters; +import bpsim.UniformDistributionType; +import org.eclipse.emf.common.util.EList; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Match; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpsim; + +public class SimulationSets { + + public static ElementParameters toElementParameters(SimulationSet simulationSet) { + ElementParameters elementParameters = bpsim.createElementParameters(); + + TimeParameters timeParameters = bpsim.createTimeParameters(); + Parameter processingTime = bpsim.createParameter(); + timeParameters.setProcessingTime(processingTime); + + switch (simulationSet.getDistributionType().getValue()) { + case "normal": + NormalDistributionType ndt = bpsim.createNormalDistributionType(); + ndt.setMean(simulationSet.getMean().getValue()); + ndt.setStandardDeviation(simulationSet.getStandardDeviation().getValue()); + processingTime.getParameterValue().add(ndt); + + break; + case "uniform": + UniformDistributionType udt = bpsim.createUniformDistributionType(); + udt.setMin(simulationSet.getMin().getValue()); + udt.setMax(simulationSet.getMax().getValue()); + processingTime.getParameterValue().add(udt); + + break; + case "poisson": + PoissonDistributionType pdt = bpsim.createPoissonDistributionType(); + pdt.setMean(simulationSet.getMean().getValue()); + processingTime.getParameterValue().add(pdt); + + break; + } + + elementParameters.setTimeParameters(timeParameters); + + Double unitCost = simulationSet.getUnitCost().getValue(); + Double quantity = simulationSet.getQuantity().getValue(); + Double workingHours = simulationSet.getWorkingHours().getValue(); + + CostParameters costParameters = bpsim.createCostParameters(); + costParameters.setUnitCost(toParameter(unitCost)); + elementParameters.setCostParameters(costParameters); + + ResourceParameters resourceParameters = bpsim.createResourceParameters(); + resourceParameters.setQuantity(toParameter(quantity)); + resourceParameters.setAvailability(toParameter(workingHours)); + elementParameters.setResourceParameters(resourceParameters); + + return elementParameters; + } + + private static Parameter toParameter(Double value) { + Parameter parameter = bpsim.createParameter(); + FloatingParameterType parameterValue = bpsim.createFloatingParameterType(); + parameterValue.setValue(value); + parameter.getParameterValue().add(parameterValue); + return parameter; + } + + public static SimulationSet of(ElementParameters eleType) { + + TimeParameters timeParams = eleType.getTimeParameters(); + if (timeParams == null) { + return new SimulationSet(); + } + Parameter processingTime = timeParams.getProcessingTime(); + ParameterValue paramValue = processingTime.getParameterValue().get(0); + + SimulationSet simulationSet = Match.of() + .when(e -> e instanceof NormalDistributionType, ndt -> { + SimulationSet sset = new SimulationSet(); + sset.getMean().setValue(ndt.getMean()); + sset.getStandardDeviation().setValue(ndt.getStandardDeviation()); + sset.getDistributionType().setValue("normal"); + return sset; + }) + .when(e -> e instanceof UniformDistributionType, udt -> { + SimulationSet sset = new SimulationSet(); + sset.getMin().setValue(udt.getMin()); + sset.getMax().setValue(udt.getMax()); + sset.getDistributionType().setValue("uniform"); + return sset; + }) + .when(e -> e instanceof PoissonDistributionType, pdt -> { + SimulationSet sset = new SimulationSet(); + sset.getMean().setValue(pdt.getMean()); + sset.getDistributionType().setValue("poisson"); + return sset; + }).apply(paramValue) + .asSuccess() + .value(); + + CostParameters costParams = eleType.getCostParameters(); + if (costParams != null) { + simulationSet.getUnitCost().setValue(extractDouble(costParams.getUnitCost())); + } + + ResourceParameters resourceParams = eleType.getResourceParameters(); + + if (resourceParams != null) { + Double quantity = extractDouble(resourceParams.getQuantity()); + simulationSet.getQuantity().setValue(quantity); + + Double availability = extractDouble(resourceParams.getAvailability()); + simulationSet.getWorkingHours().setValue(availability); + } + + return simulationSet; + } + + private static Double extractDouble(Parameter parameter) { + if (parameter == null) { + return 0.0; + } + return extractDouble(parameter.getParameterValue()); + } + + private static Double extractDouble(EList parameterValues) { + if (parameterValues.isEmpty()) { + throw new IllegalArgumentException("failure params"); + } + ParameterValue value = parameterValues.get(0); + FloatingParameterType floatingValue = (FloatingParameterType) value; + return floatingValue.getValue(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SubProcessPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SubProcessPropertyReader.java new file mode 100644 index 00000000000..b3244139b43 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SubProcessPropertyReader.java @@ -0,0 +1,44 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; + +public class SubProcessPropertyReader extends MultipleInstanceActivityPropertyReader { + + protected final SubProcess process; + + public SubProcessPropertyReader(SubProcess element, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(element, diagram, definitionResolver); + this.process = element; + } + + public boolean isAsync() { + return CustomElement.async.of(element).get(); + } + + public String getSlaDueDate() { + return CustomElement.slaDueDate.of(element).get(); + } + + public String getProcessVariables() { + return ProcessVariableReader.getProcessVariables(process.getProperties()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/TaskPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/TaskPropertyReader.java new file mode 100644 index 00000000000..37566e1bd78 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/TaskPropertyReader.java @@ -0,0 +1,31 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; + +public class TaskPropertyReader extends ActivityPropertyReader { + + protected final Task task; + + public TaskPropertyReader(Task task, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(task, diagram, definitionResolver); + this.task = task; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/TextAnnotationPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/TextAnnotationPropertyReader.java new file mode 100644 index 00000000000..96c365e45fa --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/TextAnnotationPropertyReader.java @@ -0,0 +1,44 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Optional; + +import org.eclipse.bpmn2.TextAnnotation; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNShape; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils; + +public class TextAnnotationPropertyReader extends BasePropertyReader { + + private final TextAnnotation element; + + public TextAnnotationPropertyReader(TextAnnotation element, BPMNDiagram diagram, + BPMNShape shape, + double resolutionFactor) { + super(element, diagram, shape, resolutionFactor); + this.element = element; + } + + public String getName() { + String extendedName = CustomElement.name.of(element).get(); + return ConverterUtils.isEmpty(extendedName) ? + Optional.ofNullable(element.getText()).orElse("") + : extendedName; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ThrowEventPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ThrowEventPropertyReader.java new file mode 100644 index 00000000000..ff1d6493719 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ThrowEventPropertyReader.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.ThrowEvent; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; + +public class ThrowEventPropertyReader extends EventPropertyReader { + + private final ThrowEvent throwEvent; + + public ThrowEventPropertyReader(ThrowEvent throwEvent, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(throwEvent, diagram, definitionResolver); + this.throwEvent = throwEvent; + } + + @Override + public AssignmentsInfo getAssignmentsInfo() { + return AssignmentsInfos.of( + throwEvent.getDataInputs(), + throwEvent.getDataInputAssociation(), + Collections.emptyList(), + Collections.emptyList(), false); + } + + @Override + public List getEventDefinitions() { + return combineEventDefinitions(throwEvent.getEventDefinitions(), throwEvent.getEventDefinitionRefs()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/UserTaskPropertyReader.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/UserTaskPropertyReader.java new file mode 100644 index 00000000000..4072d35dfc3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/UserTaskPropertyReader.java @@ -0,0 +1,116 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.PotentialOwner; +import org.eclipse.bpmn2.ResourceRole; +import org.eclipse.bpmn2.UserTask; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomInput; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; +import org.kie.workbench.common.stunner.bpmn.definition.property.assignee.Actors; +import org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentsInfo; + +public class UserTaskPropertyReader extends MultipleInstanceActivityPropertyReader { + + private final UserTask task; + + public UserTaskPropertyReader(UserTask element, BPMNDiagram diagram, DefinitionResolver definitionResolver) { + super(element, diagram, definitionResolver); + this.task = element; + } + + public Actors getActors() { + // get the user task actors + List roles = task.getResources(); + List users = new ArrayList<>(); + for (ResourceRole role : roles) { + if (role instanceof PotentialOwner) { + FormalExpression fe = (FormalExpression) + role.getResourceAssignmentExpression() + .getExpression(); + users.add(FormalExpressionBodyHandler.of(fe).getBody()); + } + } + return new Actors(renderActors(users)); + } + + private String renderActors(final Collection actors) { + return actors.stream().collect(Collectors.joining(",")); + } + + public ReassignmentsInfo getReassignments() { + return ReassignmentsInfos.of(task.getDataInputAssociations()); + } + + public NotificationsInfo getNotifications() { + return NotificationsInfos.of(task.getDataInputAssociations()); + } + + public String getTaskName() { + return CustomInput.taskName.of(task).get(); + } + + public String getGroupid() { + return CustomInput.groupId.of(task).get(); + } + + public boolean isAsync() { + return CustomElement.async.of(element).get(); + } + + public boolean isSkippable() { + return CustomInput.skippable.of(task).get(); + } + + public String getPriority() { + return CustomInput.priority.of(task).get(); + } + + public String getSubject() { + return CustomInput.subject.of(task).get(); + } + + public String getDescription() { + return CustomInput.description.of(task).get(); + } + + public String getCreatedBy() { + return CustomInput.createdBy.of(task).get(); + } + + public boolean isAdHocAutostart() { + return CustomElement.autoStart.of(element).get(); + } + + public String getContent() { + return CustomInput.content.of(task).get(); + } + + public String getSLADueDate() { + return CustomElement.slaDueDate.of(element).get(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/util/PropertyReaderUtils.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/util/PropertyReaderUtils.java new file mode 100644 index 00000000000..d5a0a02e8d4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/util/PropertyReaderUtils.java @@ -0,0 +1,105 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.util; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.dd.dc.Bounds; +import org.eclipse.dd.dc.Point; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; + +public class PropertyReaderUtils { + + public static Point2D getSourcePosition(DefinitionResolver definitionResolver, + String edgeId, + String sourceId) { + final double resolutionFactor = definitionResolver.getResolutionFactor(); + final Bounds sourceBounds = definitionResolver.getShape(sourceId).getBounds(); + final List waypoint = definitionResolver.getEdge(edgeId).getWaypoint(); + + return waypoint.isEmpty() ? + sourcePosition(sourceBounds, resolutionFactor) + : offsetPosition(sourceBounds, + waypoint.get(0), + resolutionFactor); + } + + public static Point2D getTargetPosition(DefinitionResolver definitionResolver, + String edgeId, + String targetId) { + final double resolutionFactor = definitionResolver.getResolutionFactor(); + final Bounds targetBounds = definitionResolver.getShape(targetId).getBounds(); + final List waypoint = definitionResolver.getEdge(edgeId).getWaypoint(); + + return waypoint.isEmpty() ? + targetPosition(targetBounds, resolutionFactor) + : offsetPosition(targetBounds, + waypoint.get(waypoint.size() - 1), + resolutionFactor); + } + + public static List getControlPoints(DefinitionResolver definitionResolver, + String edgeId) { + final double resolutionFactor = definitionResolver.getResolutionFactor(); + final List waypoint = definitionResolver.getEdge(edgeId).getWaypoint(); + final List result = new ArrayList<>(); + if (waypoint.size() > 2) { + List points = waypoint.subList(1, + waypoint.size() - 1); + for (Point p : points) { + result.add(createPoint2D(p, resolutionFactor)); + } + } + return result; + } + + private static Point2D createPoint2D(Point p, double factor) { + return Point2D.create(p.getX() * factor, + p.getY() * factor); + } + + public static boolean isAutoConnectionSource(BaseElement element) { + return CustomElement.autoConnectionSource.of(element).get(); + } + + public static boolean isAutoConnectionTarget(BaseElement element) { + return CustomElement.autoConnectionTarget.of(element).get(); + } + + private static Point2D sourcePosition(Bounds sourceBounds, + double factor) { + return Point2D.create(sourceBounds.getWidth() * factor, + sourceBounds.getHeight() * factor / 2); + } + + private static Point2D targetPosition(Bounds targetBounds, + double factor) { + return Point2D.create(0, + targetBounds.getHeight() * factor / 2); + } + + private static Point2D offsetPosition(Bounds sourceBounds, + Point wayPoint, + double factor) { + return Point2D.create((wayPoint.getX() * factor) - (sourceBounds.getX() * factor), + (wayPoint.getY() * factor) - (sourceBounds.getY() * factor)); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/sequenceflows/SequenceFlowConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/sequenceflows/SequenceFlowConverter.java new file mode 100644 index 00000000000..792c9d0ad67 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/sequenceflows/SequenceFlowConverter.java @@ -0,0 +1,70 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.sequenceflows; + +import java.util.Map; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessageKeys; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnEdge; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.EdgeConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.SequenceFlowPropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.SequenceFlow; +import org.kie.workbench.common.stunner.bpmn.definition.property.common.ConditionExpression; +import org.kie.workbench.common.stunner.bpmn.definition.property.connectors.Priority; +import org.kie.workbench.common.stunner.bpmn.definition.property.connectors.SequenceFlowExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class SequenceFlowConverter implements EdgeConverter { + + private final PropertyReaderFactory propertyReaderFactory; + private TypedFactoryManager factoryManager; + + public SequenceFlowConverter(TypedFactoryManager factoryManager, PropertyReaderFactory propertyReaderFactory) { + this.factoryManager = factoryManager; + this.propertyReaderFactory = propertyReaderFactory; + } + + @Override + public Result convertEdge(org.eclipse.bpmn2.SequenceFlow seq, Map nodes) { + Edge, Node> edge = factoryManager.newEdge(seq.getId(), SequenceFlow.class); + + SequenceFlow definition = edge.getContent().getDefinition(); + SequenceFlowPropertyReader p = propertyReaderFactory.of(seq); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setExecutionSet(new SequenceFlowExecutionSet( + new Priority(p.getPriority()), + new ConditionExpression(p.getConditionExpression()) + )); + + return result(nodes, edge, p, "Sequence Flow ignored from " + p.getSourceId() + " to " + p.getTargetId(), + MarshallingMessageKeys.sequenceFlowIgnored); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/BaseTaskConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/BaseTaskConverter.java new file mode 100644 index 00000000000..872d419f231 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/BaseTaskConverter.java @@ -0,0 +1,361 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.tasks; + +import java.util.Optional; + +import org.eclipse.bpmn2.ManualTask; +import org.eclipse.bpmn2.ReceiveTask; +import org.eclipse.bpmn2.SendTask; +import org.eclipse.bpmn2.Task; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest.Mode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.BPMNElementDecorators; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Match; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.AbstractConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.NodeConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.BusinessRuleTaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.GenericServiceTaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.ScriptTaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.TaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.UserTaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils; +import org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask; +import org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask; +import org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask; +import org.kie.workbench.common.stunner.bpmn.definition.NoneTask; +import org.kie.workbench.common.stunner.bpmn.definition.ScriptTask; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseUserTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BusinessRuleTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.DecisionName; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.DmnModelName; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.EmptyTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceExecutionMode; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.Namespace; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.RuleFlowGroup; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.RuleLanguage; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.Script; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName; +import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTask; +import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTaskExecutionSet; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.util.StringUtils; + +public abstract class BaseTaskConverter, S extends BaseUserTaskExecutionSet> + extends AbstractConverter implements NodeConverter { + + protected final TypedFactoryManager factoryManager; + private final PropertyReaderFactory propertyReaderFactory; + + public BaseTaskConverter(TypedFactoryManager factoryManager, PropertyReaderFactory propertyReaderFactory, + Mode mode) { + super(mode); + this.factoryManager = factoryManager; + this.propertyReaderFactory = propertyReaderFactory; + } + + @Override + public Result convert(Task task) { + return Match.of() + .when(e -> e instanceof org.eclipse.bpmn2.BusinessRuleTask, this::businessRuleTask) + .when(e -> e instanceof org.eclipse.bpmn2.ScriptTask, this::scriptTask) + .when(e -> e instanceof org.eclipse.bpmn2.UserTask, this::userTask) + .when(e -> e instanceof org.eclipse.bpmn2.ServiceTask, this::serviceTaskResolver) + .when(e -> org.eclipse.bpmn2.impl.TaskImpl.class.equals(e.getClass()), this::defaultTaskResolver) + .missing(e -> e instanceof ManualTask, ManualTask.class) + .missing(e -> e instanceof ServiceTask, SendTask.class) + .missing(e -> e instanceof ReceiveTask, ReceiveTask.class) + .orElse(this::defaultTaskResolver) + .inputDecorator(BPMNElementDecorators.flowElementDecorator()) + .outputDecorator(BPMNElementDecorators.bpmnNodeDecorator()) + .mode(getMode()) + .apply(task); + } + + private BpmnNode jbpmServiceTask(Task task) { + return propertyReaderFactory + .ofCustom(task) + .map(p -> { + final Node, Edge> node = factoryManager.newNode(task.getId(), ServiceTask.class); + final ServiceTask definition = node.getContent().getDefinition(); + definition.setName(p.getServiceTaskName()); + definition.getTaskType().setRawType(p.getServiceTaskName()); + definition.setDescription(p.getServiceTaskDescription()); + definition.setCategory(p.getServiceTaskCategory()); + definition.setDefaultHandler(p.getServiceTaskDefaultHandler()); + + definition.setGeneral(new TaskGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setDataIOSet(new DataIOSet( + p.getAssignmentsInfo() + )); + + definition.setExecutionSet(new ServiceTaskExecutionSet( + new TaskName(p.getTaskName()), + new IsAsync(p.isAsync()), + new AdHocAutostart(p.isAdHocAutoStart()), + new OnEntryAction(p.getOnEntryAction()), + new OnExitAction(p.getOnExitAction()) + , new SLADueDate(p.getSlaDueDate()) + )); + + definition.setSimulationSet(p.getSimulationSet()); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getRectangleDimensionsSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + + return BpmnNode.of(node, p); + }) + .orElseGet(() -> noneTask(task)); + } + + BpmnNode bpmnServiceTask(org.eclipse.bpmn2.ServiceTask task) { + Node, Edge> node = factoryManager.newNode(task.getId(), GenericServiceTask.class); + + GenericServiceTask definition = node.getContent().getDefinition(); + GenericServiceTaskPropertyReader p = propertyReaderFactory.of(task); + + if (p == null) { + throw new NullPointerException(task.getClass().getCanonicalName()); + } + + definition.setGeneral(new TaskGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setExecutionSet(new GenericServiceTaskExecutionSet( + new GenericServiceTaskInfo(p.getGenericServiceTask()), + p.getAssignmentsInfo(), + new AdHocAutostart(p.isAdHocAutostart()), + new IsAsync(p.isAsync()), + new IsMultipleInstance(p.isMultipleInstance()), + new MultipleInstanceExecutionMode(p.isSequential()), + new MultipleInstanceCollectionInput(p.getCollectionInput()), + new MultipleInstanceDataInput(p.getDataInput()), + new MultipleInstanceCollectionOutput(p.getCollectionOutput()), + new MultipleInstanceDataOutput(p.getDataOutput()), + new MultipleInstanceCompletionCondition(p.getCompletionCondition()), + new OnEntryAction(p.getOnEntryAction()), + new OnExitAction(p.getOnExitAction()), + new SLADueDate(p.getSLADueDate()))); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getRectangleDimensionsSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + + definition.setSimulationSet(p.getSimulationSet()); + + definition.setDataIOSet(new DataIOSet( + p.getAssignmentsInfo() + )); + + return BpmnNode.of(node, p); + } + + private BpmnNode businessRuleTask(org.eclipse.bpmn2.BusinessRuleTask task) { + Node, Edge> node = factoryManager.newNode(task.getId(), BusinessRuleTask.class); + + BusinessRuleTask definition = node.getContent().getDefinition(); + BusinessRuleTaskPropertyReader p = propertyReaderFactory.of(task); + + definition.setGeneral(new TaskGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setDataIOSet(new DataIOSet( + p.getAssignmentsInfo() + )); + + RuleLanguage ruleLanguage = new RuleLanguage(p.getImplementation()); + RuleFlowGroup ruleFlowGroup = null; + Namespace namespace = null; + DecisionName decisionName = null; + DmnModelName dmnModelName = null; + + if (ruleLanguage.getValue().equals(RuleLanguage.DRL)) { + ruleFlowGroup = new RuleFlowGroup(p.getRuleFlowGroup()); + namespace = new Namespace(); + decisionName = new DecisionName(); + dmnModelName = new DmnModelName(); + } else if (ruleLanguage.getValue().equals(RuleLanguage.DMN)) { + ruleFlowGroup = new RuleFlowGroup(); + namespace = new Namespace(p.getNamespace()); + decisionName = new DecisionName(p.getDecisionName()); + dmnModelName = new DmnModelName(p.getDmnModelName()); + } + + definition.setExecutionSet(new BusinessRuleTaskExecutionSet( + new RuleLanguage(p.getImplementation()), + ruleFlowGroup, + namespace, + decisionName, + dmnModelName, + new OnEntryAction(p.getOnEntryAction()), + new OnExitAction(p.getOnExitAction()), + new IsAsync(p.isAsync()), + new AdHocAutostart(p.isAdHocAutoStart()), + new SLADueDate(p.getSlaDueDate()) + )); + + definition.setSimulationSet(p.getSimulationSet()); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getRectangleDimensionsSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode scriptTask(org.eclipse.bpmn2.ScriptTask task) { + Node, Edge> node = factoryManager.newNode(task.getId(), ScriptTask.class); + + ScriptTask definition = node.getContent().getDefinition(); + ScriptTaskPropertyReader p = propertyReaderFactory.of(task); + + definition.setGeneral(new TaskGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setExecutionSet(new ScriptTaskExecutionSet( + new Script(p.getScript()), + new IsAsync(p.isAsync()), + new AdHocAutostart(p.isAdHocAutoStart()) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getRectangleDimensionsSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + + definition.setSimulationSet(p.getSimulationSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode userTask(org.eclipse.bpmn2.UserTask task) { + Node, Edge> node = createNode(task.getId()); + + U definition = node.getContent().getDefinition(); + UserTaskPropertyReader p = propertyReaderFactory.of(task); + + definition.setGeneral(new TaskGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setSimulationSet( + p.getSimulationSet() + ); + + definition.setExecutionSet(createUserTaskExecutionSet(p)); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getRectangleDimensionsSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + + return BpmnNode.of(node, p); + } + + private BpmnNode defaultTaskResolver(Task task) { + //in case serviceTaskName attribute is present handle as a Service Task, default is a None Task + return Optional.ofNullable(CustomAttribute.serviceTaskName.of(task).get()) + .filter(ConverterUtils::nonEmpty) + .filter(name -> propertyReaderFactory.ofCustom(task).isPresent()) + .map(name -> jbpmServiceTask(task)) + .orElseGet(() -> noneTask(task)); + } + + private BpmnNode serviceTaskResolver(final Task task) { + org.eclipse.bpmn2.ServiceTask serviceTask = (org.eclipse.bpmn2.ServiceTask) task; + if (StringUtils.nonEmpty(CustomAttribute.serviceImplementation.of(task).get()) + || StringUtils.nonEmpty(serviceTask.getImplementation())) { + return bpmnServiceTask(serviceTask); + } else { + return jbpmServiceTask(task); + } + } + + private BpmnNode noneTask(Task task) { + Node, Edge> node = factoryManager.newNode(task.getId(), NoneTask.class); + TaskPropertyReader p = propertyReaderFactory.of(task); + + NoneTask definition = node.getContent().getDefinition(); + + definition.setGeneral(new TaskGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + definition.setExecutionSet(new EmptyTaskExecutionSet()); + + definition.setSimulationSet( + p.getSimulationSet() + ); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getRectangleDimensionsSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + definition.setFontSet(p.getFontSet()); + + return BpmnNode.of(node, p); + } + + protected abstract Node, Edge> createNode(String id); + + protected abstract S createUserTaskExecutionSet(UserTaskPropertyReader p); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/Simulations.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/Simulations.java new file mode 100644 index 00000000000..16b2be8b8f9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/Simulations.java @@ -0,0 +1,132 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.tasks; + +import bpsim.CostParameters; +import bpsim.ElementParameters; +import bpsim.FloatingParameterType; +import bpsim.NormalDistributionType; +import bpsim.Parameter; +import bpsim.ParameterValue; +import bpsim.PoissonDistributionType; +import bpsim.ResourceParameters; +import bpsim.TimeParameters; +import bpsim.UniformDistributionType; +import org.eclipse.emf.common.util.EList; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Match; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationAttributeSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet; + +public class Simulations { + + public static SimulationSet simulationSet(ElementParameters eleType) { + SimulationSet simulationSet = new SimulationSet(); + + TimeParameters timeParams = eleType.getTimeParameters(); + if (timeParams == null) { + return simulationSet; + } + Parameter processingTime = timeParams.getProcessingTime(); + ParameterValue paramValue = processingTime.getParameterValue().get(0); + + if (paramValue instanceof NormalDistributionType) { + NormalDistributionType ndt = (NormalDistributionType) paramValue; + simulationSet.getMean().setValue(ndt.getMean()); + simulationSet.getStandardDeviation().setValue(ndt.getStandardDeviation()); + simulationSet.getDistributionType().setValue("normal"); + } else if (paramValue instanceof UniformDistributionType) { + UniformDistributionType udt = (UniformDistributionType) paramValue; + simulationSet.getMin().setValue(udt.getMin()); + simulationSet.getMax().setValue(udt.getMax()); + simulationSet.getDistributionType().setValue("uniform"); + } else if (paramValue instanceof PoissonDistributionType) { + PoissonDistributionType pdt = (PoissonDistributionType) paramValue; + simulationSet.getMean().setValue(pdt.getMean()); + simulationSet.getDistributionType().setValue("poisson"); + } else { + // TODO: Kogito + throw new UnsupportedOperationException(paramValue.getClass().toString()); + } + + CostParameters costParams = eleType.getCostParameters(); + if (costParams != null) { + simulationSet.getUnitCost().setValue(extractDouble(costParams.getUnitCost())); + } + + //controlParams(eleType, simulationSet); + ResourceParameters resourceParams = eleType.getResourceParameters(); + + if (resourceParams != null) { + Double quantity = extractDouble(resourceParams.getQuantity()); + simulationSet.getQuantity().setValue(quantity); + + Double availability = extractDouble(resourceParams.getAvailability()); + simulationSet.getWorkingHours().setValue(availability); + } + + return simulationSet; + } + + public static SimulationAttributeSet simulationAttributeSet(ElementParameters eleType) { + SimulationAttributeSet simulationSet = new SimulationAttributeSet(); + + TimeParameters timeParams = eleType.getTimeParameters(); + if (timeParams == null) { + return simulationSet; + } + Parameter processingTime = timeParams.getProcessingTime(); + ParameterValue paramValue = processingTime.getParameterValue().get(0); + + return Match.of() + .when(e -> e instanceof NormalDistributionType, ndt -> { + simulationSet.getMean().setValue(ndt.getMean()); + simulationSet.getStandardDeviation().setValue(ndt.getStandardDeviation()); + simulationSet.getDistributionType().setValue("normal"); + return simulationSet; + }) + .when(e -> e instanceof UniformDistributionType, udt -> { + simulationSet.getMin().setValue(udt.getMin()); + simulationSet.getMax().setValue(udt.getMax()); + simulationSet.getDistributionType().setValue("uniform"); + return simulationSet; + }) + .when(e -> e instanceof PoissonDistributionType, pdt -> { + simulationSet.getMean().setValue(pdt.getMean()); + simulationSet.getDistributionType().setValue("poisson"); + return simulationSet; + }) + .apply(paramValue) + .asSuccess() + .value(); + } + + private static Double extractDouble(Parameter parameter) { + if (parameter == null) { + return 0.0; + } + return extractDouble(parameter.getParameterValue()); + } + + private static Double extractDouble(EList parameterValues) { + if (parameterValues.isEmpty()) { + throw new IllegalArgumentException("failure params"); + } + ParameterValue value = parameterValues.get(0); + FloatingParameterType floatingValue = (FloatingParameterType) value; + return floatingValue.getValue(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/TaskConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/TaskConverter.java new file mode 100644 index 00000000000..b5435fe57f6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/TaskConverter.java @@ -0,0 +1,88 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.tasks; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest.Mode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.UserTaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.UserTask; +import org.kie.workbench.common.stunner.bpmn.definition.property.assignee.Groupid; +import org.kie.workbench.common.stunner.bpmn.definition.property.connectors.Priority; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.Content; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.CreatedBy; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.Description; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceExecutionMode; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.Skippable; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.Subject; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.UserTaskExecutionSet; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class TaskConverter extends BaseTaskConverter { + + public TaskConverter(TypedFactoryManager factoryManager, PropertyReaderFactory propertyReaderFactory, + Mode mode) { + super(factoryManager, propertyReaderFactory, mode); + } + + @Override + protected Node, Edge> createNode(String id) { + return factoryManager.newNode(id, UserTask.class); + } + + @Override + protected UserTaskExecutionSet createUserTaskExecutionSet(UserTaskPropertyReader p) { + return new UserTaskExecutionSet(new TaskName(p.getTaskName()), + p.getActors(), + new Groupid(p.getGroupid()), + p.getAssignmentsInfo(), + p.getNotifications(), + p.getReassignments(), + new IsAsync(p.isAsync()), + new Skippable(p.isSkippable()), + new Priority(p.getPriority()), + new Subject(p.getSubject()), + new Description(p.getDescription()), + new CreatedBy(p.getCreatedBy()), + new AdHocAutostart(p.isAdHocAutostart()), + new IsMultipleInstance(p.isMultipleInstance()), + new MultipleInstanceExecutionMode(p.isSequential()), + new MultipleInstanceCollectionInput(p.getCollectionInput()), + new MultipleInstanceDataInput(p.getDataInput()), + new MultipleInstanceCollectionOutput(p.getCollectionOutput()), + new MultipleInstanceDataOutput(p.getDataOutput()), + new MultipleInstanceCompletionCondition(p.getCompletionCondition()), + new OnEntryAction(p.getOnEntryAction()), + new OnExitAction(p.getOnExitAction()), + new Content(p.getContent()), + new SLADueDate(p.getSLADueDate())); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/textannotation/TextAnnotationConverter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/textannotation/TextAnnotationConverter.java new file mode 100644 index 00000000000..1e5f7ce48fa --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/textannotation/TextAnnotationConverter.java @@ -0,0 +1,65 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.textannotation; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.NodeConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.TextAnnotationPropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.TextAnnotation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class TextAnnotationConverter implements NodeConverter { + + private final TypedFactoryManager typedFactoryManager; + private PropertyReaderFactory propertyReaderFactory; + + public TextAnnotationConverter(TypedFactoryManager typedFactoryManager, PropertyReaderFactory propertyReaderFactory) { + this.typedFactoryManager = typedFactoryManager; + this.propertyReaderFactory = propertyReaderFactory; + } + + @Override + public Result convert(org.eclipse.bpmn2.TextAnnotation element) { + return convert(element, propertyReaderFactory.of(element)); + } + + private Result convert(org.eclipse.bpmn2.TextAnnotation element, TextAnnotationPropertyReader p) { + Node, Edge> node = typedFactoryManager.newNode(element.getId(), TextAnnotation.class); + TextAnnotation definition = node.getContent().getDefinition(); + + definition.setGeneral(new BPMNGeneralSet( + new Name(p.getName()), + new Documentation(p.getDocumentation()) + )); + + node.getContent().setBounds(p.getBounds()); + + definition.setDimensionsSet(p.getRectangleDimensionsSet()); + definition.setFontSet(p.getFontSet()); + definition.setBackgroundSet(p.getBackgroundSet()); + + return Result.success(BpmnNode.of(node, p)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/util/AbstractConverterHandler.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/util/AbstractConverterHandler.java new file mode 100644 index 00000000000..e8f91cc7cae --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/util/AbstractConverterHandler.java @@ -0,0 +1,62 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util; + +import java.util.Iterator; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.xml.type.XMLTypePackage; + +// TODO: Kogito - check why generated code throws UnsupportedOperationException for some methods +public abstract class AbstractConverterHandler { + + protected abstract FeatureMap getMixed(); + + protected String get_3_6() { + return get(3, 6); + } + + protected String get(int... ids) { + final FeatureMap featureMap = getMixed(); + if (featureMap != null && !featureMap.isEmpty()) { + StringBuilder result = new StringBuilder(); + Iterator var3 = featureMap.iterator(); + while (var3.hasNext()) { + FeatureMap.Entry cur = (FeatureMap.Entry) var3.next(); + for (int id : ids) { + if (id == cur.getEStructuralFeature().getFeatureID()) { + result.append(cur.getValue()); + } + } + } + return result.toString(); + } else { + return ""; + } + } + + protected void set(String value) { + set(XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_Text(), value); + } + + protected void set(EAttribute attribute, String value) { + final FeatureMap featureMap = getMixed(); + featureMap.clear(); + featureMap.add(attribute, value); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/util/ConverterUtils.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/util/ConverterUtils.java new file mode 100644 index 00000000000..69395d05b1a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/util/ConverterUtils.java @@ -0,0 +1,70 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util; + +import java.util.Optional; +import java.util.function.Function; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessage; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriter; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +public class ConverterUtils { + + @SuppressWarnings("unchecked") + public static Node, Edge> cast(Node node) { + return (Node, Edge>) node; + } + + public static boolean nonEmpty(final String s) { + return !isEmpty(s); + } + + public static boolean isEmpty(CharSequence str) { + return null == str || str.length() == 0; + } + + public static Result resultIgnored(Object o) { + return Result.ignored("PropertyWriter ignored for [" + o.getClass().getName() + "]."); + } + + public static Result resultNotSupported(Object o) { + return Result.failure("No PropertyWriter found for [" + o.getClass().getName() + "]."); + } + + public static PropertyWriter notSupported(Object o) { + throw new UnsupportedOperationException("No PropertyWriter found for [" + o.getClass().getName() + "]."); + } + + public static Result ignore(String name, Object o) { + return Result.ignored(name + " [" + o.getClass().getName() + "] not supported."); + } + + public Function ignored(Class expectedClass, final Object defaultValue) { + return t -> + Result.ignored( + "Ignored: " + + Optional.ofNullable(t) + .map(o -> o.getClass().getCanonicalName()) + .orElse("null -- expected " + expectedClass.getCanonicalName()), + defaultValue, + MarshallingMessage.builder().message("Ignored " + t).build()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/util/DocumentationTextHandler.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/util/DocumentationTextHandler.java new file mode 100644 index 00000000000..ea120472450 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/util/DocumentationTextHandler.java @@ -0,0 +1,45 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util; + +import org.eclipse.bpmn2.Documentation; +import org.eclipse.emf.ecore.util.FeatureMap; + +public class DocumentationTextHandler extends AbstractConverterHandler { + + private final Documentation documentation; + + public static DocumentationTextHandler of(Documentation documentation) { + return new DocumentationTextHandler(documentation); + } + + private DocumentationTextHandler(Documentation documentation) { + this.documentation = documentation; + } + + public String getText() { + return get_3_6(); + } + + public void setText(String newText) { + set(newText); + } + + protected FeatureMap getMixed() { + return documentation.getMixed(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/util/FormalExpressionBodyHandler.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/util/FormalExpressionBodyHandler.java new file mode 100644 index 00000000000..3c1694eff96 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/util/FormalExpressionBodyHandler.java @@ -0,0 +1,45 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util; + +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.emf.ecore.util.FeatureMap; + +public class FormalExpressionBodyHandler extends AbstractConverterHandler { + + private final FormalExpression formalExpression; + + public static FormalExpressionBodyHandler of(FormalExpression formalExpression) { + return new FormalExpressionBodyHandler(formalExpression); + } + + private FormalExpressionBodyHandler(FormalExpression formalExpression) { + this.formalExpression = formalExpression; + } + + public String getBody() { + return get_3_6(); + } + + public void setBody(String newBody) { + set(newBody); + } + + protected FeatureMap getMixed() { + return formalExpression.getMixed(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/service/BPMNClientDiagramService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/service/BPMNClientDiagramService.java new file mode 100644 index 00000000000..2234f3419c5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/service/BPMNClientDiagramService.java @@ -0,0 +1,160 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.service; + +import java.util.Objects; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.ConverterUtils; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; +import org.kie.workbench.common.stunner.bpmn.factory.BPMNDiagramFactory; +import org.kie.workbench.common.stunner.core.api.DefinitionManager; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.client.api.ShapeManager; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.DiagramImpl; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.diagram.MetadataImpl; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.definition.Definition; +import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; +import org.kie.workbench.common.stunner.core.graph.util.GraphUtils; +import org.kie.workbench.common.stunner.core.util.UUID; +import org.kie.workbench.common.stunner.kogito.api.editor.DiagramType; +import org.kie.workbench.common.stunner.kogito.api.editor.impl.KogitoDiagramResourceImpl; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientDiagramService; +import org.uberfire.backend.vfs.PathFactory; +import org.uberfire.client.promise.Promises; + +@ApplicationScoped +public class BPMNClientDiagramService implements KogitoClientDiagramService { + + private final DefinitionManager definitionManager; + private final BPMNClientMarshalling marshalling; + private final FactoryManager factoryManager; + private final BPMNDiagramFactory diagramFactory; + private final ShapeManager shapeManager; + private final Promises promises; + + //CDI proxy + protected BPMNClientDiagramService() { + this(null, null, null, null, null, null); + } + + @Inject + public BPMNClientDiagramService(final DefinitionManager definitionManager, + final BPMNClientMarshalling marshalling, + final FactoryManager factoryManager, + final BPMNDiagramFactory diagramFactory, + final ShapeManager shapeManager, + final Promises promises) { + this.definitionManager = definitionManager; + this.marshalling = marshalling; + this.factoryManager = factoryManager; + this.diagramFactory = diagramFactory; + this.shapeManager = shapeManager; + this.promises = promises; + } + + @Override + public void transform(final String xml, + final ServiceCallback callback) { + // TODO: handle errors? + Diagram diagram = transform(xml); + callback.onSuccess(diagram); + } + + @Override + public Promise transform(final KogitoDiagramResourceImpl resource) { + if (resource.getType() == DiagramType.PROJECT_DIAGRAM) { + return promises.resolve(transform(resource.projectDiagram().orElseThrow(() -> new IllegalStateException("DiagramType is PROJECT_DIAGRAM however no instance present")))); + } + return promises.resolve(resource.xmlDiagram().orElse("DiagramType is XML_DIAGRAM however no instance present")); + } + + public Diagram transform(final String xml) { + if (Objects.isNull(xml) || xml.isEmpty()) { + return doNewDiagram(); + } + return doTransformation(xml); + } + + public String transform(final Diagram diagram) { + return marshalling.marshall(convert(diagram)); + } + + private Diagram doNewDiagram() { + final String title = UUID.uuid(); + final String defSetId = BPMNClientMarshalling.getDefinitionSetId(); + final Metadata metadata = createMetadata(); + metadata.setTitle(title); + final Diagram diagram = factoryManager.newDiagram(title, + defSetId, + metadata); + updateClientMetadata(diagram); + return diagram; + } + + @SuppressWarnings("unchecked") + private Diagram doTransformation(final String raw) { + final Metadata metadata = createMetadata(); + final Graph graph = marshalling.unmarshall(metadata, raw); + final Node, ?> diagramNode = GraphUtils.getFirstNode((Graph) graph, BPMNDiagramImpl.class); + if (null == diagramNode) { + throw new RuntimeException("No BPMN Diagram can be found."); + } + final String title = diagramNode.getContent().getDefinition().getDiagramSet().getName().getValue(); + metadata.setTitle(title); + final Diagram diagram = diagramFactory.build(title, + metadata, + graph); + updateClientMetadata(diagram); + return diagram; + } + + // TODO: Necessary? + private static final String ROOT_PATH = "default://master@system/stunner/diagrams"; + + private Metadata createMetadata() { + return new MetadataImpl.MetadataImplBuilder(BPMNClientMarshalling.getDefinitionSetId(), + definitionManager) + .setRoot(PathFactory.newPath(".", ROOT_PATH)) + .build(); + } + + private void updateClientMetadata(final Diagram diagram) { + if (null != diagram) { + final Metadata metadata = diagram.getMetadata(); + if (Objects.nonNull(metadata) && ConverterUtils.isEmpty(metadata.getShapeSetId())) { + final String sId = shapeManager.getDefaultShapeSet(metadata.getDefinitionSetId()).getId(); + metadata.setShapeSetId(sId); + } + } + } + + private DiagramImpl convert(final Diagram diagram) { + return new DiagramImpl(diagram.getName(), + diagram.getGraph(), + diagram.getMetadata()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/service/BPMNClientMarshalling.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/service/BPMNClientMarshalling.java new file mode 100644 index 00000000000..fe1c4bda0d3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/java/org/kie/workbench/common/stunner/bpmn/client/marshall/service/BPMNClientMarshalling.java @@ -0,0 +1,195 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.service; + +import java.util.Collection; +import java.util.Collections; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.DocumentRoot; +import org.jboss.drools.DroolsPackage; +import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; +import org.kie.workbench.common.stunner.bpmn.client.emf.Bpmn2Marshalling; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.ConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.DefinitionsBuildingContext; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.DefinitionsConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BaseConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.GraphBuilder; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; +import org.kie.workbench.common.stunner.core.api.DefinitionManager; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.command.GraphCommandManager; +import org.kie.workbench.common.stunner.core.graph.command.impl.GraphCommandFactory; +import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; +import org.kie.workbench.common.stunner.core.rule.RuleManager; + +@ApplicationScoped +public class BPMNClientMarshalling { + + private static Logger LOGGER = Logger.getLogger(BPMNClientMarshalling.class.getName()); + + private final DefinitionManager definitionManager; + private final RuleManager ruleManager; + private final TypedFactoryManager typedFactoryManager; + private final GraphCommandFactory commandFactory; + private final GraphCommandManager commandManager; + + @Inject + public BPMNClientMarshalling(final DefinitionManager definitionManager, + final RuleManager ruleManager, + final FactoryManager factoryManager, + final GraphCommandFactory commandFactory, + final GraphCommandManager commandManager) { + this.definitionManager = definitionManager; + this.ruleManager = ruleManager; + this.typedFactoryManager = new TypedFactoryManager(factoryManager); + this.commandFactory = commandFactory; + this.commandManager = commandManager; + } + + @PostConstruct + public void init() { + Bpmn2Marshalling.setLogger(message -> LOGGER.log(Level.SEVERE, message)); + } + + @SuppressWarnings("unchecked") + public String marshall(final Diagram diagram) { + final PropertyWriterFactory propertyWriterFactory = new PropertyWriterFactory(); + final DefinitionsBuildingContext buildingContext = new DefinitionsBuildingContext(diagram.getGraph(), getDiagramClass()); + final ConverterFactory converterFactory = new ConverterFactory(buildingContext, propertyWriterFactory); + final DefinitionsConverter definitionsConverter = new DefinitionsConverter(converterFactory, propertyWriterFactory); + final Definitions definitions = definitionsConverter.toDefinitions(); + return Bpmn2Marshalling.marshall(definitions); + } + + public Graph unmarshall(final Metadata metadata, + final String raw) { + final MarshallingRequest.Mode mode = MarshallingRequest.Mode.AUTO; + final Graph graph = unmarshall(metadata, + mode, + raw); + return graph; + } + + @SuppressWarnings("unchecked") + private Graph unmarshall(final Metadata metadata, + final MarshallingRequest.Mode mode, + final String raw) { + final DocumentRoot documentRoot = Bpmn2Marshalling.unmarshall(raw); + final DefinitionsHandler definitionsHandler = new DefinitionsHandler(documentRoot); + final DefinitionResolver definitionResolver = new DefinitionResolver(definitionsHandler.getDefinitions(), + getWorkItemDefinitions(), + definitionsHandler.isJbpm(), + mode); + + metadata.setCanvasRootUUID(definitionResolver.getDefinitions().getId()); + metadata.setTitle(definitionResolver.getProcess().getName()); + + final BaseConverterFactory converterFactory = new org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.ConverterFactory(definitionResolver, typedFactoryManager); + // perform actual conversion. Process is the root of the diagram + final Result result = converterFactory.rootProcessConverter().convertProcess(); + final BpmnNode diagramRoot = result.value(); + + // the root node contains all of the information + // needed to build the entire graph (including parent/child relationships) + // thus, we can now walk the graph to issue all the commands + // to draw it on our canvas + final Diagram, Metadata> diagram = + typedFactoryManager.newDiagram( + definitionResolver.getDefinitions().getId(), + getDefinitionSetClass(), + metadata); + final Graph graph = diagram.getGraph(); + final GraphBuilder graphBuilder = + new GraphBuilder( + graph, + definitionManager, + typedFactoryManager, + ruleManager, + commandFactory, + commandManager); + graphBuilder.render(diagramRoot); + return graph; + } + + // TODO: Use the right WID registry. + private static Collection getWorkItemDefinitions() { + return Collections.emptyList(); + } + + public static Class getDiagramClass() { + return BPMNDiagramImpl.class; + } + + public static String getDefinitionSetId() { + return BindableAdapterUtils.getDefinitionSetId(getDefinitionSetClass()); + } + + public static Class getDefinitionSetClass() { + return BPMNDefinitionSet.class; + } + + static class DefinitionsHandler { + + private static final String JBPM_PREFIX = "jBPM"; + private static final String DROOLS_NAMESPACE = DroolsPackage.eNS_URI; + + private final Definitions definitions; + private final boolean jbpm; + + DefinitionsHandler(DocumentRoot root) { + this.definitions = root.getDefinitions(); + this.jbpm = isJbpmnDocument(root, definitions); + } + + public Definitions getDefinitions() { + return definitions; + } + + public boolean isJbpm() { + return jbpm; + } + + private static boolean isJbpmnDocument(DocumentRoot root, Definitions definitions) { + String exporter = definitions.getExporter(); + if (exporter != null) { + //99% of cases + return exporter.toLowerCase().startsWith(JBPM_PREFIX.toLowerCase()); + } + //1% of cases, legacy jBPM processes might not have exporter value properly set. + return root.getXMLNSPrefixMap().values().contains(DROOLS_NAMESPACE) || root.getXSISchemaLocation().keySet().contains(DROOLS_NAMESPACE); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnMarshalling.gwt.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnMarshalling.gwt.xml new file mode 100644 index 00000000000..aa7463c425f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnMarshalling.gwt.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/BPMNElementDecoratorsTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/BPMNElementDecoratorsTest.java new file mode 100644 index 00000000000..7b001fdaef2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/BPMNElementDecoratorsTest.java @@ -0,0 +1,77 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters; + +// TODO: Kogito - @RunWith(MockitoJUnitRunner.class) +public class BPMNElementDecoratorsTest { + + private static final String NAME = "NAME"; + + /*@Test + public void flowElementDecorator() { + MarshallingMessageDecorator decorator = BPMNElementDecorators.flowElementDecorator(); + FlowElement element = mock(FlowElement.class); + when(element.getName()).thenReturn(NAME); + assertEquals(NAME, decorator.getName(element)); + assertEquals(element.getClass().getSimpleName(), decorator.getType(element)); + } + + @Test + public void baseElementDecorator() { + MarshallingMessageDecorator decorator = BPMNElementDecorators.baseElementDecorator(); + BaseElement element = mock(FlowElement.class); + when(element.getId()).thenReturn(NAME); + assertEquals(NAME, decorator.getName(element)); + assertEquals(element.getClass().getSimpleName(), decorator.getType(element)); + } + + @Test + public void bpmnNodeDecorator() { + MarshallingMessageDecorator decorator = BPMNElementDecorators.bpmnNodeDecorator(); + BpmnNode element = mockBpmnNode(); + + assertEquals(NAME, decorator.getName(element)); + assertEquals(element.value().getContent().getDefinition().getClass().getSimpleName(), decorator.getType(element)); + } + + private BpmnNode mockBpmnNode() { + BpmnNode element = mock(BpmnNode.class); + Node node = mock(Node.class); + when(element.value()).thenReturn(node); + View content = mock(View.class); + when(node.getContent()).thenReturn(content); + BPMNViewDefinition viewDefinition = mock(BPMNViewDefinition.class); + when(content.getDefinition()).thenReturn(viewDefinition); + BPMNBaseInfo general = mock(BPMNBaseInfo.class); + when(viewDefinition.getGeneral()).thenReturn(general); + Name name = mock(Name.class); + when(general.getName()).thenReturn(name); + when(name.getValue()).thenReturn(NAME); + return element; + } + + @Test + public void resultBpmnDecorator() { + MarshallingMessageDecorator decorator = BPMNElementDecorators.resultBpmnDecorator(); + BpmnNode node = mockBpmnNode(); + Result result = Result.success(node); + + assertEquals(NAME, decorator.getName(result)); + assertEquals(node.value().getContent().getDefinition().getClass().getSimpleName(), + decorator.getType(result)); + }*/ +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/ResultComposerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/ResultComposerTest.java new file mode 100644 index 00000000000..1b73f77761f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/ResultComposerTest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessage; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +@RunWith(MockitoJUnitRunner.class) +public class ResultComposerTest { + + Result result1; + Result result2; + Result result3; + MarshallingMessage message1; + MarshallingMessage message2; + MarshallingMessage message3; + + @Mock + private Object value; + + @Before + public void setUp() { + message1 = MarshallingMessage.builder().build(); + message2 = MarshallingMessage.builder().build(); + message3 = MarshallingMessage.builder().build(); + result1 = Result.success(value, message1); + result2 = Result.failure("", value, message2); + result3 = Result.ignored("", value, message3); + } + + @Test + public void compose() { + final Result result = ResultComposer.compose(value, result1, result2, result3); + assertResult(result); + } + + private void assertResult(Result result) { + assertEquals(3, result.messages().size()); + assertTrue(result.messages().stream().anyMatch(message1::equals)); + assertTrue(result.messages().stream().anyMatch(message2::equals)); + assertTrue(result.messages().stream().anyMatch(message3::equals)); + } + + @Test + public void composeList() { + final Result result = ResultComposer.compose(value, result1, result2, result3); + assertResult(result); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/ResultTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/ResultTest.java new file mode 100644 index 00000000000..3300993c720 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/ResultTest.java @@ -0,0 +1,74 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessage; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; + +@RunWith(MockitoJUnitRunner.class) +public class ResultTest { + + @Mock + private Object value; + + private final MarshallingMessage message = MarshallingMessage.builder().message("message").build(); + + @Test + public void success() { + final Result result = Result.success(value, message); + assertResult(result, message, true, false, false, value); + } + + @Test + public void failure() { + final Result result = Result.failure("Reason", value, message); + assertResult(result, message, false, true, false, value); + } + + @Test + public void failureWithNullValue() { + final Result result = Result.failure("Reason", message); + assertResult(result, message, false, true, false, null); + } + + @Test + public void ignored() { + final Result result = Result.ignored("Reason", value, message); + assertResult(result, message, false, false, true, value); + } + + @Test + public void ignoredWithNullValue() { + final Result result = Result.ignored("Reason", message); + assertResult(result, message, false, false, true, null); + } + + private void assertResult(Result result, MarshallingMessage message, + boolean success, boolean failure, boolean ignored, Object value) { + assertEquals(value, result.value()); + assertEquals(message, result.messages().get(0)); + assertEquals(result.messages().size(), 1); + assertEquals(success, result.isSuccess()); + assertEquals(failure, result.isFailure()); + assertEquals(ignored, result.isIgnored()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/TestDefinitionsWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/TestDefinitionsWriter.java new file mode 100644 index 00000000000..8bb36959a50 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/TestDefinitionsWriter.java @@ -0,0 +1,82 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.FlowNode; +import org.eclipse.bpmn2.SequenceFlow; +import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.di.BPMNPlane; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.dd.dc.Bounds; +import org.eclipse.dd.dc.Point; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.di; + +public class TestDefinitionsWriter { + + private final DefinitionResolver definitionResolver; + private BPMNPlane bpmnPlane; + + public TestDefinitionsWriter() { + Definitions definitions = bpmn2.createDefinitions(); + definitions.getRootElements().add(bpmn2.createProcess()); + BPMNDiagram bpmnDiagram = di.createBPMNDiagram(); + bpmnPlane = di.createBPMNPlane(); + bpmnDiagram.setPlane(bpmnPlane); + definitions.getDiagrams().add(bpmnDiagram); + + this.definitionResolver = new DefinitionResolver(definitions, Collections.emptyList()); + } + + public DefinitionResolver getDefinitionResolver() { + return definitionResolver; + } + + public FlowNode mockNode(String id, Bounds bounds) { + Task node = bpmn2.createTask(); + node.setId(id); + + BPMNShape shape = di.createBPMNShape(); + shape.setBounds(bounds); + shape.setBpmnElement(node); + bpmnPlane.getPlaneElement().add(shape); + + return node; + } + + public SequenceFlow sequenceFlowOf(String id, FlowNode source, FlowNode target, List waypoints) { + SequenceFlow sequenceFlow = bpmn2.createSequenceFlow(); + sequenceFlow.setId(id); + sequenceFlow.setSourceRef(source); + sequenceFlow.setTargetRef(target); + + BPMNEdge edge = di.createBPMNEdge(); + edge.setBpmnElement(sequenceFlow); + bpmnPlane.getPlaneElement().add(edge); + edge.getWaypoint().addAll(waypoints); + + return sequenceFlow; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/TestUtils.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/TestUtils.java new file mode 100644 index 00000000000..c157f06cd12 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/TestUtils.java @@ -0,0 +1,146 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters; + +import java.util.ArrayList; +import java.util.List; + +import bpsim.NormalDistributionType; +import bpsim.PoissonDistributionType; +import bpsim.UniformDistributionType; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.dd.dc.Bounds; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.jboss.drools.MetaDataType; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Child; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; +import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; +import org.kie.workbench.common.stunner.core.util.UUID; +import org.mockito.Mockito; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.powermock.api.mockito.PowerMockito.when; + +public class TestUtils { + + public static EList mockExtensionValues(EReference metadataFeatureName, String metadataElementName, String metadataElementValue) { + List extensionElements = new ArrayList<>(); + MetaDataType metaDataType = mock(MetaDataType.class); + when(metaDataType.getName()).thenReturn(metadataElementName); + when(metaDataType.getMetaValue()).thenReturn(metadataElementValue); + extensionElements.add(metaDataType); + + FeatureMap featureMap = mock(FeatureMap.class); + when(featureMap.get(metadataFeatureName, true)).thenReturn(extensionElements); + + EList extensionValues = ECollections.newBasicEList(); + ExtensionAttributeValue extensionAttributeValue = mock(ExtensionAttributeValue.class); + when(extensionAttributeValue.getValue()).thenReturn(featureMap); + extensionValues.add(extensionAttributeValue); + return extensionValues; + } + + public static Bounds mockBounds(float x, float y) { + Bounds bounds = mock(Bounds.class); + when(bounds.getX()).thenReturn(x); + when(bounds.getY()).thenReturn(y); + return bounds; + } + + public static Bounds mockBounds(float x, float y, float width, float height) { + Bounds bounds = mockBounds(x, y); + when(bounds.getWidth()).thenReturn(width); + when(bounds.getHeight()).thenReturn(height); + return bounds; + } + + public static void assertBounds(double x1, double y1, double x2, double y2, org.kie.workbench.common.stunner.core.graph.content.Bounds bounds) { + assertEquals(x1, bounds.getUpperLeft().getX(), 0); + assertEquals(y1, bounds.getUpperLeft().getY(), 0); + assertEquals(x2, bounds.getLowerRight().getX(), 0); + assertEquals(y2, bounds.getLowerRight().getY(), 0); + } + + public static FormalExpression mockFormalExpression(String language, String body) { + FormalExpression expression = mockFormalExpression(body); + when(expression.getLanguage()).thenReturn(language); + return expression; + } + + public static FormalExpression mockFormalExpression(String body) { + FormalExpression expression = mock(FormalExpression.class); + when(expression.getBody()).thenReturn(body); + return expression; + } + + public static FeatureMap.Entry mockFeatureMapEntry(String name, Object value) { + FeatureMap.Entry entry = mock(FeatureMap.Entry.class); + EStructuralFeature feature = mock(EStructuralFeature.class); + Mockito.when(feature.getName()).thenReturn(name); + Mockito.when(entry.getEStructuralFeature()).thenReturn(feature); + Mockito.when(entry.getValue()).thenReturn(value); + return entry; + } + + public static NormalDistributionType mockNormalDistributionType(double mean, double standardDeviation) { + NormalDistributionType distributionType = mock(NormalDistributionType.class); + when(distributionType.getMean()).thenReturn(mean); + when(distributionType.getStandardDeviation()).thenReturn(standardDeviation); + return distributionType; + } + + public static UniformDistributionType mockUniformDistributionType(double min, double max) { + UniformDistributionType distributionType = mock(UniformDistributionType.class); + when(distributionType.getMin()).thenReturn(min); + when(distributionType.getMax()).thenReturn(max); + return distributionType; + } + + public static PoissonDistributionType mockPoissonDistributionType(double mean) { + PoissonDistributionType distributionType = mock(PoissonDistributionType.class); + when(distributionType.getMean()).thenReturn(mean); + return distributionType; + } + + public static Node, ?> newNode(T definition) { + return newNode(UUID.uuid(), definition); + } + + public static Node, ?> newNode(String UUID, T definition) { + Node, ?> node = new NodeImpl<>(UUID); + node.setContent(new ViewImpl(definition, org.kie.workbench.common.stunner.core.graph.content.Bounds.create())); + return node; + } + + public static Edge mockEdge(Node, ?> sourceNode, Node, ?> targetNode) { + Edge edge = mock(Edge.class); + when(edge.getContent()).thenReturn(mock(Child.class)); + when(edge.getSourceNode()).thenReturn(sourceNode); + when(edge.getTargetNode()).thenReturn(targetNode); + return edge; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AssociationDeclarationTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AssociationDeclarationTest.java new file mode 100644 index 00000000000..2a9b0966269 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AssociationDeclarationTest.java @@ -0,0 +1,78 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.AssociationDeclaration.Direction.Input; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.AssociationDeclaration.Direction.Output; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.AssociationDeclaration.Type.SourceTarget; + +public class AssociationDeclarationTest { + + private static final String INPUT_ASSIGNMENTS_VALUE = "[din]var1->input1"; + private static final String INPUT_ASSIGNMENTS_VALUE_MISSING = "[din]var1->"; + private static final String OUTPUT_ASSIGNMENTS_VALUE = "[dout]output1->var1"; + private static final String OUTPUT_ASSIGNMENTS_VALUE_MISSING = "[dout]output1->"; + + @Test(expected = IllegalArgumentException.class) + public void testFromStringNull() { + AssociationDeclaration.fromString(null); + } + + @Test(expected = IllegalArgumentException.class) + public void testFromStringEmpty() { + AssociationDeclaration.fromString(""); + } + + @Test + public void testFromStringInput() { + AssociationDeclaration associationDeclaration = AssociationDeclaration.fromString(INPUT_ASSIGNMENTS_VALUE); + assertEquals(associationDeclaration.getSource(), "var1"); + assertEquals(associationDeclaration.getTarget(), "input1"); + assertEquals(associationDeclaration.getType(), SourceTarget); + assertEquals(associationDeclaration.getDirection(), Input); + } + + @Test + public void testFromStringOutput() { + AssociationDeclaration associationDeclaration = AssociationDeclaration.fromString(OUTPUT_ASSIGNMENTS_VALUE); + assertEquals(associationDeclaration.getSource(), "output1"); + assertEquals(associationDeclaration.getTarget(), "var1"); + assertEquals(associationDeclaration.getType(), SourceTarget); + assertEquals(associationDeclaration.getDirection(), Output); + } + + @Test + public void testFromStringInputMissing() { + AssociationDeclaration associationDeclaration = AssociationDeclaration.fromString(INPUT_ASSIGNMENTS_VALUE_MISSING); + assertEquals(associationDeclaration.getSource(), "var1"); + assertEquals(associationDeclaration.getTarget(), ""); + assertEquals(associationDeclaration.getType(), SourceTarget); + assertEquals(associationDeclaration.getDirection(), Input); + } + + @Test + public void testFromStringOutputMissing() { + AssociationDeclaration associationDeclaration = AssociationDeclaration.fromString(OUTPUT_ASSIGNMENTS_VALUE_MISSING); + assertEquals(associationDeclaration.getSource(), "output1"); + assertEquals(associationDeclaration.getTarget(), ""); + assertEquals(associationDeclaration.getType(), SourceTarget); + assertEquals(associationDeclaration.getDirection(), Output); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AssociationListTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AssociationListTest.java new file mode 100644 index 00000000000..dfe648d69df --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/AssociationListTest.java @@ -0,0 +1,51 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class AssociationListTest { + + private AssociationList tested; + public static final String VALUE = "[din]var1->input1,[din]var2->input2,[dout]var3->output1," + + "[dout]var5->output2"; + + public static final String VALUE_WITH_COMMA = "[din]var1->input1,[din]var2->input2,input22,input33," + + "[dout]var3->output1,[dout]var5->output2,output22,ouput23"; + + @Before + public void setUp() { + tested = new AssociationList(); + } + + @Test + public void fromString() { + AssociationList list = tested.fromString(VALUE); + assertEquals(2, list.getInputs().size()); + assertEquals(2, list.getOutputs().size()); + } + + @Test + public void fromStringWithComma() { + AssociationList list = tested.fromString(VALUE_WITH_COMMA); + assertEquals(2, list.getInputs().size()); + assertEquals(2, list.getOutputs().size()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomAttributeTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomAttributeTest.java new file mode 100644 index 00000000000..4e1251e2412 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomAttributeTest.java @@ -0,0 +1,49 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import org.eclipse.bpmn2.BaseElement; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class CustomAttributeTest { + + @Test + public void packageNameSetEmpty() { + BaseElement baseElement = createBaseElement(); + CustomAttribute packageName = + CustomAttribute.packageName.of(baseElement); + packageName.set(""); + assertEquals(Package.DEFAULT_PACKAGE, packageName.get()); + } + + @Test + public void packageNameSetNull() { + BaseElement baseElement = createBaseElement(); + CustomAttribute packageName = + CustomAttribute.packageName.of(baseElement); + packageName.set(null); + assertEquals(null, packageName.get()); + } + + public BaseElement createBaseElement() { + return bpmn2.createTask(); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomElementTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomElementTest.java new file mode 100644 index 00000000000..eac69b23abc --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomElementTest.java @@ -0,0 +1,92 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import org.eclipse.bpmn2.BaseElement; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements.ElementDefinition; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; + +@RunWith(MockitoJUnitRunner.class) +public class CustomElementTest { + + private ElementDefinition elementDefinition; + + private Object defaultValue = new Object(); + + @Mock + private BaseElement baseElement; + + @Before + public void setUp() { + elementDefinition = new ElementDefinitionStub("someDefinition", defaultValue); + } + + @Test + public void testGet() { + Object value = new Object(); + elementDefinition.setValue(baseElement, value); + assertEquals(value, new CustomElement<>(elementDefinition, baseElement).get()); + } + + @Test + public void testSetNonDefaultValue() { + Object newValue = new Object(); + CustomElement customElement = new CustomElement<>(elementDefinition, baseElement); + customElement.set(newValue); + assertEquals(newValue, elementDefinition.getValue(baseElement)); + } + + @Test + public void testSetDefaultValue() { + Object currentValue = elementDefinition.getValue(baseElement); + CustomElement customElement = new CustomElement<>(elementDefinition, baseElement); + customElement.set(defaultValue); + assertNotEquals(defaultValue, customElement.get()); + assertEquals(currentValue, customElement.get()); + } + + private class ElementDefinitionStub extends ElementDefinition { + + private Object value; + + public ElementDefinitionStub(String name, Object defaultValue) { + super(name, defaultValue); + } + + @Override + public Object getValue(BaseElement element) { + return value; + } + + @Override + public void setValue(BaseElement element, Object value) { + this.value = value; + } + + @Override + protected void setStringValue(BaseElement element, String value) { + + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomInputDefinitionTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomInputDefinitionTest.java new file mode 100644 index 00000000000..a1b7099e3ae --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/CustomInputDefinitionTest.java @@ -0,0 +1,45 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import java.util.List; + +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.Task; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class CustomInputDefinitionTest { + + @Test + public void shouldReuseInputSet() { + Task task = bpmn2.createTask(); + StringInput stringInput = new StringInput("BLAH", "ATYPE", "DEFAULTVAL"); + stringInput.of(task).set("VALUE"); + + StringInput stringInput2 = new StringInput("BLAH2", "ATYPE", "DEFAULTVAL"); + stringInput.of(task).set("VALUE"); + + InputOutputSpecification ioSpecification = task.getIoSpecification(); + List inputSets = ioSpecification.getInputSets(); + + assertEquals(1, inputSets.size()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/VariableDeclarationTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/VariableDeclarationTest.java new file mode 100644 index 00000000000..0dfeab287b6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/VariableDeclarationTest.java @@ -0,0 +1,61 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; + +@RunWith(MockitoJUnitRunner.class) +public class VariableDeclarationTest { + + private static final String CONSTRUCTOR_IDENTIFIER = "Variable Declaration Test"; + private static final String CONSTRUCTOR_TYPE = "Integer"; + private static final String CONSTRUCTOR_KPI = "false"; + + private static final String VAR_IDENTIFIER = "Variable-Declaration-Test"; + private static final String VAR_NAME = "Variable Declaration Test"; + private static final String VAR_KPI = "false"; + + private VariableDeclaration tested; + + @Before + public void setup() { + tested = new VariableDeclaration(CONSTRUCTOR_IDENTIFIER, CONSTRUCTOR_TYPE, CONSTRUCTOR_KPI); + } + + @Test + public void testIdentifier() { + String identifier = tested.getIdentifier(); + assertEquals(identifier, VAR_IDENTIFIER); + } + + @Test + public void testName() { + String name = tested.getTypedIdentifier().getName(); + assertEquals(name, VAR_NAME); + } + + @Test + public void testKPI() { + String kpi = tested.getKpi(); + assertEquals(kpi, VAR_KPI); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/BooleanElementTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/BooleanElementTest.java new file mode 100644 index 00000000000..48348431357 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/BooleanElementTest.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; + +public class BooleanElementTest extends MetaTypeDefinitionTest { + + @Override + public MetadataTypeDefinition getMetaTypeDefinition() { + return new BooleanElement("theName", false); + } + + @Override + protected Boolean getTestValue() { + return true; + } + + @Override + protected Boolean formattedResult(Boolean testValue) { + return testValue; + } + + @Override + protected String formattedValue(Boolean testValue) { + return asCData(Boolean.toString(testValue)); + } + + @Override + protected String asStringValue(Boolean testValue) { + return Boolean.toString(testValue); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/MetaTypeDefinitionTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/MetaTypeDefinitionTest.java new file mode 100644 index 00000000000..dc26705979d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/MetaTypeDefinitionTest.java @@ -0,0 +1,95 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements; + +import java.util.List; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.Bpmn2Factory; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.impl.EStructuralFeatureImpl; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.jboss.drools.DroolsFactory; +import org.jboss.drools.DroolsPackage; +import org.jboss.drools.MetaDataType; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.jboss.drools.DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA; +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; + +@RunWith(MockitoJUnitRunner.class) +public abstract class MetaTypeDefinitionTest { + + protected BaseElement baseElement; + + public abstract MetadataTypeDefinition getMetaTypeDefinition(); + + protected abstract T getTestValue(); + + protected abstract T formattedResult(T testValue); + + protected abstract String formattedValue(T testValue); + + protected String asStringValue(T testValue) { + return testValue.toString(); + } + + @Before + public void setUp() { + baseElement = bpmn2.createTask(); + } + + @Test + public void testGetValue() { + MetadataTypeDefinition metadataTypeDefinition = getMetaTypeDefinition(); + T expectedValue = getTestValue(); + prepareBaseElementAttribute(metadataTypeDefinition.name(), asStringValue(expectedValue)); + assertEquals(formattedResult(expectedValue), metadataTypeDefinition.getValue(baseElement)); + } + + @Test + public void testSetValue() throws Exception { + MetadataTypeDefinition metadataTypeDefinition = getMetaTypeDefinition(); + T expectedValue = getTestValue(); + metadataTypeDefinition.setValue(baseElement, expectedValue); + ExtensionAttributeValue attributeValue = baseElement.getExtensionValues().get(0); + FeatureMap extensionElements = attributeValue.getValue(); + List metadataExtensions = (List) extensionElements + .get(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, true); + MetaDataType metaDataType = metadataExtensions.stream().filter(metaData -> metadataTypeDefinition.name().equals(metaData.getName())).findFirst().orElseThrow(() -> new Exception("expected metadata element:" + metadataTypeDefinition.name() + " was not found")); + assertEquals(formattedValue(expectedValue), metaDataType.getMetaValue()); + } + + private void prepareBaseElementAttribute(String name, String value) { + ExtensionAttributeValue eav = Bpmn2Factory.eINSTANCE.createExtensionAttributeValue(); + baseElement.getExtensionValues().add(eav); + eav.getValue().add(new EStructuralFeatureImpl.SimpleFeatureMapEntry((EStructuralFeature.Internal) DOCUMENT_ROOT__META_DATA, metaDataOf(name, value))); + } + + private MetaDataType metaDataOf(String name, String value) { + MetaDataType eleMetadata = DroolsFactory.eINSTANCE.createMetaDataType(); + eleMetadata.setName(name); + eleMetadata.setMetaValue(asCData(value)); + return eleMetadata; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/StringElementTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/StringElementTest.java new file mode 100644 index 00000000000..791bffe0d66 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/customproperties/elements/StringElementTest.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.elements; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; + +public class StringElementTest extends MetaTypeDefinitionTest { + + @Override + public MetadataTypeDefinition getMetaTypeDefinition() { + return new StringElement("TheName", "TheDefaultValue"); + } + + @Override + public String getTestValue() { + return "TheValue"; + } + + @Override + protected String formattedResult(String testValue) { + return asCData(testValue); + } + + @Override + protected String formattedValue(String value) { + return asCData(value); + } + + @Override + protected String asStringValue(String testValue) { + return super.asStringValue(testValue); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/DefinitionsConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/DefinitionsConverterTest.java new file mode 100644 index 00000000000..ad461313111 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/DefinitionsConverterTest.java @@ -0,0 +1,77 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner; + +import org.eclipse.bpmn2.Definitions; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Executable; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessInstanceDescription; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Version; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.Name; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; +import org.kie.workbench.common.stunner.core.graph.impl.GraphImpl; +import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; +import org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl; + +import static org.assertj.core.api.Assertions.assertThat; + +public class DefinitionsConverterTest { + + @Test + public void JBPM_7526_shouldSetExporter() { + GraphNodeStoreImpl nodeStore = new GraphNodeStoreImpl(); + NodeImpl x = new NodeImpl("x"); + BPMNDiagramImpl diag = new BPMNDiagramImpl(); + diag.setDiagramSet(new DiagramSet( + new Name("x"), + new Documentation("doc"), + new Id("x"), + new Package("org.jbpm"), + new Version("1.0"), + new AdHoc(false), + new ProcessInstanceDescription("descr"), + new GlobalVariables(""), + new Imports(), + new Executable(true), + new SLADueDate("") + )); + x.setContent(new ViewImpl<>(diag, Bounds.create())); + nodeStore.add(x); + ConverterFactory f = new ConverterFactory(new DefinitionsBuildingContext( + new GraphImpl("x", nodeStore)), + new PropertyWriterFactory()); + + DefinitionsConverter definitionsConverter = + new DefinitionsConverter(f, new PropertyWriterFactory()); + Definitions definitions = + definitionsConverter.toDefinitions(); + + assertThat(definitions.getExporter()).isNotBlank(); + assertThat(definitions.getExporterVersion()).isNotBlank(); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/activities/ReusableSubprocessConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/activities/ReusableSubprocessConverterTest.java new file mode 100644 index 00000000000..98c5aa5232d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/activities/ReusableSubprocessConverterTest.java @@ -0,0 +1,295 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.activities; + +import org.eclipse.bpmn2.CallActivity; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.CallActivityPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.subProcess.IsCase; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AbortParent; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.CalledElement; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.Independent; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceExecutionMode; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ReusableSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.WaitForCompletion; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; +import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyBoolean; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class ReusableSubprocessConverterTest { + + private static final String UUID = "UUID"; + private static final String NAME = "NAME"; + private static final String DOCUMENTATION = "DOCUMENTATION"; + private static final String CALLED_ELEMENT = "CALLED_ELEMENT"; + private static final Boolean INDEPENDENT = Boolean.TRUE; + private static final Boolean ABORT_PARENT = Boolean.TRUE; + private static final Boolean IS_CASE = Boolean.FALSE; + private static final Boolean WAIT_FOR_COMPLETION = Boolean.TRUE; + private static final Boolean IS_ASYNC = Boolean.TRUE; + private static final Boolean IS_ADHOC_AUTOSTART = Boolean.FALSE; + private static final Boolean IS_MULTIPLE_INSTANCE = Boolean.TRUE; + private static final Boolean SEQUENTIAL = Boolean.TRUE; + private static final String COLLECTION_INPUT = "COLLECTION_INPUT"; + private static final String COLLECTION_OUTPUT = "COLLECTION_OUTPUT"; + private static final String DATA_INPUT = "DATA_INPUT"; + private static final String DATA_OUTPUT = "DATA_OUTPUT"; + private static final String COMPLETION_CONDITION = "COMPLETION_CONDITION"; + private static final OnEntryAction ON_ENTRY_ACTION = new OnEntryAction(); + private static final OnExitAction ON_EXIT_ACTION = new OnExitAction(); + private static final Bounds BOUNDS = Bounds.create(); + private static final SimulationSet SIMULATION_SET = new SimulationSet(); + private static final AssignmentsInfo ASSIGNMENTS_INFO = new AssignmentsInfo(); + private static final String SLA_DUE_DATE = "12/25/1983"; + + @Mock + private PropertyWriterFactory propertyWriterFactory; + + @Mock + private CallActivityPropertyWriter propertyWriter; + + @Captor + private ArgumentCaptor activityCaptor; + + private Node, ?> node; + + private ReusableSubprocessConverter converter; + + @Before + public void setUp() { + when(propertyWriterFactory.of(any(CallActivity.class))).thenReturn(propertyWriter); + + DataIOSet ioSet = mock(DataIOSet.class); + when(ioSet.getAssignmentsinfo()).thenReturn(ASSIGNMENTS_INFO); + final ReusableSubprocess definition = new ReusableSubprocess(new BPMNGeneralSet(NAME, DOCUMENTATION), + new ReusableSubprocessTaskExecutionSet(new CalledElement(CALLED_ELEMENT), + new IsCase(IS_CASE), + new Independent(INDEPENDENT), + new AbortParent(ABORT_PARENT), + new WaitForCompletion(WAIT_FOR_COMPLETION), + new IsAsync(IS_ASYNC), + new AdHocAutostart(IS_ADHOC_AUTOSTART), + new IsMultipleInstance(IS_MULTIPLE_INSTANCE), + new MultipleInstanceExecutionMode(SEQUENTIAL), + new MultipleInstanceCollectionInput(COLLECTION_INPUT), + new MultipleInstanceDataInput(DATA_INPUT), + new MultipleInstanceCollectionOutput(COLLECTION_OUTPUT), + new MultipleInstanceDataOutput(DATA_OUTPUT), + new MultipleInstanceCompletionCondition(COMPLETION_CONDITION), + ON_ENTRY_ACTION, + ON_EXIT_ACTION, + new SLADueDate(SLA_DUE_DATE)), + ioSet, + new BackgroundSet(), + new FontSet(), + new RectangleDimensionsSet(), + SIMULATION_SET); + final View view = new ViewImpl<>(definition, BOUNDS); + node = new NodeImpl<>(UUID); + node.setContent(view); + converter = new ReusableSubprocessConverter(propertyWriterFactory); + } + + // TODO: Kogito - @Test + public void testToFlowElementMI() { + assertEquals(propertyWriter, converter.toFlowElement(node)); + verifyCommonValues(); + verify(propertyWriter).setIsSequential(SEQUENTIAL); + verify(propertyWriter).setCollectionInput(COLLECTION_INPUT); + verify(propertyWriter).setInput(DATA_INPUT); + verify(propertyWriter).setCollectionOutput(COLLECTION_OUTPUT); + verify(propertyWriter).setOutput(DATA_OUTPUT); + verify(propertyWriter).setCompletionCondition(COMPLETION_CONDITION); + } + + // TODO: Kogito - @Test + public void testToFlowElementNonMI() { + // TODO: Kogito - node.getContent().getDefinition().getExecutionSet().getIsMultipleInstance().setValue(false); + assertEquals(propertyWriter, converter.toFlowElement(node)); + verifyCommonValues(); + verify(propertyWriter, never()).setIsSequential(anyBoolean()); + verify(propertyWriter, never()).setCollectionInput(anyString()); + verify(propertyWriter, never()).setInput(anyString()); + verify(propertyWriter, never()).setCollectionOutput(anyString()); + verify(propertyWriter, never()).setOutput(anyString()); + verify(propertyWriter, never()).setCompletionCondition(anyString()); + } + + private void verifyCommonValues() { + verify(propertyWriterFactory).of(activityCaptor.capture()); + assertEquals(UUID, activityCaptor.getValue().getId()); + verify(propertyWriter).setName(NAME); + verify(propertyWriter).setDocumentation(DOCUMENTATION); + verify(propertyWriter).setOnEntryAction(ON_ENTRY_ACTION); + verify(propertyWriter).setOnExitAction(ON_EXIT_ACTION); + verify(propertyWriter).setCalledElement(CALLED_ELEMENT); + verify(propertyWriter).setAsync(IS_ASYNC); + verify(propertyWriter).setIndependent(INDEPENDENT); + verify(propertyWriter).setWaitForCompletion(WAIT_FOR_COMPLETION); + verify(propertyWriter).setAssignmentsInfo(ASSIGNMENTS_INFO); + verify(propertyWriter).setSimulationSet(SIMULATION_SET); + verify(propertyWriter).setAbsoluteBounds(node); + } + + private ReusableSubprocessConverter tested = + new ReusableSubprocessConverter(new PropertyWriterFactory()); + + @Test + public void testToFlowElement_case() { + final BaseReusableSubprocess definition = new ReusableSubprocess(); + definition.getExecutionSet().setIsCase(new IsCase(true)); + final View view = new ViewImpl<>(definition, Bounds.create()); + final Node, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString()); + node.setContent(view); + + final PropertyWriter propertyWriter = tested.toFlowElement(node); + assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter)); + assertTrue(CustomElement.isCase.of(propertyWriter.getFlowElement()).get()); + } + + @Test + public void testToFlowElement_process() { + final BaseReusableSubprocess definition = new ReusableSubprocess(); + final View view = new ViewImpl<>(definition, Bounds.create()); + final Node, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString()); + node.setContent(view); + + final PropertyWriter propertyWriter = tested.toFlowElement(node); + assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter)); + assertFalse(CustomElement.isCase.of(propertyWriter.getFlowElement()).get()); + } + + @Test + public void testToFlowElement_autostart() { + final ReusableSubprocess definition = new ReusableSubprocess(); + definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(true)); + final View view = new ViewImpl<>(definition, Bounds.create()); + final Node, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString()); + node.setContent(view); + + final PropertyWriter propertyWriter = tested.toFlowElement(node); + assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter)); + assertTrue(CustomElement.autoStart.of(propertyWriter.getFlowElement()).get()); + } + + @Test + public void testToFlowElement_notautostart() { + final ReusableSubprocess definition = new ReusableSubprocess(); + definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(false)); + final View view = new ViewImpl<>(definition, Bounds.create()); + final Node, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString()); + node.setContent(view); + + final PropertyWriter propertyWriter = tested.toFlowElement(node); + assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter)); + assertFalse(CustomElement.autoStart.of(propertyWriter.getFlowElement()).get()); + } + + // TODO: Kogito - @Test + public void testToFlowElementWhenIndependentTrueAbortParentTrue() { + testToFlowElementForAbortParent(true, true, true); + } + + // TODO: Kogito - @Test + public void testToFlowElementWhenIndependentTrueAbortParentFalse() { + testToFlowElementForAbortParent(true, false, true); + } + + // TODO: Kogito - @Test + public void testToFlowElementWhenIndependentFalseAbortParentTrue() { + testToFlowElementForAbortParent(false, true, true); + } + + // TODO: Kogito - @Test + public void testToFlowElementWhenIndependentFalseAbortParentFalse() { + testToFlowElementForAbortParent(false, false, false); + } + + private void testToFlowElementForAbortParent(boolean independent, boolean abortParent, boolean expectedAbortParent) { + final ReusableSubprocess definition = new ReusableSubprocess(); + definition.getExecutionSet().setIndependent(new Independent(independent)); + // TODO: Kogito - definition.getExecutionSet().setAbortParent(new AbortParent(abortParent)); + final View view = new ViewImpl<>(definition, Bounds.create()); + final Node, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString()); + node.setContent(view); + + final PropertyWriter propertyWriter = tested.toFlowElement(node); + assertEquals(expectedAbortParent, CustomElement.abortParent.of(propertyWriter.getFlowElement()).get()); + } + + @Test + public void testToFlowElement() { + final ReusableSubprocess definition = new ReusableSubprocess(); + definition.getExecutionSet().setSlaDueDate(new SLADueDate(SLA_DUE_DATE)); + definition.getExecutionSet().setIsAsync(new IsAsync(Boolean.TRUE)); + + final View view = new ViewImpl<>(definition, Bounds.create()); + final Node, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString()); + node.setContent(view); + + final PropertyWriter propertyWriter = tested.toFlowElement(node); + + assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter)); + assertTrue(CustomElement.async.of(propertyWriter.getFlowElement()).get()); + + assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter)); + assertTrue(CustomElement.slaDueDate.of(propertyWriter.getFlowElement()).get().contains(SLA_DUE_DATE)); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AbstractCompensationEventPostConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AbstractCompensationEventPostConverterTest.java new file mode 100644 index 00000000000..5ab257accfb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AbstractCompensationEventPostConverterTest.java @@ -0,0 +1,81 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations; + +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.Event; +import org.eclipse.bpmn2.Process; +import org.junit.Before; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.PostConverterProcessor; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public abstract class AbstractCompensationEventPostConverterTest { + + @Mock + protected ProcessPropertyWriter processWriter; + + @Mock + protected BasePropertyWriter nodeWriter; + + @Mock + protected Node, ?> node; + + @Mock + protected View content; + + protected T event; + + @Mock + protected Event bpmn2Event; + + @Mock + protected CompensateEventDefinition compensateEvent; + + @Mock + protected Process process; + + protected PostConverterProcessor converter; + + @Before + public void setUp() { + event = createEvent(); + when(node.getContent()).thenReturn(content); + when(content.getDefinition()).thenReturn(event); + + bpmn2Event = createBpmn2Event(compensateEvent); + when(nodeWriter.getElement()).thenReturn(bpmn2Event); + when(processWriter.getProcess()).thenReturn(process); + + converter = createConverter(); + } + + public abstract T createEvent(); + + public abstract B createBpmn2Event(CompensateEventDefinition compensateEvent); + + public abstract PostConverterProcessor createConverter(); +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AbstractThrowCompensationEventPostConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AbstractThrowCompensationEventPostConverterTest.java new file mode 100644 index 00000000000..d579e02b1b1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AbstractThrowCompensationEventPostConverterTest.java @@ -0,0 +1,83 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.ThrowEvent; +import org.eclipse.emf.common.util.ECollections; +import org.junit.Before; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.ActivityRef; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.CompensationEventExecutionSet; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.mockito.Mock; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +public abstract class AbstractThrowCompensationEventPostConverterTest + extends AbstractCompensationEventPostConverterTest { + + protected static final String ACTIVITY_REF = "ACTIVITY_REF"; + + @Mock + protected ActivityRef activityRef; + + @Mock + protected Activity activity; + + @Before + public void setUp() { + super.setUp(); + getExecutionSet(event).getActivityRef().setValue(ACTIVITY_REF); + when(activity.getId()).thenReturn(ACTIVITY_REF); + } + + @Override + public ThrowEvent createBpmn2Event(CompensateEventDefinition compensateEvent) { + ThrowEvent throwEvent = mock(ThrowEvent.class); + when(throwEvent.getEventDefinitions()).thenReturn(ECollections.singletonEList(compensateEvent)); + return throwEvent; + } + + public abstract CompensationEventExecutionSet getExecutionSet(T event); + + @Test + @SuppressWarnings("unchecked") + public void testProcessWhenActivityFound() { + when(process.getFlowElements()).thenReturn(ECollections.singletonEList(activity)); + converter.process(processWriter, nodeWriter, (Node) node); + verify(compensateEvent).setActivityRef(activity); + } + + @Test + @SuppressWarnings("unchecked") + public void testProcessWhenActivityNotFound() { + List flowElements = new ArrayList<>(); + when(process.getFlowElements()).thenReturn(ECollections.emptyEList()); + converter.process(processWriter, nodeWriter, (Node) node); + verify(compensateEvent, never()).setActivityRef(activity); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AssociationConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AssociationConverterTest.java new file mode 100644 index 00000000000..560ed0d3a21 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AssociationConverterTest.java @@ -0,0 +1,147 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations; + +import org.eclipse.bpmn2.Association; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.ElementContainer; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.AssociationPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class AssociationConverterTest { + + private static final String EDGE_ID = "EDGE_ID"; + + private static final String SOURCE_NODE_ID = "SOURCE_NODE_ID"; + + private static final String TARGET_NODE_ID = "TARGET_NODE_ID"; + + private static final String ERROR_PATTERN = "BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s"; + + @Mock + private PropertyWriterFactory propertyWriterFactory; + + @Mock + private AssociationPropertyWriter associationPropertyWriter; + + @Mock + private Edge, Node> edge; + + @Mock + private ViewConnector connector; + + @Mock + private Node sourceNode; + + @Mock + private Node targetNode; + + @Mock + private BasePropertyWriter pSrc; + + @Mock + private BasePropertyWriter pTgt; + + @Mock + private ElementContainer process; + + private AssociationConverter converter; + + @Captor + private ArgumentCaptor argumentCaptor; + + @Before + public void setUp() { + when(propertyWriterFactory.of(any(Association.class))).thenReturn(associationPropertyWriter); + when(edge.getUUID()).thenReturn(EDGE_ID); + when(edge.getContent()).thenReturn(connector); + when(edge.getSourceNode()).thenReturn(sourceNode); + when(edge.getTargetNode()).thenReturn(targetNode); + when(sourceNode.getUUID()).thenReturn(SOURCE_NODE_ID); + when(targetNode.getUUID()).thenReturn(TARGET_NODE_ID); + when(process.getChildElement(SOURCE_NODE_ID)).thenReturn(pSrc); + when(process.getChildElement(TARGET_NODE_ID)).thenReturn(pTgt); + converter = new AssociationConverter(propertyWriterFactory); + } + + @Test + public void testToFlowElementSuccess() { + org.kie.workbench.common.stunner.bpmn.definition.Association association = + new org.kie.workbench.common.stunner.bpmn.definition.DirectionalAssociation(); + association.setGeneral(new BPMNGeneralSet("nameValue", "documentationValue")); + when(connector.getDefinition()).thenReturn(association); + + Result result = converter.toFlowElement(edge, process); + + assertTrue(result.isSuccess()); + verify(propertyWriterFactory).of(argumentCaptor.capture()); + assertEquals(EDGE_ID, argumentCaptor.getValue().getId()); + + verify(associationPropertyWriter).setSource(pSrc); + verify(associationPropertyWriter).setTarget(pTgt); + verify(associationPropertyWriter).setConnection(connector); + verify(associationPropertyWriter).setDocumentation("documentationValue"); + verify(associationPropertyWriter).setDirectionAssociation(association); + } + + @Test + public void testToFlowElementWithSourceMissingFailure() { + when(process.getChildElement(SOURCE_NODE_ID)).thenReturn(null); + Result result = converter.toFlowElement(edge, process); + verifyFailure(String.format(ERROR_PATTERN, EDGE_ID, null, pTgt), result); + } + + @Test + public void testToFlowElementWithTargetMissingFailure() { + when(process.getChildElement(TARGET_NODE_ID)).thenReturn(null); + + Result result = converter.toFlowElement(edge, process); + verifyFailure(String.format(ERROR_PATTERN, EDGE_ID, pSrc, null), result); + } + + @Test + public void testToFlowElementWithSourceAndTargetMissingFailure() { + when(process.getChildElement(SOURCE_NODE_ID)).thenReturn(null); + when(process.getChildElement(TARGET_NODE_ID)).thenReturn(null); + Result result = converter.toFlowElement(edge, process); + verifyFailure(String.format(ERROR_PATTERN, EDGE_ID, null, null), result); + } + + private void verifyFailure(String expectedError, Result result) { + assertTrue(result.isFailure()); + assertEquals(expectedError, result.asFailure().reason()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AssociationPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AssociationPropertyWriterTest.java new file mode 100644 index 00000000000..a0c5efc65ee --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/AssociationPropertyWriterTest.java @@ -0,0 +1,132 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations; + +import org.eclipse.bpmn2.Association; +import org.eclipse.bpmn2.AssociationDirection; +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.di.BPMNShape; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.AssociationPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.VariableScope; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.DirectionalAssociation; +import org.kie.workbench.common.stunner.bpmn.definition.NonDirectionalAssociation; +import org.kie.workbench.common.stunner.core.graph.content.view.ControlPoint; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.util.PropertyWriterUtilsTest.assertWaypoint; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.util.PropertyWriterUtilsTest.mockConnector; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.util.PropertyWriterUtilsTest.mockShape; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class AssociationPropertyWriterTest { + + private static final String SOURCE_SHAPE_ID = "SOURCE_SHAPE_ID"; + private static final String TARGET_SHAPE_ID = "TARGET_SHAPE_ID"; + + @Mock + private Association association; + + @Mock + private VariableScope variableScope; + + @Mock + private BasePropertyWriter sourceWriter; + + @Mock + private BaseElement sourceElement; + + @Mock + private BasePropertyWriter targetWriter; + + @Mock + private BaseElement targetElement; + + private AssociationPropertyWriter associationWriter; + + @Before + public void setUp() { + when(sourceWriter.getElement()).thenReturn(sourceElement); + when(targetWriter.getElement()).thenReturn(targetElement); + associationWriter = new AssociationPropertyWriter(association, variableScope); + } + + @Test + public void testSetConnection() { + BPMNShape sourceShape = mockShape(SOURCE_SHAPE_ID, 1, 1, 4, 4); + BPMNShape targetShape = mockShape(TARGET_SHAPE_ID, 10, 10, 4, 4); + when(sourceWriter.getShape()).thenReturn(sourceShape); + when(targetWriter.getShape()).thenReturn(targetShape); + ControlPoint[] controlPoints = new ControlPoint[]{ + new ControlPoint(Point2D.create(3, 3)), + new ControlPoint(Point2D.create(4, 4)), + new ControlPoint(Point2D.create(5, 5)) + }; + ViewConnector connector = mockConnector(1, 1, 10, 10, controlPoints); + associationWriter.setSource(sourceWriter); + associationWriter.setTarget(targetWriter); + associationWriter.setConnection(connector); + + assertNotNull(associationWriter.getEdge()); + assertEquals(association, associationWriter.getEdge().getBpmnElement()); + assertEquals("edge_SOURCE_SHAPE_ID_to_TARGET_SHAPE_ID", associationWriter.getEdge().getId()); + assertWaypoint(2, 2, 0, associationWriter.getEdge().getWaypoint()); + assertWaypoint(3, 3, 1, associationWriter.getEdge().getWaypoint()); + assertWaypoint(4, 4, 2, associationWriter.getEdge().getWaypoint()); + assertWaypoint(5, 5, 3, associationWriter.getEdge().getWaypoint()); + assertWaypoint(20, 20, 4, associationWriter.getEdge().getWaypoint()); + } + + @Test + public void testSetSource() { + associationWriter.setSource(sourceWriter); + verify(association).setSourceRef(sourceElement); + verify(sourceWriter).setTarget(associationWriter); + } + + @Test + public void testSetTarget() { + associationWriter.setTarget(targetWriter); + verify(association).setTargetRef(targetElement); + verify(targetWriter).setSource(associationWriter); + } + + @Test + public void testSetOneDirectionAssociation() { + DirectionalAssociation directionalAssociation = new DirectionalAssociation(); + associationWriter.setDirectionAssociation(directionalAssociation); + verify(association).setAssociationDirection(AssociationDirection.ONE); + } + + @Test + public void testSetNoneDirectionAssociation() { + NonDirectionalAssociation nonDirectionalAssociation = new NonDirectionalAssociation(); + associationWriter.setDirectionAssociation(nonDirectionalAssociation); + verify(association).setAssociationDirection(AssociationDirection.NONE); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/EndCompensationEventPostConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/EndCompensationEventPostConverterTest.java new file mode 100644 index 00000000000..e0e8903edff --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/EndCompensationEventPostConverterTest.java @@ -0,0 +1,49 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.PostConverterProcessor; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events.EndCompensationEventPostConverter; +import org.kie.workbench.common.stunner.bpmn.definition.EndCompensationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.CompensationEventExecutionSet; +import org.mockito.Mock; + +import static org.mockito.Mockito.when; + +public class EndCompensationEventPostConverterTest + extends AbstractThrowCompensationEventPostConverterTest { + + @Mock + private EndCompensationEvent endCompensationEvent; + + @Override + public EndCompensationEvent createEvent() { + CompensationEventExecutionSet executionSet = new CompensationEventExecutionSet(); + when(endCompensationEvent.getExecutionSet()).thenReturn(executionSet); + return endCompensationEvent; + } + + @Override + public CompensationEventExecutionSet getExecutionSet(EndCompensationEvent event) { + return event.getExecutionSet(); + } + + @Override + public PostConverterProcessor createConverter() { + return new EndCompensationEventPostConverter(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/IntermediateCompensationEventPostConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/IntermediateCompensationEventPostConverterTest.java new file mode 100644 index 00000000000..f4f8edbfe48 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/IntermediateCompensationEventPostConverterTest.java @@ -0,0 +1,76 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.emf.common.util.ECollections; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.PostConverterProcessor; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events.IntermediateCompensationEventPostConverter; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +public class IntermediateCompensationEventPostConverterTest + extends AbstractCompensationEventPostConverterTest { + + @Override + public IntermediateCompensationEvent createEvent() { + return new IntermediateCompensationEvent(); + } + + @Override + public CatchEvent createBpmn2Event(CompensateEventDefinition compensateEvent) { + CatchEvent catchEvent = mock(CatchEvent.class); + when(catchEvent.getEventDefinitions()).thenReturn(ECollections.singletonEList(compensateEvent)); + return catchEvent; + } + + @Override + public PostConverterProcessor createConverter() { + return new IntermediateCompensationEventPostConverter(); + } + + @Test + @SuppressWarnings("unchecked") + public void testProcessWhenOutEdgeExists() { + String uuid = "UUID"; + Edge edge = mock(Edge.class); + Node targetNode = mock(Node.class); + when(targetNode.getUUID()).thenReturn(uuid); + List outEdges = new ArrayList<>(); + outEdges.add(edge); + when(node.getOutEdges()).thenReturn(outEdges); + + Activity activity = mock(Activity.class); + when(activity.getId()).thenReturn(uuid); + when(edge.getTargetNode()).thenReturn(targetNode); + when(process.getFlowElements()).thenReturn(ECollections.singletonEList(activity)); + + converter.process(processWriter, nodeWriter, (Node) node); + verify(activity).setIsForCompensation(true); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/IntermediateThrowCompensationEventPostConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/IntermediateThrowCompensationEventPostConverterTest.java new file mode 100644 index 00000000000..72b4b78a652 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/associations/IntermediateThrowCompensationEventPostConverterTest.java @@ -0,0 +1,49 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations; + +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.PostConverterProcessor; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.events.IntermediateThrowCompensationEventPostConverter; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.CompensationEventExecutionSet; +import org.mockito.Mock; + +import static org.mockito.Mockito.when; + +public class IntermediateThrowCompensationEventPostConverterTest + extends AbstractThrowCompensationEventPostConverterTest { + + @Mock + private IntermediateCompensationEventThrowing intermediateCompensationEventThrowing; + + @Override + public IntermediateCompensationEventThrowing createEvent() { + CompensationEventExecutionSet executionSet = new CompensationEventExecutionSet(); + when(intermediateCompensationEventThrowing.getExecutionSet()).thenReturn(executionSet); + return intermediateCompensationEventThrowing; + } + + @Override + public CompensationEventExecutionSet getExecutionSet(IntermediateCompensationEventThrowing event) { + return event.getExecutionSet(); + } + + @Override + public PostConverterProcessor createConverter() { + return new IntermediateThrowCompensationEventPostConverter(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/gateways/GatewayConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/gateways/GatewayConverterTest.java new file mode 100644 index 00000000000..7b682f9ab5d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/gateways/GatewayConverterTest.java @@ -0,0 +1,128 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.gateways; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.GatewayPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.definition.BaseGateway; +import org.kie.workbench.common.stunner.bpmn.definition.EventGateway; +import org.kie.workbench.common.stunner.bpmn.definition.ExclusiveGateway; +import org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway; +import org.kie.workbench.common.stunner.bpmn.definition.ParallelGateway; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.newNode; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class GatewayConverterTest { + + private static final String UUID = "UUID"; + private static final String DEFAULT_ROUTE = "DEFAULT_ROUTE"; + private static final String NAME = "NAME"; + private static final String DOCUMENTATION = "DOCUMENTATION"; + + @Mock + private PropertyWriterFactory propertyWriterFactory; + + @Mock + private GatewayPropertyWriter gatewayPropertyWriter; + + private GatewayConverter converter; + + @Before + public void setUp() { + converter = new GatewayConverter(propertyWriterFactory); + } + + @Test + public void testInclusive() { + InclusiveGateway gateway = new InclusiveGateway(); + gateway.getGeneral().getName().setValue(NAME); + gateway.getGeneral().getDocumentation().setValue(DOCUMENTATION); + gateway.getExecutionSet().getDefaultRoute().setValue(DEFAULT_ROUTE); + + Node, ?> node = newNode(UUID, gateway); + when(propertyWriterFactory.of(any(org.eclipse.bpmn2.InclusiveGateway.class))).thenReturn(gatewayPropertyWriter); + + assertEquals(gatewayPropertyWriter, converter.toFlowElement(node)); + verifyCommonValues(gatewayPropertyWriter, node); + verify(gatewayPropertyWriter).setDefaultRoute(DEFAULT_ROUTE); + verify(gatewayPropertyWriter).setGatewayDirection(node); + } + + @Test + public void testExclusive() { + ExclusiveGateway gateway = new ExclusiveGateway(); + gateway.getGeneral().getName().setValue(NAME); + gateway.getGeneral().getDocumentation().setValue(DOCUMENTATION); + gateway.getExecutionSet().getDefaultRoute().setValue(DEFAULT_ROUTE); + + Node, ?> node = newNode(UUID, gateway); + when(propertyWriterFactory.of(any(org.eclipse.bpmn2.ExclusiveGateway.class))).thenReturn(gatewayPropertyWriter); + + assertEquals(gatewayPropertyWriter, converter.toFlowElement(node)); + verifyCommonValues(gatewayPropertyWriter, node); + verify(gatewayPropertyWriter).setDefaultRoute(DEFAULT_ROUTE); + verify(gatewayPropertyWriter).setGatewayDirection(node); + } + + @Test + public void testParallel() { + ParallelGateway gateway = new ParallelGateway(); + gateway.getGeneral().getName().setValue(NAME); + gateway.getGeneral().getDocumentation().setValue(DOCUMENTATION); + + Node, ?> node = newNode(UUID, gateway); + when(propertyWriterFactory.of(any(org.eclipse.bpmn2.ParallelGateway.class))).thenReturn(gatewayPropertyWriter); + + assertEquals(gatewayPropertyWriter, converter.toFlowElement(node)); + verifyCommonValues(gatewayPropertyWriter, node); + verify(gatewayPropertyWriter).setGatewayDirection(node); + } + + @Test + public void testEvent() { + EventGateway gateway = new EventGateway(); + gateway.getGeneral().getName().setValue(NAME); + gateway.getGeneral().getDocumentation().setValue(DOCUMENTATION); + + Node, ?> node = newNode(UUID, gateway); + when(propertyWriterFactory.of(any(org.eclipse.bpmn2.EventBasedGateway.class))).thenReturn(gatewayPropertyWriter); + + assertEquals(gatewayPropertyWriter, converter.toFlowElement(node)); + verifyCommonValues(gatewayPropertyWriter, node); + } + + @SuppressWarnings("unchecked") + private void verifyCommonValues(PropertyWriter propertyWriter, Node node) { + verify(propertyWriter).setId(UUID); + verify(propertyWriter).setName(NAME); + verify(propertyWriter).setDocumentation(DOCUMENTATION); + verify(propertyWriter).setAbsoluteBounds(node); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/EventSubProcessPostConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/EventSubProcessPostConverterTest.java new file mode 100644 index 00000000000..881d6472519 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/EventSubProcessPostConverterTest.java @@ -0,0 +1,99 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.processes; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.bpmn2.SubProcess; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EndEscalationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventThrowing; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent; +import org.kie.workbench.common.stunner.bpmn.definition.ScriptTask; +import org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.UserTask; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.mockEdge; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.newNode; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class EventSubProcessPostConverterTest { + + @Mock + private ProcessPropertyWriter processWriter; + + @Mock + private BasePropertyWriter nodeWriter; + + @Mock + private Node, Edge> eventSubprocessNode; + + @Mock + private SubProcess subProcess; + + private List outEdges; + + private EventSubProcessPostConverter converter; + + @Before + @SuppressWarnings("unchecked") + public void setUp() { + when(nodeWriter.getElement()).thenReturn(subProcess); + outEdges = new ArrayList<>(); + outEdges.add(mockEdge(mock(Node.class), newNode(new IntermediateTimerEvent()))); + outEdges.add(mockEdge(mock(Node.class), newNode(new UserTask()))); + outEdges.add(mockEdge(mock(Node.class), newNode(new ScriptTask()))); + outEdges.add(mockEdge(mock(Node.class), newNode(new IntermediateSignalEventThrowing()))); + outEdges.add(mockEdge(mock(Node.class), newNode(new EmbeddedSubprocess()))); + outEdges.add(mockEdge(mock(Node.class), newNode(new EndEscalationEvent()))); + + when(eventSubprocessNode.getOutEdges()).thenReturn(outEdges); + + converter = new EventSubProcessPostConverter(); + } + + @Test + @SuppressWarnings("unchecked") + public void testProcessWhenIsForCompensation() { + outEdges.add(mockEdge(mock(Node.class), newNode(new StartCompensationEvent()))); + converter.process(processWriter, nodeWriter, eventSubprocessNode); + verify(subProcess).setIsForCompensation(true); + } + + @Test + @SuppressWarnings("unchecked") + public void testProcessWhenIsNotForCompensation() { + converter.process(processWriter, nodeWriter, eventSubprocessNode); + verify(subProcess, never()).setIsForCompensation(true); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/ProcessConverterDelegateTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/ProcessConverterDelegateTest.java new file mode 100644 index 00000000000..d847377dc89 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/ProcessConverterDelegateTest.java @@ -0,0 +1,197 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.processes; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.ConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.DefinitionsBuildingContext; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.FlowElementPostConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask; +import org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EndCompensationEvent; +import org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventThrowing; +import org.kie.workbench.common.stunner.bpmn.definition.ScriptTask; +import org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent; +import org.kie.workbench.common.stunner.bpmn.definition.UserTask; +import org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2; +import org.kie.workbench.common.stunner.core.TestingGraphMockHandler; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Dock; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; +import org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl; +import org.kie.workbench.common.stunner.core.graph.impl.GraphImpl; +import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; +import org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.assertj.core.api.Assertions.assertThatCode; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2.NODES.LEVEL0_END_NODE; +import static org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2.NODES.LEVEL0_NODE1; +import static org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2.NODES.LEVEL0_NODE2; +import static org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2.NODES.LEVEL0_START_NODE; +import static org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2.NODES.LEVEL1_NODE1; +import static org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2.NODES.LEVEL1_NODE2; +import static org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2.NODES.LEVEL1_SUB_PROCESS1; +import static org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2.NODES.LEVEL2_NODE1; +import static org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2.NODES.LEVEL2_NODE2; +import static org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2.NODES.LEVEL2_SUB_PROCESS1; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class ProcessConverterDelegateTest { + + @Captor + private ArgumentCaptor, ?>> nodeCaptor; + + @Test + public void convertDockedEdges() { + GraphNodeStoreImpl nodes = new GraphNodeStoreImpl(); + GraphImpl g = new GraphImpl("g", nodes); + + NodeImpl root = new NodeImpl<>("root"); + BPMNDiagramImpl bpmnDiagram = new BPMNDiagramImpl(); + root.setContent(new ViewImpl<>(bpmnDiagram, Bounds.create())); + g.addNode(root); + + NodeImpl n = new NodeImpl<>("n"); + EmbeddedSubprocess subProcessNode = new EmbeddedSubprocess(); + n.setContent(new ViewImpl<>(subProcessNode, Bounds.create())); + g.addNode(n); + + NodeImpl e = new NodeImpl<>("e"); + IntermediateErrorEventCatching intermediateErrorEventCatching = new IntermediateErrorEventCatching(); + e.setContent(new ViewImpl<>(intermediateErrorEventCatching, Bounds.create())); + g.addNode(e); + + EdgeImpl edge = new EdgeImpl<>("edge"); + Dock dock = new Dock(); + edge.setContent(dock); + + n.getOutEdges().add(edge); + edge.setSourceNode(n); + e.getInEdges().add(edge); + edge.setTargetNode(e); + + DefinitionsBuildingContext ctx = new DefinitionsBuildingContext(g); + PropertyWriterFactory pwFactory = new PropertyWriterFactory(); + ConverterFactory factory = new ConverterFactory(ctx, pwFactory); + + MyProcessConverter abstractProcessConverter = + new MyProcessConverter(factory); + + ProcessPropertyWriter p = pwFactory.of(bpmn2.createProcess()); + + assertThatCode(() -> { + abstractProcessConverter.convertChildNodes(p, ctx); + abstractProcessConverter.convertEdges(p, ctx); + }).doesNotThrowAnyException(); + } + + @Test + @SuppressWarnings("unchecked") + public void testPostConvertNodes() { + TestingGraphMockHandler graphTestHandler = new TestingGraphMockHandler(); + BPMNDiagramImpl bpmnDiagram = new BPMNDiagramImpl(); + StartNoneEvent level0StartNode = new StartNoneEvent(); + EndNoneEvent level0EndNode = new EndNoneEvent(); + UserTask level0Node1 = new UserTask(); + UserTask level0Node2 = new UserTask(); + EmbeddedSubprocess level1SubProcess1 = new EmbeddedSubprocess(); + ScriptTask level1Node1 = new ScriptTask(); + IntermediateSignalEventThrowing level1Node2 = new IntermediateSignalEventThrowing(); + AdHocSubprocess level2SubProcess1 = new AdHocSubprocess(); + BusinessRuleTask level2Node1 = new BusinessRuleTask(); + EndCompensationEvent level2Node2 = new EndCompensationEvent(); + + TestingGraphInstanceBuilder2.Level2Graph level2Graph = TestingGraphInstanceBuilder2.buildLevel2Graph(graphTestHandler, + bpmnDiagram, + level0StartNode, + level0Node1, + level0Node2, + level0EndNode, + level1SubProcess1, + level1Node1, + level1Node2, + level2SubProcess1, + level2Node1, + level2Node2); + DefinitionsBuildingContext ctx = new DefinitionsBuildingContext(level2Graph.graph); + PropertyWriterFactory writerFactory = new PropertyWriterFactory(); + ConverterFactory factory = spy(new ConverterFactory(ctx, writerFactory)); + FlowElementPostConverter flowElementPostConverter = mock(FlowElementPostConverter.class); + when(factory.flowElementPostConverter()).thenReturn(flowElementPostConverter); + MyProcessConverter abstractProcessConverter = new MyProcessConverter(factory); + ProcessPropertyWriter processWriter = writerFactory.of(bpmn2.createProcess()); + + abstractProcessConverter.postConvertChildNodes(processWriter, ctx); + + verify(flowElementPostConverter, times(10)).postConvert(anyObject(), anyObject(), nodeCaptor.capture()); + Map nodes = new HashMap<>(); + nodes.put(LEVEL0_START_NODE.uuid(), level0StartNode); + nodes.put(LEVEL0_NODE1.uuid(), level0Node1); + nodes.put(LEVEL0_NODE2.uuid(), level0Node2); + nodes.put(LEVEL0_END_NODE.uuid(), level0EndNode); + nodes.put(LEVEL1_SUB_PROCESS1.uuid(), level1SubProcess1); + nodes.put(LEVEL1_NODE1.uuid(), level1Node1); + nodes.put(LEVEL1_NODE2.uuid(), level1Node2); + nodes.put(LEVEL2_SUB_PROCESS1.uuid(), level2SubProcess1); + nodes.put(LEVEL2_NODE1.uuid(), level2Node1); + nodes.put(LEVEL2_NODE2.uuid(), level2Node2); + assertEquals(nodes.size(), nodeCaptor.getAllValues().size()); + + nodes.entrySet().forEach(entry -> { + Optional, ?>> processed = + nodeCaptor.getAllValues() + .stream() + .filter(captured -> entry.getKey().equals(captured.getUUID())) + .findFirst(); + assertTrue("Node: " + entry.getKey() + " was not present in result", processed.isPresent()); + assertEquals(entry.getValue(), processed.get().getContent().getDefinition()); + }); + } + + static class MyProcessConverter extends ProcessConverterDelegate { + + public MyProcessConverter(ConverterFactory converterFactory) { + super(converterFactory); + } + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/RootProcessConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/RootProcessConverterTest.java new file mode 100644 index 00000000000..9bf07bb4494 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/RootProcessConverterTest.java @@ -0,0 +1,140 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.processes; + +import java.util.AbstractMap; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.bpmn2.Process; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.ConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.DefinitionsBuildingContext; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.FlowElementConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.lanes.LaneConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.ProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseManagementSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.definition.Definition; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyBoolean; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class RootProcessConverterTest { + + private RootProcessConverter converter; + private DefinitionsBuildingContext context; + + @Mock + private PropertyWriterFactory propertyWriterFactory; + + @Mock + private ConverterFactory converterFactory; + + @Mock + private Node node; + + @Mock + private Definition content; + + private BPMNDiagramImpl diagram; + + @Mock + private CaseManagementSet caseManagementSet; + + @Mock + private CaseRoles caseRoles; + + @Mock + private CaseFileVariables caseFileVariables; + + @Mock + private ProcessPropertyWriter processPropertyWriter; + + @Mock + private SubProcessConverter subProcessConverter; + + @Mock + private FlowElementConverter viewDefinitionConverter; + + @Mock + private LaneConverter laneConverter; + + @Mock + private CaseIdPrefix caseIdPrefix; + + @Before + public void setUp() throws Exception { + diagram = new BPMNDiagramImpl(); + diagram.setDiagramSet(new DiagramSet()); + diagram.setCaseManagementSet(caseManagementSet); + context = new DefinitionsBuildingContext(node, Stream.of(new AbstractMap.SimpleEntry("uuid", node)).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue))).withRootNode(node); + converter = new RootProcessConverter(context, propertyWriterFactory, converterFactory); + + when(propertyWriterFactory.of(any(Process.class))).thenReturn(processPropertyWriter); + when(node.getContent()).thenReturn(content); + when(content.getDefinition()).thenReturn(diagram); + when(caseManagementSet.getCaseIdPrefix()).thenReturn(caseIdPrefix); + when(caseManagementSet.getCaseRoles()).thenReturn(caseRoles); + when(caseManagementSet.getCaseFileVariables()).thenReturn(caseFileVariables); + when(converterFactory.subProcessConverter()).thenReturn(subProcessConverter); + when(converterFactory.viewDefinitionConverter()).thenReturn(viewDefinitionConverter); + when(converterFactory.laneConverter()).thenReturn(laneConverter); + } + + @Test + public void convertProcessWithCaseProperties() { + final ProcessPropertyWriter propertyWriter = converter.convertProcess(); + verify(propertyWriter).setCaseIdPrefix(caseIdPrefix); + verify(propertyWriter).setCaseRoles(caseRoles); + verify(propertyWriter).setCaseFileVariables(caseFileVariables); + } + + @Test + public void convertProcessWithExecutable() { + final ProcessPropertyWriter propertyWriter = converter.convertProcess(); + verify(propertyWriter).setExecutable(anyBoolean()); + } + + @Test + public void convertProcessWithGlobalVariables() { + final ProcessPropertyWriter propertyWriter = converter.convertProcess(); + verify(propertyWriter).setGlobalVariables(any(GlobalVariables.class)); + } + + @Test + public void convertProcessWithSlaDueDate() { + final ProcessPropertyWriter propertyWriter = converter.convertProcess(); + verify(propertyWriter).setSlaDueDate(any(SLADueDate.class)); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/SubProcessConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/SubProcessConverterTest.java new file mode 100644 index 00000000000..b6fb240da9b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/processes/SubProcessConverterTest.java @@ -0,0 +1,260 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.processes; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.Property; +import org.eclipse.bpmn2.di.BPMNShape; +import org.junit.Before; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.ConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.DefinitionsBuildingContext; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.AdHocSubProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.SubProcessPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.DocumentationTextHandler; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; +import org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.BaseAdHocSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.MultipleInstanceSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Child; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; +import org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl; +import org.kie.workbench.common.stunner.core.graph.impl.GraphImpl; +import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; +import org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl; +import org.uberfire.commons.data.Pair; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; +import static org.mockito.Mockito.mock; + +public class SubProcessConverterTest { + + private static final String ELEMENT_ID = "ELEMENT_ID"; + private static final String NAME = "NAME"; + private static final String DOCUMENTATION = "DOCUMENTATION"; + private static final String ACTIVATION_CONDITION = "ACTIVATION_CONDITION"; + private static final ScriptTypeValue COMPLETION_CONDITION = new ScriptTypeValue("drools", "the condition"); + private static final ScriptTypeValue ON_ENTRY_ACTION = new ScriptTypeValue("java", "on entry script"); + private static final ScriptTypeValue ON_EXIT_ACTION = new ScriptTypeValue("java", "on exit script"); + private static final String SLA_DUE_DATE = "12/25/1983"; + + @Test + public void JBPM_7525_eventSubProcessShouldStoreIsAsync() { + ConverterFactory f = new ConverterFactory(new DefinitionsBuildingContext( + new GraphImpl("x", new GraphNodeStoreImpl())), + new PropertyWriterFactory()); + SubProcessConverter c = f.subProcessConverter(); + + NodeImpl> n = new NodeImpl<>("n"); + EventSubprocess subProcessNode = new EventSubprocess(); + subProcessNode.getExecutionSet().setIsAsync(new IsAsync(true)); + n.setContent(new ViewImpl<>(subProcessNode, Bounds.create())); + + Activity activity = c.convertSubProcess(n).value().getFlowElement(); + Boolean value = CustomElement.async.of(activity).get(); + + assertThat(value).isEqualTo(true); + } + + private SubProcessConverter tested; + + @Before + public void setUp() { + PropertyWriterFactory factory = new PropertyWriterFactory(); + + DefinitionsBuildingContext definitionsBuildingContext = new DefinitionsBuildingContext(new GraphImpl("x", new GraphNodeStoreImpl())); + + tested = new SubProcessConverter(definitionsBuildingContext, + factory, + new ConverterFactory(definitionsBuildingContext, factory)); + } + + @Test + public void testConvertAdHocSubprocessNode_autostart() { + final AdHocSubprocess definition = new AdHocSubprocess(); + definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(true)); + final View view = new ViewImpl<>(definition, Bounds.create()); + final Node, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); + node.setContent(view); + + SubProcessPropertyWriter writer = tested.convertAdHocSubprocessNode(node); + assertTrue(AdHocSubProcessPropertyWriter.class.isInstance(writer)); + assertTrue(CustomElement.autoStart.of(writer.getFlowElement()).get()); + } + + @Test + public void testConvertAdHocSubprocessNode_notautostart() { + final AdHocSubprocess definition = new AdHocSubprocess(); + definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(false)); + final View view = new ViewImpl<>(definition, Bounds.create()); + final Node, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); + node.setContent(view); + + SubProcessPropertyWriter writer = tested.convertAdHocSubprocessNode(node); + assertTrue(AdHocSubProcessPropertyWriter.class.isInstance(writer)); + assertFalse(CustomElement.autoStart.of(writer.getFlowElement()).get()); + } + + private static void setBaseSubprocessExecutionSetValues(BaseSubprocessTaskExecutionSet executionSet) { + executionSet.setIsAsync(new IsAsync(Boolean.TRUE)); + executionSet.setSlaDueDate(new SLADueDate(SLA_DUE_DATE)); + } + + private static void assertBaseSubprocessExecutionSet(SubProcessPropertyWriter writer) { + assertTrue(SubProcessPropertyWriter.class.isInstance(writer)); + assertTrue(CustomElement.async.of(writer.getElement()).get()); + assertTrue(CustomElement.slaDueDate.of(writer.getElement()).get().contains(SLA_DUE_DATE)); + } + + @Test + public void testConvertAdhocSubprocess() { + AdHocSubprocess definition = new AdHocSubprocess(); + String adHocOrdering = "Parallel"; + boolean adHocAutostart = true; + String processVariables = "processVar1:Object,processVar2:Integer"; + definition.getGeneral().getName().setValue(NAME); + definition.getGeneral().getDocumentation().setValue(DOCUMENTATION); + definition.getProcessData().getProcessVariables().setValue(processVariables); + definition.getExecutionSet().getAdHocOrdering().setValue(adHocOrdering); + definition.getExecutionSet().getAdHocAutostart().setValue(adHocAutostart); + definition.getExecutionSet().getAdHocActivationCondition().setValue(ACTIVATION_CONDITION); + definition.getExecutionSet().getAdHocCompletionCondition().setValue(COMPLETION_CONDITION); + definition.getExecutionSet().getOnEntryAction().getValue().addValue(ON_ENTRY_ACTION); + definition.getExecutionSet().getOnExitAction().getValue().addValue(ON_EXIT_ACTION); + setBaseSubprocessExecutionSetValues(definition.getExecutionSet()); + + double nodeX1 = 10; + double nodeY1 = 20; + double nodeX2 = 40; + double nodeY2 = 60; + View view = new ViewImpl<>(definition, Bounds.create(nodeX1, nodeY1, nodeX2, nodeY2)); + Node, Edge> node = new NodeImpl<>(ELEMENT_ID); + node.setContent(view); + double parentX1 = 30; + double parentY1 = 40; + double parentX2 = 60; + double parentY2 = 100; + Node, ?> parent = new NodeImpl<>("parentId"); + View parentView = new ViewImpl<>(null, Bounds.create(parentX1, parentY1, parentX2, parentY2)); + parent.setContent(parentView); + Edge edge = new EdgeImpl("edgeId"); + edge.setContent(mock(Child.class)); + node.getInEdges().add(edge); + edge.setSourceNode(parent); + edge.setTargetNode(node); + + Result result = tested.convertSubProcess(node); + assertTrue(result.isSuccess()); + AdHocSubProcess adHocSubProcess = (AdHocSubProcess) result.value().getElement(); + assertEquals(ELEMENT_ID, adHocSubProcess.getId()); + assertEquals(NAME, adHocSubProcess.getName()); + assertEquals(asCData(NAME), CustomElement.name.of(adHocSubProcess).get()); + assertEquals(asCData(DOCUMENTATION), DocumentationTextHandler.of(adHocSubProcess.getDocumentation().get(0)).getText()); + assertEquals(adHocOrdering, adHocSubProcess.getOrdering().getName()); + assertEquals(adHocAutostart, CustomElement.autoStart.of(adHocSubProcess).get()); + // TODO: Kogito - assertEquals(asCData(ACTIVATION_CONDITION), CustomElement.customActivationCondition.of(adHocSubProcess).get()); + assertEquals(Scripts.LANGUAGE.valueOf(COMPLETION_CONDITION.getLanguage().toUpperCase()).format(), ((FormalExpression) adHocSubProcess.getCompletionCondition()).getLanguage()); + assertEquals(asCData(COMPLETION_CONDITION.getScript()), FormalExpressionBodyHandler.of((FormalExpression) adHocSubProcess.getCompletionCondition()).getBody()); + assertEquals(ON_ENTRY_ACTION.getLanguage(), Scripts.onEntry(adHocSubProcess.getExtensionValues()).getValues().get(0).getLanguage()); + assertEquals(asCData(ON_ENTRY_ACTION.getScript()), Scripts.onEntry(adHocSubProcess.getExtensionValues()).getValues().get(0).getScript()); + assertEquals(ON_EXIT_ACTION.getLanguage(), Scripts.onExit(adHocSubProcess.getExtensionValues()).getValues().get(0).getLanguage()); + assertEquals(asCData(ON_EXIT_ACTION.getScript()), Scripts.onExit(adHocSubProcess.getExtensionValues()).getValues().get(0).getScript()); + assertVariables(Arrays.asList(new Pair<>("processVar1", "Object"), new Pair<>("processVar2", "Integer")), adHocSubProcess.getProperties()); + BPMNShape shape = result.value().getShape(); + assertEquals(parentX1 + nodeX1, shape.getBounds().getX(), 0); + assertEquals(parentY1 + nodeY1, shape.getBounds().getY(), 0); + assertEquals(nodeX2 - nodeX1, shape.getBounds().getWidth(), 0); + assertEquals(nodeY2 - nodeY1, shape.getBounds().getHeight(), 0); + assertBaseSubprocessExecutionSet(result.value()); + } + + @Test + public void testConvertMultipleIntanceSubprocess() { + final MultipleInstanceSubprocess definition = new MultipleInstanceSubprocess(); + setBaseSubprocessExecutionSetValues(definition.getExecutionSet()); + final View view = new ViewImpl<>(definition, Bounds.create()); + final Node, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); + node.setContent(view); + + SubProcessPropertyWriter writer = tested.convertMultipleInstanceSubprocessNode(node); + assertBaseSubprocessExecutionSet(writer); + } + + private static void assertVariables(List> expectedVariables, List properties) { + assertEquals(expectedVariables.size(), properties.size()); + Pair expectedVariable; + Property property; + for (int i = 0; i < expectedVariables.size(); i++) { + expectedVariable = expectedVariables.get(i); + property = properties.get(i); + assertEquals(expectedVariable.getK1(), property.getId()); + assertEquals(expectedVariable.getK1(), property.getName()); + assertEquals(String.format("_%sItem", expectedVariable.getK1()), property.getItemSubjectRef().getId()); + assertEquals(expectedVariable.getK2(), property.getItemSubjectRef().getStructureRef()); + } + } + + @Test + public void testConvertEmbeddedSubprocess() { + final EmbeddedSubprocess definition = new EmbeddedSubprocess(); + setBaseSubprocessExecutionSetValues(definition.getExecutionSet()); + final View view = new ViewImpl<>(definition, Bounds.create()); + final Node, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); + node.setContent(view); + + SubProcessPropertyWriter writer = tested.convertEmbeddedSubprocessNode(node); + assertBaseSubprocessExecutionSet(writer); + } + + @Test + public void testConvertEventSubprocess() { + final EventSubprocess definition = new EventSubprocess(); + setBaseSubprocessExecutionSetValues(definition.getExecutionSet()); + final View view = new ViewImpl<>(definition, Bounds.create()); + final Node, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); + node.setContent(view); + + SubProcessPropertyWriter writer = tested.convertEventSubprocessNode(node); + assertBaseSubprocessExecutionSet(writer); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/AbstractBasePropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/AbstractBasePropertyWriterTest.java new file mode 100644 index 00000000000..de55e26fde6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/AbstractBasePropertyWriterTest.java @@ -0,0 +1,219 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.Documentation; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.RootElement; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.dd.dc.Bounds; +import org.eclipse.emf.common.util.ECollections; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.DocumentationTextHandler; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Child; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public abstract class AbstractBasePropertyWriterTest { + + protected static final String ID = "PARENT_ID"; + protected static final Double X1 = 1d; + protected static final Double Y1 = 2d; + protected static final Double X2 = 10d; + protected static final Double Y2 = 20d; + + protected static final Double PARENT_ABSOLUTE_X1 = 100d; + protected static final Double PARENT_ABSOLUTE_Y1 = 200d; + protected static final Double PARENT_ABSOLUTE_X2 = 150d; + protected static final Double PARENT_ABSOLUTE_Y2 = 260d; + + protected E element; + + @Mock + protected VariableScope variableScope; + + protected W propertyWriter; + + @Before + public void setUp() { + element = mockElement(); + when(element.getId()).thenReturn(ID); + List documentation = new ArrayList<>(); + when(element.getDocumentation()).thenReturn(ECollections.newBasicEList()); + propertyWriter = newPropertyWriter(element, variableScope); + } + + protected abstract W newPropertyWriter(E baseElement, VariableScope variableScope); + + protected abstract E mockElement(); + + @Test + public void testGetId() { + assertEquals(ID, propertyWriter.getId()); + } + + @Test + public void testSetId() { + propertyWriter.setId(ID); + verify(element).setId(ID); + } + + @Test + public void testSetBounds() { + org.kie.workbench.common.stunner.core.graph.content.Bounds bounds = + org.kie.workbench.common.stunner.core.graph.content.Bounds.create(X1, Y1, X2, Y2); + propertyWriter.setBounds(bounds); + + BPMNShape shape = propertyWriter.getShape(); + assertNotNull(shape); + assertEquals("shape_" + ID, shape.getId()); + assertEquals(element, shape.getBpmnElement()); + Bounds shapeBounds = shape.getBounds(); + assertEquals(X1.floatValue(), shapeBounds.getX(), 0); + assertEquals(Y1.floatValue(), shapeBounds.getY(), 0); + assertEquals(X2.floatValue() - X1.floatValue(), shapeBounds.getWidth(), 0); + assertEquals(Y2.floatValue() - Y1.floatValue(), shapeBounds.getHeight(), 0); + } + + @Test + public void testSetAbsoluteBounds() { + testSetAbsoluteBounds(createNode()); + assertFalse(propertyWriter.getShape().isIsExpanded()); + } + + public Node createNode() { + return createNode(new Object()); + } + + public Node createNode(Object definition) { + Node parentNode = mockNode(new Object(), org.kie.workbench.common.stunner.core.graph.content.Bounds.create(PARENT_ABSOLUTE_X1, PARENT_ABSOLUTE_Y1, PARENT_ABSOLUTE_X2, PARENT_ABSOLUTE_Y2)); + return mockNode(definition, org.kie.workbench.common.stunner.core.graph.content.Bounds.create(X1, Y1, X2, Y2), parentNode); + } + + protected void testSetAbsoluteBounds(Node node) { + org.kie.workbench.common.stunner.core.graph.content.Bounds relativeBounds = node.getContent().getBounds(); + double absoluteX = PARENT_ABSOLUTE_X1 + relativeBounds.getUpperLeft().getX(); + double absoluteY = PARENT_ABSOLUTE_Y1 + relativeBounds.getUpperLeft().getY(); + propertyWriter.setAbsoluteBounds(node); + + Bounds shapeBounds = propertyWriter.getShape().getBounds(); + assertEquals(absoluteX, shapeBounds.getX(), 0); + assertEquals(absoluteY, shapeBounds.getY(), 0); + assertEquals(relativeBounds.getWidth(), shapeBounds.getWidth(), 0); + assertEquals(relativeBounds.getHeight(), shapeBounds.getHeight(), 0); + } + + @Test + public void testGetElement() { + assertEquals(element, propertyWriter.getElement()); + } + + @Test + public void testSetNullDocumentation() { + propertyWriter.setDocumentation(null); + assertTrue(element.getDocumentation().isEmpty()); + } + + @Test + public void testSetEmptyDocumentation() { + propertyWriter.setDocumentation(""); + assertTrue(element.getDocumentation().isEmpty()); + } + + @Test + public void testSetNonEmptyDocumentation() { + String value = "some non empty value"; + propertyWriter.setDocumentation(value); + assertEquals(1, element.getDocumentation().size()); + assertEquals("", DocumentationTextHandler.of(element.getDocumentation().get(0)).getText()); + } + + @Test + public void testAddItemDefinition() { + ItemDefinition itemDefinition = mock(ItemDefinition.class); + propertyWriter.addItemDefinition(itemDefinition); + assertTrue(propertyWriter.getItemDefinitions().contains(itemDefinition)); + } + + @Test + public void testAddRootElement() { + RootElement rootElement = mock(RootElement.class); + propertyWriter.addRootElement(rootElement); + assertTrue(propertyWriter.getRootElements().contains(rootElement)); + } + + @Test + public void testAbsoluteBounds() { + double parentAbsoluteX = 100; + double parentAbsoluteY = 300; + Node parentNode = mockNode(new Object(), org.kie.workbench.common.stunner.core.graph.content.Bounds.create(parentAbsoluteX, parentAbsoluteY, 100, 100)); + double childRelativeX = 10; + double childRelativeY = 20; + org.kie.workbench.common.stunner.core.graph.content.Bounds childRelativeBounds = + org.kie.workbench.common.stunner.core.graph.content.Bounds.create(childRelativeX, childRelativeY, 46, 56); + Node node = mockNode(new Object(), childRelativeBounds, parentNode); + + org.kie.workbench.common.stunner.core.graph.content.Bounds expectedResult = + org.kie.workbench.common.stunner.core.graph.content.Bounds.create(parentAbsoluteX + childRelativeX, + parentAbsoluteY + childRelativeY, + parentAbsoluteX + childRelativeX + childRelativeBounds.getWidth(), + parentAbsoluteY + childRelativeY + childRelativeBounds.getHeight()); + assertEquals(expectedResult, BasePropertyWriter.absoluteBounds(node)); + } + + @SuppressWarnings("unchecked") + protected static Node mockNode(Object definition, org.kie.workbench.common.stunner.core.graph.content.Bounds bounds) { + Node node = mock(Node.class); + View view = mock(View.class); + when(node.getContent()).thenReturn(view); + when(view.getBounds()).thenReturn(bounds); + when(view.getDefinition()).thenReturn(definition); + List inEdges = new ArrayList<>(); + when(node.getInEdges()).thenReturn(inEdges); + when(node.asNode()).thenReturn(node); + return node; + } + + @SuppressWarnings("unchecked") + protected static Node mockNode(Object definition, org.kie.workbench.common.stunner.core.graph.content.Bounds bounds, Node parent) { + Node node = (Node) mockNode(definition, bounds); + Child child = mock(Child.class); + Edge edge = mock(Edge.class); + when(edge.getContent()).thenReturn(child); + when(edge.getSourceNode()).thenReturn(parent); + node.getInEdges().add(edge); + return node; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ActivityPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ActivityPropertyWriterTest.java new file mode 100644 index 00000000000..d5539b58588 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ActivityPropertyWriterTest.java @@ -0,0 +1,42 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.List; + +import org.eclipse.bpmn2.InputSet; +import org.eclipse.bpmn2.Task; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class ActivityPropertyWriterTest { + + @Test + public void shouldCreateOneInputSet() { + Task task = bpmn2.createTask(); + ActivityPropertyWriter activityPropertyWriter = + new ActivityPropertyWriter(task, new FlatVariableScope()); + activityPropertyWriter.setAssignmentsInfo(new AssignmentsInfo( + "|A:String|||" + )); + List inputSets = task.getIoSpecification().getInputSets(); + assertEquals(1, inputSets.size()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/AdHocSubProcessPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/AdHocSubProcessPropertyWriterTest.java new file mode 100644 index 00000000000..5085b74bb41 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/AdHocSubProcessPropertyWriterTest.java @@ -0,0 +1,109 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.FormalExpression; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocCompletionCondition; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; + +public class AdHocSubProcessPropertyWriterTest { + + private AdHocSubProcessPropertyWriter tested = new AdHocSubProcessPropertyWriter(bpmn2.createAdHocSubProcess(), + new FlatVariableScope()); + + @Test + public void testSetAdHocAutostart_true() throws Exception { + tested.setAdHocAutostart(Boolean.TRUE); + + assertTrue(CustomElement.autoStart.of(tested.getFlowElement()).get()); + } + + @Test + public void testSetAdHocAutostart_false() throws Exception { + tested.setAdHocAutostart(Boolean.FALSE); + + assertFalse(CustomElement.autoStart.of(tested.getFlowElement()).get()); + } + + /* TODO: Kogito + @Test + public void testSetAdHocActivationCondition() { + tested.setAdHocActivationCondition(new AdHocActivationCondition("condition expression")); + assertEquals(asCData("condition expression"), CustomElement.customActivationCondition.of(tested.getFlowElement()).get()); + } + + @Test + public void testSetAdHocActivationConditionNull() { + tested.setAdHocActivationCondition(new AdHocActivationCondition(null)); + assertEquals("", CustomElement.customActivationCondition.of(tested.getFlowElement()).get()); + } + + @Test + public void testSetAdHocActivationConditionEmpty() { + tested.setAdHocActivationCondition(new AdHocActivationCondition("")); + assertEquals("", CustomElement.customActivationCondition.of(tested.getFlowElement()).get()); + } + */ + + @Test + public void testSetAdHocOrderingSequential() { + tested.setAdHocOrdering(new AdHocOrdering("Sequential")); + assertEquals(org.eclipse.bpmn2.AdHocOrdering.SEQUENTIAL, ((AdHocSubProcess) tested.getFlowElement()).getOrdering()); + } + + @Test + public void testSetAdHocOrderingParallel() { + tested.setAdHocOrdering(new AdHocOrdering("Parallel")); + assertEquals(org.eclipse.bpmn2.AdHocOrdering.PARALLEL, ((AdHocSubProcess) tested.getFlowElement()).getOrdering()); + } + + @Test + public void testSetAdHocCompletionCondition() { + AdHocCompletionCondition condition = new AdHocCompletionCondition(new ScriptTypeValue("java", "some code")); + tested.setAdHocCompletionCondition(condition); + FormalExpression expression = (FormalExpression) ((AdHocSubProcess) tested.getFlowElement()).getCompletionCondition(); + assertEquals(condition.getValue().getLanguage(), Scripts.scriptLanguageFromUri(expression.getLanguage())); + assertEquals(asCData(condition.getValue().getScript()), FormalExpressionBodyHandler.of(expression).getBody()); + } + + @Test + public void testSetAsync() { + tested.setAsync(true); + assertTrue(CustomElement.async.of(tested.getFlowElement()).get()); + } + + @Test + public void testSetSlaDueDate() { + String slaDueDate = "12/25/1983"; + tested.setSlaDueDate(new SLADueDate(slaDueDate)); + + assertTrue(CustomElement.slaDueDate.of(tested.getFlowElement()).get().contains(slaDueDate)); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BasePropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BasePropertyWriterTest.java new file mode 100644 index 00000000000..a6d32b245bb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BasePropertyWriterTest.java @@ -0,0 +1,45 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.BaseElement; + +import static org.mockito.Mockito.mock; + +/** + * Intended only for testing the abstract BasePropertyWriter class methods, other property writer tests must extend + * AbstractBasePropertyWriterTest. + */ +public class BasePropertyWriterTest extends AbstractBasePropertyWriterTest { + + @Override + protected BasePropertyWriter newPropertyWriter(BaseElement baseElement, VariableScope variableScope) { + return new BasePropertyWriterMock(baseElement, variableScope); + } + + @Override + protected BaseElement mockElement() { + return mock(BaseElement.class); + } + + private class BasePropertyWriterMock extends BasePropertyWriter { + + BasePropertyWriterMock(BaseElement baseElement, VariableScope variableScope) { + super(baseElement, variableScope); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BoundaryEventPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BoundaryEventPropertyWriterTest.java new file mode 100644 index 00000000000..b89f160dff5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/BoundaryEventPropertyWriterTest.java @@ -0,0 +1,156 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.dd.dc.Bounds; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.junit.Ignore; +import org.junit.Test; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Dock; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +// TODO: Kogito +@Ignore +public class BoundaryEventPropertyWriterTest extends AbstractBasePropertyWriterTest { + + @Mock + private FeatureMap featureMap; + + @Captor + private ArgumentCaptor entryCaptor; + + @Override + protected BoundaryEventPropertyWriter newPropertyWriter(BoundaryEvent baseElement, VariableScope variableScope) { + return new BoundaryEventPropertyWriter(baseElement, variableScope); + } + + @Override + protected BoundaryEvent mockElement() { + BoundaryEvent eventMock = mock(BoundaryEvent.class); + when(eventMock.getAnyAttribute()).thenReturn(featureMap); + return eventMock; + } + + @Test + public void testSetCancelActivityTrue() { + testSetCancelActivity(true); + } + + @Test + public void testSetCancelActivityFalse() { + testSetCancelActivity(false); + } + + private void testSetCancelActivity(boolean value) { + propertyWriter.setCancelActivity(value); + verify(featureMap).add(entryCaptor.capture()); + assertEquals(String.format("drools:boundaryca=%s", value), entryCaptor.getValue().toString()); + verify(element).setCancelActivity(value); + } + + @Test + public void testSetParentActivity() { + ActivityPropertyWriter parentActivityWriter = mock(ActivityPropertyWriter.class); + Activity activity = mock(Activity.class); + when(parentActivityWriter.getFlowElement()).thenReturn(activity); + propertyWriter.setParentActivity(parentActivityWriter); + verify(element).setAttachedToRef(activity); + } + + @Test + @SuppressWarnings("unchecked") + public void testAddEventDefinition() { + EList eventDefinitions = spy(ECollections.newBasicEList()); + when(element.getEventDefinitions()).thenReturn(eventDefinitions); + EventDefinition eventDefinition = mock(EventDefinition.class); + propertyWriter.addEventDefinition(eventDefinition); + verify(eventDefinitions).add(eventDefinition); + } + + @Test + @SuppressWarnings("unchecked") + public void testSetAbsoluteBounds() { + Node node = (Node) super.createNode(); + Node dockSourceParentNode = mockNode(new Object(), org.kie.workbench.common.stunner.core.graph.content.Bounds.create(PARENT_ABSOLUTE_X1, PARENT_ABSOLUTE_Y1, PARENT_ABSOLUTE_X2, PARENT_ABSOLUTE_Y2)); + double dockSourceRelativeX1 = 15d; + double dockSourceRelativeY1 = 20d; + double dockSourceRelativeX2 = 50d; + double dockSourceAbsoluteY2 = 45d; + Node dockSourceNode = mockNode(new Object(), org.kie.workbench.common.stunner.core.graph.content.Bounds.create(dockSourceRelativeX1, dockSourceRelativeY1, dockSourceRelativeX2, dockSourceAbsoluteY2), dockSourceParentNode); + + Edge dockEdge = mock(Edge.class); + when(dockEdge.getSourceNode()).thenReturn(dockSourceNode); + Dock dock = mock(Dock.class); + when(dockEdge.getContent()).thenReturn(dock); + node.getInEdges().clear(); + node.getInEdges().add(dockEdge); + + propertyWriter.setAbsoluteBounds(node); + Bounds shapeBounds = propertyWriter.getShape().getBounds(); + org.kie.workbench.common.stunner.core.graph.content.Bounds relativeBounds = node.getContent().getBounds(); + double dockSourceAbsoluteX = PARENT_ABSOLUTE_X1 + dockSourceRelativeX1; + double dockSourceAbsoluteY = PARENT_ABSOLUTE_Y1 + dockSourceRelativeY1; + assertEquals(dockSourceAbsoluteX + relativeBounds.getX(), shapeBounds.getX(), 0); + assertEquals(dockSourceAbsoluteY + relativeBounds.getY(), shapeBounds.getY(), 0); + assertEquals(relativeBounds.getWidth(), shapeBounds.getWidth(), 0); + assertEquals(relativeBounds.getHeight(), shapeBounds.getHeight(), 0); + + verifyDockerInfoWasSet(relativeBounds); + } + + @Test + @SuppressWarnings("unchecked") + public void testSetAbsoluteBoundsWhenDockedSourceNodeIsNotPresent() { + //no dock source is set + Node node = (Node) super.createNode(); + org.kie.workbench.common.stunner.core.graph.content.Bounds relativeBounds = node.getContent().getBounds(); + double absoluteX = PARENT_ABSOLUTE_X1 + relativeBounds.getUpperLeft().getX(); + double absoluteY = PARENT_ABSOLUTE_Y1 + relativeBounds.getUpperLeft().getY(); + + propertyWriter.setAbsoluteBounds(node); + + Bounds shapeBounds = propertyWriter.getShape().getBounds(); + assertEquals(absoluteX, shapeBounds.getX(), 0); + assertEquals(absoluteY, shapeBounds.getY(), 0); + assertEquals(relativeBounds.getWidth(), shapeBounds.getWidth(), 0); + assertEquals(relativeBounds.getHeight(), shapeBounds.getHeight(), 0); + + verifyDockerInfoWasSet(relativeBounds); + } + + private void verifyDockerInfoWasSet(org.kie.workbench.common.stunner.core.graph.content.Bounds relativeBounds) { + verify(featureMap).add(entryCaptor.capture()); + assertEquals(String.format("drools:dockerinfo=%s^%s|", relativeBounds.getUpperLeft().getX(), relativeBounds.getUpperLeft().getY()), + entryCaptor.getValue().toString()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/CallActivityPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/CallActivityPropertyWriterTest.java new file mode 100644 index 00000000000..538e4098f4a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/CallActivityPropertyWriterTest.java @@ -0,0 +1,84 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class CallActivityPropertyWriterTest { + + private CallActivityPropertyWriter tested = + new CallActivityPropertyWriter(bpmn2.createCallActivity(), + new FlatVariableScope()); + + @Test + public void testSetCase_true() throws Exception { + tested.setCase(Boolean.TRUE); + + assertTrue(CustomElement.isCase.of(tested.getFlowElement()).get()); + } + + @Test + public void testSetCase_false() throws Exception { + tested.setCase(Boolean.FALSE); + + assertFalse(CustomElement.isCase.of(tested.getFlowElement()).get()); + } + + @Test + public void testSetAdHocAutostart_true() throws Exception { + tested.setAdHocAutostart(Boolean.TRUE); + + assertTrue(CustomElement.autoStart.of(tested.getFlowElement()).get()); + } + + @Test + public void testSetAdHocAutostart_false() throws Exception { + tested.setAdHocAutostart(Boolean.FALSE); + + assertFalse(CustomElement.autoStart.of(tested.getFlowElement()).get()); + } + + @Test + public void testAbortParentTrue() { + tested.setAbortParent(true); + } + + @Test + public void testAbortParentFalse() { + tested.setAbortParent(false); + } + + @Test + public void testSetIsAsync() { + tested.setAsync(Boolean.TRUE); + assertTrue(CustomElement.async.of(tested.getFlowElement()).get()); + } + + @Test + public void testSetSlaDueDate() { + String slaDueDate = "12/25/1983"; + tested.setSlaDueDate(new SLADueDate(slaDueDate)); + + assertTrue(CustomElement.slaDueDate.of(tested.getFlowElement()).get().contains(slaDueDate)); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/CatchEventPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/CatchEventPropertyWriterTest.java new file mode 100644 index 00000000000..76ee7894b20 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/CatchEventPropertyWriterTest.java @@ -0,0 +1,46 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import bpsim.ElementParameters; +import org.eclipse.bpmn2.StartEvent; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationAttributeSet; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class CatchEventPropertyWriterTest { + + @Test + public void simulationSetMustHaveElementRef() { + String elementId = "MY_ID"; + StartEvent startEvent = bpmn2.createStartEvent(); + startEvent.setId(elementId); + + CatchEventPropertyWriter p = + new CatchEventPropertyWriter( + startEvent, + new FlatVariableScope()); + + SimulationAttributeSet defaults = new SimulationAttributeSet(); + p.setSimulationSet(defaults); + + ElementParameters simulationParameters = p.getSimulationParameters(); + assertEquals(elementId, simulationParameters.getElementRef()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/EmbeddedSubprocessPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/EmbeddedSubprocessPropertyWriterTest.java new file mode 100644 index 00000000000..da433335861 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/EmbeddedSubprocessPropertyWriterTest.java @@ -0,0 +1,44 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; + +import static junit.framework.TestCase.assertTrue; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class EmbeddedSubprocessPropertyWriterTest { + + private SubProcessPropertyWriter tested = new SubProcessPropertyWriter(bpmn2.createSubProcess(), + new FlatVariableScope()); + + @Test + public void testSetIsAsync() { + tested.setAsync(Boolean.TRUE); + assertTrue(CustomElement.async.of(tested.getFlowElement()).get()); + } + + @Test + public void testSetSlaDueDate() { + String slaDueDate = "12/25/1983"; + tested.setSlaDueDate(new SLADueDate(slaDueDate)); + + assertTrue(CustomElement.slaDueDate.of(tested.getFlowElement()).get().contains(slaDueDate)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/EventSubprocessPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/EventSubprocessPropertyWriterTest.java new file mode 100644 index 00000000000..9d8227cc5b3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/EventSubprocessPropertyWriterTest.java @@ -0,0 +1,44 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; + +import static junit.framework.TestCase.assertTrue; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class EventSubprocessPropertyWriterTest { + + private SubProcessPropertyWriter tested = new SubProcessPropertyWriter(bpmn2.createSubProcess(), + new FlatVariableScope()); + + @Test + public void testSetIsAsync() { + tested.setAsync(Boolean.TRUE); + assertTrue(CustomElement.async.of(tested.getFlowElement()).get()); + } + + @Test + public void testSetSlaDueDate() { + String slaDueDate = "12/25/1983"; + tested.setSlaDueDate(new SLADueDate(slaDueDate)); + + assertTrue(CustomElement.slaDueDate.of(tested.getFlowElement()).get().contains(slaDueDate)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/FlatVariableScopeTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/FlatVariableScopeTest.java new file mode 100644 index 00000000000..e1215ada60c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/FlatVariableScopeTest.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.Optional; +import java.util.UUID; + +import org.junit.Before; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Ids; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +public class FlatVariableScopeTest { + + private FlatVariableScope tested; + private String scope = "scope"; + private String id = "id"; + private String type = "type"; + + @Before + public void setUp() { + tested = new FlatVariableScope(); + } + + @Test + public void declareAndlookup() { + tested.declare(scope, id, type); + + Optional lookup = tested.lookup(id); + VariableScope.Variable variable = lookup.get(); + assertEquals(scope, variable.getParentScopeId()); + assertEquals(Ids.item(id), variable.getTypeDeclaration().getId()); + assertEquals(type, variable.getTypeDeclaration().getStructureRef()); + } + + @Test + public void lookupNotFound() { + Optional variable = tested.lookup(UUID.randomUUID().toString()); + assertFalse(variable.isPresent()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/GatewayPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/GatewayPropertyWriterTest.java new file mode 100644 index 00000000000..4b45a10f2a6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/GatewayPropertyWriterTest.java @@ -0,0 +1,188 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.bpmn2.ExclusiveGateway; +import org.eclipse.bpmn2.Gateway; +import org.eclipse.bpmn2.GatewayDirection; +import org.eclipse.bpmn2.InclusiveGateway; +import org.eclipse.bpmn2.SequenceFlow; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.junit.Ignore; +import org.junit.Test; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +// TODO: Kogito +@Ignore +public class GatewayPropertyWriterTest extends AbstractBasePropertyWriterTest { + + private static final String SEQUENCE_ID = "SEQUENCE_ID"; + + @Mock + private FeatureMap featureMap; + + @Captor + private ArgumentCaptor entryCaptor; + + @Mock + private PropertyWriter anotherPropertyWriter; + + @Mock + private SequenceFlow sequenceFlow; + + @Override + protected GatewayPropertyWriter newPropertyWriter(Gateway baseElement, VariableScope variableScope) { + return new GatewayPropertyWriter(baseElement, variableScope); + } + + @Override + protected Gateway mockElement() { + return mockGateway(Gateway.class, ID); + } + + @Test + public void testSetDefaultRoute() { + testSetDefaultRoute("defaultRoute", "defaultRoute"); + } + + @Test + public void testSetDefaultRouteWithPrefix() { + testSetDefaultRoute("prefix : defaultRoute", "defaultRoute"); + } + + @Test + public void testSetDefaultRouteNull() { + propertyWriter.setDefaultRoute(null); + verify(featureMap, never()).add(any()); + } + + private void testSetDefaultRoute(String defaultRoute, String expectedGatewayId) { + propertyWriter.setDefaultRoute(defaultRoute); + verify(featureMap).add(entryCaptor.capture()); + assertEquals(String.format("drools:dg=%s", defaultRoute), entryCaptor.getValue().toString()); + assertEquals(expectedGatewayId, propertyWriter.getDefaultGatewayId()); + } + + @Test + public void testSetSourceForExclusiveGateway() { + ExclusiveGateway exclusiveGateway = mockGateway(ExclusiveGateway.class, ID); + prepareTestSetSourceOrTarget(exclusiveGateway); + propertyWriter.setSource(anotherPropertyWriter); + verify(exclusiveGateway).setDefault(sequenceFlow); + } + + @Test + public void testSetSourceForInclusiveGateway() { + InclusiveGateway inclusiveGateway = mockGateway(InclusiveGateway.class, ID); + prepareTestSetSourceOrTarget(inclusiveGateway); + propertyWriter.setSource(anotherPropertyWriter); + verify(inclusiveGateway).setDefault(sequenceFlow); + } + + @Test + public void testSetTargetForExclusiveGateway() { + ExclusiveGateway exclusiveGateway = mockGateway(ExclusiveGateway.class, ID); + prepareTestSetSourceOrTarget(exclusiveGateway); + propertyWriter.setTarget(anotherPropertyWriter); + verify(exclusiveGateway).setDefault(sequenceFlow); + } + + @Test + public void testSetTargetForInclusiveGateway() { + InclusiveGateway inclusiveGateway = mockGateway(InclusiveGateway.class, ID); + prepareTestSetSourceOrTarget(inclusiveGateway); + propertyWriter.setTarget(anotherPropertyWriter); + verify(inclusiveGateway).setDefault(sequenceFlow); + } + + private void prepareTestSetSourceOrTarget(Gateway gateway) { + when(sequenceFlow.getId()).thenReturn(SEQUENCE_ID); + when(anotherPropertyWriter.getElement()).thenReturn(sequenceFlow); + propertyWriter = new GatewayPropertyWriter(gateway, variableScope); + propertyWriter.setDefaultRoute(SEQUENCE_ID); + } + + @Test + public void testSetGatewayDirectionWithDivergingNode() { + Node node = mockNode(1, 2); + propertyWriter.setGatewayDirection(node); + verify(element).setGatewayDirection(GatewayDirection.DIVERGING); + } + + @Test + public void testSetGatewayDirectionWithConvergingNode() { + Node node = mockNode(2, 1); + propertyWriter.setGatewayDirection(node); + verify(element).setGatewayDirection(GatewayDirection.CONVERGING); + } + + @Test + public void testSetGatewayDirectionWithNotConfiguredNode() { + Node node = mockNode(0, 0); + propertyWriter.setGatewayDirection(node); + verify(element).setGatewayDirection(GatewayDirection.UNSPECIFIED); + } + + @Test + public void testSetGatewayDirection() { + GatewayDirection randomDirection = GatewayDirection.CONVERGING; + propertyWriter.setGatewayDirection(randomDirection); + verify(element).setGatewayDirection(randomDirection); + } + + protected T mockGateway(Class classToMock, String id) { + T gateway = mock(classToMock); + when(gateway.getAnyAttribute()).thenReturn(featureMap); + when(gateway.getId()).thenReturn(id); + return gateway; + } + + private Node mockNode(int inEdgesSize, int outEdgesSize) { + Node node = mock(Node.class); + List inEdges = new ArrayList<>(); + when(node.getInEdges()).thenReturn(inEdges); + Edge edge; + for (int i = 0; i < inEdgesSize; i++) { + edge = mock(Edge.class); + when(edge.getContent()).thenReturn(mock(ViewConnector.class)); + inEdges.add(edge); + } + List outEdges = new ArrayList<>(); + when(node.getOutEdges()).thenReturn(outEdges); + for (int i = 0; i < outEdgesSize; i++) { + edge = mock(Edge.class); + when(edge.getContent()).thenReturn(mock(ViewConnector.class)); + outEdges.add(edge); + } + return node; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/GenericServiceTaskPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/GenericServiceTaskPropertyWriterTest.java new file mode 100644 index 00000000000..d58767e3737 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/GenericServiceTaskPropertyWriterTest.java @@ -0,0 +1,91 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.ServiceTask; +import org.junit.Before; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class GenericServiceTaskPropertyWriterTest { + + private final static String SLA_DUE_DATE = "12/25/1983"; + private final static String SLA_DUE_DATE_CDATA = ""; + + private GenericServiceTaskPropertyWriter w; + + private ServiceTask serviceTask = bpmn2.createServiceTask(); + + private GenericServiceTaskValue value; + + @Before + public void setUp() { + PropertyWriterFactory writerFactory = new PropertyWriterFactory(); + w = writerFactory.of(serviceTask); + value = new GenericServiceTaskValue("Java", + "serviceInterface", + "serviceOperation", + "inMessageStructure", + "outMessagetructure"); + } + + @Test + public void setAndTestJava() { + w.setValue(value); + w.setSLADueDate(SLA_DUE_DATE); + w.setAsync(false); + w.setAdHocAutostart(false); + w.setAssignmentsInfo(new AssignmentsInfo()); + + assertServiceTaskProperties("Java"); + assertEquals(SLA_DUE_DATE_CDATA, CustomElement.slaDueDate.of(serviceTask).get()); + assertEquals(false, CustomElement.async.of(serviceTask).get()); + assertEquals(false, CustomElement.autoStart.of(serviceTask).get()); + assertNotNull(Scripts.onEntry(serviceTask)); + } + + private void assertServiceTaskProperties(String serviceImplementation) { + assertEquals(serviceImplementation, CustomAttribute.serviceImplementation.of(serviceTask).get()); + assertEquals("serviceOperation", CustomAttribute.serviceOperation.of(serviceTask).get()); + assertEquals("serviceInterface", CustomAttribute.serviceInterface.of(serviceTask).get()); + assertEquals("serviceOperation", serviceTask.getOperationRef().getName()); + assertEquals("inMessageStructure", serviceTask.getOperationRef().getInMessageRef().getItemRef().getStructureRef()); + assertEquals("outMessagetructure", serviceTask.getOperationRef().getOutMessageRef().getItemRef().getStructureRef()); + } + + @Test + public void setAndTestWebService() { + value.setServiceImplementation("WebServicee"); + w.setValue(value); + w.setSLADueDate(SLA_DUE_DATE); + w.setAsync(false); + w.setAdHocAutostart(false); + + assertServiceTaskProperties("WebServicee"); + assertEquals(SLA_DUE_DATE_CDATA, CustomElement.slaDueDate.of(serviceTask).get()); + assertEquals(false, CustomElement.async.of(serviceTask).get()); + assertEquals(false, CustomElement.autoStart.of(serviceTask).get()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/InitializedVariableTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/InitializedVariableTest.java new file mode 100644 index 00000000000..6f6af1c146e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/InitializedVariableTest.java @@ -0,0 +1,153 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.io.UnsupportedEncodingException; +import java.util.List; + +import com.google.gwt.safehtml.shared.UriUtils; +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.impl.PropertyImpl; +import org.junit.Before; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.InitializedVariable; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.VariableDeclaration; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Ids; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; + +public class InitializedVariableTest { + + private VariableScope varScope; + + // TODO: Kogito - @Test + public void urlDecodeConstants() throws UnsupportedEncodingException { + String expected = "<<<#!!!#>>>"; + String encoded = UriUtils.encode(expected); + + VariableDeclaration variable = new VariableDeclaration("PARENT_ID", "Object"); + InitializedVariable.InputConstant c = new InitializedVariable.InputConstant("PARENT", variable, encoded); + + Assignment assignment = c.getDataInputAssociation().getAssignment().get(0); + + FormalExpression to = (FormalExpression) assignment.getTo(); + assertEquals(Ids.dataInput("PARENT", "PARENT_ID"), FormalExpressionBodyHandler.of(to).getBody()); + + FormalExpression from = (FormalExpression) assignment.getFrom(); + assertEquals(asCData(expected), from.getBody()); + } + + @Before + public void setup() { + varScope = new FlatVariableScope(); + varScope.declare("", "BooleanSource", "Boolean"); + varScope.declare("", "BooleanTarget", "Boolean"); + } + + @Test + public void testGetDataInput() { + + final String SOURCE_VAR = "BooleanSource"; + final String DATA_INPUT_ID = "_Data-Input-TestInputX"; + final String DATA_INPUT_NAME = "Data Input Test"; + final String DATA_INPUT_ASSOCIATION_ID = "Data Input Test"; + final String DATA_INPUT_ASSOCIATION_VALUE = "BooleanSource"; + final String INIT_INPUT_VAR_ID = "Data-Input-Test"; + final String INIT_INPUT_VAR_TYPE = "Boolean"; + + final VariableDeclaration varDeclaration = new VariableDeclaration("Data Input Test", "Boolean"); + + InitializedVariable.InitializedInputVariable initializedInputVar = + new InitializedVariable.InputVariableReference( + "", + varScope, + varDeclaration, + SOURCE_VAR + ); + + DataInput dataInput = initializedInputVar.getDataInput(); + + DataInputAssociation dataInputAssociation = initializedInputVar.getDataInputAssociation(); + List sourceRef = dataInputAssociation.getSourceRef(); + PropertyImpl source = (PropertyImpl) sourceRef.get(0); + DataInput target = (DataInput) dataInputAssociation.getTargetRef(); + + String dataInputId = dataInput.getId(); + String dataInputName = dataInput.getName(); + String dataInputAssociationID = target.getName(); + String dataInputAssociationValue = source.getId(); + String initVarID = initializedInputVar.getIdentifier(); + String initVarType = initializedInputVar.getType(); + + assertEquals(dataInputId, DATA_INPUT_ID); + assertEquals(dataInputName, DATA_INPUT_NAME); + assertEquals(dataInputAssociationID, DATA_INPUT_ASSOCIATION_ID); + assertEquals(dataInputAssociationValue, DATA_INPUT_ASSOCIATION_VALUE); + assertEquals(initVarID, INIT_INPUT_VAR_ID); + assertEquals(initVarType, INIT_INPUT_VAR_TYPE); + } + + @Test + public void testGetDataOuput() { + final VariableDeclaration varDeclaration = new VariableDeclaration("Data Output Test", "Boolean"); + final String TARGET_VAR = "BooleanTarget"; + + final String DATA_OUTPUT_ID = "_Data-Output-TestOutputX"; + final String DATA_OUTPUT_NAME = "Data Output Test"; + final String DATA_OUTPUT_ASSOCIATION_ID = "Data Output Test"; + final String DATA_OUTPUT_ASSOCIATION_VALUE = "BooleanTarget"; + final String INIT_OUTPUT_VAR_ID = "Data-Output-Test"; + final String INIT_OUTPUT_VAR_TYPE = "Boolean"; + + InitializedVariable.InitializedOutputVariable initializedOutputVar = + new InitializedVariable.OutputVariableReference( + "", + varScope, + varDeclaration, + TARGET_VAR + ); + + DataOutput dataOuput = initializedOutputVar.getDataOutput(); + + DataOutputAssociation dataOutputAssociation = initializedOutputVar.getDataOutputAssociation(); + List sourceRef = dataOutputAssociation.getSourceRef(); + DataOutput source = (DataOutput) sourceRef.get(0); + PropertyImpl target = (PropertyImpl) dataOutputAssociation.getTargetRef(); + + String dataOuputID = dataOuput.getId(); + String dataOutputName = dataOuput.getName(); + String dataOutputAssociationID = source.getName(); + String dataOutputAssocationValue = target.getId(); + String initVarID = initializedOutputVar.getIdentifier(); + String initVarType = initializedOutputVar.getType(); + + assertEquals(dataOuputID, DATA_OUTPUT_ID); + assertEquals(dataOutputName, DATA_OUTPUT_NAME); + assertEquals(dataOutputAssociationID, DATA_OUTPUT_ASSOCIATION_ID); + assertEquals(dataOutputAssocationValue, DATA_OUTPUT_ASSOCIATION_VALUE); + assertEquals(initVarID, INIT_OUTPUT_VAR_ID); + assertEquals(initVarType, INIT_OUTPUT_VAR_TYPE); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/LanePropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/LanePropertyWriterTest.java new file mode 100644 index 00000000000..59a0c37b195 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/LanePropertyWriterTest.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.apache.commons.lang3.StringEscapeUtils; +import org.eclipse.bpmn2.Lane; +import org.junit.Ignore; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.DocumentationTextHandler; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; + +// TODO: Kogito +@Ignore +public class LanePropertyWriterTest { + + @Test + public void JBPM_7523_shouldPreserveNameChars() { + Lane lane = bpmn2.createLane(); + + PropertyWriterFactory writerFactory = new PropertyWriterFactory(); + LanePropertyWriter w = writerFactory.of(lane); + + String aWeirdName = " XXX !!@@ <><> "; + String aWeirdDoc = " XXX !!@@ <><> Docs "; + w.setName(aWeirdName); + w.setDocumentation(aWeirdDoc); + + assertThat(lane.getName()).isEqualTo(StringEscapeUtils.escapeXml10(aWeirdName.trim())); + assertThat(CustomElement.name.of(lane).get()).isEqualTo(asCData(aWeirdName)); + assertThat(DocumentationTextHandler.of(lane.getDocumentation().get(0)).getText()).isEqualTo(asCData(aWeirdDoc)); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/MultipleInstanceActivityPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/MultipleInstanceActivityPropertyWriterTest.java new file mode 100644 index 00000000000..182dbe8f779 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/MultipleInstanceActivityPropertyWriterTest.java @@ -0,0 +1,240 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.DataAssociation; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics; +import org.eclipse.bpmn2.Property; +import org.junit.Before; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class MultipleInstanceActivityPropertyWriterTest { + + private static final String ACTIVITY_ID = "ACTIVITY_ID"; + private static final String PROPERTY_ID = "PROPERTY_ID"; + private static final String ITEM_ID = "ITEM_ID"; + private static final String IN_COLLECTION = "IN_COLLECTION"; + private static final String OUT_COLLECTION = "OUT_COLLECTION"; + private static final String INPUT_VARIABLE_ID = "INPUT_VARIABLE_ID"; + private static final String OUTPUT_VARIABLE_ID = "OUTPUT_VARIABLE_ID"; + private static final String COMPLETION_CONDITION = "COMPLETION_CONDITION"; + + private Activity activity; + + private VariableScope variableScope; + + private MultipleInstanceActivityPropertyWriter writer; + + @Before + public void setUp() { + activity = Factories.bpmn2.createUserTask(); + activity.setId(ACTIVITY_ID); + variableScope = mock(VariableScope.class); + VariableScope.Variable variable = mock(VariableScope.Variable.class); + when(variableScope.lookup(PROPERTY_ID)).thenReturn(Optional.of(variable)); + Property property = mockProperty(PROPERTY_ID, ITEM_ID); + when(variable.getTypedIdentifier()).thenReturn(property); + writer = new MultipleInstanceActivityPropertyWriter(activity, variableScope); + } + + @Test + public void testSetCollectionInput() { + writer.setCollectionInput(PROPERTY_ID); + assertInputsInitialized(); + String inputId = ACTIVITY_ID + "_" + IN_COLLECTION + "InputX"; + assertHasDataInput(activity.getIoSpecification(), inputId, ITEM_ID, IN_COLLECTION); + assertHasDataInputAssociation(activity, PROPERTY_ID, inputId); + assertEquals(inputId, ((MultiInstanceLoopCharacteristics) activity.getLoopCharacteristics()).getLoopDataInputRef().getId()); + } + + @Test + public void setSetInputAndAddAssociation() { + testSetInput(true); + } + + @Test + public void setSetInputAndDontAddAssociation() { + testSetInput(false); + } + + private void testSetInput(boolean addAssociation) { + writer.setInput(INPUT_VARIABLE_ID, addAssociation); + assertInputsInitialized(); + String inputId = ACTIVITY_ID + "_" + INPUT_VARIABLE_ID + "InputX"; + String itemSubjectRef = ACTIVITY_ID + "_multiInstanceItemType_" + INPUT_VARIABLE_ID; + assertHasDataInput(activity.getIoSpecification(), inputId, itemSubjectRef, INPUT_VARIABLE_ID); + if (addAssociation) { + assertHasDataInputAssociation(activity, INPUT_VARIABLE_ID, inputId); + } else { + assertDontHasDataInputAssociation(activity, INPUT_VARIABLE_ID, inputId); + } + } + + @Test + public void testSetOutputAndAddAssociation() { + testSetOutput(true); + } + + @Test + public void testSetOutputAndDontAddAssociation() { + testSetOutput(false); + } + + private void testSetOutput(boolean addAssociation) { + writer.setOutput(OUTPUT_VARIABLE_ID, true); + assertOutputsInitialized(); + String outputId = ACTIVITY_ID + "_" + OUTPUT_VARIABLE_ID + "OutputX"; + String itemSubjectRef = ACTIVITY_ID + "_multiInstanceItemType_" + OUTPUT_VARIABLE_ID; + assertHasDataOutput(activity.getIoSpecification(), outputId, itemSubjectRef, OUTPUT_VARIABLE_ID); + if (addAssociation) { + assertHasDataOutputAssociation(activity, outputId, OUTPUT_VARIABLE_ID); + } else { + assertDontHasDataInputAssociation(activity, outputId, OUTPUT_VARIABLE_ID); + } + } + + @Test + public void testSetCollectionOutput() { + writer.setCollectionOutput(PROPERTY_ID); + assertOutputsInitialized(); + String outputId = ACTIVITY_ID + "_" + OUT_COLLECTION + "OutputX"; + assertHasDataOutput(activity.getIoSpecification(), outputId, ITEM_ID, OUT_COLLECTION); + assertHasDataOutputAssociation(activity, outputId, PROPERTY_ID); + assertEquals(outputId, ((MultiInstanceLoopCharacteristics) activity.getLoopCharacteristics()).getLoopDataOutputRef().getId()); + } + + @Test + public void testSetCompletionCondition() { + writer.setCompletionCondition(COMPLETION_CONDITION); + assertEquals("", FormalExpressionBodyHandler.of((FormalExpression) ((MultiInstanceLoopCharacteristics) activity.getLoopCharacteristics()).getCompletionCondition()).getBody()); + } + + @Test + public void testSetIsSequentialTrue() { + writer.setIsSequential(true); + assertTrue(((MultiInstanceLoopCharacteristics) activity.getLoopCharacteristics()).isIsSequential()); + } + + @Test + public void testSetIsSequentialFalse() { + writer.setIsSequential(false); + assertFalse(((MultiInstanceLoopCharacteristics) activity.getLoopCharacteristics()).isIsSequential()); + } + + private void assertInputsInitialized() { + assertNotNull(activity.getIoSpecification()); + assertNotNull(activity.getIoSpecification().getDataInputs()); + assertNotNull(activity.getDataInputAssociations()); + assertNotNull(activity.getLoopCharacteristics()); + } + + private void assertOutputsInitialized() { + assertNotNull(activity.getIoSpecification()); + assertNotNull(activity.getIoSpecification().getDataOutputs()); + assertNotNull(activity.getDataOutputAssociations()); + assertNotNull(activity.getLoopCharacteristics()); + } + + private void assertHasDataInput(InputOutputSpecification ioSpecification, String id, String itemSubjectRef, String name) { + assertNotNull(ioSpecification.getDataInputs()); + Optional dataInput = ioSpecification.getDataInputs().stream() + .filter(di -> Objects.equals(id, di.getId())) + .filter(di -> Objects.equals(itemSubjectRef, di.getItemSubjectRef().getId())) + .filter(di -> Objects.equals(name, di.getName())) + .findFirst(); + if (!dataInput.isPresent()) { + fail(String.format("DataInput: id: %s, itemSubjectRef: %s, name: %s was not found.", id, itemSubjectRef, name)); + } + } + + private void assertHasDataOutput(InputOutputSpecification ioSpecification, String id, String itemSubjectRef, String name) { + assertNotNull(ioSpecification.getDataOutputs()); + Optional dataOutput = ioSpecification.getDataOutputs().stream() + .filter(dout -> Objects.equals(id, dout.getId())) + .filter(dout -> Objects.equals(itemSubjectRef, dout.getItemSubjectRef().getId())) + .filter(dout -> Objects.equals(name, dout.getName())) + .findFirst(); + if (!dataOutput.isPresent()) { + fail(String.format("DataOutput: id: %s, itemSubjectRef: %s, name: %s was not found.", id, itemSubjectRef, name)); + } + } + + private void assertHasDataInputAssociation(Activity activity, String sourceRef, String targetRef) { + assertNotNull(activity.getDataInputAssociations()); + Optional inputAssociation = findDataAssociation(activity.getDataInputAssociations(), sourceRef, targetRef); + if (!inputAssociation.isPresent()) { + fail(String.format("DataInputAssociation sourceRef: %s, targetRef: %s was not found.", sourceRef, targetRef)); + } + } + + private void assertDontHasDataInputAssociation(Activity activity, String sourceRef, String targetRef) { + assertNotNull(activity.getDataInputAssociations()); + Optional inputAssociation = findDataAssociation(activity.getDataInputAssociations(), sourceRef, targetRef); + if (inputAssociation.isPresent()) { + fail(String.format("DataInputAssociation sourceRef: %s, targetRef: %s shouldn't be present.", sourceRef, targetRef)); + } + } + + private void assertHasDataOutputAssociation(Activity activity, String sourceRef, String targetRef) { + assertNotNull(activity.getDataOutputAssociations()); + Optional outputAssociation = findDataAssociation(activity.getDataOutputAssociations(), sourceRef, targetRef); + if (!outputAssociation.isPresent()) { + fail(String.format("DataInputAssociation sourceRef: %s, targetRef: %s was not found.", sourceRef, targetRef)); + } + } + + private Optional findDataAssociation(List dataAssociations, String sourceRef, String targetRef) { + assertNotNull(dataAssociations); + return dataAssociations.stream() + .filter(dia -> !dia.getSourceRef().isEmpty()) + .filter(dia -> Objects.equals(sourceRef, dia.getSourceRef().get(0).getId())) + .filter(dia -> Objects.equals(targetRef, dia.getTargetRef().getId())) + .findFirst(); + } + + private Property mockProperty(String name, String itemSubjectRef) { + Property property = mock(Property.class); + when(property.getId()).thenReturn(name); + when(property.getName()).thenReturn(name); + ItemDefinition itemDefinition = mock(ItemDefinition.class); + when(itemDefinition.getId()).thenReturn(itemSubjectRef); + when(property.getItemSubjectRef()).thenReturn(itemDefinition); + return property; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/MultipleInstanceSubProcessPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/MultipleInstanceSubProcessPropertyWriterTest.java new file mode 100644 index 00000000000..138cdd24f2c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/MultipleInstanceSubProcessPropertyWriterTest.java @@ -0,0 +1,84 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics; +import org.eclipse.bpmn2.SubProcess; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; + +import static junit.framework.TestCase.assertTrue; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatCode; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class MultipleInstanceSubProcessPropertyWriterTest { + + private MultipleInstanceSubProcessPropertyWriter tested = + new MultipleInstanceSubProcessPropertyWriter(bpmn2.createSubProcess(), + new FlatVariableScope()); + + @Test + public void nullInputOutputsShouldNotThrow() { + SubProcess subProcess = bpmn2.createSubProcess(); + MultipleInstanceSubProcessPropertyWriter p = + new MultipleInstanceSubProcessPropertyWriter( + subProcess, new FlatVariableScope()); + + assertThatCode(() -> { + p.setInput(null); + p.setOutput(null); + p.createDataInput(null, null); + p.createDataOutput(null, null); + p.setCompletionCondition(null); + }).doesNotThrowAnyException(); + } + + @Test + public void completionConditionMustBeWrappedInCdata() { + String expression = "x<1"; + String expected = ""; + SubProcess subProcess = bpmn2.createSubProcess(); + MultipleInstanceSubProcessPropertyWriter p = + new MultipleInstanceSubProcessPropertyWriter( + subProcess, new FlatVariableScope()); + p.setCompletionCondition(expression); + MultiInstanceLoopCharacteristics loopCharacteristics = + (MultiInstanceLoopCharacteristics) subProcess.getLoopCharacteristics(); + FormalExpression completionCondition = + (FormalExpression) loopCharacteristics.getCompletionCondition(); + + assertThat(expected).isEqualTo(FormalExpressionBodyHandler.of(completionCondition).getBody()); + } + + @Test + public void testSetIsAsync() { + tested.setAsync(Boolean.TRUE); + assertTrue(CustomElement.async.of(tested.getFlowElement()).get()); + } + + @Test + public void testSetSlaDueDate() { + String slaDueDate = "12/25/1983"; + tested.setSlaDueDate(new SLADueDate(slaDueDate)); + + assertTrue(CustomElement.slaDueDate.of(tested.getFlowElement()).get().contains(slaDueDate)); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/NotificationPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/NotificationPropertyWriterTest.java new file mode 100644 index 00000000000..eb61c9bf4d3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/NotificationPropertyWriterTest.java @@ -0,0 +1,130 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomInput; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations.AssociationType; +import org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationsInfo; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class NotificationPropertyWriterTest { + + private FlatVariableScope variableScope; + + @Before + public void before() { + this.variableScope = new FlatVariableScope(); + } + + @Test + public void addOneNotStartedNotifyValue() { + UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope); + + NotificationsInfo notificationsInfo = new NotificationsInfo(); + notificationsInfo.getValue().addValue(getNotificationValue(AssociationType.NOT_STARTED_NOTIFY.getName())); + userTaskPropertyWriter.setNotifications(notificationsInfo); + + CustomInput notStartedNotify = getFieldValue(UserTaskPropertyWriter.class, userTaskPropertyWriter, "notStartedNotify"); + Assert.assertEquals(asCDATA(getNotificationValue(AssociationType.NOT_STARTED_NOTIFY.getName()).toCDATAFormat()), notStartedNotify.get()); + } + + @Test + public void addTwoNotStartedNotifyValue() { + UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope); + + NotificationsInfo notificationsInfo = new NotificationsInfo(); + notificationsInfo.getValue().addValue(getNotificationValue(AssociationType.NOT_STARTED_NOTIFY.getName())); + notificationsInfo.getValue().addValue(getNotificationValue(AssociationType.NOT_STARTED_NOTIFY.getName())); + userTaskPropertyWriter.setNotifications(notificationsInfo); + + String cdata = getNotificationValue(AssociationType.NOT_STARTED_NOTIFY.getName()).toCDATAFormat(); + + CustomInput notStartedNotify = getFieldValue(UserTaskPropertyWriter.class, userTaskPropertyWriter, "notStartedNotify"); + Assert.assertEquals(asCDATA(cdata + "^" + cdata), notStartedNotify.get()); + } + + @Test + public void addOneNotCompletedNotifyValue() { + UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope); + + NotificationsInfo notificationsInfo = new NotificationsInfo(); + notificationsInfo.getValue().addValue(getNotificationValue(AssociationType.NOT_COMPLETED_NOTIFY.getName())); + userTaskPropertyWriter.setNotifications(notificationsInfo); + + CustomInput notStartedNotify = getFieldValue(UserTaskPropertyWriter.class, userTaskPropertyWriter, "notCompletedNotify"); + Assert.assertEquals(asCDATA(getNotificationValue(AssociationType.NOT_COMPLETED_NOTIFY.getName()).toCDATAFormat()), notStartedNotify.get()); + } + + @Test + public void addTwoNotCompletedNotifyValue() { + UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope); + + NotificationsInfo notificationsInfo = new NotificationsInfo(); + notificationsInfo.getValue().addValue(getNotificationValue(AssociationType.NOT_COMPLETED_NOTIFY.getName())); + notificationsInfo.getValue().addValue(getNotificationValue(AssociationType.NOT_COMPLETED_NOTIFY.getName())); + userTaskPropertyWriter.setNotifications(notificationsInfo); + + String cdata = getNotificationValue(AssociationType.NOT_COMPLETED_NOTIFY.getName()).toCDATAFormat(); + + CustomInput notStartedNotify = getFieldValue(UserTaskPropertyWriter.class, userTaskPropertyWriter, "notCompletedNotify"); + Assert.assertEquals(asCDATA(cdata + "^" + cdata), notStartedNotify.get()); + } + + protected T getFieldValue(Class parent, Object instance, String fieldName) { + Field inputField = FieldUtils.getField(parent, fieldName, true); + try { + return (T) inputField.get(instance); + } catch (IllegalAccessException e) { + throw new Error(e); + } + } + + private String asCDATA(String value) { + return ""; + } + + private NotificationValue getNotificationValue(String type) { + List users = new ArrayList<>(); + users.add("AAA"); + users.add("BBB"); + + List groups = new ArrayList<>(); + users.add("G1"); + users.add("G2"); + + NotificationValue value = new NotificationValue(); + value.setType(type); + value.setUsers(users); + value.setGroups(groups); + value.setFrom("User"); + value.setReplyTo("Admin"); + value.setSubject("Subj"); + value.setBody("Body"); + + return value; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ProcessPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ProcessPropertyWriterTest.java new file mode 100644 index 00000000000..8fd151533fe --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ProcessPropertyWriterTest.java @@ -0,0 +1,168 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.Process; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.di.BPMNShape; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.ProcessPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.DocumentationTextHandler; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles; +import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.di; + +@RunWith(MockitoJUnitRunner.class) +public class ProcessPropertyWriterTest { + + ProcessPropertyWriter p; + FlatVariableScope variableScope; + + @Before + public void before() { + this.variableScope = new FlatVariableScope(); + this.p = new ProcessPropertyWriter( + bpmn2.createProcess(), variableScope); + } + + @Test + public void setIdWithWhitespace() { + p.setId("some weird id \t"); + Process process = p.getProcess(); + assertThat(process.getId()).isEqualTo("someweirdid"); + } + + @Test + public void addChildElement() { + Process process = p.getProcess(); + + BoundaryEventPropertyWriter boundaryEventPropertyWriter = + new BoundaryEventPropertyWriter(bpmn2.createBoundaryEvent(), variableScope); + + UserTaskPropertyWriter userTaskPropertyWriter = + new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope); + + p.addChildElement(boundaryEventPropertyWriter); + p.addChildElement(userTaskPropertyWriter); + + // boundary event should always occur after other nodes (compat with old marshallers) + assertThat(process.getFlowElements().get(0)).isEqualTo(userTaskPropertyWriter.getFlowElement()); + assertThat(process.getFlowElements().get(1)).isEqualTo(boundaryEventPropertyWriter.getFlowElement()); + } + + @Test + public void addChildShape() { + BPMNShape bpmnShape = di.createBPMNShape(); + bpmnShape.setId("a"); + p.addChildShape(bpmnShape); + assertThatThrownBy(() -> p.addChildShape(bpmnShape)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessageStartingWith("Cannot add the same shape twice"); + } + + @Test + public void addChildEdge() { + BPMNEdge bpmnEdge = di.createBPMNEdge(); + bpmnEdge.setId("a"); + p.addChildEdge(bpmnEdge); + assertThatThrownBy(() -> p.addChildEdge(bpmnEdge)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessageStartingWith("Cannot add the same edge twice"); + } + + @Test + public void caseRoles() { + CaseRoles caseRole = new CaseRoles("role"); + p.setCaseRoles(caseRole); + String cdata = CustomElement.caseRole.of(p.getProcess()).get(); + assertThat("role").isEqualTo(CustomElement.caseRole.stripCData(cdata)); + } + + @Test + public void caseIdPrefix() { + CaseIdPrefix caseIdPrefix = new CaseIdPrefix("caseIdPrefix"); + p.setCaseIdPrefix(caseIdPrefix); + String cdata = CustomElement.caseIdPrefix.of(p.getProcess()).get(); + assertThat("caseIdPrefix").isEqualTo(CustomElement.caseIdPrefix.stripCData(cdata)); + } + + @Test + public void caseFileVariables() { + CaseFileVariables caseFileVariables = new CaseFileVariables("CFV1:Boolean,CFV2:Boolean,CFV3:Boolean"); + p.setCaseFileVariables(caseFileVariables); + assertThat(p.itemDefinitions.size() == 3); + } + + @Test + public void executable() { + p.setExecutable(true); + assertTrue(p.getProcess().isIsExecutable()); + p.setExecutable(false); + assertFalse(p.getProcess().isIsExecutable()); + } + + @Test + public void globalVariables() { + GlobalVariables globalVariables = new GlobalVariables("GV1:Boolean,GV2:Boolean,GV3:Integer"); + p.setGlobalVariables(globalVariables); + String globalVariablesString = CustomElement.globalVariables.of(p.getProcess()).get(); + assertThat(globalVariablesString).isEqualTo("GV1:Boolean,GV2:Boolean,GV3:Integer"); + } + + @Test + public void processVariables() { + ProcessVariables processVariables = new ProcessVariables("GV1:Boolean:true,GV2:Boolean:true,GV3:Integer:false"); + p.setProcessVariables(processVariables); + + final ProcessPropertyReader pp = new ProcessPropertyReader( + p.getProcess(), p.getBpmnDiagram(), p.getShape(), 1.0); + String processVariablesString = pp.getProcessVariables(); + assertThat(processVariablesString).isEqualTo("GV1:Boolean:true,GV2:Boolean:true,GV3:Integer:false"); + } + + @Test + public void slaDueDate() { + SLADueDate slaDueDate = new SLADueDate("12/25/1983"); + p.setSlaDueDate(slaDueDate); + String slaDueDateString = CustomElement.slaDueDate.of(p.getProcess()).get(); + assertThat(slaDueDateString).isEqualTo(""); + } + + @Test + public void testSetDocumentationNotEmpty() { + p.setDocumentation("DocumentationValue"); + assertNotNull(p.getProcess().getDocumentation()); + assertEquals(1, p.getProcess().getDocumentation().size()); + assertEquals("", DocumentationTextHandler.of(p.getProcess().getDocumentation().get(0)).getText()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ProcessesTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ProcessesTest.java new file mode 100644 index 00000000000..040bd6c9a8e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ProcessesTest.java @@ -0,0 +1,170 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.List; +import java.util.Map; + +import bpsim.ElementParameters; +import org.eclipse.bpmn2.Artifact; +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.FlowElementsContainer; +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Process; +import org.eclipse.bpmn2.RootElement; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.impl.ArtifactImpl; +import org.eclipse.bpmn2.impl.FlowElementImpl; +import org.eclipse.emf.common.util.EList; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class ProcessesTest { + + private static final String ELEMENT_ID = "ELEMENT_ID"; + + @Mock + private PropertyWriter propertyWriter; + + @Mock + private BoundaryEventPropertyWriter boundaryEventPropertyWriter; + + @Mock + private List propertyWriterRootElements; + + @Mock + private List propertyWriterItemDefinitions; + + @Mock + private ElementParameters propertyWriterElementParameters; + + @Mock + private FlowElement flowElement; + + @Mock + private Artifact artifact; + + @Mock + private Process process; + + @Mock + private SubProcess subProcess; + + @Mock + private EList flowElements; + + @Mock + private EList artifacts; + + @Mock + private Map childElements; + + @Mock + private List rootElements; + + @Mock + private List simulationParameters; + + @Mock + private List itemDefinitions; + + @Before + public void setUp() { + when(propertyWriter.getRootElements()).thenReturn(propertyWriterRootElements); + when(propertyWriter.getSimulationParameters()).thenReturn(propertyWriterElementParameters); + when(propertyWriter.getItemDefinitions()).thenReturn(propertyWriterItemDefinitions); + + when(boundaryEventPropertyWriter.getRootElements()).thenReturn(propertyWriterRootElements); + when(boundaryEventPropertyWriter.getSimulationParameters()).thenReturn(propertyWriterElementParameters); + when(boundaryEventPropertyWriter.getItemDefinitions()).thenReturn(propertyWriterItemDefinitions); + + flowElement = new FlowElementImpl() { + }; + flowElement.setId(ELEMENT_ID); + artifact = new ArtifactImpl() { + }; + artifact.setId(ELEMENT_ID); + + when(process.getFlowElements()).thenReturn(flowElements); + when(process.getArtifacts()).thenReturn(artifacts); + when(subProcess.getFlowElements()).thenReturn(flowElements); + when(subProcess.getArtifacts()).thenReturn(artifacts); + } + + @Test + public void testAddFlowElementChildOnProcess() { + testAddFlowElementCase(process); + } + + @Test + public void testAddFlowElementChildOnSubProcess() { + testAddFlowElementCase(subProcess); + } + + private void testAddFlowElementCase(FlowElementsContainer container) { + testAddElementChild(propertyWriter, container, flowElement); + verify(flowElements).add(0, flowElement); + } + + @Test + public void testAddBoundaryEventFlowElementOnProcess() { + testAddBoundaryEventFlowElementCase(process); + } + + @Test + public void testAddBoundaryEventFlowElementSubProcess() { + testAddBoundaryEventFlowElementCase(subProcess); + } + + private void testAddBoundaryEventFlowElementCase(FlowElementsContainer container) { + testAddElementChild(boundaryEventPropertyWriter, container, flowElement); + verify(flowElements).add(flowElement); + } + + @Test + public void testAddArtifactElementOnProcess() { + testAddArtifactCase(process); + } + + @Test + public void testAddArtifactElementOnSubProcess() { + testAddArtifactCase(subProcess); + } + + private void testAddArtifactCase(FlowElementsContainer container) { + testAddElementChild(propertyWriter, container, artifact); + verify(artifacts).add(artifact); + } + + private void testAddElementChild(BasePropertyWriter propertyWriter, FlowElementsContainer flowElementsContainer, BaseElement baseElement) { + when(propertyWriter.getElement()).thenReturn(baseElement); + Processes.addChildElement(propertyWriter, childElements, flowElementsContainer, simulationParameters, itemDefinitions, rootElements); + + verify(childElements).put(ELEMENT_ID, propertyWriter); + verify(simulationParameters).add(propertyWriterElementParameters); + verify(rootElements).addAll(propertyWriterRootElements); + verify(itemDefinitions).addAll(propertyWriterItemDefinitions); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ReassignmentPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ReassignmentPropertyWriterTest.java new file mode 100644 index 00000000000..f3c0cc00b1d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/ReassignmentPropertyWriterTest.java @@ -0,0 +1,127 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomInput; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations.AssociationType; +import org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentsInfo; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class ReassignmentPropertyWriterTest { + + private FlatVariableScope variableScope; + + @Before + public void before() { + this.variableScope = new FlatVariableScope(); + } + + @Test + public void addOneNotStartedReassignmentValue() { + UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope); + + ReassignmentsInfo reassignmentsInfo = new ReassignmentsInfo(); + reassignmentsInfo.getValue().addValue(getReassignmentValue(AssociationType.NOT_STARTED_REASSIGN.getName())); + userTaskPropertyWriter.setReassignments(reassignmentsInfo); + + CustomInput notStartedNotify = getFieldValue(UserTaskPropertyWriter.class, userTaskPropertyWriter, "notStartedReassign"); + Assert.assertEquals(asCDATA(getReassignmentValue(AssociationType.NOT_STARTED_REASSIGN.getName()).toCDATAFormat()), notStartedNotify.get()); + } + + @Test + public void addTwoNotStartedReassignmentValue() { + UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope); + + ReassignmentsInfo reassignmentsInfo = new ReassignmentsInfo(); + reassignmentsInfo.getValue().addValue(getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName())); + reassignmentsInfo.getValue().addValue(getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName())); + userTaskPropertyWriter.setReassignments(reassignmentsInfo); + + String cdata = getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName()).toCDATAFormat(); + + CustomInput notStartedNotify = getFieldValue(UserTaskPropertyWriter.class, userTaskPropertyWriter, "notCompletedReassign"); + Assert.assertEquals(asCDATA(cdata + "^" + cdata), notStartedNotify.get()); + } + + @Test + public void addOneNotCompletedReassignmentValue() { + UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope); + + ReassignmentsInfo reassignmentsInfo = new ReassignmentsInfo(); + reassignmentsInfo.getValue().addValue(getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName())); + userTaskPropertyWriter.setReassignments(reassignmentsInfo); + + CustomInput notStartedNotify = getFieldValue(UserTaskPropertyWriter.class, userTaskPropertyWriter, "notCompletedReassign"); + Assert.assertEquals(asCDATA(getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName()).toCDATAFormat()), notStartedNotify.get()); + } + + @Test + public void addTwoNotCompletedReassignmentValue() { + UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope); + + ReassignmentsInfo reassignmentsInfo = new ReassignmentsInfo(); + reassignmentsInfo.getValue().addValue(getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName())); + reassignmentsInfo.getValue().addValue(getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName())); + userTaskPropertyWriter.setReassignments(reassignmentsInfo); + + String cdata = getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName()).toCDATAFormat(); + + CustomInput notStartedNotify = getFieldValue(UserTaskPropertyWriter.class, userTaskPropertyWriter, "notCompletedReassign"); + Assert.assertEquals(asCDATA(cdata + "^" + cdata), notStartedNotify.get()); + } + + protected T getFieldValue(Class parent, Object instance, String fieldName) { + Field inputField = FieldUtils.getField(parent, fieldName, true); + try { + return (T) inputField.get(instance); + } catch (IllegalAccessException e) { + throw new Error(e); + } + } + + private String asCDATA(String value) { + return ""; + } + + private ReassignmentValue getReassignmentValue(String type) { + List users = new ArrayList<>(); + users.add("AAA"); + users.add("BBB"); + + List groups = new ArrayList<>(); + users.add("G1"); + users.add("G2"); + + ReassignmentValue value = new ReassignmentValue(); + value.setType(type); + value.setUsers(users); + value.setGroups(groups); + value.setDuration("1d"); + + return value; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/SequenceFlowPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/SequenceFlowPropertyWriterTest.java new file mode 100644 index 00000000000..9694dcc30be --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/SequenceFlowPropertyWriterTest.java @@ -0,0 +1,200 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import java.util.List; + +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.dd.dc.Point; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.DocumentationTextHandler; +import org.kie.workbench.common.stunner.bpmn.definition.SequenceFlow; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.ControlPoint; +import org.kie.workbench.common.stunner.core.graph.content.view.MagnetConnection; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnectorImpl; + +import static java.util.Arrays.asList; +import static junit.framework.TestCase.assertEquals; +import static junit.framework.TestCase.failNotEquals; +import static org.assertj.core.api.Assertions.assertThat; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.dc; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; + +public class SequenceFlowPropertyWriterTest { + + private final String SEQ_ID = "SEQ_ID", SOURCE_ID = "SOURCE_ID", TARGET_ID = "TARGET_ID"; + + @Test + public void setConnectionMagnetsNullLocation() { + + TestSequenceFlowWriter w = new TestSequenceFlowWriter(); + SequenceFlowPropertyWriter p = w.sequenceFlowOf(SEQ_ID); + + float sx = 10, sy = 10, sWidth = 50, sHeight = 70; + PropertyWriter source = w.nodeOf(SOURCE_ID, sx, sy, sWidth, sHeight); + + float tx = 100, ty = 100, tWidth = 20, tHeight = 30; + PropertyWriter target = w.nodeOf(TARGET_ID, tx, ty, tWidth, tHeight); + + p.setSource(source); + p.setTarget(target); + + // magnets have null location + ViewConnectorImpl connector = makeConnector(); + connector.setSourceConnection(new MagnetConnection.Builder().build()); + connector.setTargetConnection(new MagnetConnection.Builder().build()); + p.setConnection(connector); + + BPMNEdge edge = p.getEdge(); + List expected = asList( + pointOf(sWidth + sx, + sHeight / 2 + sy), + pointOf(tx, + tHeight / 2 + ty)); + List waypoints = edge.getWaypoint(); + + assertPointsEqual(expected, waypoints, + "when magnet location is null: " + + "source magnet should be right/middle, " + + "target magnet should left/middle"); + } + + @Test + public void setConnectionMagnets() { + TestSequenceFlowWriter w = new TestSequenceFlowWriter(); + SequenceFlowPropertyWriter p = w.sequenceFlowOf(SEQ_ID); + + float sx = 10, sy = 10, sWidth = 50, sHeight = 70; + PropertyWriter source = w.nodeOf(SOURCE_ID, sx, sy, sWidth, sHeight); + + float tx = 100, ty = 100, tWidth = 20, tHeight = 30; + PropertyWriter target = w.nodeOf(TARGET_ID, tx, ty, tWidth, tHeight); + + p.setSource(source); + p.setTarget(target); + + // magnets have null location + ViewConnectorImpl connector = makeConnector(); + connector.setSourceConnection(MagnetConnection.Builder.at(1, 2)); + connector.setTargetConnection(MagnetConnection.Builder.at(2, 3)); + p.setConnection(connector); + + BPMNEdge edge = p.getEdge(); + List expected = asList( + pointOf(sx + 1, + sy + 2), + pointOf(tx + 2, + ty + 3)); + List waypoints = edge.getWaypoint(); + + assertPointsEqual(expected, waypoints, "when magnet location is defined, waypoints should be translated into an absolute position"); + } + + @Test + public void setControlPoints() { + TestSequenceFlowWriter w = new TestSequenceFlowWriter(); + SequenceFlowPropertyWriter p = w.sequenceFlowOf(SEQ_ID); + + float sx = 10, sy = 10, sWidth = 50, sHeight = 70; + PropertyWriter source = w.nodeOf(SOURCE_ID, sx, sy, sWidth, sHeight); + + float tx = 100, ty = 100, tWidth = 20, tHeight = 30; + PropertyWriter target = w.nodeOf(TARGET_ID, tx, ty, tWidth, tHeight); + + p.setSource(source); + p.setTarget(target); + + // magnets have null location + ViewConnectorImpl connector = makeConnector(); + connector.setSourceConnection(MagnetConnection.Builder.at(1, 2)); + connector.setTargetConnection(MagnetConnection.Builder.at(2, 3)); + connector.setControlPoints(new ControlPoint[]{ + ControlPoint.build(Point2D.create( + sx + 100, + sy + 100)), + ControlPoint.build(Point2D.create( + sx + 150, + sy + 150)) + }); + p.setConnection(connector); + + BPMNEdge edge = p.getEdge(); + List expected = asList( + pointOf(sx + 1, + sy + 2), + pointOf(sx + 100, + sy + 100), + pointOf(sx + 150, + sy + 150), + pointOf(tx + 2, + ty + 3)); + List waypoints = edge.getWaypoint(); + + assertPointsEqual(expected, waypoints, "when magnet location is defined, waypoints should be translated into an absolute position"); + } + + @Test + public void JBPM_7522_shouldPersistProperties() { + TestSequenceFlowWriter w = new TestSequenceFlowWriter(); + SequenceFlowPropertyWriter p = w.sequenceFlowOf(SEQ_ID); + + String name = "Name"; + String doc = "Doc"; + String priority = "100"; + ScriptTypeValue scriptTypeValue = + new ScriptTypeValue("java", "System.out.println(1);"); + + p.setName(name); + p.setDocumentation(doc); + p.setPriority(priority); + p.setConditionExpression(scriptTypeValue); + + org.eclipse.bpmn2.SequenceFlow seq = + (org.eclipse.bpmn2.SequenceFlow) p.getFlowElement(); + + assertThat(seq.getName()).isEqualTo(name); + assertThat(DocumentationTextHandler.of(seq.getDocumentation().get(0)).getText()).isEqualTo(asCData(doc)); + assertThat(CustomAttribute.priority.of(seq).get()).isEqualTo(priority); + assertThat(seq.getConditionExpression()).isNotNull(); + } + + private static ViewConnectorImpl makeConnector() { + return new ViewConnectorImpl<>(new SequenceFlow(), Bounds.create(0, 0, 1000, 1000)); + } + + private static void assertPointsEqual(List expected, List given, String message) { + assertEquals(expected.size(), given.size()); + for (int i = 0; i < expected.size(); i++) { + Point pe = expected.get(i); + Point pg = given.get(i); + if (pe.getX() != pg.getX() || pe.getY() != pg.getY()) { + failNotEquals(message, expected, given); + } + } + } + + private static Point pointOf(double x, double y) { + Point point = dc.createPoint(); + point.setX((float) x); + point.setY((float) y); + return point; + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/SubProcessPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/SubProcessPropertyWriterTest.java new file mode 100644 index 00000000000..364912c9fa7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/SubProcessPropertyWriterTest.java @@ -0,0 +1,122 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.emf.ecore.xmi.util.ECollections; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.definition.BaseAdHocSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseAdHocSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseProcessData; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertTrue; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class SubProcessPropertyWriterTest extends AbstractBasePropertyWriterTest { + + @Override + protected SubProcessPropertyWriter newPropertyWriter(SubProcess baseElement, VariableScope variableScope) { + return new SubProcessPropertyWriter(baseElement, variableScope); + } + + @Override + protected SubProcess mockElement() { + return mock(SubProcess.class); + } + + @Test + public void addChildElement() { + SubProcess process = (SubProcess) propertyWriter.getElement(); + when(process.getFlowElements()).thenReturn(ECollections.newBasicEList()); + + BoundaryEventPropertyWriter boundaryEventPropertyWriter = + new BoundaryEventPropertyWriter(bpmn2.createBoundaryEvent(), variableScope); + + UserTaskPropertyWriter userTaskPropertyWriter = + new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope); + + propertyWriter.addChildElement(boundaryEventPropertyWriter); + propertyWriter.addChildElement(userTaskPropertyWriter); + + // boundary event should always occur after other nodes (compat with old marshallers) + assertThat(process.getFlowElements().get(0)).isEqualTo(userTaskPropertyWriter.getFlowElement()); + assertThat(process.getFlowElements().get(1)).isEqualTo(boundaryEventPropertyWriter.getFlowElement()); + } + + @Test + public void testSetAbsoluteBoundsForAdHocSubprocess() { + testSetAbsoluteBoundsForExpandedNode(createNode(new BaseAdHocSubprocessMock())); + } + + @Test + public void testSetAbsoluteBoundsForEmbeddedSubprocess() { + testSetAbsoluteBoundsForExpandedNode(createNode(mock(EmbeddedSubprocess.class))); + } + + @Test + public void testSetAbsoluteBoundsForEventSubprocess() { + testSetAbsoluteBoundsForExpandedNode(createNode(mock(EventSubprocess.class))); + } + + private void testSetAbsoluteBoundsForExpandedNode(Node node) { + testSetAbsoluteBounds(node); + assertTrue(propertyWriter.getShape().isIsExpanded()); + } + + private class BaseAdHocSubprocessMock extends BaseAdHocSubprocess { + + BaseAdHocSubprocessMock() { + this(null, null, null, null, null); + } + + private BaseAdHocSubprocessMock(BPMNGeneralSet general, BackgroundSet backgroundSet, FontSet fontSet, RectangleDimensionsSet dimensionsSet, SimulationSet simulationSet) { + super(general, backgroundSet, fontSet, dimensionsSet, simulationSet); + } + + @Override + public BaseAdHocSubprocessTaskExecutionSet getExecutionSet() { + return null; + } + + @Override + public void setExecutionSet(BaseAdHocSubprocessTaskExecutionSet executionSet) { + + } + + @Override + public BaseProcessData getProcessData() { + return null; + } + + @Override + public void setProcessData(BaseProcessData processData) { + + } + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/TestSequenceFlowWriter.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/TestSequenceFlowWriter.java new file mode 100644 index 00000000000..565952de01b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/TestSequenceFlowWriter.java @@ -0,0 +1,42 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.ScriptTask; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; + +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +class TestSequenceFlowWriter { + + final PropertyWriterFactory propertyWriter = new PropertyWriterFactory(); + + SequenceFlowPropertyWriter sequenceFlowOf(String id) { + org.eclipse.bpmn2.SequenceFlow sequenceFlow = bpmn2.createSequenceFlow(); + sequenceFlow.setId(id); + return propertyWriter.of(sequenceFlow); + } + + PropertyWriter nodeOf(String id, float x, float y, float width, float height) { + ScriptTask el = bpmn2.createScriptTask(); + el.setId(id); + Bounds sb = Bounds.create(x, y, x + width, y + height); + PropertyWriter p = propertyWriter.of(el); + p.setBounds(sb); + return p; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/TextAnnotationPropertyWriterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/TextAnnotationPropertyWriterTest.java new file mode 100644 index 00000000000..5c67c90e0b3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/TextAnnotationPropertyWriterTest.java @@ -0,0 +1,85 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties; + +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.TextAnnotation; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.jboss.drools.MetaDataType; +import org.jboss.drools.impl.MetaDataTypeImpl; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class TextAnnotationPropertyWriterTest { + + public static final String NAME = "name"; + + private TextAnnotationPropertyWriter tested; + + @Mock + private TextAnnotation element; + + @Mock + private VariableScope variableScope; + + @Mock + private ExtensionAttributeValue extensionAttributeValue; + + @Mock + private FeatureMap valueMap; + + @Mock + private MetaDataType metaDataType; + + @Captor + private ArgumentCaptor entryArgumentCaptor; + + @Before + public void setUp() { + when(element.getExtensionValues()).thenReturn(ECollections.asEList(extensionAttributeValue)); + when(extensionAttributeValue.getValue()).thenReturn(valueMap); + when(metaDataType.getName()).thenReturn(CustomElement.name.name()); + tested = new TextAnnotationPropertyWriter(element, variableScope); + } + + @Test + public void setName() { + tested.setName(NAME); + verify(element).setText(NAME); + verify(element).setName(NAME); + verify(valueMap).add(entryArgumentCaptor.capture()); + final MetaDataTypeImpl value = (MetaDataTypeImpl) entryArgumentCaptor.getValue().getValue(); + assertEquals(NAME, CustomElement.name.stripCData(value.getMetaValue())); + } + + @Test + public void getElement() { + assertEquals(element, tested.getElement()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/util/PropertyWriterUtilsTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/util/PropertyWriterUtilsTest.java new file mode 100644 index 00000000000..3b9d209a9d6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/properties/util/PropertyWriterUtilsTest.java @@ -0,0 +1,166 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.util; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.dd.dc.Bounds; +import org.eclipse.dd.dc.Point; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.BasePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.relationship.Dock; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.ControlPoint; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class PropertyWriterUtilsTest { + + private static final String SOURCE_SHAPE_ID = "SOURCE_SHAPE_ID"; + private static final String TARGET_SHAPE_ID = "TARGET_SHAPE_ID"; + + @Mock + private BasePropertyWriter sourceWriter; + + @Mock + private BaseElement sourceElement; + + @Mock + private BasePropertyWriter targetWriter; + + @Mock + private BaseElement targetElement; + + @Before + public void setUp() { + when(sourceWriter.getElement()).thenReturn(sourceElement); + when(targetWriter.getElement()).thenReturn(targetElement); + } + + @Test + public void testCreateBPMNEdge() { + BPMNShape sourceShape = mockShape(SOURCE_SHAPE_ID, 1, 1, 4, 4); + BPMNShape targetShape = mockShape(TARGET_SHAPE_ID, 10, 10, 4, 4); + when(sourceWriter.getShape()).thenReturn(sourceShape); + when(targetWriter.getShape()).thenReturn(targetShape); + Connection sourceConnection = mockConnection(1, 1); + Connection targetConnection = mockConnection(10, 10); + ControlPoint[] controlPoints = new ControlPoint[]{ + new ControlPoint(Point2D.create(3, 3)), + new ControlPoint(Point2D.create(4, 4)), + new ControlPoint(Point2D.create(5, 5)) + }; + + BPMNEdge edge = PropertyWriterUtils.createBPMNEdge(sourceWriter, targetWriter, sourceConnection, controlPoints, targetConnection); + + assertEquals("edge_SOURCE_SHAPE_ID_to_TARGET_SHAPE_ID", edge.getId()); + assertWaypoint(2, 2, 0, edge.getWaypoint()); + assertWaypoint(3, 3, 1, edge.getWaypoint()); + assertWaypoint(4, 4, 2, edge.getWaypoint()); + assertWaypoint(5, 5, 3, edge.getWaypoint()); + assertWaypoint(20, 20, 4, edge.getWaypoint()); + } + + @Test + public void testGetDockSourceNodeWhenDocked() { + Node dockSourceNode = mock(Node.class); + Node node = mockDockedNode(dockSourceNode); + Optional> result = PropertyWriterUtils.getDockSourceNode(node); + assertTrue(result.isPresent()); + assertEquals(dockSourceNode, result.get()); + } + + @Test + public void testGetDockSourceNodeWhenNotDocked() { + Node node = mock(Node.class); + List edges = new ArrayList<>(); + when(node.getInEdges()).thenReturn(edges); + Optional> result = PropertyWriterUtils.getDockSourceNode(node); + assertFalse(result.isPresent()); + } + + public static void assertWaypoint(float x, float y, int index, List waypoints) { + assertEquals(x, waypoints.get(index).getX(), 0); + assertEquals(y, waypoints.get(index).getY(), 0); + } + + public static BPMNShape mockShape(String id, float x, float y, float width, float height) { + BPMNShape shape = mock(BPMNShape.class); + when(shape.getId()).thenReturn(id); + Bounds bounds = mock(Bounds.class); + when(bounds.getX()).thenReturn(x); + when(bounds.getY()).thenReturn(y); + when(bounds.getHeight()).thenReturn(height); + when(bounds.getWidth()).thenReturn(width); + when(shape.getBounds()).thenReturn(bounds); + return shape; + } + + public static Connection mockConnection(double x, double y) { + Connection connection = mock(Connection.class); + Point2D locationPoint = Point2D.create(x, y); + when(connection.getLocation()).thenReturn(locationPoint); + return connection; + } + + @SuppressWarnings("unchecked") + public static ViewConnector mockConnector(double sourceX, double sourceY, double targetX, double targetY, ControlPoint[] controlPoints) { + ViewConnector connector = mock(ViewConnector.class); + Connection sourceConnection = mockConnection(sourceX, sourceY); + Connection targetConnection = mockConnection(targetX, targetY); + + Optional sourceConnectionOpt = Optional.of(sourceConnection); + Optional targetConnectionOpt = Optional.of(targetConnection); + + when(connector.getSourceConnection()).thenReturn(sourceConnectionOpt); + when(connector.getTargetConnection()).thenReturn(targetConnectionOpt); + when(connector.getControlPoints()).thenReturn(controlPoints); + return connector; + } + + private static Node mockDockedNode(Node dockSourceNode) { + Dock dockContent = mock(Dock.class); + Edge edge = mock(Edge.class); + List inEdges = Collections.singletonList(edge); + when(edge.getContent()).thenReturn(dockContent); + when(edge.getSourceNode()).thenReturn(dockSourceNode); + Node node = mock(Node.class); + when(node.getInEdges()).thenReturn(inEdges); + return node; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/textannotation/TextAnnotationConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/textannotation/TextAnnotationConverterTest.java new file mode 100644 index 00000000000..f20bfb496c7 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/fromstunner/textannotation/TextAnnotationConverterTest.java @@ -0,0 +1,79 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.textannotation; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.TextAnnotationPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.definition.TextAnnotation; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; +import org.kie.workbench.common.stunner.core.util.UUID; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class TextAnnotationConverterTest { + + public static final String NAME = "name"; + public static final String DOC = "doc"; + private TextAnnotationConverter tested; + + @Mock + private PropertyWriterFactory propertyWriterFactory; + + private Node, ?> node; + + @Mock + private View textAnnotationView; + + private TextAnnotation textAnnotation; + + @Mock + private TextAnnotationPropertyWriter writer; + + @Before + public void setUp() { + textAnnotation = new TextAnnotation(); + textAnnotation.getGeneral().getDocumentation().setValue(DOC); + textAnnotation.getGeneral().getName().setValue(NAME); + node = new NodeImpl<>(UUID.uuid()); + node.setContent(textAnnotationView); + when(textAnnotationView.getDefinition()).thenReturn(textAnnotation); + when(propertyWriterFactory.of(any(org.eclipse.bpmn2.TextAnnotation.class))).thenReturn(writer); + + tested = new TextAnnotationConverter(propertyWriterFactory); + } + + @Test + public void toElement() { + PropertyWriter propertyWriter = tested.toElement(node); + verify(writer).setName(NAME); + verify(writer).setDocumentation(DOC); + verify(writer).setAbsoluteBounds(node); + assertEquals(writer, propertyWriter); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/DefinitionResolverTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/DefinitionResolverTest.java new file mode 100644 index 00000000000..945faca96bf --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/DefinitionResolverTest.java @@ -0,0 +1,102 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import java.util.Collections; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.Process; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.di.BPMNPlane; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.dd.di.DiagramElement; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class DefinitionResolverTest { + + private static final String ID = "PARENT_ID"; + + @Mock + private Definitions definitions; + + @Mock + private BPMNDiagram diagram; + + @Mock + private BPMNPlane plane; + + @Mock + private Process process; + + private DefinitionResolver definitionResolver; + private EList planeElements; + + @Before + public void setUp() { + planeElements = ECollections.newBasicEList(); + when(definitions.getRootElements()).thenReturn(ECollections.singletonEList(process)); + when(definitions.getDiagrams()).thenReturn(ECollections.singletonEList(diagram)); + when(definitions.getRelationships()).thenReturn(ECollections.emptyEList()); + when(diagram.getPlane()).thenReturn(plane); + when(plane.getPlaneElement()).thenReturn(planeElements); + definitionResolver = new DefinitionResolver(definitions, Collections.emptyList()); + } + + @Test + public void testCalculateResolutionFactor() { + BPMNDiagram diagram = mock(BPMNDiagram.class); + when(diagram.getResolution()).thenReturn(0f); + double factor = DefinitionResolver.calculateResolutionFactor(diagram); + assertEquals(1d, factor, 0d); + when(diagram.getResolution()).thenReturn(250f); + factor = DefinitionResolver.calculateResolutionFactor(diagram); + assertEquals(0.45d, factor, 0d); + } + + @Test + public void testGetShape() { + BPMNShape shape = mock(BPMNShape.class); + BaseElement bpmnElement = mock(BaseElement.class); + when(shape.getBpmnElement()).thenReturn(bpmnElement); + when(bpmnElement.getId()).thenReturn(ID); + planeElements.add(shape); + assertEquals(shape, definitionResolver.getShape(ID)); + } + + @Test + public void testGetEdge() { + BPMNEdge edge = mock(BPMNEdge.class); + BaseElement bpmnElement = mock(BaseElement.class); + when(edge.getBpmnElement()).thenReturn(bpmnElement); + when(bpmnElement.getId()).thenReturn(ID); + planeElements.add(edge); + assertEquals(edge, definitionResolver.getEdge(ID)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/EdgeConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/EdgeConverterTest.java new file mode 100644 index 00000000000..9239dedcbcb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/EdgeConverterTest.java @@ -0,0 +1,130 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import java.util.Map; + +import org.eclipse.bpmn2.BaseElement; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.soup.commons.util.Maps; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EdgePropertyReader; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class EdgeConverterTest { + + private EdgeConverter tested; + + @Mock + private BpmnNode node1; + + @Mock + private BpmnNode node2; + + @Mock + private BpmnNode node3; + + @Mock + private Edge, Node> edge; + + @Mock + private EdgePropertyReader reader; + + private static final String message = "message"; + private static final String key = "key"; + + @Before + public void setUp() { + when(reader.getSourceId()).thenReturn("1"); + when(reader.getTargetId()).thenReturn("2"); + + tested = new EdgeConverter() { + @Override + public Result convertEdge(BaseElement element, Map nodes) { + return null; + } + }; + } + + @Test + public void resultWithExistingNodes() { + Map nodes = new Maps.Builder() + .put("1", node1) + .put("2", node2) + .put("3", node3) + .build(); + + when(reader.getSourceId()).thenReturn("1"); + when(reader.getTargetId()).thenReturn("2"); + + Result result = tested.result(nodes, edge, reader, message, key); + BpmnEdge value = result.value(); + assertTrue(result.isSuccess()); + assertEquals(node1, value.getSource()); + assertEquals(node2, value.getTarget()); + } + + @Test + public void resultWithMissingSourceNode() { + Map nodes = new Maps.Builder() + .put("2", node1) + .build(); + + Result result = tested.result(nodes, edge, reader, message, key); + BpmnEdge value = result.value(); + assertTrue(result.isIgnored()); + assertNull(value); + } + + @Test + public void resultWithMissingTargetNode() { + Map nodes = new Maps.Builder() + .put("1", node1) + .build(); + + Result result = tested.result(nodes, edge, reader, message, key); + BpmnEdge value = result.value(); + assertTrue(result.isIgnored()); + assertNull(value); + } + + @Test + public void valid() { + Map nodes = new Maps.Builder() + .put("1", node1) + .put("2", node1) + .build(); + + assertTrue(tested.valid(nodes, "1", "2")); + assertFalse(tested.valid(nodes, "1", "3")); + assertFalse(tested.valid(nodes, "0", "2")); + assertFalse(tested.valid(nodes, "0", "0")); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/FlowElementConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/FlowElementConverterTest.java new file mode 100644 index 00000000000..9bd7f101fc6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/FlowElementConverterTest.java @@ -0,0 +1,166 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.CallActivity; +import org.eclipse.bpmn2.DataObject; +import org.eclipse.bpmn2.DataObjectReference; +import org.eclipse.bpmn2.DataStoreReference; +import org.eclipse.bpmn2.EndEvent; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.Gateway; +import org.eclipse.bpmn2.IntermediateCatchEvent; +import org.eclipse.bpmn2.IntermediateThrowEvent; +import org.eclipse.bpmn2.StartEvent; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.TextAnnotation; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.activities.CallActivityConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events.EndEventConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events.IntermediateCatchEventConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events.IntermediateThrowEventConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events.StartEventConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.gateways.GatewayConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.processes.SubProcessConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.tasks.TaskConverter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.textannotation.TextAnnotationConverter; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class FlowElementConverterTest { + + private FlowElementConverter tested; + + @Mock + private BaseConverterFactory converterFactory; + + @Mock + private DefinitionResolver definitionResolver; + + @Mock + private StartEventConverter startEventConverter; + + @Mock + private EndEventConverter endEventConverter; + + @Mock + private IntermediateCatchEventConverter eventConverter; + + @Mock + private IntermediateThrowEventConverter throwEventConverter; + + @Mock + private TaskConverter taskConverter; + + @Mock + private GatewayConverter gatewayConverter; + + @Mock + private SubProcessConverter subProcessConverter; + + @Mock + private CallActivityConverter callActivityConverter; + + @Mock + private TextAnnotationConverter textAnnotationConverter; + + @Before + public void setUp() { + when(converterFactory.startEventConverter()).thenReturn(startEventConverter); + when(converterFactory.endEventConverter()).thenReturn(endEventConverter); + when(converterFactory.intermediateCatchEventConverter()).thenReturn(eventConverter); + when(converterFactory.taskConverter()).thenReturn(taskConverter); + when(converterFactory.intermediateThrowEventConverter()).thenReturn(throwEventConverter); + when(converterFactory.gatewayConverter()).thenReturn(gatewayConverter); + when(converterFactory.subProcessConverter()).thenReturn(subProcessConverter); + when(converterFactory.callActivityConverter()).thenReturn(callActivityConverter); + when(converterFactory.getDefinitionResolver()).thenReturn(definitionResolver); + when(converterFactory.textAnnotationConverter()).thenReturn(textAnnotationConverter); + tested = new FlowElementConverter(converterFactory); + } + + @Test + public void convertSupported() { + StartEvent startEvent = mock(StartEvent.class); + tested.convertNode(startEvent); + verify(startEventConverter).convert(startEvent); + + EndEvent endEvent = mock(EndEvent.class); + tested.convertNode(endEvent); + verify(endEventConverter).convert(endEvent); + + BoundaryEvent boundaryEvent = mock(BoundaryEvent.class); + tested.convertNode(boundaryEvent); + verify(eventConverter).convertBoundaryEvent(boundaryEvent); + + IntermediateCatchEvent intermediateCatchEvent = mock(IntermediateCatchEvent.class); + tested.convertNode(intermediateCatchEvent); + + verify(eventConverter).convert(intermediateCatchEvent); + + IntermediateThrowEvent intermediateThrowEvent = mock(IntermediateThrowEvent.class); + tested.convertNode(intermediateThrowEvent); + verify(throwEventConverter).convert(intermediateThrowEvent); + + Task task = mock(Task.class); + tested.convertNode(task); + verify(taskConverter).convert(task); + + Gateway gateway = mock(Gateway.class); + tested.convertNode(gateway); + verify(gatewayConverter).convert(gateway); + + SubProcess subProcess = mock(SubProcess.class); + tested.convertNode(subProcess); + verify(subProcessConverter).convertSubProcess(subProcess); + + CallActivity callActivity = mock(CallActivity.class); + tested.convertNode(callActivity); + verify(callActivityConverter).convert(callActivity); + + TextAnnotation textAnnotation = mock(TextAnnotation.class); + tested.convertNode(textAnnotation); + verify(textAnnotationConverter).convert(textAnnotation); + } + + // TODO: Kogito - @Test + public void convertUnsupported() { + assertUnsupported(DataStoreReference.class); + assertUnsupported(DataObjectReference.class); + assertUnsupported(DataObject.class); + } + + private void assertUnsupported(Class type) { + T element = mock(type); + Result result = tested.convertNode(element); + assertTrue(result.isIgnored()); + assertFalse(result.isSuccess()); + assertFalse(result.isFailure()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/GraphBuilderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/GraphBuilderTest.java new file mode 100644 index 00000000000..056aac7a9f0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/GraphBuilderTest.java @@ -0,0 +1,214 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import java.util.Collections; + +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNPlane; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.emf.common.util.ECollections; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; +import org.kie.workbench.common.stunner.bpmn.BPMNTestDefinitionFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.BasePropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess; +import org.kie.workbench.common.stunner.core.backend.StunnerTestingGraphBackendAPI; +import org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.diagram.MetadataImpl; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.dc; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class GraphBuilderTest { + + private static final String BPMN_ID = BindableAdapterUtils.getDefinitionSetId(BPMNDefinitionSet.class); + private static final String DIAGRAM_UUID = "DIAGRAM_UUID"; + private static final String SUBPROCESS1_ID = "SUBPROCESS1_ID"; + private static final String SUBPROCESS2_ID = "SUBPROCESS2_ID"; + private static final String SUBPROCESS3_ID = "SUBPROCESS3_ID"; + + private DefinitionResolver definitionResolver; + + @Mock + private org.eclipse.bpmn2.Process process; + + @Mock + private BPMNDiagram diagram; + + @Mock + private BPMNPlane plane; + + @Mock + private Definitions definitions; + + private Graph graph; + + private GraphBuilder graphBuilder; + + @Before + @SuppressWarnings("unchecked") + public void setUp() throws Exception { + when(diagram.getPlane()).thenReturn(plane); + when(definitions.getId()).thenReturn(DIAGRAM_UUID); + when(definitions.getRootElements()).thenReturn(ECollections.singletonEList(process)); + when(definitions.getDiagrams()).thenReturn(ECollections.singletonEList(diagram)); + when(definitions.getRelationships()).thenReturn(ECollections.emptyEList()); + definitionResolver = new DefinitionResolver(definitions, Collections.emptyList()); + StunnerTestingGraphBackendAPI api = StunnerTestingGraphBackendAPI.build(BPMNDefinitionSet.class, + new BPMNTestDefinitionFactory()); + TypedFactoryManager typedFactoryManager = new TypedFactoryManager(api.getFactoryManager()); + Metadata metadata = + new MetadataImpl.MetadataImplBuilder( + BindableAdapterUtils.getDefinitionSetId(BPMNDefinitionSet.class)).build(); + Diagram, Metadata> diagram = + api.getFactoryManager().newDiagram( + definitionResolver.getDefinitions().getId(), + BPMN_ID, + metadata); + graph = diagram.getGraph(); + graphBuilder = new GraphBuilder(graph, + api.getDefinitionManager(), + typedFactoryManager, + api.getRuleManager(), + api.commandFactory, + api.commandManager); + } + + @Test + public void testBoundsCalculation() { + //subprocess1 + double subprocess1X = 10; + double subprocess1Y = 10; + double subprocess1Width = 100; + double subprocess1Height = 200; + EmbeddedSubprocess subprocess1Definition = mock(EmbeddedSubprocess.class); + Node, ?> subprocess1 = mockNode(subprocess1Definition, + subprocess1X, + subprocess1Y, + subprocess1Width, + subprocess1Height); + when(subprocess1.getUUID()).thenReturn(SUBPROCESS1_ID); + BpmnNode subprocess1Node = mockBpmnNode(subprocess1); + + //subprocess2 + double subprocess2X = 20; + double subprocess2Y = 20; + double subprocess2Width = 70; + double subprocess2Height = 170; + EmbeddedSubprocess subprocess2Definition = mock(EmbeddedSubprocess.class); + //subprocess1 -> subprocess2 + //absolute coordinates in eclipse model + Node, ?> subprocess2 = mockNode(subprocess2Definition, + subprocess1X + subprocess2X, + subprocess1Y + subprocess2Y, + subprocess2Width, + subprocess2Height); + when(subprocess2.getUUID()).thenReturn(SUBPROCESS2_ID); + BpmnNode subprocess2Node = mockBpmnNode(subprocess2); + + //subprocess3 + double subprocess3X = 30; + double subprocess3Y = 30; + double subprocess3Width = 30; + double subprocess3Height = 120; + EmbeddedSubprocess subprocess3Definition = mock(EmbeddedSubprocess.class); + //subprocess1 -> subprocess2 -> subprocess3 + //absolute coordinates in eclipse model + Node, ?> subprocess3 = mockNode(subprocess3Definition, + subprocess1X + subprocess2X + subprocess3X, + subprocess1Y + subprocess2Y + subprocess3Y, + subprocess3Width, subprocess3Height); + when(subprocess3.getUUID()).thenReturn(SUBPROCESS3_ID); + BpmnNode subprocess3Node = mockBpmnNode(subprocess3); + + //subprocess1 -> subprocess2 -> subprocess3 + Node, ?> rootDiagram = mockNode(mock(BPMNDiagramImpl.class), 0, 0, 1000, 1000); + when(rootDiagram.getUUID()).thenReturn(DIAGRAM_UUID); + BpmnNode rootNode = mockBpmnNode(rootDiagram); + + subprocess1Node.setParent(rootNode); + subprocess2Node.setParent(subprocess1Node); + subprocess3Node.setParent(subprocess2Node); + graphBuilder.buildGraph(rootNode); + + //stunner model must have the relative coordinates + assertNodePosition(SUBPROCESS1_ID, subprocess1X, subprocess1Y); + assertNodePosition(SUBPROCESS2_ID, subprocess2X, subprocess2Y); + assertNodePosition(SUBPROCESS3_ID, subprocess3X, subprocess3Y); + } + + @SuppressWarnings("unchecked") + private void assertNodePosition(String uuid, double x, double y) { + Node, ?> node = graph.getNode(uuid); + assertNotNull(node); + Bounds bounds = node.getContent().getBounds(); + assertEquals(x, bounds.getUpperLeft().getX(), 0); + assertEquals(y, bounds.getUpperLeft().getY(), 0); + } + + public static BpmnNode mockBpmnNode(Node, ?> node) { + Bounds nodeBounds = node.getContent().getBounds(); + BasePropertyReader propertyReader = mock(BasePropertyReader.class); + BPMNShape shape = mock(BPMNShape.class); + org.eclipse.dd.dc.Bounds bounds = dc.createBounds(); + bounds.setX(nodeBounds.getUpperLeft().getX().floatValue()); + bounds.setY(nodeBounds.getUpperLeft().getY().floatValue()); + bounds.setWidth(Double.valueOf(nodeBounds.getWidth()).floatValue()); + bounds.setHeight(Double.valueOf(nodeBounds.getHeight()).floatValue()); + Bounds readerBounds = Bounds.create(nodeBounds.getUpperLeft().getX(), + nodeBounds.getUpperLeft().getY(), + nodeBounds.getLowerRight().getX(), + nodeBounds.getLowerRight().getY()); + when(propertyReader.getBounds()).thenReturn(readerBounds); + when(shape.getBounds()).thenReturn(bounds); + when(propertyReader.getShape()).thenReturn(shape); + return BpmnNode.of(node, propertyReader); + } + + public static Node, ?> mockNode(BPMNViewDefinition definition, double x, double y, double width, double height) { + return mockNode(definition, Bounds.create(x, y, x + width, y + height)); + } + + @SuppressWarnings("unchecked") + private static Node, ?> mockNode(BPMNViewDefinition definition, Bounds bounds) { + Node, ?> node = mock(Node.class); + View view = new ViewImpl<>(definition, bounds); + when(node.getContent()).thenReturn(view); + return node; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/ProcessPostConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/ProcessPostConverterTest.java new file mode 100644 index 00000000000..7936cf77704 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/ProcessPostConverterTest.java @@ -0,0 +1,292 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.dd.dc.Point; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessage; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessageKeys; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.BasePropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.SequenceFlowPropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent; +import org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent; +import org.kie.workbench.common.stunner.bpmn.definition.Lane; +import org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent; +import org.kie.workbench.common.stunner.bpmn.definition.UserTask; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.MagnetConnection; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.validation.Violation; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.dc; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.GraphBuilderTest.mockBpmnNode; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.GraphBuilderTest.mockNode; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class ProcessPostConverterTest { + + @Test + public void testPostConvert() { + + DefinitionResolver definitionResolver = mock(DefinitionResolver.class); + + double laneX = 80; + double laneY = 100; + double laneWidth = 500; + double laneHeight = 200; + RectangleDimensionsSet laneRectangleDimensionsSet = new RectangleDimensionsSet(laneWidth, laneHeight); + Lane laneDefinition = mock(Lane.class); + when(laneDefinition.getDimensionsSet()).thenReturn(laneRectangleDimensionsSet); + Node, ?> lane = mockNode(laneDefinition, laneX, laneY, laneWidth, laneHeight); + BpmnNode laneNode = mockBpmnNode(lane); + + double startEventX = 180; + double startEventY = 130; + double eventWidth = 56; + double eventHeight = 56; + Node, ?> startEvent = mockNode(mock(StartNoneEvent.class), startEventX + laneX, startEventY + laneY, eventWidth, eventHeight); + BpmnNode startEventNode = mockBpmnNode(startEvent); + + //subprocess is collapsed and has a boundaryEvent, and contains task1 and task2 (task2 has a boundaryEvent) + double subprocessX = 270; + double subprocessY = 180; + double subprocessWidth = 100; + double subprocessHeight = 60; + RectangleDimensionsSet subprocessRectangleDimensionsSet = new RectangleDimensionsSet(subprocessWidth, subprocessHeight); + EmbeddedSubprocess subprocessDefinition = mock(EmbeddedSubprocess.class); + when(subprocessDefinition.getDimensionsSet()).thenReturn(subprocessRectangleDimensionsSet); + Node, ?> subprocess = mockNode(subprocessDefinition, subprocessX + laneX, subprocessY + laneY, subprocessWidth, subprocessHeight); + BpmnNode subprocessNode = mockBpmnNode(subprocess); + BasePropertyReader subprocessPropertyReader = subprocessNode.getPropertyReader(); + when(subprocessPropertyReader.isExpanded()).thenReturn(false); + + double subprocessBoundaryEventX = subprocessWidth - 28; + double subprocessBoundaryEventY = (subprocessHeight / 2) - 28; + Node, ?> subprocessBoundaryEvent = mockNode(mock(IntermediateTimerEvent.class), subprocessBoundaryEventX, subprocessBoundaryEventY, eventWidth, eventHeight); + BpmnNode subprocessBoundaryEventNode = mockBpmnNode(subprocessBoundaryEvent).docked(); + + double task1X = 10; + double task1Y = 10; + double taskWidth = 200; + double taskHeight = 100; + Node, ?> task1 = mockNode(mock(UserTask.class), task1X, task1Y, taskWidth, taskHeight); + BpmnNode task1Node = mockBpmnNode(task1); + + double task2X = 300; + double task2Y = 200; + Node, ?> task2 = mockNode(mock(UserTask.class), task2X, task2Y, taskWidth, taskHeight); + BpmnNode task2Node = mockBpmnNode(task2); + + double task2BoundaryEventX = taskWidth - 28; + double task2BoundaryEventY = taskHeight - 28; + Node, ?> task2BoundaryEvent = mockNode(mock(IntermediateTimerEvent.class), task2BoundaryEventX, task2BoundaryEventY, eventWidth, eventHeight); + BpmnNode task2BoundaryEventNode = mockBpmnNode(task2BoundaryEvent).docked(); + + double endEventX = 450; + double endEventY = 230; + Node, ?> endEvent = mockNode(mock(EndNoneEvent.class), endEventX + laneX, endEventY + laneY, eventWidth, eventHeight); + BpmnNode endEventNode = mockBpmnNode(endEvent); + + double task3X = 500; + double task3Y = 600; + Node, ?> task3 = mockNode(mock(UserTask.class), task3X + laneX, task3Y + laneY, taskWidth, taskHeight); + BpmnNode task3Node = mockBpmnNode(task3); + + double task3BoundaryEventX = taskWidth - 28; + double task3BoundaryEventY = taskHeight - 28; + Node, ?> task3BoundaryEvent = mockNode(mock(IntermediateTimerEvent.class), task3BoundaryEventX, task3BoundaryEventY, eventWidth, eventHeight); + BpmnNode task3BoundaryEventNode = mockBpmnNode(task3BoundaryEvent).docked(); + + double task4X = 900; + double task4Y = 1000; + Node, ?> task4 = mockNode(mock(UserTask.class), task4X + laneX, task4Y + laneY, taskWidth, taskHeight); + BpmnNode task4Node = mockBpmnNode(task4); + + List controlPoints = new ArrayList<>(); + controlPoints.add(Point2D.create(900 + 100 + laneX, 700 + laneY)); + Connection sourceConnection = MagnetConnection.Builder.at(56, 28).setAuto(false); + Connection targetConnection = MagnetConnection.Builder.at(100, 0).setAuto(false); + + BPMNEdge bpmnEdge = mock(BPMNEdge.class); + BaseElement baseElement = mock(BaseElement.class); + SequenceFlowPropertyReader edgePropertyReader = mock(SequenceFlowPropertyReader.class); + when(edgePropertyReader.getDefinitionResolver()).thenReturn(definitionResolver); + when(edgePropertyReader.getElement()).thenReturn(baseElement); + when(baseElement.getId()).thenReturn("elementId"); + when(definitionResolver.getEdge("elementId")).thenReturn(bpmnEdge); + + EList wayPoints = ECollections.newBasicEList(); + wayPoints.add(mockPoint((float) (700 + 28 + laneX), (float) (700 + laneY))); + wayPoints.add(mockPoint((float) (1000 + laneX), (float) (700 + laneY))); + wayPoints.add(mockPoint((float) (900 + 100 + laneX), (float) (1000 + laneY))); + when(bpmnEdge.getWaypoint()).thenReturn(wayPoints); + + org.eclipse.dd.dc.Bounds sourceShapeBounds = mockBounds((float) (task3X + taskWidth - 28 + laneX), (float) (task3Y + taskHeight - 28 + laneY), (float) eventWidth, (float) eventHeight); + BPMNShape sourceShape = mockShape(sourceShapeBounds); + when(task3BoundaryEventNode.getPropertyReader().getShape()).thenReturn(sourceShape); + + org.eclipse.dd.dc.Bounds targetShapeBounds = mockBounds(task4.getContent().getBounds()); + BPMNShape targetShape = mockShape(targetShapeBounds); + when(task4Node.getPropertyReader().getShape()).thenReturn(targetShape); + + BpmnEdge.Simple edgeTask3BoundaryEventToTask4 = BpmnEdge.of(null, task3BoundaryEventNode, sourceConnection, controlPoints, task4Node, targetConnection, edgePropertyReader); + + Node, ?> diagram = mockNode(mock(BPMNDiagramImpl.class), 0, 0, 10000, 10000); + BpmnNode rootNode = mockBpmnNode(diagram); + + rootNode.addChild(laneNode); + laneNode.addChild(startEventNode); + laneNode.addChild(subprocessNode); + laneNode.addChild(subprocessBoundaryEventNode); + rootNode.addEdge(BpmnEdge.docked(subprocessNode, subprocessBoundaryEventNode)); + subprocessNode.addChild(task1Node); + subprocessNode.addChild(task2Node); + subprocessNode.addChild(task2BoundaryEventNode); + subprocessNode.addEdge(BpmnEdge.docked(task2Node, task2BoundaryEventNode)); + laneNode.addChild(task3Node); + laneNode.addChild(task3BoundaryEventNode); + laneNode.addChild(task4Node); + rootNode.addEdge(BpmnEdge.docked(task3Node, task3BoundaryEventNode)); + rootNode.addEdge(edgeTask3BoundaryEventToTask4); + laneNode.addChild(endEventNode); + + ProcessPostConverter postConverter = new ProcessPostConverter(); + when(definitionResolver.getResolutionFactor()).thenReturn(2d); + Result result = postConverter.postConvert(rootNode, definitionResolver); + + Bounds startEventBounds = startEventNode.value().getContent().getBounds(); + //preserves original position + assertEquals(laneX + startEventX, startEventBounds.getUpperLeft().getX(), 0); + assertEquals(laneY + startEventY, startEventBounds.getUpperLeft().getY(), 0); + assertEquals(eventWidth, startEventBounds.getWidth(), 0); + assertEquals(eventHeight, startEventBounds.getHeight(), 0); + + Bounds subProcessBounds = subprocessNode.value().getContent().getBounds(); + //was properly resized and preserves original position + assertEquals(laneX + subprocessX, subProcessBounds.getUpperLeft().getX(), 0); + assertEquals(laneY + subprocessY, subProcessBounds.getUpperLeft().getY(), 0); + assertEquals(300 + 200 + 10, subProcessBounds.getWidth(), 0); + assertEquals(200 + 100 + 10, subProcessBounds.getHeight(), 0); + + Bounds subProcessBoundaryEventBounds = subprocessBoundaryEventNode.value().getContent().getBounds(); + //boundary event was properly located + assertEquals(subProcessBounds.getWidth() - 28, subProcessBoundaryEventBounds.getUpperLeft().getX(), 0); + assertEquals(subProcessBounds.getHeight() / subprocessHeight * subprocessBoundaryEventY, subProcessBoundaryEventBounds.getUpperLeft().getY(), 0); + + Bounds task1Bounds = task1Node.value().getContent().getBounds(); + //was properly positioned and preserves size + assertEquals(laneX + subprocessX + task1X, task1Bounds.getUpperLeft().getX(), 0); + assertEquals(laneY + subprocessY + task1Y, task1Bounds.getUpperLeft().getY(), 0); + assertEquals(taskWidth, task1Bounds.getWidth(), 0); + assertEquals(taskHeight, task1Bounds.getHeight(), 0); + + Bounds task2Bounds = task2Node.value().getContent().getBounds(); + //was properly positioned and preserves size + assertEquals(laneX + subprocessX + task2X, task2Bounds.getUpperLeft().getX(), 0); + assertEquals(laneY + subprocessY + task2Y, task2Bounds.getUpperLeft().getY(), 0); + assertEquals(taskWidth, task1Bounds.getWidth(), 0); + assertEquals(taskHeight, task1Bounds.getHeight(), 0); + + Bounds task2BoundaryEventBounds = task2BoundaryEventNode.value().getContent().getBounds(); + //is relative to the task2 in the converted model and preserves size + assertEquals(task2BoundaryEventX, task2BoundaryEventBounds.getUpperLeft().getX(), 0); + assertEquals(task2BoundaryEventY, task2BoundaryEventBounds.getUpperLeft().getY(), 0); + assertEquals(eventWidth, task2BoundaryEventBounds.getWidth(), 0); + assertEquals(eventHeight, task2BoundaryEventBounds.getHeight(), 0); + + Bounds endEventBounds = endEventNode.value().getContent().getBounds(); + double subprocessDeltaX = subProcessBounds.getWidth() - subprocessWidth; + double subprocessDeltaY = subProcessBounds.getHeight() - subprocessHeight; + //was properly moved after the subprocess resize + assertEquals(laneX + endEventX + subprocessDeltaX, endEventBounds.getUpperLeft().getX(), 0); + assertEquals(laneY + endEventY + subprocessDeltaY, endEventBounds.getUpperLeft().getY(), 0); + + Bounds task3Bounds = task3Node.value().getContent().getBounds(); + //was properly moved after the subprocess resize + assertEquals(laneX + task3X + subprocessDeltaX, task3Bounds.getUpperLeft().getX(), 0); + assertEquals(laneY + task3Y + subprocessDeltaY, task3Bounds.getUpperLeft().getY(), 0); + + Bounds task3BoundaryEventBounds = task3BoundaryEventNode.value().getContent().getBounds(); + //is relative to the task3 in the converted model and preserves size + assertEquals(task3BoundaryEventX, task3BoundaryEventBounds.getUpperLeft().getX(), 0); + assertEquals(task3BoundaryEventY, task3BoundaryEventBounds.getUpperLeft().getY(), 0); + assertEquals(eventWidth, task3BoundaryEventBounds.getWidth(), 0); + assertEquals(eventHeight, task3BoundaryEventBounds.getHeight(), 0); + + Bounds task4Bounds = task4Node.value().getContent().getBounds(); + //was properly moved after the subprocess resize + assertEquals(laneX + task4X + subprocessDeltaX, task4Bounds.getUpperLeft().getX(), 0); + assertEquals(laneY + task4Y + subprocessDeltaY, task4Bounds.getUpperLeft().getY(), 0); + + //edgeTask3BoundaryEventToTask4 was properly translated and magnets are ok + assertEquals(56, edgeTask3BoundaryEventToTask4.getSourceConnection().getLocation().getX(), 0); + assertEquals(28, edgeTask3BoundaryEventToTask4.getSourceConnection().getLocation().getY(), 0); + assertEquals(task4Node.value().getContent().getBounds().getUpperLeft().getX() + taskWidth / 2, controlPoints.get(0).getX(), 0); + assertEquals(task3Node.value().getContent().getBounds().getLowerRight().getY(), controlPoints.get(0).getY(), 0); + + //assert the message result + List messages = result.messages(); + assertEquals(1, messages.size()); + MarshallingMessage message = messages.get(0); + assertEquals(Violation.Type.WARNING, message.getViolationType()); + assertEquals(MarshallingMessageKeys.collapsedElementExpanded, message.getMessageKey()); + } + + private static Point mockPoint(float x, float y) { + Point point = mock(Point.class); + when(point.getX()).thenReturn(x); + when(point.getY()).thenReturn(y); + return point; + } + + private static org.eclipse.dd.dc.Bounds mockBounds(float x, float y, float width, float height) { + org.eclipse.dd.dc.Bounds bounds = dc.createBounds(); + bounds.setX(x); + bounds.setY(y); + bounds.setWidth(width); + bounds.setHeight(height); + return bounds; + } + + private static org.eclipse.dd.dc.Bounds mockBounds(Bounds bounds) { + return mockBounds((float) bounds.getX(), (float) bounds.getY(), (float) bounds.getWidth(), (float) bounds.getHeight()); + } + + private static BPMNShape mockShape(org.eclipse.dd.dc.Bounds bounds) { + BPMNShape shape = mock(BPMNShape.class); + when(shape.getBounds()).thenReturn(bounds); + return shape; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/activities/CallActivityConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/activities/CallActivityConverterTest.java new file mode 100644 index 00000000000..a9479e094cb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/activities/CallActivityConverterTest.java @@ -0,0 +1,197 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.activities; + +import org.eclipse.bpmn2.CallActivity; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.CallActivityPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ReusableSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; +import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class CallActivityConverterTest { + + private static final String UUID = "UUID"; + private static final String NAME = "NAME"; + private static final String DOCUMENTATION = "DOCUMENTATION"; + private static final String CALLED_ELEMENT = "CALLED_ELEMENT"; + private static final Boolean INDEPENDENT = Boolean.TRUE; + private static final Boolean ABORT_PARENT = Boolean.TRUE; + private static final Boolean WAIT_FOR_COMPLETION = Boolean.TRUE; + private static final Boolean IS_ASYNC = Boolean.TRUE; + private static final Boolean SEQUENTIAL = Boolean.TRUE; + private static final String COLLECTION_INPUT = "COLLECTION_INPUT"; + private static final String COLLECTION_OUTPUT = "COLLECTION_OUTPUT"; + private static final String DATA_INPUT = "DATA_INPUT"; + private static final String DATA_OUTPUT = "DATA_OUTPUT"; + private static final String COMPLETION_CONDITION = "COMPLETION_CONDITION"; + private static final ScriptTypeListValue ON_ENTRY_ACTION = new ScriptTypeListValue(); + private static final ScriptTypeListValue ON_EXIT_ACTION = new ScriptTypeListValue(); + private static final Bounds BOUNDS = Bounds.create(); + private static final SimulationSet SIMULATION_SET = new SimulationSet(); + private static final RectangleDimensionsSet RECTANGLE_DIMENSIONS_SET = new RectangleDimensionsSet(); + private static final FontSet FONT_SET = new FontSet(); + private static final BackgroundSet BACKGROUND_SET = new BackgroundSet(); + private static final AssignmentsInfo ASSIGNMENTS_INFO = new AssignmentsInfo(); + private static final String SLA_DUE_DATE = "12/25/1983"; + + @Mock + private TypedFactoryManager factoryManager; + + @Mock + private PropertyReaderFactory propertyReaderFactory; + + @Mock + private CallActivityPropertyReader propertyReader; + + @Mock + private CallActivity callActivity; + + private CallActivityConverter converter; + + @Before + public void setUp() { + final ReusableSubprocess definition = new ReusableSubprocess(new BPMNGeneralSet(), + new ReusableSubprocessTaskExecutionSet(), + new DataIOSet(), + new BackgroundSet(), + new FontSet(), + new RectangleDimensionsSet(), + new SimulationSet()); + final View view = new ViewImpl<>(definition, Bounds.create()); + Node, Edge> node = new NodeImpl<>(UUID); + node.setContent(view); + + when(callActivity.getId()).thenReturn(UUID); + when(callActivity.getCalledElement()).thenReturn(CALLED_ELEMENT); + when(factoryManager.newNode(eq(UUID), eq(ReusableSubprocess.class))).thenReturn(node); + when(propertyReaderFactory.of(callActivity)).thenReturn(propertyReader); + + when(propertyReader.getName()).thenReturn(NAME); + when(propertyReader.getDocumentation()).thenReturn(DOCUMENTATION); + when(propertyReader.getAssignmentsInfo()).thenReturn(ASSIGNMENTS_INFO); + when(propertyReader.getBounds()).thenReturn(BOUNDS); + when(propertyReader.getSimulationSet()).thenReturn(SIMULATION_SET); + when(propertyReader.getRectangleDimensionsSet()).thenReturn(RECTANGLE_DIMENSIONS_SET); + when(propertyReader.getFontSet()).thenReturn(FONT_SET); + when(propertyReader.getBackgroundSet()).thenReturn(BACKGROUND_SET); + when(propertyReader.isIndependent()).thenReturn(INDEPENDENT); + when(propertyReader.isAbortParent()).thenReturn(ABORT_PARENT); + when(propertyReader.isWaitForCompletion()).thenReturn(WAIT_FOR_COMPLETION); + when(propertyReader.isAsync()).thenReturn(IS_ASYNC); + when(propertyReader.isSequential()).thenReturn(SEQUENTIAL); + when(propertyReader.getCollectionOutput()).thenReturn(COLLECTION_OUTPUT); + when(propertyReader.getCollectionInput()).thenReturn(COLLECTION_INPUT); + when(propertyReader.getDataInput()).thenReturn(DATA_INPUT); + when(propertyReader.getDataOutput()).thenReturn(DATA_OUTPUT); + when(propertyReader.getCompletionCondition()).thenReturn(COMPLETION_CONDITION); + when(propertyReader.getOnEntryAction()).thenReturn(ON_ENTRY_ACTION); + when(propertyReader.getOnExitAction()).thenReturn(ON_EXIT_ACTION); + when(propertyReader.getSlaDueDate()).thenReturn(SLA_DUE_DATE); + + converter = new CallActivityConverter(factoryManager, propertyReaderFactory); + } + + @Test + @SuppressWarnings("unchecked") + public void testConvertMI() { + when(propertyReader.isMultipleInstance()).thenReturn(true); + BpmnNode bpmnNode = converter.convert(callActivity).value(); + Node, Edge> result = (Node, Edge>) bpmnNode.value(); + assertCommonValues(result); + + assertTrue(result.getContent().getDefinition().getExecutionSet().getIsMultipleInstance().getValue()); + assertEquals(SEQUENTIAL, result.getContent().getDefinition().getExecutionSet().getMultipleInstanceExecutionMode().isSequential()); + assertEquals(COLLECTION_INPUT, result.getContent().getDefinition().getExecutionSet().getMultipleInstanceCollectionInput().getValue()); + assertEquals(COLLECTION_OUTPUT, result.getContent().getDefinition().getExecutionSet().getMultipleInstanceCollectionOutput().getValue()); + assertEquals(DATA_INPUT, result.getContent().getDefinition().getExecutionSet().getMultipleInstanceDataInput().getValue()); + assertEquals(DATA_OUTPUT, result.getContent().getDefinition().getExecutionSet().getMultipleInstanceDataOutput().getValue()); + assertEquals(COMPLETION_CONDITION, result.getContent().getDefinition().getExecutionSet().getMultipleInstanceCompletionCondition().getValue()); + } + + @Test + @SuppressWarnings("unchecked") + public void testConvertNonMI() { + when(propertyReader.isMultipleInstance()).thenReturn(false); + when(propertyReader.isSequential()).thenReturn(false); + when(propertyReader.getCollectionOutput()).thenReturn(null); + when(propertyReader.getCollectionInput()).thenReturn(null); + when(propertyReader.getDataInput()).thenReturn(null); + when(propertyReader.getDataOutput()).thenReturn(null); + when(propertyReader.getCompletionCondition()).thenReturn(null); + + BpmnNode bpmnNode = converter.convert(callActivity).value(); + Node, Edge> result = (Node, Edge>) bpmnNode.value(); + assertCommonValues(result); + + assertEquals(false, result.getContent().getDefinition().getExecutionSet().getIsMultipleInstance().getValue()); + assertFalse(result.getContent().getDefinition().getExecutionSet().getMultipleInstanceExecutionMode().isSequential()); + assertNull(result.getContent().getDefinition().getExecutionSet().getMultipleInstanceCollectionInput().getValue()); + assertNull(result.getContent().getDefinition().getExecutionSet().getMultipleInstanceCollectionOutput().getValue()); + assertNull(result.getContent().getDefinition().getExecutionSet().getMultipleInstanceDataInput().getValue()); + assertNull(result.getContent().getDefinition().getExecutionSet().getMultipleInstanceDataOutput().getValue()); + assertNull(result.getContent().getDefinition().getExecutionSet().getMultipleInstanceCompletionCondition().getValue()); + } + + private void assertCommonValues(Node, Edge> result) { + assertEquals(UUID, result.getUUID()); + assertEquals(NAME, result.getContent().getDefinition().getGeneral().getName().getValue()); + assertEquals(DOCUMENTATION, result.getContent().getDefinition().getGeneral().getDocumentation().getValue()); + assertEquals(ASSIGNMENTS_INFO, result.getContent().getDefinition().getDataIOSet().getAssignmentsinfo()); + assertEquals(BOUNDS, result.getContent().getBounds()); + assertEquals(SIMULATION_SET, result.getContent().getDefinition().getSimulationSet()); + assertEquals(RECTANGLE_DIMENSIONS_SET, result.getContent().getDefinition().getDimensionsSet()); + assertEquals(FONT_SET, result.getContent().getDefinition().getFontSet()); + assertEquals(BACKGROUND_SET, result.getContent().getDefinition().getBackgroundSet()); + assertEquals(CALLED_ELEMENT, result.getContent().getDefinition().getExecutionSet().getCalledElement().getValue()); + assertEquals(INDEPENDENT, result.getContent().getDefinition().getExecutionSet().getIndependent().getValue()); + assertEquals(ABORT_PARENT, result.getContent().getDefinition().getExecutionSet().getAbortParent().getValue()); + assertEquals(WAIT_FOR_COMPLETION, result.getContent().getDefinition().getExecutionSet().getWaitForCompletion().getValue()); + assertEquals(IS_ASYNC, result.getContent().getDefinition().getExecutionSet().getIsAsync().getValue()); + assertEquals(ON_ENTRY_ACTION, result.getContent().getDefinition().getExecutionSet().getOnEntryAction().getValue()); + assertEquals(ON_EXIT_ACTION, result.getContent().getDefinition().getExecutionSet().getOnExitAction().getValue()); + assertEquals(SLA_DUE_DATE, result.getContent().getDefinition().getExecutionSet().getSlaDueDate().getValue()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/associations/AssociationConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/associations/AssociationConverterTest.java new file mode 100644 index 00000000000..e739e79950c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/associations/AssociationConverterTest.java @@ -0,0 +1,187 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.associations; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.bpmn2.Association; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnEdge; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.AssociationPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.definition.DirectionalAssociation; +import org.kie.workbench.common.stunner.bpmn.definition.NonDirectionalAssociation; +import org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class AssociationConverterTest { + + private static final String ASSOCIATION_ID = "ASSOCIATION_ID"; + + private static final String ASSOCIATION_DOCUMENTATION = "ASSOCIATION_DOCUMENTATION"; + + private static final String SOURCE_ID = "SOURCE_ID"; + + private static final String TARGET_ID = "TARGET_ID"; + + @Mock + private PropertyReaderFactory propertyReaderFactory; + + @Mock + private TypedFactoryManager factoryManager; + + @Mock + private Edge, Node> edge; + + @Mock + private View content; + + @Mock + private org.kie.workbench.common.stunner.bpmn.definition.Association definition; + + @Captor + private ArgumentCaptor generalSetCaptor; + + @Mock + private Association association; + + @Mock + private AssociationPropertyReader associationReader; + + private AssociationConverter associationConverter; + + private Map nodes; + + @Mock + private BpmnNode sourceNode; + + @Mock + private BpmnNode targetNode; + + @Mock + private Connection sourceConnection; + + @Mock + private Connection targetConnection; + + @Mock + private List controlPoints; + + @Mock + private Edge, Node> edgeNonDirectional; + + @Mock + private View contentNonDirectional; + + @Mock + private NonDirectionalAssociation definitionNonDirectional; + + @Before + @SuppressWarnings("unchecked") + public void setUp() { + when(association.getId()).thenReturn(ASSOCIATION_ID); + when(edge.getContent()).thenReturn(content); + when(content.getDefinition()).thenReturn(definition); + when(factoryManager.newEdge(ASSOCIATION_ID, DirectionalAssociation.class)).thenReturn((Edge) edge); + when(propertyReaderFactory.of(association)).thenReturn(associationReader); + when(associationReader.getAssociationByDirection()).thenAnswer(a -> DirectionalAssociation.class); + when(associationReader.getDocumentation()).thenReturn(ASSOCIATION_DOCUMENTATION); + when(associationReader.getSourceId()).thenReturn(SOURCE_ID); + when(associationReader.getTargetId()).thenReturn(TARGET_ID); + when(associationReader.getSourceConnection()).thenReturn(sourceConnection); + when(associationReader.getTargetConnection()).thenReturn(targetConnection); + when(associationReader.getControlPoints()).thenReturn(controlPoints); + + associationConverter = new AssociationConverter(factoryManager, propertyReaderFactory); + nodes = new HashMap<>(); + nodes.put(SOURCE_ID, sourceNode); + nodes.put(TARGET_ID, targetNode); + } + + @Test + public void testConvertEdge() { + associationConverter.convertEdge(association, nodes); + verify(definition).setGeneral(generalSetCaptor.capture()); + assertEquals(ASSOCIATION_DOCUMENTATION, generalSetCaptor.getValue().getDocumentation().getValue()); + assertEdgeWithConnections(); + } + + private void assertEdgeWithConnections() { + BpmnEdge.Simple result = (BpmnEdge.Simple) associationConverter.convertEdge(association, nodes).value(); + assertEquals(sourceNode, result.getSource()); + assertEquals(targetNode, result.getTarget()); + assertEquals(sourceConnection, result.getSourceConnection()); + assertEquals(targetConnection, result.getTargetConnection()); + assertEquals(controlPoints, result.getControlPoints()); + assertEquals(edge, result.getEdge()); + } + + @Test + public void testConvertEdgeNonDirectional() { + when(factoryManager.newEdge(ASSOCIATION_ID, NonDirectionalAssociation.class)).thenReturn((Edge) edgeNonDirectional); + when(associationReader.getAssociationByDirection()).thenAnswer(a -> NonDirectionalAssociation.class); + when(edgeNonDirectional.getContent()).thenReturn(contentNonDirectional); + when(contentNonDirectional.getDefinition()).thenReturn(definitionNonDirectional); + + BpmnEdge.Simple result = (BpmnEdge.Simple) associationConverter.convertEdge(association, nodes).value(); + assertEquals(edgeNonDirectional, result.getEdge()); + } + + @Test + public void testConvertIgnoredEdge() { + //assert connections + assertEdgeWithConnections(); + + //now remove the source node + nodes.remove(SOURCE_ID); + + BpmnEdge.Simple result = (BpmnEdge.Simple) associationConverter.convertEdge(association, nodes).value(); + assertNull(result); + + //add source node and remove target + nodes.put(SOURCE_ID, sourceNode); + nodes.remove(TARGET_ID); + + result = (BpmnEdge.Simple) associationConverter.convertEdge(association, nodes).value(); + assertNull(result); + + //adding both again + nodes.put(SOURCE_ID, sourceNode); + nodes.put(TARGET_ID, targetNode); + assertEdgeWithConnections(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/BoundaryEventConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/BoundaryEventConverterTest.java new file mode 100644 index 00000000000..fd497cbeae2 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/events/BoundaryEventConverterTest.java @@ -0,0 +1,91 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.events; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.BoundaryEvent; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.soup.commons.util.Maps; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnEdge; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class BoundaryEventConverterTest { + + public static final String PARENT_ID = "1"; + public static final String CHILD_ID = "2"; + private BoundaryEventConverter tested; + + @Mock + protected BpmnNode node1; + + @Mock + protected BpmnNode node2; + + @Mock + private BoundaryEvent event; + + @Mock + private Activity ref; + + @Before + public void setUp() throws Exception { + + tested = new BoundaryEventConverter(); + + when(event.getAttachedToRef()).thenReturn(ref); + when(ref.getId()).thenReturn(PARENT_ID); + when(event.getId()).thenReturn(CHILD_ID); + } + + @Test + public void convertEdge() { + Map nodes = new Maps.Builder() + .put(PARENT_ID, node1) + .put(CHILD_ID, node2) + .build(); + + Result result = tested.convertEdge(event, nodes); + BpmnEdge value = result.value(); + assertTrue(result.isSuccess()); + assertEquals(node1, value.getSource()); + assertEquals(node2, value.getTarget()); + assertTrue(value.isDocked()); + } + + @Test + public void convertMissingNodes() { + Map nodes = new HashMap<>(); + Result result = tested.convertEdge(event, nodes); + BpmnEdge value = result.value(); + assertTrue(result.isIgnored()); + assertNull(value); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/gateways/GatewayConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/gateways/GatewayConverterTest.java new file mode 100644 index 00000000000..079de21187f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/gateways/GatewayConverterTest.java @@ -0,0 +1,136 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.gateways; + +import org.eclipse.bpmn2.Gateway; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.GatewayPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.definition.BaseGateway; +import org.kie.workbench.common.stunner.bpmn.definition.EventGateway; +import org.kie.workbench.common.stunner.bpmn.definition.ExclusiveGateway; +import org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway; +import org.kie.workbench.common.stunner.bpmn.definition.ParallelGateway; +import org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.CircleDimensionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.newNode; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class GatewayConverterTest { + + private static final String UUID = "UUID"; + private static final String NAME = "NAME"; + private static final String DOCUMENTATION = "DOCUMENTATION"; + private static final String DEFAULT_ROUTE = "DEFAULT_ROUTE"; + + @Mock + private TypedFactoryManager factoryManager; + + @Mock + private PropertyReaderFactory readerFactory; + + @Mock + private GatewayPropertyReader propertyReader; + + @Mock + private CircleDimensionSet circleDimensionSet; + + @Mock + private FontSet fontSet; + + @Mock + private BackgroundSet backgroundSet; + + @Mock + private Bounds bounds; + + private GatewayConverter converter; + + @Before + public void setUp() { + when(propertyReader.getName()).thenReturn(NAME); + when(propertyReader.getDocumentation()).thenReturn(DOCUMENTATION); + when(propertyReader.getDefaultRoute()).thenReturn(DEFAULT_ROUTE); + when(propertyReader.getBounds()).thenReturn(bounds); + when(propertyReader.getCircleDimensionSet()).thenReturn(circleDimensionSet); + when(propertyReader.getFontSet()).thenReturn(fontSet); + when(propertyReader.getBackgroundSet()).thenReturn(backgroundSet); + converter = new GatewayConverter(factoryManager, readerFactory, MarshallingRequest.Mode.AUTO); + } + + @Test + public void testConvertInclusiveGateway() { + InclusiveGateway result = testConvertGateway(new InclusiveGateway(), bpmn2.createInclusiveGateway()); + assertEquals(DEFAULT_ROUTE, result.getExecutionSet().getDefaultRoute().getValue()); + } + + @Test + public void testConvertExclusiveGateway() { + ExclusiveGateway result = testConvertGateway(new ExclusiveGateway(), bpmn2.createExclusiveGateway()); + assertEquals(DEFAULT_ROUTE, result.getExecutionSet().getDefaultRoute().getValue()); + } + + @Test + public void testConvertParallelGateway() { + testConvertGateway(new ParallelGateway(), bpmn2.createParallelGateway()); + } + + @Test + public void testConvertEventGateway() { + testConvertGateway(new EventGateway(), bpmn2.createEventBasedGateway()); + } + + @SuppressWarnings("unchecked") + private D testConvertGateway(D gatewayDefinition, G eclipseGateway) { + when(readerFactory.of(any(eclipseGateway.getClass()))).thenReturn(propertyReader); + Node, Edge> node = (Node, Edge>) newNode(UUID, gatewayDefinition); + when(factoryManager.newNode(UUID, (Class) gatewayDefinition.getClass())).thenReturn(node); + + eclipseGateway.setId(UUID); + BpmnNode bpmnNode = converter.convert(eclipseGateway).value(); + assertEquals(UUID, bpmnNode.value().getUUID()); + D result = (D) bpmnNode.value().getContent().getDefinition(); + assertCommonValues(result, node); + return node.getContent().getDefinition(); + } + + private void assertCommonValues(BaseGateway baseGateway, Node node) { + assertEquals(NAME, baseGateway.getGeneral().getName().getValue()); + assertEquals(DOCUMENTATION, baseGateway.getGeneral().getDocumentation().getValue()); + assertEquals(backgroundSet, baseGateway.getBackgroundSet()); + assertEquals(fontSet, baseGateway.getFontSet()); + assertEquals(circleDimensionSet, baseGateway.getDimensionsSet()); + assertEquals(bounds, node.getContent().getBounds()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/ProcessConverterDelegateTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/ProcessConverterDelegateTest.java new file mode 100644 index 00000000000..f28759fb0d3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/ProcessConverterDelegateTest.java @@ -0,0 +1,331 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.processes; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.Bpmn2Factory; +import org.eclipse.bpmn2.DataObject; +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.FlowElement; +import org.eclipse.bpmn2.FlowNode; +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.LaneSet; +import org.eclipse.bpmn2.ManualTask; +import org.eclipse.bpmn2.SequenceFlow; +import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.di.BPMNPlane; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.bpmn2.impl.LaneImpl; +import org.eclipse.dd.dc.Bounds; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.soup.commons.util.Maps; +import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; +import org.kie.workbench.common.stunner.bpmn.BPMNTestDefinitionFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessage; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingMessageKeys; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BaseConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.ConverterFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.BasePropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.core.backend.StunnerTestingGraphBackendAPI; +import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; +import org.kie.workbench.common.stunner.core.validation.Violation; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class ProcessConverterDelegateTest { + + @Mock + private PropertyReaderFactory propertyReaderFactory; + + private DefinitionResolver definitionResolver; + + private BaseConverterFactory factory; + + @Mock + private BasePropertyReader basePropertyReader; + + @Mock + private org.eclipse.bpmn2.Process process; + + @Mock + private BPMNDiagram diagram; + + @Mock + private BPMNPlane plane; + + private BpmnNode parentNode; + + private ProcessConverterDelegate converterDelegate; + + @Mock + private Definitions definitions; + + @Before + public void setUp() throws Exception { + parentNode = new BpmnNode.Simple(new NodeImpl<>("ParentNode"), basePropertyReader); + when(diagram.getPlane()).thenReturn(plane); + when(definitions.getRootElements()).thenReturn(ECollections.singletonEList(process)); + when(definitions.getDiagrams()).thenReturn(ECollections.singletonEList(diagram)); + when(definitions.getRelationships()).thenReturn(ECollections.newBasicEList()); + when(plane.getPlaneElement()).thenReturn(ECollections.newBasicEList()); + definitionResolver = new DefinitionResolver(definitions, Collections.emptyList()); + StunnerTestingGraphBackendAPI api = StunnerTestingGraphBackendAPI.build(BPMNDefinitionSet.class, + new BPMNTestDefinitionFactory()); + TypedFactoryManager typedFactoryManager = new TypedFactoryManager(api.getFactoryManager()); + factory = new ConverterFactory(definitionResolver, typedFactoryManager); + converterDelegate = new ProcessConverterDelegate(typedFactoryManager, + propertyReaderFactory, + definitionResolver, + factory); + } + + @Test + public void testConvertEdges() { + Task task1 = mockTask("1"); + Task task2 = mockTask("2"); + BpmnNode task1Node = mockTaskNode(task1); + BpmnNode task2Node = mockTaskNode(task2); + SequenceFlow sequenceFlow = mockSequenceFlow("seq1", task1, task2); + List elements = Arrays.asList(sequenceFlow, task1, task2); + + //ignored because there the tasks are not on the nodes map + assertFalse(converterDelegate.convertEdges(parentNode, elements, new HashMap<>()).value()); + + //convert with all nodes + Map nodes = new Maps.Builder().put(task1.getId(), task1Node).put(task2.getId(), task2Node).build(); + assertTrue(converterDelegate.convertEdges(parentNode, elements, nodes).value()); + } + + private BpmnNode.Simple mockTaskNode(Task task) { + BPMNShape shape = mock(BPMNShape.class); + when(shape.getBounds()).thenReturn(mock(Bounds.class)); + plane.getPlaneElement().add(shape); + when(shape.getBpmnElement()).thenReturn(task); + return new BpmnNode.Simple(new NodeImpl<>(task.getId()), basePropertyReader); + } + + private SequenceFlow mockSequenceFlow(String id, FlowNode source, FlowNode target) { + SequenceFlow sequenceFlow = Bpmn2Factory.eINSTANCE.createSequenceFlow(); + sequenceFlow.setSourceRef(source); + sequenceFlow.setTargetRef(target); + sequenceFlow.setId(id); + + BPMNEdge shape = mock(BPMNEdge.class); + when(shape.getWaypoint()).thenReturn(ECollections.emptyEList()); + plane.getPlaneElement().add(shape); + when(shape.getBpmnElement()).thenReturn(sequenceFlow); + return sequenceFlow; + } + + @Test + public void testConvertEdgesIgnoredNonEdgeElement() { + Map nodes = new HashMap<>(); + List elements = Arrays.asList(mockTask("1")); + assertFalse(converterDelegate.convertEdges(parentNode, elements, nodes).value()); + } + + // TODO: Kogito - @Test + public void testConvertUnsupportedChildNodes() { + List laneSets = Collections.emptyList(); + //adding 2 supported and 2 unsupported elements + List flowElements = Arrays.asList(mockTask("1"), + mockTask("2"), + mockUnsupportedTask("3"), + mockUnsupportedDataObject("4")); + + Result> result = converterDelegate.convertChildNodes(parentNode, flowElements, laneSets); + List messages = result.messages(); + //check one message per unsupported element + assertEquals(2, messages.size()); + assertTrue(messages.stream().map(MarshallingMessage::getViolationType).allMatch(Violation.Type.WARNING::equals)); + } + + // TODO: Kogito - @Test + public void testConvertLanes() { + Task task0_1 = mockTask("TASK0_1"); + Task task0_2 = mockTask("TASK0_2"); + Task task0_3 = mockTask("TASK0_3"); + + Task task1_1 = mockTask("TASK1_1"); + Lane lane1 = mockLane("Lane1", "Lane1Name", task1_1); + + Task task2_1 = mockTask("TASK2_1"); + Lane lane2 = mockLane("Lane2", "Lane2Name", task2_1); + LaneSet laneSet1 = mockLaneSet("LaneSet1", lane1, lane2); + + Task task3_2_1 = mockTask("TASK3_2_1"); + Task task3_2_2 = mockTask("TASK3_2_2"); + Lane lane3_2 = mockLane("Lane3_2", "Lane3_2Name", task3_2_1, task3_2_2); + + Task task3_1_2_1 = mockTask("TASK3_1_2_1"); + Lane lane3_1_2 = mockLane("Lane3_1_2", "Lane3_1_2Name", task3_1_2_1); + + Task task3_1_1_1_1 = mockTask("task3_1_1_1_1"); + Lane lane3_1_1_1 = mockLane("Lane3_1_1_1", "lane3_1_1_1Name", task3_1_1_1_1); + + Task task3_1_1_2_1 = mockTask("task3_1_1_2_1"); + Lane lane3_1_1_2 = mockLane("Lane3_1_1_2", "lane3_1_1_2Name", task3_1_1_2_1); + + Lane lane3_1_1 = mockLane("Lane3_1_1", "Lane3_1_1Name", mockLaneSet("laneSet3_1_1", lane3_1_1_1, lane3_1_1_2)); + + Lane lane3_1 = mockLane("Lane3_1", "Lane3_1Name", mockLaneSet("laneSet3_1", lane3_1_1, lane3_1_2)); + + Lane lane3 = mockLane("Lane3", "Lane3Name", mockLaneSet("LaneSet3", lane3_1, lane3_2)); + LaneSet laneSet2 = mockLaneSet("LaneSet2", lane3); + + List flowElements = Arrays.asList(task0_1, task0_2, task0_3, task1_1, task2_1, task3_1_1_1_1, + task3_1_1_2_1, task3_1_2_1, task3_2_1, task3_2_2); + List laneSets = Arrays.asList(laneSet1, laneSet2); + + Result> result = converterDelegate.convertChildNodes(parentNode, flowElements, laneSets); + Map nodes = result.value(); + assertEquals(16, nodes.size()); + + assertEquals(9, parentNode.getChildren().size()); + assertHasChildren(parentNode, task0_1.getId(), task0_2.getId(), task0_3.getId(), lane1.getId(), lane2.getId(), + lane3_2.getId(), lane3_1_2.getId(), lane3_1_1_1.getId(), lane3_1_1_2.getId()); + + BpmnNode lane1Node = getChildById(parentNode, lane1.getId()); + assertNotNull(lane1Node); + assertHasChildren(lane1Node, task1_1.getId()); + + BpmnNode lane2Node = getChildById(parentNode, lane2.getId()); + assertNotNull(lane2Node); + assertHasChildren(lane2Node, task2_1.getId()); + + BpmnNode lane3_1_1_1Node = getChildById(parentNode, lane3_1_1_1.getId()); + assertNotNull(lane3_1_1_1Node); + assertHasChildren(lane3_1_1_1Node, task3_1_1_1_1.getId()); + + BpmnNode lane3_1_1_2Node = getChildById(parentNode, lane3_1_1_2.getId()); + assertNotNull(lane3_1_1_2Node); + assertHasChildren(lane3_1_1_2Node, task3_1_1_2_1.getId()); + + BpmnNode lane3_1_2Node = getChildById(parentNode, lane3_1_2.getId()); + assertNotNull(lane3_1_2Node); + assertHasChildren(lane3_1_2Node, task3_1_2_1.getId()); + + BpmnNode lane3_2Node = getChildById(parentNode, lane3_2.getId()); + assertHasChildren(lane3_2Node); + assertHasChildren(lane3_2Node, task3_2_1.getId(), task3_2_2.getId()); + + //assert messages for converted lane sets + List messages = result.messages(); + assertEquals(4, messages.size()); + assertTrue(messages.stream() + .map(MarshallingMessage::getMessageKey) + .allMatch(MarshallingMessageKeys.childLaneSetConverted::equals)); + } + + private static void assertHasChildren(BpmnNode bpmnNode, String... nodeIds) { + Arrays.stream(nodeIds).forEach(nodeId -> assertTrue(bpmnNode.getChildren().stream().anyMatch(child -> Objects.equals(child.value().getUUID(), nodeId)))); + } + + private static BpmnNode getChildById(BpmnNode bpmnNode, String nodeId) { + return bpmnNode.getChildren().stream().filter(child -> Objects.equals(child.value().getUUID(), nodeId)).findFirst().orElse(null); + } + + private static Task mockTask(String id) { + Task task = Bpmn2Factory.eINSTANCE.createTask(); + task.setId(id); + return task; + } + + private static Task mockUnsupportedTask(String id) { + ManualTask task = Bpmn2Factory.eINSTANCE.createManualTask(); + task.setId(id); + return task; + } + + private static DataObject mockUnsupportedDataObject(String id) { + DataObject element = Bpmn2Factory.eINSTANCE.createDataObject(); + element.setId(id); + return element; + } + + private static LaneSet mockLaneSet(String name, Lane... children) { + LaneSet laneSet = mock(LaneSet.class); + laneSet.setName(name); + when(laneSet.getName()).thenReturn(name); + when(laneSet.getLanes()).thenReturn(ECollections.asEList(children)); + return laneSet; + } + + private static Lane mockLane(String id, String name, FlowNode... children) { + Lane lane = new LaneMock(ECollections.asEList(children)); + lane.setId(id); + lane.setName(name); + return lane; + } + + private static Lane mockLane(String id, String name, LaneSet childLineSet) { + Lane lane = new LaneMock(childLineSet); + lane.setId(id); + lane.setName(name); + return lane; + } + + private static class LaneMock extends LaneImpl { + + EList children; + LaneSet childLineSet; + + LaneMock(EList children) { + this.children = children; + } + + LaneMock(LaneSet childLineSet) { + this.childLineSet = childLineSet; + } + + @Override + public EList getFlowNodeRefs() { + return children; + } + + @Override + public LaneSet getChildLaneSet() { + return childLineSet; + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/SubProcessConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/SubProcessConverterTest.java new file mode 100644 index 00000000000..bee7d7c93eb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/processes/SubProcessConverterTest.java @@ -0,0 +1,191 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.processes; + +import org.eclipse.bpmn2.AdHocOrdering; +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.SubProcess; +import org.junit.Ignore; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.AdHocSubProcessPropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.MultipleInstanceSubprocess; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseSubprocessTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData; + +import static junit.framework.TestCase.assertTrue; +import static org.junit.Assert.assertNotNull; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.mockito.Mockito.mock; +import static org.powermock.api.mockito.PowerMockito.when; + +// TODO: Kogito +@Ignore +public class SubProcessConverterTest { + + private final String SLA_DUE_DATE = "12/25/1983"; + + private DefinitionResolver definitionResolver; + + private SubProcessConverter tested; + + /*@Before + public void setUp() { + Definitions definitions = bpmn2.createDefinitions(); + definitions.getRootElements().add(bpmn2.createProcess()); + BPMNDiagram bpmnDiagram = di.createBPMNDiagram(); + bpmnDiagram.setPlane(di.createBPMNPlane()); + definitions.getDiagrams().add(bpmnDiagram); + + definitionResolver = new DefinitionResolver(definitions, Collections.emptyList()); + + Node adHocNode = new NodeImpl(""); + View adHocContent = + new ViewImpl<>(new AdHocSubprocess(), Bounds.create()); + adHocNode.setContent(adHocContent); + + Node multipleInstanceNode = new NodeImpl(""); + View miContent = + new ViewImpl<>(new MultipleInstanceSubprocess(), Bounds.create()); + multipleInstanceNode.setContent(miContent); + + Node embeddedNode = new NodeImpl(""); + View embeddedContent = + new ViewImpl<>(new EmbeddedSubprocess(), Bounds.create()); + embeddedNode.setContent(embeddedContent); + + Node eventNode = new NodeImpl(""); + View eventSubprocess = + new ViewImpl<>(new EventSubprocess(), Bounds.create()); + eventNode.setContent(eventSubprocess); + + FactoryManager factoryManager = mock(FactoryManager.class); + when(factoryManager.newElement(anyString(), eq(getDefinitionId(AdHocSubprocess.class)))) + .thenReturn(adHocNode); + when(factoryManager.newElement(anyString(), eq(getDefinitionId(MultipleInstanceSubprocess.class)))) + .thenReturn(multipleInstanceNode); + when(factoryManager.newElement(anyString(), eq(getDefinitionId(EmbeddedSubprocess.class)))) + .thenReturn(embeddedNode); + when(factoryManager.newElement(anyString(), eq(getDefinitionId(EventSubprocess.class)))) + .thenReturn(eventNode); + + TypedFactoryManager typedFactoryManager = new TypedFactoryManager(factoryManager); + + tested = new SubProcessConverter(typedFactoryManager, + new PropertyReaderFactory(definitionResolver), + definitionResolver, + new ConverterFactory(definitionResolver, typedFactoryManager)); + }*/ + + @Test + public void createNode() { + assertTrue(AdHocSubprocess.class.isInstance(tested.createNode("id").getContent().getDefinition())); + } + + @Test + public void createProcessData() { + assertTrue(ProcessData.class.isInstance(tested.createProcessData("id"))); + } + + @Test + public void testCreateAdHocSubprocessTaskExecutionSet() { + AdHocSubProcess adHocSubProcess = mock(AdHocSubProcess.class); + when(adHocSubProcess.getCompletionCondition()).thenReturn(mock(FormalExpression.class)); + when(adHocSubProcess.getOrdering()).thenReturn(AdHocOrdering.SEQUENTIAL); + + assertTrue(AdHocSubprocessTaskExecutionSet.class.isInstance(tested.createAdHocSubprocessTaskExecutionSet( + new AdHocSubProcessPropertyReader(adHocSubProcess, + definitionResolver.getDiagram(), + definitionResolver)))); + } + + @Test + public void testConvertAdHocSubprocessNode() { + SubProcess subProcess = bpmn2.createAdHocSubProcess(); + CustomElement.async.setValue(subProcess, Boolean.TRUE); + CustomElement.slaDueDate.setValue(subProcess, SLA_DUE_DATE); + + Result result = tested.convertSubProcess(subProcess); + BpmnNode node = result.value(); + AdHocSubprocess adHocSubprocess = (AdHocSubprocess) node.value().getContent().getDefinition(); + + assertNotNull(adHocSubprocess); + assertBaseSubprocessExecutionSet(adHocSubprocess.getExecutionSet()); + } + + @Test + public void testConvertMultInstanceSubprocessNode() { + SubProcess subProcess = bpmn2.createSubProcess(); + subProcess.setLoopCharacteristics(bpmn2.createMultiInstanceLoopCharacteristics()); + CustomElement.async.setValue(subProcess, Boolean.TRUE); + CustomElement.slaDueDate.setValue(subProcess, SLA_DUE_DATE); + + Result result = tested.convertSubProcess(subProcess); + BpmnNode node = result.value(); + MultipleInstanceSubprocess miSubProcess = (MultipleInstanceSubprocess) node.value().getContent().getDefinition(); + + assertNotNull(miSubProcess); + assertBaseSubprocessExecutionSet(miSubProcess.getExecutionSet()); + } + + @Test + public void testConvertEmbeddedSubprocessNode() { + SubProcess subProcess = bpmn2.createSubProcess(); + CustomElement.async.setValue(subProcess, Boolean.TRUE); + CustomElement.slaDueDate.setValue(subProcess, SLA_DUE_DATE); + + Result result = tested.convertSubProcess(subProcess); + BpmnNode node = result.value(); + EmbeddedSubprocess embeddedSubprocess = (EmbeddedSubprocess) node.value().getContent().getDefinition(); + assertNotNull(embeddedSubprocess); + + assertBaseSubprocessExecutionSet(embeddedSubprocess.getExecutionSet()); + } + + @Test + public void testConvertEventSubprocessNode() { + SubProcess subProcess = bpmn2.createSubProcess(); + subProcess.setTriggeredByEvent(Boolean.TRUE); + CustomElement.async.setValue(subProcess, Boolean.TRUE); + CustomElement.slaDueDate.setValue(subProcess, SLA_DUE_DATE); + + Result result = tested.convertSubProcess(subProcess); + BpmnNode node = result.value(); + EventSubprocess eventSubprocess = (EventSubprocess) node.value().getContent().getDefinition(); + + assertNotNull(eventSubprocess); + assertBaseSubprocessExecutionSet(eventSubprocess.getExecutionSet()); + } + + private void assertBaseSubprocessExecutionSet(BaseSubprocessTaskExecutionSet executionSet) { + assertNotNull(executionSet); + + assertNotNull(executionSet.getIsAsync()); + assertTrue(executionSet.getIsAsync().getValue()); + + assertNotNull(executionSet.getSlaDueDate()); + assertTrue(executionSet.getSlaDueDate().getValue().contains(SLA_DUE_DATE)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ActivityPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ActivityPropertyReaderTest.java new file mode 100644 index 00000000000..cb55846e606 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ActivityPropertyReaderTest.java @@ -0,0 +1,259 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.InputOutputSpecification; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.Property; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.jboss.drools.DroolsPackage; +import org.jboss.drools.OnEntryScriptType; +import org.jboss.drools.OnExitScriptType; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class ActivityPropertyReaderTest { + + private static final String JAVA = "java"; + private static final String JAVA_FORMAT = "http://www.java.com/java"; + private static final String SCRIPT = "SCRIPT"; + + @Mock + private Activity activity; + + @Mock + private BPMNDiagram diagram; + + @Mock + private DefinitionResolver definitionResolver; + + private ActivityPropertyReader reader; + + @Before + public void setUp() { + reader = new ActivityPropertyReader(activity, diagram, definitionResolver); + } + + @Test + public void testGetOnEntryScript() { + OnEntryScriptType onEntryScript = Mockito.mock(OnEntryScriptType.class); + when(onEntryScript.getScript()).thenReturn(SCRIPT); + when(onEntryScript.getScriptFormat()).thenReturn(JAVA_FORMAT); + List onEntryScripts = Collections.singletonList(onEntryScript); + + EList extensions = mockExtensions(DroolsPackage.Literals.DOCUMENT_ROOT__ON_ENTRY_SCRIPT, onEntryScripts); + when(activity.getExtensionValues()).thenReturn(extensions); + + assertScript(JAVA, SCRIPT, reader.getOnEntryAction()); + } + + @Test + public void testGetOnExitScript() { + OnExitScriptType onExitScript = Mockito.mock(OnExitScriptType.class); + when(onExitScript.getScript()).thenReturn(SCRIPT); + when(onExitScript.getScriptFormat()).thenReturn(JAVA_FORMAT); + List onExitScripts = Collections.singletonList(onExitScript); + + EList extensions = mockExtensions(DroolsPackage.Literals.DOCUMENT_ROOT__ON_EXIT_SCRIPT, onExitScripts); + when(activity.getExtensionValues()).thenReturn(extensions); + + assertScript(JAVA, SCRIPT, reader.getOnExitAction()); + } + + @Test + public void testGetAssignmentsInfo() { + EList dataInputs = ECollections.newBasicEList(); + DataInput dataInput1 = mockDataInput("INPUT_ID_1", "INPUT_NAME_1", mockEntry("dtype", "Integer")); + DataInput dataInput2 = mockDataInput("INPUT_ID_2", "INPUT_NAME_2", mockEntry("dtype", "String")); + + dataInputs.add(dataInput1); + dataInputs.add(dataInput2); + InputOutputSpecification ioSpec = mock(InputOutputSpecification.class); + + EList dataInputAssociations = ECollections.newBasicEList(); + DataInputAssociation inputAssociation = mockDataInputAssociation(dataInput1, "VARIABLE1"); + DataInputAssociation inputAssociation2 = mockDataInputAssociation(dataInput2, "VARIABLE2"); + dataInputAssociations.add(inputAssociation); + dataInputAssociations.add(inputAssociation2); + + EList dataOutputs = ECollections.newBasicEList(); + DataOutput dataOutput1 = mockDataOutput("OUTPUT_ID_1", "OUTPUT_NAME_1", mockEntry("dtype", "Boolean")); + DataOutput dataOutput2 = mockDataOutput("OUTPUT_ID_2", "OUTPUT_NAME_2", mockEntry("dtype", "Float")); + dataOutputs.add(dataOutput1); + dataOutputs.add(dataOutput2); + + EList dataOutputAssociations = ECollections.newBasicEList(); + DataOutputAssociation outputAssociation1 = mockDataOutputAssociation(dataOutput1, "VARIABLE3"); + DataOutputAssociation outputAssociation2 = mockDataOutputAssociation(dataOutput2, "VARIABLE4"); + dataOutputAssociations.add(outputAssociation1); + dataOutputAssociations.add(outputAssociation2); + + when(ioSpec.getDataInputs()).thenReturn(dataInputs); + when(ioSpec.getDataOutputs()).thenReturn(dataOutputs); + when(activity.getIoSpecification()).thenReturn(ioSpec); + when(activity.getDataInputAssociations()).thenReturn(dataInputAssociations); + when(activity.getDataOutputAssociations()).thenReturn(dataOutputAssociations); + + AssignmentsInfo result = reader.getAssignmentsInfo(); + + String expectedResult = "|INPUT_NAME_1:Integer,INPUT_NAME_2:String||OUTPUT_NAME_1:Boolean,OUTPUT_NAME_2:Float|[din]VARIABLE1->INPUT_NAME_1,[din]VARIABLE2->INPUT_NAME_2,[dout]OUTPUT_NAME_1->VARIABLE3,[dout]OUTPUT_NAME_2->VARIABLE4"; + assertEquals(expectedResult, result.getValue()); + } + + @Test + public void testGetAssignmentsInfoWithNoAssignments() { + EList dataInputs = ECollections.newBasicEList(); + EList dataInputAssociations = ECollections.newBasicEList(); + EList dataOutputs = ECollections.newBasicEList(); + EList dataOutputAssociations = ECollections.newBasicEList(); + InputOutputSpecification ioSpec = mock(InputOutputSpecification.class); + when(ioSpec.getDataInputs()).thenReturn(dataInputs); + when(ioSpec.getDataOutputs()).thenReturn(dataOutputs); + when(activity.getIoSpecification()).thenReturn(ioSpec); + when(activity.getDataInputAssociations()).thenReturn(dataInputAssociations); + when(activity.getDataOutputAssociations()).thenReturn(dataOutputAssociations); + + AssignmentsInfo result = reader.getAssignmentsInfo(); + assertEquals("||||", result.getValue()); + } + + private static void assertScript(String expectedLanguage, String expectedScript, ScriptTypeListValue value) { + assertEquals(1, value.getValues().size()); + assertEquals(expectedLanguage, value.getValues().get(0).getLanguage()); + assertEquals(expectedScript, value.getValues().get(0).getScript()); + } + + public static EList mockExtensions(EStructuralFeature feature, Object value) { + FeatureMap featureMap = mock(FeatureMap.class); + when(featureMap.get(feature, true)).thenReturn(value); + ExtensionAttributeValue attributeValue = Mockito.mock(ExtensionAttributeValue.class); + when(attributeValue.getValue()).thenReturn(featureMap); + return ECollections.singletonEList(attributeValue); + } + + public static DataInput mockDataInput(String id, String name) { + return mockDataInput(id, name, new FeatureMap.Entry[0]); + } + + public static DataInput mockDataInput(String id, String name, FeatureMap.Entry... entries) { + DataInput dataInput = mock(DataInput.class); + when(dataInput.getId()).thenReturn(id); + when(dataInput.getName()).thenReturn(name); + List entriesList = new ArrayList<>(); + if (entries != null) { + entriesList.addAll(Arrays.asList(entries)); + } + FeatureMap featureMap = mock(FeatureMap.class); + when(featureMap.stream()).thenReturn(entriesList.stream()); + when(dataInput.getAnyAttribute()).thenReturn(featureMap); + return dataInput; + } + + public static DataOutput mockDataOutput(String id, String name) { + return mockDataOutput(id, name, new FeatureMap.Entry[0]); + } + + public static DataOutput mockDataOutput(String id, String name, FeatureMap.Entry... entries) { + DataOutput dataOutput = mock(DataOutput.class); + when(dataOutput.getId()).thenReturn(id); + when(dataOutput.getName()).thenReturn(name); + List entriesList = new ArrayList<>(); + if (entries != null) { + entriesList.addAll(Arrays.asList(entries)); + } + FeatureMap featureMap = mock(FeatureMap.class); + when(featureMap.stream()).thenReturn(entriesList.stream()); + when(dataOutput.getAnyAttribute()).thenReturn(featureMap); + return dataOutput; + } + + public static DataInputAssociation mockDataInputAssociation(String targetRef, String sourceRef) { + return mockDataInputAssociation(mockItemAwareElement(targetRef), sourceRef); + } + + public static DataInputAssociation mockDataInputAssociation(ItemAwareElement targetRefItem, String sourceRef) { + DataInputAssociation inputAssociation = mock(DataInputAssociation.class); + when(inputAssociation.getTargetRef()).thenReturn(targetRefItem); + + ItemAwareElement sourceRefItem = mockProperty(sourceRef); + EList sourceRefs = ECollections.singletonEList(sourceRefItem); + when(inputAssociation.getSourceRef()).thenReturn(sourceRefs); + return inputAssociation; + } + + public static DataOutputAssociation mockDataOutputAssociation(String sourceRef, String targetRef) { + return mockDataOutputAssociation(mockItemAwareElement(sourceRef), targetRef); + } + + public static DataOutputAssociation mockDataOutputAssociation(ItemAwareElement sourceRefItem, String targetRef) { + DataOutputAssociation outputAssociation = mock(DataOutputAssociation.class); + EList sourceRefs = ECollections.singletonEList(sourceRefItem); + when(outputAssociation.getSourceRef()).thenReturn(sourceRefs); + + ItemAwareElement targetRefItem = mockProperty(targetRef); + when(outputAssociation.getTargetRef()).thenReturn(targetRefItem); + return outputAssociation; + } + + public static ItemAwareElement mockItemAwareElement(String id) { + ItemAwareElement item = mock(ItemAwareElement.class); + when(item.getId()).thenReturn(id); + return item; + } + + public static Property mockProperty(String id) { + Property property = mock(Property.class); + when(property.getId()).thenReturn(id); + return property; + } + + public FeatureMap.Entry mockEntry(String name, Object value) { + FeatureMap.Entry entry = mock(FeatureMap.Entry.class); + EStructuralFeature feature = mock(EStructuralFeature.class); + when(feature.getName()).thenReturn(name); + when(entry.getEStructuralFeature()).thenReturn(feature); + when(entry.getValue()).thenReturn(value); + return entry; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AdHocSubProcessPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AdHocSubProcessPropertyReaderTest.java new file mode 100644 index 00000000000..8d2c4d14abb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AdHocSubProcessPropertyReaderTest.java @@ -0,0 +1,181 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Collections; +import java.util.UUID; + +import org.eclipse.bpmn2.AdHocOrdering; +import org.eclipse.bpmn2.AdHocSubProcess; +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.di; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class AdHocSubProcessPropertyReaderTest { + + private static final String SCRIPT = "SCRIPT"; + + @Mock + private AdHocSubProcess process; + + @Mock + private BPMNDiagram diagram; + + @Mock + private DefinitionResolver definitionResolver; + + private AdHocSubProcessPropertyReader propertyReader; + + private DefinitionResolver definitionResolverReal; + + private AdHocSubProcessPropertyReader tested; + + @Before + public void setUp() { + Definitions definitions = bpmn2.createDefinitions(); + definitions.getRootElements().add(bpmn2.createProcess()); + BPMNDiagram bpmnDiagram = di.createBPMNDiagram(); + bpmnDiagram.setPlane(di.createBPMNPlane()); + definitions.getDiagrams().add(bpmnDiagram); + + definitionResolverReal = new DefinitionResolver(definitions, Collections.emptyList()); + + propertyReader = new AdHocSubProcessPropertyReader(process, diagram, definitionResolver); + } + + // TODO: Kogito - @Test + public void testGetAdHocCompletionConditionWithFormalExpression() { + for (Scripts.LANGUAGE language : Scripts.LANGUAGE.values()) { + testGetAdHocCompletionConditionWithFormalExpression(new ScriptTypeValue(language.language(), SCRIPT), language.format(), SCRIPT); + } + } + + @Test + public void testGetAdHocCompletionConditionWithoutFormalExpression() { + when(process.getCompletionCondition()).thenReturn(null); + assertEquals(new ScriptTypeValue(Scripts.LANGUAGE.MVEL.language(), "autocomplete"), propertyReader.getAdHocCompletionCondition()); + } + + private void testGetAdHocCompletionConditionWithFormalExpression(ScriptTypeValue expectedValue, String currentLanguage, String currentBody) { + FormalExpression formalExpression = mock(FormalExpression.class); + when(formalExpression.getLanguage()).thenReturn(currentLanguage); + when(formalExpression.getBody()).thenReturn(currentBody); + when(process.getCompletionCondition()).thenReturn(formalExpression); + assertEquals(expectedValue, propertyReader.getAdHocCompletionCondition()); + } + + @Test + public void testGetAdHocOrderingSequential() { + testGetAdHocOrdering("Sequential", AdHocOrdering.SEQUENTIAL); + } + + @Test + public void testGetAdHocOrderingParallel() { + testGetAdHocOrdering("Parallel", AdHocOrdering.PARALLEL); + } + + private void testGetAdHocOrdering(String expectedValue, AdHocOrdering currentOrdering) { + when(process.getOrdering()).thenReturn(currentOrdering); + assertEquals(expectedValue, propertyReader.getAdHocOrdering()); + } + + @Test + public void testIsAdHocAutostart_true() { + String id = UUID.randomUUID().toString(); + + AdHocSubProcess adHocSubProcess = bpmn2.createAdHocSubProcess(); + adHocSubProcess.setId(id); + CustomElement.autoStart.of(adHocSubProcess).set(Boolean.TRUE); + + tested = new AdHocSubProcessPropertyReader(adHocSubProcess, + definitionResolverReal.getDiagram(), + definitionResolverReal); + + assertTrue(tested.isAdHocAutostart()); + } + + @Test + public void testIsAdHocAutostart_false() { + String id = UUID.randomUUID().toString(); + + AdHocSubProcess adHocSubProcess = bpmn2.createAdHocSubProcess(); + adHocSubProcess.setId(id); + CustomElement.autoStart.of(adHocSubProcess).set(Boolean.FALSE); + + tested = new AdHocSubProcessPropertyReader(adHocSubProcess, + definitionResolverReal.getDiagram(), + definitionResolverReal); + + assertFalse(tested.isAdHocAutostart()); + } + + @Test + public void testIsAdHocActivationCondition() { + AdHocSubProcess adHocSubProcess = bpmn2.createAdHocSubProcess(); + CustomElement.customActivationCondition.of(adHocSubProcess).set("some condition"); + + tested = new AdHocSubProcessPropertyReader(adHocSubProcess, + definitionResolverReal.getDiagram(), + definitionResolverReal); + + assertEquals(asCData("some condition"), tested.getAdHocActivationCondition()); + } + + @Test + public void testIsAsync() { + AdHocSubProcess adHocSubProcess = bpmn2.createAdHocSubProcess(); + CustomElement.async.of(adHocSubProcess).set(Boolean.TRUE); + + tested = new AdHocSubProcessPropertyReader(adHocSubProcess, + definitionResolverReal.getDiagram(), + definitionResolverReal); + + assertTrue(tested.isAsync()); + } + + @Test + public void testGetSlaDueDate() { + String rawSlaDueDate = "12/25/1983"; + + AdHocSubProcess adHocSubProcess = bpmn2.createAdHocSubProcess(); + CustomElement.slaDueDate.of(adHocSubProcess).set(rawSlaDueDate); + + tested = new AdHocSubProcessPropertyReader(adHocSubProcess, + definitionResolverReal.getDiagram(), + definitionResolverReal); + + assertTrue(tested.getSlaDueDate().contains(rawSlaDueDate)); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AssignmentsInfosTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AssignmentsInfosTest.java new file mode 100644 index 00000000000..dc11c028eef --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AssignmentsInfosTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Collections; + +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataOutput; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.ParsedAssignmentsInfo; + +import static org.junit.Assert.assertFalse; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class AssignmentsInfosTest { + + @Test + public void JBPM_7447_shouldNotFilterOutDataOutputsWithEmptyType() { + DataInput dataInput = bpmn2.createDataInput(); + dataInput.setName("InputName"); + dataInput.setId("InputID"); + DataOutput dataOutput = bpmn2.createDataOutput(); + dataOutput.setName("OutputName"); + dataOutput.setId("OutputID"); + ParsedAssignmentsInfo result = AssignmentsInfos.parsed( + Collections.singletonList(dataInput), + Collections.emptyList(), + Collections.singletonList(dataOutput), + Collections.emptyList(), + false + ); + assertFalse(result.getOutputs().getDeclarations().isEmpty()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AssociationPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AssociationPropertyReaderTest.java new file mode 100644 index 00000000000..b8d70c742ab --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/AssociationPropertyReaderTest.java @@ -0,0 +1,156 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.List; + +import org.eclipse.bpmn2.Association; +import org.eclipse.bpmn2.AssociationDirection; +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.Bpmn2Factory; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNPlane; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.util.PropertyReaderUtils; +import org.kie.workbench.common.stunner.bpmn.definition.DirectionalAssociation; +import org.kie.workbench.common.stunner.bpmn.definition.NonDirectionalAssociation; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.mockito.Mock; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.when; +import static org.powermock.api.mockito.PowerMockito.mock; +import static org.powermock.api.mockito.PowerMockito.mockStatic; + +@RunWith(PowerMockRunner.class) +@PrepareForTest(PropertyReaderUtils.class) +public class AssociationPropertyReaderTest { + + private static String SOURCE_ID = "SOURCE_ID"; + + private static String TARGET_ID = "TARGET_ID"; + + private static String ASSOCIATION_ID = "ASSOCIATION_ID"; + + private static double X = 1; + + private static double Y = 2; + + @Mock + private DefinitionResolver definitionResolver; + + @Mock + private Association association; + + @Mock + private BaseElement sourceRef; + + @Mock + private BaseElement targetRef; + + @Mock + private BPMNDiagram bpmnDiagram; + + @Mock + private BPMNPlane bpmnLane; + + private Point2D position; + + @Mock + private AssociationPropertyReader propertyReader; + + @Before + public void setUp() { + position = Point2D.create(X, Y); + when(bpmnDiagram.getPlane()).thenReturn(bpmnLane); + when(association.getId()).thenReturn(ASSOCIATION_ID); + when(sourceRef.getId()).thenReturn(SOURCE_ID); + when(targetRef.getId()).thenReturn(TARGET_ID); + when(association.getSourceRef()).thenReturn(sourceRef); + when(association.getTargetRef()).thenReturn(targetRef); + + propertyReader = new AssociationPropertyReader(association, bpmnDiagram, definitionResolver); + } + + @Test + public void testGetSourceId() { + assertEquals(SOURCE_ID, propertyReader.getSourceId()); + } + + @Test + public void testGetTargetId() { + assertEquals(TARGET_ID, propertyReader.getTargetId()); + } + + @Test + public void testGetSourceConnection() { + mockStatic(PropertyReaderUtils.class); + PowerMockito.when(PropertyReaderUtils.getSourcePosition(definitionResolver, ASSOCIATION_ID, SOURCE_ID)).thenReturn(position); + boolean arbitraryBoolean = true; + PowerMockito.when(PropertyReaderUtils.isAutoConnectionSource(association)).thenReturn(arbitraryBoolean); + + Connection result = propertyReader.getSourceConnection(); + assertEquals(X, result.getLocation().getX(), 0); + assertEquals(Y, result.getLocation().getY(), 0); + } + + @Test + public void testGetTargetConnection() { + mockStatic(PropertyReaderUtils.class); + PowerMockito.when(PropertyReaderUtils.getTargetPosition(definitionResolver, ASSOCIATION_ID, TARGET_ID)).thenReturn(position); + boolean arbitraryBoolean = true; + PowerMockito.when(PropertyReaderUtils.isAutoConnectionSource(association)).thenReturn(arbitraryBoolean); + + Connection result = propertyReader.getTargetConnection(); + assertEquals(X, result.getLocation().getX(), 0); + assertEquals(Y, result.getLocation().getY(), 0); + } + + @Test + public void testGetAssociationByDirection() { + final Association association = Bpmn2Factory.eINSTANCE.createAssociation(); + + //null direction + association.setAssociationDirection(null); + propertyReader = new AssociationPropertyReader(association, bpmnDiagram, definitionResolver); + assertEquals(NonDirectionalAssociation.class, propertyReader.getAssociationByDirection()); + + //none direction + association.setAssociationDirection(AssociationDirection.NONE); + assertEquals(NonDirectionalAssociation.class, propertyReader.getAssociationByDirection()); + + //one direction + association.setAssociationDirection(AssociationDirection.ONE); + assertEquals(DirectionalAssociation.class, propertyReader.getAssociationByDirection()); + } + + @Test + @SuppressWarnings("unchecked") + public void testGetControlPoints() { + List controlPoints = mock(List.class); + mockStatic(PropertyReaderUtils.class); + PowerMockito.when(PropertyReaderUtils.getControlPoints(definitionResolver, ASSOCIATION_ID)).thenReturn(controlPoints); + assertEquals(controlPoints, propertyReader.getControlPoints()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BaseEventPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BaseEventPropertyReaderTest.java new file mode 100644 index 00000000000..943d331ee06 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BaseEventPropertyReaderTest.java @@ -0,0 +1,232 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +import bpsim.ElementParameters; +import bpsim.Parameter; +import bpsim.ParameterValue; +import bpsim.TimeParameters; +import org.eclipse.bpmn2.ConditionalEventDefinition; +import org.eclipse.bpmn2.Event; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.bpmn2.TimerEventDefinition; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.dd.dc.Bounds; +import org.eclipse.emf.common.util.EList; +import org.jboss.drools.DroolsPackage; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.definition.property.common.ConditionExpression; +import org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationAttributeSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.assertBounds; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.mockBounds; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.mockExtensionValues; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.mockFormalExpression; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.mockNormalDistributionType; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.mockPoissonDistributionType; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.mockUniformDistributionType; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public abstract class BaseEventPropertyReaderTest { + + protected static final double RESOLUTION_FACTOR = 1234; + protected static final float X = 1f; + protected static final float Y = 2f; + + protected static final String SIGNAL_REF_ID = "SIGNAL_REF_ID"; + protected static final String SIGNAL_NAME = "SIGNAL_NAME"; + protected static final String SCOPE_ELEMENT_NAME = "customScope"; + protected static final String SCOPE = "SCOPE"; + + protected static final String SLADUEDATE_ELEMENT_NAME = "customSLADueDate"; + protected static final String SLADUEDATE = "12/25/1983"; + + protected static final String TIME_CYCLE_LANGUAGE = "TIME_CYCLE_LANGUAGE"; + protected static final String TIME_CYCLE = "TIME_CYCLE"; + protected static final String TIME_DATE = "TIME_DATE"; + protected static final String TIME_DURATION = "TIME_DURATION"; + + protected static final double MIN = 1; + protected static final double MAX = 2; + protected static final double MEAN = 3; + protected static final double TIME_UNIT = 4; + protected static final double STANDARD_DEVIATION = 5; + + protected static final String SCRIPT = "SCRIPT"; + + @Mock + protected DefinitionResolver definitionResolver; + + @Mock + protected BPMNDiagram diagram; + + protected EventPropertyReader propertyReader; + + protected abstract EventPropertyReader newPropertyReader(); + + protected abstract void setSignalEventDefinitionOnCurrentMock(SignalEventDefinition eventDefinition); + + protected abstract Event getCurrentEventMock(); + + @Before + public void setUp() { + when(definitionResolver.getResolutionFactor()).thenReturn(RESOLUTION_FACTOR); + propertyReader = newPropertyReader(); + } + + @Test + public void testGetSignalRef() { + SignalEventDefinition eventDefinition = mock(SignalEventDefinition.class); + when(eventDefinition.getSignalRef()).thenReturn(SIGNAL_REF_ID); + setSignalEventDefinitionOnCurrentMock(eventDefinition); + when(definitionResolver.resolveSignalName(SIGNAL_REF_ID)).thenReturn(SIGNAL_NAME); + assertEquals(SIGNAL_NAME, propertyReader.getSignalRef()); + } + + // TODO: Kogito - @Test + public void testGetSignalRefWithNoSignal() { + assertEquals("", propertyReader.getSignalRef()); + } + + @Test + public void testComputeBounds() { + Bounds bounds = mockBounds(X, Y); + org.kie.workbench.common.stunner.core.graph.content.Bounds result = propertyReader.computeBounds(bounds); + assertBounds(X * RESOLUTION_FACTOR, + Y * RESOLUTION_FACTOR, + X * RESOLUTION_FACTOR + EventPropertyReader.WIDTH, + Y * RESOLUTION_FACTOR + EventPropertyReader.HEIGHT, result); + } + + @Test + public void testGetSignalScope() { + EList extensionValues = mockExtensionValues(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, SCOPE_ELEMENT_NAME, SCOPE); + Event eventMock = getCurrentEventMock(); + when(eventMock.getExtensionValues()).thenReturn(extensionValues); + assertEquals(SCOPE, propertyReader.getSignalScope()); + } + + // TODO: Kogito - @Test + public void testGetTimerSettings() { + TimerEventDefinition eventDefinition = mock(TimerEventDefinition.class); + FormalExpression timeCycle = mockFormalExpression(TIME_CYCLE_LANGUAGE, TIME_CYCLE); + FormalExpression timeDate = mockFormalExpression(TIME_DATE); + FormalExpression timeDuration = mockFormalExpression(TIME_DURATION); + when(eventDefinition.getTimeCycle()).thenReturn(timeCycle); + when(eventDefinition.getTimeDate()).thenReturn(timeDate); + when(eventDefinition.getTimeDuration()).thenReturn(timeDuration); + TimerSettingsValue value = propertyReader.getTimerSettings(eventDefinition); + assertEquals(TIME_CYCLE_LANGUAGE, value.getTimeCycleLanguage()); + assertEquals(TIME_CYCLE, value.getTimeCycle()); + assertEquals(TIME_DATE, value.getTimeDate()); + assertEquals(TIME_DURATION, value.getTimeDuration()); + } + + @Test + public void testGetSimulationSetNormalDistribution() { + ParameterValue paramValue = mockNormalDistributionType(MEAN, STANDARD_DEVIATION); + testGetSimulationSet(new SimulationAttributeSet(0d, 0d, MEAN, "ms", STANDARD_DEVIATION, "normal"), + paramValue); + } + + @Test + public void testGetSimulationSetUniformDistribution() { + ParameterValue paramValue = mockUniformDistributionType(MIN, MAX); + testGetSimulationSet(new SimulationAttributeSet(MIN, MAX, 0d, "ms", 0d, "uniform"), + paramValue); + } + + @Test + public void testGetSimulationSetPoissonDistribution() { + ParameterValue paramValue = mockPoissonDistributionType(MEAN); + testGetSimulationSet(new SimulationAttributeSet(0d, 0d, MEAN, "ms", 0d, "poisson"), + paramValue); + } + + private void testGetSimulationSet(SimulationAttributeSet expectedResult, ParameterValue distributionType) { + ElementParameters parameters = mock(ElementParameters.class); + TimeParameters timeParams = mock(TimeParameters.class); + when(parameters.getTimeParameters()).thenReturn(timeParams); + Parameter processingTime = mock(Parameter.class); + when(timeParams.getProcessingTime()).thenReturn(processingTime); + EList parameterList = mock(EList.class); + when(processingTime.getParameterValue()).thenReturn(parameterList); + when(parameterList.get(0)).thenReturn(distributionType); + when(definitionResolver.resolveSimulationParameters(getCurrentEventMock().getId())).thenReturn(Optional.ofNullable(parameters)); + assertEquals(expectedResult, propertyReader.getSimulationSet()); + } + + // TODO: Kogito - @Test + public void testGetConditionExpression() { + for (Scripts.LANGUAGE language : Scripts.LANGUAGE.values()) { + testGetConditionExpression(new ConditionExpression(new ScriptTypeValue(language.language(), SCRIPT)), language.format(), SCRIPT); + } + } + + private void testGetConditionExpression(ConditionExpression expectedValue, String languageFormat, String script) { + ConditionalEventDefinition eventDefinition = mock(ConditionalEventDefinition.class); + FormalExpression expression = mockFormalExpression(languageFormat, script); + when(eventDefinition.getCondition()).thenReturn(expression); + assertEquals(expectedValue, EventPropertyReader.getConditionExpression(eventDefinition)); + } + + @Test + public void testGetConditionExpressionNotConfigured() { + ConditionalEventDefinition eventDefinition = mock(ConditionalEventDefinition.class); + assertEquals(new ConditionExpression(new ScriptTypeValue(Scripts.LANGUAGE.DROOLS.language(), "")), EventPropertyReader.getConditionExpression(eventDefinition)); + } + + @Test + public void testCombineEventDefinitions() { + EventDefinition definition1 = mock(EventDefinition.class); + EventDefinition definition2 = mock(EventDefinition.class); + EventDefinition definition3 = mock(EventDefinition.class); + List eventDefinitions = Arrays.asList(definition1, definition2, definition3); + + EventDefinition definitionRef1 = mock(EventDefinition.class); + EventDefinition definitionRef2 = mock(EventDefinition.class); + List eventDefinitionsRefs = Arrays.asList(definitionRef1, definitionRef2, null); + + List result = EventPropertyReader.combineEventDefinitions(eventDefinitions, eventDefinitionsRefs); + assertEquals(eventDefinitions, result); + } + + @Test + public void testSLADueDate() { + EList extensionValues = mockExtensionValues(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, SLADUEDATE_ELEMENT_NAME, SLADUEDATE); + Event eventMock = getCurrentEventMock(); + when(eventMock.getExtensionValues()).thenReturn(extensionValues); + assertEquals(SLADUEDATE, propertyReader.getSlaDueDate()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BasePropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BasePropertyReaderTest.java new file mode 100644 index 00000000000..f49df15986a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BasePropertyReaderTest.java @@ -0,0 +1,113 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.CircleDimensionSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class BasePropertyReaderTest { + + private static final double RESOLUTION_FACTOR = 0.65d; + + @Mock + private BaseElement element; + + @Mock + private BPMNShape shape; + + @Mock + private BPMNDiagram diagram; + + private BasePropertyReader tested; + + @Before + public void setup() { + FeatureMap featureMap = mock(FeatureMap.class); + when(featureMap.isEmpty()).thenReturn(true); + when(element.getAnyAttribute()).thenReturn(featureMap); + org.eclipse.dd.dc.Bounds shapeBounds = mock(org.eclipse.dd.dc.Bounds.class); + when(shapeBounds.getX()).thenReturn(1.1f); + when(shapeBounds.getY()).thenReturn(2.2f); + when(shapeBounds.getWidth()).thenReturn(100f); + when(shapeBounds.getHeight()).thenReturn(545.34f); + when(shape.getBounds()).thenReturn(shapeBounds); + tested = new BasePropertyReader(element, diagram, shape, RESOLUTION_FACTOR); + } + + @Test + public void testBounds() { + Bounds bounds = tested.getBounds(); + assertTrue(bounds.hasLowerRight()); + assertTrue(bounds.hasUpperLeft()); + assertEquals(0.7150000154972077d, bounds.getUpperLeft().getX(), 0d); + assertEquals(1.4300000309944154d, bounds.getUpperLeft().getY(), 0d); + assertEquals(65.71500001549721d, bounds.getLowerRight().getX(), 0d); + assertEquals(355.9010174870491d, bounds.getLowerRight().getY(), 0d); + } + + @Test + public void testGetCircleDimensionSet() { + CircleDimensionSet circleDimensionSet = tested.getCircleDimensionSet(); + assertEquals(32.5d, circleDimensionSet.getRadius().getValue(), 0d); + } + + @Test + public void testGetRectangleDimensionsSet() { + RectangleDimensionsSet rectangleDimensionsSet = tested.getRectangleDimensionsSet(); + assertEquals(65.0d, rectangleDimensionsSet.getWidth().getValue(), 0d); + assertEquals(354.4710174560547d, rectangleDimensionsSet.getHeight().getValue(), 0d); + } + + @Test + public void testIsExpandedTrue() { + when(shape.isIsExpanded()).thenReturn(true); + assertTrue(tested.isExpanded()); + } + + @Test + public void testIsExpandedFalse() { + when(shape.isIsExpanded()).thenReturn(false); + assertFalse(shape.isIsExpanded()); + } + + @Test + public void testGetElement() { + assertEquals(element, tested.getElement()); + } + + @Test + public void testGetShape() { + assertEquals(shape, tested.getShape()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BoundaryEventPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BoundaryEventPropertyReaderTest.java new file mode 100644 index 00000000000..1ba4c86cf3e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/BoundaryEventPropertyReaderTest.java @@ -0,0 +1,147 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.Event; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.junit.Test; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.mockito.Mock; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.mockBounds; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.mockFeatureMapEntry; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class BoundaryEventPropertyReaderTest extends CatchEventPropertyReaderTest { + + private static final String DOCKER_INFO_METADATA_ELEMENT_NAME = "dockerinfo"; + /** + * encoded value format -> "1.0^2.0|" + */ + private static final String DOCKER_INFO_VALUE = X + "^" + Y + "|"; + + private static final float ACTIVITY_X = 100; + private static final float ACTIVITY_Y = 150; + float ACTIVITY_WIDTH = 100; + float ACTIVITY_HEIGHT = 200; + + @Mock + private BoundaryEvent boundaryEvent; + + @Override + public void setUp() { + FeatureMap featureMap = mock(FeatureMap.class); + FeatureMap.Entry entry = mockFeatureMapEntry(DOCKER_INFO_METADATA_ELEMENT_NAME, DOCKER_INFO_VALUE); + Stream entries = Stream.of(entry); + when(featureMap.stream()).thenReturn(entries); + when(boundaryEvent.getAnyAttribute()).thenReturn(featureMap); + super.setUp(); + } + + @Override + protected EventPropertyReader newPropertyReader() { + return new BoundaryEventPropertyReader(boundaryEvent, diagram, definitionResolver); + } + + @Override + protected void setSignalEventDefinitionOnCurrentMock(SignalEventDefinition eventDefinition) { + EList eventDefinitions = ECollections.singletonEList(eventDefinition); + when(boundaryEvent.getEventDefinitions()).thenReturn(eventDefinitions); + when(boundaryEvent.getEventDefinitionRefs()).thenReturn(ECollections.emptyEList()); + } + + @Test + public void testComputeBoundsWhenNoDockerInfoEventOnTop() { + float eventX = ACTIVITY_X + 40; + float eventY = ACTIVITY_Y - 28; + testComputeBoundsWhenNoDockerInfo(eventX, + eventY, + Double.valueOf(eventX * RESOLUTION_FACTOR - ACTIVITY_X * RESOLUTION_FACTOR).floatValue(), + Double.valueOf(-EventPropertyReader.HEIGHT / 2).floatValue()); + } + + @Test + public void testComputeBoundsWhenNoDockerInfoEventOnRight() { + float eventX = ACTIVITY_X + ACTIVITY_WIDTH - 28; + float eventY = ACTIVITY_Y + 40; + testComputeBoundsWhenNoDockerInfo(eventX, + eventY, + Double.valueOf(eventX * RESOLUTION_FACTOR - ACTIVITY_X * RESOLUTION_FACTOR).floatValue(), + Double.valueOf(eventY * RESOLUTION_FACTOR - ACTIVITY_Y * RESOLUTION_FACTOR).floatValue()); + } + + @Test + public void testComputeBoundsWhenNoDockerInfoEventOnBottom() { + float eventX = ACTIVITY_X + 40; + float eventY = ACTIVITY_Y + ACTIVITY_WIDTH - 28; + testComputeBoundsWhenNoDockerInfo(eventX, + eventY, + Double.valueOf(eventX * RESOLUTION_FACTOR - ACTIVITY_X * RESOLUTION_FACTOR).floatValue(), + Double.valueOf(eventY * RESOLUTION_FACTOR - ACTIVITY_Y * RESOLUTION_FACTOR).floatValue()); + } + + @Test + public void testComputeBoundsWhenNoDockerInfoEventOnLeft() { + float eventX = ACTIVITY_X + -28; + float eventY = ACTIVITY_Y + 40; + testComputeBoundsWhenNoDockerInfo(eventX, + eventY, + Double.valueOf(-EventPropertyReader.WIDTH / 2).floatValue(), + Double.valueOf(eventY * RESOLUTION_FACTOR - ACTIVITY_Y * RESOLUTION_FACTOR).floatValue()); + } + + private void testComputeBoundsWhenNoDockerInfo(float eventX, float eventY, float expectedX, float expectedY) { + FeatureMap featureMap = mock(FeatureMap.class); + List entries = new ArrayList<>(); + when(featureMap.stream()).thenReturn(entries.stream()); + when(boundaryEvent.getAnyAttribute()).thenReturn(featureMap); + String activityId = "activityId"; + Activity sourceActivity = mock(Activity.class); + BPMNShape sourceActivityShape = mock(BPMNShape.class); + org.eclipse.dd.dc.Bounds activityBounds = mockBounds(ACTIVITY_X, ACTIVITY_Y, ACTIVITY_WIDTH, ACTIVITY_HEIGHT); + when(sourceActivity.getId()).thenReturn(activityId); + when(sourceActivityShape.getBounds()).thenReturn(activityBounds); + when(definitionResolver.getShape(activityId)).thenReturn(sourceActivityShape); + when(definitionResolver.getResolutionFactor()).thenReturn(1d); + when(boundaryEvent.getAttachedToRef()).thenReturn(sourceActivity); + + float eventWidth = 56; + float eventHeight = 56; + org.eclipse.dd.dc.Bounds eventBounds = mockBounds(eventX, eventY, eventWidth, eventHeight); + Bounds result = propertyReader.computeBounds(eventBounds); + assertEquals(expectedX, result.getX(), 0); + assertEquals(expectedY, result.getY(), 0); + } + + @Override + protected Event getCurrentEventMock() { + return boundaryEvent; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CallActivityPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CallActivityPropertyReaderTest.java new file mode 100644 index 00000000000..4525f4e4d38 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CallActivityPropertyReaderTest.java @@ -0,0 +1,158 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Collections; +import java.util.UUID; + +import org.eclipse.bpmn2.CallActivity; +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.junit.Before; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.di; + +public class CallActivityPropertyReaderTest { + + private DefinitionResolver definitionResolver; + + private CallActivityPropertyReader tested; + + @Before + public void setUp() { + Definitions definitions = bpmn2.createDefinitions(); + definitions.getRootElements().add(bpmn2.createProcess()); + BPMNDiagram bpmnDiagram = di.createBPMNDiagram(); + bpmnDiagram.setPlane(di.createBPMNPlane()); + definitions.getDiagrams().add(bpmnDiagram); + + definitionResolver = new DefinitionResolver(definitions, Collections.emptyList()); + } + + @Test + public void testIsCase_true() { + String id = UUID.randomUUID().toString(); + + CallActivity callActivity = bpmn2.createCallActivity(); + callActivity.setId(id); + CustomElement.isCase.of(callActivity).set(Boolean.TRUE); + + tested = new CallActivityPropertyReader(callActivity, + definitionResolver.getDiagram(), + definitionResolver); + + assertTrue(tested.isCase()); + } + + @Test + public void testIsCase_false() { + String id = UUID.randomUUID().toString(); + + CallActivity callActivity = bpmn2.createCallActivity(); + callActivity.setId(id); + CustomElement.isCase.of(callActivity).set(Boolean.FALSE); + + tested = new CallActivityPropertyReader(callActivity, + definitionResolver.getDiagram(), + definitionResolver); + + assertFalse(tested.isCase()); + } + + @Test + public void testIsAdHocAutostart_true() { + String id = UUID.randomUUID().toString(); + + CallActivity callActivity = bpmn2.createCallActivity(); + callActivity.setId(id); + CustomElement.autoStart.of(callActivity).set(Boolean.TRUE); + + tested = new CallActivityPropertyReader(callActivity, + definitionResolver.getDiagram(), + definitionResolver); + + assertTrue(tested.isAdHocAutostart()); + } + + @Test + public void testIsAdHocAutostart_false() { + String id = UUID.randomUUID().toString(); + + CallActivity callActivity = bpmn2.createCallActivity(); + callActivity.setId(id); + CustomElement.autoStart.of(callActivity).set(Boolean.FALSE); + + tested = new CallActivityPropertyReader(callActivity, + definitionResolver.getDiagram(), + definitionResolver); + + assertFalse(tested.isAdHocAutostart()); + } + + @Test + public void testAbortParentTrue() { + testAbortParent(true); + } + + @Test + public void testAbortParentFalse() { + testAbortParent(false); + } + + private void testAbortParent(boolean value) { + CallActivity callActivity = bpmn2.createCallActivity(); + CustomElement.abortParent.of(callActivity).set(value); + + tested = new CallActivityPropertyReader(callActivity, + definitionResolver.getDiagram(), + definitionResolver); + assertEquals(value, tested.isAbortParent()); + } + + @Test + public void testIsAsync() { + CallActivity callActivity = bpmn2.createCallActivity(); + CustomElement.async.of(callActivity).set(Boolean.TRUE); + + tested = new CallActivityPropertyReader(callActivity, + definitionResolver.getDiagram(), + definitionResolver); + + assertTrue(tested.isAsync()); + } + + @Test + public void testGetSlaDueDate() { + String rawSlaDueDate = "12/25/1983"; + + CallActivity callActivity = bpmn2.createCallActivity(); + CustomElement.slaDueDate.of(callActivity).set(rawSlaDueDate); + + tested = new CallActivityPropertyReader(callActivity, + definitionResolver.getDiagram(), + definitionResolver); + + assertTrue(tested.getSlaDueDate().contains(rawSlaDueDate)); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CaseFileVariableReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CaseFileVariableReaderTest.java new file mode 100644 index 00000000000..abdce7a40e5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CaseFileVariableReaderTest.java @@ -0,0 +1,98 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.bpmn2.ItemDefinition; +import org.eclipse.bpmn2.Property; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class CaseFileVariableReaderTest { + + private List properties; + + @Mock + protected Property property1; + @Mock + protected Property property2; + @Mock + protected Property property3; + @Mock + protected Property property4; + + @Mock + protected ItemDefinition definition; + + @Before + public void setup() { + properties = new ArrayList<>(); + properties.add(property1); + properties.add(property2); + properties.add(property3); + properties.add(property4); + + when(property1.getName()).thenReturn(CaseFileVariables.CASE_FILE_PREFIX + "CFV1"); + when(property1.getId()).thenReturn(CaseFileVariables.CASE_FILE_PREFIX + "CFV1"); + when(property1.getItemSubjectRef()).thenReturn(definition); + + when(property2.getName()).thenReturn(null); + when(property2.getId()).thenReturn(CaseFileVariables.CASE_FILE_PREFIX + "CFV2"); + when(property2.getItemSubjectRef()).thenReturn(definition); + + when(definition.getStructureRef()).thenReturn("Boolean"); + + when(property3.getName()).thenReturn("PV1"); + when(property3.getId()).thenReturn("PV1"); + + when(property4.getName()).thenReturn(null); + when(property4.getId()).thenReturn("PV2"); + } + + @Test + public void getCaseFileVariables() { + String caseFileVariables = CaseFileVariableReader.getCaseFileVariables(properties); + assertEquals(caseFileVariables, "CFV1:Boolean,CFV2:Boolean"); + } + + @Test + public void isCaseFileVariable() { + boolean isCaseFile1 = CaseFileVariableReader.isCaseFileVariable(property1); + assertTrue(isCaseFile1); + + boolean isCaseFile2 = CaseFileVariableReader.isCaseFileVariable(property2); + assertTrue(isCaseFile2); + + boolean isCaseFile3 = CaseFileVariableReader.isCaseFileVariable(property3); + assertFalse(isCaseFile3); + + boolean isCaseFile4 = CaseFileVariableReader.isCaseFileVariable(property4); + assertFalse(isCaseFile4); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CatchEventPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CatchEventPropertyReaderTest.java new file mode 100644 index 00000000000..d5df2e2fb7d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/CatchEventPropertyReaderTest.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.Event; +import org.eclipse.bpmn2.EventDefinition; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.mockito.Mock; + +import static org.mockito.Mockito.when; + +public class CatchEventPropertyReaderTest extends BaseEventPropertyReaderTest { + + @Mock + private CatchEvent catchEvent; + + @Override + protected EventPropertyReader newPropertyReader() { + return new CatchEventPropertyReader(catchEvent, diagram, definitionResolver); + } + + @Override + protected void setSignalEventDefinitionOnCurrentMock(SignalEventDefinition eventDefinition) { + EList eventDefinitions = ECollections.singletonEList(eventDefinition); + when(catchEvent.getEventDefinitions()).thenReturn(eventDefinitions); + when(catchEvent.getEventDefinitionRefs()).thenReturn(ECollections.emptyEList()); + } + + @Override + protected Event getCurrentEventMock() { + return catchEvent; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EmbeddedSubprocessPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EmbeddedSubprocessPropertyReaderTest.java new file mode 100644 index 00000000000..2efbd32befe --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EmbeddedSubprocessPropertyReaderTest.java @@ -0,0 +1,75 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Collections; + +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.junit.Before; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; + +import static junit.framework.TestCase.assertTrue; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.di; + +public class EmbeddedSubprocessPropertyReaderTest { + + private DefinitionResolver definitionResolverReal; + + private SubProcessPropertyReader tested; + + @Before + public void setUp() { + Definitions definitions = bpmn2.createDefinitions(); + definitions.getRootElements().add(bpmn2.createProcess()); + BPMNDiagram bpmnDiagram = di.createBPMNDiagram(); + bpmnDiagram.setPlane(di.createBPMNPlane()); + definitions.getDiagrams().add(bpmnDiagram); + + definitionResolverReal = new DefinitionResolver(definitions, Collections.emptyList()); + } + + @Test + public void testIsAsync() { + SubProcess embeddedSubProcess = bpmn2.createSubProcess(); + CustomElement.async.of(embeddedSubProcess).set(Boolean.TRUE); + + tested = new SubProcessPropertyReader(embeddedSubProcess, + definitionResolverReal.getDiagram(), + definitionResolverReal); + + assertTrue(tested.isAsync()); + } + + @Test + public void testGetSlaDueDate() { + String rawSlaDueDate = "12/25/1983"; + + SubProcess embeddedSubProcess = bpmn2.createSubProcess(); + CustomElement.slaDueDate.of(embeddedSubProcess).set(rawSlaDueDate); + + tested = new SubProcessPropertyReader(embeddedSubProcess, + definitionResolverReal.getDiagram(), + definitionResolverReal); + + assertTrue(tested.getSlaDueDate().contains(rawSlaDueDate)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EventDefinitionReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EventDefinitionReaderTest.java new file mode 100644 index 00000000000..e7836d15027 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EventDefinitionReaderTest.java @@ -0,0 +1,124 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.CompensateEventDefinition; +import org.eclipse.bpmn2.Error; +import org.eclipse.bpmn2.ErrorEventDefinition; +import org.eclipse.bpmn2.Escalation; +import org.eclipse.bpmn2.EscalationEventDefinition; +import org.eclipse.bpmn2.Message; +import org.eclipse.bpmn2.MessageEventDefinition; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EventDefinitionReader.activityRefOf; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EventDefinitionReader.errorRefOf; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EventDefinitionReader.escalationRefOf; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.EventDefinitionReader.messageRefOf; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class EventDefinitionReaderTest { + + private static final String SOME_VALUE = "SOME_VALUE"; + + @Mock + private ErrorEventDefinition errorEventDefinition; + + @Mock + private MessageEventDefinition messageEventDefinition; + + @Mock + private EscalationEventDefinition escalationEventDefinition; + + @Mock + private CompensateEventDefinition compensateEventDefinition; + + @Test + public void testErrorRefOfWithValue() { + Error error = mock(Error.class); + when(error.getErrorCode()).thenReturn(SOME_VALUE); + testErrorRef(error, SOME_VALUE); + } + + @Test + public void testErrorRefOfWithNOValue() { + testErrorRef(null, ""); + } + + private void testErrorRef(Error error, String expectedValue) { + when(errorEventDefinition.getErrorRef()).thenReturn(error); + assertEquals(expectedValue, errorRefOf(errorEventDefinition)); + } + + @Test + public void testMessageRefOfWithValue() { + Message message = mock(Message.class); + when(message.getName()).thenReturn(SOME_VALUE); + testMessageRefOf(message, SOME_VALUE); + } + + @Test + public void testMessageRefOfWithNoValue() { + testMessageRefOf(null, ""); + } + + private void testMessageRefOf(Message message, String expectedValue) { + when(messageEventDefinition.getMessageRef()).thenReturn(message); + assertEquals(expectedValue, messageRefOf(messageEventDefinition)); + } + + @Test + public void testEscalationRefOfWithValue() { + Escalation escalation = mock(Escalation.class); + when(escalation.getEscalationCode()).thenReturn(SOME_VALUE); + testEscalationRefOf(escalation, SOME_VALUE); + } + + @Test + public void testEscalationRefOfWithNoValue() { + testEscalationRefOf(null, ""); + } + + private void testEscalationRefOf(Escalation escalation, String expectedValue) { + when(escalationEventDefinition.getEscalationRef()).thenReturn(escalation); + assertEquals(expectedValue, escalationRefOf(escalationEventDefinition)); + } + + @Test + public void testActivityRefOfWithValue() { + Activity activity = mock(Activity.class); + when(activity.getId()).thenReturn(SOME_VALUE); + testActivityRefOf(activity, SOME_VALUE); + } + + @Test + public void testActivityRefOfWithNoValue() { + testActivityRefOf(null, null); + } + + private void testActivityRefOf(Activity activity, String expectedValue) { + when(compensateEventDefinition.getActivityRef()).thenReturn(activity); + assertEquals(expectedValue, activityRefOf(compensateEventDefinition)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EventSubprocessPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EventSubprocessPropertyReaderTest.java new file mode 100644 index 00000000000..0c5c40134c0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/EventSubprocessPropertyReaderTest.java @@ -0,0 +1,75 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Collections; + +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.junit.Before; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; + +import static junit.framework.TestCase.assertTrue; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.di; + +public class EventSubprocessPropertyReaderTest { + + private DefinitionResolver definitionResolverReal; + + private SubProcessPropertyReader tested; + + @Before + public void setUp() { + Definitions definitions = bpmn2.createDefinitions(); + definitions.getRootElements().add(bpmn2.createProcess()); + BPMNDiagram bpmnDiagram = di.createBPMNDiagram(); + bpmnDiagram.setPlane(di.createBPMNPlane()); + definitions.getDiagrams().add(bpmnDiagram); + + definitionResolverReal = new DefinitionResolver(definitions, Collections.emptyList()); + } + + @Test + public void testIsAsync() { + SubProcess eventSubProcess = bpmn2.createSubProcess(); + CustomElement.async.of(eventSubProcess).set(Boolean.TRUE); + + tested = new SubProcessPropertyReader(eventSubProcess, + definitionResolverReal.getDiagram(), + definitionResolverReal); + + assertTrue(tested.isAsync()); + } + + @Test + public void testGetSlaDueDate() { + String rawSlaDueDate = "12/25/1983"; + + SubProcess eventSubProcess = bpmn2.createSubProcess(); + CustomElement.slaDueDate.of(eventSubProcess).set(rawSlaDueDate); + + tested = new SubProcessPropertyReader(eventSubProcess, + definitionResolverReal.getDiagram(), + definitionResolverReal); + + assertTrue(tested.getSlaDueDate().contains(rawSlaDueDate)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/FixedBoundsPropertyReadersTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/FixedBoundsPropertyReadersTest.java new file mode 100644 index 00000000000..a1abfbc77b9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/FixedBoundsPropertyReadersTest.java @@ -0,0 +1,132 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.BoundaryEvent; +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.Gateway; +import org.eclipse.bpmn2.ThrowEvent; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNShape; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class FixedBoundsPropertyReadersTest { + + private static final double RESOLUTION_FACTOR = 1d; + private static final String CATCH_EVENT_ID = "ce"; + private static final String BOUNDARY_EVENT_ID = "be"; + private static final String THROW_EVENT_ID = "te"; + private static final String GATEWAY_EVENT_ID = "gw"; + + @Mock + private CatchEvent catchEvent; + + @Mock + private BoundaryEvent boundaryEvent; + + @Mock + private ThrowEvent throwEvent; + + @Mock + private Gateway gateway; + + @Mock + private BPMNDiagram diagram; + + @Mock + private DefinitionResolver definitionResolver; + + @Mock + private BPMNShape catchEventShape; + + @Mock + private BPMNShape boundaryEventShape; + + @Mock + private BPMNShape throwEventShape; + + @Mock + private BPMNShape gatewayEventShape; + + private CatchEventPropertyReader catchEventPropertyReader; + private BoundaryEventPropertyReader boundaryEventPropertyReader; + private ThrowEventPropertyReader throwEventPropertyReader; + private GatewayPropertyReader gatewayPropertyReader; + + @Before + public void setup() { + when(definitionResolver.getResolutionFactor()).thenReturn(RESOLUTION_FACTOR); + when(catchEvent.getId()).thenReturn(CATCH_EVENT_ID); + when(boundaryEvent.getId()).thenReturn(BOUNDARY_EVENT_ID); + when(throwEvent.getId()).thenReturn(THROW_EVENT_ID); + when(gateway.getId()).thenReturn(GATEWAY_EVENT_ID); + when(definitionResolver.getShape(eq(CATCH_EVENT_ID))).thenReturn(catchEventShape); + when(definitionResolver.getShape(eq(BOUNDARY_EVENT_ID))).thenReturn(boundaryEventShape); + when(definitionResolver.getShape(eq(THROW_EVENT_ID))).thenReturn(throwEventShape); + when(definitionResolver.getShape(eq(GATEWAY_EVENT_ID))).thenReturn(gatewayEventShape); + this.catchEventPropertyReader = new CatchEventPropertyReader(catchEvent, diagram, definitionResolver); + this.boundaryEventPropertyReader = spy(new BoundaryEventPropertyReader(boundaryEvent, diagram, definitionResolver)); + this.throwEventPropertyReader = new ThrowEventPropertyReader(throwEvent, diagram, definitionResolver); + this.gatewayPropertyReader = new GatewayPropertyReader(gateway, diagram, gatewayEventShape, RESOLUTION_FACTOR); + } + + @Test + public void testBounds() { + org.eclipse.dd.dc.Bounds catchEventShapeBounds = mockBounds(1f, 2f, 123.2f, 322.3f); + when(catchEventShape.getBounds()).thenReturn(catchEventShapeBounds); + org.eclipse.dd.dc.Bounds throwEventShapeBounds = mockBounds(5f, 6f, 2144.67f, 853.34f); + when(throwEventShape.getBounds()).thenReturn(throwEventShapeBounds); + doReturn(Point2D.create(3d, 4d)).when(boundaryEventPropertyReader).getDockerInfo(); + org.eclipse.dd.dc.Bounds gatewayEventShapeBounds = mockBounds(7f, 8f, 4543.2f, 25.3f); + when(gatewayEventShape.getBounds()).thenReturn(gatewayEventShapeBounds); + Bounds catchEventBounds = catchEventPropertyReader.getBounds(); + Bounds boundaryEventBounds = boundaryEventPropertyReader.getBounds(); + Bounds throwEventBounds = throwEventPropertyReader.getBounds(); + Bounds gatewayEventBounds = gatewayPropertyReader.getBounds(); + assertEquals(Bounds.create(1, 2, 57, 58), catchEventBounds); + assertEquals(Bounds.create(3, 4, 59, 60), boundaryEventBounds); + assertEquals(Bounds.create(5, 6, 61, 62), throwEventBounds); + assertEquals(Bounds.create(7, 8, 63, 64), gatewayEventBounds); + } + + private static org.eclipse.dd.dc.Bounds mockBounds(float x, + float y, + float width, + float height) { + org.eclipse.dd.dc.Bounds bounds = mock(org.eclipse.dd.dc.Bounds.class); + when(bounds.getX()).thenReturn(x); + when(bounds.getY()).thenReturn(y); + when(bounds.getWidth()).thenReturn(width); + when(bounds.getHeight()).thenReturn(height); + return bounds; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/GenericServiceTaskPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/GenericServiceTaskPropertyReaderTest.java new file mode 100644 index 00000000000..2c2a7cf339e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/GenericServiceTaskPropertyReaderTest.java @@ -0,0 +1,97 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.ServiceTask; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.GenericServiceTaskPropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +@RunWith(MockitoJUnitRunner.class) +public class GenericServiceTaskPropertyReaderTest { + + private final static String SLA_DUE_DATE = "12/25/1983"; + private final static String SLA_DUE_DATE_CDATA = ""; + + private GenericServiceTaskPropertyReader reader; + + @Mock + private BPMNDiagram diagram; + + @Mock + private DefinitionResolver definitionResolver; + + private GenericServiceTaskValue value; + + @Before + public void setUp() { + ServiceTask serviceTask = bpmn2.createServiceTask(); + value = new GenericServiceTaskValue("java", + "serviceInterface", + "serviceOperation", + "inMessageStructure", + "outMessageStructure"); + + GenericServiceTaskPropertyWriter writer = new GenericServiceTaskPropertyWriter(serviceTask, null); + writer.setValue(value); + writer.setSLADueDate(SLA_DUE_DATE); + writer.setAsync(false); + writer.setAdHocAutostart(true); + + OnEntryAction onEntryAction = new OnEntryAction(); + onEntryAction.setValue(new ScriptTypeListValue()); + writer.setOnEntryAction(onEntryAction); + + OnExitAction onExitAction = new OnExitAction(); + onExitAction.setValue(new ScriptTypeListValue()); + writer.setOnExitAction(onExitAction); + + writer.setAssignmentsInfo(new AssignmentsInfo()); + + reader = new GenericServiceTaskPropertyReader(serviceTask, diagram, definitionResolver); + } + + @Test + public void getGenericServiceTask() { + GenericServiceTaskValue task = reader.getGenericServiceTask(); + assertEquals("Java", task.getServiceImplementation()); + assertEquals("serviceOperation", task.getServiceOperation()); + assertEquals("serviceInterface", task.getServiceInterface()); + assertEquals("inMessageStructure", task.getInMessageStructure()); + assertEquals("outMessageStructure", task.getOutMessagetructure()); + assertEquals(SLA_DUE_DATE_CDATA, reader.getSLADueDate()); + assertEquals(false, reader.isAsync()); + assertEquals(true, reader.isAdHocAutostart()); + assertNotNull(reader.getOnEntryAction()); + assertNotNull(reader.getOnExitAction()); + assertNotNull(reader.getAssignmentsInfo()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/InputAssignmentReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/InputAssignmentReaderTest.java new file mode 100644 index 00000000000..41f915d9ab5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/InputAssignmentReaderTest.java @@ -0,0 +1,72 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.FormalExpression; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.AssociationDeclaration; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.util.FormalExpressionBodyHandler; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; + +public class InputAssignmentReaderTest { + + public static final String ID = "PARENT_ID"; + + // TODO: Kogito - @Test + public void urlEncodeConstants() throws UnsupportedEncodingException { + final String decoded = "<<<#!!!#>>>"; + final String expected = URLEncoder.encode(decoded, "UTF-8"); + + final Assignment assignment = createAssignment(decoded); + + final InputAssignmentReader iar = new InputAssignmentReader(assignment, ID); + + final AssociationDeclaration associationDeclaration = iar.getAssociationDeclaration(); + + assertEquals(AssociationDeclaration.Type.FromTo, associationDeclaration.getType()); + assertEquals(expected, associationDeclaration.getSource()); + } + + private static Assignment createAssignment(String decodedBody) { + final Assignment assignment = bpmn2.createAssignment(); + final FormalExpression from = bpmn2.createFormalExpression(); + FormalExpressionBodyHandler.of(from).setBody(decodedBody); + + final FormalExpression to = bpmn2.createFormalExpression(); + FormalExpressionBodyHandler.of(to).setBody(ID); + + assignment.setFrom(from); + assignment.setTo(to); + return assignment; + } + + @Test + public void testNullBody() { + final Assignment assignment = createAssignment(null); + final InputAssignmentReader iar = new InputAssignmentReader(assignment, ID); + final AssociationDeclaration associationDeclaration = iar.getAssociationDeclaration(); + + assertEquals(AssociationDeclaration.Type.FromTo, associationDeclaration.getType()); + assertEquals("", associationDeclaration.getSource()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ItemNameReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ItemNameReaderTest.java new file mode 100644 index 00000000000..ff6e53b13f0 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ItemNameReaderTest.java @@ -0,0 +1,91 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.Property; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class ItemNameReaderTest { + + private static String NAME = "NAME"; + private static String ID = "PARENT_ID"; + + @Mock + private Property property; + + @Mock + private DataInput dataInput; + + @Mock + private DataOutput dataOutput; + + @Test + public void testGetPropertyName() { + when(property.getName()).thenReturn(NAME); + when(property.getId()).thenReturn(ID); + testGetName(NAME, property); + } + + @Test + public void testGetPropertyID() { + when(property.getName()).thenReturn(null); + when(property.getId()).thenReturn(ID); + testGetName(ID, property); + } + + @Test + public void testGetDataInputName() { + when(dataInput.getName()).thenReturn(NAME); + when(dataInput.getId()).thenReturn(ID); + testGetName(NAME, dataInput); + } + + @Test + public void testGetDataInputID() { + when(dataInput.getName()).thenReturn(null); + when(dataInput.getId()).thenReturn(ID); + testGetName(ID, dataInput); + } + + @Test + public void testGetDataOutputName() { + when(dataOutput.getName()).thenReturn(NAME); + when(dataOutput.getId()).thenReturn(ID); + testGetName(NAME, dataOutput); + } + + @Test + public void testGetDataOutputID() { + when(dataOutput.getName()).thenReturn(null); + when(dataOutput.getId()).thenReturn(ID); + testGetName(ID, dataOutput); + } + + private void testGetName(String expectedValue, ItemAwareElement element) { + assertEquals(expectedValue, ItemNameReader.from(element).getName()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/LanePropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/LanePropertyReaderTest.java new file mode 100644 index 00000000000..9a0e81e62ed --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/LanePropertyReaderTest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.Lane; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.emf.common.util.EList; +import org.jboss.drools.DroolsPackage; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestDefinitionsWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.LanePropertyWriter; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.PropertyWriterFactory; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.assertBounds; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.mockBounds; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.mockExtensionValues; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.Scripts.asCData; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class LanePropertyReaderTest { + + private static final String NAME = "NAME"; + private static final String METADATA_ELEMENT_NAME = "elementname"; + private static final float X = 5; + private static final float Y = 6f; + private static final float WIDTH = 7f; + private static final float HEIGHT = 8f; + + private static final float PARENT_X = 1f; + private static final float PARENT_Y = 2f; + private static final float PARENT_WIDTH = 10f; + private static final float PARENT_HEIGHT = 11f; + + private static double RESOLUTION_FACTOR = 1.234; + + @Mock + private Lane lane; + + @Mock + private BPMNDiagram diagram; + + @Mock + private BPMNShape shape; + + private org.eclipse.dd.dc.Bounds bounds; + + @Mock + private BPMNShape parentLaneShape; + + private org.eclipse.dd.dc.Bounds parentBounds; + + @Before + public void setUp() { + bounds = mockBounds(X, Y, WIDTH, HEIGHT); + when(shape.getBounds()).thenReturn(bounds); + parentBounds = mockBounds(PARENT_X, PARENT_Y, PARENT_WIDTH, PARENT_HEIGHT); + when(parentLaneShape.getBounds()).thenReturn(parentBounds); + } + + @Test + public void JBPM_7523_shouldPreserveNameChars() { + PropertyReaderFactory factory = new PropertyReaderFactory( + new TestDefinitionsWriter().getDefinitionResolver()); + Lane lane = bpmn2.createLane(); + + PropertyWriterFactory writerFactory = new PropertyWriterFactory(); + LanePropertyWriter w = writerFactory.of(lane); + + String aWeirdName = " XXX !!@@ <><> "; + String aWeirdDoc = " XXX !!@@ <><> Docs "; + w.setName(aWeirdName); + w.setDocumentation(aWeirdDoc); + + LanePropertyReader r = factory.of(lane); + assertThat(r.getName()).isEqualTo(asCData(aWeirdName)); + assertThat(r.getDocumentation()).isEqualTo(asCData(aWeirdDoc)); + } + + @Test + public void testGetBounds() { + LanePropertyReader propertyReader = new LanePropertyReader(lane, diagram, shape, RESOLUTION_FACTOR); + Bounds result = propertyReader.getBounds(); + assertBounds(X * RESOLUTION_FACTOR, + Y * RESOLUTION_FACTOR, + X * RESOLUTION_FACTOR + WIDTH * RESOLUTION_FACTOR, + Y * RESOLUTION_FACTOR + HEIGHT * RESOLUTION_FACTOR, + result); + } + + @Test + public void testGetBoundsWithParentLaneShape() { + LanePropertyReader propertyReader = new LanePropertyReader(lane, diagram, shape, parentLaneShape, RESOLUTION_FACTOR); + Bounds result = propertyReader.getBounds(); + assertBounds(PARENT_X * RESOLUTION_FACTOR, + Y * RESOLUTION_FACTOR, + PARENT_X * RESOLUTION_FACTOR + PARENT_WIDTH * RESOLUTION_FACTOR, + Y * RESOLUTION_FACTOR + HEIGHT * RESOLUTION_FACTOR, + result); + } + + @Test + public void testGetRectangleDimensionsSet() { + LanePropertyReader propertyReader = new LanePropertyReader(lane, diagram, shape, RESOLUTION_FACTOR); + RectangleDimensionsSet dimensionsSet = propertyReader.getRectangleDimensionsSet(); + assertRectangleDimensions(WIDTH * RESOLUTION_FACTOR, HEIGHT * RESOLUTION_FACTOR, dimensionsSet); + } + + @Test + public void testGetRectangleDimensionsSetWithParentShape() { + LanePropertyReader propertyReader = new LanePropertyReader(lane, diagram, shape, parentLaneShape, RESOLUTION_FACTOR); + RectangleDimensionsSet dimensionsSet = propertyReader.getRectangleDimensionsSet(); + assertRectangleDimensions(PARENT_WIDTH * RESOLUTION_FACTOR, HEIGHT * RESOLUTION_FACTOR, dimensionsSet); + } + + @Test + public void testGetNameFromExtensionElement() { + EList extensionValues = mockExtensionValues(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, METADATA_ELEMENT_NAME, NAME); + when(lane.getName()).thenReturn(null); + when(lane.getExtensionValues()).thenReturn(extensionValues); + LanePropertyReader propertyReader = new LanePropertyReader(lane, diagram, shape, RESOLUTION_FACTOR); + assertEquals(NAME, propertyReader.getName()); + } + + @Test + public void testGetNameFromNameValue() { + LanePropertyReader propertyReader = new LanePropertyReader(lane, diagram, shape, RESOLUTION_FACTOR); + when(lane.getExtensionValues()).thenReturn(null); + when(lane.getName()).thenReturn(NAME); + assertEquals(NAME, propertyReader.getName()); + } + + private void assertRectangleDimensions(double width, double height, RectangleDimensionsSet dimensionsSet) { + assertEquals(width, dimensionsSet.getWidth().getValue(), 0); + assertEquals(height, dimensionsSet.getHeight().getValue(), 0); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/MultipleInstanceActivityPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/MultipleInstanceActivityPropertyReaderTest.java new file mode 100644 index 00000000000..39e9683a39c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/MultipleInstanceActivityPropertyReaderTest.java @@ -0,0 +1,127 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.ActivityPropertyReaderTest.mockDataInput; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.ActivityPropertyReaderTest.mockDataInputAssociation; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.ActivityPropertyReaderTest.mockDataOutput; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.ActivityPropertyReaderTest.mockDataOutputAssociation; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.ActivityPropertyReaderTest.mockItemAwareElement; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class MultipleInstanceActivityPropertyReaderTest { + + private static final String ITEM_ID = "ITEM_ID"; + private static final String PROPERTY_ID = "PROPERTY_ID"; + private static final String EXPRESSION = "EXPRESSION"; + + private MultipleInstanceActivityPropertyReader reader; + + @Mock + private Activity activity; + + @Mock + private BPMNDiagram diagram; + + @Mock + private DefinitionResolver definitionResolver; + + @Mock + private MultiInstanceLoopCharacteristics miloop; + + @Before + public void setUp() { + reader = new MultipleInstanceActivityPropertyReader(activity, diagram, definitionResolver); + when(activity.getLoopCharacteristics()).thenReturn(miloop); + } + + @Test + public void testGetCollectionInput() { + ItemAwareElement item = mockItemAwareElement(ITEM_ID); + when(miloop.getLoopDataInputRef()).thenReturn(item); + EList inputAssociations = ECollections.singletonEList(mockDataInputAssociation(ITEM_ID, PROPERTY_ID)); + when(activity.getDataInputAssociations()).thenReturn(inputAssociations); + assertEquals(PROPERTY_ID, reader.getCollectionInput()); + } + + @Test + public void testGetDataInput() { + DataInput item = mockDataInput(ITEM_ID, PROPERTY_ID); + when(miloop.getInputDataItem()).thenReturn(item); + assertEquals(PROPERTY_ID, reader.getDataInput()); + } + + @Test + public void testGetCollectionOutput() { + ItemAwareElement item = mockItemAwareElement(ITEM_ID); + when(miloop.getLoopDataOutputRef()).thenReturn(item); + EList outputAssociations = ECollections.singletonEList(mockDataOutputAssociation(ITEM_ID, PROPERTY_ID)); + when(activity.getDataOutputAssociations()).thenReturn(outputAssociations); + assertEquals(PROPERTY_ID, reader.getCollectionOutput()); + } + + @Test + public void testGetDataOutput() { + DataOutput item = mockDataOutput(ITEM_ID, PROPERTY_ID); + when(miloop.getOutputDataItem()).thenReturn(item); + assertEquals(PROPERTY_ID, reader.getDataOutput()); + } + + // TODO: Kogito - @Test + public void getGetCompletionCondition() { + FormalExpression expression = mock(FormalExpression.class); + when(expression.getBody()).thenReturn(EXPRESSION); + when(miloop.getCompletionCondition()).thenReturn(expression); + assertEquals(EXPRESSION, reader.getCompletionCondition()); + } + + @Test + public void testGetIsSequentialTrue() { + testIsSequential(true); + } + + @Test + public void testGetIsSequentialFalse() { + testIsSequential(false); + } + + private void testIsSequential(boolean sequential) { + when(miloop.isIsSequential()).thenReturn(sequential); + assertEquals(sequential, reader.isSequential()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/MultipleInstanceSubProcessPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/MultipleInstanceSubProcessPropertyReaderTest.java new file mode 100644 index 00000000000..0834a33fb9b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/MultipleInstanceSubProcessPropertyReaderTest.java @@ -0,0 +1,115 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Collections; + +import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNPlane; +import org.eclipse.bpmn2.di.BPMNShape; +import org.junit.Before; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; + +import static junit.framework.TestCase.assertEquals; +import static junit.framework.TestCase.assertNull; +import static junit.framework.TestCase.assertTrue; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.bpmn2; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.di; + +public class MultipleInstanceSubProcessPropertyReaderTest { + + private DefinitionResolver definitionResolverReal; + + private MultipleInstanceSubProcessPropertyReader tested; + + @Before + public void setUp() { + Definitions definitions = bpmn2.createDefinitions(); + definitions.getRootElements().add(bpmn2.createProcess()); + BPMNDiagram bpmnDiagram = di.createBPMNDiagram(); + bpmnDiagram.setPlane(di.createBPMNPlane()); + definitions.getDiagrams().add(bpmnDiagram); + + definitionResolverReal = new DefinitionResolver(definitions, Collections.emptyList()); + } + + @Test + public void testIsAsync() { + SubProcess multipleInstanceSubProcess = bpmn2.createSubProcess(); + multipleInstanceSubProcess.setLoopCharacteristics(bpmn2.createMultiInstanceLoopCharacteristics()); + CustomElement.async.of(multipleInstanceSubProcess).set(Boolean.TRUE); + + tested = new MultipleInstanceSubProcessPropertyReader(multipleInstanceSubProcess, + definitionResolverReal.getDiagram(), + definitionResolverReal); + + assertTrue(tested.isAsync()); + } + + @Test + public void defaultReturnValues() { + MultipleInstanceSubProcessPropertyReader p = + new MultipleInstanceSubProcessPropertyReader(bpmn2.createSubProcess(), null, new DummyDefinitionResolver()); + assertNull(p.getCollectionInput()); + assertNull(p.getCollectionOutput()); + assertEquals("", p.getDataInput()); + assertEquals("", p.getDataOutput()); + assertEquals("", p.getCompletionCondition()); + assertEquals("", p.getSlaDueDate()); + } + + // internal mock + static class DummyDefinitionResolver extends DefinitionResolver { + + DummyDefinitionResolver() { + super(makeDefinitions(), Collections.emptyList()); + } + + public BPMNShape getShape(String elementId) { + return null; + } + + static Definitions makeDefinitions() { + Definitions d = bpmn2.createDefinitions(); + BPMNPlane bpmnPlane = di.createBPMNPlane(); + BPMNDiagram bpmnDiagram = di.createBPMNDiagram(); + bpmnDiagram.setPlane(bpmnPlane); + d.getDiagrams().add(bpmnDiagram); + d.getRootElements().add(bpmn2.createProcess()); + return d; + } + } + + @Test + public void testGetSlaDueDate() { + String rawSlaDueDate = "12/25/1983"; + + SubProcess multipleInstanceSubProcess = bpmn2.createSubProcess(); + multipleInstanceSubProcess.setLoopCharacteristics(bpmn2.createMultiInstanceLoopCharacteristics()); + CustomElement.slaDueDate.of(multipleInstanceSubProcess).set(rawSlaDueDate); + + tested = new MultipleInstanceSubProcessPropertyReader(multipleInstanceSubProcess, + definitionResolverReal.getDiagram(), + definitionResolverReal); + + assertTrue(tested.getSlaDueDate().contains(rawSlaDueDate)); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/OutputAssignmentReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/OutputAssignmentReaderTest.java new file mode 100644 index 00000000000..80e634db939 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/OutputAssignmentReaderTest.java @@ -0,0 +1,87 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.Property; +import org.eclipse.emf.common.util.ECollections; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.AssociationDeclaration; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class OutputAssignmentReaderTest { + + private static final String SOURCE_NAME = "SOURCE_NAME"; + private static final String TARGET_NAME = "TARGET_NAME"; + private static final String TARGET_ID = "TARGET_ID"; + + @Test + public void testFromAssociationWithPropertyName() { + Property property = mockProperty(TARGET_ID, TARGET_NAME); + DataOutputAssociation outputAssociation = mockDataOutputAssociation(SOURCE_NAME, property); + OutputAssignmentReader outputReader = OutputAssignmentReader.fromAssociation(outputAssociation); + assertNotNull(outputReader); + assertResult(SOURCE_NAME, TARGET_NAME, outputReader.getAssociationDeclaration()); + } + + @Test + public void testFromAssociationWithPropertyId() { + Property property = mockProperty(TARGET_ID, null); + DataOutputAssociation outputAssociation = mockDataOutputAssociation(SOURCE_NAME, property); + OutputAssignmentReader outputReader = OutputAssignmentReader.fromAssociation(outputAssociation); + assertNotNull(outputReader); + assertResult(SOURCE_NAME, TARGET_ID, outputReader.getAssociationDeclaration()); + } + + @Test + public void testFromAssociationWithNonPropertyItem() { + ItemAwareElement item = mock(ItemAwareElement.class); + DataOutputAssociation outputAssociation = mockDataOutputAssociation(SOURCE_NAME, item); + assertNull(OutputAssignmentReader.fromAssociation(outputAssociation)); + } + + private void assertResult(String sourceName, String targetId, AssociationDeclaration associationDeclaration) { + assertNotNull(associationDeclaration); + assertEquals(sourceName, associationDeclaration.getSource()); + assertEquals(targetId, associationDeclaration.getTarget()); + assertEquals(AssociationDeclaration.Type.SourceTarget, associationDeclaration.getType()); + assertEquals(AssociationDeclaration.Direction.Output, associationDeclaration.getDirection()); + } + + private static Property mockProperty(String id, String name) { + Property property = mock(Property.class); + when(property.getId()).thenReturn(id); + when(property.getName()).thenReturn(name); + return property; + } + + private static DataOutputAssociation mockDataOutputAssociation(String dataOutputName, ItemAwareElement targetRef) { + DataOutputAssociation outputAssociation = mock(DataOutputAssociation.class); + DataOutput dataOutput = mock(DataOutput.class); + when(dataOutput.getName()).thenReturn(dataOutputName); + when(outputAssociation.getSourceRef()).thenReturn(ECollections.singletonEList(dataOutput)); + when(outputAssociation.getTargetRef()).thenReturn(targetRef); + return outputAssociation; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ParsedAssignmentsInfoTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ParsedAssignmentsInfoTest.java new file mode 100644 index 00000000000..e06632a23e1 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ParsedAssignmentsInfoTest.java @@ -0,0 +1,161 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.List; + +import org.eclipse.bpmn2.Assignment; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.impl.PropertyImpl; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.InitializedVariable; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.ParsedAssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.FlatVariableScope; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.properties.VariableScope; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; + +@RunWith(MockitoJUnitRunner.class) +public class ParsedAssignmentsInfoTest { + + private static final String ASSIGNMENTS_INFO = "Years of Service:Integer||Data Test:Boolean||[din]Years of Service=35,[dout]Data Test->BooleanTest"; + + private ParsedAssignmentsInfo tested; + + @Before + public void setup() { + AssignmentsInfo assignmentsInfos = new AssignmentsInfo(ASSIGNMENTS_INFO); + tested = ParsedAssignmentsInfo.of(assignmentsInfos); + } + + // TODO: Kogito - @Test + public void testCreateInitializedInputVariables() { + final String DATA_INPUT_ID = "_Years-of-ServiceInputX"; + final String DATA_INPUT_NAME = "Years of Service"; + final String DATA_INPUT_ASSOCIATION_ID = "Years of Service"; + final String DATA_INPUT_ASSOCIATION_VALUE = ""; + final String INIT_INPUT_VAR_ID = "Years-of-Service"; + final String INIT_INPUT_VAR_TYPE = "Integer"; + + VariableScope variableScope = new FlatVariableScope(); + List initializedInputVariables = + tested.createInitializedInputVariables("", variableScope); + + assertEquals(initializedInputVariables.size(), 1); + + InitializedVariable.InitializedInputVariable initializedInputVariable = + initializedInputVariables.get(0); + + DataInput dataInput = initializedInputVariable.getDataInput(); + + DataInputAssociation dataInputAssociation = initializedInputVariable.getDataInputAssociation(); + DataInput target = (DataInput) dataInputAssociation.getTargetRef(); + + List assignments = dataInputAssociation.getAssignment(); + Assignment assignment = assignments.get(0); + FormalExpression from = (FormalExpression) assignment.getFrom(); + + String dataInputID = dataInput.getId(); + String dataInputName = dataInput.getName(); + String dataInputAssociationID = target.getName(); + String dataInputAssociationValue = from.getBody(); + String initVarID = initializedInputVariable.getIdentifier(); + String initVarType = initializedInputVariable.getType(); + + assertEquals(dataInputID, DATA_INPUT_ID); + assertEquals(dataInputName, DATA_INPUT_NAME); + assertEquals(dataInputAssociationID, DATA_INPUT_ASSOCIATION_ID); + assertEquals(dataInputAssociationValue, DATA_INPUT_ASSOCIATION_VALUE); + assertEquals(initVarID, INIT_INPUT_VAR_ID); + assertEquals(initVarType, INIT_INPUT_VAR_TYPE); + } + + @Test + public void testCreateInitializedOutputVariables() { + final String DATA_OUTPUT_ID = "_Data-TestOutputX"; + final String DATA_OUTPUT_NAME = "Data Test"; + final String DATA_OUTPUT_ASSOCIATION_ID = "Data Test"; + final String DATA_OUTPUT_ASSOCIATION_VALUE = "BooleanTest"; + final String INIT_OUTPUT_VAR_ID = "Data-Test"; + final String INIT_OUTPUT_VAR_TYPE = "Boolean"; + + VariableScope variableScope = new FlatVariableScope(); + variableScope.declare("", "BooleanTest", "Boolean"); + + List initializedOutputVariables = + tested.createInitializedOutputVariables("", variableScope); + + assertEquals(1, initializedOutputVariables.size()); + + InitializedVariable.InitializedOutputVariable initializedOutputVariable = + initializedOutputVariables.get(0); + + DataOutput dataOuput = initializedOutputVariable.getDataOutput(); + + DataOutputAssociation dataOutputAssociation = initializedOutputVariable.getDataOutputAssociation(); + List sourceRef = dataOutputAssociation.getSourceRef(); + DataOutput source = (DataOutput) sourceRef.get(0); + PropertyImpl target = (PropertyImpl) dataOutputAssociation.getTargetRef(); + + String dataOuputID = dataOuput.getId(); + String dataOutputName = dataOuput.getName(); + String dataOutputAssociationID = source.getName(); + String dataOutputAssocationValue = target.getId(); + String initVarID = initializedOutputVariable.getIdentifier(); + String initVarType = initializedOutputVariable.getType(); + + assertEquals(dataOuputID, DATA_OUTPUT_ID); + assertEquals(dataOutputName, DATA_OUTPUT_NAME); + assertEquals(dataOutputAssociationID, DATA_OUTPUT_ASSOCIATION_ID); + assertEquals(dataOutputAssocationValue, DATA_OUTPUT_ASSOCIATION_VALUE); + assertEquals(initVarID, INIT_OUTPUT_VAR_ID); + assertEquals(initVarType, INIT_OUTPUT_VAR_TYPE); + } + + @Test + public void fromString() { + String original = + "|input1:String,input2:String||output1:String,output2:String|[din]pv1->input1,[din]pv2->input2,[dout]output1->pv2,[dout]output2->pv2"; + assertParseUnparse(original); + } + + @Test + public void fromString2() { + String original = + "||IntermediateMessageEventCatchingOutputVar1:String||[dout]IntermediateMessageEventCatchingOutputVar1->var1"; + assertParseUnparse(original); + } + + private void assertParseUnparse(String original) { + ParsedAssignmentsInfo assignmentsInfo = + ParsedAssignmentsInfo.fromString(original); + + String s1 = assignmentsInfo.toString(); + String s2 = ParsedAssignmentsInfo.fromString(s1).toString(); + + assertEquals(original, s2); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ParsedNotificationsInfosTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ParsedNotificationsInfosTest.java new file mode 100644 index 00000000000..181dfb62503 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ParsedNotificationsInfosTest.java @@ -0,0 +1,68 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.ArrayList; +import java.util.Arrays; + +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.ParsedNotificationsInfos; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations.AssociationType; +import org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue; + +import static org.junit.Assert.assertEquals; + +public class ParsedNotificationsInfosTest { + + @Test + public void testNotification() { + String body = "[from:director|tousers:director,jack,katy|togroups:Forms,IT|replyTo:guest|subject:asd|body:asd]@[11h]"; + NotificationValue actual = ParsedNotificationsInfos.of(AssociationType.NOT_COMPLETED_NOTIFY.getName(), body); + NotificationValue expected = new NotificationValue(); + expected.setType(AssociationType.NOT_COMPLETED_NOTIFY.getName()); + expected.setFrom("director"); + expected.setReplyTo("guest"); + expected.setSubject("asd"); + expected.setBody("asd"); + expected.setExpiresAt("11h"); + expected.setGroups(new ArrayList<>(Arrays.asList("Forms", "IT"))); + expected.setUsers(new ArrayList<>(Arrays.asList("director", "jack", "katy"))); + + assertEquals(expected, actual); + } + + @Test + public void testNotificationPartial() { + String body = "[from:|tousers:|togroups:|replyTo:|subject:|body:]@[0h]]"; + NotificationValue actual = ParsedNotificationsInfos.of(AssociationType.NOT_COMPLETED_NOTIFY.getName(), body); + NotificationValue expected = new NotificationValue(); + expected.setType(AssociationType.NOT_COMPLETED_NOTIFY.getName()); + expected.setExpiresAt("0h"); + + assertEquals(expected.toString(), actual.toString()); + assertEquals(expected.toCDATAFormat(), actual.toCDATAFormat()); + assertEquals(expected, actual); + } + + @Test + public void testNotificationEmpty() { + NotificationValue value = ParsedNotificationsInfos.of(AssociationType.NOT_COMPLETED_NOTIFY.getName(), ""); + NotificationValue valid = new NotificationValue(); + valid.setType(AssociationType.NOT_COMPLETED_NOTIFY.getName()); + assertEquals(valid, value); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ParsedReassignmentsInfosTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ParsedReassignmentsInfosTest.java new file mode 100644 index 00000000000..776d7257462 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ParsedReassignmentsInfosTest.java @@ -0,0 +1,64 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.ArrayList; +import java.util.Arrays; + +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.ParsedReassignmentsInfos; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.associations.AssociationType; +import org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue; + +import static org.junit.Assert.assertEquals; + +public class ParsedReassignmentsInfosTest { + + @Test + public void testReassignment() { + String body = "[users:Forms,Reviewer,manager|groups:director,john]@[33y]"; + ReassignmentValue actual = ParsedReassignmentsInfos.of(AssociationType.NOT_COMPLETED_REASSIGN.getName(), body); + ReassignmentValue expected = new ReassignmentValue(); + expected.setType(AssociationType.NOT_COMPLETED_REASSIGN.getName()); + expected.setDuration("33y"); + expected.setGroups(new ArrayList<>(Arrays.asList("director", "john"))); + expected.setUsers(new ArrayList<>(Arrays.asList("Forms", "Reviewer", "manager"))); + + assertEquals(expected, actual); + } + + @Test + public void testReassignmentPartial() { + String body = "[users:|groups:]@[33h]"; + ReassignmentValue actual = ParsedReassignmentsInfos.of(AssociationType.NOT_COMPLETED_REASSIGN.getName(), body); + ReassignmentValue expected = new ReassignmentValue(); + expected.setType(AssociationType.NOT_COMPLETED_REASSIGN.getName()); + expected.setDuration("33h"); + + assertEquals(expected.toString(), actual.toString()); + assertEquals(expected.toCDATAFormat(), actual.toCDATAFormat()); + assertEquals(expected, actual); + } + + @Test + public void testNotificationEmpty() { + ReassignmentValue value = ParsedReassignmentsInfos.of(AssociationType.NOT_COMPLETED_REASSIGN.getName(), ""); + ReassignmentValue valid = new ReassignmentValue(); + valid.setType(AssociationType.NOT_COMPLETED_REASSIGN.getName()); + assertEquals(valid, value); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/PropertyReaderUtilsTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/PropertyReaderUtilsTest.java new file mode 100644 index 00000000000..2ea4e0f19b9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/PropertyReaderUtilsTest.java @@ -0,0 +1,272 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.dd.dc.Bounds; +import org.eclipse.dd.dc.Point; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.jboss.drools.DroolsPackage; +import org.jboss.drools.MetaDataType; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.util.PropertyReaderUtils; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class PropertyReaderUtilsTest { + + private static final String EDGE_ID = "EDGE_ID"; + + private static final String SHAPE_ID = "SHAPE_ID"; + + private static final float BOUNDS_X = 1; + + private static final float BOUNDS_Y = 2; + + private static final float BOUNDS_WIDTH = 2; + + private static final float BOUNDS_HEIGHT = 4; + + private static final float WAY_POINT_X = 1; + + private static final float WAY_POINT_Y = 2; + + @Mock + private DefinitionResolver definitionResolver; + + @Mock + private BPMNEdge edge; + + @Mock + private BPMNShape shape; + + @Mock + private Bounds bounds; + + @Mock + private Point point; + + @Mock + private BaseElement baseElement; + + @Before + public void setUp() { + when(bounds.getX()).thenReturn(BOUNDS_X); + when(bounds.getY()).thenReturn(BOUNDS_Y); + when(bounds.getWidth()).thenReturn(BOUNDS_WIDTH); + when(bounds.getHeight()).thenReturn(BOUNDS_HEIGHT); + when(point.getX()).thenReturn(WAY_POINT_X); + when(point.getY()).thenReturn(WAY_POINT_Y); + + when(definitionResolver.getResolutionFactor()).thenReturn(1d); + when(definitionResolver.getEdge(EDGE_ID)).thenReturn(edge); + when(definitionResolver.getShape(SHAPE_ID)).thenReturn(shape); + when(shape.getBounds()).thenReturn(bounds); + } + + @Test + public void testGetSourcePositionWithNoWaypoint() { + when(edge.getWaypoint()).thenReturn(ECollections.newBasicEList()); + Point2D point = PropertyReaderUtils.getSourcePosition(definitionResolver, EDGE_ID, SHAPE_ID); + assertPoint(BOUNDS_WIDTH, BOUNDS_HEIGHT / 2, point); + } + + @Test + public void testGetSourcePositionWithWaypoint() { + when(edge.getWaypoint()).thenReturn(ECollections.singletonEList(point)); + Point2D point = PropertyReaderUtils.getSourcePosition(definitionResolver, EDGE_ID, SHAPE_ID); + assertPoint(WAY_POINT_X - BOUNDS_X, WAY_POINT_Y - BOUNDS_Y, point); + } + + @Test + public void testGetTargetPositionWithNoWaypoint() { + when(edge.getWaypoint()).thenReturn(ECollections.newBasicEList()); + Point2D point = PropertyReaderUtils.getTargetPosition(definitionResolver, EDGE_ID, SHAPE_ID); + assertPoint(0, BOUNDS_HEIGHT / 2, point); + } + + @Test + public void testGetTargetPositionWithWaypoint() { + when(edge.getWaypoint()).thenReturn(ECollections.singletonEList(point)); + Point2D point = PropertyReaderUtils.getTargetPosition(definitionResolver, EDGE_ID, SHAPE_ID); + assertPoint(WAY_POINT_X - BOUNDS_X, WAY_POINT_Y - BOUNDS_Y, point); + } + + @Test + public void testGetControlPointsWhenZeroPoints() { + when(edge.getWaypoint()).thenReturn(ECollections.newBasicEList()); + List result = PropertyReaderUtils.getControlPoints(definitionResolver, EDGE_ID); + assertTrue(result.isEmpty()); + } + + @Test + public void testGetControlPointsWhenOnePoints() { + EList waypoints = mockPoints(1, 2, 1); + when(edge.getWaypoint()).thenReturn(waypoints); + List result = PropertyReaderUtils.getControlPoints(definitionResolver, EDGE_ID); + assertTrue(result.isEmpty()); + } + + @Test + public void testGetControlPointsWhenTwoPoints() { + EList waypoints = mockPoints(1, 2, 2); + when(edge.getWaypoint()).thenReturn(waypoints); + List result = PropertyReaderUtils.getControlPoints(definitionResolver, EDGE_ID); + assertTrue(result.isEmpty()); + } + + @Test + public void testGetControlPointsWhenThreePoints() { + testGetControlPointsWhenMoreThanTwo(3); + } + + @Test + public void testGetControlPointsWhenNPoints() { + testGetControlPointsWhenMoreThanTwo(10); + } + + @Test + public void testIsAutoConnectionSourceWithTrue() { + testIsAutoConnectionSource("true", true); + } + + @Test + public void testIsAutoConnectionSourceWithFalse() { + testIsAutoConnectionSource("false", false); + } + + @Test + public void testIsAutoConnectionSourceWithNull() { + testIsAutoConnectionSource(null, false); + } + + private void testIsAutoConnectionSource(String valueToSet, boolean expectedResult) { + prepareExtensionElement(CustomElement.autoConnectionSource.name(), valueToSet); + assertEquals(expectedResult, PropertyReaderUtils.isAutoConnectionSource(baseElement)); + } + + @Test + public void testIsAutoConnectionTargetWithTrue() { + testIsAutoConnectionTarget("true", true); + } + + @Test + public void testIsAutoConnectionTargetWithFalse() { + testIsAutoConnectionTarget("false", false); + } + + @Test + public void testIsAutoConnectionTargetWithNull() { + testIsAutoConnectionTarget(null, false); + } + + @Test + public void testResolutionFactoryIsBeingAppliedOnControlPoints() { + when(definitionResolver.getResolutionFactor()).thenReturn(0.25d); + when(edge.getWaypoint()).thenReturn(ECollections.newBasicEList()); + Point2D point = PropertyReaderUtils.getSourcePosition(definitionResolver, EDGE_ID, SHAPE_ID); + assertPoint(0.5f, 0.5f, point); + when(edge.getWaypoint()).thenReturn(ECollections.newBasicEList()); + point = PropertyReaderUtils.getTargetPosition(definitionResolver, EDGE_ID, SHAPE_ID); + assertPoint(0, 0.5f, point); + EList waypoints = mockPoints(1, 2, 3); + when(edge.getWaypoint()).thenReturn(waypoints); + List result = PropertyReaderUtils.getControlPoints(definitionResolver, EDGE_ID); + waypoints.remove(0); + waypoints.remove(waypoints.size() - 1); + assertEquals(waypoints.size(), result.size()); + for (int i = 0; i < result.size(); i++) { + assertEquals(waypoints.get(i).getX() * 0.25d, result.get(i).getX(), 0); + assertEquals(waypoints.get(i).getY() * 0.25d, result.get(i).getY(), 0); + } + } + + private void testIsAutoConnectionTarget(String valueToSet, boolean expectedResult) { + prepareExtensionElement(CustomElement.autoConnectionTarget.name(), valueToSet); + assertEquals(expectedResult, PropertyReaderUtils.isAutoConnectionTarget(baseElement)); + } + + private void prepareExtensionElement(String extensionElementName, String value) { + ExtensionAttributeValue extensionAttributeValue = mock(ExtensionAttributeValue.class); + FeatureMap extensionElements = mock(FeatureMap.class); + when(extensionAttributeValue.getValue()).thenReturn(extensionElements); + List metadataExtensions = new ArrayList<>(); + MetaDataType metaDataType = mock(MetaDataType.class); + when(metaDataType.getName()).thenReturn(extensionElementName); + when(metaDataType.getMetaValue()).thenReturn(value); + metadataExtensions.add(metaDataType); + when(extensionElements.get(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, true)).thenReturn(metadataExtensions); + + EList extensionAttributes = ECollections.newBasicEList(); + extensionAttributes.add(extensionAttributeValue); + when(baseElement.getExtensionValues()).thenReturn(extensionAttributes); + } + + private void testGetControlPointsWhenMoreThanTwo(int size) { + EList waypoints = mockPoints(1, 2, size); + when(edge.getWaypoint()).thenReturn(waypoints); + List result = PropertyReaderUtils.getControlPoints(definitionResolver, EDGE_ID); + waypoints.remove(0); + waypoints.remove(waypoints.size() - 1); + assertPoints(waypoints, result); + } + + private void assertPoint(float x, float y, Point2D point2D) { + assertNotNull(point2D); + assertEquals(x, point2D.getX(), 0); + assertEquals(y, point2D.getY(), 0); + } + + private void assertPoints(List originalPoints, List points) { + assertEquals(originalPoints.size(), points.size()); + for (int i = 0; i < points.size(); i++) { + assertEquals(originalPoints.get(i).getX(), points.get(i).getX(), 0); + assertEquals(originalPoints.get(i).getY(), points.get(i).getY(), 0); + } + } + + private EList mockPoints(float mockXStart, float mockYStart, int size) { + EList result = ECollections.newBasicEList(); + for (int i = 0; i < size; i++) { + Point point = mock(Point.class); + when(point.getX()).thenReturn(mockXStart + i); + when(point.getY()).thenReturn(mockYStart + i); + result.add(point); + } + return result; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ScriptTaskPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ScriptTaskPropertyReaderTest.java new file mode 100644 index 00000000000..6b60221c66a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ScriptTaskPropertyReaderTest.java @@ -0,0 +1,92 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.ScriptTask; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.emf.common.util.EList; +import org.jboss.drools.DroolsPackage; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.DefinitionResolver; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestUtils.mockExtensionValues; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class ScriptTaskPropertyReaderTest { + + private static final String METADATA_ELEMENT_NAME = "customAsync"; + private static final String SCRIPT = "SCRIPT"; + + @Mock + private ScriptTask task; + + @Mock + private BPMNDiagram diagram; + + @Mock + private DefinitionResolver definitionResolver; + + private ScriptTaskPropertyReader propertyReader; + + @Before + public void setUp() { + propertyReader = new ScriptTaskPropertyReader(task, diagram, definitionResolver); + } + + @Test + public void testGetScript() { + for (Scripts.LANGUAGE language : Scripts.LANGUAGE.values()) { + testGetScript(new ScriptTypeValue(language.language(), SCRIPT), language.format(), SCRIPT); + } + } + + @Test + public void testGetScriptNotConfigured() { + testGetScript(new ScriptTypeValue(Scripts.LANGUAGE.JAVA.language(), null), null, null); + } + + private void testGetScript(ScriptTypeValue expectedValue, String currentLanguage, String currentScript) { + when(task.getScriptFormat()).thenReturn(currentLanguage); + when(task.getScript()).thenReturn(currentScript); + assertEquals(expectedValue, propertyReader.getScript()); + } + + @Test + public void testIsAsyncTrue() { + testIsAsync(true, "true"); + } + + @Test + public void testIsAsyncFalse() { + testIsAsync(false, "false"); + testIsAsync(false, null); + } + + private void testIsAsync(boolean expectedValue, String extensionValue) { + EList extensionValues = mockExtensionValues(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, METADATA_ELEMENT_NAME, extensionValue); + when(task.getExtensionValues()).thenReturn(extensionValues); + assertEquals(expectedValue, propertyReader.isAsync()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SequenceFlowPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SequenceFlowPropertyReaderTest.java new file mode 100644 index 00000000000..dc17e04caa5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/SequenceFlowPropertyReaderTest.java @@ -0,0 +1,190 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.bpmn2.FlowNode; +import org.eclipse.bpmn2.FormalExpression; +import org.eclipse.bpmn2.SequenceFlow; +import org.eclipse.dd.dc.Bounds; +import org.eclipse.dd.dc.Point; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TestDefinitionsWriter; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue; +import org.kie.workbench.common.stunner.core.graph.content.view.Connection; +import org.kie.workbench.common.stunner.core.graph.content.view.Point2D; + +import static java.util.Arrays.asList; +import static org.junit.Assert.assertEquals; +import static org.kie.workbench.common.stunner.bpmn.client.marshall.converters.fromstunner.Factories.dc; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class SequenceFlowPropertyReaderTest { + + private static final String SCRIPT = "SCRIPT"; + private final String SEQ_ID = "SEQ_ID", SOURCE_ID = "SOURCE_ID", TARGET_ID = "TARGET_ID"; + + @Test + public void getConnectionsNoWaypoints() { + TestDefinitionsWriter d = new TestDefinitionsWriter(); + PropertyReaderFactory factory = new PropertyReaderFactory(d.getDefinitionResolver()); + + Bounds sourceBounds = boundsOf(10, 10, 50, 50); + FlowNode source = d.mockNode(SOURCE_ID, sourceBounds); + Bounds targetBounds = boundsOf(100, 100, 60, 60); + FlowNode target = d.mockNode(TARGET_ID, targetBounds); + List noWaypoints = Collections.emptyList(); + + SequenceFlow el = d.sequenceFlowOf(SEQ_ID, source, target, noWaypoints); + + SequenceFlowPropertyReader p = factory.of(el); + + // this is inferred from behavior of the old marshallers + Connection sourceConnection = p.getSourceConnection(); + assertEquals(sourceBounds.getWidth(), (float) sourceConnection.getLocation().getX(), 0); + assertEquals(sourceBounds.getHeight() / 2f, (float) sourceConnection.getLocation().getY(), 0); + + Connection targetConnection = p.getTargetConnection(); + assertEquals(0.0f, (float) targetConnection.getLocation().getX(), 0); + assertEquals(targetBounds.getHeight() / 2.0f, (float) targetConnection.getLocation().getY(), 0); + } + + @Test + public void getConnectionsWithWaypoints() { + TestDefinitionsWriter d = new TestDefinitionsWriter(); + PropertyReaderFactory factory = new PropertyReaderFactory(d.getDefinitionResolver()); + + Bounds sourceBounds = boundsOf(10, 10, 50, 50); + FlowNode source = d.mockNode(SOURCE_ID, sourceBounds); + Bounds targetBounds = boundsOf(100, 100, 60, 60); + FlowNode target = d.mockNode(TARGET_ID, targetBounds); + Point sourcePoint = pointOf(10, 20); + Point targetPoint = pointOf(100, 120); + List waypoints = asList(sourcePoint, targetPoint); + + SequenceFlow el = d.sequenceFlowOf(SEQ_ID, source, target, waypoints); + + SequenceFlowPropertyReader p = factory.of(el); + + Connection sourceConnection = p.getSourceConnection(); + assertEquals(sourcePoint.getX() - sourceBounds.getX(), (float) sourceConnection.getLocation().getX(), 0); + assertEquals(sourcePoint.getY() - sourceBounds.getY(), (float) sourceConnection.getLocation().getY(), 0); + + Connection targetConnection = p.getTargetConnection(); + assertEquals(targetPoint.getX() - targetBounds.getX(), (float) targetConnection.getLocation().getX(), 0); + assertEquals(targetPoint.getY() - targetBounds.getY(), (float) targetConnection.getLocation().getY(), 0); + } + + @Test + public void get1Waypoint() { + TestDefinitionsWriter d = new TestDefinitionsWriter(); + PropertyReaderFactory factory = new PropertyReaderFactory(d.getDefinitionResolver()); + + Bounds sourceBounds = boundsOf(10, 10, 50, 50); + FlowNode source = d.mockNode(SOURCE_ID, sourceBounds); + Bounds targetBounds = boundsOf(100, 100, 60, 60); + FlowNode target = d.mockNode(TARGET_ID, targetBounds); + Point sourcePoint = pointOf(10, 20); + Point mid1 = pointOf(15, 25); + Point targetPoint = pointOf(100, 120); + List waypoints = asList(sourcePoint, + mid1, + targetPoint); + + SequenceFlow el = d.sequenceFlowOf(SEQ_ID, source, target, waypoints); + + SequenceFlowPropertyReader p = factory.of(el); + List controlPoints = p.getControlPoints(); + List expected = + Collections.singletonList( + Point2D.create(mid1.getX(), mid1.getY())); + + assertEquals(expected, controlPoints); + } + + @Test + public void get2Waypoints() { + TestDefinitionsWriter d = new TestDefinitionsWriter(); + PropertyReaderFactory factory = new PropertyReaderFactory(d.getDefinitionResolver()); + + Bounds sourceBounds = boundsOf(10, 10, 50, 50); + FlowNode source = d.mockNode(SOURCE_ID, sourceBounds); + Bounds targetBounds = boundsOf(100, 100, 60, 60); + FlowNode target = d.mockNode(TARGET_ID, targetBounds); + Point sourcePoint = pointOf(10, 20); + Point mid1 = pointOf(15, 25); + Point mid2 = pointOf(20, 30); + Point targetPoint = pointOf(100, 120); + List waypoints = asList(sourcePoint, + mid1, + mid2, + targetPoint); + + SequenceFlow el = d.sequenceFlowOf(SEQ_ID, source, target, waypoints); + + SequenceFlowPropertyReader p = factory.of(el); + List controlPoints = p.getControlPoints(); + List expected = asList( + Point2D.create(mid1.getX(), mid1.getY()), + Point2D.create(mid2.getX(), mid2.getY())); + + assertEquals(expected, controlPoints); + } + + private Point pointOf(float x, float y) { + Point point = dc.createPoint(); + point.setX(x); + point.setY(y); + return point; + } + + private Bounds boundsOf(float x, float y, float width, float height) { + Bounds bounds = dc.createBounds(); + bounds.setX(x); + bounds.setY(y); + bounds.setWidth(width); + bounds.setHeight(height); + return bounds; + } + + // TODO: Kogito - @Test + public void testGetConditionExpressionWithFormalExpression() { + for (Scripts.LANGUAGE language : Scripts.LANGUAGE.values()) { + FormalExpression formalExpression = mock(FormalExpression.class); + when(formalExpression.getLanguage()).thenReturn(language.format()); + when(formalExpression.getBody()).thenReturn(SCRIPT); + testGetConditionExpression(new ScriptTypeValue(language.language(), SCRIPT), formalExpression); + } + } + + @Test + public void testGetConditionExpressionWithoutFormalExpression() { + testGetConditionExpression(new ScriptTypeValue(Scripts.LANGUAGE.JAVA.language(), ""), null); + } + + private void testGetConditionExpression(ScriptTypeValue expectedValue, FormalExpression formalExpression) { + TestDefinitionsWriter d = new TestDefinitionsWriter(); + PropertyReaderFactory factory = new PropertyReaderFactory(d.getDefinitionResolver()); + SequenceFlow sequenceFlow = mock(SequenceFlow.class); + SequenceFlowPropertyReader propertyReader = factory.of(sequenceFlow); + when(sequenceFlow.getConditionExpression()).thenReturn(formalExpression); + assertEquals(expectedValue, propertyReader.getConditionExpression()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/TextAnnotationPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/TextAnnotationPropertyReaderTest.java new file mode 100644 index 00000000000..cde1d956a15 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/TextAnnotationPropertyReaderTest.java @@ -0,0 +1,106 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import java.util.Arrays; + +import org.eclipse.bpmn2.ExtensionAttributeValue; +import org.eclipse.bpmn2.TextAnnotation; +import org.eclipse.bpmn2.di.BPMNDiagram; +import org.eclipse.bpmn2.di.BPMNShape; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.jboss.drools.DroolsPackage; +import org.jboss.drools.MetaDataType; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomElement; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class TextAnnotationPropertyReaderTest { + + private TextAnnotationPropertyReader tested; + + @Mock + private TextAnnotation element; + + @Mock + private BPMNDiagram diagram; + + @Mock + private BPMNShape shape; + + private static final double RESOLUTION_FACTOR = 1; + + @Mock + private ExtensionAttributeValue extensionAttributeValue; + + @Mock + private FeatureMap valueMap; + + @Mock + private MetaDataType metaDataType; + + @Before + public void setUp() { + when(element.getName()).thenReturn("name"); + when(element.getText()).thenReturn("text"); + when(element.getExtensionValues()).thenReturn(ECollections.asEList(extensionAttributeValue)); + when(extensionAttributeValue.getValue()).thenReturn(valueMap); + when(valueMap.get(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, true)).thenReturn(Arrays.asList(metaDataType)); + when(metaDataType.getName()).thenReturn(CustomElement.name.name()); + when(metaDataType.getMetaValue()).thenReturn("custom"); + + tested = new TextAnnotationPropertyReader(element, diagram, shape, RESOLUTION_FACTOR); + } + + @Test + public void getExtendedName() { + String name = tested.getName(); + assertEquals("custom", name); + } + + @Test + public void getName() { + when(element.getExtensionValues()).thenReturn(ECollections.emptyEList()); + String name = tested.getName(); + assertEquals("name", name); + } + + @Test + public void getTextName() { + when(element.getExtensionValues()).thenReturn(ECollections.emptyEList()); + when(element.getName()).thenReturn(null); + String name = tested.getName(); + assertEquals("text", name); + } + + @Test + public void getNameNull() { + when(element.getExtensionValues()).thenReturn(ECollections.emptyEList()); + when(element.getName()).thenReturn(null); + when(element.getText()).thenReturn(null); + String name = tested.getName(); + assertEquals("", name); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ThrowEventPropertyReaderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ThrowEventPropertyReaderTest.java new file mode 100644 index 00000000000..ec535033cd6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/properties/ThrowEventPropertyReaderTest.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties; + +import org.eclipse.bpmn2.Event; +import org.eclipse.bpmn2.SignalEventDefinition; +import org.eclipse.bpmn2.ThrowEvent; +import org.eclipse.emf.common.util.ECollections; +import org.mockito.Mock; + +import static org.mockito.Mockito.when; + +public class ThrowEventPropertyReaderTest extends BaseEventPropertyReaderTest { + + @Mock + private ThrowEvent throwEvent; + + @Override + protected EventPropertyReader newPropertyReader() { + return new ThrowEventPropertyReader(throwEvent, diagram, definitionResolver); + } + + @Override + protected void setSignalEventDefinitionOnCurrentMock(SignalEventDefinition eventDefinition) { + when(throwEvent.getEventDefinitions()).thenReturn(ECollections.singletonEList(eventDefinition)); + when(throwEvent.getEventDefinitionRefs()).thenReturn(ECollections.emptyEList()); + } + + @Override + protected Event getCurrentEventMock() { + return throwEvent; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/sequenceflows/SequenceFlowConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/sequenceflows/SequenceFlowConverterTest.java new file mode 100644 index 00000000000..321980918b4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/sequenceflows/SequenceFlowConverterTest.java @@ -0,0 +1,110 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.sequenceflows; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.bpmn2.Bpmn2Factory; +import org.eclipse.bpmn2.FlowNode; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.soup.commons.util.Maps; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnEdge; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.SequenceFlowPropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.SequenceFlow; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyString; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.mock; +import static org.powermock.api.mockito.PowerMockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class SequenceFlowConverterTest { + + public static final String SOURCE_ID = "1"; + public static final String TARGET_ID = "2"; + private SequenceFlowConverter tested; + + @Mock + private TypedFactoryManager factoryManager; + + @Mock + private PropertyReaderFactory propertyReaderFactory; + + @Mock + private Edge, Node> edge; + + @Mock + private View content; + + @Mock + private SequenceFlow def; + + @Mock + private SequenceFlowPropertyReader reader; + + @Before + public void setUp() throws Exception { + when(factoryManager.newEdge(anyString(), eq(SequenceFlow.class))).thenReturn(edge); + when(edge.getContent()).thenReturn(content); + when(content.getDefinition()).thenReturn(def); + when(propertyReaderFactory.of(any(org.eclipse.bpmn2.SequenceFlow.class))).thenReturn(reader); + when(reader.getSourceId()).thenReturn(SOURCE_ID); + when(reader.getTargetId()).thenReturn(TARGET_ID); + + tested = new SequenceFlowConverter(factoryManager, propertyReaderFactory); + } + + @Test + public void convertEdge() { + org.eclipse.bpmn2.SequenceFlow sequenceFlow = Bpmn2Factory.eINSTANCE.createSequenceFlow(); + FlowNode source = Bpmn2Factory.eINSTANCE.createUserTask(); + sequenceFlow.setSourceRef(source); + FlowNode target = Bpmn2Factory.eINSTANCE.createBusinessRuleTask(); + sequenceFlow.setTargetRef(target); + + //testing with empty source/target nodes, the edge should be ignored + Result result = tested.convertEdge(sequenceFlow, new HashMap<>()); + assertTrue(result.isIgnored()); + assertNull(result.value()); + + //testing with the source/target nodes + Map nodes = new Maps.Builder() + .put(SOURCE_ID, mock(BpmnNode.class)) + .put(TARGET_ID, mock(BpmnNode.class)) + .build(); + result = tested.convertEdge(sequenceFlow, nodes); + assertTrue(result.isSuccess()); + BpmnEdge.Simple value = (BpmnEdge.Simple) result.value(); + assertEquals(edge, value.getEdge()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/BaseTaskConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/BaseTaskConverterTest.java new file mode 100644 index 00000000000..be3fb0d3f42 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/BaseTaskConverterTest.java @@ -0,0 +1,226 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.tasks; + +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import org.eclipse.bpmn2.ManualTask; +import org.eclipse.bpmn2.ReceiveTask; +import org.eclipse.bpmn2.SendTask; +import org.eclipse.bpmn2.Task; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.junit.Before; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.customproperties.CustomAttribute; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.BusinessRuleTaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.GenericServiceTaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.ServiceTaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.TaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.UserTaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask; +import org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask; +import org.kie.workbench.common.stunner.bpmn.definition.NoneTask; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseUserTaskExecutionSet; +import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTask; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.mockito.Mock; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.mockito.Matchers.anyString; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.when; + +public abstract class BaseTaskConverterTest { + + protected BaseTaskConverter tested; + + @Mock + protected TypedFactoryManager factoryManager; + + @Mock + protected PropertyReaderFactory propertyReaderFactory; + + @Mock + protected View businessRuleTaskContent; + + @Mock + protected View noneTaskContent; + + protected NoneTask noneTaskDefinition; + + @Mock + protected TaskPropertyReader taskPropertyReader; + + @Mock + private Node, Edge> noneTaskNode; + + @Mock + private Node, Edge> serviceTaskNode; + + @Mock + private View serviceTaskContent; + + @Mock + protected View genericServiceTaskContent; + + @Mock + private Node, Edge> businessRuleTaskNode; + + @Mock + private Node, Edge> genericServiceTaskNode; + + @Mock + private FeatureMap featureMap; + + @Mock + private FeatureMap.Entry entry; + + @Before + public void setUp() { + noneTaskDefinition = new NoneTask(); + + when(factoryManager.newNode(anyString(), eq(NoneTask.class))).thenReturn(noneTaskNode); + when(noneTaskNode.getContent()).thenReturn(noneTaskContent); + when(noneTaskContent.getDefinition()).thenReturn(noneTaskDefinition); + when(entry.getEStructuralFeature()).thenReturn(mock(EStructuralFeature.class)); + when(featureMap.stream()).thenReturn(Arrays.asList(entry).stream()); + + tested = createTaskConverter(); + } + + protected BaseTaskConverter createTaskConverter() { + return spy(new BaseTaskConverter(factoryManager, propertyReaderFactory, MarshallingRequest.Mode.AUTO) { + @Override + protected Node createNode(String id) { + return null; + } + + @Override + protected BaseUserTaskExecutionSet createUserTaskExecutionSet(UserTaskPropertyReader p) { + return null; + } + }); + } + + @Test + public void convertBusinessRuleTask() { + org.eclipse.bpmn2.BusinessRuleTask task = mock(org.eclipse.bpmn2.BusinessRuleTask.class); + BusinessRuleTaskPropertyReader propertyReader = mock(BusinessRuleTaskPropertyReader.class); + BusinessRuleTask businessRuleDefinition = new BusinessRuleTask(); + + when(factoryManager.newNode(anyString(), eq(BusinessRuleTask.class))).thenReturn(businessRuleTaskNode); + when(businessRuleTaskNode.getContent()).thenReturn(businessRuleTaskContent); + when(businessRuleTaskContent.getDefinition()).thenReturn(businessRuleDefinition); + when(propertyReaderFactory.of(task)).thenReturn(propertyReader); + + final BpmnNode converted = (BpmnNode) tested.convert(task).value(); + assertNotEquals(converted.value(), noneTaskNode); + assertEquals(converted.value(), businessRuleTaskNode); + } + + @Test + public void convertServiceTask() { + org.eclipse.bpmn2.ServiceTask task = mock(org.eclipse.bpmn2.ServiceTask.class); + ServiceTaskPropertyReader serviceTaskPropertyReader = mock(ServiceTaskPropertyReader.class); + ServiceTask definition = new ServiceTask(); + FeatureMap attributes = mock(FeatureMap.class); + FeatureMap.Entry ruleAttr = mock(FeatureMap.Entry.class); + EStructuralFeature ruleFeature = mock(EStructuralFeature.class); + + when(factoryManager.newNode(anyString(), eq(ServiceTask.class))).thenReturn(serviceTaskNode); + when(serviceTaskNode.getContent()).thenReturn(serviceTaskContent); + when(serviceTaskContent.getDefinition()).thenReturn(definition); + when(propertyReaderFactory.ofCustom(task)).thenReturn(Optional.of(serviceTaskPropertyReader)); + + when(task.getAnyAttribute()).thenReturn(attributes); + when(attributes.stream()).thenReturn(Stream.of(ruleAttr)); + when(ruleAttr.getEStructuralFeature()).thenReturn(ruleFeature); + when(ruleAttr.getValue()).thenReturn(""); + when(ruleFeature.getName()).thenReturn(CustomAttribute.serviceImplementation.name()); + + final BpmnNode converted = (BpmnNode) tested.convert(task).value(); + assertNotEquals(converted.value(), noneTaskNode); + assertEquals(converted.value(), serviceTaskNode); + } + + @Test + public void convertGenericServiceTask() { + org.eclipse.bpmn2.ServiceTask task = mock(org.eclipse.bpmn2.ServiceTask.class); + GenericServiceTaskPropertyReader genericServiceTaskPropertyReader = mock(GenericServiceTaskPropertyReader.class); + GenericServiceTask definition = new GenericServiceTask(); + + FeatureMap attributes = mock(FeatureMap.class); + FeatureMap.Entry ruleAttr = mock(FeatureMap.Entry.class); + EStructuralFeature ruleFeature = mock(EStructuralFeature.class); + + when(factoryManager.newNode(anyString(), eq(GenericServiceTask.class))).thenReturn(genericServiceTaskNode); + when(genericServiceTaskNode.getContent()).thenReturn(genericServiceTaskContent); + when(genericServiceTaskContent.getDefinition()).thenReturn(definition); + when(propertyReaderFactory.of(task)).thenReturn(genericServiceTaskPropertyReader); + + when(task.getAnyAttribute()).thenReturn(attributes); + when(attributes.stream()).thenReturn(Stream.of(ruleAttr)); + when(ruleAttr.getEStructuralFeature()).thenReturn(ruleFeature); + when(ruleAttr.getValue()).thenReturn("Java"); + when(ruleFeature.getName()).thenReturn(CustomAttribute.serviceImplementation.name()); + + final BpmnNode converted = (BpmnNode) tested.convert(task).value(); + assertNotEquals(converted.value(), noneTaskNode); + assertEquals(converted.value(), genericServiceTaskNode); + } + + // TODO: Kogito - @Test + public void convertManualTask() { + testTaskToNoneTask(ManualTask.class); + } + + @Test + public void convertReceiveTask() { + testTaskToNoneTask(ReceiveTask.class); + } + + @Test + public void convertSendTask() { + testTaskToNoneTask(SendTask.class); + } + + @Test + public void convertDefaultTask() { + testTaskToNoneTask(Task.class); + } + + private void testTaskToNoneTask(Class taskType) { + final T task = mock(taskType); + when(task.getAnyAttribute()).thenReturn(featureMap); + when(propertyReaderFactory.of(task)).thenReturn(taskPropertyReader); + + final BpmnNode converted = (BpmnNode) tested.convert(task).value(); + assertEquals(converted.value(), noneTaskNode); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/TaskConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/TaskConverterTest.java new file mode 100644 index 00000000000..ce4bf642980 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/tasks/TaskConverterTest.java @@ -0,0 +1,238 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.tasks; + +import org.eclipse.bpmn2.Bpmn2Factory; +import org.eclipse.bpmn2.Task; +import org.junit.Ignore; +import org.junit.Test; +import org.kie.workbench.common.stunner.bpmn.client.marshall.MarshallingRequest; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.TaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.UserTaskPropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.NoneTask; +import org.kie.workbench.common.stunner.bpmn.definition.UserTask; +import org.kie.workbench.common.stunner.bpmn.definition.property.assignee.Actors; +import org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo; +import org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet; +import org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.mockito.Mock; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.anyString; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +// TODO: Kogito - @RunWith(MockitoJUnitRunner.class) +@Ignore +public class TaskConverterTest extends BaseTaskConverterTest { + + private static final String NAME = "NAME"; + private static final String TASK_NAME = "TASK_NAME"; + private static final Actors ACTORS = new Actors(); + private static final String GROUP_ID = "GROUP_ID"; + private static final String DOCUMENTATION = "DOCUMENTATION"; + private static final Boolean IS_ASYNC = Boolean.TRUE; + private static final Boolean SKIPPABLE = Boolean.TRUE; + private static final String PRIORITY = "PRIORITY"; + private static final String SUBJECT = "SUBJECT"; + private static final String DESCRIPTION = "DESCRIPTION"; + private static final String CREATED_BY = "CREATED_BY"; + private static final Boolean IS_AUTOSTART = Boolean.TRUE; + private static final Boolean SEQUENTIAL = Boolean.TRUE; + private static final String COLLECTION_INPUT = "COLLECTION_INPUT"; + private static final String COLLECTION_OUTPUT = "COLLECTION_OUTPUT"; + private static final String DATA_INPUT = "DATA_INPUT"; + private static final String DATA_OUTPUT = "DATA_OUTPUT"; + private static final String COMPLETION_CONDITION = "COMPLETION_CONDITION"; + private static final ScriptTypeListValue ON_ENTRY_ACTION = new ScriptTypeListValue(); + private static final ScriptTypeListValue ON_EXIT_ACTION = new ScriptTypeListValue(); + private static final String CONTENT = "CONTENT"; + private static final String SLA_DUE_DATE = "SLA_DUE_DATE"; + private static final Bounds BOUNDS = Bounds.create(); + private static final SimulationSet SIMULATION_SET = new SimulationSet(); + private static final RectangleDimensionsSet RECTANGLE_DIMENSIONS_SET = new RectangleDimensionsSet(); + private static final FontSet FONT_SET = new FontSet(); + private static final BackgroundSet BACKGROUND_SET = new BackgroundSet(); + private static final AssignmentsInfo ASSIGNMENTS_INFO = new AssignmentsInfo(); + + @Mock + private org.eclipse.bpmn2.UserTask userTask; + + @Mock + private Node, Edge> userTaskNode; + + @Mock + private View userTaskContent; + + private UserTask userTaskDefinition; + + @Mock + private UserTaskPropertyReader userTaskPropertyReader; + + @Override + public void setUp() { + super.setUp(); + userTaskDefinition = new UserTask(); + when(factoryManager.newNode(anyString(), eq(UserTask.class))).thenReturn(userTaskNode); + when(userTaskNode.getContent()).thenReturn(userTaskContent); + when(userTaskNode.getContent().getDefinition()).thenReturn(userTaskDefinition); + when(propertyReaderFactory.of(userTask)).thenReturn(userTaskPropertyReader); + + when(userTaskPropertyReader.getName()).thenReturn(NAME); + when(userTaskPropertyReader.getDocumentation()).thenReturn(DOCUMENTATION); + when(userTaskPropertyReader.getSimulationSet()).thenReturn(SIMULATION_SET); + when(userTaskPropertyReader.getBounds()).thenReturn(BOUNDS); + when(userTaskPropertyReader.getRectangleDimensionsSet()).thenReturn(RECTANGLE_DIMENSIONS_SET); + when(userTaskPropertyReader.getBackgroundSet()).thenReturn(BACKGROUND_SET); + when(userTaskPropertyReader.getFontSet()).thenReturn(FONT_SET); + when(userTaskPropertyReader.getTaskName()).thenReturn(TASK_NAME); + when(userTaskPropertyReader.getActors()).thenReturn(ACTORS); + when(userTaskPropertyReader.getGroupid()).thenReturn(GROUP_ID); + when(userTaskPropertyReader.getAssignmentsInfo()).thenReturn(ASSIGNMENTS_INFO); + when(userTaskPropertyReader.isAsync()).thenReturn(IS_ASYNC); + when(userTaskPropertyReader.isSkippable()).thenReturn(SKIPPABLE); + when(userTaskPropertyReader.getPriority()).thenReturn(PRIORITY); + when(userTaskPropertyReader.getSubject()).thenReturn(SUBJECT); + when(userTaskPropertyReader.getDescription()).thenReturn(DESCRIPTION); + when(userTaskPropertyReader.getCreatedBy()).thenReturn(CREATED_BY); + when(userTaskPropertyReader.isAdHocAutostart()).thenReturn(IS_AUTOSTART); + when(userTaskPropertyReader.isSequential()).thenReturn(SEQUENTIAL); + when(userTaskPropertyReader.getCollectionInput()).thenReturn(COLLECTION_INPUT); + when(userTaskPropertyReader.getCollectionOutput()).thenReturn(COLLECTION_OUTPUT); + when(userTaskPropertyReader.getDataInput()).thenReturn(DATA_INPUT); + when(userTaskPropertyReader.getDataOutput()).thenReturn(DATA_OUTPUT); + when(userTaskPropertyReader.getCompletionCondition()).thenReturn(COMPLETION_CONDITION); + when(userTaskPropertyReader.getOnEntryAction()).thenReturn(ON_ENTRY_ACTION); + when(userTaskPropertyReader.getOnExitAction()).thenReturn(ON_EXIT_ACTION); + when(userTaskPropertyReader.getContent()).thenReturn(CONTENT); + when(userTaskPropertyReader.getSLADueDate()).thenReturn(SLA_DUE_DATE); + } + + @Override + protected BaseTaskConverter createTaskConverter() { + return new TaskConverter(factoryManager, propertyReaderFactory, MarshallingRequest.Mode.AUTO); + } + + @Test + public void testConvertUserTaskMI() { + when(userTaskPropertyReader.isMultipleInstance()).thenReturn(true); + BpmnNode node = (BpmnNode) tested.convert(userTask).value(); + UserTask result = (UserTask) node.value().getContent().getDefinition(); + assertCommonValues(result); + assertTrue(result.getExecutionSet().getIsMultipleInstance().getValue()); + assertEquals(SEQUENTIAL, result.getExecutionSet().getMultipleInstanceExecutionMode().isSequential()); + assertEquals(COLLECTION_INPUT, result.getExecutionSet().getMultipleInstanceCollectionInput().getValue()); + assertEquals(COLLECTION_OUTPUT, result.getExecutionSet().getMultipleInstanceCollectionOutput().getValue()); + assertEquals(DATA_INPUT, result.getExecutionSet().getMultipleInstanceDataInput().getValue()); + assertEquals(DATA_OUTPUT, result.getExecutionSet().getMultipleInstanceDataOutput().getValue()); + assertEquals(COMPLETION_CONDITION, result.getExecutionSet().getMultipleInstanceCompletionCondition().getValue()); + } + + @Test + public void testConvertUserTaskNonMI() { + when(userTaskPropertyReader.isMultipleInstance()).thenReturn(false); + when(userTaskPropertyReader.isSequential()).thenReturn(false); + when(userTaskPropertyReader.getCollectionInput()).thenReturn(null); + when(userTaskPropertyReader.getDataInput()).thenReturn(null); + when(userTaskPropertyReader.getCollectionOutput()).thenReturn(null); + when(userTaskPropertyReader.getDataOutput()).thenReturn(null); + when(userTaskPropertyReader.getCompletionCondition()).thenReturn(null); + BpmnNode node = (BpmnNode) tested.convert(userTask).value(); + UserTask result = (UserTask) node.value().getContent().getDefinition(); + assertCommonValues(result); + assertFalse(result.getExecutionSet().getIsMultipleInstance().getValue()); + assertFalse(result.getExecutionSet().getMultipleInstanceExecutionMode().isSequential()); + assertNull(result.getExecutionSet().getMultipleInstanceCollectionInput().getValue()); + assertNull(result.getExecutionSet().getMultipleInstanceCollectionOutput().getValue()); + assertNull(result.getExecutionSet().getMultipleInstanceDataInput().getValue()); + assertNull(result.getExecutionSet().getMultipleInstanceDataOutput().getValue()); + assertNull(result.getExecutionSet().getMultipleInstanceCompletionCondition().getValue()); + } + + private void assertCommonValues(UserTask result) { + assertEquals(NAME, result.getGeneral().getName().getValue()); + assertEquals(DOCUMENTATION, result.getGeneral().getDocumentation().getValue()); + assertEquals(SIMULATION_SET, result.getSimulationSet()); + verify(userTaskContent).setBounds(BOUNDS); + assertEquals(ACTORS, result.getExecutionSet().getActors()); + assertEquals(GROUP_ID, result.getExecutionSet().getGroupid().getValue()); + assertEquals(ASSIGNMENTS_INFO, result.getExecutionSet().getAssignmentsinfo()); + assertEquals(IS_ASYNC, result.getExecutionSet().getIsAsync().getValue()); + assertEquals(SKIPPABLE, result.getExecutionSet().getSkippable().getValue()); + assertEquals(PRIORITY, result.getExecutionSet().getPriority().getValue()); + assertEquals(SUBJECT, result.getExecutionSet().getSubject().getValue()); + assertEquals(DESCRIPTION, result.getExecutionSet().getDescription().getValue()); + assertEquals(CREATED_BY, result.getExecutionSet().getCreatedBy().getValue()); + assertEquals(IS_AUTOSTART, result.getExecutionSet().getAdHocAutostart().getValue()); + assertEquals(ON_ENTRY_ACTION, result.getExecutionSet().getOnEntryAction().getValue()); + assertEquals(ON_EXIT_ACTION, result.getExecutionSet().getOnExitAction().getValue()); + assertEquals(CONTENT, result.getExecutionSet().getContent().getValue()); + assertEquals(SLA_DUE_DATE, result.getExecutionSet().getSlaDueDate().getValue()); + } + + // TODO: Kogito - @Test + public void testConvertManualTask() { + testConvertToDefaultTask(Bpmn2Factory.eINSTANCE.createManualTask()); + } + + @Test + public void testConvertReceiveTask() { + testConvertToDefaultTask(Bpmn2Factory.eINSTANCE.createReceiveTask()); + } + + @Test + public void testConvertSendTask() { + testConvertToDefaultTask(Bpmn2Factory.eINSTANCE.createSendTask()); + } + + @Test + public void testConvertNoneTask() { + testConvertToDefaultTask(Bpmn2Factory.eINSTANCE.createTask()); + } + + private void testConvertToDefaultTask(Task task) { + TaskPropertyReader reader = mock(TaskPropertyReader.class); + when(propertyReaderFactory.of(task)).thenReturn(reader); + + Node, Edge> taskNode = mock(Node.class); + when(factoryManager.newNode(anyString(), eq(NoneTask.class))).thenReturn(taskNode); + + View taskContent = mock(View.class); + when(taskNode.getContent()).thenReturn(taskContent); + NoneTask taskDef = mock(NoneTask.class); + when(taskContent.getDefinition()).thenReturn(taskDef); + + Result result = tested.convert(task); + verify(factoryManager).newNode(anyString(), eq(NoneTask.class)); + assertTrue(result.value().value().getContent().getDefinition() instanceof NoneTask); + } +} + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/textannotation/TextAnnotationConverterTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/textannotation/TextAnnotationConverterTest.java new file mode 100644 index 00000000000..fa0512fecaf --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/java/org/kie/workbench/common/stunner/bpmn/client/marshall/converters/tostunner/textannotation/TextAnnotationConverterTest.java @@ -0,0 +1,85 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.textannotation; + +import org.eclipse.bpmn2.Bpmn2Factory; +import org.eclipse.bpmn2.TextAnnotation; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.Result; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.TypedFactoryManager; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.BpmnNode; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.PropertyReaderFactory; +import org.kie.workbench.common.stunner.bpmn.client.marshall.converters.tostunner.properties.TextAnnotationPropertyReader; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition; +import org.kie.workbench.common.stunner.core.graph.Edge; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.view.View; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.anyString; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class TextAnnotationConverterTest { + + private TextAnnotationConverter tested; + + @Mock + private TypedFactoryManager typedFactoryManager; + + @Mock + private PropertyReaderFactory propertyReaderFactory; + + private TextAnnotation element; + + @Mock + private Node, Edge> node; + + @Mock + private View content; + + @Mock + private org.kie.workbench.common.stunner.bpmn.definition.TextAnnotation def; + + @Mock + private TextAnnotationPropertyReader reader; + + @Before + public void setUp() { + element = Bpmn2Factory.eINSTANCE.createTextAnnotation(); + tested = new TextAnnotationConverter(typedFactoryManager, propertyReaderFactory); + + when(typedFactoryManager.newNode(anyString(), + eq(org.kie.workbench.common.stunner.bpmn.definition.TextAnnotation.class))).thenReturn(node); + when(node.getContent()).thenReturn(content); + when(content.getDefinition()).thenReturn(def); + when(propertyReaderFactory.of(element)).thenReturn(reader); + } + + @Test + public void convert() { + final Result node = tested.convert(element); + final Node, ?> value = node.value().value(); + assertEquals(content, value.getContent()); + assertEquals(def, value.getContent().getDefinition()); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/resources/META-INF/ErraiApp.properties b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-marshalling/src/test/resources/META-INF/ErraiApp.properties new file mode 100644 index 00000000000..e69de29bb2d diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/pom.xml index 6f85d1feaac..a52f5aa486f 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/pom.xml @@ -74,6 +74,11 @@ kie-wb-common-stunner-bpmn-api + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-api + + org.uberfire uberfire-project-api diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/java/org/kie/workbench/common/stunner/bpmn/project/factory/impl/BPMNProjectDiagramFactoryImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/java/org/kie/workbench/common/stunner/bpmn/project/factory/impl/BPMNProjectDiagramFactoryImpl.java index f3e295a866c..9e3c67e3132 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/java/org/kie/workbench/common/stunner/bpmn/project/factory/impl/BPMNProjectDiagramFactoryImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/java/org/kie/workbench/common/stunner/bpmn/project/factory/impl/BPMNProjectDiagramFactoryImpl.java @@ -60,9 +60,9 @@ protected Class getDefinitionSetType() { } @Override - public ProjectDiagram doBuild(final String name, - final ProjectMetadata metadata, - final Graph graph) { + public ProjectDiagramImpl doBuild(final String name, + final ProjectMetadata metadata, + final Graph graph) { return new ProjectDiagramImpl(name, graph, metadata); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/service/BPMNDiagramService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/java/org/kie/workbench/common/stunner/bpmn/project/service/BPMNDiagramService.java similarity index 80% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/service/BPMNDiagramService.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/java/org/kie/workbench/common/stunner/bpmn/project/service/BPMNDiagramService.java index 8ef3d36b39a..37c4453a789 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/service/BPMNDiagramService.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/java/org/kie/workbench/common/stunner/bpmn/project/service/BPMNDiagramService.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,10 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.service; +package org.kie.workbench.common.stunner.bpmn.project.service; import org.jboss.errai.bus.server.annotations.Remote; +import org.kie.workbench.common.stunner.bpmn.service.ProjectType; import org.uberfire.backend.vfs.Path; @Remote diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/service/DataTypesService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/java/org/kie/workbench/common/stunner/bpmn/project/service/DataTypesService.java similarity index 86% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/service/DataTypesService.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/java/org/kie/workbench/common/stunner/bpmn/project/service/DataTypesService.java index 772d4f970d3..0653ce68b01 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-api/src/main/java/org/kie/workbench/common/stunner/bpmn/service/DataTypesService.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/java/org/kie/workbench/common/stunner/bpmn/project/service/DataTypesService.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.service; +package org.kie.workbench.common.stunner.bpmn.project.service; import java.util.List; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnProjectApi.gwt.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnProjectApi.gwt.xml index 0910da9950f..620647fc0cc 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnProjectApi.gwt.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-api/src/main/resources/org/kie/workbench/common/stunner/bpmn/StunnerBpmnProjectApi.gwt.xml @@ -26,5 +26,6 @@ + \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/pom.xml index f96df5be8c4..13a94874867 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/pom.xml @@ -81,11 +81,21 @@ uberfire-project-api + + org.kie.soup + kie-soup-project-datamodel-api + + org.kie.soup kie-soup-commons + + org.uberfire + uberfire-metadata-api + + org.kie.workbench.services kie-wb-common-services-api @@ -96,6 +106,91 @@ kie-wb-common-services-backend + + org.kie.workbench.services + kie-wb-common-refactoring-api + + + + org.kie.workbench.services + kie-wb-common-refactoring-backend + + + + org.kie.workbench.services + kie-wb-common-datamodel-api + + + + org.kie.workbench.services + kie-wb-common-datamodel-backend + + + + org.kie.workbench.services + kie-wb-common-data-modeller-core + + + + org.kie.workbench.stunner + kie-wb-common-stunner-forms-backend + + + + org.jbpm + jbpm-flow + + + + org.jbpm + jbpm-flow-builder + + + + org.jbpm + jbpm-bpmn2 + + + + org.drools + drools-compiler + + + + org.drools + drools-core + + + + org.kie + kie-api + + + + org.kie + kie-internal + + + + org.eclipse + org.eclipse.bpmn2 + + + + org.eclipse.emf + org.eclipse.emf.ecore + + + + org.eclipse.emf + org.eclipse.emf.common + + + + org.eclipse.emf + org.eclipse.emf.ecore.xmi + + @@ -138,6 +233,11 @@ kie-wb-common-stunner-bpmn-backend + + org.apache.commons + commons-lang3 + + org.slf4j @@ -152,6 +252,13 @@ test-jar + + org.kie.workbench.services + kie-wb-common-refactoring-backend + tests + test + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/factory/CaseGraphFactoryImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/factory/CaseGraphFactoryImpl.java index bc20184921f..0ee12539447 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/factory/CaseGraphFactoryImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/factory/CaseGraphFactoryImpl.java @@ -23,12 +23,12 @@ import javax.enterprise.inject.Typed; import javax.inject.Inject; -import org.kie.workbench.common.stunner.bpmn.backend.workitem.service.WorkItemDefinitionBackendService; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram; import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc; import org.kie.workbench.common.stunner.bpmn.factory.BPMNGraphFactoryImpl; import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTask; import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTaskFactory; +import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionService; import org.kie.workbench.common.stunner.core.api.DefinitionManager; import org.kie.workbench.common.stunner.core.api.FactoryManager; @@ -65,7 +65,7 @@ public CaseGraphFactoryImpl(DefinitionManager definitionManager, FactoryManager RuleManager ruleManager, GraphCommandManager graphCommandManager, GraphCommandFactory graphCommandFactory, GraphIndexBuilder indexBuilder, ServiceTaskFactory serviceTaskFactory, - WorkItemDefinitionBackendService workItemDefinitionService) { + WorkItemDefinitionLookupService workItemDefinitionService) { super(definitionManager, factoryManager, ruleManager, graphCommandManager, graphCommandFactory, indexBuilder); this.serviceTaskFactory = serviceTaskFactory; this.workItemDefinitionService = workItemDefinitionService; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/BaseConditionEditorServiceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/BaseConditionEditorServiceImpl.java similarity index 92% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/BaseConditionEditorServiceImpl.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/BaseConditionEditorServiceImpl.java index 038e3ddc325..ca4959495a3 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/BaseConditionEditorServiceImpl.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/BaseConditionEditorServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions; import java.text.ParseException; import java.util.ArrayList; @@ -26,10 +26,6 @@ import org.kie.soup.project.datamodel.oracle.ModelField; import org.kie.workbench.common.services.datamodel.backend.server.builder.projects.ClassFieldInspector; import org.kie.workbench.common.services.datamodeller.codegen.GenerationTools; -import org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionGenerator; -import org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionParser; -import org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.FunctionsRegistry; -import org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.GenerateConditionException; import org.kie.workbench.common.stunner.bpmn.forms.conditions.Condition; import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; import org.kie.workbench.common.stunner.bpmn.forms.conditions.FieldMetadata; @@ -39,6 +35,10 @@ import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadata; import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQuery; import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQueryResult; +import org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionGenerator; +import org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionParser; +import org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.FunctionsRegistry; +import org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.GenerateConditionException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.uberfire.backend.vfs.Path; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorProjectServiceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorProjectServiceImpl.java deleted file mode 100644 index 916a4c3b093..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorProjectServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions; - -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Specializes; -import javax.inject.Inject; - -import org.jboss.errai.bus.server.annotations.Service; -import org.kie.workbench.common.services.backend.project.ModuleClassLoaderHelper; -import org.kie.workbench.common.services.shared.project.KieModule; -import org.kie.workbench.common.services.shared.project.KieModuleService; -import org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.ConditionEditorServiceImpl; -import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; -import org.uberfire.backend.vfs.Path; - -@Service -@Specializes -@ApplicationScoped -public class ConditionEditorProjectServiceImpl - extends ConditionEditorServiceImpl - implements ConditionEditorService { - - private final KieModuleService moduleService; - - private final ModuleClassLoaderHelper moduleClassLoaderHelper; - - private ConditionEditorProjectServiceImpl() { - //Empty constructor for proxying - this(null, null); - } - - @Inject - public ConditionEditorProjectServiceImpl(final KieModuleService moduleService, - final ModuleClassLoaderHelper moduleClassLoaderHelper) { - this.moduleService = moduleService; - this.moduleClassLoaderHelper = moduleClassLoaderHelper; - } - - protected ClassLoader resolveClassLoader(Path path) { - KieModule module = moduleService.resolveModule(path); - return moduleClassLoaderHelper.getModuleClassLoader(module); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorServiceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorServiceImpl.java new file mode 100644 index 00000000000..ecf48f74049 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorServiceImpl.java @@ -0,0 +1,55 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import org.jboss.errai.bus.server.annotations.Service; +import org.kie.workbench.common.services.backend.project.ModuleClassLoaderHelper; +import org.kie.workbench.common.services.shared.project.KieModule; +import org.kie.workbench.common.services.shared.project.KieModuleService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; +import org.uberfire.backend.vfs.Path; + +@Service +@ApplicationScoped +public class ConditionEditorServiceImpl + extends BaseConditionEditorServiceImpl + implements ConditionEditorService { + + private final KieModuleService moduleService; + + private final ModuleClassLoaderHelper moduleClassLoaderHelper; + + private ConditionEditorServiceImpl() { + //Empty constructor for proxying + this(null, null); + } + + @Inject + public ConditionEditorServiceImpl(final KieModuleService moduleService, + final ModuleClassLoaderHelper moduleClassLoaderHelper) { + this.moduleService = moduleService; + this.moduleClassLoaderHelper = moduleClassLoaderHelper; + } + + protected ClassLoader resolveClassLoader(Path path) { + KieModule module = moduleService.resolveModule(path); + return moduleClassLoaderHelper.getModuleClassLoader(module); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionGenerator.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionGenerator.java similarity index 96% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionGenerator.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionGenerator.java index 3fcbc5eb0a8..1c7f853db2a 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionGenerator.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionGenerator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser; import java.text.MessageFormat; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionParser.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionParser.java similarity index 99% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionParser.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionParser.java index 8881c6a454d..52a32d359c1 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionParser.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionParser.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser; import java.text.MessageFormat; import java.text.ParseException; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/FunctionsRegistry.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/FunctionsRegistry.java similarity index 98% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/FunctionsRegistry.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/FunctionsRegistry.java index 3ce86ae02d0..4e252f02d4b 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/FunctionsRegistry.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/FunctionsRegistry.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser; import java.util.ArrayList; import java.util.Collections; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/GenerateConditionException.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/GenerateConditionException.java similarity index 89% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/GenerateConditionException.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/GenerateConditionException.java index 9ff149f1c01..5044f74d570 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/GenerateConditionException.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/GenerateConditionException.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser; public class GenerateConditionException extends Exception { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ParsingUtils.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ParsingUtils.java similarity index 95% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ParsingUtils.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ParsingUtils.java index 0ff3b038f2f..4644ee142a5 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ParsingUtils.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ParsingUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser; import java.text.ParseException; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/BPMNFormGenerationModelProvider.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/BPMNFormGenerationModelProvider.java similarity index 90% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/BPMNFormGenerationModelProvider.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/BPMNFormGenerationModelProvider.java index b96c3b02386..06f36bbb457 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/BPMNFormGenerationModelProvider.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/BPMNFormGenerationModelProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.gen; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.gen; import java.io.IOException; @@ -24,7 +24,7 @@ import org.eclipse.bpmn2.Definitions; import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; -import org.kie.workbench.common.stunner.bpmn.backend.forms.gen.util.BPMNFormGenerationModelProviderHelper; +import org.kie.workbench.common.stunner.bpmn.project.backend.forms.gen.util.BPMNFormGenerationModelProviderHelper; import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.util.DefinitionUtils; import org.kie.workbench.common.stunner.forms.backend.gen.FormGenerationModelProvider; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/util/BPMNFormGenerationModelProviderHelper.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/util/BPMNFormGenerationModelProviderHelper.java similarity index 92% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/util/BPMNFormGenerationModelProviderHelper.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/util/BPMNFormGenerationModelProviderHelper.java index f46215a1dd7..cbfefea2589 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/util/BPMNFormGenerationModelProviderHelper.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/util/BPMNFormGenerationModelProviderHelper.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.gen.util; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.gen.util; import javax.enterprise.context.Dependent; import javax.inject.Inject; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/util/FormGenerationModelProviderHelper.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/util/FormGenerationModelProviderHelper.java similarity index 95% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/util/FormGenerationModelProviderHelper.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/util/FormGenerationModelProviderHelper.java index f167bb13052..d2804c09e34 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/util/FormGenerationModelProviderHelper.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/util/FormGenerationModelProviderHelper.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.gen.util; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.gen.util; import java.io.IOException; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/AbstractBpmnFileIndexer.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/AbstractBpmnFileIndexer.java similarity index 99% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/AbstractBpmnFileIndexer.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/AbstractBpmnFileIndexer.java index 7c7dc639c65..4bdf42b7442 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/AbstractBpmnFileIndexer.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/AbstractBpmnFileIndexer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.indexing; +package org.kie.workbench.common.stunner.bpmn.project.backend.indexing; import java.io.StringReader; import java.util.ArrayList; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/AbstractBpmnProcessDataEventListener.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/AbstractBpmnProcessDataEventListener.java similarity index 99% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/AbstractBpmnProcessDataEventListener.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/AbstractBpmnProcessDataEventListener.java index 2845bd81bac..a22da4c5bea 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/AbstractBpmnProcessDataEventListener.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/AbstractBpmnProcessDataEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.indexing; +package org.kie.workbench.common.stunner.bpmn.project.backend.indexing; import java.io.Serializable; import java.util.ArrayList; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/BpmnFileIndexer.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/BpmnFileIndexer.java similarity index 90% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/BpmnFileIndexer.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/BpmnFileIndexer.java index 7ef4efec7cf..766382a0740 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/BpmnFileIndexer.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/BpmnFileIndexer.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.indexing; +package org.kie.workbench.common.stunner.bpmn.project.backend.indexing; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/BpmnProcessDataEventListener.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/BpmnProcessDataEventListener.java similarity index 92% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/BpmnProcessDataEventListener.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/BpmnProcessDataEventListener.java index 4733d4ac3a3..41ad6d53e03 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/BpmnProcessDataEventListener.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/BpmnProcessDataEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.indexing; +package org.kie.workbench.common.stunner.bpmn.project.backend.indexing; import org.kie.api.definition.process.Process; import org.kie.workbench.common.services.refactoring.backend.server.impact.ResourceReferenceCollector; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/BpmnProcessDataEventListenerProvider.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/BpmnProcessDataEventListenerProvider.java similarity index 88% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/BpmnProcessDataEventListenerProvider.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/BpmnProcessDataEventListenerProvider.java index 63075965805..c127e6eb86d 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/indexing/BpmnProcessDataEventListenerProvider.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/BpmnProcessDataEventListenerProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.indexing; +package org.kie.workbench.common.stunner.bpmn.project.backend.indexing; import org.jbpm.compiler.xml.ProcessDataEventListenerProvider; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/query/AbstractFindIdsQuery.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/query/AbstractFindIdsQuery.java similarity index 97% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/query/AbstractFindIdsQuery.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/query/AbstractFindIdsQuery.java index 4bae092fba8..245ce49424b 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/query/AbstractFindIdsQuery.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/query/AbstractFindIdsQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.query; +package org.kie.workbench.common.stunner.bpmn.project.backend.query; import java.net.URI; import java.util.ArrayList; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/query/FindBpmnProcessIdsQuery.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/query/FindBpmnProcessIdsQuery.java similarity index 89% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/query/FindBpmnProcessIdsQuery.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/query/FindBpmnProcessIdsQuery.java index 47a6d88ac9b..01405d368c0 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/query/FindBpmnProcessIdsQuery.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/query/FindBpmnProcessIdsQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.query; +package org.kie.workbench.common.stunner.bpmn.project.backend.query; import javax.enterprise.context.ApplicationScoped; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/BPMNDiagramProjectService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/BPMNDiagramProjectService.java new file mode 100644 index 00000000000..e077e30baab --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/BPMNDiagramProjectService.java @@ -0,0 +1,56 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.service; + +import java.util.stream.StreamSupport; + +import javax.inject.Inject; +import javax.inject.Named; + +import org.jboss.errai.bus.server.annotations.Service; +import org.kie.workbench.common.stunner.bpmn.project.service.BPMNDiagramService; +import org.kie.workbench.common.stunner.bpmn.service.ProjectType; +import org.uberfire.backend.server.util.Paths; +import org.uberfire.backend.vfs.Path; +import org.uberfire.io.IOService; +import org.uberfire.java.nio.file.DirectoryStream; + +@Service +public class BPMNDiagramProjectService implements BPMNDiagramService { + + private IOService ioService; + + @Inject + public BPMNDiagramProjectService(final @Named("ioStrategy") IOService ioService) { + this.ioService = ioService; + } + + public BPMNDiagramProjectService() { + } + + @Override + public ProjectType getProjectType(Path projectRootPath) { + try (DirectoryStream paths = + ioService.newDirectoryStream(Paths.convert(projectRootPath), f -> f.getFileName().toString().startsWith("."))) { + return ProjectType.fromFileName(StreamSupport.stream(paths.spliterator(), false) + .map(Paths::convert) + .map(Path::getFileName) + .findFirst() + ).orElse(null); + } + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/BPMNFindDataTypesProjectService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/BPMNFindDataTypesProjectService.java new file mode 100644 index 00000000000..675df33939b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/BPMNFindDataTypesProjectService.java @@ -0,0 +1,66 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.bpmn.project.backend.service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import javax.inject.Inject; + +import org.guvnor.common.services.backend.exceptions.ExceptionUtilities; +import org.jboss.errai.bus.server.annotations.Service; +import org.kie.soup.project.datamodel.oracle.PackageDataModelOracle; +import org.kie.workbench.common.services.datamodel.backend.server.DataModelOracleUtilities; +import org.kie.workbench.common.services.datamodel.backend.server.service.DataModelService; +import org.kie.workbench.common.stunner.bpmn.project.service.DataTypesService; +import org.uberfire.backend.vfs.Path; + +@Service +public class BPMNFindDataTypesProjectService implements DataTypesService { + + private DataModelService dataModelService; + + //CDI proxy + protected BPMNFindDataTypesProjectService() { + this(null); + } + + @Inject + public BPMNFindDataTypesProjectService(final DataModelService dataModelService) { + this.dataModelService = dataModelService; + } + + public List getDataTypeNames(final Path path) { + if (null == path) { + return Collections.emptyList(); + } + final List dataTypeNames = new ArrayList<>(); + + try { + final PackageDataModelOracle oracle = dataModelService.getDataModel(path); + final String[] fullyQualifiedClassNames = DataModelOracleUtilities.getFactTypes(oracle); + + dataTypeNames.addAll(Arrays.asList(fullyQualifiedClassNames)); + Collections.sort(dataTypeNames); + } catch (Exception e) { + throw ExceptionUtilities.handleException(e); + } + + return dataTypeNames; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/ProcessesDataService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/ProcessesDataService.java new file mode 100644 index 00000000000..9aae14c2280 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/ProcessesDataService.java @@ -0,0 +1,99 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.service; + +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.event.Event; +import javax.enterprise.event.Observes; +import javax.inject.Inject; + +import org.kie.soup.commons.util.Sets; +import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueIndexTerm; +import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueResourceIndexTerm; +import org.kie.workbench.common.services.refactoring.service.RefactoringQueryService; +import org.kie.workbench.common.services.refactoring.service.ResourceType; +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.ProcessDataEvent; +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RequestProcessDataEvent; +import org.kie.workbench.common.stunner.bpmn.project.backend.query.FindBpmnProcessIdsQuery; +import org.uberfire.backend.vfs.Path; + +@ApplicationScoped +public class ProcessesDataService { + + private final RefactoringQueryService queryService; + private final Event processDataEvent; + private Supplier resourceType; + private Supplier queryName; + + // CDI proxy. + public ProcessesDataService() { + this(null, null); + } + + @Inject + public ProcessesDataService(final RefactoringQueryService queryService, + final Event processDataEvent) { + this.queryService = queryService; + this.processDataEvent = processDataEvent; + this.resourceType = () -> ResourceType.BPMN2; + this.queryName = () -> FindBpmnProcessIdsQuery.NAME; + } + + public List getBusinessProcessIDs() { + return getProcessIDs(); + } + + void onRequestProcessDataEvent(final @Observes RequestProcessDataEvent event) { + fireData(); + } + + public void setResourceType(final Supplier resourceType) { + this.resourceType = resourceType; + } + + public void setQueryName(final Supplier queryName) { + this.queryName = queryName; + } + + private void fireData() { + final List processIds = getBusinessProcessIDs(); + processDataEvent.fire(new ProcessDataEvent(processIds.toArray(new String[processIds.size()]))); + } + + @SuppressWarnings("unchecked") + private List getProcessIDs() { + final Set queryTerms = new Sets.Builder() + .add(new ValueResourceIndexTerm("*", + resourceType.get(), + ValueIndexTerm.TermSearchType.WILDCARD)) + .build(); + return queryService + .query(queryName.get(), queryTerms) + .stream() + .map(row -> (Map) row.getValue()) + .flatMap(mapRow -> mapRow.keySet().stream()) + .filter(pId -> !"null".equals(pId)) + .distinct() + .collect(Collectors.toList()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/RuleFlowGroupDataService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/RuleFlowGroupDataService.java new file mode 100644 index 00000000000..a37d1b21196 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/RuleFlowGroupDataService.java @@ -0,0 +1,53 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.service; + +import java.util.List; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.event.Event; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RequestRuleFlowGroupDataEvent; +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RuleFlowGroupDataEvent; + +@ApplicationScoped +public class RuleFlowGroupDataService { + + private final RuleFlowGroupQueryService queryService; + private final Event dataChangedEvent; + + @Inject + public RuleFlowGroupDataService(final RuleFlowGroupQueryService queryService, + final Event dataChangedEvent) { + this.queryService = queryService; + this.dataChangedEvent = dataChangedEvent; + } + + public List getRuleFlowGroupNames() { + return queryService.getRuleFlowGroupNames(); + } + + void onRequestRuleFlowGroupDataEvent(final RequestRuleFlowGroupDataEvent event) { + fireData(); + } + + void fireData() { + final List groupNames = getRuleFlowGroupNames(); + dataChangedEvent.fire(new RuleFlowGroupDataEvent(groupNames.toArray(new String[groupNames.size()]))); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/RuleFlowGroupQueryService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/RuleFlowGroupQueryService.java new file mode 100644 index 00000000000..7ade6c7f33c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/RuleFlowGroupQueryService.java @@ -0,0 +1,85 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.service; + +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import org.kie.soup.commons.util.Sets; +import org.kie.workbench.common.services.refactoring.backend.server.query.standard.FindRuleFlowNamesQuery; +import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueIndexTerm; +import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueSharedPartIndexTerm; +import org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow; +import org.kie.workbench.common.services.refactoring.service.PartType; +import org.kie.workbench.common.services.refactoring.service.RefactoringQueryService; + +@ApplicationScoped +public class RuleFlowGroupQueryService { + + private final RefactoringQueryService queryService; + private final Function, List> resultToSelectorData; + + //CDI proxy. + public RuleFlowGroupQueryService() { + this(null); + } + + @Inject + public RuleFlowGroupQueryService(final RefactoringQueryService queryService) { + this(queryService, + DEFAULT_RESULT_CONVERTER); + } + + RuleFlowGroupQueryService(final RefactoringQueryService queryService, + final Function, List> resultToSelectorData) { + this.queryService = queryService; + this.resultToSelectorData = resultToSelectorData; + } + + @SuppressWarnings("unchecked") + public List getRuleFlowGroupNames() { + List queryResult = queryService.query( + FindRuleFlowNamesQuery.NAME, + new Sets.Builder() + .add(new ValueSharedPartIndexTerm("*", + PartType.RULEFLOW_GROUP, + ValueIndexTerm.TermSearchType.WILDCARD)).build() + ); + return resultToSelectorData.apply(queryResult); + } + + @SuppressWarnings("unchecked") + private static String getValue(final RefactoringPageRow row) { + return ((Map) row.getValue()).get("name"); + } + + private static boolean isNotEmpty(final String s) { + return null != s && s.trim().length() > 0; + } + + public static Function, List> DEFAULT_RESULT_CONVERTER = + rows -> rows.stream() + .map(RuleFlowGroupQueryService::getValue) + .filter(RuleFlowGroupQueryService::isNotEmpty) + .distinct() + .collect(Collectors.toList()); +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/workitem/service/WorkItemDefinitionProjectService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/workitem/service/WorkItemDefinitionProjectService.java new file mode 100644 index 00000000000..0dacf6b3f18 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/project/backend/workitem/service/WorkItemDefinitionProjectService.java @@ -0,0 +1,120 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.workitem.service; + +import java.util.Collection; +import java.util.List; +import java.util.function.BiPredicate; +import java.util.stream.Collectors; + +import javax.annotation.PreDestroy; +import javax.enterprise.context.RequestScoped; +import javax.enterprise.inject.Default; +import javax.enterprise.inject.Produces; +import javax.inject.Inject; + +import org.jboss.errai.bus.server.annotations.Service; +import org.kie.workbench.common.stunner.bpmn.backend.workitem.deploy.WorkItemDefinitionDeployServices; +import org.kie.workbench.common.stunner.bpmn.backend.workitem.service.WorkItemDefinitionVFSLookupService; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistry; +import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; +import org.kie.workbench.common.stunner.core.diagram.Metadata; + +/** + * - It produces the work item definition registry for the current request + * - It performs look-ups by calling the VFS WorkItemDefinitionService, in order to populate a request's registry + * - If no work item definitions found for the module, it starts the deployment (see DEFAULT_DEPLOY_PREDICATE) + */ +@RequestScoped +@Service +public class WorkItemDefinitionProjectService + implements WorkItemDefinitionLookupService { + + private final WorkItemDefinitionCacheRegistry registry; + private final WorkItemDefinitionVFSLookupService vfsService; + private final WorkItemDefinitionDeployServices deployServices; + private final BiPredicate> deployPredicate; + + /** + * Assuming that at least the default built-in work item definitions provided by the workbench should be + * present, this predicate just checks if any asset has been found for the active module, + * if no assets found, it means the deployment must be performed, otherwise, do not perform any deployment. + */ + private static final BiPredicate> DEFAULT_DEPLOY_PREDICATE = + ((metadata, workItemDefinitions) -> workItemDefinitions.isEmpty()); + + // CDI proxy. + @SuppressWarnings("all") + protected WorkItemDefinitionProjectService() { + this(null, null, null, null); + } + + @Inject + public WorkItemDefinitionProjectService(final WorkItemDefinitionCacheRegistry registry, + final WorkItemDefinitionVFSLookupService vfsService, + final WorkItemDefinitionDeployServices deployServices) { + this(registry, + vfsService, + deployServices, + DEFAULT_DEPLOY_PREDICATE); + } + + WorkItemDefinitionProjectService(final WorkItemDefinitionCacheRegistry registry, + final WorkItemDefinitionVFSLookupService vfsService, + final WorkItemDefinitionDeployServices deployServices, + final BiPredicate> deployPredicate) { + this.registry = registry; + this.vfsService = vfsService; + this.deployServices = deployServices; + this.deployPredicate = deployPredicate; + } + + @Produces + @Default + public WorkItemDefinitionRegistry getRegistry() { + return registry; + } + + @Override + public Collection execute(final Metadata metadata) { + return load(metadata).items(); + } + + @PreDestroy + public void destroy() { + registry.destroy(); + } + + private WorkItemDefinitionCacheRegistry load(final Metadata metadata) { + Collection items = search(metadata); + if (deployPredicate.test(metadata, items)) { + deployServices.deploy(metadata); + items = search(metadata); + } + items.forEach(registry::register); + return registry; + } + + private List search(final Metadata metadata) { + return vfsService + .search(metadata) + .stream() + .collect(Collectors.toList()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/resources/META-INF/services/org.jbpm.compiler.xml.ProcessDataEventListenerProvider b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/resources/META-INF/services/org.jbpm.compiler.xml.ProcessDataEventListenerProvider new file mode 100644 index 00000000000..5447bd594bc --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/main/resources/META-INF/services/org.jbpm.compiler.xml.ProcessDataEventListenerProvider @@ -0,0 +1,17 @@ +# +# Copyright 2019 Red Hat, Inc. and/or its affiliates. +# +# Licensed 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. +# + +org.kie.workbench.common.stunner.bpmn.project.backend.indexing.BpmnProcessDataEventListenerProvider \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/factory/CaseGraphFactoryImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/factory/CaseGraphFactoryImplTest.java index 6898e23028a..c0d4e4efc89 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/factory/CaseGraphFactoryImplTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/factory/CaseGraphFactoryImplTest.java @@ -21,13 +21,13 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.bpmn.backend.workitem.service.WorkItemDefinitionBackendService; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram; import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc; import org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet; import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTask; import org.kie.workbench.common.stunner.bpmn.workitem.ServiceTaskFactory; +import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; import org.kie.workbench.common.stunner.core.api.DefinitionManager; import org.kie.workbench.common.stunner.core.api.FactoryManager; import org.kie.workbench.common.stunner.core.command.Command; @@ -90,7 +90,7 @@ public class CaseGraphFactoryImplTest { private ServiceTaskFactory serviceTaskFactory; @Mock - private WorkItemDefinitionBackendService workItemDefinitionService; + private WorkItemDefinitionLookupService workItemDefinitionService; @Mock private Node diagramNode; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/Bean1.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/Bean1.java similarity index 90% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/Bean1.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/Bean1.java index 316b148d0f6..cc022d9809b 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/Bean1.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/Bean1.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions; /** * Class intended for testing purposes, please do not delete or verify the tests if modified. diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/Bean2.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/Bean2.java similarity index 89% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/Bean2.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/Bean2.java index 8be7816c6e0..6e08bf79737 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/Bean2.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/Bean2.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions; /** * Class intended for testing purposes, please do not delete or verify the tests if modified. diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorProjectServiceImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorProjectServiceImplTest.java deleted file mode 100644 index 0992d96e303..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorProjectServiceImplTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions; - -import org.kie.workbench.common.services.backend.project.ModuleClassLoaderHelper; -import org.kie.workbench.common.services.shared.project.KieModule; -import org.kie.workbench.common.services.shared.project.KieModuleService; -import org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.ConditionEditorServiceBaseTest; -import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; -import org.mockito.Mock; - -import static org.mockito.Mockito.when; - -public class ConditionEditorProjectServiceImplTest - extends ConditionEditorServiceBaseTest { - - @Mock - private KieModuleService moduleService; - - @Mock - private ModuleClassLoaderHelper moduleClassLoaderHelper; - - @Mock - private KieModule module; - - @Override - public void setUp() { - super.setUp(); - when(moduleService.resolveModule(path)).thenReturn(module); - ClassLoader classLoader = ClassLoader.getSystemClassLoader(); - when(moduleClassLoaderHelper.getModuleClassLoader(module)).thenReturn(classLoader); - } - - @Override - protected ConditionEditorService createService() { - return new ConditionEditorProjectServiceImpl(moduleService, moduleClassLoaderHelper); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/ConditionEditorServiceBaseTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorServiceBaseTest.java similarity index 90% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/ConditionEditorServiceBaseTest.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorServiceBaseTest.java index acc0c099550..444cb020198 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/ConditionEditorServiceBaseTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorServiceBaseTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions; import java.math.BigDecimal; import java.math.BigInteger; @@ -41,12 +41,12 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.binaryFunctions; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.buildBinaryConditionScript; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.buildBinaryConditionScripts; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.failingBinaryFunctionExpressions; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.stringParams; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.variableParams; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.binaryFunctions; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.buildBinaryConditionScript; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.buildBinaryConditionScripts; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.failingBinaryFunctionExpressions; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.stringParams; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.variableParams; @RunWith(MockitoJUnitRunner.class) public abstract class ConditionEditorServiceBaseTest { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorServiceImplTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorServiceImplTest.java new file mode 100644 index 00000000000..b9613f933aa --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/ConditionEditorServiceImplTest.java @@ -0,0 +1,51 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions; + +import org.kie.workbench.common.services.backend.project.ModuleClassLoaderHelper; +import org.kie.workbench.common.services.shared.project.KieModule; +import org.kie.workbench.common.services.shared.project.KieModuleService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; +import org.mockito.Mock; + +import static org.mockito.Mockito.when; + +public class ConditionEditorServiceImplTest + extends ConditionEditorServiceBaseTest { + + @Mock + private KieModuleService moduleService; + + @Mock + private ModuleClassLoaderHelper moduleClassLoaderHelper; + + @Mock + private KieModule module; + + @Override + public void setUp() { + super.setUp(); + when(moduleService.resolveModule(path)).thenReturn(module); + ClassLoader classLoader = ClassLoader.getSystemClassLoader(); + when(moduleClassLoaderHelper.getModuleClassLoader(module)).thenReturn(classLoader); + } + + @Override + protected ConditionEditorService createService() { + return new ConditionEditorServiceImpl(moduleService, moduleClassLoaderHelper); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionGeneratorTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionGeneratorTest.java similarity index 78% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionGeneratorTest.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionGeneratorTest.java index 362b62dbd53..b6400397d1c 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionGeneratorTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionGeneratorTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser; import org.junit.Rule; import org.junit.Test; @@ -22,14 +22,14 @@ import org.kie.workbench.common.stunner.bpmn.forms.conditions.Condition; import static org.junit.Assert.assertEquals; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.binaryFunctions; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.buildBinaryConditionScript; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.buildTernaryConditionScript; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.buildUnaryConditionScript; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.stringParams; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.ternaryFunctions; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.unaryFunctions; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.variableParams; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.binaryFunctions; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.buildBinaryConditionScript; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.buildTernaryConditionScript; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.buildUnaryConditionScript; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.stringParams; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.ternaryFunctions; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.unaryFunctions; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.variableParams; public class ConditionGeneratorTest { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionParserTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionParserTest.java similarity index 79% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionParserTest.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionParserTest.java index dae7da9e2ee..679d7e1905b 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionParserTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionParserTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser; import java.text.ParseException; import java.util.Arrays; @@ -25,17 +25,17 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.binaryFunctions; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.buildBinaryConditionScripts; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.buildTernaryConditionScripts; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.buildUnaryConditionScripts; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.failingBinaryFunctionExpressions; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.failingTernaryFunctionExpressions; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.failingUnaryFunctionExpressions; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.stringParams; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.ternaryFunctions; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.unaryFunctions; -import static org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser.ConditionTestCommons.variableParams; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.binaryFunctions; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.buildBinaryConditionScripts; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.buildTernaryConditionScripts; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.buildUnaryConditionScripts; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.failingBinaryFunctionExpressions; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.failingTernaryFunctionExpressions; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.failingUnaryFunctionExpressions; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.stringParams; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.ternaryFunctions; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.unaryFunctions; +import static org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser.ConditionTestCommons.variableParams; public class ConditionParserTest { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionTestCommons.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionTestCommons.java similarity index 99% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionTestCommons.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionTestCommons.java index b1124447d7b..197463e6c63 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ConditionTestCommons.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ConditionTestCommons.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser; import java.util.ArrayList; import java.util.Arrays; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ParsingUtilsTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ParsingUtilsTest.java similarity index 97% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ParsingUtilsTest.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ParsingUtilsTest.java index c786e3281d0..f447c84b6ef 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/conditions/parser/ParsingUtilsTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/conditions/parser/ParsingUtilsTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.conditions.parser; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.conditions.parser; import java.text.ParseException; import java.util.Arrays; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/BPMNFormGenerationModelProviderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/BPMNFormGenerationModelProviderTest.java similarity index 92% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/BPMNFormGenerationModelProviderTest.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/BPMNFormGenerationModelProviderTest.java index 4572fdcc8c9..28ba580a2ab 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/BPMNFormGenerationModelProviderTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/BPMNFormGenerationModelProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.gen; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.gen; import org.eclipse.bpmn2.Definitions; import org.junit.Before; @@ -23,7 +23,7 @@ import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; import org.kie.workbench.common.stunner.bpmn.backend.BPMNBackendService; import org.kie.workbench.common.stunner.bpmn.backend.BPMNDirectDiagramMarshaller; -import org.kie.workbench.common.stunner.bpmn.backend.forms.gen.util.BPMNFormGenerationModelProviderHelper; +import org.kie.workbench.common.stunner.bpmn.project.backend.forms.gen.util.BPMNFormGenerationModelProviderHelper; import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.diagram.Metadata; import org.kie.workbench.common.stunner.core.util.DefinitionUtils; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/util/FormGenerationModelProviderHelperTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/util/FormGenerationModelProviderHelperTest.java similarity index 96% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/util/FormGenerationModelProviderHelperTest.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/util/FormGenerationModelProviderHelperTest.java index c14bb15aa88..38ea16f6c03 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/forms/gen/util/FormGenerationModelProviderHelperTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/forms/gen/util/FormGenerationModelProviderHelperTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.forms.gen.util; +package org.kie.workbench.common.stunner.bpmn.project.backend.forms.gen.util; import org.junit.Before; import org.junit.Test; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/BpmnProcessDataEventListenerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/BpmnProcessDataEventListenerTest.java new file mode 100644 index 00000000000..fc8ca9753c9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/indexing/BpmnProcessDataEventListenerTest.java @@ -0,0 +1,37 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.indexing; + +import org.junit.Test; +import org.kie.workbench.common.services.refactoring.service.ResourceType; + +import static org.junit.Assert.assertEquals; + +public class BpmnProcessDataEventListenerTest { + + private BpmnProcessDataEventListener tested = new BpmnProcessDataEventListener(); + + @Test + public void testGetProcessIdResourceType() throws Exception { + assertEquals(tested.getProcessIdResourceType(), ResourceType.BPMN2); + } + + @Test + public void testGetProcessNameResourceType() throws Exception { + assertEquals(tested.getProcessNameResourceType(), ResourceType.BPMN2_NAME); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/query/FindBpmnProcessIdsQueryTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/query/FindBpmnProcessIdsQueryTest.java new file mode 100644 index 00000000000..152ba8e53eb --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/query/FindBpmnProcessIdsQueryTest.java @@ -0,0 +1,32 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.query; + +import org.junit.Test; +import org.kie.workbench.common.services.refactoring.service.ResourceType; + +import static org.junit.Assert.assertEquals; + +public class FindBpmnProcessIdsQueryTest { + + private FindBpmnProcessIdsQuery tested = new FindBpmnProcessIdsQuery(); + + @Test + public void testGetProcessIdResourceType() throws Exception { + assertEquals(tested.getProcessIdResourceType(), ResourceType.BPMN2); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/BPMNDiagramProjectServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/BPMNDiagramProjectServiceTest.java new file mode 100644 index 00000000000..b19a411d730 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/BPMNDiagramProjectServiceTest.java @@ -0,0 +1,95 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.service; + +import java.net.URI; +import java.util.Arrays; +import java.util.Collections; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.service.ProjectType; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.uberfire.io.IOService; +import org.uberfire.java.nio.file.DirectoryStream; +import org.uberfire.java.nio.file.FileSystem; +import org.uberfire.java.nio.file.Path; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class BPMNDiagramProjectServiceTest { + + public static final String DIR_URI = "default://master@diagrams/root"; + + private static final String FILE_NAME = ".caseproject"; + + public static final String FILE_URI = DIR_URI + "/" + FILE_NAME; + + private BPMNDiagramProjectService tested; + + @Mock + private IOService ioService; + + @Mock + private DirectoryStream directoryStream; + + @Mock + private org.uberfire.backend.vfs.Path projectPath; + + @Mock + private Path fsPath; + + @Mock + private Path fileName; + + @Mock + private FileSystem fs; + + @Before + public void setUp() throws Exception { + + ArgumentCaptor filter = ArgumentCaptor.forClass(DirectoryStream.Filter.class); + when(ioService.newDirectoryStream(any(), filter.capture())).thenReturn(directoryStream); + when(directoryStream.spliterator()).thenReturn(Arrays.asList(fsPath).spliterator()); + when(projectPath.toURI()).thenReturn(DIR_URI); + when(fsPath.getFileName()).thenReturn(fileName); + when(fsPath.toUri()).thenReturn(new URI(FILE_URI)); + when(fsPath.getFileSystem()).thenReturn(fs); + when(fileName.toString()).thenReturn(FILE_NAME); + + tested = new BPMNDiagramProjectService(ioService); + } + + @Test + public void getProjectTypeCase() { + final ProjectType projectType = tested.getProjectType(projectPath); + assertEquals(projectType, ProjectType.CASE); + } + + @Test + public void getProjectTypeNull() { + when(directoryStream.spliterator()).thenReturn(Collections.emptyList().spliterator()); + final ProjectType projectType = tested.getProjectType(projectPath); + assertEquals(projectType, null); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/RuleFlowGroupDataServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/RuleFlowGroupDataServiceTest.java new file mode 100644 index 00000000000..1c7088792e8 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/RuleFlowGroupDataServiceTest.java @@ -0,0 +1,84 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.service; + +import java.util.Arrays; +import java.util.List; + +import javax.enterprise.event.Event; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RuleFlowGroupDataEvent; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class RuleFlowGroupDataServiceTest { + + @Mock + private RuleFlowGroupQueryService queryService; + + @Mock + private Event dataChangedEvent; + + private RuleFlowGroupDataService tested; + + @Before + public void setUp() { + when(queryService.getRuleFlowGroupNames()).thenReturn(Arrays.asList("g1", "g2")); + tested = new RuleFlowGroupDataService(queryService, dataChangedEvent); + } + + @Test + public void testGetRuleFlowGroupNames() { + List names = tested.getRuleFlowGroupNames(); + assertRightRuleFlowGroupNames(names); + } + + @Test + public void testFireData() { + tested.fireData(); + ArgumentCaptor ec = ArgumentCaptor.forClass(RuleFlowGroupDataEvent.class); + verify(dataChangedEvent, times(1)).fire(ec.capture()); + RuleFlowGroupDataEvent event = ec.getValue(); + assertRightRuleFlowGroupNames(event.getGroupNames()); + } + + private static void assertRightRuleFlowGroupNames(String[] names) { + assertNotNull(names); + assertEquals(2, names.length); + assertEquals("g1", names[0]); + assertEquals("g2", names[1]); + } + + private static void assertRightRuleFlowGroupNames(List names) { + assertNotNull(names); + assertEquals(2, names.size()); + assertTrue(names.contains("g1")); + assertTrue(names.contains("g2")); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/RuleFlowGroupQueryServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/RuleFlowGroupQueryServiceTest.java new file mode 100644 index 00000000000..93c8d7bdb9a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/RuleFlowGroupQueryServiceTest.java @@ -0,0 +1,117 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.service; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.junit.Test; +import org.kie.workbench.common.services.refactoring.backend.server.query.standard.FindRuleFlowNamesQuery; +import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueIndexTerm; +import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueSharedPartIndexTerm; +import org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow; +import org.kie.workbench.common.services.refactoring.service.PartType; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class RuleFlowGroupQueryServiceTest { + + private final static String ERROR_MSG = PartType.ACTIVATION_GROUP.toString() + "' can not be used"; + + @Test + public void findRuleFlowNamesQueryTermsTest() { + FindRuleFlowNamesQuery query = new FindRuleFlowNamesQuery(); + + Set queryTerms = new HashSet<>(); + try { + query.validateTerms(queryTerms); + fail("The required rule-flow term is missing, but no exception was thrown."); + } catch (IllegalArgumentException iae) { + assertTrue("Incorrect error message: " + iae.getMessage(), + iae.getMessage().contains("At least 1 term")); + } + + queryTerms = new HashSet<>(); + queryTerms.add(new ValueSharedPartIndexTerm("not-rule-flow", + PartType.ACTIVATION_GROUP)); + try { + query.validateTerms(queryTerms); + fail("The required rule-flow term is missing, but no exception was thrown."); + } catch (IllegalArgumentException iae) { + assertTrue("Incorrect error message: " + iae.getMessage(), + iae.getMessage().contains(ERROR_MSG)); + } + + queryTerms = new HashSet<>(); + queryTerms.add(new ValueSharedPartIndexTerm("not-rule-flow", + PartType.ACTIVATION_GROUP)); + queryTerms.add(new ValueSharedPartIndexTerm("rule-flow", + PartType.RULEFLOW_GROUP)); + try { + query.validateTerms(queryTerms); + fail("The activation term is not acceptable here, but no exception was thrown."); + } catch (IllegalArgumentException iae) { + assertTrue("Incorrect error message: " + iae.getMessage(), + iae.getMessage().contains(ERROR_MSG)); + } + + queryTerms = new HashSet<>(); + queryTerms.add(new ValueSharedPartIndexTerm("rule-flow", + PartType.RULEFLOW_GROUP)); + query.validateTerms(queryTerms); + } + + @Test + @SuppressWarnings("unchecked") + public void testDefaultResultConverter() { + RefactoringPageRow row1 = mock(RefactoringPageRow.class); + when(row1.getValue()).thenReturn(asMap("row1")); + RefactoringPageRow row2 = mock(RefactoringPageRow.class); + when(row2.getValue()).thenReturn(asMap("row2")); + RefactoringPageRow row3 = mock(RefactoringPageRow.class); + when(row3.getValue()).thenReturn(asMap("row3")); + RefactoringPageRow row4 = mock(RefactoringPageRow.class); + when(row4.getValue()).thenReturn(asMap("row4")); + RefactoringPageRow row4_2 = mock(RefactoringPageRow.class); + when(row4_2.getValue()).thenReturn(asMap("row4")); + RefactoringPageRow emptyRow1 = mock(RefactoringPageRow.class); + when(emptyRow1.getValue()).thenReturn(asMap("")); + RefactoringPageRow emptyRow2 = mock(RefactoringPageRow.class); + when(emptyRow2.getValue()).thenReturn(asMap("")); + List rows = Arrays.asList(row1, row2, row3, row4, row4_2, emptyRow1, emptyRow2); + List result = RuleFlowGroupQueryService.DEFAULT_RESULT_CONVERTER.apply(rows); + assertEquals(4, result.size()); + assertTrue(result.contains("row1")); + assertTrue(result.contains("row2")); + assertTrue(result.contains("row3")); + assertTrue(result.contains("row4")); + } + + private static Map asMap(String s) { + HashMap map = new HashMap<>(1); + map.put("name", s); + return map; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/indexing/BpmnFileIndexerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/indexing/BpmnFileIndexerTest.java similarity index 95% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/indexing/BpmnFileIndexerTest.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/indexing/BpmnFileIndexerTest.java index 83b5ef78d3d..e96b02a7466 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/indexing/BpmnFileIndexerTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/indexing/BpmnFileIndexerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.service.indexing; +package org.kie.workbench.common.stunner.bpmn.project.backend.service.indexing; import java.util.ArrayList; import java.util.Arrays; @@ -26,8 +26,10 @@ import org.guvnor.common.services.project.model.GAV; import org.guvnor.common.services.project.model.POM; import org.guvnor.common.services.project.model.Package; +import org.junit.Ignore; import org.junit.Test; import org.kie.workbench.common.services.refactoring.backend.server.BaseIndexingTest; +import org.kie.workbench.common.services.refactoring.backend.server.IndexingTest; import org.kie.workbench.common.services.refactoring.backend.server.TestIndexer; import org.kie.workbench.common.services.refactoring.backend.server.query.NamedQuery; import org.kie.workbench.common.services.refactoring.backend.server.query.response.DefaultResponseBuilder; @@ -43,7 +45,7 @@ import org.kie.workbench.common.services.refactoring.service.impact.QueryOperationRequest; import org.kie.workbench.common.services.shared.project.KieModule; import org.kie.workbench.common.services.shared.project.KieModuleService; -import org.kie.workbench.common.stunner.bpmn.backend.query.FindBpmnProcessIdsQuery; +import org.kie.workbench.common.stunner.bpmn.project.backend.query.FindBpmnProcessIdsQuery; import org.kie.workbench.common.stunner.bpmn.resource.BPMNDefinitionSetResourceType; import org.uberfire.java.nio.file.Path; import org.uberfire.paging.PageResponse; @@ -56,6 +58,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +@Ignore("Needs Kogito backend") public class BpmnFileIndexerTest extends BaseIndexingTest { private final static List PROCESS_IDS = Arrays.asList(new String[]{"hiring", "ParentProcess", "SubProcess", "multiple-rule-tasks", "org.jbpm.signal", "org.jbpm.broken"}); @@ -259,11 +262,11 @@ private PageResponse queryBPMN2Resources() throws IllegalArg @Override protected KieModuleService getModuleService() { final org.uberfire.backend.vfs.Path mockRoot = mock(org.uberfire.backend.vfs.Path.class); - when(mockRoot.toURI()).thenReturn(TEST_MODULE_ROOT); + when(mockRoot.toURI()).thenReturn(IndexingTest.TEST_MODULE_ROOT); final KieModule mockModule = mock(KieModule.class); when(mockModule.getRootPath()).thenReturn(mockRoot); - when(mockModule.getModuleName()).thenReturn(TEST_MODULE_NAME); + when(mockModule.getModuleName()).thenReturn(IndexingTest.TEST_MODULE_NAME); POM mockPom = mock(POM.class); when(mockModule.getPom()).thenReturn(mockPom); @@ -272,7 +275,7 @@ protected KieModuleService getModuleService() { when(mockGAV.toString()).thenReturn(DEPLOYMENT_ID); final Package mockPackage = mock(Package.class); - when(mockPackage.getPackageName()).thenReturn(TEST_PACKAGE_NAME); + when(mockPackage.getPackageName()).thenReturn(IndexingTest.TEST_PACKAGE_NAME); final KieModuleService mockModuleService = mock(KieModuleService.class); when(mockModuleService.resolveModule(any(org.uberfire.backend.vfs.Path.class))).thenReturn(mockModule); diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/indexing/BpmnProcessDataEventListenerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/indexing/BpmnProcessDataEventListenerTest.java new file mode 100644 index 00000000000..d87d66ff9e6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/indexing/BpmnProcessDataEventListenerTest.java @@ -0,0 +1,77 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.bpmn.project.backend.service.indexing; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import org.jbpm.process.core.context.variable.Variable; +import org.jbpm.process.core.datatype.impl.type.StringDataType; +import org.junit.Test; +import org.kie.workbench.common.services.refactoring.Resource; +import org.kie.workbench.common.services.refactoring.service.ResourceType; +import org.kie.workbench.common.stunner.bpmn.project.backend.indexing.BpmnProcessDataEventListener; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; + +public class BpmnProcessDataEventListenerTest { + + @Test + public void testAddDistinctProcessVariables() throws Exception { + Resource processResource = new Resource("org.jbpm.test.testProcess.bpmn2", + ResourceType.BPMN2); + BpmnProcessDataEventListener dataEventListener = new BpmnProcessDataEventListener(); + try { + dataEventListener.addDistinctProcessVariables(getProcessVariables(), + processResource); + Set adderVars = dataEventListener.getUniqueVariables(); + assertNotNull(adderVars); + assertEquals(3, + adderVars.size()); + } catch (IllegalArgumentException e) { + fail("Unable to add process variables: " + e.getMessage()); + } + } + + private List getProcessVariables() { + List processVariables = new ArrayList<>(); + Variable firstName = new Variable(); + firstName.setName("firstName"); + firstName.setType(new StringDataType()); + processVariables.add(firstName); + + Variable lastName = new Variable(); + lastName.setName("lastName"); + lastName.setType(new StringDataType()); + processVariables.add(lastName); + + Variable address = new Variable(); + address.setName("address"); + address.setType(new StringDataType()); + processVariables.add(address); + + // add first name again (could be a subprocess variable also called firstName + Variable subprocessFirstName = new Variable(); + subprocessFirstName.setName("firstName"); + subprocessFirstName.setType(new StringDataType()); + processVariables.add(subprocessFirstName); + + return processVariables; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/indexing/TestBpmnFileIndexer.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/indexing/TestBpmnFileIndexer.java similarity index 88% rename from kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/indexing/TestBpmnFileIndexer.java rename to kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/indexing/TestBpmnFileIndexer.java index 5a0040aa7a1..80917e04f5d 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/service/indexing/TestBpmnFileIndexer.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/indexing/TestBpmnFileIndexer.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.workbench.common.stunner.bpmn.backend.service.indexing; +package org.kie.workbench.common.stunner.bpmn.project.backend.service.indexing; import org.kie.workbench.common.services.backend.project.ModuleClassLoaderHelper; import org.kie.workbench.common.services.refactoring.backend.server.TestIndexer; import org.kie.workbench.common.services.shared.project.KieModuleService; -import org.kie.workbench.common.stunner.bpmn.backend.indexing.BpmnFileIndexer; +import org.kie.workbench.common.stunner.bpmn.project.backend.indexing.BpmnFileIndexer; import org.kie.workbench.common.stunner.bpmn.resource.BPMNDefinitionSetResourceType; import org.uberfire.io.IOService; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/query/FindBpmnProcessIdsQueryTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/query/FindBpmnProcessIdsQueryTest.java new file mode 100644 index 00000000000..8280733ad71 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/query/FindBpmnProcessIdsQueryTest.java @@ -0,0 +1,69 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.service.query; + +import java.util.HashSet; +import java.util.Set; + +import org.junit.Test; +import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueIndexTerm; +import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueResourceIndexTerm; +import org.kie.workbench.common.services.refactoring.service.ResourceType; +import org.kie.workbench.common.stunner.bpmn.project.backend.query.FindBpmnProcessIdsQuery; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class FindBpmnProcessIdsQueryTest { + + private final static String ERROR_MSG = ResourceType.JAVA.toString() + "' can not be used"; + + @Test + public void findBpmnProcessIdsQueryTermsTest() { + FindBpmnProcessIdsQuery query = new FindBpmnProcessIdsQuery(); + + Set queryTerms = new HashSet<>(); + try { + query.validateTerms(queryTerms); + fail("The required resources term is missing, but no exception was thrown."); + } catch (IllegalArgumentException iae) { + assertTrue("Incorrect error message: " + iae.getMessage(), + iae.getMessage().contains("Expected 'ValueResourceIndexTerm' term was not found.")); + } + + queryTerms = new HashSet<>(); + queryTerms.add(new ValueResourceIndexTerm("not-bpmn2-resources", + ResourceType.JAVA)); + try { + query.validateTerms(queryTerms); + fail("The required resources term is missing, but no exception was thrown."); + } catch (IllegalArgumentException iae) { + assertTrue("Incorrect error message: " + iae.getMessage(), + iae.getMessage().contains(ERROR_MSG)); + } + + queryTerms = new HashSet<>(); + queryTerms.add(new ValueResourceIndexTerm("*", + ResourceType.BPMN2, + ValueIndexTerm.TermSearchType.WILDCARD)); + try { + query.validateTerms(queryTerms); + } catch (IllegalArgumentException iae) { + fail("The activation term is acceptable here, but an exception was thrown."); + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/service/FindDataTypesProjectServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/service/FindDataTypesProjectServiceTest.java new file mode 100644 index 00000000000..75516971b8c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/service/FindDataTypesProjectServiceTest.java @@ -0,0 +1,101 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.bpmn.project.backend.service.service; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.soup.project.datamodel.oracle.DataType; +import org.kie.soup.project.datamodel.oracle.FieldAccessorsAndMutators; +import org.kie.soup.project.datamodel.oracle.ModelField; +import org.kie.soup.project.datamodel.oracle.PackageDataModelOracle; +import org.kie.workbench.common.services.datamodel.backend.server.service.DataModelService; +import org.kie.workbench.common.stunner.bpmn.project.backend.service.BPMNFindDataTypesProjectService; +import org.kie.workbench.common.stunner.bpmn.project.service.DataTypesService; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.uberfire.backend.vfs.Path; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class FindDataTypesProjectServiceTest { + + @Mock + private DataModelService dataModelService; + + @Mock + private PackageDataModelOracle oracle; + + @Mock + private Path path; + + private DataTypesService service; + + @Before + public void setup() { + this.service = new BPMNFindDataTypesProjectService(dataModelService); + } + + @Test + public void testGetJavaTypeNames() throws Exception { + final Map fields = new java.util.HashMap<>(); + + when(oracle.getModulePackageNames()).thenReturn(Collections.singletonList("org")); + when(dataModelService.getDataModel(path)).thenReturn(oracle); + + //Types in the package + fields.put("org.Zebra", + new ModelField[]{new ModelField("this", + "org.Zebra", + ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, + ModelField.FIELD_ORIGIN.SELF, + FieldAccessorsAndMutators.ACCESSOR, + DataType.TYPE_THIS)}); + + fields.put("org.Antelope", + new ModelField[]{new ModelField("this", + "org.Antelope", + ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, + ModelField.FIELD_ORIGIN.SELF, + FieldAccessorsAndMutators.ACCESSOR, + DataType.TYPE_THIS)}); + + //Type not in the package + fields.put("smurf.Pupa", + new ModelField[]{new ModelField("this", + "smurf.Pupa", + ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, + ModelField.FIELD_ORIGIN.SELF, + FieldAccessorsAndMutators.ACCESSOR, + DataType.TYPE_THIS)}); + + when(oracle.getModuleModelFields()).thenReturn(fields); + + final List dataTypeNames = service.getDataTypeNames(path); + + assertNotNull(dataTypeNames); + assertEquals(2, dataTypeNames.size()); + assertEquals("org.Antelope", dataTypeNames.get(0)); + assertEquals("org.Zebra", dataTypeNames.get(1)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/service/ProcessesDataServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/service/ProcessesDataServiceTest.java new file mode 100644 index 00000000000..c388ae74ee3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/service/service/ProcessesDataServiceTest.java @@ -0,0 +1,88 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.service.service; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.enterprise.event.Event; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.services.refactoring.model.query.RefactoringMapPageRow; +import org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow; +import org.kie.workbench.common.services.refactoring.service.RefactoringQueryService; +import org.kie.workbench.common.stunner.bpmn.forms.dataproviders.ProcessDataEvent; +import org.kie.workbench.common.stunner.bpmn.project.backend.service.ProcessesDataService; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.uberfire.backend.vfs.Path; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class ProcessesDataServiceTest { + + private static final String ID1 = "P1.Process1"; + private static final String ID2 = "P1.Process2"; + + @Mock + private RefactoringQueryService queryService; + + @Mock + private Event processesUpdatedEvent; + + @Mock + private Path path1; + + @Mock + private Path path2; + + private ProcessesDataService tested; + + @Before + public void setup() { + List results = new ArrayList(); + RefactoringMapPageRow refactoringMapPageRow = new RefactoringMapPageRow(); + Map map = new HashMap(); + map.put(ID1, + path1); + map.put(ID2, + path2); + refactoringMapPageRow.setValue(map); + results.add(refactoringMapPageRow); + when(queryService.query(anyString(), + anyObject())).thenReturn(results); + tested = new ProcessesDataService(queryService, processesUpdatedEvent); + } + + @Test + public void testGetBusinessProcessIDs() { + Collection results = tested.getBusinessProcessIDs(); + assertEquals(results.size(), 2); + assertTrue(results.contains(ID1)); + assertTrue(results.contains(ID2)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/workitem/service/WorkItemDefinitionProjectServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/workitem/service/WorkItemDefinitionProjectServiceTest.java new file mode 100644 index 00000000000..1af60c9b50d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/project/backend/workitem/service/WorkItemDefinitionProjectServiceTest.java @@ -0,0 +1,93 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.backend.workitem.service; + +import java.util.Arrays; +import java.util.Collection; +import java.util.function.BiPredicate; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.backend.workitem.deploy.WorkItemDefinitionDeployServices; +import org.kie.workbench.common.stunner.bpmn.backend.workitem.service.WorkItemDefinitionVFSLookupService; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class WorkItemDefinitionProjectServiceTest { + + private static WorkItemDefinition wid1 = new WorkItemDefinition().setName("wid1"); + private static WorkItemDefinition wid2 = new WorkItemDefinition().setName("wid2"); + + @Mock + private WorkItemDefinitionVFSLookupService vfsService; + + @Mock + private WorkItemDefinitionDeployServices deployServices; + + @Mock + private BiPredicate> deployPredicate; + + @Mock + private Metadata metadata; + + private WorkItemDefinitionProjectService tested; + private WorkItemDefinitionCacheRegistry registry; + + @Before + public void init() { + when(vfsService.search(eq(metadata))).thenReturn(Arrays.asList(wid1, + wid2)); + registry = new WorkItemDefinitionCacheRegistry(); + tested = new WorkItemDefinitionProjectService(registry, + vfsService, + deployServices, + deployPredicate); + } + + @Test + public void testGetRegistry() { + assertEquals(registry, tested.getRegistry()); + } + + @Test + public void testExecute() { + Collection result = tested.execute(metadata); + assertFalse(result.isEmpty()); + assertEquals(2, result.size()); + assertTrue(result.contains(wid1)); + assertTrue(result.contains(wid2)); + } + + @Test + public void testDestroy() { + tested.execute(metadata); + assertFalse(registry.isEmpty()); + tested.destroy(); + assertTrue(registry.isEmpty()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/pom.xml index 30a4706d0ab..2f15a55b5b8 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/pom.xml @@ -125,6 +125,11 @@ kie-wb-common-stunner-jbpm-designer-integration-shared + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client + + @@ -151,6 +156,13 @@ provided + + + + com.google.elemental2 + elemental2-promise + + @@ -173,12 +185,6 @@ uberfire-project-api - - org.uberfire - uberfire-widgets-properties-editor-api - provided - - org.uberfire uberfire-workbench-client @@ -248,6 +254,16 @@ errai-security-server + + org.uberfire + uberfire-security-management-api + + + + org.uberfire + uberfire-security-management-client + + @@ -264,6 +280,13 @@ test-jar + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client + test + test-jar + + org.kie lienzo-tests diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/canvas/controls/BPMNProjectActionsToolboxFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/canvas/controls/BPMNProjectActionsToolboxFactory.java new file mode 100644 index 00000000000..941de34ec5c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/canvas/controls/BPMNProjectActionsToolboxFactory.java @@ -0,0 +1,82 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.canvas.controls; + +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; + +import javax.annotation.PreDestroy; +import javax.enterprise.context.Dependent; +import javax.enterprise.inject.Any; +import javax.inject.Inject; + +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.kie.workbench.common.stunner.bpmn.client.forms.util.BPMNFormsContextUtils; +import org.kie.workbench.common.stunner.bpmn.qualifiers.BPMN; +import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; +import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.AbstractActionsToolboxFactory; +import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxFactory; +import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxView; +import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.CommonActionsToolbox; +import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ToolboxAction; +import org.kie.workbench.common.stunner.core.graph.Element; +import org.kie.workbench.common.stunner.forms.client.components.toolbox.FormGenerationToolboxAction; + +/** + * Produces same toolbox content and view as the @CommonActionsToolbox but + * it additionally add the form generation action, if it applies. + */ +@Dependent +@BPMN +public class BPMNProjectActionsToolboxFactory extends AbstractActionsToolboxFactory { + + private final ActionsToolboxFactory commonActionToolbox; + private final ManagedInstance generateFormsActions; + private final ManagedInstance views; + + @Inject + public BPMNProjectActionsToolboxFactory(final @CommonActionsToolbox ActionsToolboxFactory commonActionToolbox, + final @Any ManagedInstance generateFormsActions, + final @Any @CommonActionsToolbox ManagedInstance views) { + this.commonActionToolbox = commonActionToolbox; + this.generateFormsActions = generateFormsActions; + this.views = views; + } + + @Override + protected ActionsToolboxView newViewInstance() { + return views.get(); + } + + @Override + public Collection> getActions(final AbstractCanvasHandler canvasHandler, + final Element e) { + final List> actions = new LinkedList<>(); + actions.addAll(commonActionToolbox.getActions(canvasHandler, e)); + if (BPMNFormsContextUtils.isFormGenerationSupported(e)) { + actions.add(generateFormsActions.get()); + } + return actions; + } + + @PreDestroy + public void destroy() { + generateFormsActions.destroyAll(); + views.destroyAll(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/canvas/controls/BPMNProjectToolboxControl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/canvas/controls/BPMNProjectToolboxControl.java new file mode 100644 index 00000000000..aee19b94057 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/canvas/controls/BPMNProjectToolboxControl.java @@ -0,0 +1,69 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.canvas.controls; + +import java.util.Arrays; +import java.util.List; + +import javax.annotation.PreDestroy; +import javax.enterprise.context.Dependent; +import javax.enterprise.inject.Any; +import javax.inject.Inject; + +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.kie.workbench.common.stunner.bpmn.qualifiers.BPMN; +import org.kie.workbench.common.stunner.core.client.canvas.controls.toolbox.AbstractToolboxControl; +import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxFactory; +import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.FlowActionsToolbox; +import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.MorphActionsToolbox; + +/** + * Custom toolbox control for BPMN, which includes additional items. + */ +@Dependent +@BPMN +public class BPMNProjectToolboxControl extends AbstractToolboxControl { + + private final ManagedInstance flowActionsToolboxFactories; + private final ManagedInstance morphActionsToolboxFactories; + private final ManagedInstance bpmnCommonActionsToolboxFactories; + + @Inject + public BPMNProjectToolboxControl(final @Any @FlowActionsToolbox ManagedInstance flowActionsToolboxFactories, + final @Any @MorphActionsToolbox ManagedInstance morphActionsToolboxFactories, + final @Any @BPMN ManagedInstance bpmnCommonActionsToolboxFactories) { + this.flowActionsToolboxFactories = flowActionsToolboxFactories; + this.morphActionsToolboxFactories = morphActionsToolboxFactories; + this.bpmnCommonActionsToolboxFactories = bpmnCommonActionsToolboxFactories; + } + + @Override + protected List getFactories() { + return Arrays.asList(flowActionsToolboxFactories.get(), + morphActionsToolboxFactories.get(), + bpmnCommonActionsToolboxFactories.get()); + } + + @PreDestroy + @Override + public void destroy() { + super.destroy(); + flowActionsToolboxFactories.destroyAll(); + morphActionsToolboxFactories.destroyAll(); + bpmnCommonActionsToolboxFactories.destroyAll(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/diagram/DiagramTypeClientProjectService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/diagram/DiagramTypeClientProjectService.java new file mode 100644 index 00000000000..3a34770965d --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/diagram/DiagramTypeClientProjectService.java @@ -0,0 +1,73 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.diagram; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.event.Observes; +import javax.inject.Inject; + +import org.jboss.errai.common.client.api.Caller; +import org.kie.workbench.common.stunner.bpmn.client.diagram.DiagramTypeClientService; +import org.kie.workbench.common.stunner.bpmn.project.service.BPMNDiagramService; +import org.kie.workbench.common.stunner.bpmn.service.ProjectType; +import org.kie.workbench.common.stunner.core.client.session.event.SessionDestroyedEvent; +import org.kie.workbench.common.stunner.core.diagram.Metadata; + +@ApplicationScoped +public class DiagramTypeClientProjectService implements DiagramTypeClientService { + + private final Caller bpmnDiagramService; + private static final Map projectTypeRegistry = new HashMap<>(); + + DiagramTypeClientProjectService() { + this(null); + } + + @Inject + public DiagramTypeClientProjectService(Caller bpmnDiagramService) { + this.bpmnDiagramService = bpmnDiagramService; + } + + @Override + public void loadDiagramType(Metadata metadata) { + bpmnDiagramService + .call((r) -> setProjectType(metadata, (ProjectType) r)) + .getProjectType(metadata.getRoot()); + } + + void setProjectType(final Metadata metadata, final ProjectType projectType) { + projectTypeRegistry.put(getDiagramId(metadata), projectType); + } + + private String getDiagramId(Metadata metadata) { + return metadata.getCanvasRootUUID(); + } + + @Override + public ProjectType getProjectType(final Metadata metadata) { + return Optional.ofNullable(projectTypeRegistry.get(getDiagramId(metadata))) + .orElse(ProjectType.BPMN); + } + + protected void onSessionClosed(@Observes final SessionDestroyedEvent event) { + projectTypeRegistry.remove(getDiagramId(event.getMetadata())); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessEditorSessionCommands.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessEditorSessionCommands.java index 6c9922daea9..cfc12047b9d 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessEditorSessionCommands.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessEditorSessionCommands.java @@ -16,13 +16,13 @@ package org.kie.workbench.common.stunner.bpmn.project.client.editor; -import org.kie.workbench.common.stunner.bpmn.client.forms.util.ContextUtils; +import org.kie.workbench.common.stunner.bpmn.client.forms.util.BPMNFormsContextUtils; import org.kie.workbench.common.stunner.core.client.session.ClientSession; import org.kie.workbench.common.stunner.core.client.session.command.ManagedClientSessionCommands; import org.kie.workbench.common.stunner.forms.client.session.command.GenerateDiagramFormsSessionCommand; import org.kie.workbench.common.stunner.forms.client.session.command.GenerateProcessFormsSessionCommand; import org.kie.workbench.common.stunner.forms.client.session.command.GenerateSelectedFormsSessionCommand; -import org.kie.workbench.common.stunner.project.client.session.EditorSessionCommands; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; public abstract class AbstractProcessEditorSessionCommands extends EditorSessionCommands { @@ -31,8 +31,8 @@ public AbstractProcessEditorSessionCommands(ManagedClientSessionCommands command } @Override - public void init() { - super.init(); + protected void registerCommands() { + super.registerCommands(); getCommands() .register(GenerateProcessFormsSessionCommand.class) .register(GenerateDiagramFormsSessionCommand.class) @@ -43,19 +43,19 @@ public void init() { public EditorSessionCommands bind(final ClientSession session) { super.bind(session); getGenerateSelectedFormsSessionCommand() - .setElementAcceptor(ContextUtils::isFormGenerationSupported); + .setElementAcceptor(BPMNFormsContextUtils::isFormGenerationSupported); return this; } public GenerateProcessFormsSessionCommand getGenerateProcessFormsSessionCommand() { - return get(16); + return get(GenerateProcessFormsSessionCommand.class); } public GenerateDiagramFormsSessionCommand getGenerateDiagramFormsSessionCommand() { - return get(17); + return get(GenerateDiagramFormsSessionCommand.class); } public GenerateSelectedFormsSessionCommand getGenerateSelectedFormsSessionCommand() { - return get(18); + return get(GenerateSelectedFormsSessionCommand.class); } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessProjectEditorMenuSessionItems.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessProjectEditorMenuSessionItems.java index 0f90b7a1847..f3029348350 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessProjectEditorMenuSessionItems.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessProjectEditorMenuSessionItems.java @@ -31,15 +31,15 @@ import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; import org.kie.workbench.common.stunner.core.client.session.command.AbstractClientSessionCommand; import org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand; -import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditorMenuItemsBuilder; -import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectEditorMenuSessionItems; -import org.kie.workbench.common.stunner.project.client.session.EditorSessionCommands; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuItemsBuilder; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; import org.uberfire.mvp.Command; import org.uberfire.workbench.model.menu.MenuItem; -public abstract class AbstractProcessProjectEditorMenuSessionItems - extends AbstractProjectEditorMenuSessionItems { +public abstract class AbstractProcessProjectEditorMenuSessionItems + extends AbstractDiagramEditorMenuSessionItems { MenuItem formsItem; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNDiagramEditor.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNDiagramEditor.java index 5b101de6579..6636049cc6f 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNDiagramEditor.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNDiagramEditor.java @@ -38,9 +38,9 @@ import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; import org.kie.workbench.common.stunner.core.documentation.DocumentationView; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramLoseFocusEvent; import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditor; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramLoseFocusEvent; import org.kie.workbench.common.stunner.project.client.screens.ProjectMessagesListener; import org.kie.workbench.common.stunner.project.client.service.ClientProjectDiagramService; import org.kie.workbench.common.stunner.project.service.ProjectDiagramResourceService; @@ -50,10 +50,7 @@ import org.uberfire.client.annotations.WorkbenchPartTitle; import org.uberfire.client.annotations.WorkbenchPartTitleDecoration; import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.ext.editor.commons.client.file.popups.SavePopUpPresenter; import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; import org.uberfire.lifecycle.OnClose; import org.uberfire.lifecycle.OnFocus; @@ -63,6 +60,7 @@ import org.uberfire.lifecycle.OnStartup; import org.uberfire.mvp.ParameterizedCommand; import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.events.NotificationEvent; import org.uberfire.workbench.model.menu.Menus; @Dependent @@ -78,41 +76,37 @@ public class BPMNDiagramEditor extends AbstractProjectDiagramEditor changeTitleNotificationEvent, - final SavePopUpPresenter savePopUpPresenter, - final BPMNDiagramResourceType resourceType, - final ClientProjectDiagramService projectDiagramServices, + final TextEditorView xmlEditorView, final ManagedInstance> editorPresenter, final ManagedInstance> viewerPresenter, - final BPMNProjectEditorMenuSessionItems menuSessionItems, final Event onDiagramFocusEvent, final Event onDiagramLostFocusEvent, - final ProjectMessagesListener projectMessagesListener, + final Event notificationEvent, + final ErrorPopupPresenter errorPopupPresenter, final DiagramClientErrorHandler diagramClientErrorHandler, + final @BPMN DocumentationView documentationView, + final BPMNDiagramResourceType resourceType, + final BPMNProjectEditorMenuSessionItems menuSessionItems, + final ProjectMessagesListener projectMessagesListener, final ClientTranslationService translationService, + final ClientProjectDiagramService projectDiagramServices, final Caller projectDiagramResourceServiceCaller, - final IntegrationHandlerProvider integrationHandlerProvider, - final TextEditorView xmlEditorView) { + final IntegrationHandlerProvider integrationHandlerProvider) { super(view, - documentationView, - placeManager, - errorPopupPresenter, - changeTitleNotificationEvent, - savePopUpPresenter, - resourceType, - projectDiagramServices, + xmlEditorView, editorPresenter, viewerPresenter, - menuSessionItems, onDiagramFocusEvent, onDiagramLostFocusEvent, - projectMessagesListener, + notificationEvent, + errorPopupPresenter, diagramClientErrorHandler, + documentationView, + resourceType, + menuSessionItems, + projectMessagesListener, translationService, - xmlEditorView, + projectDiagramServices, projectDiagramResourceServiceCaller); this.integrationHandlerProvider = integrationHandlerProvider; } @@ -131,7 +125,7 @@ public void onStartup(final ObservablePath path, } @Override - protected String getEditorIdentifier() { + public String getEditorIdentifier() { return EDITOR_ID; } @@ -144,7 +138,6 @@ public void onOpen() { @Override public void onClose() { super.doClose(); - super.onClose(); } @OnFocus @@ -201,7 +194,7 @@ protected void onSaveSuccess() { } @Override - protected void onSaveError(ClientRuntimeError error) { + public void onSaveError(ClientRuntimeError error) { super.onSaveError(error); if (isMigrating) { isMigrating = false; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNEditorSessionCommands.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNEditorSessionCommands.java index c629dfe3db2..9f69d14924c 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNEditorSessionCommands.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNEditorSessionCommands.java @@ -17,13 +17,13 @@ package org.kie.workbench.common.stunner.bpmn.project.client.editor; import javax.enterprise.context.Dependent; -import javax.enterprise.inject.Typed; import javax.inject.Inject; +import org.kie.workbench.common.stunner.bpmn.qualifiers.BPMN; import org.kie.workbench.common.stunner.core.client.session.command.ManagedClientSessionCommands; @Dependent -@Typed(BPMNEditorSessionCommands.class) +@BPMN public class BPMNEditorSessionCommands extends AbstractProcessEditorSessionCommands { @Inject diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNProjectDiagramEditorMenuItemsBuilder.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNProjectDiagramEditorMenuItemsBuilder.java index 80ced3350a6..6ad8eb808ed 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNProjectDiagramEditorMenuItemsBuilder.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNProjectDiagramEditorMenuItemsBuilder.java @@ -15,6 +15,8 @@ */ package org.kie.workbench.common.stunner.bpmn.project.client.editor; +import java.util.Optional; + import javax.enterprise.context.Dependent; import javax.enterprise.inject.Typed; import javax.inject.Inject; @@ -22,11 +24,11 @@ import org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil; import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; import org.kie.workbench.common.stunner.core.i18n.CoreTranslationMessages; -import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditorMenuItemsBuilder; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuItemsBuilder; @Dependent @Typed(BPMNProjectDiagramEditorMenuItemsBuilder.class) -public class BPMNProjectDiagramEditorMenuItemsBuilder extends AbstractProjectDiagramEditorMenuItemsBuilder { +public class BPMNProjectDiagramEditorMenuItemsBuilder extends AbstractDiagramEditorMenuItemsBuilder { @SuppressWarnings("unused") public BPMNProjectDiagramEditorMenuItemsBuilder() { @@ -41,7 +43,7 @@ public BPMNProjectDiagramEditorMenuItemsBuilder(final ClientTranslationService t } @Override - protected String getExportAsRawLabel() { - return translationService.getValue(CoreTranslationMessages.EXPORT_BPMN); + protected Optional getExportLabelToRawFormatIfSupported() { + return Optional.of(translationService.getValue(CoreTranslationMessages.EXPORT_BPMN)); } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNProjectEditorMenuSessionItems.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNProjectEditorMenuSessionItems.java index a7874870488..b3211c68f5d 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNProjectEditorMenuSessionItems.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNProjectEditorMenuSessionItems.java @@ -23,6 +23,7 @@ import org.gwtbootstrap3.client.ui.Button; import org.gwtbootstrap3.client.ui.constants.ButtonSize; import org.kie.workbench.common.stunner.bpmn.project.client.resources.BPMNClientConstants; +import org.kie.workbench.common.stunner.bpmn.qualifiers.BPMN; import org.kie.workbench.common.stunner.client.widgets.menu.MenuUtils; import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; import org.uberfire.mvp.Command; @@ -37,7 +38,7 @@ public class BPMNProjectEditorMenuSessionItems extends AbstractProcessProjectEdi @Inject public BPMNProjectEditorMenuSessionItems(final BPMNProjectDiagramEditorMenuItemsBuilder itemsBuilder, - final BPMNEditorSessionCommands sessionCommands) { + final @BPMN BPMNEditorSessionCommands sessionCommands) { super(itemsBuilder, sessionCommands); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/handlers/util/CaseHelper.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/handlers/util/CaseHelper.java index 185eed39904..854599c0ee6 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/handlers/util/CaseHelper.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/handlers/util/CaseHelper.java @@ -25,7 +25,7 @@ import org.guvnor.common.services.project.client.context.WorkspaceProjectContext; import org.guvnor.common.services.project.model.WorkspaceProject; import org.jboss.errai.common.client.api.Caller; -import org.kie.workbench.common.stunner.bpmn.service.BPMNDiagramService; +import org.kie.workbench.common.stunner.bpmn.project.service.BPMNDiagramService; import org.kie.workbench.common.stunner.bpmn.service.ProjectType; @Dependent diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/AssigneeLiveSearchProjectService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/AssigneeLiveSearchProjectService.java new file mode 100644 index 00000000000..c9a064f716e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/AssigneeLiveSearchProjectService.java @@ -0,0 +1,226 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.service; + +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.TreeSet; +import java.util.function.Consumer; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import org.jboss.errai.bus.client.api.messaging.Message; +import org.jboss.errai.common.client.api.ErrorCallback; +import org.jboss.errai.common.client.api.RemoteCallback; +import org.jboss.errai.security.shared.api.Group; +import org.jboss.errai.security.shared.api.identity.User; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.AssigneeLiveSearchService; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.AssigneeLocalSearchService; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.widget.AssigneeLiveSearchEntryCreationEditor; +import org.kie.workbench.common.stunner.bpmn.forms.model.AssigneeType; +import org.uberfire.ext.security.management.api.AbstractEntityManager; +import org.uberfire.ext.security.management.client.ClientUserSystemManager; +import org.uberfire.ext.security.management.impl.SearchRequestImpl; +import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchCallback; +import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchResults; + +import static org.kie.workbench.common.stunner.core.util.StringUtils.isEmpty; + +@Dependent +public class AssigneeLiveSearchProjectService implements AssigneeLiveSearchService { + + private static final Logger LOGGER = Logger.getLogger(AssigneeLiveSearchProjectService.class.getName()); + + private final ClientUserSystemManager userSystemManager; + private final AssigneeLiveSearchEntryCreationEditor editor; + + private AssigneeLocalSearchService localSearchService; + private AssigneeType type = AssigneeType.USER; + private Consumer searchErrorHandler; + + @Inject + public AssigneeLiveSearchProjectService(ClientUserSystemManager userSystemManager, + AssigneeLiveSearchEntryCreationEditor editor) { + this.userSystemManager = userSystemManager; + this.editor = editor; + } + + @PostConstruct + public void postConstruct() { + localSearchService = AssigneeLocalSearchService.build(editor); + } + + public void init(AssigneeType type) { + this.type = type; + } + + public void setSearchErrorHandler(Consumer searchErrorHandler) { + this.searchErrorHandler = searchErrorHandler; + } + + @Override + public void search(String pattern, + int maxResults, + LiveSearchCallback callback) { + + final List filteredCustomEntries = localSearchService.search(pattern); + + RemoteCallback> searchResponseRemoteCallback = response -> processFilterResponse(response, filteredCustomEntries, maxResults, callback); + + ErrorCallback searchErrorCallback = (message, throwable) -> processSearchError(filteredCustomEntries, maxResults, callback, throwable); + + SearchRequestImpl request = new SearchRequestImpl(pattern, 1, maxResults); + + if (AssigneeType.USER.equals(type)) { + userSystemManager.users(searchResponseRemoteCallback, searchErrorCallback).search(request); + } else { + userSystemManager.groups(searchResponseRemoteCallback, searchErrorCallback).search(request); + } + } + + @Override + public void addCustomEntry(final String customEntry) { + localSearchService.addCustomEntry(customEntry); + } + + @Override + public AssigneeLiveSearchEntryCreationEditor getEditor() { + return editor; + } + + @Override + public void searchEntry(String key, + LiveSearchCallback callback) { + + SearchRequestImpl request = new SearchRequestImpl(key, 1, 1); + + ErrorCallback searchErrorCallback = (message, throwable) -> processSearchEntryError(key, callback, throwable); + + RemoteCallback> searchResponseRemoteCallback = response -> searchEntry(key, response, callback); + + if (AssigneeType.USER.equals(type)) { + userSystemManager.users(searchResponseRemoteCallback, searchErrorCallback).search(request); + } else { + userSystemManager.groups(searchResponseRemoteCallback, searchErrorCallback).search(request); + } + } + + @PreDestroy + public void destroy() { + localSearchService.destroy(); + localSearchService = null; + } + + private boolean processSearchEntryError(String key, LiveSearchCallback callback, Throwable throwable) { + LiveSearchResults results = new LiveSearchResults<>(1); + if (!isEmpty(key)) { + addCustomEntry(key); + results.add(key, key); + } + callback.afterSearch(results); + processError("It was not possible to get user or group: " + key + " from the users system.", throwable); + return false; + } + + private boolean processSearchError(List filteredCustomEntries, int maxResults, LiveSearchCallback callback, Throwable throwable) { + int maxSize = maxResults > filteredCustomEntries.size() ? filteredCustomEntries.size() : maxResults; + maxSize = maxSize < 0 ? 0 : maxSize; + LiveSearchResults result = new LiveSearchResults<>(maxSize); + filteredCustomEntries.subList(0, maxSize).forEach(entry -> result.add(entry, entry)); + callback.afterSearch(result); + processError("It was not possible to execute search on the users system.", throwable); + return false; + } + + private void processError(String errorMessage, Throwable throwable) { + LOGGER.log(Level.SEVERE, errorMessage, throwable); + if (searchErrorHandler != null) { + searchErrorHandler.accept(throwable); + } + } + + private void searchEntry(String key, + AbstractEntityManager.SearchResponse response, + LiveSearchCallback liveSearchCallback) { + + LiveSearchResults results = new LiveSearchResults<>(1); + + if (key != null) { + if (!getCustomEntries().contains(key)) { + Optional exists = response.getResults().stream().filter(item -> { + + String value = null; + + if (item instanceof User) { + value = ((User) item).getIdentifier(); + } else if (item instanceof Group) { + value = ((Group) item).getName(); + } + + return key.equals(value); + }).findAny(); + + if (!exists.isPresent()) { + addCustomEntry(key); + } + } + results.add(key, key); + } + + liveSearchCallback.afterSearch(results); + } + + protected void processFilterResponse(AbstractEntityManager.SearchResponse response, + List filteredCustomEntries, + int maxResults, + LiveSearchCallback liveSearchCallback) { + + Set values = new TreeSet<>(filteredCustomEntries); + + response.getResults().forEach(item -> { + String value = null; + + if (item instanceof User) { + value = ((User) item).getIdentifier(); + } else if (item instanceof Group) { + value = ((Group) item).getName(); + } + + if (value != null) { + values.add(value); + } + }); + + if (maxResults > values.size()) { + maxResults = values.size(); + } + + LiveSearchResults results = AssigneeLocalSearchService.createSearchResults(values, maxResults); + + liveSearchCallback.afterSearch(results); + } + + List getCustomEntries() { + return localSearchService.getCustomEntries(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/ConditionEditorAvailableFunctionsProjectService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/ConditionEditorAvailableFunctionsProjectService.java new file mode 100644 index 00000000000..98888128210 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/ConditionEditorAvailableFunctionsProjectService.java @@ -0,0 +1,51 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.service; + +import java.util.List; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import elemental2.promise.Promise; +import org.jboss.errai.common.client.api.Caller; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorAvailableFunctionsService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.FunctionDef; +import org.uberfire.client.promise.Promises; + +@ApplicationScoped +public class ConditionEditorAvailableFunctionsProjectService implements ConditionEditorAvailableFunctionsService { + + private final Promises promises; + private final Caller conditionEditorService; + + @Inject + public ConditionEditorAvailableFunctionsProjectService(final Promises promises, + final Caller conditionEditorService) { + this.promises = promises; + this.conditionEditorService = conditionEditorService; + } + + @Override + public Promise> call(final Input input) { + return promises.promisify(conditionEditorService, + s -> { + s.findAvailableFunctions(input.path, input.clazz); + }); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/ConditionEditorGeneratorProjectService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/ConditionEditorGeneratorProjectService.java new file mode 100644 index 00000000000..ad6d4dfc88a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/ConditionEditorGeneratorProjectService.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.service; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import elemental2.promise.Promise; +import org.jboss.errai.common.client.api.Caller; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorGeneratorService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.Condition; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.GenerateConditionResult; +import org.uberfire.client.promise.Promises; + +@ApplicationScoped +public class ConditionEditorGeneratorProjectService implements ConditionEditorGeneratorService { + + private final Promises promises; + private final Caller conditionEditorService; + + @Inject + public ConditionEditorGeneratorProjectService(final Promises promises, + final Caller conditionEditorService) { + this.promises = promises; + this.conditionEditorService = conditionEditorService; + } + + @Override + public Promise call(final Condition condition) { + return promises.promisify(conditionEditorService, + s -> { + s.generateCondition(condition); + }); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/ConditionEditorMetadataProjectService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/ConditionEditorMetadataProjectService.java new file mode 100644 index 00000000000..6372bfa60c3 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/ConditionEditorMetadataProjectService.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.service; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import elemental2.promise.Promise; +import org.jboss.errai.common.client.api.Caller; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorMetadataService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQuery; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQueryResult; +import org.uberfire.client.promise.Promises; + +@ApplicationScoped +public class ConditionEditorMetadataProjectService implements ConditionEditorMetadataService { + + private final Promises promises; + private final Caller conditionEditorService; + + @Inject + public ConditionEditorMetadataProjectService(final Promises promises, + final Caller conditionEditorService) { + this.promises = promises; + this.conditionEditorService = conditionEditorService; + } + + @Override + public Promise call(final TypeMetadataQuery query) { + return promises.promisify(conditionEditorService, + s -> { + s.findMetadata(query); + }); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/ConditionEditorParsingProjectService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/ConditionEditorParsingProjectService.java new file mode 100644 index 00000000000..74b8b6a434a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/ConditionEditorParsingProjectService.java @@ -0,0 +1,49 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.service; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import elemental2.promise.Promise; +import org.jboss.errai.common.client.api.Caller; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorParsingService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.ParseConditionResult; +import org.uberfire.client.promise.Promises; + +@ApplicationScoped +public class ConditionEditorParsingProjectService implements ConditionEditorParsingService { + + private final Promises promises; + private final Caller conditionEditorService; + + @Inject + public ConditionEditorParsingProjectService(final Promises promises, + final Caller conditionEditorService) { + this.promises = promises; + this.conditionEditorService = conditionEditorService; + } + + @Override + public Promise call(final String conditionStr) { + return promises.promisify(conditionEditorService, + s -> { + s.parseCondition(conditionStr); + }); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/DataTypeNamesProjectService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/DataTypeNamesProjectService.java new file mode 100644 index 00000000000..5ba27c80e28 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/service/DataTypeNamesProjectService.java @@ -0,0 +1,51 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.service; + +import java.util.List; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import elemental2.promise.Promise; +import org.jboss.errai.common.client.api.Caller; +import org.kie.workbench.common.stunner.bpmn.client.forms.DataTypeNamesService; +import org.kie.workbench.common.stunner.bpmn.project.service.DataTypesService; +import org.uberfire.backend.vfs.Path; +import org.uberfire.client.promise.Promises; + +@ApplicationScoped +public class DataTypeNamesProjectService implements DataTypeNamesService { + + private final Promises promises; + private final Caller dataTypesServiceCaller; + + @Inject + public DataTypeNamesProjectService(final Promises promises, + final Caller dataTypesServiceCaller) { + this.promises = promises; + this.dataTypesServiceCaller = dataTypesServiceCaller; + } + + @Override + public Promise> call(final Path path) { + return promises.promisify(dataTypesServiceCaller, + s -> { + s.getDataTypeNames(path); + }); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/workitem/WorkItemDefinitionProjectClientService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/workitem/WorkItemDefinitionProjectClientService.java new file mode 100644 index 00000000000..dce188a57e4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/main/java/org/kie/workbench/common/stunner/bpmn/project/client/workitem/WorkItemDefinitionProjectClientService.java @@ -0,0 +1,165 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.workitem; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.function.Supplier; + +import javax.annotation.PreDestroy; +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.event.Observes; +import javax.enterprise.inject.Default; +import javax.enterprise.inject.Produces; +import javax.inject.Inject; + +import elemental2.promise.Promise; +import org.jboss.errai.common.client.api.Caller; +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.kie.workbench.common.stunner.bpmn.client.workitem.WorkItemDefinitionClientService; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistries; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistry; +import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; +import org.kie.workbench.common.stunner.core.client.api.SessionManager; +import org.kie.workbench.common.stunner.core.client.session.ClientSession; +import org.kie.workbench.common.stunner.core.client.session.event.SessionDestroyedEvent; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.uberfire.client.promise.Promises; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; + +/** + * - It manages the registries relying on the client session lifecycle + * - It produces the @Default WorkItemDefinitionRegistry based on current session + * - It performs calls to server side to populate the current registry + * - It destroy the registry, if any, when a session is being destroyed + */ +@ApplicationScoped +public class WorkItemDefinitionProjectClientService implements WorkItemDefinitionClientService { + + private final Promises promises; + private final Caller service; + private final WorkItemDefinitionRegistries index; + private final SessionManager sessionManager; + private final Supplier registryInstanceSupplier; + private final Consumer errorPresenter; + + @Inject + public WorkItemDefinitionProjectClientService(final Promises promises, + final Caller service, + final SessionManager sessionManager, + final ManagedInstance registryInstances, + final ErrorPopupPresenter errorPopupPresenter) { + this(promises, + service, + sessionManager, + registryInstances::get, + exception -> errorPopupPresenter.showMessage(getExceptionMessage(exception)), + new WorkItemDefinitionRegistries<>(metadata -> metadata.getRoot().toURI(), + new HashMap<>(), + registryInstances::destroy)); + } + + WorkItemDefinitionProjectClientService(final Promises promises, + final Caller service, + final SessionManager sessionManager, + final Supplier registryInstances, + final Consumer errorPresenter, + final WorkItemDefinitionRegistries index) { + this.promises = promises; + this.service = service; + this.sessionManager = sessionManager; + this.registryInstanceSupplier = registryInstances; + this.errorPresenter = errorPresenter; + this.index = index; + } + + @Produces + @Default + @Override + public WorkItemDefinitionRegistry getRegistry() { + return getCurrentSessionRegistry(); + } + + @Override + public Promise> call(final Metadata metadata) { + return promises.promisify(service, + s -> { + return s.execute(metadata); + }) + .then(workItemDefinitions -> { + final WorkItemDefinitionCacheRegistry registry = getRegistryForModule(metadata); + workItemDefinitions.forEach(registry::register); + return promises.resolve(workItemDefinitions); + }) + .catch_((Promise.CatchOnRejectedCallbackFn>) error -> { + errorPresenter.accept((Throwable) error); + return promises.resolve(Collections.emptyList()); + }); + } + + public void removeRegistry(final Metadata metadata) { + Optional.ofNullable(index.remove(metadata)).ifPresent(WorkItemDefinitionCacheRegistry::clear); + } + + @PreDestroy + public void destroy() { + index.clear(); + } + + void onSessionDestroyed(final @Observes SessionDestroyedEvent sessionDestroyedEvent) { + removeRegistry(sessionDestroyedEvent.getMetadata()); + } + + WorkItemDefinitionCacheRegistry getCurrentSessionRegistry() { + return getRegistryForSession(sessionManager.getCurrentSession()); + } + + WorkItemDefinitionCacheRegistry getRegistryForSession(final ClientSession session) { + return getRegistryForModule(session.getCanvasHandler().getDiagram().getMetadata()); + } + + WorkItemDefinitionCacheRegistry getRegistryForModule(final Metadata metadata) { + return obtainRegistry(metadata); + } + + private WorkItemDefinitionCacheRegistry obtainRegistry(final Metadata metadata) { + if (!index.contains(metadata)) { + index.put(metadata, + registryInstanceSupplier.get()); + } + return index.registries().apply(metadata); + } + + @SuppressWarnings("all") + private static String getExceptionMessage(final Throwable throwable) { + Throwable root = throwable; + while (null != root) { + if (null != root.getCause()) { + root = root.getCause(); + } else { + break; + } + } + final String msg = null != root.getMessage() ? root.getMessage() : root.toString(); + return "Cannot load Work Item definitions. Cause: " + msg; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/canvas/controls/BPMNProjectActionsToolboxFactoryTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/canvas/controls/BPMNProjectActionsToolboxFactoryTest.java new file mode 100644 index 00000000000..8f35ff5c73b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/canvas/controls/BPMNProjectActionsToolboxFactoryTest.java @@ -0,0 +1,122 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.canvas.controls; + +import java.util.Collection; +import java.util.Collections; + +import com.google.gwtmockito.GwtMockitoTestRunner; +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.definition.ScriptTask; +import org.kie.workbench.common.stunner.bpmn.definition.UserTask; +import org.kie.workbench.common.stunner.core.client.ManagedInstanceStub; +import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; +import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxFactory; +import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxView; +import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ToolboxAction; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.Bounds; +import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; +import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; +import org.kie.workbench.common.stunner.forms.client.components.toolbox.FormGenerationToolboxAction; +import org.mockito.Mock; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(GwtMockitoTestRunner.class) +public class BPMNProjectActionsToolboxFactoryTest { + + @Mock + private AbstractCanvasHandler canvasHandler; + + @Mock + private ActionsToolboxFactory commonActionToolbox; + + @Mock + private ToolboxAction action1; + + private ManagedInstance generateFormsActions; + + @Mock + private FormGenerationToolboxAction formGenerationToolboxAction; + + private ManagedInstance views; + + @Mock + private ActionsToolboxView view; + + private BPMNProjectActionsToolboxFactory tested; + private Node element; + + @Before + public void init() { + element = new NodeImpl<>("node1"); + when(commonActionToolbox.getActions(eq(canvasHandler), + eq(element))).thenReturn(Collections.singletonList(action1)); + generateFormsActions = spy(new ManagedInstanceStub<>(formGenerationToolboxAction)); + views = spy(new ManagedInstanceStub<>(view)); + tested = new BPMNProjectActionsToolboxFactory(commonActionToolbox, + generateFormsActions, + views); + } + + @Test + public void testNewViewInstance() { + assertEquals(view, tested.newViewInstance()); + } + + @Test + @SuppressWarnings("unchecked") + public void testGetActionsForSupportedNode() { + element.setContent(new ViewImpl<>(new UserTask(), + Bounds.create())); + final Collection> actions = tested.getActions(canvasHandler, + element); + assertEquals(2, actions.size()); + assertTrue(actions.contains(action1)); + assertTrue(actions.contains(formGenerationToolboxAction)); + } + + @Test + @SuppressWarnings("unchecked") + public void testGetActionsForNotSupportedNode() { + element.setContent(new ViewImpl<>(new ScriptTask(), + Bounds.create())); + final Collection> actions = tested.getActions(canvasHandler, + element); + assertEquals(1, actions.size()); + assertTrue(actions.contains(action1)); + assertFalse(actions.contains(formGenerationToolboxAction)); + } + + @Test + public void testDestroy() { + tested.destroy(); + verify(generateFormsActions, times(1)).destroyAll(); + verify(views, times(1)).destroyAll(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/diagram/DiagramTypeClientProjectServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/diagram/DiagramTypeClientProjectServiceTest.java new file mode 100644 index 00000000000..ccb5eeaa58e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/diagram/DiagramTypeClientProjectServiceTest.java @@ -0,0 +1,89 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.diagram; + +import org.jboss.errai.common.client.api.Caller; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.project.service.BPMNDiagramService; +import org.kie.workbench.common.stunner.bpmn.service.ProjectType; +import org.kie.workbench.common.stunner.core.client.session.event.SessionDestroyedEvent; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.uberfire.backend.vfs.Path; +import org.uberfire.mocks.CallerMock; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class DiagramTypeClientProjectServiceTest { + + private static final String ID = "ID"; + private DiagramTypeClientProjectService tested; + + @Mock + private BPMNDiagramService bpmnDiagramService; + + @Mock + private Caller bpmnDiagramServiceCaller; + + @Mock + private Metadata metadata; + + @Mock + private SessionDestroyedEvent sessionDestroyedEvent; + + @Mock + private Path path; + + @Before + public void setUp() throws Exception { + when(sessionDestroyedEvent.getMetadata()).thenReturn(metadata); + when(metadata.getCanvasRootUUID()).thenReturn(ID); + when(metadata.getRoot()).thenReturn(path); + when(bpmnDiagramService.getProjectType(path)).thenReturn(ProjectType.CASE); + + bpmnDiagramServiceCaller = new CallerMock<>(bpmnDiagramService); + tested = new DiagramTypeClientProjectService(bpmnDiagramServiceCaller); + } + + @Test + public void loadDiagramType() { + tested.loadDiagramType(metadata); + final ProjectType projectType = tested.getProjectType(metadata); + assertThat(projectType).isEqualTo(ProjectType.CASE); + } + + @Test + public void getNull() { + ProjectType projectType = tested.getProjectType(metadata); + assertThat(projectType).isEqualTo(ProjectType.BPMN); + } + + @Test + public void onSessionClosed() { + tested.loadDiagramType(metadata); + ProjectType projectType = tested.getProjectType(metadata); + assertThat(projectType).isEqualTo(ProjectType.CASE); + tested.onSessionClosed(sessionDestroyedEvent); + projectType = tested.getProjectType(metadata); + assertThat(projectType).isEqualTo(ProjectType.BPMN); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessEditorSessionCommandsTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessEditorSessionCommandsTest.java index ef3b5b1e457..52d7998026e 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessEditorSessionCommandsTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessEditorSessionCommandsTest.java @@ -43,7 +43,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyInt; +import static org.mockito.Matchers.eq; import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; @@ -79,18 +79,20 @@ public void setUp() throws Exception { final Class commandClass = invocation.getArgumentAt(0, Class.class); if (GenerateProcessFormsSessionCommand.class.isAssignableFrom(commandClass)) { - commandList.add(generateProcessFormsSessionCommand); + commandList.set(0, generateProcessFormsSessionCommand); } else if (GenerateDiagramFormsSessionCommand.class.isAssignableFrom(commandClass)) { - commandList.add(generateDiagramFormsSessionCommand); + commandList.set(1, generateDiagramFormsSessionCommand); } else if (GenerateSelectedFormsSessionCommand.class.isAssignableFrom(commandClass)) { - commandList.add(generateSelectedFormsSessionCommand); + commandList.set(2, generateSelectedFormsSessionCommand); } else { commandList.add(mock(ClientSessionCommand.class)); } return commands; }); - when(commands.get(anyInt())).thenAnswer(invocation -> commandList.get(invocation.getArgumentAt(0, Integer.class))); + when(commands.get(eq(GenerateProcessFormsSessionCommand.class))).thenAnswer(invocation -> commandList.get(0)); + when(commands.get(eq(GenerateDiagramFormsSessionCommand.class))).thenAnswer(invocation -> commandList.get(1)); + when(commands.get(eq(GenerateSelectedFormsSessionCommand.class))).thenAnswer(invocation -> commandList.get(2)); tested.init(); } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessProjectEditorMenuSessionItemsTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessProjectEditorMenuSessionItemsTest.java index 658852fb501..0806b5d4f4e 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessProjectEditorMenuSessionItemsTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/AbstractProcessProjectEditorMenuSessionItemsTest.java @@ -28,7 +28,7 @@ import org.kie.workbench.common.stunner.forms.client.session.command.GenerateDiagramFormsSessionCommand; import org.kie.workbench.common.stunner.forms.client.session.command.GenerateProcessFormsSessionCommand; import org.kie.workbench.common.stunner.forms.client.session.command.GenerateSelectedFormsSessionCommand; -import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditorMenuItemsBuilder; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuItemsBuilder; import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; import org.mockito.Mock; import org.uberfire.mvp.Command; @@ -62,7 +62,7 @@ public class AbstractProcessProjectEditorMenuSessionItemsTest { private GenerateSelectedFormsSessionCommand generateSelectedFormsSessionCommand; @Mock - private AbstractProjectDiagramEditorMenuItemsBuilder itemsBuilder; + private AbstractDiagramEditorMenuItemsBuilder itemsBuilder; @Mock private ClientTranslationService translationService; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNDiagramEditorTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNDiagramEditorTest.java index da7d7fbde5c..015be2232da 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNDiagramEditorTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNDiagramEditorTest.java @@ -19,24 +19,44 @@ import java.util.Optional; import java.util.logging.Level; +import javax.enterprise.event.Event; + import com.google.gwtmockito.GwtMockitoTestRunner; +import org.jboss.errai.ioc.client.api.ManagedInstance; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.kie.workbench.common.stunner.bpmn.integration.client.IntegrationHandler; import org.kie.workbench.common.stunner.bpmn.integration.client.IntegrationHandlerProvider; import org.kie.workbench.common.stunner.bpmn.project.client.type.BPMNDiagramResourceType; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; +import org.kie.workbench.common.stunner.core.client.error.DiagramClientErrorHandler; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; +import org.kie.workbench.common.stunner.core.documentation.DocumentationPage; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditor; +import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditorCore; import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditorTest; -import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectEditorMenuSessionItems; +import org.kie.workbench.common.stunner.project.client.editor.ProjectDiagramEditorProxy; +import org.kie.workbench.common.stunner.project.client.resources.i18n.StunnerProjectClientConstants; +import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; +import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata; +import org.kie.workbench.common.stunner.project.diagram.editor.ProjectDiagramResource; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.uberfire.backend.vfs.ObservablePath; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; +import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; import org.uberfire.mvp.Command; import org.uberfire.mvp.ParameterizedCommand; import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.events.NotificationEvent; +import static org.junit.Assert.assertEquals; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.doReturn; @@ -74,12 +94,10 @@ public void setUp() { super.setUp(); commandCaptor = ArgumentCaptor.forClass(Command.class); when(canvasHandler.getDiagram()).thenReturn(diagram); - - super.setUp(); } @Override - protected AbstractProjectEditorMenuSessionItems getMenuSessionItems() { + protected AbstractDiagramEditorMenuSessionItems getMenuSessionItems() { return bpmnMenuSessionItems; } @@ -96,24 +114,22 @@ protected BPMNDiagramResourceType mockResourceType() { protected AbstractProjectDiagramEditor createDiagramEditor() { when(integrationHandlerProvider.getIntegrationHandler()).thenReturn(Optional.empty()); diagramEditor = spy(new BPMNDiagramEditor(view, - documentationView, - placeManager, - errorPopupPresenter, - changeTitleNotificationEvent, - savePopUpPresenter, - (BPMNDiagramResourceType) getResourceType(), - clientProjectDiagramService, + xmlEditorView, sessionEditorPresenters, sessionViewerPresenters, - bpmnMenuSessionItems, onDiagramFocusEvent, onDiagramLostFocusEvent, - projectMessagesListener, + notificationEvent, + errorPopupPresenter, diagramClientErrorHandler, + documentationView, + (BPMNDiagramResourceType) getResourceType(), + bpmnMenuSessionItems, + projectMessagesListener, translationService, + clientProjectDiagramService, projectDiagramResourceServiceCaller, - integrationHandlerProvider, - xmlEditorView) { + integrationHandlerProvider) { { docks = defaultEditorDock; perspectiveManager = perspectiveManagerMock; @@ -125,7 +141,37 @@ protected AbstractProjectDiagramEditor createDiagramEditor() { place = BPMNDiagramEditorTest.this.currentPlace; kieView = BPMNDiagramEditorTest.this.kieView; overviewWidget = BPMNDiagramEditorTest.this.overviewWidget; - notification = BPMNDiagramEditorTest.this.notification; + notification = BPMNDiagramEditorTest.this.notificationEvent; + placeManager = BPMNDiagramEditorTest.this.placeManager; + changeTitleNotification = BPMNDiagramEditorTest.this.changeTitleNotificationEvent; + savePopUpPresenter = BPMNDiagramEditorTest.this.savePopUpPresenter; + } + + @Override + protected AbstractProjectDiagramEditorCore> makeCore(final AbstractProjectDiagramEditor.View view, + final TextEditorView xmlEditorView, + final Event notificationEvent, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final AbstractDiagramEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService) { + presenterCore = spy(super.makeCore(view, + xmlEditorView, + notificationEvent, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService)); + return presenterCore; + } + + @Override + protected boolean isReadOnly() { + return BPMNDiagramEditorTest.this.isReadOnly; } @Override @@ -137,6 +183,12 @@ protected void log(Level level, return diagramEditor; } + @Override + public void testOpen() { + super.testOpen(); + // TODO (Kogito): verify(presenter).addDocumentationPage(diagram); + } + @Test public void testInitWhenIntegrationIsPresent() { Optional optional = Optional.of(integrationHandler); @@ -175,4 +227,19 @@ private void testMigrate(boolean isDirty) { commandCaptor.getValue().execute(); verify(integrationHandler).migrateFromStunnerToJBPMDesigner(eq(currentPath), eq(currentPlace), eq(isDirty), any(ParameterizedCommand.class)); } + + @Test + @SuppressWarnings("unchecked") + public void testAddDocumentationPage() { + when(documentationView.isEnabled()).thenReturn(Boolean.TRUE); + when(translationService.getValue(StunnerProjectClientConstants.DOCUMENTATION)).thenReturn(DOC_LABEL); + when(documentationView.initialize(diagram)).thenReturn(documentationView); + ArgumentCaptor documentationPageCaptor = ArgumentCaptor.forClass(DocumentationPage.class); + presenter.addDocumentationPage(diagram); + verify(translationService).getValue(StunnerProjectClientConstants.DOCUMENTATION); + verify(kieView).addPage(documentationPageCaptor.capture()); + DocumentationPage documentationPage = documentationPageCaptor.getValue(); + assertEquals(documentationPage.getDocumentationView(), documentationView); + assertEquals(documentationPage.getLabel(), DOC_LABEL); + } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNProjectDiagramEditorMenuItemsBuilderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNProjectDiagramEditorMenuItemsBuilderTest.java index a0799905a46..d9dd99b7cfb 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNProjectDiagramEditorMenuItemsBuilderTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/editor/BPMNProjectDiagramEditorMenuItemsBuilderTest.java @@ -49,6 +49,6 @@ public void setup() { @Test public void testExportAsRawLabel() { assertEquals(CoreTranslationMessages.EXPORT_BPMN, - builder.getExportAsRawLabel()); + builder.getExportLabelToRawFormatIfSupported().get()); } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/handlers/CaseDefinitionNewResourceHandlerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/handlers/CaseDefinitionNewResourceHandlerTest.java index ae20ebcc871..83f993cfc23 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/handlers/CaseDefinitionNewResourceHandlerTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/handlers/CaseDefinitionNewResourceHandlerTest.java @@ -30,7 +30,7 @@ import org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet; import org.kie.workbench.common.stunner.bpmn.project.client.handlers.util.CaseHelper; import org.kie.workbench.common.stunner.bpmn.project.client.type.BPMNDiagramResourceType; -import org.kie.workbench.common.stunner.bpmn.service.BPMNDiagramService; +import org.kie.workbench.common.stunner.bpmn.project.service.BPMNDiagramService; import org.kie.workbench.common.stunner.bpmn.service.ProjectType; import org.kie.workbench.common.stunner.core.api.DefinitionManager; import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/handlers/util/CaseHelperTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/handlers/util/CaseHelperTest.java index a67b1225912..72050bc11da 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/handlers/util/CaseHelperTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/handlers/util/CaseHelperTest.java @@ -25,7 +25,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.bpmn.service.BPMNDiagramService; +import org.kie.workbench.common.stunner.bpmn.project.service.BPMNDiagramService; import org.kie.workbench.common.stunner.bpmn.service.ProjectType; import org.mockito.Mock; import org.uberfire.backend.vfs.Path; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/service/AssigneeLiveSearchProjectServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/service/AssigneeLiveSearchProjectServiceTest.java new file mode 100644 index 00000000000..0170969ae9f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/service/AssigneeLiveSearchProjectServiceTest.java @@ -0,0 +1,479 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.function.Consumer; + +import org.jboss.errai.common.client.api.ErrorCallback; +import org.jboss.errai.common.client.api.RemoteCallback; +import org.jboss.errai.security.shared.api.GroupImpl; +import org.jboss.errai.security.shared.api.identity.UserImpl; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.widget.AssigneeLiveSearchEntryCreationEditor; +import org.kie.workbench.common.stunner.bpmn.forms.model.AssigneeType; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.uberfire.ext.security.management.api.AbstractEntityManager; +import org.uberfire.ext.security.management.api.GroupManager; +import org.uberfire.ext.security.management.api.UserManager; +import org.uberfire.ext.security.management.client.ClientUserSystemManager; +import org.uberfire.ext.security.management.impl.SearchRequestImpl; +import org.uberfire.ext.security.management.impl.SearchResponseImpl; +import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchCallback; +import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchEntry; +import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchResults; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class AssigneeLiveSearchProjectServiceTest { + + @Mock + private UserManager userManager; + + @Mock + private GroupManager groupManager; + + @Mock + private ClientUserSystemManager userSystemManager; + + @Mock + private AssigneeLiveSearchEntryCreationEditor editor; + + @Mock + private LiveSearchCallback callback; + + private AssigneeLiveSearchProjectService assigneeLiveSearchService; + + @Before + public void init() { + when(userSystemManager.users(any(), any())).thenReturn(userManager); + when(userSystemManager.groups(any(), any())).thenReturn(groupManager); + assigneeLiveSearchService = new AssigneeLiveSearchProjectService(userSystemManager, editor); + assigneeLiveSearchService.postConstruct(); + } + + @Test + public void testSearchUsers() { + assigneeLiveSearchService.init(AssigneeType.USER); + + assigneeLiveSearchService.search("admin", 10, callback); + + ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); + + verify(userManager).search(requestArgumentCaptor.capture()); + + SearchRequestImpl request = requestArgumentCaptor.getValue(); + + assertEquals("admin", request.getSearchPattern()); + assertEquals(10, request.getPageSize()); + + ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); + + verify(userSystemManager).users(callbackArgumentCaptor.capture(), any()); + + RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); + + successCallback.callback(prepareUsersResponse()); + + ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); + + verify(callback).afterSearch(resultsArgumentCaptor.capture()); + + LiveSearchResults result = resultsArgumentCaptor.getValue(); + + assertEquals(3, result.size()); + } + + @Test + public void testSearchUsersIncludeCustomEntries() { + assigneeLiveSearchService.init(AssigneeType.USER); + + assigneeLiveSearchService.addCustomEntry("custom_admin"); + + assigneeLiveSearchService.search("admin", 10, callback); + + ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); + + verify(userManager).search(requestArgumentCaptor.capture()); + + SearchRequestImpl request = requestArgumentCaptor.getValue(); + + assertEquals("admin", request.getSearchPattern()); + assertEquals(10, request.getPageSize()); + + ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); + + verify(userSystemManager).users(callbackArgumentCaptor.capture(), any()); + + RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); + + successCallback.callback(prepareUsersResponse()); + + ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); + + verify(callback).afterSearch(resultsArgumentCaptor.capture()); + + LiveSearchResults result = resultsArgumentCaptor.getValue(); + + assertEquals(4, result.size()); + } + + @Test + public void testSearchUsersIncludeCustomEntriesNotMatchSearchPattern() { + assigneeLiveSearchService.init(AssigneeType.USER); + + assigneeLiveSearchService.addCustomEntry("custom_entry"); + + assigneeLiveSearchService.search("admin", 10, callback); + + ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); + + verify(userManager).search(requestArgumentCaptor.capture()); + + SearchRequestImpl request = requestArgumentCaptor.getValue(); + + assertEquals("admin", request.getSearchPattern()); + assertEquals(10, request.getPageSize()); + + ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); + + verify(userSystemManager).users(callbackArgumentCaptor.capture(), any()); + + RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); + + successCallback.callback(prepareUsersResponse()); + + ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); + + verify(callback).afterSearch(resultsArgumentCaptor.capture()); + + LiveSearchResults result = resultsArgumentCaptor.getValue(); + + assertEquals(3, result.size()); + } + + @Test + public void testSearchGroups() { + assigneeLiveSearchService.init(AssigneeType.GROUP); + + assigneeLiveSearchService.search("it", 10, callback); + + ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); + + verify(groupManager).search(requestArgumentCaptor.capture()); + + SearchRequestImpl request = requestArgumentCaptor.getValue(); + + assertEquals("it", request.getSearchPattern()); + assertEquals(10, request.getPageSize()); + + ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); + + verify(userSystemManager).groups(callbackArgumentCaptor.capture(), any()); + + RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); + + successCallback.callback(prepareGroupsResponse()); + + ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); + + verify(callback).afterSearch(resultsArgumentCaptor.capture()); + + LiveSearchResults result = resultsArgumentCaptor.getValue(); + + assertEquals(3, result.size()); + } + + @Test + public void testSearchGroupsIncludeCustomEntries() { + assigneeLiveSearchService.init(AssigneeType.GROUP); + + assigneeLiveSearchService.addCustomEntry("custom_it"); + + assigneeLiveSearchService.search("it", 10, callback); + + ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); + + verify(groupManager).search(requestArgumentCaptor.capture()); + + SearchRequestImpl request = requestArgumentCaptor.getValue(); + + assertEquals("it", request.getSearchPattern()); + assertEquals(10, request.getPageSize()); + + ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); + + verify(userSystemManager).groups(callbackArgumentCaptor.capture(), any()); + + RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); + + successCallback.callback(prepareGroupsResponse()); + + ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); + + verify(callback).afterSearch(resultsArgumentCaptor.capture()); + + LiveSearchResults result = resultsArgumentCaptor.getValue(); + + assertEquals(4, result.size()); + } + + @Test + public void testSearchGroupsIncludeCustomEntriesNotMatchSearchPattern() { + assigneeLiveSearchService.init(AssigneeType.GROUP); + + assigneeLiveSearchService.addCustomEntry("custom_entry"); + + assigneeLiveSearchService.search("it", 10, callback); + + ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); + + verify(groupManager).search(requestArgumentCaptor.capture()); + + SearchRequestImpl request = requestArgumentCaptor.getValue(); + + assertEquals("it", request.getSearchPattern()); + assertEquals(10, request.getPageSize()); + + ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); + + verify(userSystemManager).groups(callbackArgumentCaptor.capture(), any()); + + RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); + + successCallback.callback(prepareGroupsResponse()); + + ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); + + verify(callback).afterSearch(resultsArgumentCaptor.capture()); + + LiveSearchResults result = resultsArgumentCaptor.getValue(); + + assertEquals(3, result.size()); + } + + @Test + public void testSearchSingleUser() { + assigneeLiveSearchService.init(AssigneeType.USER); + + assigneeLiveSearchService.searchEntry("user", callback); + + ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); + + verify(userManager).search(requestArgumentCaptor.capture()); + + SearchRequestImpl request = requestArgumentCaptor.getValue(); + + assertEquals("user", request.getSearchPattern()); + assertEquals(1, request.getPageSize()); + + ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); + + verify(userSystemManager).users(callbackArgumentCaptor.capture(), any()); + + RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); + + successCallback.callback(prepareSingleUserResponse()); + + ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); + + verify(callback).afterSearch(resultsArgumentCaptor.capture()); + + LiveSearchResults> result = resultsArgumentCaptor.getValue(); + + assertEquals(1, result.size()); + assertEquals("user", result.get(0).getValue()); + } + + @Test + public void testSearchSingleGroup() { + assigneeLiveSearchService.init(AssigneeType.GROUP); + + assigneeLiveSearchService.searchEntry("it", callback); + + ArgumentCaptor requestArgumentCaptor = ArgumentCaptor.forClass(SearchRequestImpl.class); + + verify(groupManager).search(requestArgumentCaptor.capture()); + + SearchRequestImpl request = requestArgumentCaptor.getValue(); + + assertEquals("it", request.getSearchPattern()); + assertEquals(1, request.getPageSize()); + + ArgumentCaptor callbackArgumentCaptor = ArgumentCaptor.forClass(RemoteCallback.class); + + verify(userSystemManager).groups(callbackArgumentCaptor.capture(), any()); + + RemoteCallback> successCallback = callbackArgumentCaptor.getValue(); + + successCallback.callback(prepareSingleGroupResponse()); + + ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); + + verify(callback).afterSearch(resultsArgumentCaptor.capture()); + + LiveSearchResults> result = resultsArgumentCaptor.getValue(); + + assertEquals(1, result.size()); + assertEquals("it", result.get(0).getValue()); + } + + @Test + public void testSearchEntryWithErrorUser() { + testSearchEntryWithError(AssigneeType.USER); + } + + @Test + public void testSearchEntryWithErrorGroup() { + testSearchEntryWithError(AssigneeType.GROUP); + } + + @SuppressWarnings("unchecked") + private void testSearchEntryWithError(AssigneeType assigneeType) { + Consumer errorHandler = mock(Consumer.class); + ArgumentCaptor errorCaptor = ArgumentCaptor.forClass(Throwable.class); + ArgumentCaptor errorCallback = ArgumentCaptor.forClass(ErrorCallback.class); + ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); + assigneeLiveSearchService.init(assigneeType); + assigneeLiveSearchService.setSearchErrorHandler(errorHandler); + assigneeLiveSearchService.searchEntry("key", callback); + if (assigneeType == AssigneeType.USER) { + verify(userSystemManager).users(any(), errorCallback.capture()); + verify(userSystemManager, never()).groups(any(), any()); + } else { + verify(userSystemManager).groups(any(), errorCallback.capture()); + verify(userSystemManager, never()).users(any(), any()); + } + Throwable error = new Throwable(); + errorCallback.getValue().error(null, error); + verify(callback).afterSearch(resultsArgumentCaptor.capture()); + verify(errorHandler).accept(errorCaptor.capture()); + assertEquals(error, errorCaptor.getValue()); + LiveSearchResults result = resultsArgumentCaptor.getValue(); + assertEquals(1, result.size()); + assertEquals("key", result.get(0).getValue()); + } + + @Test + @SuppressWarnings("unchecked") + public void testSearchWithErrorNoCustomEntriesUser() { + testSearchWithError(AssigneeType.USER, "pattern", 1234, Collections.EMPTY_LIST, Collections.EMPTY_LIST); + } + + @Test + public void testSearchWithErrorWithCustomEntriesUser() { + testSearchWithError(AssigneeType.USER, "value", 1234, + Arrays.asList("value1", "value2", "other1", "other2"), + Arrays.asList("value1", "value2")); + } + + @Test + @SuppressWarnings("unchecked") + public void testSearchWithErrorNoCustomEntriesGroup() { + testSearchWithError(AssigneeType.GROUP, "pattern", 1234, Collections.EMPTY_LIST, Collections.EMPTY_LIST); + } + + @Test + public void testSearchWithErrorWithCustomEntriesGroup() { + testSearchWithError(AssigneeType.GROUP, "value", 1234, + Arrays.asList("value1", "value2", "other1", "other2"), + Arrays.asList("value1", "value2")); + } + + @SuppressWarnings("unchecked") + private void testSearchWithError(AssigneeType assigneeType, String pattern, int maxResults, List customEntries, List expectedResults) { + Consumer errorHandler = mock(Consumer.class); + ArgumentCaptor errorCaptor = ArgumentCaptor.forClass(Throwable.class); + ArgumentCaptor errorCallback = ArgumentCaptor.forClass(ErrorCallback.class); + ArgumentCaptor resultsArgumentCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); + assigneeLiveSearchService.init(assigneeType); + customEntries.forEach(assigneeLiveSearchService::addCustomEntry); + assigneeLiveSearchService.setSearchErrorHandler(errorHandler); + assigneeLiveSearchService.search(pattern, maxResults, callback); + if (assigneeType == AssigneeType.USER) { + verify(userSystemManager).users(any(), errorCallback.capture()); + verify(userSystemManager, never()).groups(any(), any()); + } else { + verify(userSystemManager).groups(any(), errorCallback.capture()); + verify(userSystemManager, never()).users(any(), any()); + } + Throwable error = new Throwable(); + errorCallback.getValue().error(null, error); + verify(callback).afterSearch(resultsArgumentCaptor.capture()); + verify(errorHandler).accept(errorCaptor.capture()); + assertEquals(error, errorCaptor.getValue()); + + LiveSearchResults result = resultsArgumentCaptor.getValue(); + assertEquals(expectedResults.size(), result.size()); + expectedResults.forEach(expectedValue -> assertTrue(result.stream().anyMatch(entry -> entry.getValue().equals(expectedValue)))); + } + + private AbstractEntityManager.SearchResponse prepareUsersResponse() { + + List result = new ArrayList(); + + result.add(new UserImpl("admin")); + result.add(new UserImpl("user")); + result.add(new UserImpl("developer")); + + return new SearchResponseImpl(result, 1, 1, 1, true); + } + + private AbstractEntityManager.SearchResponse prepareSingleUserResponse() { + + List result = new ArrayList(); + + result.add(new UserImpl("user")); + + return new SearchResponseImpl(result, 1, 1, 1, true); + } + + private AbstractEntityManager.SearchResponse prepareGroupsResponse() { + + List result = new ArrayList(); + + result.add(new GroupImpl("it")); + result.add(new GroupImpl("hr")); + result.add(new GroupImpl("qe")); + + return new SearchResponseImpl(result, 1, 1, 1, true); + } + + private AbstractEntityManager.SearchResponse prepareSingleGroupResponse() { + + List result = new ArrayList(); + + result.add(new GroupImpl("it")); + + return new SearchResponseImpl(result, 1, 1, 1, true); + } +} + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/workitem/WorkItemDefinitionProjectClientRegistryTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/workitem/WorkItemDefinitionProjectClientRegistryTest.java new file mode 100644 index 00000000000..ba0503d3003 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-project-client/src/test/java/org/kie/workbench/common/stunner/bpmn/project/client/workitem/WorkItemDefinitionProjectClientRegistryTest.java @@ -0,0 +1,145 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.bpmn.project.client.workitem; + +import java.util.Collections; +import java.util.function.Consumer; + +import com.google.gwtmockito.GwtMockitoTestRunner; +import org.jboss.errai.common.client.api.Caller; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistries; +import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; +import org.kie.workbench.common.stunner.core.client.api.SessionManager; +import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; +import org.kie.workbench.common.stunner.core.client.session.ClientSession; +import org.kie.workbench.common.stunner.core.client.session.event.SessionDestroyedEvent; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.kogito.client.PromisesMock; +import org.mockito.Mock; +import org.uberfire.client.promise.Promises; +import org.uberfire.mocks.CallerMock; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(GwtMockitoTestRunner.class) +public class WorkItemDefinitionProjectClientRegistryTest { + + private static final WorkItemDefinition WID = new WorkItemDefinition().setName("testWID"); + + @Mock + private WorkItemDefinitionLookupService service; + + @Mock + private WorkItemDefinitionRegistries index; + + @Mock + private SessionManager sessionManager; + + @Mock + private WorkItemDefinitionCacheRegistry registry; + + @Mock + private Consumer errorPresenter; + + @Mock + private Metadata metadata; + + @Mock + private SessionDestroyedEvent sessionDestroyedEvent; + + private WorkItemDefinitionProjectClientService tested; + private Caller serviceCaller; + private Promises promises; + + @Before + @SuppressWarnings("unchecked") + public void init() { + when(index.registries()).thenReturn(m -> metadata.equals(m) ? registry : null); + when(service.execute(eq(metadata))).thenReturn(Collections.singleton(WID)); + when(sessionDestroyedEvent.getMetadata()).thenReturn(metadata); + when(index.remove(metadata)).thenReturn(registry); + serviceCaller = new CallerMock<>(service); + promises = PromisesMock.build(); + tested = new WorkItemDefinitionProjectClientService(promises, + serviceCaller, + sessionManager, + () -> registry, + errorPresenter, + index); + } + + @Test + @SuppressWarnings("unchecked") + public void testCallService() { + tested.call(metadata); + verify(index, times(1)).put(eq(metadata), eq(registry)); + verify(registry, times(1)).register(eq(WID)); + } + + @Test + @SuppressWarnings("unchecked") + public void testGetCurrentSessionRegistry() { + ClientSession session = mock(ClientSession.class); + CanvasHandler canvasHandler = mock(CanvasHandler.class); + Diagram diagram = mock(Diagram.class); + when(session.getCanvasHandler()).thenReturn(canvasHandler); + when(canvasHandler.getDiagram()).thenReturn(diagram); + when(diagram.getMetadata()).thenReturn(metadata); + when(sessionManager.getCurrentSession()).thenReturn(session); + tested.call(metadata); + verify(index, times(1)).put(eq(metadata), eq(registry)); + verify(registry, times(1)).register(eq(WID)); + WorkItemDefinitionCacheRegistry currentSessionRegistry = tested.getCurrentSessionRegistry(); + assertEquals(registry, currentSessionRegistry); + } + + @Test + @SuppressWarnings("unchecked") + public void testDestroy() { + tested.destroy(); + verify(index, times(1)).clear(); + } + + @Test + public void testOnSessionDestroyed() { + tested.onSessionDestroyed(sessionDestroyedEvent); + verify(index).remove(metadata); + verify(registry).clear(); + } + + @Test + public void testOnSessionDestroyedNullRegistry() { + when(index.remove(metadata)).thenReturn(null); + + tested.onSessionDestroyed(sessionDestroyedEvent); + + verify(index).remove(metadata); + verify(registry, never()).clear(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/pom.xml index 59d27b896bc..f6975eb3690 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/pom.xml @@ -33,10 +33,13 @@ kie-wb-common-stunner-bpmn-api kie-wb-common-stunner-bpmn-backend + kie-wb-common-stunner-bpmn-emf + kie-wb-common-stunner-bpmn-marshalling kie-wb-common-stunner-bpmn-client kie-wb-common-stunner-bpmn-project-api kie-wb-common-stunner-bpmn-project-client kie-wb-common-stunner-bpmn-project-backend + kie-wb-common-stunner-bpmn-kogito-runtime \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-api/src/main/java/org/kie/workbench/common/stunner/cm/definition/property/task/ProcessReusableSubprocessTaskExecutionSet.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-api/src/main/java/org/kie/workbench/common/stunner/cm/definition/property/task/ProcessReusableSubprocessTaskExecutionSet.java index 34bd6c6954e..cdcdc78b901 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-api/src/main/java/org/kie/workbench/common/stunner/cm/definition/property/task/ProcessReusableSubprocessTaskExecutionSet.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-api/src/main/java/org/kie/workbench/common/stunner/cm/definition/property/task/ProcessReusableSubprocessTaskExecutionSet.java @@ -68,7 +68,7 @@ public class ProcessReusableSubprocessTaskExecutionSet @Property @SelectorDataProvider( type = SelectorDataProvider.ProviderType.REMOTE, - className = "org.kie.workbench.common.stunner.bpmn.backend.dataproviders.CalledElementFormProvider") + className = "org.kie.workbench.common.stunner.cm.backend.dataproviders.CaseCalledElementFormProvider") @FormField( type = ListBoxFieldType.class ) diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/pom.xml index 02f99b68a33..91b2dc20bc3 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/pom.xml @@ -70,6 +70,15 @@ kie-wb-common-stunner-bpmn-backend + + + org.kie.workbench.stunner + kie-wb-common-stunner-bpmn-project-backend + + org.kie.workbench.stunner kie-wb-common-stunner-forms-api diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/CaseManagementDirectDiagramMarshaller.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/CaseManagementDirectDiagramMarshaller.java index d048c75c151..99f22934086 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/CaseManagementDirectDiagramMarshaller.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/CaseManagementDirectDiagramMarshaller.java @@ -21,7 +21,7 @@ import org.kie.workbench.common.stunner.bpmn.backend.BaseDirectDiagramMarshaller; import org.kie.workbench.common.stunner.bpmn.backend.converters.TypedFactoryManager; import org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.DefinitionResolver; -import org.kie.workbench.common.stunner.bpmn.backend.workitem.service.WorkItemDefinitionBackendService; +import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; import org.kie.workbench.common.stunner.cm.CaseManagementDefinitionSet; import org.kie.workbench.common.stunner.cm.backend.converters.tostunner.CaseManagementConverterFactory; import org.kie.workbench.common.stunner.cm.definition.CaseManagementDiagram; @@ -41,7 +41,7 @@ public class CaseManagementDirectDiagramMarshaller extends BaseDirectDiagramMars public CaseManagementDirectDiagramMarshaller(final XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller, final DefinitionManager definitionManager, final RuleManager ruleManager, - final WorkItemDefinitionBackendService workItemDefinitionService, + final WorkItemDefinitionLookupService workItemDefinitionService, final FactoryManager factoryManager, final GraphCommandFactory commandFactory, final GraphCommandManager commandManager) { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/dataproviders/CaseCalledElementFormDataProvider.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/dataproviders/CaseCalledElementFormDataProvider.java new file mode 100644 index 00000000000..5e17e40d52e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/dataproviders/CaseCalledElementFormDataProvider.java @@ -0,0 +1,53 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.cm.backend.dataproviders; + +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import org.kie.workbench.common.services.refactoring.service.ResourceType; +import org.kie.workbench.common.stunner.bpmn.project.backend.service.ProcessesDataService; +import org.kie.workbench.common.stunner.cm.backend.query.FindCaseManagementIdsQuery; + +@Dependent +public class CaseCalledElementFormDataProvider { + + private final ProcessesDataService dataService; + + @Inject + public CaseCalledElementFormDataProvider(final ProcessesDataService dataService) { + this.dataService = dataService; + } + + @PostConstruct + public void init() { + dataService.setQueryName(() -> FindCaseManagementIdsQuery.NAME); + dataService.setResourceType(() -> ResourceType.BPMN_CM); + } + + public Map getBusinessProcessIDs() { + return toMap(dataService.getBusinessProcessIDs()); + } + + private static Map toMap(final Iterable items) { + return StreamSupport.stream(items.spliterator(), false).collect(Collectors.toMap(s -> s, s -> s)); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/dataproviders/CaseCalledElementFormProvider.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/dataproviders/CaseCalledElementFormProvider.java index 5666c90b467..c0f1ea690a7 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/dataproviders/CaseCalledElementFormProvider.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/dataproviders/CaseCalledElementFormProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,19 +15,29 @@ */ package org.kie.workbench.common.stunner.cm.backend.dataproviders; -import org.kie.workbench.common.services.refactoring.service.ResourceType; -import org.kie.workbench.common.stunner.bpmn.backend.dataproviders.AbstractCalledElementFormProvider; -import org.kie.workbench.common.stunner.cm.backend.query.FindCaseManagementIdsQuery; +import javax.inject.Inject; -public class CaseCalledElementFormProvider extends AbstractCalledElementFormProvider { +import org.kie.workbench.common.forms.dynamic.model.config.SelectorData; +import org.kie.workbench.common.forms.dynamic.model.config.SelectorDataProvider; +import org.kie.workbench.common.forms.dynamic.service.shared.FormRenderingContext; + +public class CaseCalledElementFormProvider implements SelectorDataProvider { + + @Inject + private CaseCalledElementFormDataProvider dataProvider; + + public void setDataProvider(final CaseCalledElementFormDataProvider dataProvider) { + this.dataProvider = dataProvider; + } @Override - protected ResourceType getProcessIdResourceType() { - return ResourceType.BPMN_CM; + public String getProviderName() { + return getClass().getSimpleName(); } @Override - protected String getQueryName() { - return FindCaseManagementIdsQuery.NAME; + @SuppressWarnings("unchecked") + public SelectorData getSelectorData(final FormRenderingContext context) { + return new SelectorData(dataProvider.getBusinessProcessIDs(), null); } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/forms/gen/util/CaseManagementFormGenerationModelProviderHelper.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/forms/gen/util/CaseManagementFormGenerationModelProviderHelper.java index b5a71624fe0..cb84299a44b 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/forms/gen/util/CaseManagementFormGenerationModelProviderHelper.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/forms/gen/util/CaseManagementFormGenerationModelProviderHelper.java @@ -19,7 +19,7 @@ import javax.enterprise.context.Dependent; import javax.inject.Inject; -import org.kie.workbench.common.stunner.bpmn.backend.forms.gen.util.FormGenerationModelProviderHelper; +import org.kie.workbench.common.stunner.bpmn.project.backend.forms.gen.util.FormGenerationModelProviderHelper; import org.kie.workbench.common.stunner.cm.backend.CaseManagementBackendService; @Dependent diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/indexing/CaseManagementDataEventListener.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/indexing/CaseManagementDataEventListener.java index 6ec028d206f..4c795d7c984 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/indexing/CaseManagementDataEventListener.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/indexing/CaseManagementDataEventListener.java @@ -16,7 +16,7 @@ package org.kie.workbench.common.stunner.cm.backend.indexing; import org.kie.workbench.common.services.refactoring.service.ResourceType; -import org.kie.workbench.common.stunner.bpmn.backend.indexing.AbstractBpmnProcessDataEventListener; +import org.kie.workbench.common.stunner.bpmn.project.backend.indexing.AbstractBpmnProcessDataEventListener; public class CaseManagementDataEventListener extends AbstractBpmnProcessDataEventListener { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/indexing/CaseManagementFileIndexer.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/indexing/CaseManagementFileIndexer.java index 64e04703988..e7f3b5a8399 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/indexing/CaseManagementFileIndexer.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/indexing/CaseManagementFileIndexer.java @@ -18,7 +18,7 @@ import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; -import org.kie.workbench.common.stunner.bpmn.backend.indexing.AbstractBpmnFileIndexer; +import org.kie.workbench.common.stunner.bpmn.project.backend.indexing.AbstractBpmnFileIndexer; import org.kie.workbench.common.stunner.cm.qualifiers.CaseManagementEditor; import org.kie.workbench.common.stunner.cm.resource.CaseManagementDefinitionSetResourceType; import org.uberfire.backend.server.util.Paths; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/query/FindCaseManagementIdsQuery.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/query/FindCaseManagementIdsQuery.java index ad2997068f6..e2060795780 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/query/FindCaseManagementIdsQuery.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/main/java/org/kie/workbench/common/stunner/cm/backend/query/FindCaseManagementIdsQuery.java @@ -18,7 +18,7 @@ import javax.enterprise.context.ApplicationScoped; import org.kie.workbench.common.services.refactoring.service.ResourceType; -import org.kie.workbench.common.stunner.bpmn.backend.query.AbstractFindIdsQuery; +import org.kie.workbench.common.stunner.bpmn.project.backend.query.AbstractFindIdsQuery; import org.kie.workbench.common.stunner.cm.qualifiers.CaseManagementEditor; @ApplicationScoped diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/test/java/org/kie/workbench/common/stunner/cm/backend/CaseManagementDirectDiagramMarshallerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/test/java/org/kie/workbench/common/stunner/cm/backend/CaseManagementDirectDiagramMarshallerTest.java index 87a30c25f21..e416d44f94f 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/test/java/org/kie/workbench/common/stunner/cm/backend/CaseManagementDirectDiagramMarshallerTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/test/java/org/kie/workbench/common/stunner/cm/backend/CaseManagementDirectDiagramMarshallerTest.java @@ -24,7 +24,7 @@ import org.junit.runner.RunWith; import org.kie.workbench.common.stunner.bpmn.backend.converters.TypedFactoryManager; import org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.DefinitionResolver; -import org.kie.workbench.common.stunner.bpmn.backend.workitem.service.WorkItemDefinitionBackendService; +import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; import org.kie.workbench.common.stunner.cm.CaseManagementDefinitionSet; import org.kie.workbench.common.stunner.core.api.DefinitionManager; import org.kie.workbench.common.stunner.core.api.FactoryManager; @@ -107,7 +107,7 @@ public void setUp() throws Exception { GraphCommandFactory commandFactory = new GraphCommandFactory(); // The work item definition service. - WorkItemDefinitionBackendService widService = mock(WorkItemDefinitionBackendService.class); + WorkItemDefinitionLookupService widService = mock(WorkItemDefinitionLookupService.class); // The tested CM marshaller. tested = new CaseManagementDirectDiagramMarshaller(new XMLEncoderDiagramMetadataMarshaller(), diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/test/java/org/kie/workbench/common/stunner/cm/backend/dataproviders/CaseCalledElementFormProviderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/test/java/org/kie/workbench/common/stunner/cm/backend/dataproviders/CaseCalledElementFormProviderTest.java deleted file mode 100644 index 8d335685beb..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-backend/src/test/java/org/kie/workbench/common/stunner/cm/backend/dataproviders/CaseCalledElementFormProviderTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.cm.backend.dataproviders; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.forms.dynamic.model.config.SelectorData; -import org.kie.workbench.common.forms.dynamic.service.shared.FormRenderingContext; -import org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueIndexTerm; -import org.kie.workbench.common.services.refactoring.model.query.RefactoringMapPageRow; -import org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow; -import org.kie.workbench.common.services.refactoring.service.RefactoringQueryService; -import org.kie.workbench.common.services.refactoring.service.ResourceType; -import org.kie.workbench.common.stunner.cm.backend.query.FindCaseManagementIdsQuery; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; -import org.uberfire.backend.vfs.Path; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class CaseCalledElementFormProviderTest { - - private static final String ID1 = "P1.Process1"; - private static final String ID2 = "P1.Process2"; - @Mock - FormRenderingContext context; - @Mock - RefactoringQueryService queryService; - @Mock - Path path1; - @Mock - Path path2; - private CaseCalledElementFormProvider tested = new CaseCalledElementFormProvider(); - - @Before - @SuppressWarnings("unchecked") - public void setup() { - tested.setQueryService(queryService); - List results = new ArrayList<>(); - RefactoringMapPageRow refactoringMapPageRow = new RefactoringMapPageRow(); - Map map = new HashMap<>(); - map.put(ID1, path1); - map.put(ID2, path2); - refactoringMapPageRow.setValue(map); - results.add(refactoringMapPageRow); - - when(queryService.query(eq(tested.getQueryName()), - anyObject())).thenAnswer(invocation -> { - Set terms = invocation.getArgumentAt(1, Set.class); - - if (terms.stream().anyMatch(t -> tested.getProcessIdResourceType().toString().equals(t.getTerm()))) { - return results; - } - - return null; - }); - } - - @Test - public void getBusinessProcessIDsTest() { - Map results = tested.getBusinessProcessIDs(); - - assertEquals(results.size(), 2); - assertTrue(results.keySet().contains(ID1)); - assertTrue(results.keySet().contains(ID2)); - assertEquals(results.get(ID1), ID1); - assertEquals(results.get(ID1), ID1); - } - - @Test - public void getSelectorDataTest() { - SelectorData selectorData = tested.getSelectorData(context); - - assertEquals(selectorData.getValues().size(), - 2); - } - - @Test - public void testGetProcessIdResourceType() throws Exception { - assertEquals(tested.getProcessIdResourceType(), ResourceType.BPMN_CM); - } - - @Test - public void testGetQueryName() throws Exception { - assertEquals(tested.getQueryName(), FindCaseManagementIdsQuery.NAME); - } -} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/pom.xml index 2fdc79d1d58..e811a0d6ec3 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/pom.xml @@ -152,11 +152,6 @@ kie-soup-commons - - org.uberfire - uberfire-widgets-properties-editor-api - - org.jboss.errai errai-bus diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/main/java/org/kie/workbench/common/stunner/cm/client/canvas/controls/CaseManagementCommonActionsToolboxFactory.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/main/java/org/kie/workbench/common/stunner/cm/client/canvas/controls/CaseManagementCommonActionsToolboxFactory.java deleted file mode 100644 index 25262861ac6..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/main/java/org/kie/workbench/common/stunner/cm/client/canvas/controls/CaseManagementCommonActionsToolboxFactory.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.cm.client.canvas.controls; - -import java.util.Collection; - -import javax.annotation.PreDestroy; -import javax.enterprise.context.Dependent; -import javax.enterprise.inject.Any; -import javax.inject.Inject; - -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.kie.workbench.common.stunner.bpmn.client.canvas.controls.util.ActionsToolboxHelper; -import org.kie.workbench.common.stunner.cm.qualifiers.CaseManagementEditor; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.AbstractActionsToolboxFactory; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxView; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.CommonActionsToolbox; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ToolboxAction; -import org.kie.workbench.common.stunner.core.graph.Element; -import org.kie.workbench.common.stunner.forms.client.components.toolbox.FormGenerationToolboxAction; - -@Dependent -@CaseManagementEditor -public class CaseManagementCommonActionsToolboxFactory extends AbstractActionsToolboxFactory { - - private final ManagedInstance generateFormsActions; - private final ManagedInstance views; - private final ActionsToolboxHelper actionsToolboxHelper; - - protected CaseManagementCommonActionsToolboxFactory() { - this.generateFormsActions = null; - this.views = null; - this.actionsToolboxHelper = null; - } - - @Inject - public CaseManagementCommonActionsToolboxFactory(final @Any ManagedInstance generateFormsActions, - final @Any @CommonActionsToolbox ManagedInstance views, - final ActionsToolboxHelper actionsToolboxHelper) { - this.generateFormsActions = generateFormsActions; - this.views = views; - this.actionsToolboxHelper = actionsToolboxHelper; - } - - @Override - protected ActionsToolboxView newViewInstance() { - return views.get(); - } - - @PreDestroy - public void destroy() { - generateFormsActions.destroyAll(); - views.destroyAll(); - } - - @Override - public Collection> getActions(AbstractCanvasHandler canvasHandler, Element element) { - return actionsToolboxHelper.getActions(canvasHandler, element); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/main/java/org/kie/workbench/common/stunner/cm/client/canvas/controls/CaseManagementToolboxControl.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/main/java/org/kie/workbench/common/stunner/cm/client/canvas/controls/CaseManagementToolboxControl.java deleted file mode 100644 index 11115a882a8..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/main/java/org/kie/workbench/common/stunner/cm/client/canvas/controls/CaseManagementToolboxControl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.cm.client.canvas.controls; - -import java.util.Arrays; -import java.util.List; - -import javax.annotation.PreDestroy; -import javax.enterprise.context.Dependent; -import javax.enterprise.inject.Any; -import javax.inject.Inject; - -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.kie.workbench.common.stunner.cm.qualifiers.CaseManagementEditor; -import org.kie.workbench.common.stunner.core.client.canvas.controls.toolbox.AbstractToolboxControl; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxFactory; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.FlowActionsToolbox; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.MorphActionsToolbox; - -@Dependent -@CaseManagementEditor -public class CaseManagementToolboxControl extends AbstractToolboxControl { - - private final ManagedInstance flowActionsToolboxFactories; - private final ManagedInstance morphActionsToolboxFactories; - private final ManagedInstance cmCommonActionsToolboxFactories; - - @Inject - public CaseManagementToolboxControl(final @Any @FlowActionsToolbox ManagedInstance flowActionsToolboxFactories, - final @Any @MorphActionsToolbox ManagedInstance morphActionsToolboxFactories, - final @Any @CaseManagementEditor ManagedInstance cmCommonActionsToolboxFactories) { - this.flowActionsToolboxFactories = flowActionsToolboxFactories; - this.morphActionsToolboxFactories = morphActionsToolboxFactories; - this.cmCommonActionsToolboxFactories = cmCommonActionsToolboxFactories; - } - - @Override - protected List getFactories() { - return Arrays.asList(flowActionsToolboxFactories.get(), - morphActionsToolboxFactories.get(), - cmCommonActionsToolboxFactories.get()); - } - - @PreDestroy - @Override - public void destroy() { - super.destroy(); - flowActionsToolboxFactories.destroyAll(); - morphActionsToolboxFactories.destroyAll(); - cmCommonActionsToolboxFactories.destroyAll(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/main/java/org/kie/workbench/common/stunner/cm/client/forms/fields/conditionEditor/CaseManagementVariableSearchService.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/main/java/org/kie/workbench/common/stunner/cm/client/forms/fields/conditionEditor/CaseManagementVariableSearchService.java index 04ad30176a8..ea9640f9f15 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/main/java/org/kie/workbench/common/stunner/cm/client/forms/fields/conditionEditor/CaseManagementVariableSearchService.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/main/java/org/kie/workbench/common/stunner/cm/client/forms/fields/conditionEditor/CaseManagementVariableSearchService.java @@ -19,9 +19,8 @@ import javax.enterprise.inject.Specializes; import javax.inject.Inject; -import org.jboss.errai.common.client.api.Caller; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorMetadataService; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.VariableSearchService; -import org.kie.workbench.common.stunner.bpmn.forms.conditions.ConditionEditorService; import org.kie.workbench.common.stunner.cm.definition.AdHocSubprocess; import org.kie.workbench.common.stunner.cm.definition.CaseManagementDiagram; import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; @@ -36,8 +35,9 @@ public class CaseManagementVariableSearchService extends VariableSearchService { @Inject - public CaseManagementVariableSearchService(Caller service, ClientTranslationService translationService) { - super(service, translationService); + public CaseManagementVariableSearchService(final ConditionEditorMetadataService metadataService, + final ClientTranslationService translationService) { + super(metadataService, translationService); } @Override diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/test/java/org/kie/workbench/common/stunner/cm/client/canvas/controls/CaseManagementCommonActionsToolboxFactoryTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/test/java/org/kie/workbench/common/stunner/cm/client/canvas/controls/CaseManagementCommonActionsToolboxFactoryTest.java deleted file mode 100644 index f6d7d3166db..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/test/java/org/kie/workbench/common/stunner/cm/client/canvas/controls/CaseManagementCommonActionsToolboxFactoryTest.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.cm.client.canvas.controls; - -import java.util.Collection; -import java.util.Collections; - -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.stunner.bpmn.client.canvas.controls.util.ActionsToolboxHelper; -import org.kie.workbench.common.stunner.bpmn.definition.ScriptTask; -import org.kie.workbench.common.stunner.bpmn.definition.UserTask; -import org.kie.workbench.common.stunner.core.client.ManagedInstanceStub; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxFactory; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ActionsToolboxView; -import org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ToolboxAction; -import org.kie.workbench.common.stunner.core.graph.Node; -import org.kie.workbench.common.stunner.core.graph.content.Bounds; -import org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl; -import org.kie.workbench.common.stunner.core.graph.impl.NodeImpl; -import org.kie.workbench.common.stunner.forms.client.components.toolbox.FormGenerationToolboxAction; -import org.mockito.Mock; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class CaseManagementCommonActionsToolboxFactoryTest { - - @Mock - private AbstractCanvasHandler canvasHandler; - - @Mock - private ActionsToolboxFactory commonActionToolbox; - - @Mock - private ToolboxAction action1; - - private ManagedInstance generateFormsActions; - - @Mock - private FormGenerationToolboxAction formGenerationToolboxAction; - - private ManagedInstance views; - - @Mock - private ActionsToolboxView view; - - private CaseManagementCommonActionsToolboxFactory tested; - - private Node element; - - private ActionsToolboxHelper actionsToolboxHelper; - - @Before - public void setUp() throws Exception { - element = new NodeImpl<>("node1"); - when(commonActionToolbox.getActions(eq(canvasHandler), eq(element))).thenReturn(Collections.singletonList(action1)); - generateFormsActions = spy(new ManagedInstanceStub<>(formGenerationToolboxAction)); - views = spy(new ManagedInstanceStub<>(view)); - actionsToolboxHelper = new ActionsToolboxHelper(commonActionToolbox, generateFormsActions); - tested = new CaseManagementCommonActionsToolboxFactory(generateFormsActions, views, actionsToolboxHelper); - } - - @Test - @SuppressWarnings("unchecked") - public void testGetActionsForSupportedNode() { - element.setContent(new ViewImpl<>(new UserTask(), Bounds.create())); - final Collection> actions = tested.getActions(canvasHandler, element); - assertEquals(2, actions.size()); - assertTrue(actions.contains(action1)); - assertTrue(actions.contains(formGenerationToolboxAction)); - } - - @Test - @SuppressWarnings("unchecked") - public void testGetActionsForNotSupportedNode() { - element.setContent(new ViewImpl<>(new ScriptTask(), Bounds.create())); - final Collection> actions = tested.getActions(canvasHandler, element); - assertEquals(1, actions.size()); - assertTrue(actions.contains(action1)); - assertFalse(actions.contains(formGenerationToolboxAction)); - } - - @Test - public void testDestroy() { - tested.destroy(); - verify(generateFormsActions, times(1)).destroyAll(); - verify(views, times(1)).destroyAll(); - } -} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/test/java/org/kie/workbench/common/stunner/cm/client/forms/fields/conditionEditor/CaseManagementVariableSearchServiceTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/test/java/org/kie/workbench/common/stunner/cm/client/forms/fields/conditionEditor/CaseManagementVariableSearchServiceTest.java index 6b9ae949f49..91a1d60dee7 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/test/java/org/kie/workbench/common/stunner/cm/client/forms/fields/conditionEditor/CaseManagementVariableSearchServiceTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/test/java/org/kie/workbench/common/stunner/cm/client/forms/fields/conditionEditor/CaseManagementVariableSearchServiceTest.java @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.List; +import org.junit.Ignore; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.VariableSearchService; import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.VariableSearchServiceTest; import org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables; @@ -32,11 +33,12 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +@Ignore("Needs Kogito backend") public class CaseManagementVariableSearchServiceTest extends VariableSearchServiceTest { @Override protected VariableSearchService newSearchService() { - return new CaseManagementVariableSearchService(editorServiceCaller, translationService); + return new CaseManagementVariableSearchService(metadataService, translationService); } protected List mockNodes() { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-api/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-api/pom.xml index b5d1a0c20fd..57a04dcb680 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-api/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-api/pom.xml @@ -68,6 +68,11 @@ kie-wb-common-stunner-case-mgmt-api + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-api + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/pom.xml index 82a7de6e668..34cf69e8f95 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/pom.xml @@ -112,12 +112,12 @@ org.kie.workbench.stunner - kie-wb-common-stunner-bpmn-project-client + kie-wb-common-stunner-bpmn-client org.kie.workbench.stunner - kie-wb-common-stunner-bpmn-client + kie-wb-common-stunner-bpmn-project-client @@ -145,6 +145,11 @@ kie-wb-common-stunner-forms-client + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client + + @@ -176,12 +181,6 @@ uberfire-project-api - - org.uberfire - uberfire-widgets-properties-editor-api - provided - - org.uberfire uberfire-workbench-client diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/main/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementDiagramEditor.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/main/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementDiagramEditor.java index 18332e7fd1c..877dd5f1b33 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/main/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementDiagramEditor.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/main/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementDiagramEditor.java @@ -17,9 +17,9 @@ package org.kie.workbench.common.stunner.cm.project.client.editor; import java.util.Optional; +import java.util.OptionalInt; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Consumer; -import java.util.logging.Logger; import javax.enterprise.context.Dependent; import javax.enterprise.event.Event; @@ -42,15 +42,14 @@ import org.kie.workbench.common.stunner.core.client.annotation.DiagramEditor; import org.kie.workbench.common.stunner.core.client.error.DiagramClientErrorHandler; import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; -import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; import org.kie.workbench.common.stunner.core.client.session.ClientSession; import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; import org.kie.workbench.common.stunner.core.diagram.Diagram; import org.kie.workbench.common.stunner.core.documentation.DocumentationView; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramLoseFocusEvent; import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditor; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent; -import org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramLoseFocusEvent; import org.kie.workbench.common.stunner.project.client.screens.ProjectMessagesListener; import org.kie.workbench.common.stunner.project.client.service.ClientProjectDiagramService; import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; @@ -61,10 +60,7 @@ import org.uberfire.client.annotations.WorkbenchPartTitle; import org.uberfire.client.annotations.WorkbenchPartTitleDecoration; import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.ext.editor.commons.client.file.popups.SavePopUpPresenter; import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; import org.uberfire.lifecycle.OnClose; import org.uberfire.lifecycle.OnFocus; @@ -73,6 +69,7 @@ import org.uberfire.lifecycle.OnOpen; import org.uberfire.lifecycle.OnStartup; import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.events.NotificationEvent; import org.uberfire.workbench.model.menu.Menus; @Dependent @@ -80,58 +77,51 @@ @WorkbenchEditor(identifier = CaseManagementDiagramEditor.EDITOR_ID, supportedTypes = {CaseManagementDiagramResourceType.class}) public class CaseManagementDiagramEditor extends AbstractProjectDiagramEditor { - private static final Logger LOGGER = Logger.getLogger(CaseManagementDiagramEditor.class.getName()); - public static final String EDITOR_ID = "CaseManagementDiagramEditor"; - private Caller caseManagementSwitchViewService; - + private final Caller caseManagementSwitchViewService; + private final SwitchViewControl switchViewControl; private AtomicBoolean switchedToProcess; - - private SwitchViewControl switchViewControl; + private OptionalInt switchSessionHash; @Inject - public CaseManagementDiagramEditor(final View view, - final DocumentationView documentationView, - final PlaceManager placeManager, - final ErrorPopupPresenter errorPopupPresenter, - final Event changeTitleNotificationEvent, - final SavePopUpPresenter savePopUpPresenter, - final CaseManagementDiagramResourceType resourceType, - final ClientProjectDiagramService projectDiagramServices, + public CaseManagementDiagramEditor(final AbstractProjectDiagramEditor.View view, + final TextEditorView xmlEditorView, final ManagedInstance> editorSessionPresenterInstances, final ManagedInstance> viewerSessionPresenterInstances, - final CaseManagementProjectEditorMenuSessionItems menuSessionItems, final Event onDiagramFocusEvent, final Event onDiagramLostFocusEvent, - final ProjectMessagesListener projectMessagesListener, + final Event notificationEvent, + final ErrorPopupPresenter errorPopupPresenter, final DiagramClientErrorHandler diagramClientErrorHandler, + final DocumentationView documentationView, + final CaseManagementDiagramResourceType resourceType, + final CaseManagementProjectEditorMenuSessionItems menuSessionItems, + final ProjectMessagesListener projectMessagesListener, final ClientTranslationService translationService, - final TextEditorView xmlEditorView, + final ClientProjectDiagramService projectDiagramServices, final Caller projectDiagramResourceServiceCaller, final Caller caseManagementSwitchViewService) { super(view, - documentationView, - placeManager, - errorPopupPresenter, - changeTitleNotificationEvent, - savePopUpPresenter, - resourceType, - projectDiagramServices, + xmlEditorView, editorSessionPresenterInstances, viewerSessionPresenterInstances, - menuSessionItems, onDiagramFocusEvent, onDiagramLostFocusEvent, - projectMessagesListener, + notificationEvent, + errorPopupPresenter, diagramClientErrorHandler, + documentationView, + resourceType, + menuSessionItems, + projectMessagesListener, translationService, - xmlEditorView, + projectDiagramServices, projectDiagramResourceServiceCaller); - this.caseManagementSwitchViewService = caseManagementSwitchViewService; this.switchedToProcess = new AtomicBoolean(); this.switchViewControl = initSwitchViewControl(); + this.switchSessionHash = OptionalInt.empty(); } private SwitchViewControl initSwitchViewControl() { @@ -163,8 +153,7 @@ private SwitchViewControl initSwitchViewControl() { @Override public void init() { super.init(); - - this.addTabBarWidget(switchViewControl); + addTabBarWidget(switchViewControl); } private void updateSessionEditorPresenter(final String defSetId, final String shapeSetId) { @@ -183,7 +172,7 @@ public void onStartup(final ObservablePath path, } @Override - protected String getEditorIdentifier() { + public String getEditorIdentifier() { return CaseManagementDiagramEditor.EDITOR_ID; } @@ -196,7 +185,6 @@ public void onOpen() { @Override public void onClose() { super.doClose(); - super.onClose(); } @OnFocus @@ -235,7 +223,7 @@ public boolean onMayClose() { } @Override - protected SessionEditorPresenter newSessionEditorPresenter() { + public SessionEditorPresenter newSessionEditorPresenter() { return (SessionEditorPresenter) super.newSessionEditorPresenter() .displayNotifications(type -> false); } @@ -248,35 +236,17 @@ protected void loadContent() { } void reopenSession(final ProjectDiagram diagram) { - final Integer originalHash = this.originalHash; - final boolean unsaved = this.hasUnsavedChanges(); - - this.getMenuSessionItems().getCommands().getCommands().clearCommands(); - this.destroySession(); - - this.open(diagram, Optional.of(new SessionPresenter.SessionPresenterCallback() { - @Override - public void afterSessionOpened() { - - } - - @Override - public void afterCanvasInitialized() { - - } - - @Override - public void onSuccess() { - if (unsaved) { - CaseManagementDiagramEditor.this.setOriginalHash(originalHash); - } - } - - @Override - public void onError(ClientRuntimeError error) { + switchSessionHash = hasUnsavedChanges() ? OptionalInt.of(originalHash) : OptionalInt.empty(); + getMenuSessionItems().getCommands().getCommands().clearCommands(); + destroySession(); + open(diagram); + } - } - })); + @Override + public void initialiseKieEditorForSession(ProjectDiagram diagram) { + super.initialiseKieEditorForSession(diagram); + switchSessionHash.ifPresent(CaseManagementDiagramEditor.this::setOriginalHash); + switchSessionHash = OptionalInt.empty(); } protected void onSwitch(final Diagram diagram, final String defSetId, final String shapeDefId) { diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/main/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementProjectDiagramEditorMenuItemsBuilder.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/main/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementProjectDiagramEditorMenuItemsBuilder.java index 1cb81c0333d..e1bcf647e82 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/main/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementProjectDiagramEditorMenuItemsBuilder.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/main/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementProjectDiagramEditorMenuItemsBuilder.java @@ -15,6 +15,8 @@ */ package org.kie.workbench.common.stunner.cm.project.client.editor; +import java.util.Optional; + import javax.enterprise.context.Dependent; import javax.enterprise.inject.Typed; import javax.inject.Inject; @@ -22,11 +24,11 @@ import org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil; import org.kie.workbench.common.stunner.cm.project.client.resources.i18n.CaseManagementProjectClientConstants; import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; -import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditorMenuItemsBuilder; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuItemsBuilder; @Dependent @Typed(CaseManagementProjectDiagramEditorMenuItemsBuilder.class) -public class CaseManagementProjectDiagramEditorMenuItemsBuilder extends AbstractProjectDiagramEditorMenuItemsBuilder { +public class CaseManagementProjectDiagramEditorMenuItemsBuilder extends AbstractDiagramEditorMenuItemsBuilder { @SuppressWarnings("unused") public CaseManagementProjectDiagramEditorMenuItemsBuilder() { @@ -41,7 +43,7 @@ public CaseManagementProjectDiagramEditorMenuItemsBuilder(final ClientTranslatio } @Override - protected String getExportAsRawLabel() { - return translationService.getValue(CaseManagementProjectClientConstants.CaseManagementDiagramResourceTypeDownload); + protected Optional getExportLabelToRawFormatIfSupported() { + return Optional.of(translationService.getValue(CaseManagementProjectClientConstants.CaseManagementDiagramResourceTypeDownload)); } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/test/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementDiagramEditorTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/test/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementDiagramEditorTest.java index 01801e089f9..02d3c979979 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/test/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementDiagramEditorTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/test/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementDiagramEditorTest.java @@ -30,10 +30,9 @@ import org.kie.workbench.common.stunner.cm.project.service.CaseManagementSwitchViewService; import org.kie.workbench.common.stunner.core.client.session.command.ManagedClientSessionCommands; import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditor; import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditorTest; -import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectEditorMenuSessionItems; -import org.kie.workbench.common.stunner.project.client.session.EditorSessionCommands; import org.kie.workbench.common.stunner.project.diagram.ProjectDiagram; import org.mockito.Mock; import org.uberfire.mvp.PlaceRequest; @@ -94,22 +93,20 @@ public void setUp() { @Override protected AbstractProjectDiagramEditor createDiagramEditor() { tested = spy(new CaseManagementDiagramEditor(view, - documentationView, - placeManager, - errorPopupPresenter, - changeTitleNotificationEvent, - savePopUpPresenter, - (CaseManagementDiagramResourceType) getResourceType(), - clientProjectDiagramService, + xmlEditorView, sessionEditorPresenters, sessionViewerPresenters, - cmMenuSessionItems, onDiagramFocusEvent, onDiagramLostFocusEvent, - projectMessagesListener, + notificationEvent, + errorPopupPresenter, diagramClientErrorHandler, + documentationView, + (CaseManagementDiagramResourceType) getResourceType(), + cmMenuSessionItems, + projectMessagesListener, translationService, - xmlEditorView, + clientProjectDiagramService, projectDiagramResourceServiceCaller, caseManagementSwitchViewServiceCaller) { { @@ -124,7 +121,7 @@ protected AbstractProjectDiagramEditor createDiagramEditor() { place = CaseManagementDiagramEditorTest.this.currentPlace; kieView = CaseManagementDiagramEditorTest.this.kieView; overviewWidget = CaseManagementDiagramEditorTest.this.overviewWidget; - notification = CaseManagementDiagramEditorTest.this.notification; + notification = CaseManagementDiagramEditorTest.this.notificationEvent; } } }); @@ -136,7 +133,7 @@ protected AbstractProjectDiagramEditor createDiagramEditor() { } @Override - protected AbstractProjectEditorMenuSessionItems getMenuSessionItems() { + protected CaseManagementProjectEditorMenuSessionItems getMenuSessionItems() { return cmMenuSessionItems; } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/test/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementProjectDiagramEditorMenuItemsBuilderTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/test/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementProjectDiagramEditorMenuItemsBuilderTest.java index b417655fe3f..ed67a04de72 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/test/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementProjectDiagramEditorMenuItemsBuilderTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/test/java/org/kie/workbench/common/stunner/cm/project/client/editor/CaseManagementProjectDiagramEditorMenuItemsBuilderTest.java @@ -49,6 +49,6 @@ public void setup() { @Test public void testExportAsRawLabel() { assertEquals(CaseManagementProjectClientConstants.CaseManagementDiagramResourceTypeDownload, - builder.getExportAsRawLabel()); + builder.getExportLabelToRawFormatIfSupported().get()); } } diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/test/java/org/kie/workbench/common/stunner/cm/project/client/handlers/CaseManagementDiagramNewResourceHandlerTest.java b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/test/java/org/kie/workbench/common/stunner/cm/project/client/handlers/CaseManagementDiagramNewResourceHandlerTest.java index e51343fe325..6578f53e743 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/test/java/org/kie/workbench/common/stunner/cm/project/client/handlers/CaseManagementDiagramNewResourceHandlerTest.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-project-client/src/test/java/org/kie/workbench/common/stunner/cm/project/client/handlers/CaseManagementDiagramNewResourceHandlerTest.java @@ -28,7 +28,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.kie.workbench.common.stunner.bpmn.project.client.handlers.util.CaseHelper; -import org.kie.workbench.common.stunner.bpmn.service.BPMNDiagramService; +import org.kie.workbench.common.stunner.bpmn.project.service.BPMNDiagramService; import org.kie.workbench.common.stunner.bpmn.service.ProjectType; import org.kie.workbench.common.stunner.cm.CaseManagementDefinitionSet; import org.kie.workbench.common.stunner.cm.project.client.editor.CaseManagementDiagramEditor; diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-project/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-project/pom.xml index 207a336c224..960dede9853 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-project/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-project/pom.xml @@ -26,7 +26,6 @@ 7.29.0-SNAPSHOT - kie-wb-common-stunner-showcase-project war @@ -218,6 +217,15 @@ org.uberfire uberfire-widgets-properties-editor-api + + org.uberfire + uberfire-widgets-properties-editor-backend + + + org.uberfire + uberfire-widgets-properties-editor-client + provided + org.uberfire uberfire-widgets-service-api @@ -732,11 +740,6 @@ provided - - org.kie.workbench.forms - kie-wb-common-forms-data-modeller-integration-backend - - org.kie.workbench.stunner @@ -756,7 +759,12 @@ org.kie.workbench.stunner - kie-wb-common-stunner-jbpm-designer-integration-shared + kie-wb-common-stunner-kogito-api + + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client provided @@ -765,6 +773,12 @@ kie-wb-common-stunner-jbpm-designer-integration-api + + org.kie.workbench.stunner + kie-wb-common-stunner-jbpm-designer-integration-shared + provided + + org.kie.workbench.stunner kie-wb-common-stunner-jbpm-designer-integration-backend @@ -909,6 +923,16 @@ kie-wb-common-forms-backend-services + + org.kie.workbench.forms + kie-wb-common-forms-data-modeller-integration-api + + + + org.kie.workbench.forms + kie-wb-common-forms-data-modeller-integration-backend + + org.kie.workbench.forms kie-wb-common-forms-jbpm-integration-api @@ -1259,10 +1283,9 @@ gwt-maven-plugin ${project.build.directory}/gwt-symbols-deploy - -Xmx6G -Xms1024m -Xss1M -XX:CompileThreshold=7000 -Derrai.jboss.home=${errai.jboss.home} -Derrai.marshalling.server.classOutput=${project.build.outputDirectory} -Derrai.dynamic_validation.enabled=true + -Xmx16G -Xms2G -Xss1M -XX:CompileThreshold=7000 -Derrai.jboss.home=${errai.jboss.home} -Derrai.marshalling.server.classOutput=${project.build.outputDirectory} -Derrai.dynamic_validation.enabled=true org.kie.workbench.common.stunner.project.StunnerProjectShowcase false - false org.jboss.errai.cdi.server.gwt.EmbeddedWildFlyLauncher true stunner.html @@ -1356,12 +1379,6 @@ org.uberfire:uberfire-widgets-properties-editor-client org.uberfire:uberfire-simple-docks-client - - org.uberfire:uberfire-wires-core-api - org.uberfire:uberfire-wires-core-client - org.uberfire:uberfire-wires-core-trees - org.uberfire:uberfire-wires-core-grids - org.kie.soup:kie-soup-commons @@ -1435,6 +1452,9 @@ org.kie.workbench.stunner:kie-wb-common-stunner-forms-client org.kie.workbench.stunner:kie-wb-common-stunner-project-api org.kie.workbench.stunner:kie-wb-common-stunner-project-client + org.kie.workbench.stunner:kie-wb-common-stunner-kogito-api + org.kie.workbench.stunner:kie-wb-common-stunner-kogito-client + org.kie.workbench:kie-wb-common-kogito-client org.kie.workbench.stunner:kie-wb-common-stunner-case-mgmt-api org.kie.workbench.stunner:kie-wb-common-stunner-case-mgmt-client diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-project/src/main/resources/org/kie/workbench/common/stunner/project/StunnerProjectShowcase.gwt.xml b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-project/src/main/resources/org/kie/workbench/common/stunner/project/StunnerProjectShowcase.gwt.xml index 6cf7f07d432..6c3841ced1b 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-project/src/main/resources/org/kie/workbench/common/stunner/project/StunnerProjectShowcase.gwt.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-project/src/main/resources/org/kie/workbench/common/stunner/project/StunnerProjectShowcase.gwt.xml @@ -52,6 +52,7 @@ + @@ -74,7 +75,6 @@ - diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/pom.xml b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/pom.xml index 28b9f5815e1..29435ba5aaf 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/pom.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/pom.xml @@ -37,97 +37,6 @@ - - org.jboss.xnio - xnio-api - - - - org.uberfire - uberfire-widgets-service-backend - - - - org.uberfire - uberfire-backend-api - - - - org.uberfire - uberfire-api - - - org.uberfire - uberfire-commons - - - org.kie.soup - kie-soup-commons - - - org.uberfire - uberfire-io - - - - - org.uberfire - uberfire-metadata-api - - - - org.uberfire - uberfire-metadata-backend-lucene - - - jakarta-regexp - jakarta-regexp - - - - - - org.uberfire - uberfire-metadata-backend-elasticsearch - - - jakarta-regexp - jakarta-regexp - - - - - - org.uberfire - uberfire-metadata-backend-infinispan - - - jakarta-regexp - jakarta-regexp - - - - - - org.uberfire - uberfire-metadata-commons-io - - - - org.apache.lucene - lucene-core - - - - org.uberfire - uberfire-preferences-backend - - - - org.uberfire - uberfire-preferences-ui-client - - org.slf4j @@ -150,287 +59,47 @@ log4j-over-slf4j - - - org.uberfire - uberfire-all - - - log4j - log4j - - - - - - org.uberfire - uberfire-backend-server - - - - org.uberfire - uberfire-backend-cdi - - - - org.uberfire - uberfire-security-api - - - - org.uberfire - uberfire-security-client - provided - - - - org.uberfire - uberfire-servlet-security - - - - org.uberfire - uberfire-client - provided - - - - org.uberfire - uberfire-js - provided - - - - org.uberfire - uberfire-workbench-client-backend - provided - - - - org.uberfire - uberfire-workbench-client - provided - - - - org.uberfire - uberfire-simple-docks-client - provided - - - - org.uberfire - uberfire-client-backend - provided - - - - org.uberfire - uberfire-workbench-processors - provided - - - - org.uberfire - uberfire-nio2-model - - - - org.uberfire - uberfire-client-api - - - - org.uberfire - uberfire-services-api - - - - org.uberfire - uberfire-workingset-api - - - - org.uberfire - uberfire-workingset-client - - - - org.uberfire - uberfire-project-api - - - - org.uberfire - uberfire-project-client - - - - org.uberfire - uberfire-structure-api - + + - org.uberfire - uberfire-structure-client + com.google.inject + guice - - - org.uberfire - uberfire-workbench-client-views-patternfly - provided - - - - org.uberfire - uberfire-widgets-properties-editor-api - - - - org.uberfire - uberfire-widgets-properties-editor-backend - - - - org.uberfire - uberfire-widgets-properties-editor-client - provided - - - - org.uberfire - uberfire-widgets-commons - provided - - - - org.uberfire - uberfire-widgets-table - provided - - - - - org.uberfire - uberfire-ssh-api - - - org.uberfire - uberfire-ssh-backend - - - org.uberfire - uberfire-ssh-client - provided - - - - - - org.uberfire - uberfire-security-management-api - - - - org.uberfire - uberfire-security-management-backend - - - - org.uberfire - uberfire-security-management-wildfly - - - - org.uberfire - uberfire-security-management-client - provided - - - - org.uberfire - uberfire-widgets-security-management - provided - - - - org.uberfire - uberfire-security-management-client-wb - provided - - - - - org.uberfire - uberfire-experimental-api - - - - org.uberfire - uberfire-experimental-backend - - - - org.uberfire - uberfire-experimental-client - provided - - - org.jboss.errai errai-ioc - org.jboss.errai errai-common - org.jboss.errai errai-bus - org.jboss.errai errai-ui provided - org.jboss.errai errai-data-binding provided - org.jboss.errai errai-marshalling - org.jboss.errai errai-security-server - - - org.jboss.errai - errai-security-client - provided - - - - org.jboss.errai - errai-navigation - provided - - org.jboss.errai errai-cdi-server - org.jboss.errai errai-cdi-client @@ -440,36 +109,20 @@ org.jboss.errai errai-cdi-shared - - - org.jboss.errai - errai-jaxrs-client - provided - - org.jboss.errai errai-cdi-jboss provided - - - ant - ant - - - org.jboss.errai errai-jboss-as-support - org.jboss.errai errai-codegen-gwt provided - org.jboss.errai errai-validation @@ -481,113 +134,98 @@ encoder - - - - org.kie.workbench.services - kie-wb-common-refactoring-backend - - - + org.kie.workbench.stunner kie-wb-common-stunner-core-api - org.kie.workbench.stunner kie-wb-common-stunner-client-api - org.kie.workbench.stunner kie-wb-common-stunner-backend-api - org.kie.workbench.stunner kie-wb-common-stunner-core-common - - - org.kie.workbench.stunner - kie-wb-common-stunner-backend-common - - org.kie.workbench.stunner kie-wb-common-stunner-processors provided - org.kie.workbench.stunner kie-wb-common-stunner-backend - org.kie.workbench.stunner kie-wb-common-stunner-client-common + + + org.powermock + powermock-api-mockito + + + org.powermock + powermock-module-junit4 + + provided - org.kie.workbench.stunner kie-wb-common-stunner-lienzo provided - org.kie.workbench.stunner kie-wb-common-stunner-shapes-api - org.kie.workbench.stunner kie-wb-common-stunner-shapes-client provided - org.kie.workbench.stunner kie-wb-common-stunner-lienzo-extensions provided - org.kie.workbench.stunner kie-wb-common-stunner-svg-client provided - org.kie.workbench.stunner kie-wb-common-stunner-svg-gen provided - org.kie.workbench.stunner kie-wb-common-stunner-widgets provided - + + org.kie.workbench.stunner + kie-wb-common-stunner-forms-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-forms-client + provided + org.kie.workbench.stunner kie-wb-common-stunner-bpmn-api - org.kie.workbench.stunner kie-wb-common-stunner-bpmn-backend - - - org.kie.workbench.stunner - kie-wb-common-stunner-forms-backend - - - org.kie.workbench.stunner kie-wb-common-stunner-bpmn-client @@ -595,286 +233,418 @@ - org.kie.workbench.stunner - kie-wb-common-stunner-case-mgmt-api + org.jbpm + jbpm-bpmn2 + + - org.kie.workbench.stunner - kie-wb-common-stunner-case-mgmt-backend + org.uberfire + uberfire-preferences-api - - org.kie.workbench.stunner - kie-wb-common-stunner-case-mgmt-client - provided + org.uberfire + uberfire-preferences-backend - - org.kie.workbench.stunner - kie-wb-common-stunner-forms-api + org.uberfire + uberfire-preferences-client - - org.kie.workbench.stunner - kie-wb-common-stunner-forms-client + org.uberfire + uberfire-preferences-client-backend provided + + org.uberfire + uberfire-widgets-service-api + + + org.uberfire + uberfire-widgets-service-backend + - - + org.kie lienzo-core provided - com.ahome-it ahome-tooling-nativetools provided - com.ahome-it ahome-tooling-common provided - + + org.kie.workbench.forms kie-wb-common-forms-crud-component provided - org.kie.workbench.forms kie-wb-common-forms-api - org.kie.workbench.forms kie-wb-common-forms-fields - org.kie.workbench.forms kie-wb-common-forms-processing-engine provided - org.kie.workbench.forms kie-wb-common-forms-adf-base - org.kie.workbench.forms kie-wb-common-forms-adf-engine-api - org.kie.workbench.forms kie-wb-common-forms-adf-engine-backend - org.kie.workbench.forms kie-wb-common-forms-adf-engine-client provided - org.kie.workbench.forms kie-wb-common-dynamic-forms-api - org.kie.workbench.forms kie-wb-common-dynamic-forms-backend + + + org.kie.workbench.services + kie-wb-common-datamodel-backend + + - org.kie.workbench.forms kie-wb-common-dynamic-forms-client - provided - org.kie.workbench.forms kie-wb-common-forms-backend-services - org.kie.workbench.forms kie-wb-common-forms-common-rendering-shared - org.kie.workbench.forms kie-wb-common-forms-common-rendering-client provided + javax.validation validation-api - javax.validation validation-api sources - org.hibernate hibernate-validator - org.hibernate hibernate-validator sources + + - org.kie.workbench.services - kie-wb-common-datamodel-api + org.uberfire + uberfire-layout-editor-api + + + org.uberfire + uberfire-layout-editor-client + provided + + + org.uberfire + uberfire-layout-editor-backend + + - org.kie.soup - kie-soup-project-datamodel-api + org.uberfire + uberfire-runtime-plugins-api + + + org.uberfire + uberfire-runtime-plugins-backend + + + org.uberfire + uberfire-runtime-plugins-client + provided + + - org.kie.soup - kie-soup-project-datamodel-commons + org.uberfire + uberfire-widgets-properties-editor-api + + + org.uberfire + uberfire-widgets-properties-editor-client + provided + + + + + + org.uberfire + uberfire-js + provided + + + + + + org.uberfire + uberfire-commons-editor-api + + + org.uberfire + uberfire-commons-editor-client + provided - + - org.drools - drools-cdi + org.uberfire + uberfire-all - org.drools - drools-compiler + log4j + log4j - - - org.drools - drools-workbench-models-datamodel-api + org.uberfire + uberfire-api - org.kie.workbench.services - kie-wb-common-data-modeller-core + org.uberfire + uberfire-backend-api org.uberfire - uberfire-widgets-service-api + uberfire-backend-server - - org.jbpm - jbpm-bpmn2 + org.uberfire + uberfire-services-api - - - org.uberfire - uberfire-runtime-plugins-api + uberfire-client + provided - org.uberfire - uberfire-runtime-plugins-backend + uberfire-client-api - org.uberfire - uberfire-runtime-plugins-client + uberfire-client-backend provided - - - org.uberfire - uberfire-commons-editor-api + uberfire-workbench-client + provided - org.uberfire - uberfire-commons-editor-client + uberfire-workbench-client-backend provided - org.uberfire - uberfire-commons-editor-backend + uberfire-security-api - - - org.uberfire - uberfire-layout-editor-api + uberfire-security-client + provided + + + org.uberfire + uberfire-simple-docks-client + provided + + + org.uberfire + uberfire-workbench-processors + provided + + + org.uberfire + uberfire-workbench-client-views-patternfly + provided + + + com.google.elemental2 + elemental2-promise + + + org.uberfire - uberfire-layout-editor-client + uberfire-widgets-core-client provided - + + + org.uberfire + uberfire-io + + + org.uberfire + uberfire-nio2-model + + + + + org.uberfire + uberfire-ssh-api + org.uberfire - uberfire-apps-api + uberfire-ssh-backend + + + + org.uberfire + uberfire-experimental-api + + + org.uberfire + uberfire-experimental-backend + org.uberfire - uberfire-apps-client + uberfire-experimental-client provided + + + org.kie.soup + kie-soup-commons + + + org.uberfire - uberfire-apps-backend + uberfire-commons + + + org.apache.activemq + artemis-jms-client + + + org.jboss.spec.javax.jms + jboss-jms-api_2.0_spec + + + + + org.uberfire + uberfire-widgets-commons + provided + - javax.enterprise - cdi-api + org.uberfire + uberfire-widgets-table provided + + org.kie.workbench.widgets + kie-wb-common-ui + + + org.uberfire + uberfire-servlet-security + + + + + org.uberfire - uberfire-preferences-api + uberfire-project-api + + + org.uberfire + uberfire-project-client + + + org.kie.workbench.services + kie-wb-common-datamodel-api + org.uberfire - uberfire-preferences-client + uberfire-structure-api org.uberfire - uberfire-preferences-client-backend + uberfire-structure-backend + + + org.uberfire + uberfire-servlet-security + + - + + + org.uberfire + uberfire-preferences-ui-client + provided + + com.google.gwt gwt-user @@ -886,18 +656,48 @@ - org.gwtbootstrap3 gwtbootstrap3 provided - org.gwtbootstrap3 gwtbootstrap3-extras provided + + com.google.elemental2 + elemental2-dom + + + + + org.kie.workbench + kie-wb-common-kogito-client + provided + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-api + + + org.kie.workbench.stunner + kie-wb-common-stunner-kogito-client + provided + + + + + com.google.gwt.gwtmockito + gwtmockito + test + + + org.uberfire + uberfire-testing-utils + test + @@ -907,14 +707,6 @@ - - org.apache.maven.plugins - maven-enforcer-plugin - - true - - - org.codehaus.mojo gwt-maven-plugin @@ -930,18 +722,15 @@ false org.jboss.errai.cdi.server.gwt.EmbeddedWildFlyLauncher true - stunner.html + index.html src/main/webapp false - org.kie.soup:kie-soup-project-datamodel-api - org.kie.soup:kie-soup-project-datamodel-commons - org.kie.soup:kie-soup-commons - + org.uberfire:uberfire-commons org.uberfire:uberfire-nio2-model org.uberfire:uberfire-io @@ -954,32 +743,25 @@ org.uberfire:uberfire-workbench-client-backend org.uberfire:uberfire-workbench-client-views-patternfly org.uberfire:uberfire-simple-docks-client - org.uberfire:uberfire-preferences-api - org.uberfire:uberfire-preferences-client - org.uberfire:uberfire-preferences-client-backend org.uberfire:uberfire-backend-api - org.uberfire:uberfire-structure-api - org.uberfire:uberfire-structure-client org.uberfire:uberfire-project-api org.uberfire:uberfire-project-client org.uberfire:uberfire-services-api - org.uberfire:uberfire-workingset-api - org.uberfire:uberfire-workingset-client + org.uberfire:uberfire-structure-api + org.uberfire:uberfire-message-console-api + org.uberfire:uberfire-message-console-client + + org.jboss.errai:errai-data-binding + org.kie.workbench.widgets:kie-wb-common-ui + org.kie.workbench.profile:kie-wb-common-profile-api org.kie.workbench.services:kie-wb-common-datamodel-api - org.kie.workbench.services:kie-wb-common-data-modeller-core - - org.uberfire:uberfire-ssh-api - org.uberfire:uberfire-ssh-client + org.kie.workbench.services:kie-wb-common-services-api + org.kie.workbench:kie-wb-common-kogito-client - org.uberfire:uberfire-preferences-api - org.uberfire:uberfire-preferences-client - org.uberfire:uberfire-preferences-ui-client org.uberfire:uberfire-runtime-plugins-api org.uberfire:uberfire-runtime-plugins-client - org.uberfire:uberfire-apps-api - org.uberfire:uberfire-apps-client org.uberfire:uberfire-commons-editor-api org.uberfire:uberfire-commons-editor-client org.uberfire:uberfire-widgets-commons @@ -989,11 +771,11 @@ org.uberfire:uberfire-widgets-service-api org.uberfire:uberfire-widgets-core-client - - org.uberfire:uberfire-security-management-api - org.uberfire:uberfire-security-management-client - org.uberfire:uberfire-security-management-client-wb - org.uberfire:uberfire-widgets-security-management + + org.uberfire:uberfire-preferences-api + org.uberfire:uberfire-preferences-client + org.uberfire:uberfire-preferences-ui-client + org.uberfire:uberfire-preferences-client-backend org.uberfire:uberfire-experimental-api @@ -1026,10 +808,10 @@ org.kie.workbench.stunner:kie-wb-common-stunner-widgets org.kie.workbench.stunner:kie-wb-common-stunner-bpmn-api org.kie.workbench.stunner:kie-wb-common-stunner-bpmn-client - org.kie.workbench.stunner:kie-wb-common-stunner-case-mgmt-api - org.kie.workbench.stunner:kie-wb-common-stunner-case-mgmt-client org.kie.workbench.stunner:kie-wb-common-stunner-forms-api org.kie.workbench.stunner:kie-wb-common-stunner-forms-client + org.kie.workbench.stunner:kie-wb-common-stunner-kogito-api + org.kie.workbench.stunner:kie-wb-common-stunner-kogito-client org.uberfire:appformer-js-bridge diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/ApplicationScopedProducer.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/ApplicationScopedProducer.java index b6b30442545..392f2d68c6f 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/ApplicationScopedProducer.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/ApplicationScopedProducer.java @@ -20,12 +20,10 @@ import javax.enterprise.context.ApplicationScoped; import javax.enterprise.context.RequestScoped; import javax.enterprise.inject.Produces; -import javax.inject.Inject; import javax.inject.Named; import org.jboss.errai.security.shared.api.identity.User; -import org.jboss.errai.security.shared.service.AuthenticationService; -import org.uberfire.backend.server.IOWatchServiceAllImpl; +import org.jboss.errai.security.shared.api.identity.UserImpl; import org.uberfire.commons.services.cdi.Startup; import org.uberfire.commons.services.cdi.StartupType; import org.uberfire.io.IOService; @@ -35,18 +33,11 @@ @ApplicationScoped public class ApplicationScopedProducer { - @Inject - private AuthenticationService authenticationService; - - @Inject - private IOWatchServiceAllImpl watchService; - private IOService ioService; @PostConstruct public void setup() { - ioService = new IOServiceNio2WrapperImpl("1", - watchService); + ioService = new IOServiceNio2WrapperImpl("bpmn"); } @Produces @@ -57,8 +48,7 @@ public IOService ioService() { @Produces @RequestScoped - public User getIdentity() { - return authenticationService.getUser(); + public User user() { + return new UserImpl("admin"); } } - diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/CORSFilter.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/CORSFilter.java new file mode 100644 index 00000000000..c8bb6a2f8f6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/CORSFilter.java @@ -0,0 +1,86 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.backend; + +import java.io.IOException; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.annotation.WebFilter; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Servlet Filter implementation class CORSFilter + */ +// Enable it for Servlet 3.x implementations +@WebFilter(asyncSupported = true, urlPatterns = {"/*"}) +public class CORSFilter implements Filter { + + /** + * Default constructor. + */ + public CORSFilter() { + } + + /** + * @see Filter#destroy() + */ + public void destroy() { + } + + /** + * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain) + */ + public void doFilter(final ServletRequest servletRequest, + final ServletResponse servletResponse, + final FilterChain chain) throws IOException, ServletException { + + final HttpServletRequest request = (HttpServletRequest) servletRequest; + + // Authorize (allow) all domains to consume the content + final HttpServletResponse r = (HttpServletResponse) servletResponse; + String origin = request.getHeader("origin"); + r.addHeader("Access-Control-Allow-Origin", origin); + r.addHeader("Access-Control-Allow-Headers", + "Accept,Accept-Encoding,Accept-Language,Cache-Control,Connection,Content-Length,Content-Type," + + "Cookie,Host,Pragma,Referer,RemoteQueueID,User-Agent"); + r.addHeader("Access-Control-Allow-Credentials", "true"); + r.addHeader("Access-Control-Allow-Methods", "GET, OPTIONS, HEAD, PUT, POST"); + + final HttpServletResponse resp = (HttpServletResponse) servletResponse; + + // For HTTP OPTIONS verb/method reply with ACCEPTED status code -- per CORS handshake + if (request.getMethod().equals("OPTIONS")) { + resp.setStatus(HttpServletResponse.SC_ACCEPTED); + return; + } + + // pass the request along the filter chain + chain.doFilter(request, servletResponse); + } + + /** + * @see Filter#init(FilterConfig) + */ + public void init(final FilterConfig fConfig) throws ServletException { + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/DefaultLuceneConfigProducer.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/DefaultLuceneConfigProducer.java deleted file mode 100644 index 5a1e84d3c6d..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/DefaultLuceneConfigProducer.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.backend; - -import java.util.Map; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Produces; -import javax.inject.Named; - -import org.apache.lucene.analysis.Analyzer; -import org.kie.soup.commons.util.Maps; -import org.kie.workbench.common.services.refactoring.backend.server.indexing.ImpactAnalysisAnalyzerWrapperFactory; -import org.kie.workbench.common.services.refactoring.backend.server.indexing.LowerCaseOnlyAnalyzer; -import org.kie.workbench.common.services.refactoring.model.index.terms.ModuleNameIndexTerm; -import org.kie.workbench.common.services.refactoring.model.index.terms.ModuleRootPathIndexTerm; -import org.kie.workbench.common.services.refactoring.model.index.terms.PackageNameIndexTerm; -import org.uberfire.ext.metadata.MetadataConfig; -import org.uberfire.ext.metadata.backend.lucene.analyzer.FilenameAnalyzer; -import org.uberfire.ext.metadata.io.MetadataConfigBuilder; - -/** - * This class contains the default Lucene configuration, and can be - * replaced by using CDI alternatives. - */ -@ApplicationScoped -public class DefaultLuceneConfigProducer { - - private MetadataConfig config; - - @PostConstruct - public void setup() { - final Map analyzers = getAnalyzers(); - this.config = new MetadataConfigBuilder().withInMemoryMetaModelStore() - .usingAnalyzers(analyzers) - .usingAnalyzerWrapperFactory(ImpactAnalysisAnalyzerWrapperFactory.getInstance()) - .useDirectoryBasedIndex() - .useNIODirectory() - .build(); - } - - @Produces - @Named("luceneConfig") - public MetadataConfig configProducer() { - return this.config; - } - - private Map getAnalyzers() { - return new Maps.Builder() - .put(ModuleRootPathIndexTerm.TERM, - new FilenameAnalyzer()) - .put(ModuleNameIndexTerm.TERM, - new LowerCaseOnlyAnalyzer()) - .put(PackageNameIndexTerm.TERM, - new LowerCaseOnlyAnalyzer()) - .build(); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/DummyAuthenticationService.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/DummyAuthenticationService.java new file mode 100644 index 00000000000..b574442b011 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/DummyAuthenticationService.java @@ -0,0 +1,46 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.backend; + +import javax.enterprise.context.Dependent; + +import org.jboss.errai.security.shared.api.identity.User; +import org.jboss.errai.security.shared.api.identity.UserImpl; +import org.jboss.errai.security.shared.service.AuthenticationService; + +@Dependent +public class DummyAuthenticationService implements AuthenticationService { + + @Override + public void logout() { + } + + @Override + public User login(String username, String password) { + return new UserImpl("admin"); + } + + @Override + public boolean isLoggedIn() { + return true; + } + + @Override + public User getUser() { + return new UserImpl("admin"); + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/FormGenerationMockService.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/FormGenerationMockService.java deleted file mode 100644 index f284dca2f90..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/FormGenerationMockService.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.backend; - -import javax.enterprise.context.ApplicationScoped; - -import org.jboss.errai.bus.server.annotations.Service; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.kie.workbench.common.stunner.forms.service.FormGenerationService; - -@ApplicationScoped -@Service -public class FormGenerationMockService implements FormGenerationService { - - @Override - public void generateProcessForm(Diagram diagram) { - - } - - @Override - public void generateAllForms(Diagram diagram) { - - } - - @Override - public void generateSelectedForms(Diagram diagram, String[] ids) { - - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/WorkItemDefinitionShowcaseResources.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/WorkItemDefinitionShowcaseResources.java deleted file mode 100644 index a7b0b7b7d62..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/WorkItemDefinitionShowcaseResources.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.backend; - -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Specializes; -import javax.inject.Inject; -import javax.inject.Named; - -import org.kie.workbench.common.stunner.backend.service.BackendFileSystemBootstrap; -import org.kie.workbench.common.stunner.bpmn.backend.workitem.WorkItemDefinitionResources; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.uberfire.io.IOService; -import org.uberfire.java.nio.file.Path; - -import static org.uberfire.backend.server.util.Paths.convert; - -/** - * Work Item Definition resources specialization class for the standalone showcase. - * It provides different global roots for work item defintions rather than the defaults. - */ -@ApplicationScoped -@Specializes -public class WorkItemDefinitionShowcaseResources extends WorkItemDefinitionResources { - - private final BackendFileSystemBootstrap backendFileSystemManager; - - // CDI proxy. - protected WorkItemDefinitionShowcaseResources() { - this(null, null); - } - - @Inject - public WorkItemDefinitionShowcaseResources(final @Named("ioStrategy") IOService ioService, - final BackendFileSystemBootstrap backendFileSystemManager) { - super(ioService); - this.backendFileSystemManager = backendFileSystemManager; - } - - @Override - public Path resolveResourcePath(final Metadata metadata) { - if (null != metadata.getPath()) { - return super.resolveResourcePath(metadata); - } - return backendFileSystemManager.getRootPath(); - } - - @Override - public Path resolveGlobalPath(final Metadata metadata) { - if (null != metadata.getRoot()) { - return super.resolveGlobalPath(metadata); - } - return resolveGlobalPathByRoot(convert(backendFileSystemManager.getRootPath())); - } - - @Override - public Path resolveResourcesPath(final Metadata metadata) { - return resolveGlobalPath(metadata); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/services/BPMNStandaloneDiagramServiceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/services/BPMNStandaloneDiagramServiceImpl.java new file mode 100644 index 00000000000..f3efff07068 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/services/BPMNStandaloneDiagramServiceImpl.java @@ -0,0 +1,165 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.backend.services; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.Objects; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import org.jboss.errai.bus.server.annotations.Service; +import org.kie.workbench.common.stunner.bpmn.backend.BPMNBackendService; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram; +import org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl; +import org.kie.workbench.common.stunner.bpmn.factory.BPMNDiagramFactory; +import org.kie.workbench.common.stunner.core.api.DefinitionManager; +import org.kie.workbench.common.stunner.core.api.FactoryManager; +import org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils; +import org.kie.workbench.common.stunner.core.definition.service.DefinitionSetService; +import org.kie.workbench.common.stunner.core.definition.service.DiagramMarshaller; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.DiagramImpl; +import org.kie.workbench.common.stunner.core.diagram.DiagramParsingException; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.diagram.MetadataImpl; +import org.kie.workbench.common.stunner.core.graph.Graph; +import org.kie.workbench.common.stunner.core.graph.Node; +import org.kie.workbench.common.stunner.core.graph.content.definition.Definition; +import org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet; +import org.kie.workbench.common.stunner.core.graph.util.GraphUtils; +import org.kie.workbench.common.stunner.kogito.api.service.KogitoDiagramService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.uberfire.backend.vfs.PathFactory; +import org.uberfire.commons.uuid.UUID; + +@Service +@ApplicationScoped +public class BPMNStandaloneDiagramServiceImpl implements KogitoDiagramService { + + private static final Logger LOG = LoggerFactory.getLogger(BPMNStandaloneDiagramServiceImpl.class); + + private static final String DIAGRAMS_PATH = "diagrams"; + + //This path is needed by DiagramsNavigatorImpl's use of AbstractClientDiagramService.lookup(..) to retrieve a list of diagrams + private static final String ROOT = "default://master@system/stunner/" + DIAGRAMS_PATH; + + private DefinitionManager definitionManager; + private FactoryManager factoryManager; + private BPMNBackendService backendService; + private BPMNDiagramFactory diagramFactory; + + protected BPMNStandaloneDiagramServiceImpl() { + // CDI proxy. + this(null, + null, + null, + null); + } + + @Inject + public BPMNStandaloneDiagramServiceImpl(final DefinitionManager definitionManager, + final FactoryManager factoryManager, + final BPMNBackendService backendService, + final BPMNDiagramFactory diagramFactory) { + this.definitionManager = definitionManager; + this.factoryManager = factoryManager; + this.backendService = backendService; + this.diagramFactory = diagramFactory; + } + + @Override + public Diagram transform(final String xml) { + if (Objects.isNull(xml) || xml.isEmpty()) { + return doNewDiagram(); + } + return doTransformation(xml); + } + + private Diagram doNewDiagram() { + final String title = UUID.uuid(); + final String defSetId = getDefinitionSetId(backendService); + final Metadata metadata = buildMetadataInstance(defSetId); + metadata.setTitle(title); + + try { + return factoryManager.newDiagram(title, + defSetId, + metadata); + } catch (final Exception e) { + LOG.error("Cannot create new diagram", e); + throw new RuntimeException(e); + } + } + + @SuppressWarnings("unchecked") + private Diagram doTransformation(final String xml) { + final String defSetId = getDefinitionSetId(backendService); + final Metadata metadata = buildMetadataInstance(defSetId); + final InputStream is = new ByteArrayInputStream(xml.getBytes()); + + try { + final DiagramMarshaller marshaller = backendService.getDiagramMarshaller(); + final Graph graph = marshaller.unmarshall(metadata, is); + final Node, ?> diagramNode = GraphUtils.getFirstNode((Graph) graph, BPMNDiagramImpl.class); + if (null == diagramNode) { + throw new RuntimeException("No BPMN Diagram can be found."); + } + final String title = diagramNode.getContent().getDefinition().getDiagramSet().getName().getValue(); + metadata.setTitle(title); + + return diagramFactory.build(title, + metadata, + graph); + } catch (Exception e) { + LOG.error("Error whilst converting XML to BPMN Diagram.", e); + throw new DiagramParsingException(metadata, xml); + } + } + + @Override + @SuppressWarnings("unchecked") + public String transform(final Diagram diagram) { + try { + final DiagramMarshaller marshaller = backendService.getDiagramMarshaller(); + return marshaller.marshall(convert(diagram)); + } catch (Exception e) { + LOG.error("Error whilst converting BPMN Diagram to XML.", e); + throw new RuntimeException(e); + } + } + + private String getDefinitionSetId(final DefinitionSetService services) { + final Class type = services.getResourceType().getDefinitionSetType(); + return BindableAdapterUtils.getDefinitionSetId(type); + } + + private Metadata buildMetadataInstance(final String defSetId) { + return new MetadataImpl.MetadataImplBuilder(defSetId, + definitionManager) + .setRoot(PathFactory.newPath(".", ROOT)) + .build(); + } + + private DiagramImpl convert(final Diagram diagram) { + return new DiagramImpl(diagram.getName(), + diagram.getGraph(), + diagram.getMetadata()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/services/WorkItemDefinitionStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/services/WorkItemDefinitionStandaloneService.java new file mode 100644 index 00000000000..766e74e766f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/backend/services/WorkItemDefinitionStandaloneService.java @@ -0,0 +1,67 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.backend.services; + +import java.util.Collection; + +import javax.annotation.PreDestroy; +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.inject.Default; +import javax.enterprise.inject.Produces; +import javax.inject.Inject; + +import org.jboss.errai.bus.server.annotations.Service; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistry; +import org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService; +import org.kie.workbench.common.stunner.core.diagram.Metadata; + +@ApplicationScoped +@Service +public class WorkItemDefinitionStandaloneService + implements WorkItemDefinitionLookupService { + + private final WorkItemDefinitionCacheRegistry registry; + + // CDI proxy. + @SuppressWarnings("all") + protected WorkItemDefinitionStandaloneService() { + this(null); + } + + @Inject + public WorkItemDefinitionStandaloneService(final WorkItemDefinitionCacheRegistry registry) { + this.registry = registry; + } + + @Produces + @Default + public WorkItemDefinitionRegistry getRegistry() { + return registry; + } + + @Override + public Collection execute(final Metadata metadata) { + return registry.items(); + } + + @PreDestroy + public void destroy() { + registry.destroy(); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/ShowcaseEntryPoint.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/ShowcaseEntryPoint.java deleted file mode 100644 index 999bc3793d7..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/ShowcaseEntryPoint.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.standalone.client; - -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.annotation.PostConstruct; -import javax.inject.Inject; - -import com.google.gwt.animation.client.Animation; -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.Style; -import com.google.gwt.logging.client.LogConfiguration; -import com.google.gwt.user.client.ui.RootPanel; -import org.jboss.errai.common.client.api.Caller; -import org.jboss.errai.common.client.api.RemoteCallback; -import org.jboss.errai.ioc.client.api.EntryPoint; -import org.jboss.errai.security.shared.api.Role; -import org.jboss.errai.security.shared.api.identity.User; -import org.jboss.errai.security.shared.service.AuthenticationService; -import org.kie.workbench.common.stunner.standalone.client.perspectives.AuthoringPerspective; -import org.kie.workbench.common.stunner.standalone.client.perspectives.CanvasPerspective; -import org.kie.workbench.common.stunner.standalone.client.perspectives.HomePerspective; -import org.uberfire.client.mvp.ActivityManager; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.client.views.pfly.menu.UserMenu; -import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.client.workbench.widgets.menu.UtilityMenuBar; -import org.uberfire.client.workbench.widgets.menu.WorkbenchMenuBarPresenter; -import org.uberfire.ext.security.management.client.ClientUserSystemManager; -import org.uberfire.mvp.Command; -import org.uberfire.workbench.model.menu.MenuFactory; -import org.uberfire.workbench.model.menu.Menus; - -import static org.uberfire.workbench.model.menu.MenuFactory.newTopLevelMenu; - -/** - * GWT's entry-point for Stunner showcase. - */ -@EntryPoint -public class ShowcaseEntryPoint { - - private static Logger LOGGER = Logger.getLogger(ShowcaseEntryPoint.class.getName()); - - @Inject - private PlaceManager placeManager; - - @Inject - private WorkbenchMenuBarPresenter menubar; - - @Inject - private UserMenu userMenu; - - @Inject - private UtilityMenuBar utilityMenuBar; - - @Inject - public User identity; - - @Inject - private ActivityManager activityManager; - - @Inject - private Caller authService; - - @Inject - private ClientUserSystemManager userSystemManager; - - @Inject - private ErrorPopupPresenter errorPopupPresenter; - - @PostConstruct - public void startApp() { - userSystemManager.waitForInitialization(new Command() { - @Override - public void execute() { - setupGlobalErrorHandler(); - setupMenus(); - hideLoadingPopup(); - } - }); - } - - private void setupGlobalErrorHandler() { - GWT.setUncaughtExceptionHandler(throwable -> { - final String message = "Uncaught error on client side: " + throwable.getMessage(); - errorPopupPresenter.showMessage(message); - log(Level.SEVERE, - throwable.getMessage()); - }); - } - - private void setupMenus() { - for (Menus roleMenus : getRoles()) { - userMenu.addMenus(roleMenus); - } - refreshMenus(); - } - - private void refreshMenus() { - menubar.clear(); - menubar.addMenus(createMenuBar()); - final Menus utilityMenus = - MenuFactory.newTopLevelCustomMenu(userMenu) - .endMenu() - .build(); - utilityMenuBar.addMenus(utilityMenus); - } - - private Menus createMenuBar() { - return newTopLevelMenu("Home") - .perspective(HomePerspective.PERSPECTIVE_ID) - .endMenu() - .newTopLevelMenu("Authoring") - .perspective(AuthoringPerspective.PERSPECTIVE_ID) - .endMenu() - .newTopLevelMenu("Canvas only") - .perspective(CanvasPerspective.PERSPECTIVE_ID) - .endMenu() - .build(); - } - - private List getRoles() { - final List result = new ArrayList(identity.getRoles().size()); - result.add(MenuFactory.newSimpleItem("Logout").respondsWith(new LogoutCommand()).endMenu().build()); - for (Role role : identity.getRoles()) { - if (!role.getName().equals("IS_REMEMBER_ME")) { - result.add(MenuFactory.newSimpleItem("Role: " + role.getName()).endMenu().build()); - } - } - return result; - } - - // Fade out the "Loading application" pop-up - private void hideLoadingPopup() { - final Element e = RootPanel.get("loading").getElement(); - new Animation() { - - @Override - protected void onUpdate(double progress) { - e.getStyle().setOpacity(1.0 - progress); - } - - @Override - protected void onComplete() { - e.getStyle().setVisibility(Style.Visibility.HIDDEN); - } - }.run(500); - } - - private class LogoutCommand implements Command { - - @Override - public void execute() { - authService.call(new RemoteCallback() { - @Override - public void callback(Void response) { - final String location = GWT.getModuleBaseURL().replaceFirst("/" + GWT.getModuleName() + "/", - "/logout.jsp"); - redirect(location); - } - }).logout(); - } - } - - public static native void redirect(String url)/*-{ - $wnd.location = url; - }-*/; - - private void log(final Level level, - final String message) { - if (LogConfiguration.loggingIsEnabled()) { - LOGGER.log(level, - message); - } - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/editor/BPMNDiagramsNavigatorScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/editor/BPMNDiagramsNavigatorScreen.java new file mode 100644 index 00000000000..392f894bd2a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/editor/BPMNDiagramsNavigatorScreen.java @@ -0,0 +1,133 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.standalone.client.editor; + +import java.util.Objects; +import java.util.function.Consumer; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.Dependent; +import javax.enterprise.event.Observes; +import javax.inject.Inject; + +import com.google.gwt.user.client.ui.IsWidget; +import org.kie.workbench.common.stunner.client.widgets.event.LoadDiagramEvent; +import org.kie.workbench.common.stunner.client.widgets.explorer.navigator.diagrams.DiagramsNavigator; +import org.kie.workbench.common.stunner.client.widgets.menu.dev.ShapeSetsMenuItemsBuilder; +import org.kie.workbench.common.stunner.core.client.annotation.DiagramEditor; +import org.uberfire.client.annotations.WorkbenchMenu; +import org.uberfire.client.annotations.WorkbenchPartTitle; +import org.uberfire.client.annotations.WorkbenchPartView; +import org.uberfire.client.annotations.WorkbenchScreen; +import org.uberfire.lifecycle.OnClose; +import org.uberfire.lifecycle.OnStartup; +import org.uberfire.mvp.PlaceRequest; +import org.uberfire.mvp.impl.DefaultPlaceRequest; +import org.uberfire.workbench.model.menu.MenuFactory; +import org.uberfire.workbench.model.menu.Menus; + +@Dependent +@WorkbenchScreen(identifier = BPMNDiagramsNavigatorScreen.SCREEN_ID) +public class BPMNDiagramsNavigatorScreen { + + public static final String SCREEN_ID = "BPMNDiagramsNavigatorScreen"; + + public static final PlaceRequest DIAGRAM_EDITOR = new DefaultPlaceRequest(BPMNStandaloneDiagramEditor.EDITOR_ID); + + private DiagramsNavigator diagramsNavigator; + private ShapeSetsMenuItemsBuilder newDiagramMenuItemsBuilder; + private BPMNStandaloneDiagramWrapper stateHolder; + + @Inject + @DiagramEditor + private BPMNStandaloneDiagramEditor diagramEditor; + + private Menus menu = null; + private LoadDiagramEvent selectedDiagramEvent = null; + + public BPMNDiagramsNavigatorScreen() { + //CDI proxy + } + + @Inject + public BPMNDiagramsNavigatorScreen(final DiagramsNavigator diagramsNavigator, + final ShapeSetsMenuItemsBuilder newDiagramMenuItemsBuilder, + final BPMNStandaloneDiagramWrapper stateHolder) { + this.diagramsNavigator = diagramsNavigator; + this.newDiagramMenuItemsBuilder = newDiagramMenuItemsBuilder; + this.stateHolder = stateHolder; + } + + @PostConstruct + public void init() { + this.selectedDiagramEvent = null; + } + + @OnStartup + @SuppressWarnings("unused") + public void onStartup(final PlaceRequest placeRequest) { + this.menu = makeMenuBar(); + clear(); + } + + private Menus makeMenuBar() { + final MenuFactory.TopLevelMenusBuilder m = + MenuFactory + .newTopLevelMenu("Load diagrams from server") + .respondsWith(() -> diagramsNavigator.show()) + .endMenu() + .newTopLevelMenu("Edit") + .respondsWith(() -> { + if (Objects.nonNull(selectedDiagramEvent)) { + stateHolder.openFile(selectedDiagramEvent.getPath()); + } + }) + .endMenu(); + m.newTopLevelMenu(newDiagramMenuItemsBuilder.build("Create", + "Create a new", + (shapeSet) -> stateHolder.newFile())).endMenu(); + return m.build(); + } + + private void clear() { + diagramsNavigator.clear(); + selectedDiagramEvent = null; + } + + @OnClose + public void onClose() { + clear(); + } + + @WorkbenchMenu + public void getMenus(final Consumer menusConsumer) { + menusConsumer.accept(menu); + } + + @WorkbenchPartTitle + public String getTitle() { + return "Diagrams Navigator"; + } + + @WorkbenchPartView + public IsWidget getWidget() { + return diagramsNavigator.asWidget(); + } + + private void onLoadDiagramEvent(final @Observes LoadDiagramEvent loadDiagramEvent) { + this.selectedDiagramEvent = loadDiagramEvent; + } +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/editor/BPMNStandaloneDiagramEditor.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/editor/BPMNStandaloneDiagramEditor.java new file mode 100644 index 00000000000..45fdb4507fe --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/editor/BPMNStandaloneDiagramEditor.java @@ -0,0 +1,324 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ +package org.kie.workbench.common.stunner.standalone.client.editor; + +import java.util.Optional; +import java.util.function.Consumer; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.event.Event; +import javax.inject.Inject; + +import com.google.gwt.user.client.ui.IsWidget; +import elemental2.promise.Promise; +import org.jboss.errai.ioc.client.api.ManagedInstance; +import org.kie.workbench.common.kogito.client.editor.MultiPageEditorContainerView; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; +import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; +import org.kie.workbench.common.stunner.core.client.annotation.DiagramEditor; +import org.kie.workbench.common.stunner.core.client.api.SessionManager; +import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; +import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; +import org.kie.workbench.common.stunner.core.client.command.SessionCommandManager; +import org.kie.workbench.common.stunner.core.client.components.layout.LayoutHelper; +import org.kie.workbench.common.stunner.core.client.components.layout.OpenDiagramLayoutExecutor; +import org.kie.workbench.common.stunner.core.client.error.DiagramClientErrorHandler; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.kie.workbench.common.stunner.core.client.session.Session; +import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; +import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.documentation.DocumentationView; +import org.kie.workbench.common.stunner.kogito.client.docks.DiagramEditorPreviewAndExplorerDock; +import org.kie.workbench.common.stunner.kogito.client.docks.DiagramEditorPropertiesDock; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditor; +import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientDiagramService; +import org.kie.workbench.common.stunner.standalone.client.menus.BPMNStandaloneEditorMenuSessionItems; +import org.kie.workbench.common.stunner.standalone.client.perspectives.AuthoringPerspective; +import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder; +import org.uberfire.backend.vfs.Path; +import org.uberfire.backend.vfs.PathFactory; +import org.uberfire.client.annotations.WorkbenchMenu; +import org.uberfire.client.annotations.WorkbenchPartTitle; +import org.uberfire.client.annotations.WorkbenchPartTitleDecoration; +import org.uberfire.client.annotations.WorkbenchPartView; +import org.uberfire.client.annotations.WorkbenchScreen; +import org.uberfire.client.mvp.PlaceManager; +import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; +import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; +import org.uberfire.ext.widgets.core.client.editors.texteditor.TextEditorView; +import org.uberfire.lifecycle.IsDirty; +import org.uberfire.lifecycle.OnClose; +import org.uberfire.lifecycle.OnFocus; +import org.uberfire.lifecycle.OnLostFocus; +import org.uberfire.lifecycle.OnMayClose; +import org.uberfire.lifecycle.OnOpen; +import org.uberfire.lifecycle.OnStartup; +import org.uberfire.mvp.PlaceRequest; +import org.uberfire.workbench.events.NotificationEvent; +import org.uberfire.workbench.model.menu.Menus; + +@ApplicationScoped +@DiagramEditor +// @WorkbenchClientEditor(identifier = BPMNStandaloneDiagramEditor.EDITOR_ID) +@WorkbenchScreen(identifier = BPMNStandaloneDiagramEditor.EDITOR_ID) +public class BPMNStandaloneDiagramEditor extends AbstractDiagramEditor { + + public static final String EDITOR_ID = "BPMNStandaloneDiagramEditor"; + + private final Event notificationEvent; + + private final DiagramEditorPreviewAndExplorerDock diagramPreviewAndExplorerDock; + private final DiagramEditorPropertiesDock diagramPropertiesDock; + + private final LayoutHelper layoutHelper; + private final OpenDiagramLayoutExecutor openDiagramLayoutExecutor; + + private final KogitoClientDiagramService diagramServices; + private final BPMNStandaloneDiagramWrapper stateHolder; + + @Inject + public BPMNStandaloneDiagramEditor(final View view, + final FileMenuBuilder fileMenuBuilder, + final PlaceManager placeManager, + final MultiPageEditorContainerView multiPageEditorContainerView, + final Event changeTitleNotificationEvent, + final Event notificationEvent, + final Event onDiagramFocusEvent, + final TextEditorView xmlEditorView, + final ManagedInstance> editorSessionPresenterInstances, + final ManagedInstance> viewerSessionPresenterInstances, + final BPMNStandaloneEditorMenuSessionItems menuSessionItems, + final ErrorPopupPresenter errorPopupPresenter, + final DiagramClientErrorHandler diagramClientErrorHandler, + final ClientTranslationService translationService, + final DocumentationView documentationView, + final SessionManager sessionManager, + final @Session SessionCommandManager sessionCommandManager, + final DiagramEditorPreviewAndExplorerDock diagramPreviewAndExplorerDock, + final DiagramEditorPropertiesDock diagramPropertiesDock, + final LayoutHelper layoutHelper, + final OpenDiagramLayoutExecutor openDiagramLayoutExecutor, + final KogitoClientDiagramService diagramServices, + final BPMNStandaloneDiagramWrapper stateHolder) { + super(view, + fileMenuBuilder, + placeManager, + multiPageEditorContainerView, + changeTitleNotificationEvent, + notificationEvent, + onDiagramFocusEvent, + xmlEditorView, + editorSessionPresenterInstances, + viewerSessionPresenterInstances, + menuSessionItems, + errorPopupPresenter, + diagramClientErrorHandler, + translationService, + documentationView); + this.notificationEvent = notificationEvent; + + this.diagramPreviewAndExplorerDock = diagramPreviewAndExplorerDock; + this.diagramPropertiesDock = diagramPropertiesDock; + + this.layoutHelper = layoutHelper; + this.openDiagramLayoutExecutor = openDiagramLayoutExecutor; + + this.diagramServices = diagramServices; + this.stateHolder = stateHolder; + } + + @OnStartup + @SuppressWarnings("unused") + public void onStartup(final PlaceRequest place) { + superDoStartUp(place); + + diagramPreviewAndExplorerDock.init(AuthoringPerspective.PERSPECTIVE_ID); + diagramPropertiesDock.init(AuthoringPerspective.PERSPECTIVE_ID); + + getWidget().init(this); + } + + void superDoStartUp(final PlaceRequest place) { + super.doStartUp(place); + } + + @Override + public void initialiseKieEditorForSession(final Diagram diagram) { + superInitialiseKieEditorForSession(diagram); + } + + void superInitialiseKieEditorForSession(final Diagram diagram) { + super.initialiseKieEditorForSession(diagram); + } + + @Override + public void open(final Diagram diagram) { + this.layoutHelper.applyLayout(diagram, openDiagramLayoutExecutor); + super.open(diagram); + } + + @OnOpen + @SuppressWarnings("unused") + public void onOpen() { + super.doOpen(); + } + + @OnClose + @SuppressWarnings("unused") + public void onClose() { + superOnClose(); + diagramPreviewAndExplorerDock.close(); + diagramPropertiesDock.close(); + } + + void superOnClose() { + super.doClose(); + } + + @Override + public void onDiagramLoad() { + final Optional canvasHandler = Optional.ofNullable(getCanvasHandler()); + + canvasHandler.ifPresent(c -> { + final Metadata metadata = c.getDiagram().getMetadata(); + metadata.setPath(makeMetadataPath(metadata.getRoot(), metadata.getTitle())); + diagramPreviewAndExplorerDock.open(); + diagramPropertiesDock.open(); + }); + } + + private Path makeMetadataPath(final Path root, + final String title) { + final String uri = root.toURI(); + return PathFactory.newPath(title, uri + "/" + title + ".bpmn"); + } + + @OnFocus + @SuppressWarnings("unused") + public void onFocus() { + superDoFocus(); + onDiagramLoad(); + } + + void superDoFocus() { + super.doFocus(); + } + + @OnLostFocus + @SuppressWarnings("unused") + public void onLostFocus() { + super.doLostFocus(); + } + + @Override + @WorkbenchPartTitleDecoration + public IsWidget getTitle() { + return super.getTitle(); + } + + @WorkbenchPartTitle + public String getTitleText() { + return ""; + } + + @WorkbenchMenu + public void getMenus(final Consumer menusConsumer) { + menusConsumer.accept(super.getMenus()); + } + + @Override + protected void makeMenuBar() { + if (!menuBarInitialized) { + getFileMenuBuilder().addSave(this::doSave); + getMenuSessionItems().populateMenu(getFileMenuBuilder()); + makeAdditionalStunnerMenus(getFileMenuBuilder()); + menuBarInitialized = true; + } + } + + private void doSave() { + stateHolder.saveFile(new ServiceCallback() { + @Override + public void onSuccess(final String xml) { + resetContentHash(); + notificationEvent.fire(new NotificationEvent(org.uberfire.ext.editor.commons.client.resources.i18n.CommonConstants.INSTANCE.ItemSavedSuccessfully())); + hideLoadingViews(); + } + + @Override + public void onError(final ClientRuntimeError error) { + onSaveError(error); + } + }); + } + + @Override + @WorkbenchPartView + public IsWidget asWidget() { + return super.asWidget(); + } + + @OnMayClose + @SuppressWarnings("unused") + public boolean onMayClose() { + return super.mayClose(); + } + + @Override + public String getEditorIdentifier() { + return EDITOR_ID; + } + + @Override + // @GetContent + public Promise getContent() { + return diagramServices.transform(getEditor().getEditorProxy().getContentSupplier().get()); + } + + @Override + @IsDirty + public boolean isDirty() { + return super.isDirty(); + } + + @Override + // @SetContent + public void setContent(final String value) { + diagramServices.transform(value, + new ServiceCallback() { + + @Override + public void onSuccess(final Diagram diagram) { + getEditor().open(diagram); + } + + @Override + public void onError(final ClientRuntimeError error) { + BPMNStandaloneDiagramEditor.this.getEditor().onLoadError(error); + } + }); + } + + @Override + public void resetContentHash() { + setOriginalContentHash(getCurrentDiagramHash()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/editor/BPMNStandaloneDiagramWrapper.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/editor/BPMNStandaloneDiagramWrapper.java new file mode 100644 index 00000000000..003094e86e4 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/editor/BPMNStandaloneDiagramWrapper.java @@ -0,0 +1,91 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.editor; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.core.client.annotation.DiagramEditor; +import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.kie.workbench.common.stunner.standalone.client.services.BPMNStandaloneClientDiagramServiceImpl; +import org.uberfire.backend.vfs.Path; +import org.uberfire.client.mvp.PlaceManager; + +@ApplicationScoped +public class BPMNStandaloneDiagramWrapper { + + @Inject + @DiagramEditor + private BPMNStandaloneDiagramEditor diagramEditor; + + private PlaceManager placeManager; + private BPMNStandaloneClientDiagramServiceImpl clientDiagramService; + + public BPMNStandaloneDiagramWrapper() { + //CDI proxy + } + + @Inject + public BPMNStandaloneDiagramWrapper(final PlaceManager placeManager, + final BPMNStandaloneClientDiagramServiceImpl clientDiagramService) { + this.placeManager = placeManager; + this.clientDiagramService = clientDiagramService; + } + + public void newFile() { + placeManager.registerOnOpenCallback(BPMNDiagramsNavigatorScreen.DIAGRAM_EDITOR, + () -> { + diagramEditor.setContent(""); + placeManager.unregisterOnOpenCallbacks(BPMNDiagramsNavigatorScreen.DIAGRAM_EDITOR); + }); + + placeManager.goTo(BPMNDiagramsNavigatorScreen.DIAGRAM_EDITOR); + } + + public void openFile(final Path path) { + placeManager.registerOnOpenCallback(BPMNDiagramsNavigatorScreen.DIAGRAM_EDITOR, + () -> { + clientDiagramService.loadAsXml(path, + new ServiceCallback() { + @Override + public void onSuccess(final String xml) { + diagramEditor.setContent(xml); + placeManager.unregisterOnOpenCallbacks(BPMNDiagramsNavigatorScreen.DIAGRAM_EDITOR); + } + + @Override + public void onError(final ClientRuntimeError error) { + placeManager.unregisterOnOpenCallbacks(BPMNDiagramsNavigatorScreen.DIAGRAM_EDITOR); + } + }); + }); + + placeManager.goTo(BPMNDiagramsNavigatorScreen.DIAGRAM_EDITOR); + } + + @SuppressWarnings("unchecked") + public void saveFile(final ServiceCallback callback) { + final Path path = diagramEditor.getCanvasHandler().getDiagram().getMetadata().getPath(); + diagramEditor.getContent().then(xml -> { + clientDiagramService.saveAsXml(path, + (String) xml, + callback); + return null; + }); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/editor/BPMNStandaloneShapeSetThumbProvder.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/editor/BPMNStandaloneShapeSetThumbProvder.java new file mode 100644 index 00000000000..c71a37e9f0f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/editor/BPMNStandaloneShapeSetThumbProvder.java @@ -0,0 +1,42 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.editor; + +import javax.enterprise.context.ApplicationScoped; + +import com.google.gwt.safehtml.shared.SafeUri; +import com.google.gwt.safehtml.shared.UriUtils; +import org.kie.workbench.common.stunner.core.client.ShapeSetThumbProvider; + +@ApplicationScoped +public class BPMNStandaloneShapeSetThumbProvder implements ShapeSetThumbProvider { + + @Override + public SafeUri getThumbnailUri() { + return UriUtils.fromSafeConstant("/images/default-diagram-thumbnail.png"); + } + + @Override + public Class getSourceType() { + return String.class; + } + + @Override + public boolean thumbFor(final String definitionSetId) { + return true; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/menus/BPMNStandaloneEditorMenuItemsBuilder.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/menus/BPMNStandaloneEditorMenuItemsBuilder.java new file mode 100644 index 00000000000..242e6a10070 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/menus/BPMNStandaloneEditorMenuItemsBuilder.java @@ -0,0 +1,43 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.menus; + +import javax.enterprise.context.Dependent; +import javax.enterprise.inject.Typed; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil; +import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuItemsBuilder; + +@Dependent +@Typed(BPMNStandaloneEditorMenuItemsBuilder.class) +public class BPMNStandaloneEditorMenuItemsBuilder extends AbstractDiagramEditorMenuItemsBuilder { + + @SuppressWarnings("unused") + protected BPMNStandaloneEditorMenuItemsBuilder() { + //CDI proxy + super(); + } + + @Inject + public BPMNStandaloneEditorMenuItemsBuilder(final ClientTranslationService translationService, + final PopupUtil popupUtil) { + super(translationService, + popupUtil); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/menus/BPMNStandaloneEditorMenuSessionItems.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/menus/BPMNStandaloneEditorMenuSessionItems.java new file mode 100644 index 00000000000..d3aa9a3673a --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/menus/BPMNStandaloneEditorMenuSessionItems.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.menus; + +import javax.enterprise.context.Dependent; +import javax.enterprise.inject.Typed; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.bpmn.qualifiers.BPMN; +import org.kie.workbench.common.stunner.kogito.client.editor.AbstractDiagramEditorMenuSessionItems; + +@Dependent +@Typed(BPMNStandaloneEditorMenuSessionItems.class) +public class BPMNStandaloneEditorMenuSessionItems extends AbstractDiagramEditorMenuSessionItems { + + @Inject + public BPMNStandaloneEditorMenuSessionItems(final BPMNStandaloneEditorMenuItemsBuilder itemsBuilder, + final @BPMN BPMNStandaloneEditorSessionCommands sessionCommands) { + super(itemsBuilder, + sessionCommands); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/menus/BPMNStandaloneEditorSessionCommands.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/menus/BPMNStandaloneEditorSessionCommands.java new file mode 100644 index 00000000000..cc83f52266e --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/menus/BPMNStandaloneEditorSessionCommands.java @@ -0,0 +1,68 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.menus; + +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.bpmn.qualifiers.BPMN; +import org.kie.workbench.common.stunner.core.client.session.command.ManagedClientSessionCommands; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToJpgSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPdfSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPngSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToRawFormatSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToSvgSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.RedoSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.SwitchGridSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.UndoSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.ValidateSessionCommand; +import org.kie.workbench.common.stunner.core.client.session.command.impl.VisitGraphSessionCommand; +import org.kie.workbench.common.stunner.kogito.client.session.EditorSessionCommands; + +@Dependent +@BPMN +public class BPMNStandaloneEditorSessionCommands extends EditorSessionCommands { + + @Inject + public BPMNStandaloneEditorSessionCommands(final ManagedClientSessionCommands commands) { + super(commands); + } + + @Override + protected void registerCommands() { + getCommands().register(VisitGraphSessionCommand.class) + .register(SwitchGridSessionCommand.class) + .register(ClearSessionCommand.class) + .register(DeleteSelectionSessionCommand.class) + .register(UndoSessionCommand.class) + .register(RedoSessionCommand.class) + .register(ValidateSessionCommand.class) + .register(ExportToPngSessionCommand.class) + .register(ExportToJpgSessionCommand.class) + .register(ExportToPdfSessionCommand.class) + .register(ExportToSvgSessionCommand.class) + .register(ExportToRawFormatSessionCommand.class) + .register(CopySelectionSessionCommand.class) + .register(PasteSelectionSessionCommand.class) + .register(CutSelectionSessionCommand.class); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/navbar/AppNavBar.html b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/navbar/AppNavBar.html deleted file mode 100644 index 7b81904291e..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/navbar/AppNavBar.html +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/navbar/AppNavBar.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/navbar/AppNavBar.java deleted file mode 100644 index f9fccd02ece..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/navbar/AppNavBar.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.client.navbar; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; - -import org.jboss.errai.common.client.dom.DOMUtil; -import org.jboss.errai.common.client.dom.Div; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.Templated; -import org.uberfire.client.workbench.Header; -import org.uberfire.client.workbench.widgets.menu.WorkbenchMenuBarPresenter; - -import static java.lang.Integer.MAX_VALUE; - -@ApplicationScoped -@Templated -public class AppNavBar implements Header { - - @Inject - @DataField - Div header; - - @Inject - private WorkbenchMenuBarPresenter menuBarPresenter; - - @PostConstruct - public void setup() { - DOMUtil.appendWidgetToElement(header, - menuBarPresenter.getView().asWidget()); - } - - @Override - public String getId() { - return "AppNavBar"; - } - - @Override - public int getOrder() { - return MAX_VALUE; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/perspectives/AuthoringPerspective.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/perspectives/AuthoringPerspective.java index de671ae424e..4795db2647d 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/perspectives/AuthoringPerspective.java +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/perspectives/AuthoringPerspective.java @@ -13,89 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.kie.workbench.common.stunner.standalone.client.perspectives; import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import org.kie.workbench.common.stunner.client.widgets.palette.BS3PaletteWidgetImpl; -import org.kie.workbench.common.stunner.client.widgets.views.LoadingBox; -import org.kie.workbench.common.stunner.standalone.client.screens.DiagramsNavigatorScreen; -import org.kie.workbench.common.stunner.standalone.client.screens.NotificationsScreen; -import org.kie.workbench.common.stunner.standalone.client.screens.SessionDiagramPreviewScreen; -import org.kie.workbench.common.stunner.standalone.client.screens.SessionPropertiesScreen; -import org.kie.workbench.common.stunner.standalone.client.screens.SessionTreeExplorerScreen; +import org.kie.workbench.common.stunner.standalone.client.editor.BPMNDiagramsNavigatorScreen; import org.uberfire.client.annotations.Perspective; import org.uberfire.client.annotations.WorkbenchPerspective; -import org.uberfire.client.mvp.PlaceManager; import org.uberfire.client.workbench.panels.impl.MultiListWorkbenchPanelPresenter; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; import org.uberfire.mvp.impl.DefaultPlaceRequest; -import org.uberfire.workbench.model.CompassPosition; -import org.uberfire.workbench.model.PanelDefinition; import org.uberfire.workbench.model.PerspectiveDefinition; -import org.uberfire.workbench.model.impl.PanelDefinitionImpl; import org.uberfire.workbench.model.impl.PartDefinitionImpl; import org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl; @ApplicationScoped -@WorkbenchPerspective(identifier = AuthoringPerspective.PERSPECTIVE_ID, isTransient = false) +@WorkbenchPerspective(identifier = AuthoringPerspective.PERSPECTIVE_ID, isTransient = false, isDefault = true) public class AuthoringPerspective { public static final String PERSPECTIVE_ID = "AuthoringPerspective"; - public static final int WEST_PANEL_WIDTH = BS3PaletteWidgetImpl.getDefaultWidth(); - public static final int EAST_PANEL_WIDTH = 450; - public static final int EAST_PANEL_HEIGHT = 300; - - PanelDefinition notificationsPanel; - PanelDefinition propertiesPanel; - PanelDefinition treeExplorerPanel; - PanelDefinition previewPanel; - - @Inject - LoadingBox loadingBox; - - @Inject - PlaceManager placeManager; - - private PlaceRequest placeRequest; - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.placeRequest = placeRequest; - } @Perspective public PerspectiveDefinition buildPerspective() { - PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); + final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); perspective.setName("Authoring"); - perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest(DiagramsNavigatorScreen.SCREEN_ID))); - treeExplorerPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); - treeExplorerPanel.setWidth(EAST_PANEL_WIDTH); - treeExplorerPanel.setHeight(EAST_PANEL_HEIGHT); - treeExplorerPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(SessionTreeExplorerScreen.SCREEN_ID))); - previewPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); - previewPanel.setWidth(EAST_PANEL_WIDTH); - previewPanel.setHeight(EAST_PANEL_HEIGHT); - previewPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(SessionDiagramPreviewScreen.SCREEN_ID))); - propertiesPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); - propertiesPanel.setWidth(EAST_PANEL_WIDTH); - propertiesPanel.setHeight(EAST_PANEL_HEIGHT); - propertiesPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(SessionPropertiesScreen.SCREEN_ID))); - propertiesPanel.appendChild(CompassPosition.NORTH, - previewPanel); - propertiesPanel.appendChild(CompassPosition.SOUTH, - treeExplorerPanel); - notificationsPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); - notificationsPanel.setWidth(400); - notificationsPanel.setHeight(100); - notificationsPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(NotificationsScreen.SCREEN_ID))); - perspective.getRoot().insertChild(CompassPosition.EAST, - propertiesPanel); - perspective.getRoot().insertChild(CompassPosition.SOUTH, - notificationsPanel); + perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest(BPMNDiagramsNavigatorScreen.SCREEN_ID))); return perspective; } } + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/perspectives/CanvasPerspective.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/perspectives/CanvasPerspective.java deleted file mode 100644 index c7bf2f4e28a..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/perspectives/CanvasPerspective.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.client.perspectives; - -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; - -import org.kie.workbench.common.stunner.client.widgets.views.LoadingBox; -import org.kie.workbench.common.stunner.standalone.client.screens.DiagramsNavigatorScreen; -import org.uberfire.client.annotations.Perspective; -import org.uberfire.client.annotations.WorkbenchPerspective; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.client.workbench.panels.impl.MultiListWorkbenchPanelPresenter; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.mvp.impl.DefaultPlaceRequest; -import org.uberfire.workbench.model.PerspectiveDefinition; -import org.uberfire.workbench.model.impl.PartDefinitionImpl; -import org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl; - -@ApplicationScoped -@WorkbenchPerspective(identifier = CanvasPerspective.PERSPECTIVE_ID, isTransient = false) -public class CanvasPerspective { - - public static final String PERSPECTIVE_ID = "CanvasPerspective"; - - @Inject - LoadingBox loadingBox; - - @Inject - PlaceManager placeManager; - - private PlaceRequest placeRequest; - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.placeRequest = placeRequest; - } - - @Perspective - public PerspectiveDefinition buildPerspective() { - PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); - perspective.setName("Canvas only"); - perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest(DiagramsNavigatorScreen.SCREEN_ID))); - return perspective; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/perspectives/HomePerspective.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/perspectives/HomePerspective.java deleted file mode 100644 index 14988df18d6..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/perspectives/HomePerspective.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.client.perspectives; - -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; - -import org.kie.workbench.common.stunner.standalone.client.screens.DiagramPresenterScreen; -import org.kie.workbench.common.stunner.standalone.client.screens.WelcomeScreen; -import org.uberfire.client.annotations.Perspective; -import org.uberfire.client.annotations.WorkbenchPerspective; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.client.workbench.panels.impl.MultiListWorkbenchPanelPresenter; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.mvp.impl.DefaultPlaceRequest; -import org.uberfire.workbench.model.CompassPosition; -import org.uberfire.workbench.model.PanelDefinition; -import org.uberfire.workbench.model.PerspectiveDefinition; -import org.uberfire.workbench.model.impl.PanelDefinitionImpl; -import org.uberfire.workbench.model.impl.PartDefinitionImpl; -import org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl; - -@ApplicationScoped -@WorkbenchPerspective(identifier = HomePerspective.PERSPECTIVE_ID, isTransient = false, isDefault = true) -public class HomePerspective { - - public static final String PERSPECTIVE_ID = "HomePerspective"; - - @Inject - PlaceManager placeManager; - - private PanelDefinition welcomePanel; - private PlaceRequest placeRequest; - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.placeRequest = placeRequest; - } - - @Perspective - public PerspectiveDefinition buildPerspective() { - PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); - perspective.setName("Home"); - perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest(DiagramPresenterScreen.SCREEN_ID))); - welcomePanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName()); - welcomePanel.setMinHeight(100); - welcomePanel.setHeight(100); - welcomePanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(WelcomeScreen.SCREEN_ID))); - perspective.getRoot().insertChild(CompassPosition.NORTH, - welcomePanel); - return perspective; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/AbstractSessionScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/AbstractSessionScreen.java deleted file mode 100644 index e03cdf61b6c..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/AbstractSessionScreen.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.client.screens; - -import javax.enterprise.event.Observes; - -import org.kie.workbench.common.stunner.client.widgets.event.SessionFocusedEvent; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvas; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.session.ClientSession; -import org.kie.workbench.common.stunner.core.client.session.event.SessionDestroyedEvent; -import org.kie.workbench.common.stunner.core.client.session.event.SessionDiagramOpenedEvent; -import org.kie.workbench.common.stunner.core.client.session.impl.AbstractSession; -import org.kie.workbench.common.stunner.core.diagram.Diagram; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -public abstract class AbstractSessionScreen { - - private ClientSession session; - - protected abstract void doOpenDiagram(); - - protected abstract void doCloseSession(); - - protected abstract void doUpdateTitle(String title); - - public void open(final ClientSession session) { - if (null != this.session) { - close(); - } - this.session = session; - doOpenDiagram(); - updateTitle(); - } - - public void close() { - doCloseSession(); - this.session = null; - } - - @SuppressWarnings("unchecked") - void onSessionDiagramOpenedEvent(@Observes SessionDiagramOpenedEvent sessionDiagramOpenedEvent) { - checkNotNull("sessionDiagramOpenedEvent", - sessionDiagramOpenedEvent); - open(sessionDiagramOpenedEvent.getSession()); - } - - @SuppressWarnings("unchecked") - void onSessionFocusedEvent(@Observes SessionFocusedEvent focusedEvent) { - open(focusedEvent.getSession()); - } - - void onCanvasSessionDestroyed(@Observes SessionDestroyedEvent sessionDestroyedEvent) { - checkNotNull("sessionDestroyedEvent", - sessionDestroyedEvent); - close(); - } - - protected AbstractCanvasHandler getCanvasHandler() { - return null != session ? session.getCanvasHandler() : null; - } - - protected AbstractCanvas getCanvas() { - return null != session ? session.getCanvas() : null; - } - - protected AbstractSession getSession() { - return (AbstractSession) session; - } - - private void updateTitle() { - if (null != getCanvasHandler() && null != getCanvasHandler().getDiagram()) { - final Diagram diagram = getCanvasHandler().getDiagram(); - doUpdateTitle(diagram.getMetadata().getTitle()); - } - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/DiagramPresenterScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/DiagramPresenterScreen.java deleted file mode 100644 index fa66737e80d..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/DiagramPresenterScreen.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.client.screens; - -import java.util.function.Consumer; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.logging.client.LogConfiguration; -import com.google.gwt.user.client.ui.IsWidget; -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.kie.workbench.common.stunner.client.widgets.presenters.diagram.DiagramEditor; -import org.kie.workbench.common.stunner.client.widgets.presenters.diagram.DiagramViewer; -import org.kie.workbench.common.stunner.client.widgets.views.session.ScreenErrorView; -import org.kie.workbench.common.stunner.client.widgets.views.session.ScreenPanelView; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; -import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.uberfire.client.annotations.WorkbenchContextId; -import org.uberfire.client.annotations.WorkbenchMenu; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.ext.widgets.common.client.common.BusyPopup; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnOpen; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.menu.MenuFactory; -import org.uberfire.workbench.model.menu.Menus; - -/** - * This screen wraps the diagram viewer & editor widgets - * and provides the menu items for both loading or editing a diagram. - */ -@Dependent -@WorkbenchScreen(identifier = DiagramPresenterScreen.SCREEN_ID) -public class DiagramPresenterScreen { - - private static Logger LOGGER = Logger.getLogger(DiagramPresenterScreen.class.getName()); - - public static final String SCREEN_ID = "DiagramPresenterScreen"; - public static final String DIAGRAM_NAME = "evaluation2"; - - @Inject - private ShowcaseDiagramService diagramService; - - @Inject - private ManagedInstance> diagramViewers; - - @Inject - private ManagedInstance> diagramEditors; - - @Inject - private ScreenPanelView screenPanelView; - - @Inject - private ScreenErrorView screenErrorView; - - private Menus menu = null; - private DiagramViewer diagramViewer; - private DiagramEditor diagramEditor; - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.menu = makeMenuBar(); - } - - private Menus makeMenuBar() { - return MenuFactory - .newTopLevelMenu("View process: " + DIAGRAM_NAME) - .respondsWith(this::viewProcess) - .endMenu() - .newTopLevelMenu("Edit process: " + DIAGRAM_NAME) - .respondsWith(this::editProcess) - .endMenu() - .build(); - } - - private void viewProcess() { - Logger.getLogger("org.kie.workbench.common.stunner").setLevel(Level.FINE); - BusyPopup.showMessage("Loading"); - destroy(); - diagramService.loadByName(DIAGRAM_NAME, - new ServiceCallback() { - @Override - public void onSuccess(final Diagram diagram) { - diagramViewer = diagramViewers.get(); - screenPanelView.setWidget(diagramViewer.getView()); - diagramViewer.open(diagram, - new ScreenViewerCallback()); - } - - @Override - public void onError(final ClientRuntimeError error) { - showError(error); - } - }); - } - - private void editProcess() { - Logger.getLogger("org.kie.workbench.common.stunner").setLevel(Level.FINE); - BusyPopup.showMessage("Loading"); - destroy(); - diagramService.loadByName(DIAGRAM_NAME, - new ServiceCallback() { - @Override - public void onSuccess(final Diagram diagram) { - diagramEditor = diagramEditors.get(); - screenPanelView.setWidget(diagramEditor.getView()); - diagramEditor.open(diagram, - new ScreenViewerCallback()); - } - - @Override - public void onError(ClientRuntimeError error) { - showError(error); - } - }); - } - - @OnOpen - public void onOpen() { - } - - @OnClose - public void onClose() { - destroy(); - } - - @WorkbenchMenu - public void getMenus(final Consumer menusConsumer) { - menusConsumer.accept(menu); - } - - @WorkbenchPartTitle - public String getTitle() { - return "Diagram Presenter"; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return screenPanelView; - } - - @WorkbenchContextId - public String getMyContextRef() { - return "diagramPresenterScreenContext"; - } - - private final class ScreenViewerCallback implements DiagramViewer.DiagramViewerCallback { - - @Override - public void onOpen(Diagram diagram) { - } - - @Override - public void afterCanvasInitialized() { - } - - @Override - public void onSuccess() { - LOGGER.log(Level.FINE, - DIAGRAM_NAME + " loaded!."); - BusyPopup.close(); - } - - @Override - public void onError(final ClientRuntimeError error) { - showError(error); - } - } - - private void destroy() { - screenPanelView.clear(); - if (null != diagramViewer) { - if (null != diagramViewer.getInstance()) { - diagramViewer.destroy(); - } - diagramViewers.destroy(diagramViewer); - diagramViewers.destroyAll(); - } - if (null != diagramEditor) { - if (null != diagramEditor.getInstance()) { - diagramEditor.destroy(); - } - diagramEditors.destroy(diagramEditor); - diagramEditors.destroyAll(); - } - } - - private void showError(final ClientRuntimeError error) { - screenErrorView.showError(error); - screenPanelView.setWidget(screenErrorView.asWidget()); - log(Level.SEVERE, - DIAGRAM_NAME + " cannot be loaded! [Error=" + error + "]"); - BusyPopup.close(); - } - - private void log(final Level level, - final String message) { - if (LogConfiguration.loggingIsEnabled()) { - LOGGER.log(level, - message); - } - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/DiagramsNavigatorScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/DiagramsNavigatorScreen.java deleted file mode 100644 index a96184397ac..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/DiagramsNavigatorScreen.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.client.screens; - -import java.util.HashMap; -import java.util.Map; -import java.util.function.Consumer; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.enterprise.event.Observes; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.IsWidget; -import org.kie.workbench.common.stunner.client.widgets.event.LoadDiagramEvent; -import org.kie.workbench.common.stunner.client.widgets.explorer.navigator.diagrams.DiagramsNavigator; -import org.kie.workbench.common.stunner.client.widgets.menu.dev.ShapeSetsMenuItemsBuilder; -import org.kie.workbench.common.stunner.core.client.ShapeSet; -import org.uberfire.client.annotations.WorkbenchContextId; -import org.uberfire.client.annotations.WorkbenchMenu; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnOpen; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.mvp.impl.DefaultPlaceRequest; -import org.uberfire.workbench.model.menu.MenuFactory; -import org.uberfire.workbench.model.menu.Menus; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -/** - * This screen lists the first 10 diagrams found on the server. - * It provides an additional screen button for creating new diagrams as well. - */ -// TODO: I18n. -@Dependent -@WorkbenchScreen(identifier = DiagramsNavigatorScreen.SCREEN_ID) -public class DiagramsNavigatorScreen { - - private static Logger LOGGER = Logger.getLogger(DiagramsNavigatorScreen.class.getName()); - - public static final String SCREEN_ID = "DiagramsNavigatorScreen"; - public static final String NO_ITEM_SELECTED = "No diagram selected!"; - - @Inject - protected DiagramsNavigator diagramsNavigator; - - @Inject - protected ShapeSetsMenuItemsBuilder newDiagramMenuItemsBuilder; - - @Inject - private ErrorPopupPresenter errorPopupPresenter; - - @Inject - PlaceManager placeManager; - - private Menus menu = null; - private String selectedDiagramName; - - @PostConstruct - public void init() { - this.selectedDiagramName = null; - } - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.menu = makeMenuBar(); - clear(); - } - - private Menus makeMenuBar() { - final MenuFactory.TopLevelMenusBuilder m = - MenuFactory - .newTopLevelMenu("Load diagrams from server") - .respondsWith(this::show) - .endMenu() - .newTopLevelMenu("View") - .respondsWith(this::view) - .endMenu() - .newTopLevelMenu("Edit") - .respondsWith(this::edit) - .endMenu(); - m.newTopLevelMenu(newDiagramMenuItemsBuilder.build("Create", - "Create a new", - DiagramsNavigatorScreen.this::create)).endMenu(); - return m.build(); - } - - @OnOpen - public void onOpen() { - } - - @OnClose - public void onClose() { - clear(); - } - - @WorkbenchMenu - public void getMenus(final Consumer menusConsumer) { - menusConsumer.accept(menu); - } - - @WorkbenchPartTitle - public String getTitle() { - return "Diagrams Navigator"; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return diagramsNavigator.asWidget(); - } - - @WorkbenchContextId - public String getMyContextRef() { - return "diagramsNavigatorScreenContext"; - } - - public void show() { - diagramsNavigator.show(); - } - - public void view() { - openSelected(true); - } - - public void edit() { - openSelected(false); - } - - public void clear() { - diagramsNavigator.clear(); - selectedDiagramName = null; - } - - void onLoadDiagramEvent(@Observes LoadDiagramEvent loadDiagramEvent) { - checkNotNull("loadDiagramEvent", - loadDiagramEvent); - this.selectedDiagramName = loadDiagramEvent.getName(); - } - - public void openSelected(final boolean viewMode) { - if (checkItemSelected()) { - Map params = new HashMap(); - params.put("name", - this.selectedDiagramName); - open(params, - viewMode); - } - } - - private boolean checkItemSelected() { - if (null != selectedDiagramName) { - return true; - } else { - LOGGER.log(Level.WARNING, - NO_ITEM_SELECTED); - errorPopupPresenter.showMessage(NO_ITEM_SELECTED); - return false; - } - } - - protected void open(final Map params, - final boolean viewMode) { - PlaceRequest diagramScreenPlaceRequest = - new DefaultPlaceRequest(viewMode ? SessionDiagramViewerScreen.SCREEN_ID : SessionDiagramEditorScreen.SCREEN_ID, - params); - placeManager.goTo(diagramScreenPlaceRequest); - } - - private void create(final ShapeSet shapeSet) { - final String shapSetName = shapeSet.getDescription(); - final String defSetId = shapeSet.getDefinitionSetId(); - Map params = new HashMap(); - params.put("defSetId", - defSetId); - params.put("shapeSetId", - shapeSet.getId()); - params.put("title", - "New " + shapSetName + " diagram"); - open(params, - false); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/NotificationsScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/NotificationsScreen.java deleted file mode 100644 index cecab4a7b1c..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/NotificationsScreen.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.standalone.client.screens; - -import java.util.function.Consumer; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.IsWidget; -import org.kie.workbench.common.stunner.standalone.client.widgets.Notifications; -import org.uberfire.client.annotations.WorkbenchContextId; -import org.uberfire.client.annotations.WorkbenchMenu; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnOpen; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.Command; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.menu.MenuFactory; -import org.uberfire.workbench.model.menu.Menus; - -@Dependent -@WorkbenchScreen(identifier = NotificationsScreen.SCREEN_ID) -public class NotificationsScreen { - - public static final String SCREEN_ID = "NotificationsScreen"; - - @Inject - Notifications notifications; - - @Inject - ErrorPopupPresenter errorPopupPresenter; - - @Inject - PlaceManager placeManager; - - private Menus menu = null; - - @PostConstruct - public void init() { - } - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.menu = makeMenuBar(); - } - - private Menus makeMenuBar() { - return MenuFactory - .newTopLevelMenu("Clear") - .respondsWith(getClearCommand()) - .endMenu() - .build(); - } - - private Command getClearCommand() { - return new Command() { - public void execute() { - notifications.clear(); - } - }; - } - - @OnOpen - public void onOpen() { - } - - @OnClose - public void onClose() { - notifications.clear(); - } - - @WorkbenchMenu - public void getMenus(final Consumer menusConsumer) { - menusConsumer.accept(menu); - } - - private void showError(final String message) { - errorPopupPresenter.showMessage(message); - } - - // TODO: I18n. - @WorkbenchPartTitle - public String getTitle() { - return "Notifications"; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return notifications.asWidget(); - } - - @WorkbenchContextId - public String getMyContextRef() { - return "stunnerNotificationsScreenContext"; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionDiagramEditorScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionDiagramEditorScreen.java deleted file mode 100644 index 4b51a4a6c7b..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionDiagramEditorScreen.java +++ /dev/null @@ -1,398 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.client.screens; - -import java.util.Collection; -import java.util.function.Consumer; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.enterprise.event.Event; -import javax.enterprise.event.Observes; -import javax.inject.Inject; - -import com.google.gwt.logging.client.LogConfiguration; -import com.google.gwt.user.client.ui.IsWidget; -import org.kie.workbench.common.stunner.backend.service.BackendFileSystemBootstrap; -import org.kie.workbench.common.stunner.client.widgets.menu.dev.MenuDevCommandsBuilder; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionPresenter; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionEditorPresenter; -import org.kie.workbench.common.stunner.client.widgets.toolbar.impl.ManagedEditorToolbar; -import org.kie.workbench.common.stunner.client.widgets.views.session.ScreenErrorView; -import org.kie.workbench.common.stunner.client.widgets.views.session.ScreenPanelView; -import org.kie.workbench.common.stunner.core.api.DefinitionManager; -import org.kie.workbench.common.stunner.core.client.annotation.DiagramEditor; -import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; -import org.kie.workbench.common.stunner.core.client.service.ClientFactoryService; -import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; -import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; -import org.kie.workbench.common.stunner.core.client.session.ClientSession; -import org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand; -import org.kie.workbench.common.stunner.core.client.session.event.OnSessionErrorEvent; -import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.kie.workbench.common.stunner.core.diagram.MetadataImpl; -import org.kie.workbench.common.stunner.core.graph.Graph; -import org.kie.workbench.common.stunner.core.rule.RuleViolation; -import org.kie.workbench.common.stunner.core.util.UUID; -import org.kie.workbench.common.stunner.core.validation.DiagramElementViolation; -import org.kie.workbench.common.stunner.core.validation.Violation; -import org.kie.workbench.common.stunner.core.validation.impl.ValidationUtils; -import org.uberfire.backend.vfs.PathFactory; -import org.uberfire.client.annotations.WorkbenchContextId; -import org.uberfire.client.annotations.WorkbenchMenu; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; -import org.uberfire.ext.widgets.common.client.common.BusyPopup; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnFocus; -import org.uberfire.lifecycle.OnLostFocus; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.Command; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.menu.MenuFactory; -import org.uberfire.workbench.model.menu.Menus; - -// TODO: i18n. -@Dependent -@DiagramEditor -@WorkbenchScreen(identifier = SessionDiagramEditorScreen.SCREEN_ID) -public class SessionDiagramEditorScreen { - - private static Logger LOGGER = Logger.getLogger(SessionDiagramEditorScreen.class.getName()); - - public static final String SCREEN_ID = "SessionDiagramEditorScreen"; - - private final DefinitionManager definitionManager; - private final ClientFactoryService clientFactoryServices; - private final ShowcaseDiagramService diagramService; - private final SessionEditorPresenter presenter; - private final Event changeTitleNotificationEvent; - private final MenuDevCommandsBuilder menuDevCommandsBuilder; - private final ScreenPanelView screenPanelView; - private final ScreenErrorView screenErrorView; - - private PlaceRequest placeRequest; - private String title = "Authoring Screen"; - private Menus menu = null; - - @Inject - public SessionDiagramEditorScreen(final DefinitionManager definitionManager, - final ClientFactoryService clientFactoryServices, - final ShowcaseDiagramService diagramService, - final SessionEditorPresenter presenter, - final Event changeTitleNotificationEvent, - final MenuDevCommandsBuilder menuDevCommandsBuilder, - final ScreenPanelView screenPanelView, - final ScreenErrorView screenErrorView) { - this.definitionManager = definitionManager; - this.clientFactoryServices = clientFactoryServices; - this.diagramService = diagramService; - this.presenter = presenter; - this.changeTitleNotificationEvent = changeTitleNotificationEvent; - this.menuDevCommandsBuilder = menuDevCommandsBuilder; - this.screenPanelView = screenPanelView; - this.screenErrorView = screenErrorView; - } - - @PostConstruct - @SuppressWarnings("unchecked") - public void init() { - } - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.placeRequest = placeRequest; - this.menu = makeMenuBar(); - final String name = placeRequest.getParameter("name", - ""); - final boolean isCreate = name == null || name.trim().length() == 0; - final Command callback = () -> { - final Diagram diagram = getDiagram(); - if (null != diagram) { - // Update screen title. - updateTitle(diagram.getMetadata().getTitle()); - } - }; - if (isCreate) { - final String defSetId = placeRequest.getParameter("defSetId", - ""); - final String shapeSetd = placeRequest.getParameter("shapeSetId", - ""); - final String title = placeRequest.getParameter("title", - ""); - // Create a new diagram. - newDiagram(UUID.uuid(), - title, - defSetId, - shapeSetd, - callback); - } else { - // Load an existing diagram. - load(name, - callback); - } - } - - private Menus makeMenuBar() { - final MenuFactory.TopLevelMenusBuilder m = - MenuFactory - .newTopLevelMenu("Save") - .respondsWith(getSaveCommand()) - .endMenu(); - m.newTopLevelMenu(menuDevCommandsBuilder.build()).endMenu(); - return m.build(); - } - - private Command getSaveCommand() { - return this::validateAndSave; - } - - private void validateAndSave() { - final Command save = this::save; - final ManagedEditorToolbar toolbar = (ManagedEditorToolbar) presenter.getToolbar(); - toolbar - .getValidateCommand() - .execute(new ClientSessionCommand.Callback>>() { - @Override - public void onSuccess() { - log(Level.INFO, - "Validation success."); - save.execute(); - } - - @Override - public void onError(final Collection> violations) { - log(Level.WARNING, - "Validation failed [violations=" + violations.toString() + "]."); - // Allow saving when only warnings founds. - final Violation.Type maxSeverity = ValidationUtils.getMaxSeverity(violations); - if (!maxSeverity.equals(Violation.Type.ERROR)) { - save.execute(); - } - } - }); - } - - private void save() { - diagramService.save(getSession(), - new ServiceCallback>() { - @Override - public void onSuccess(Diagram item) { - log(Level.INFO, - "Save operation finished for diagram [" + item.getName() + "]."); - } - - @Override - public void onError(ClientRuntimeError error) { - showError(error); - } - }); - } - - private void newDiagram(final String uuid, - final String title, - final String definitionSetId, - final String shapeSetId, - final Command callback) { - BusyPopup.showMessage("Loading"); - final Metadata metadata = buildMetadata(definitionSetId, - shapeSetId, - title); - clientFactoryServices.newDiagram(uuid, - definitionSetId, - metadata, - new ServiceCallback() { - @Override - public void onSuccess(final Diagram diagram) { - final Metadata metadata = diagram.getMetadata(); - metadata.setShapeSetId(shapeSetId); - metadata.setTitle(title); - open(diagram, - callback); - } - - @Override - public void onError(final ClientRuntimeError error) { - showError(error); - callback.execute(); - } - }); - } - - private void open(final Diagram diagram, - final Command callback) { - screenPanelView.setWidget(presenter.getView()); - presenter - .withToolbar(true) - .withPalette(true) - .displayNotifications(type -> true) - .open(diagram, - new ScreenPresenterCallback(callback)); - } - - private Metadata buildMetadata(final String defSetId, - final String shapeSetId, - final String title) { - return new MetadataImpl.MetadataImplBuilder(defSetId, - definitionManager) - .setTitle(title) - .setRoot(PathFactory.newPath(".", - BackendFileSystemBootstrap.VFS_PRO - + "://master@" - + BackendFileSystemBootstrap.VFS_ROOT + "/")) - .setShapeSetId(shapeSetId) - .build(); - } - - private void load(final String name, - final Command callback) { - BusyPopup.showMessage("Loading"); - diagramService.loadByName(name, - new ServiceCallback() { - @Override - public void onSuccess(final Diagram diagram) { - open(diagram, - callback); - } - - @Override - public void onError(final ClientRuntimeError error) { - showError(error); - callback.execute(); - } - }); - } - - @OnFocus - public void onFocus() { - presenter.focus(); - } - - private boolean isSameSession(final ClientSession other) { - return null != other && null != getSession() && other.equals(getSession()); - } - - @OnLostFocus - public void OnLostFocus() { - presenter.lostFocus(); - } - - @OnClose - public void onClose() { - presenter.destroy(); - } - - @WorkbenchMenu - public void getMenus(final Consumer menusConsumer) { - menusConsumer.accept(menu); - } - - @WorkbenchPartTitle - public String getTitle() { - return title; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return screenPanelView.asWidget(); - } - - @WorkbenchContextId - public String getMyContextRef() { - return "sessionDiagramEditorScreenContext"; - } - - private final class ScreenPresenterCallback implements SessionPresenter.SessionPresenterCallback { - - private final Command callback; - - private ScreenPresenterCallback(final Command callback) { - this.callback = callback; - } - - @Override - public void afterSessionOpened() { - - } - - @Override - public void afterCanvasInitialized() { - - } - - @Override - public void onSuccess() { - BusyPopup.close(); - callback.execute(); - } - - @Override - public void onError(final ClientRuntimeError error) { - showError(error); - callback.execute(); - } - } - - private void updateTitle(final String title) { - // Change screen title. - SessionDiagramEditorScreen.this.title = title; - changeTitleNotificationEvent.fire(new ChangeTitleWidgetEvent(placeRequest, - this.title)); - } - - private EditorSession getSession() { - return null != presenter ? presenter.getInstance() : null; - } - - private CanvasHandler getCanvasHandler() { - return null != getSession() ? getSession().getCanvasHandler() : null; - } - - private Diagram getDiagram() { - return null != getCanvasHandler() ? getCanvasHandler().getDiagram() : null; - } - - private void showError(final ClientRuntimeError error) { - screenErrorView.showError(error); - screenPanelView.setWidget(screenErrorView.asWidget()); - log(Level.SEVERE, - error.toString()); - BusyPopup.close(); - } - - void onSessionErrorEvent(@Observes OnSessionErrorEvent errorEvent) { - if (isSameSession(errorEvent.getSession())) { - showError(errorEvent.getError()); - // TODO executeWithConfirm( "An error happened [" + errorEvent.getError() + "]. Do you want" + - // "to refresh the diagram (Last changes can be lost)? ", this::menu_refresh ); - } - } - - private void log(final Level level, - final String message) { - if (LogConfiguration.loggingIsEnabled()) { - LOGGER.log(level, - message); - } - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionDiagramPreviewScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionDiagramPreviewScreen.java deleted file mode 100644 index 80d33f3ebdc..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionDiagramPreviewScreen.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.client.screens; - -import java.util.ArrayList; -import java.util.function.Consumer; -import java.util.logging.Logger; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.enterprise.event.Event; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Default; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.IsWidget; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.constants.ButtonSize; -import org.gwtbootstrap3.client.ui.constants.IconType; -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.kie.workbench.common.stunner.client.widgets.canvas.StunnerBoundsProviderFactory; -import org.kie.workbench.common.stunner.client.widgets.menu.MenuUtils; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionDiagramPreview; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionViewer; -import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; -import org.kie.workbench.common.stunner.core.client.session.impl.AbstractSession; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.uberfire.client.annotations.WorkbenchContextId; -import org.uberfire.client.annotations.WorkbenchMenu; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnOpen; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.menu.MenuFactory; -import org.uberfire.workbench.model.menu.MenuItem; -import org.uberfire.workbench.model.menu.Menus; - -import static java.util.logging.Level.FINE; -import static java.util.logging.Level.SEVERE; - -/** - * This screen provides a preview for a diagram. - * It is session aware - It shows the preview for the current session's diagram. - */ -// TODO: i18n. -@Dependent -@WorkbenchScreen(identifier = SessionDiagramPreviewScreen.SCREEN_ID) -public class SessionDiagramPreviewScreen extends AbstractSessionScreen { - - private static Logger LOGGER = Logger.getLogger(SessionDiagramPreviewScreen.class.getName()); - - public static final String SCREEN_ID = "SessionDiagramPreviewScreen"; - public static final String TITLE = "Preview"; - public static final int WIDTH = 420; - public static final int HEIGHT = StunnerBoundsProviderFactory.computeHeight(WIDTH); - - private final ManagedInstance> sessionPreviews; - private final SessionScreenView view; - private final Event changeTitleNotificationEvent; - - private PlaceRequest placeRequest; - private String title = TITLE; - private Menus menu; - private SessionDiagramPreview preview; - - @Inject - public SessionDiagramPreviewScreen(final @Any @Default ManagedInstance> sessionPreviews, - final SessionScreenView view, - final Event changeTitleNotificationEvent) { - this.sessionPreviews = sessionPreviews; - this.view = view; - this.changeTitleNotificationEvent = changeTitleNotificationEvent; - } - - @PostConstruct - public void init() { - view.showEmptySession(); - } - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.placeRequest = placeRequest; - this.menu = makeMenuBar(); - } - - @OnOpen - public void onOpen() { - } - - @OnClose - public void onClose() { - close(); - } - - @WorkbenchMenu - public void getMenus(final Consumer menusConsumer) { - menusConsumer.accept(menu); - } - - @WorkbenchPartTitle - public String getTitle() { - return title; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return view; - } - - @WorkbenchContextId - public String getMyContextRef() { - return "sessionDiagramPreviewScreenContext"; - } - - @Override - protected void doOpenDiagram() { - final AbstractSession session = getSession(); - preview = sessionPreviews.get(); - preview.open(session, - WIDTH, - HEIGHT, - new SessionViewer.SessionViewerCallback() { - @Override - public void afterCanvasInitialized() { - } - - @Override - public void onSuccess() { - LOGGER.log(FINE, - "Session's preview completed for [" + session + "]"); - view.showScreenView(preview.getView()); - } - - @Override - public void onError(final ClientRuntimeError error) { - LOGGER.log(SEVERE, - "Error while showing session preview for [" + session + "]. " + - "Error=[" + error + "]"); - } - }); - } - - @Override - protected void doCloseSession() { - view.showEmptySession(); - preview.destroy(); - sessionPreviews.destroy(preview); - preview = null; - } - - @Override - protected void doUpdateTitle(final String title) { - // Change screen title. - SessionDiagramPreviewScreen.this.title = title; - changeTitleNotificationEvent.fire(new ChangeTitleWidgetEvent(placeRequest, - this.title)); - } - - private void refresh() { - final AbstractSession session = getSession(); - open(session); - } - - private Menus makeMenuBar() { - return MenuFactory - .newTopLevelMenu("Refresh") - .withItems(new ArrayList(1) {{ - add(buildRefreshMenuItem()); - }}) - .endMenu() - .build(); - } - - private MenuItem buildRefreshMenuItem() { - return MenuUtils.buildItem(new Button() {{ - setIcon(IconType.REFRESH); - setSize(ButtonSize.SMALL); - setTitle("Refresh"); - addClickHandler(e -> SessionDiagramPreviewScreen.this.refresh()); - }}); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionDiagramViewerScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionDiagramViewerScreen.java deleted file mode 100644 index f8ba7b51d76..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionDiagramViewerScreen.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.standalone.client.screens; - -import java.util.ArrayList; -import java.util.function.Consumer; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.enterprise.event.Event; -import javax.enterprise.event.Observes; -import javax.inject.Inject; - -import com.google.gwt.logging.client.LogConfiguration; -import com.google.gwt.user.client.ui.IsWidget; -import org.kie.workbench.common.stunner.client.widgets.menu.dev.MenuDevCommandsBuilder; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.SessionPresenter; -import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; -import org.kie.workbench.common.stunner.client.widgets.views.session.ScreenErrorView; -import org.kie.workbench.common.stunner.client.widgets.views.session.ScreenPanelView; -import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; -import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; -import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; -import org.kie.workbench.common.stunner.core.client.session.ClientSession; -import org.kie.workbench.common.stunner.core.client.session.event.OnSessionErrorEvent; -import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.uberfire.client.annotations.WorkbenchContextId; -import org.uberfire.client.annotations.WorkbenchMenu; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; -import org.uberfire.ext.widgets.common.client.common.BusyPopup; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnFocus; -import org.uberfire.lifecycle.OnLostFocus; -import org.uberfire.lifecycle.OnOpen; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.Command; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.menu.MenuFactory; -import org.uberfire.workbench.model.menu.MenuItem; -import org.uberfire.workbench.model.menu.Menus; - -import static java.util.logging.Level.SEVERE; -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -// TODO: i18n. -@Dependent -@WorkbenchScreen(identifier = SessionDiagramViewerScreen.SCREEN_ID) -public class SessionDiagramViewerScreen { - - private static Logger LOGGER = Logger.getLogger(SessionDiagramViewerScreen.class.getName()); - - public static final String SCREEN_ID = "SessionDiagramViewerScreen"; - - private final ShowcaseDiagramService diagramLoader; - private final SessionViewerPresenter presenter; - private final Event changeTitleNotificationEvent; - private final MenuDevCommandsBuilder menuDevCommandsBuilder; - private final ScreenPanelView screenPanelView; - private final ScreenErrorView screenErrorView; - - private PlaceRequest placeRequest; - private String title = "Viewer Screen"; - private Menus menu = null; - - @Inject - public SessionDiagramViewerScreen(final ShowcaseDiagramService diagramLoader, - final SessionViewerPresenter presenter, - final Event changeTitleNotificationEvent, - final MenuDevCommandsBuilder menuDevCommandsBuilder, - final ScreenPanelView screenPanelView, - final ScreenErrorView screenErrorView) { - this.diagramLoader = diagramLoader; - this.presenter = presenter; - this.changeTitleNotificationEvent = changeTitleNotificationEvent; - this.menuDevCommandsBuilder = menuDevCommandsBuilder; - this.screenPanelView = screenPanelView; - this.screenErrorView = screenErrorView; - } - - @PostConstruct - @SuppressWarnings("unchecked") - public void init() { - } - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.placeRequest = placeRequest; - this.menu = makeMenuBar(); - final String name = placeRequest.getParameter("name", - ""); - final boolean isCreate = name == null || name.trim().length() == 0; - if (isCreate) { - LOGGER.log(SEVERE, - "This screen it's just read only!"); - } else { - // Load an existing diagram. - load(name, - () -> { - final Diagram diagram = getDiagram(); - if (null != diagram) { - // Update screen title. - updateTitle(diagram.getMetadata().getTitle()); - } - }); - } - } - - private Menus makeMenuBar() { - return MenuFactory - .newTopLevelMenu("Dev") - .withItems(new ArrayList(1) {{ - add(menuDevCommandsBuilder.build()); - }}) - .endMenu() - .build(); - } - - private void load(final String name, - final Command callback) { - BusyPopup.showMessage("Loading"); - diagramLoader.loadByName(name, - new ServiceCallback() { - @Override - public void onSuccess(final Diagram diagram) { - open(diagram, - callback); - } - - @Override - public void onError(final ClientRuntimeError error) { - SessionDiagramViewerScreen.this.showError(error); - callback.execute(); - } - }); - } - - private void open(final Diagram diagram, - final Command callback) { - screenPanelView.setWidget(presenter.getView()); - presenter - .withToolbar(true) - .withPalette(false) - .displayNotifications(type -> true) - .open(diagram, - new SessionPresenter.SessionPresenterCallback() { - @Override - public void afterSessionOpened() { - - } - - @Override - public void afterCanvasInitialized() { - - } - - @Override - public void onSuccess() { - BusyPopup.close(); - callback.execute(); - } - - @Override - public void onError(final ClientRuntimeError error) { - SessionDiagramViewerScreen.this.showError(error); - callback.execute(); - } - }); - } - - private void updateTitle(final String title) { - // Change screen title. - SessionDiagramViewerScreen.this.title = title; - changeTitleNotificationEvent.fire(new ChangeTitleWidgetEvent(placeRequest, - this.title)); - } - - @OnOpen - public void onOpen() { - } - - @OnFocus - public void onFocus() { - } - - private boolean isSameSession(final ClientSession other) { - checkNotNull("session", - getSession()); - return null != other && getSession().equals(other); - } - - @OnLostFocus - public void OnLostFocus() { - } - - @OnClose - public void onClose() { - presenter.destroy(); - } - - @WorkbenchMenu - public void getMenus(final Consumer menusConsumer) { - menusConsumer.accept(menu); - } - - @WorkbenchPartTitle - public String getTitle() { - return title; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return screenPanelView.asWidget(); - } - - @WorkbenchContextId - public String getMyContextRef() { - return "sessionDiagramViewerScreenContext"; - } - - private ViewerSession getSession() { - return null != presenter ? presenter.getInstance() : null; - } - - private CanvasHandler getCanvasHandler() { - return null != getSession() ? getSession().getCanvasHandler() : null; - } - - private Diagram getDiagram() { - return null != getCanvasHandler() ? getCanvasHandler().getDiagram() : null; - } - - private void showError(final ClientRuntimeError error) { - screenErrorView.showError(error); - screenPanelView.setWidget(screenErrorView.asWidget()); - log(Level.SEVERE, - error.toString()); - BusyPopup.close(); - } - - void onSessionErrorEvent(@Observes OnSessionErrorEvent errorEvent) { - if (null != getSession() && isSameSession(errorEvent.getSession())) { - showError(errorEvent.getError()); - // TODO executeWithConfirm( "An error happened [" + errorEvent.getError() + "]. Do you want" + - // "to refresh the diagram (Last changes can be lost)? ", this::menu_refresh ); - } - } - - private void log(final Level level, - final String message) { - if (LogConfiguration.loggingIsEnabled()) { - LOGGER.log(level, - message); - } - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionPropertiesScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionPropertiesScreen.java deleted file mode 100644 index 8eb360b876b..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionPropertiesScreen.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.standalone.client.screens; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.enterprise.event.Event; -import javax.enterprise.event.Observes; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.IsWidget; -import org.jboss.errai.common.client.ui.ElementWrapperWidget; -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.kie.workbench.common.stunner.forms.client.event.FormPropertiesOpened; -import org.kie.workbench.common.stunner.forms.client.widgets.FormPropertiesWidget; -import org.uberfire.client.annotations.WorkbenchContextId; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnOpen; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; - -/** - * This screen wraps the FormsProperties widget. - * It is session aware - It shows the properties view for the current session's selection element. - */ -@Dependent -@WorkbenchScreen(identifier = SessionPropertiesScreen.SCREEN_ID) -public class SessionPropertiesScreen extends AbstractSessionScreen { - - public static final String SCREEN_ID = "SessionPropertiesScreen"; - - @Inject - private ManagedInstance formPropertiesWidgets; - - @Inject - private SessionScreenView view; - - @Inject - private PlaceManager placeManager; - - @Inject - private Event changeTitleNotificationEvent; - - private PlaceRequest placeRequest; - private String title = "Properties"; - private FormPropertiesWidget widget; - - @PostConstruct - public void init() { - } - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.placeRequest = placeRequest; - } - - @OnOpen - public void onOpen() { - } - - @OnClose - public void onClose() { - close(); - } - - @WorkbenchPartTitle - public String getTitle() { - return title; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return view; - } - - @WorkbenchContextId - public String getMyContextRef() { - return "sessionPropertiesScreenContext"; - } - - @Override - protected void doOpenDiagram() { - widget = formPropertiesWidgets.get(); - view.showScreenView(ElementWrapperWidget.getWidget(widget.getElement())); - widget.bind(getSession()) - .show(); - } - - @Override - protected void doCloseSession() { - view.clear(); - if (null != widget) { - widget.destroy(); - widget = null; - } - formPropertiesWidgets.destroyAll(); - } - - @Override - protected void doUpdateTitle(String title) { - updateTitle(title); - } - - void onFormPropertiesOpened(final @Observes FormPropertiesOpened propertiesOpened) { - if (null != getSession() && getSession().equals(propertiesOpened.getSession())) { - updateTitle(propertiesOpened.getName()); - } - } - - private void updateTitle(final String title) { - // Change screen title. - SessionPropertiesScreen.this.title = title; - if (null != title && title.trim().length() > 0) { - changeTitleNotificationEvent.fire(new ChangeTitleWidgetEvent(placeRequest, - title)); - } - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionScreenView.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionScreenView.java deleted file mode 100644 index dfcc5db68c5..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionScreenView.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.standalone.client.screens; - -import com.google.gwt.user.client.ui.IsWidget; - -public interface SessionScreenView extends IsWidget { - - void showEmptySession(); - - void showScreenView(final IsWidget view); - - void setScreenViewBgColor(final String color); - - void setMarginTop(final int px); - - void setPaddingTop(final int px); - - void clear(); -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionScreenViewImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionScreenViewImpl.java deleted file mode 100644 index 5c67702c88b..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionScreenViewImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.standalone.client.screens; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; - -import com.google.gwt.dom.client.Style; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.Heading; -import org.gwtbootstrap3.client.ui.constants.HeadingSize; - -// TODO: i18N. -@Dependent -public class SessionScreenViewImpl implements SessionScreenView { - - private static final String EMPTY_TEXT = "No diagram session active."; - - private final FlowPanel mainPanel = new FlowPanel(); - private final FlowPanel emptyViewPanel = new FlowPanel(); - private final FlowPanel screenViewPanel = new FlowPanel(); - - @PostConstruct - public void init() { - mainPanel.add(emptyViewPanel); - mainPanel.add(screenViewPanel); - mainPanel.setHeight("100%"); - this.emptyViewPanel.setHeight("100%"); - this.emptyViewPanel.getElement().getStyle().setTextAlign(Style.TextAlign.CENTER); - this.screenViewPanel.setHeight("100%"); - this.emptyViewPanel.add(new Heading(HeadingSize.H5, - EMPTY_TEXT)); - showEmptySession(); - } - - @Override - public void showEmptySession() { - emptyViewPanel.setVisible(true); - screenViewPanel.setVisible(false); - } - - @Override - public void showScreenView(final IsWidget viewWidget) { - emptyViewPanel.setVisible(false); - setScreenView(viewWidget); - screenViewPanel.setVisible(true); - } - - @Override - public void setScreenViewBgColor(final String color) { - screenViewPanel.getElement().getStyle().setBackgroundColor(color); - } - - @Override - public void setMarginTop(final int px) { - this.emptyViewPanel.getElement().getStyle().setMarginTop(px, - Style.Unit.PX); - this.screenViewPanel.getElement().getStyle().setMarginTop(px, - Style.Unit.PX); - } - - @Override - public void setPaddingTop(final int px) { - this.emptyViewPanel.getElement().getStyle().setPaddingTop(px, - Style.Unit.PX); - this.screenViewPanel.getElement().getStyle().setPaddingTop(px, - Style.Unit.PX); - } - - @Override - public void clear() { - this.screenViewPanel.clear(); - } - - private SessionScreenView setScreenView(final IsWidget view) { - clear(); - this.screenViewPanel.add(view); - return this; - } - - @Override - public Widget asWidget() { - return mainPanel; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionTreeExplorerScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionTreeExplorerScreen.java deleted file mode 100644 index 3b1fccc89f1..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/SessionTreeExplorerScreen.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ -package org.kie.workbench.common.stunner.standalone.client.screens; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.enterprise.event.Event; -import javax.enterprise.inject.Any; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.IsWidget; -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.kie.workbench.common.stunner.client.widgets.explorer.tree.TreeExplorer; -import org.uberfire.client.annotations.WorkbenchContextId; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.client.workbench.events.ChangeTitleWidgetEvent; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnOpen; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; - -// TODO: I18n. -@Dependent -@WorkbenchScreen(identifier = SessionTreeExplorerScreen.SCREEN_ID) -public class SessionTreeExplorerScreen extends AbstractSessionScreen { - - public static final String SCREEN_ID = "SessionTreeExplorerScreen"; - public static final String TITLE = "Explorer"; - - private final ManagedInstance treeExplorers; - private final SessionScreenView view; - private final Event changeTitleNotificationEvent; - - private PlaceRequest placeRequest; - private String title = TITLE; - private TreeExplorer widget; - - @Inject - public SessionTreeExplorerScreen(final @Any ManagedInstance treeExplorers, - final SessionScreenView view, - final Event changeTitleNotificationEvent) { - this.treeExplorers = treeExplorers; - this.view = view; - this.changeTitleNotificationEvent = changeTitleNotificationEvent; - } - - @PostConstruct - public void init() { - view.showEmptySession(); - } - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.placeRequest = placeRequest; - } - - @OnOpen - public void onOpen() { - } - - @OnClose - public void onClose() { - close(); - } - - @WorkbenchPartTitle - public String getTitle() { - return title; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return view; - } - - @WorkbenchContextId - public String getMyContextRef() { - return "sessionTreeExplorerScreenContext"; - } - - @Override - protected void doOpenDiagram() { - widget = treeExplorers.get(); - widget.show(getCanvasHandler()); - view.showScreenView(widget); - } - - @Override - protected void doCloseSession() { - view.clear(); - treeExplorers.destroyAll(); - widget = null; - } - - protected void doUpdateTitle(final String title) { - // Change screen title. - SessionTreeExplorerScreen.this.title = title; - changeTitleNotificationEvent.fire(new ChangeTitleWidgetEvent(placeRequest, - this.title)); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/ShowcaseDiagramService.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/ShowcaseDiagramService.java deleted file mode 100644 index 7cc0a27e269..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/ShowcaseDiagramService.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.client.screens; - -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; - -import org.kie.workbench.common.stunner.client.widgets.presenters.diagram.impl.DiagramLoader; -import org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler; -import org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler; -import org.kie.workbench.common.stunner.core.client.canvas.export.CanvasExport; -import org.kie.workbench.common.stunner.core.client.canvas.export.CanvasURLExportSettings; -import org.kie.workbench.common.stunner.core.client.service.ClientDiagramServiceImpl; -import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; -import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; -import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; -import org.kie.workbench.common.stunner.core.diagram.Diagram; -import org.kie.workbench.common.stunner.core.diagram.Metadata; -import org.kie.workbench.common.stunner.core.graph.Graph; -import org.kie.workbench.common.stunner.core.lookup.LookupManager; -import org.kie.workbench.common.stunner.core.lookup.diagram.DiagramLookupRequest; -import org.kie.workbench.common.stunner.core.lookup.diagram.DiagramRepresentation; -import org.uberfire.backend.vfs.Path; - -@ApplicationScoped -public class ShowcaseDiagramService { - - private final DiagramLoader diagramLoader; - private final ClientDiagramServiceImpl clientDiagramServices; - private final CanvasExport canvasExport; - - @Inject - public ShowcaseDiagramService(final DiagramLoader diagramLoader, - final ClientDiagramServiceImpl clientDiagramServices, - final CanvasExport canvasExport) { - this.diagramLoader = diagramLoader; - this.clientDiagramServices = clientDiagramServices; - this.canvasExport = canvasExport; - } - - public void loadByName(final String name, - final ServiceCallback callback) { - final DiagramLookupRequest request = new DiagramLookupRequest.Builder().withName(name).build(); - clientDiagramServices.lookup(request, - new ServiceCallback>() { - @Override - public void onSuccess(LookupManager.LookupResponse diagramRepresentations) { - if (null != diagramRepresentations && !diagramRepresentations.getResults().isEmpty()) { - final Path path = diagramRepresentations.getResults().get(0).getPath(); - loadByPath(path, - callback); - } - } - - @Override - public void onError(final ClientRuntimeError error) { - callback.onError(error); - } - }); - } - - @SuppressWarnings("unchecked") - public void loadByPath(final Path path, - final ServiceCallback callback) { - diagramLoader.loadByPath(path, callback); - } - - @SuppressWarnings("unchecked") - public void save(final Diagram diagram, - final ServiceCallback> diagramServiceCallback) { - // Perform update operation remote call. - clientDiagramServices.saveOrUpdate(diagram, - diagramServiceCallback); - } - - // TODO: Move this to ClientFactoryServices, so shared for others as well. - public void save(final EditorSession session, - final ServiceCallback> diagramServiceCallback) { - // Update diagram's image data as thumbnail. - final String thumbData = toImageData(session); - final CanvasHandler canvasHandler = session.getCanvasHandler(); - final Diagram diagram = canvasHandler.getDiagram(); - diagram.getMetadata().setThumbData(thumbData); - save(diagram, - diagramServiceCallback); - } - - private String toImageData(final EditorSession session) { - return canvasExport.toImageData(session.getCanvasHandler(), - CanvasURLExportSettings.build(CanvasExport.URLDataType.JPG)); - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/WelcomeScreen.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/WelcomeScreen.java deleted file mode 100644 index 7b83b098b4c..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/screens/WelcomeScreen.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.client.screens; - -import java.util.function.Consumer; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; - -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.IsWidget; -import org.gwtbootstrap3.client.ui.Heading; -import org.gwtbootstrap3.client.ui.constants.HeadingSize; -import org.kie.workbench.common.stunner.core.client.util.StunnerClientLogger; -import org.uberfire.client.annotations.WorkbenchContextId; -import org.uberfire.client.annotations.WorkbenchMenu; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnOpen; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.menu.MenuFactory; -import org.uberfire.workbench.model.menu.Menus; - -@Dependent -@WorkbenchScreen(identifier = WelcomeScreen.SCREEN_ID) -public class WelcomeScreen { - - public static final String SCREEN_ID = "WelcomeScreen"; - - private class View extends FlowPanel { - - public View(final String tag) { - super(tag); - init(); - } - - public View() { - init(); - } - - private void init() { - add(new Heading(HeadingSize.H1, - "Welcome to Stunner!")); - } - } - - private Menus menu = null; - private View view = new View(); - - @PostConstruct - public void init() { - } - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.menu = makeMenuBar(); - } - - private Menus makeMenuBar() { - return MenuFactory - .newTopLevelMenu("Switch log level") - .respondsWith(StunnerClientLogger::switchLogLevel) - .endMenu() - .build(); - } - - @OnOpen - public void onOpen() { - } - - @OnClose - public void onClose() { - } - - @WorkbenchMenu - public void getMenus(final Consumer menusConsumer) { - menusConsumer.accept(menu); - } - - @WorkbenchPartTitle - public String getTitle() { - return "Welcome"; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return view; - } - - @WorkbenchContextId - public String getMyContextRef() { - return "welcomeScreenContext"; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/AssigneeLiveSearchStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/AssigneeLiveSearchStandaloneService.java new file mode 100644 index 00000000000..efd89fa2ad9 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/AssigneeLiveSearchStandaloneService.java @@ -0,0 +1,84 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.services; + +import java.util.function.Consumer; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.AssigneeLiveSearchService; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.AssigneeLocalSearchService; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.assigneeEditor.widget.AssigneeLiveSearchEntryCreationEditor; +import org.kie.workbench.common.stunner.bpmn.forms.model.AssigneeType; +import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchCallback; + +@Dependent +public class AssigneeLiveSearchStandaloneService implements AssigneeLiveSearchService { + + private final AssigneeLiveSearchEntryCreationEditor editor; + private AssigneeLocalSearchService localSearchService; + + @Inject + public AssigneeLiveSearchStandaloneService(final AssigneeLiveSearchEntryCreationEditor editor) { + this.editor = editor; + } + + @PostConstruct + public void postConstruct() { + this.localSearchService = AssigneeLocalSearchService.build(editor); + } + + @Override + public void init(final AssigneeType type) { + } + + @Override + public void addCustomEntry(final String customEntry) { + localSearchService.addCustomEntry(customEntry); + } + + @Override + public void setSearchErrorHandler(final Consumer searchErrorHandler) { + } + + @Override + public void search(final String pattern, + final int maxResults, + final LiveSearchCallback callback) { + localSearchService.search(pattern, maxResults, callback); + } + + @Override + public void searchEntry(final String key, + final LiveSearchCallback callback) { + localSearchService.searchEntry(key, callback); + } + + @Override + public AssigneeLiveSearchEntryCreationEditor getEditor() { + return editor; + } + + @PreDestroy + public void destroy() { + localSearchService.destroy(); + localSearchService = null; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/BPMNStandaloneClientDiagramServiceImpl.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/BPMNStandaloneClientDiagramServiceImpl.java new file mode 100644 index 00000000000..3171d0e7024 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/BPMNStandaloneClientDiagramServiceImpl.java @@ -0,0 +1,107 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.services; + +import java.util.Objects; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import elemental2.promise.Promise; +import org.jboss.errai.common.client.api.Caller; +import org.jboss.errai.common.client.api.RemoteCallback; +import org.kie.workbench.common.stunner.core.client.api.ShapeManager; +import org.kie.workbench.common.stunner.core.client.service.ServiceCallback; +import org.kie.workbench.common.stunner.core.diagram.Diagram; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.kie.workbench.common.stunner.core.util.StringUtils; +import org.kie.workbench.common.stunner.kogito.api.editor.DiagramType; +import org.kie.workbench.common.stunner.kogito.api.editor.impl.KogitoDiagramResourceImpl; +import org.kie.workbench.common.stunner.kogito.api.service.KogitoDiagramService; +import org.kie.workbench.common.stunner.kogito.client.service.KogitoClientDiagramService; +import org.uberfire.backend.vfs.Path; +import org.uberfire.backend.vfs.VFSService; +import org.uberfire.client.promise.Promises; + +@ApplicationScoped +public class BPMNStandaloneClientDiagramServiceImpl implements KogitoClientDiagramService { + + private ShapeManager shapeManager; + private Caller vfsServiceCaller; + private Caller kogitoDiagramServiceCaller; + private Promises promises; + + public BPMNStandaloneClientDiagramServiceImpl() { + //CDI proxy + } + + @Inject + public BPMNStandaloneClientDiagramServiceImpl(final ShapeManager shapeManager, + final Caller vfsServiceCaller, + final Caller kogitoDiagramServiceCaller, + final Promises promises) { + this.shapeManager = shapeManager; + this.vfsServiceCaller = vfsServiceCaller; + this.kogitoDiagramServiceCaller = kogitoDiagramServiceCaller; + this.promises = promises; + } + + public void saveAsXml(final Path path, + final String xml, + final ServiceCallback callback) { + vfsServiceCaller.call((Path p) -> { + callback.onSuccess(xml); + }).write(path, xml); + } + + public void loadAsXml(final Path path, + final ServiceCallback callback) { + vfsServiceCaller.call((RemoteCallback) callback::onSuccess).readAllString(path); + } + + //Kogito requirements + + @Override + public void transform(final String xml, + final ServiceCallback callback) { + kogitoDiagramServiceCaller.call((Diagram d) -> { + updateClientMetadata(d); + callback.onSuccess(d); + }).transform(xml); + } + + @Override + public Promise transform(final KogitoDiagramResourceImpl resource) { + if (resource.getType() == DiagramType.PROJECT_DIAGRAM) { + return promises.promisify(kogitoDiagramServiceCaller, + s -> { + return s.transform(resource.projectDiagram().orElseThrow(() -> new IllegalStateException("DiagramType is PROJECT_DIAGRAM however no instance present"))); + }); + } + return promises.resolve(resource.xmlDiagram().orElse("DiagramType is XML_DIAGRAM however no instance present")); + } + + private void updateClientMetadata(final Diagram diagram) { + if (null != diagram) { + final Metadata metadata = diagram.getMetadata(); + if (Objects.nonNull(metadata) && StringUtils.isEmpty(metadata.getShapeSetId())) { + final String sId = shapeManager.getDefaultShapeSet(metadata.getDefinitionSetId()).getId(); + metadata.setShapeSetId(sId); + } + } + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/ConditionEditorAvailableFunctionsStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/ConditionEditorAvailableFunctionsStandaloneService.java new file mode 100644 index 00000000000..20a96e59a8b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/ConditionEditorAvailableFunctionsStandaloneService.java @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.services; + +import java.util.Collections; +import java.util.List; + +import javax.enterprise.context.ApplicationScoped; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorAvailableFunctionsService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.FunctionDef; + +@ApplicationScoped +public class ConditionEditorAvailableFunctionsStandaloneService implements ConditionEditorAvailableFunctionsService { + + @Override + public Promise> call(final Input input) { + return Promise.resolve(Collections.emptyList()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/ConditionEditorGeneratorStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/ConditionEditorGeneratorStandaloneService.java new file mode 100644 index 00000000000..b21cddb9a5f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/ConditionEditorGeneratorStandaloneService.java @@ -0,0 +1,33 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.services; + +import javax.enterprise.context.ApplicationScoped; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorGeneratorService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.Condition; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.GenerateConditionResult; + +@ApplicationScoped +public class ConditionEditorGeneratorStandaloneService implements ConditionEditorGeneratorService { + + @Override + public Promise call(final Condition condition) { + return Promise.resolve(new GenerateConditionResult("")); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/ConditionEditorMetadataStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/ConditionEditorMetadataStandaloneService.java new file mode 100644 index 00000000000..ab7935e75e6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/ConditionEditorMetadataStandaloneService.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.services; + +import java.util.Collections; + +import javax.enterprise.context.ApplicationScoped; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorMetadataService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQuery; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.TypeMetadataQueryResult; + +@ApplicationScoped +public class ConditionEditorMetadataStandaloneService implements ConditionEditorMetadataService { + + @Override + public Promise call(final TypeMetadataQuery query) { + return Promise.resolve(new TypeMetadataQueryResult(Collections.emptySet(), + Collections.emptySet())); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/ConditionEditorParsingStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/ConditionEditorParsingStandaloneService.java new file mode 100644 index 00000000000..d661ba6eee6 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/ConditionEditorParsingStandaloneService.java @@ -0,0 +1,33 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.services; + +import javax.enterprise.context.ApplicationScoped; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.forms.fields.conditionEditor.ConditionEditorParsingService; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.Condition; +import org.kie.workbench.common.stunner.bpmn.forms.conditions.ParseConditionResult; + +@ApplicationScoped +public class ConditionEditorParsingStandaloneService implements ConditionEditorParsingService { + + @Override + public Promise call(final String input) { + return Promise.resolve(new ParseConditionResult(new Condition("return false;"))); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/DataTypeNamesStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/DataTypeNamesStandaloneService.java new file mode 100644 index 00000000000..7f27b0d5598 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/DataTypeNamesStandaloneService.java @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.services; + +import java.util.Collections; +import java.util.List; + +import javax.enterprise.context.ApplicationScoped; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.forms.DataTypeNamesService; +import org.uberfire.backend.vfs.Path; + +@ApplicationScoped +public class DataTypeNamesStandaloneService implements DataTypeNamesService { + + @Override + public Promise> call(final Path path) { + return Promise.resolve(Collections.emptyList()); + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/DiagramTypeClientStandaloneService.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/DiagramTypeClientStandaloneService.java new file mode 100644 index 00000000000..3a019ec377b --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/DiagramTypeClientStandaloneService.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.services; + +import javax.enterprise.context.ApplicationScoped; + +import org.kie.workbench.common.stunner.bpmn.client.diagram.DiagramTypeClientService; +import org.kie.workbench.common.stunner.bpmn.service.ProjectType; +import org.kie.workbench.common.stunner.core.diagram.Metadata; + +@ApplicationScoped +public class DiagramTypeClientStandaloneService implements DiagramTypeClientService { + + @Override + public void loadDiagramType(final Metadata metadata) { + } + + @Override + public ProjectType getProjectType(final Metadata metadata) { + return ProjectType.BPMN; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/WorkItemDefinitionStandaloneClientService.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/WorkItemDefinitionStandaloneClientService.java new file mode 100644 index 00000000000..6bb9d3c1a7c --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/services/WorkItemDefinitionStandaloneClientService.java @@ -0,0 +1,58 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.stunner.standalone.client.services; + +import java.util.Collection; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.inject.Default; +import javax.enterprise.inject.Produces; +import javax.inject.Inject; + +import elemental2.promise.Promise; +import org.kie.workbench.common.stunner.bpmn.client.workitem.WorkItemDefinitionClientService; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry; +import org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistry; +import org.kie.workbench.common.stunner.core.diagram.Metadata; +import org.uberfire.client.promise.Promises; + +@ApplicationScoped +public class WorkItemDefinitionStandaloneClientService implements WorkItemDefinitionClientService { + + private final Promises promises; + private final WorkItemDefinitionCacheRegistry registry; + + @Inject + public WorkItemDefinitionStandaloneClientService(final Promises promises, + final WorkItemDefinitionCacheRegistry registry) { + this.promises = promises; + this.registry = registry; + } + + @Override + public Promise> call(final Metadata input) { + return promises.resolve(registry.items()); + } + + @Produces + @Default + @Override + public WorkItemDefinitionRegistry getRegistry() { + return registry; + } +} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/widgets/Notifications.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/widgets/Notifications.java deleted file mode 100644 index 90bd33ef1ea..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/widgets/Notifications.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.client.widgets; - -import java.util.List; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.cell.client.Cell; -import com.google.gwt.cell.client.TextCell; -import com.google.gwt.user.cellview.client.ColumnSortEvent; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.Widget; -import com.google.gwt.view.client.HasData; -import com.google.gwt.view.client.ListDataProvider; -import com.google.gwt.view.client.ProvidesKey; -import org.kie.workbench.common.stunner.client.widgets.notification.Notification; -import org.kie.workbench.common.stunner.client.widgets.notification.NotificationsObserver; -import org.uberfire.client.mvp.UberView; - -@Dependent -public class Notifications implements IsWidget { - - public interface View extends UberView { - - View setColumnSortHandler(final ColumnSortEvent.ListHandler sortHandler); - - View addColumn(final com.google.gwt.user.cellview.client.Column column, - final double pixelsWidth, - final String name); - - View removeColumn(final int index); - - int getColumnCount(); - - View redraw(); - - View clear(); - } - - private final View view; - private final NotificationsObserver notificationsObserver; - - final ListDataProvider logsProvider = new ListDataProvider<>(); - - @Inject - public Notifications(final View view, - final NotificationsObserver notificationsObserver) { - this.view = view; - this.notificationsObserver = notificationsObserver; - } - - @PostConstruct - public void init() { - view.init(this); - notificationsObserver.onNotification(this::add); - buildViewColumns(); - } - - @Override - public Widget asWidget() { - return view.asWidget(); - } - - public void add(final Notification notification) { - if (null != notification) { - addLogEntry(notification); - view.redraw(); - } - } - - public void clear() { - logsProvider.getList().clear(); - view.clear(); - } - - /* ****************************************************************************************************** - VIEW CALLBACKS - ****************************************************************************************************** */ - - final ProvidesKey KEY_PROVIDER = item -> item == null ? null : item.hashCode(); - - /** - * View callback for getting the list. - */ - void addDataDisplay(final HasData display) { - logsProvider.addDataDisplay(display); - } - - protected void buildViewColumns() { - int columnCount = view.getColumnCount(); - while (columnCount > 0) { - view.removeColumn(0); - columnCount = view.getColumnCount(); - } - // Attach a column sort handler to the ListDataProvider to sort the list. - ColumnSortEvent.ListHandler sortHandler = new ColumnSortEvent.ListHandler(logsProvider.getList()); - view.setColumnSortHandler(sortHandler); - // Log's type. - final com.google.gwt.user.cellview.client.Column typeColumn = createTypeColumn(sortHandler); - if (typeColumn != null) { - view.addColumn(typeColumn, - 100, - "Severity"); - } - // Log element's UUID. - final com.google.gwt.user.cellview.client.Column contextColumn = createContextColumn(sortHandler); - if (contextColumn != null) { - view.addColumn(contextColumn, - 300, - "Context"); - } - // Log's message. - final com.google.gwt.user.cellview.client.Column messageColumn = createMessageColumn(sortHandler); - if (messageColumn != null) { - view.addColumn(messageColumn, - 600, - "Message"); - } - } - - private void addLogEntry(final Notification entry) { - List logs = logsProvider.getList(); - logs.remove(entry); - logs.add(entry); - } - - private com.google.gwt.user.cellview.client.Column createTypeColumn(ColumnSortEvent.ListHandler sortHandler) { - // Log type.. - final Cell typeCell = new TextCell(); - final com.google.gwt.user.cellview.client.Column typeColumn = new com.google.gwt.user.cellview.client.Column(typeCell) { - @Override - public String getValue(final Notification object) { - return getNotificationTypeMessage(object); - } - }; - typeColumn.setSortable(true); - sortHandler.setComparator(typeColumn, - (o1, o2) -> o1.getType().compareTo(o2.getType())); - return typeColumn; - } - - private com.google.gwt.user.cellview.client.Column createContextColumn(ColumnSortEvent.ListHandler sortHandler) { - // Log element's context. - final Cell contextCell = new TextCell(); - final com.google.gwt.user.cellview.client.Column contextColumn = new com.google.gwt.user.cellview.client.Column(contextCell) { - @Override - public String getValue(final Notification object) { - return getNotificationContextMessage(object); - } - }; - contextColumn.setSortable(false); - return contextColumn; - } - - private com.google.gwt.user.cellview.client.Column createMessageColumn(ColumnSortEvent.ListHandler sortHandler) { - // Log message. - final Cell messageCell = new TextCell(); - final com.google.gwt.user.cellview.client.Column messageColumn = new com.google.gwt.user.cellview.client.Column(messageCell) { - @Override - public String getValue(final Notification object) { - return getNotificationSourceMessage(object); - } - }; - messageColumn.setSortable(false); - return messageColumn; - } - - @SuppressWarnings("unchecked") - private String getNotificationSourceMessage(final Notification notification) { - return (String) notification.getSource() - .map(s -> notification.getMessage()) - .orElse("-- No source --"); - } - - @SuppressWarnings("unchecked") - private String getNotificationContextMessage(final Notification notification) { - return notification.getContext() != null ? - notification.getContext().toString() : - "-- No context --"; - } - - @SuppressWarnings("unchecked") - private String getNotificationTypeMessage(final Notification notification) { - return notification.getType() != null ? - "[" + notification.getType().name() + "]" : - "[ ]"; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/widgets/NotificationsView.java b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/widgets/NotificationsView.java deleted file mode 100644 index 6fe264b6f30..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/widgets/NotificationsView.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.stunner.standalone.client.widgets; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.Style; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.cellview.client.Column; -import com.google.gwt.user.cellview.client.ColumnSortEvent; -import com.google.gwt.user.cellview.client.SimplePager; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.Row; -import org.gwtbootstrap3.client.ui.gwt.CellTable; -import org.kie.workbench.common.stunner.client.widgets.notification.Notification; - -public class NotificationsView extends Composite implements Notifications.View { - - interface ViewBinder extends UiBinder { - - } - - private static ViewBinder uiBinder = GWT.create(ViewBinder.class); - - @UiField - Row logsRow; - - @UiField(provided = true) - CellTable logsGrid; - - @UiField(provided = true) - SimplePager logsGridPager; - - Notifications presenter; - - @Override - public void init(final Notifications presenter) { - this.presenter = presenter; - initGrid(); - initWidget(uiBinder.createAndBindUi(this)); - } - - private void initGrid() { - // Init the logs grid. - logsGrid = new CellTable(presenter.KEY_PROVIDER); - logsGrid.setWidth("100%", - true); - // Do not refresh the headers and footers every time the data is updated. - logsGrid.setAutoHeaderRefreshDisabled(true); - logsGrid.setAutoFooterRefreshDisabled(true); - // Create a Pager to control the table. - SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class); - logsGridPager = new SimplePager(SimplePager.TextLocation.CENTER, - pagerResources, - false, - 0, - true); - logsGridPager.setDisplay(logsGrid); - presenter.addDataDisplay(logsGrid); - } - - @Override - public Notifications.View setColumnSortHandler(final ColumnSortEvent.ListHandler sortHandler) { - logsGrid.addColumnSortHandler(sortHandler); - return this; - } - - @Override - @SuppressWarnings("unchecked") - public Notifications.View addColumn(final Column column, - final double pixelsWidth, - final String name) { - logsGrid.addColumn(column, - name); - logsGrid.setColumnWidth(column, - pixelsWidth, - Style.Unit.PX); - return this; - } - - @Override - public Notifications.View removeColumn(final int index) { - logsGrid.removeColumn(index); - return this; - } - - @Override - public int getColumnCount() { - return logsGrid.getColumnCount(); - } - - @Override - public Notifications.View redraw() { - logsGrid.redraw(); - return this; - } - - @Override - public Notifications.View clear() { - return this; - } -} diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/widgets/NotificationsView.ui.xml b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/widgets/NotificationsView.ui.xml deleted file mode 100644 index eb5bc88b187..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/java/org/kie/workbench/common/stunner/standalone/client/widgets/NotificationsView.ui.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - .logsGrid { - width: 350px; - height: 350px; - } - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/resources/org/kie/workbench/common/stunner/standalone/StunnerStandaloneShowcase.gwt.xml b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/resources/org/kie/workbench/common/stunner/standalone/StunnerStandaloneShowcase.gwt.xml index a3238d1d025..8d3375a523b 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/resources/org/kie/workbench/common/stunner/standalone/StunnerStandaloneShowcase.gwt.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/resources/org/kie/workbench/common/stunner/standalone/StunnerStandaloneShowcase.gwt.xml @@ -19,42 +19,42 @@ "http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd"> - - - + + - - - - - + + - - - + + + + + + - + - - + - + + + + + - - @@ -66,6 +66,6 @@ - + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/resources/project-defaults.yml b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/resources/project-defaults.yml new file mode 100644 index 00000000000..e380166f27f --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/resources/project-defaults.yml @@ -0,0 +1,56 @@ +# Sample Swarm config for KIE Drools Workbench +swarm: + management: + blocking: + timeout: 900 # This might need to be higher if the jar has timeout issues on startup + security-realms: + ApplicationRealm: # almost the same as default config in WildFly 10.1.0.Final + local-authentication: + default-user: local + allowed-users: local + skip-group-loading: true + sasasasasasasasasasasasasasasasasasasasasasasasasasasaproperties-authentication: + path: application-users.properties + plain-text: true + properties-authorization: + path: application-roles.properties +# Optional logging + logging: + console-handlers: + CONSOLE: + level: INFO + named-formatter: COLOR_PATTERN + pattern-formatters: + PATTERN: + pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n" + COLOR_PATTERN: + pattern: "%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n" + periodic-rotating-file-handlers: + FILE: + file: + path: server.log + suffix: .yyyy-MM-dd + named-formatter: PATTERN + root-logger: + handlers: + - CONSOLE + - FILE + security: + security-domains: + other: + classic-authentication: + login-modules: + kieLoginModule: + code: org.kie.security.jaas.KieLoginModule + flag: optional + module: deployment.standalone-editor.war + +# This configuration is required to make the users system work. +org: + uberfire: + ext: + security: + management: + wildfly: + cli: + user: admin diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/resources/security-policy.properties b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/resources/security-policy.properties index 0d68df21dc7..30d7ab450c8 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/resources/security-policy.properties +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/resources/security-policy.properties @@ -33,16 +33,15 @@ # # Default settings -default.home=HomePerspective -default.permission.perspective.create=false -default.permission.perspective.update=false -default.permission.perspective.delete=false +default.home=AuthoringPerspective +default.permission.perspective.create=true +default.permission.perspective.update=true +default.permission.perspective.delete=true default.permission.perspective.read=true -default.permission.perspective.read.AuthoringPerspective=true +default.permission.perspective.read.HomePerspective=true # Role "admin" role.admin.permission.perspective.create=true role.admin.permission.perspective.update=true role.admin.permission.perspective.delete=true role.admin.permission.perspective.read=true - diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/README.md b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/README.md deleted file mode 100644 index 26f1658c444..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/README.md +++ /dev/null @@ -1,4 +0,0 @@ -**DO NOT DELETE** - -Diagrams placed here will be deployed into application's VFS on first time run. - diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/evaluation.bpmn b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/evaluation.bpmn deleted file mode 100644 index 7ba83634a17..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/evaluation.bpmn +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - _B7E46E20-8DF5-4A5B-AB56-064165E376CA - - - - - - - - - _B7E46E20-8DF5-4A5B-AB56-064165E376CA - _2D745241-AC6E-448F-A14E-F109C3905873 - - - - _6063D302-9D81-4C86-920B-E808A45377C2_SkippableInputX - - - - _6063D302-9D81-4C86-920B-E808A45377C2_SkippableInputX - - true - _6063D302-9D81-4C86-920B-E808A45377C2_SkippableInputX - - - - - - - - - - - _F9F81024-E5D9-4540-9E43-11B29F6920B0 - _A2F01016-5F80-4EED-BEEF-79084949CA8A - - - - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A_SkippableInputX - - - - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A_SkippableInputX - - true - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A_SkippableInputX - - - - - - - - - - - _B09334B4-29CA-414A-A071-B57C08D3CBBE - _A97AA50D-38CB-40FE-B151-AEE5BDF22D42 - - - - _88233779-B395-4B8C-A086-9EF43698426C_SkippableInputX - - - - _88233779-B395-4B8C-A086-9EF43698426C_SkippableInputX - - true - _88233779-B395-4B8C-A086-9EF43698426C_SkippableInputX - - - - - - - - - - - _2D745241-AC6E-448F-A14E-F109C3905873 - _B09334B4-29CA-414A-A071-B57C08D3CBBE - _F9F81024-E5D9-4540-9E43-11B29F6920B0 - - - - - - - - - _A2F01016-5F80-4EED-BEEF-79084949CA8A - _A97AA50D-38CB-40FE-B151-AEE5BDF22D42 - _52C590CA-F91A-46AC-917C-C0B49AA90F53 - - - - - - - - - _52C590CA-F91A-46AC-917C-C0B49AA90F53 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _x52BcFz1EeaIo48j8XabDw - _x52BcFz1EeaIo48j8XabDw - - \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/evaluation.bpmn.meta b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/evaluation.bpmn.meta deleted file mode 100644 index 1fbe447a78a..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/evaluation.bpmn.meta +++ /dev/null @@ -1,17 +0,0 @@ - - - - - org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet - - - org.kie.workbench.common.stunner.bpmn.client.BPMNShapeSet - - - - - - Evaluation - - - \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/evaluation2.bpmn b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/evaluation2.bpmn deleted file mode 100644 index 32ae391be70..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/evaluation2.bpmn +++ /dev/null @@ -1,357 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - _88233779-B395-4B8C-A086-9EF43698426C - - - - - - - - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A - - - - - - - - - _B7E46E20-8DF5-4A5B-AB56-064165E376CA - - - - - - - - _B7E46E20-8DF5-4A5B-AB56-064165E376CA - _2D745241-AC6E-448F-A14E-F109C3905873 - - - - - - _6063D302-9D81-4C86-920B-E808A45377C2_reasonInputX - _6063D302-9D81-4C86-920B-E808A45377C2_SkippableInputX - - - _6063D302-9D81-4C86-920B-E808A45377C2_performanceOutputX - - - - reason - _6063D302-9D81-4C86-920B-E808A45377C2_reasonInputX - - - _6063D302-9D81-4C86-920B-E808A45377C2_SkippableInputX - - true - _6063D302-9D81-4C86-920B-E808A45377C2_SkippableInputX - - - - _6063D302-9D81-4C86-920B-E808A45377C2_performanceOutputX - performance - - - - #{employee} - - - - - - - - - - _2D745241-AC6E-448F-A14E-F109C3905873 - _B09334B4-29CA-414A-A071-B57C08D3CBBE - _F9F81024-E5D9-4540-9E43-11B29F6920B0 - - - - - - - - _52C590CA-F91A-46AC-917C-C0B49AA90F53 - - - - - - - - - _A2F01016-5F80-4EED-BEEF-79084949CA8A - _A97AA50D-38CB-40FE-B151-AEE5BDF22D42 - _52C590CA-F91A-46AC-917C-C0B49AA90F53 - - - - - - - - - - - - - - - _B09334B4-29CA-414A-A071-B57C08D3CBBE - _A97AA50D-38CB-40FE-B151-AEE5BDF22D42 - - - - - - - _88233779-B395-4B8C-A086-9EF43698426C_reasonInputX - _88233779-B395-4B8C-A086-9EF43698426C_performanceInputX - _88233779-B395-4B8C-A086-9EF43698426C_SkippableInputX - _88233779-B395-4B8C-A086-9EF43698426C_GroupIdInputX - - - - - reason - _88233779-B395-4B8C-A086-9EF43698426C_reasonInputX - - - performance - _88233779-B395-4B8C-A086-9EF43698426C_performanceInputX - - - _88233779-B395-4B8C-A086-9EF43698426C_GroupIdInputX - - - _88233779-B395-4B8C-A086-9EF43698426C_GroupIdInputX - - - - _88233779-B395-4B8C-A086-9EF43698426C_SkippableInputX - - true - _88233779-B395-4B8C-A086-9EF43698426C_SkippableInputX - - - - - - - - - - _F9F81024-E5D9-4540-9E43-11B29F6920B0 - _A2F01016-5F80-4EED-BEEF-79084949CA8A - - - - - - - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A_reasonInputX - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A_performanceInputX - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A_SkippableInputX - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A_GroupIdInputX - - - - - reason - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A_reasonInputX - - - performance - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A_performanceInputX - - - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A_GroupIdInputX - - - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A_GroupIdInputX - - - - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A_SkippableInputX - - true - _AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A_SkippableInputX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _1kfnwaokEeaKcvgREUT4hw - _1kfnwaokEeaKcvgREUT4hw - - diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/evaluation2.bpmn.meta b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/evaluation2.bpmn.meta deleted file mode 100644 index 4ca5f4ff48a..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/evaluation2.bpmn.meta +++ /dev/null @@ -1,17 +0,0 @@ - - - - - org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet - - - org.kie.workbench.common.stunner.bpmn.client.BPMNShapeSet - - - data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABJcAAAJZCAYAAAAUO9QWAAAgAElEQVR4XuzdCXhU1d3H8f+ENWwBcQViwK1uKKigAhXcENxAcKs7tqh1Y2lRRIGEasUVpFWsqOCrAtUqrgXZBEGpWBUUFFcCuFBEICwJxCTzPufeTJiEIDNz752cc893nud98gpzz/zP53+STn6ceyYiPBBAAAEEEEAAAQQQQAABBBBAAAEEEEhRIJLidVyGAAIIIIAAAggggAACCCCAAAIIIICAEC6xCBBAAAEEEEAAAQQQQAABBBBAAAEEUhYgXEqZjgsRQAABBBBAAAEEEEAAAQQQQAABBAiXWAMIIIAAAggggAACCCCAAAIIIIAAAikLEC6lTMeFCCCAAAIIIIAAAggggAACCCCAAAKES6wBBBBAAAEEEEAAAQQQQAABBBBAAIGUBQiXUqbjQgQQQAABBBBAAAEEEEAAAQQQQAABwiXWAAIIIIAAAggggAACCCCAAAIIIIBAygKESynTcSECCCCAAAIIIIAAAggggAACCCCAAOESawABBBBAAAEEEEAAAQQQQAABBBBAIGUBwqWU6bgQAQQQQAABBBBAAAEEEEAAAQQQQIBwiTWAAAIIIIAAAggggAACCCCAAAIIIJCyAOFSynRciAACCCBQLjAXCQQQQAABBCwWOM3iuTN1BBBAwBEgXGIhIIAAAgh4EZibkZHRvl69ep95GYRrEUAAAQQQMFGguLj4yNLS0iUicqqJ9VMzAggg4JcA4ZJfkoyDAAII2CkwNzMzs25hYeEFdk6fWSOAAAII2CzQoEGDl4uKikoIl2xeBcwdAQSUAOES6wABBBBAwIsA4ZIXPa5FAAEEEDBagHDJ6PZRPAII+ChAuOQjJkMhgAACFgoQLlnYdKaMAAIIIOAKEC6xEhBAAAFXgHCJlYAAAggg4EWAcMmLHtcigAACCBgtQLhkdPsoHgEEfBQgXPIRk6EQQAABCwUIlyxsOlNGAAEEEHAFCJdYCQgggIArQLjESkAAAQQQ8CJAuORFj2sRQAABBIwWIFwyun0UjwACPgoQLvmIyVAIIICAhQKESxY2nSkjgAACCLgChEusBAQQQMAVIFxiJSCAAAIIeBEgXPKix7UIIIAAAkYLEC4Z3T6KRwABHwUIl3zEZCgEEEDAQgHCJQubzpQRQAABBFwBwiVWAgIIIOAKEC6xEhBAAAEEvAgQLnnR41oEEEAAAaMFCJeMbh/FI4CAjwKESz5iMhQCCCBgoQDhkoVNZ8oIIIAAAq4A4RIrAQEEEHAFCJdYCQgggAACXgQIl7zocS0CCCCAgNEChEtGt4/iEUDARwHCJR8xGQoBBBCwUIBwycKmM2UEEEAAAVeAcImVgAACCLgChEusBAQQQAABLwKES170uBYBBBBAwGgBwiWj20fxCCDgowDhko+YDIUAAghYKEC4ZGHTmTICCCCAgCtAuMRKQAABBFwBwiVWAgIIIICAFwHCJS96XIsAAgggYLQA4ZLR7aN4BBDwUYBwyUdMhkIAAQQsFCBcsrDpTBkBBBBAwBUgXGIlIIAAAq4A4RIrAQEEEEDAiwDhkhc9rkUAAQQQMFqAcMno9lE8Agj4KEC45CMmQyGAAAIWChAuWdh0powAAggg4AoQLrESEEAAAVeAcImVgAACCCDgRYBwyYse1yKAAAIIGC1AuGR0+ygeAQR8FCBc8hGToRBAAAELBQiXLGw6U0YAAQQQcAUIl1gJCCCAgCtAuMRKQAABBBDwIkC45EWPaxFAAAEEjBYgXDK6fRSPAAI+ChAu+YjJUAgggICFAoRLFjadKSOAAAIIuAKES6wEBBBAwBUgXGIlIIAAAgh4ESBc8qLHtQgggAACRgsQLhndPopHAAEfBQiXfMRkKAQQQMBCAcIlC5vOlBFAAAEEXAHCJVYCAggg4AoQLrESEEAAAQS8CBAuedHjWgQQQAABowUIl4xuH8UjgICPAoRLPmIyFAIIIGChAOGShU1nyggggAACrgDhEisBAQQQcAUIl1gJCCCAAAJeBAiXvOhxLQIIIICA0QKES0a3j+IRQMBHAcIlHzEZCgEEELBQgHDJwqYzZQQQQAABV4BwiZWAAAIIuAKES6wEBBBAAAEvAoRLXvS4FgEEEEDAaAHCJaPbR/EIIOCjAOGSj5gMhQACCFgoQLhkYdOZMgIIIICAK0C4xEpAAAEEXAHCJVYCAggggIAXAcIlL3pciwACCCBgtADhktHto3gEEPBRgHDJR0yGQgABBCwUIFyysOlMGQEEEEDAFSBcYiUggAACrgDhEisBAQQQQMCLAOGSFz2uRQABBBAwWoBwyej2UTwCCPgoQLjkIyZDIYAAAhYKEC5Z2HSmjAACCCDgChAusRIQQAABV4BwiZWAAAIIIOBFgHDJix7XIoAAAggYLUC4ZHT7KB4BBHwUIFzyEZOhEEAAAQsFCJcsbDpTRgABBBBwBQiXWAkIIICAK0C4xEpAAAEEEPAiQLjkRY9rEUAAAQSMFiBcMrp9FI8AAj4KEC75iMlQCCCAgIUChEsWNp0pI4AAAgi4AoRLrAQEEEDAFSBcYiUggAACCHgRIFzyose1CCCAAAJGCxAuGd0+ikcAAR8FCJd8xGQoBBBAwEIBwiULm86UEUAAAQRcAcIlVgICCCDgChAusRIQQAABBLwIEC550eNaBBBAAAGjBQiXjG4fxSOAgI8ChEs+YjIUAgggYKEA4ZKFTWfKCCCAAAKuAOESKwEBBBBwBQiXWAkIIIAAAl4ECJe86HEtAggggIDRAoRLRreP4hFAwEcBwiUfMRkKAQQQsFCAcMnCpjNlBBBAAAFXgHCJlYAAAgi4AoRLrAQEEEAAAS8ChEte9LgWAQQQQMBoAcIlo9tH8Qgg4KMA4ZKPmAyFAAIIWChAuGRh05kyAggggIArQLjESkAAAQRcAcIlVgICCCCAgBcBwiUvelyLAAIIIGC0AOGS0e2jeAQQ8FGAcMlHTIZCAAEELBQgXLKw6UwZAQQQQMAVIFxiJSCAAAKuAOESKwEBBBBAwIsA4ZIXPa5FAAEEEDBagHDJ6PZRPAII+ChAuOQjJkMhgAACFgoQLlnYdKaMAAIIIOAKEC6xEhBAAAFXgHCJlYAAAggg4EWAcMmLHtcigAACCBgtQLhkdPsoHgEEfBQgXPIRk6EQQAABCwUIlyxsOlNGAAEEEHAFCJdYCQgggIArQLjESkAAAQQQ8CJAuORFj2sRQAABBIwWIFwyun0UjwACPgoQLvmIyVAIIICAhQKESxY2nSkjgAACCLgChEusBAQQQMAVIFxiJSCAAAIIeBEgXPKix7UIIIAAAkYLEC4Z3T6KRwABHwUIl3zEZCgEEEDAQgHCJQubzpQRQAABBFwBwiVWAgIIIOAKEC6xEhBAAAEEvAgQLnnR41oEEEAAAaMFCJeMbh/FI4CAjwKESz5iMhQCCCBgoQDhkoVNZ8oIIIAAAq4A4RIrAQEEEHAFCJdYCQgggAACXgQIl7zocS0CCCCAgNEChEtGt4/iEUDARwHCJR8xGQoBBBCwUIBwycKmM2UEEEAAAVeAcImVgAACCLgChEusBAQQQAABLwKES170uBYBBBBAwGgBwiWj20fxCCDgowDhko+YDIUAAghYKEC4ZGHTmTICCCCAgCtAuMRKQAABBFwBwiVWAgIIIICAFwHCJS96XIsAAgggYLQA4ZLR7aN4BBDwUYBwyUdMhkIAAQQsFCBcsrDpTBkBBBBAwBUgXGIlIIAAAq4A4RIrAQEEEEDAiwDhkhc9rkUAAQQQMFqAcMno9lE8Agj4KEC45CMmQyGAAAIWChAuWdh0powAAggg4AoQLrESEEAAAVeAcImVgAACCCDgRYBwyYse1yKAAAIIGC1AuGR0+ygeAQR8FCBc8hGToRBAAAELBQiXLGw6U0YAAQQQcAUIl1gJCCCAgCtAuMRKQAABBBDwIkC45EWPaxFAAAEEjBYgXDK6fRSPAAI+ChAu+YjJUAgggICFAoRLFjadKSOAAAIIuAKES6wEBBBAwBUgXGIlIIAAAgh4ESBc8qLHtQgggAACRgsQLhndPopHAAEfBQiXfMRkKAQQQMBCAcIlC5vOlBFAAAEEXAHCJVYCAggg4AoQLrESEEAAAQS8CBAuedHjWgQQQAABowUIl4xuH8UjgICPAoRLPmIyFAIIIGChAOGShU1nyggggAACrgDhEisBAQQQcAUIl1gJCCCAAAJeBAiXvOhxLQIIIICA0QKES0a3j+IRQMBHAcIlHzEZCgEEELBQgHDJwqYzZQQQQAABV4BwiZWAAAIIuAKES6wEBBBAAAEvAoRLXvS4FgEEEEDAaAHCJaPbR/EIIOCjAOGSj5gMhQACCFgoQLhkYdOZMgIIIICAK0C4xEpAAAEEXAHCJVYCAggggIAXAcIlL3pciwACCCBgtADhktHto3gEEPBRgHDJR0yGQgABBCwUIFyysOlMGQEEEEDAFSBcYiUggAACrgDhEisBAQQQQMCLAOGSFz2uRQABBBAwWoBwyej2UTwCCPgoQLjkIyZDIYAAAhYKEC5Z2HSmjAACCCDgChAusRIQQAABV4BwiZWAAAIIIOBFgHDJix7XIoAAAggYLUC4ZHT7KB4BBHwUIFzyEZOhEEAAAQsFCJcsbDpTRgABBBBwBQiXWAkIIICAK0C4xEpAAAEEEPAiQLjkRY9rEUAAAQSMFiBcMrp9FI8AAj4KEC75iMlQCCCAgIUChEsWNp0pI4AAAgi4AoRLrAQEEEDAFSBcYiUggAACCHgRIFzyose1CCCAAAJGCxAuGd0+ikcAAR8FCJd8xGQoBBBAwEIBwiULm86UEUAAAQRcAcIlVgICCCDgChAusRIQQAABBLwIEC550eNaBBBAAAGjBQiXjG4fxSOAgI8ChEs+YjIUAgggYKEA4ZKFTWfKCCCAAAKuAOESKwEBBBBwBQiXWAkIIIAAAl4ECJe86HEtAggggIDRAoRLRreP4hFAwEcBwiUfMRkKAQQQsFCAcMnCpjNlBBBAAAFXgHCJlYAAAgi4AoRLrAQEEEAAAS8ChEte9LgWAQQQQMBoAcIlo9tH8Qgg4KMA4ZKPmAyFAAIIWChAuGRh05kyAggggIArQLjESkAAAQRcAcIlVgICCCCAgBcBwiUvelzri8CBBx54xaZNmzqXlJTs78uADGKUQO3atX/MyspauGbNmslGFU6xoRAgXApFG5kEAgj4IEC45AMiQyCAAAIWCxAuWdz8mp56bm5us/HjH1vapk2bem3bHhVp2bJlTZfE69eAwHfffSfLl38W/fbb/O2DBg06ZujQoQU1UAYvaakA4ZKljWfaCCCwiwDhEosCAQQQQMCLAOGSFz2uTVlABUvPP//8ZxMmPFara9dTRCRaviHbrq8ZGfUrGZaVFVnpoPo/d+58+eMfby7p3/+6w4cMGbI55cXFhQgkIUC4lAQWT0UAgVALEC6Fur1MDgEEEAhcgHApcGJeoDqB/fbbd/U///l8/a7dThGJRkUiEeu+ZkQqB0sxJydgstBDrYM5c+fJFZdfXbR27f9y+M5BIB0ChEvpUOY1EEDABAHCJRO6RI0IIICAvgKES/r2JrSVtWrV6opWrVo+tGjRfKvfx2RkZFbbY3f3kr2PE0/sEl23bv2t+fn5/7RXgZmnS4BwKV3SvA4CCOguYPWbMt2bQ30IIICAAQKESwY0KWwlNmnSZPwll1zY94knHgvb1JKaD+FS9Vz9+/9RXnjhpX9t3rz5xqRAeTICKQgQLqWAxiUIIBBKAcKlULaVSSGAAAJpEyBcShs1LxQTUL/MDRkyqHNu7nB1L5y1ZwxlZDSodlG4O5fsdcnLuyd6//0Pv1dYWHgB3zUIBC1AuBS0MOMjgIApAoRLpnSKOhFAAAE9BYrq1Kmzqri4+Ld6lkdVYRTYGS7dFRFRb2XsDFJ2v3Op0NrATa2HvLy7CZfC+I2v6ZwIlzRtDGUhgEDaBQiX0k7OCyKAAAKhEojWqVPn2+Li4pNCNSsmo7WA+mXuz0MGdc7LvStiZ6zkxmm1drtzqdDSuM11GcXOJa2/f8NWHOFS2DrKfBBAIFUBwqVU5bgOAQQQCK+A+pSlgSJypoj8JCKPi0jVg3G7iMibItKEcCm8C0HXmVXeuaRrlempq+qtcWVlateS3Q9ui7O7/+mePeFSusV5PQQQ0FWAcEnXzlAXAgggUDMCV4jI0yJSJ+7ly0RknYgcUP5nT4nIVSJSW/13nTp1vuC2uJpplq2v6u5cGtg5L3d4JCpRiUhEbP160kmnyOLF/3WWQt++veWFF5+32kOtg1F5f+W2OFt/ONTAvAmXagCdl0QAAS0FCJe0bAtFIYAAAjUmsFlEGouICpSKRSSjPGhS/3uxpvz/36/8QJcdIvJ9ZmbmjxycW2P9svKFd+5cutPqM5fUTWAZGQ0rrQF355LNNwvGzlwaw4HeVv50SP+kCZfSb84rIoCAngKES3r2haoQQACBmhBQt8N9KyLbRKStiKwqL6KriMyMC5nUb66rRUT9+cTMzMy6hEs10S57X3PnziV7z1yqGipVXQ2lZdusPercPXOJcMnenxDpnTnhUnq9eTUEENBXgHBJ395QGQIIIJBuAXXO0hgRGSIiD1Z58UdF5EYR+aX8trkbyv9+LuFSutvE67k7lwZ2zs1VnxZn32NPwVJMpKxM5cT2PdwzlwiX7Ot8zcyYcKlm3HlVBBDQT8DKN2X6tYGKEEAAAS0EYuFSdf/boP7uYREZLCJj46rdUadOnZWcuaRF/6wpwtm59OeBnfPy7opEo1GJRCJiy9dEg6XYYigt3WqVj1oHo0apM5cIl6z5gVDDEyVcquEG8PIIIKCNAOGSNq2gEAQQQKDGBVIJl6J8WlyN9826AmI7l0bm3hmx6TDvZIOlioCpbKtVh3zn5t0TfYBwybqfCzU1YcKlmpLndRFAQDcBwiXdOkI9CCCAQM0JxMIldZB3dY+65Yd8x/9dXcKlmmuYra+8c+fSnZFoVCQSEeErDrF1wM4lW38y1My8CZdqxp1XRQAB/QQIl/TrCRUhgAACNSUQC5eSen3CpaS4eLIPAjt3Lg2zaudSVKJW7UBKdb7uzqWxfFqcD99rDLFnAcKlPRvxDAQQsEOAcMmOPjNLBBBAIBGB2LlK6lDvRB+DCZcSpeJ5fgm4O5cGdM7LY+cSO7Z23bHl7lwiXPLr+41xfl2AcIkVggACCLgChEusBAQQQACBmIAKl+4TkXpJkHCgdxJYPNUfAXfn0oDO7plLItHyNzR8dd/Y2e6Qm/dXdi75863GKAkIEC4lgMRTEEDACgHCJSvazCQRQACBhAS6iIgKmC5M6Nnuk9bVrVv3xx07dpyRxDU8FQFHoFatWh82btz43yeccMI/Z8+evSxRltjOpdy8O9XHxHHYEIdOVTp0K2/UvYRLiX4z8TzPAoRLngkZAAEEQiJAuBSSRjINBBBAwAcBFSw9pH7nT2IsPi0uCSyeWlkgEomsi/1JRkbG6saNG09PJGiq2Lk0clgkElH5UlT4ikNsHeTm/jX6wAPcFsfPm/QIEC6lx5lXQQAB/QUIl/TvERUigAAC6RKIHei9NYkXbMSZS0lo8dRKAvHhUvxf7Clo2rlzaVjE+nvAbL8Hrpr5s3OJHzTpFCBcSqc2r4UAAjoLEC7p3B1qQwABBNIrwKfFpdfb+lfbXbi0p6Cp8s6lSndECXeI4ZGbey87l6z/6ZI+AMKl9FnzSgggoLcA4ZLe/aE6BBBAIJ0CsXDpiyov2kxE9lXnK4nIxip/95sw7Fy6+eab9501a9bxBQUFLUtKSpqmE93m1/r5559vS2b+sR1NRUVFHW+/fVA7zlyKkCRVc+ZW3qjRFWcuZWdn/zmZNcZza06gXr1661q0aLHsnXfe+ajmqkj+lQmXkjfjCgQQCKcA4VI4+8qsEEAAgVQEVLj0gIjUqXKx+vOHRWSwiIyt8ndlderUWVlcXHxSKi+owzUtW7bst2HDhtNFpCQrK+u9X375JUuHumyoYcOGDUOSmWdGRsYadS5TUVFRh6FDB7cbOfIOzlzizKldztxyz1x65L3CwsILsrOzk1pjyaxHnuuvQHFx8b7FxcXZIlJ70qRJV/Tq1Wu7v68QzGiES8G4MioCCJgnQLhkXs+oGAEEEEi3wK+FS3MzMzPrql/i0l2UH6930EEHnb927drehYWF1/oxHmMkJ5DgbXFOoHTCCSdMjX2inHvm0q2dc/M4c4kzp0REvZuNO3vJPXPJDZeSW5E8WweBTp06dfn888//NHny5Et79uy5Q4eafq0GwiXdO0R9CCCQLgHCpXRJ8zoIIICAuQKhDJfat2/fafny5UOKi4v5BbSG1uavHOi9S6AUX6ITLg25tXPuyGGRqsEC/105aLHRI885c4lwqYa+rX152ZNPPvm3K1asuHXjxo0X+TJggIMQLgWIy9AIIGCUAOGSUe2iWAQQQCBQgUvKb3s7oMqr/Fq4tKP8trjfBlpZAINnZmZOOvTQQyd88skn7wYwPEMmIBAfLsVueYvfobS7ISrvXIoKp3hz9pLEnb3knrlEuJTAt6DWT2nWrNm/jjvuuHvmzJnzsc6FEi7p3B1qQwCBdAoQLqVTm9dCAAEE9BaIhUjqa/yjq4io3T3TRGR+lb97xNQDvTMyMpYNHjz41AcffPAnvdsS3upq1ar1YdVb3hKZ7c6dS3dECJYIluKDJbUe2LmUyHeR/s/Zb7/9HmjcuPGnX3/99f/pXC3hks7doTYEEEinAOFSOrV5LQQQQEBvgdinxSVVpanhkto1E41G1afg8TBMoGLnUu4dvI8xrHfpKDcvbzS3xaUDOuDXKP+kv8iaNWvUB01o+yBc0rY1FIYAAmkW4E1ZmsF5OQQQQEBjgVi4pI7GTfQRIVxKlIrn+SVQeecSZwxxqHflQ73zcgmX/Ppeq8lxCJdqUp/XRgABBJIXIFxK3owrEEAAgbAKxMKlZP63IUq4FNbloO+83J1Lt3TOzR2m7gnb9ePCbDzFGoeKdZCXdx87l/T99k24MsKlhKl4IgIIIKCFQDK/QGhRMEUggAACCAQmoA70fkhEWiXxCtvr1KmTX1xcbNyB3twWl0SXNXuqu3Ppls65I9WZS+xcIleqbufSuPcKCwv5JEjNvneTKYdwKRktnosAAgjUvADhUs33gAoQQAABkwXmZmZm1jXxlzjCJXOX3c6dS3dEohIVlTDxFYfYOhjl7FwiXDL3O9ytnHDJ9A5SPwII2CZAuGRbx5kvAggg4K8A4ZK/noyWgMDOnUtD+bS4CJ8Wt+unxakzlwiXEvhW0vophEtat4fiEEAAgV0ECJdYFAgggAACXgQIl7zocW1KAjt3Lg2NcOKScGdglTsj2bmU0reVdhcRLmnXEgpCAAEEflWAcIkFggACCCDgRYBwyYse16YkEB8upTRAiC/atKlAli5d5szw2GOPlqZNs0I82+qn5h7ozc4l0xtPuGR6B6kfAQRsEyBcsq3jzBcBBBDwV4BwyV9PRktAwA2Xbu6cm5veM5dW5a+R/FWrK854andsW9m4aZOsXvVdxZlPTZtlyaaNBbucAXVK107Vng2lrv9k6fJqz4xqnXOg5LTOTupMqZX5q+SSi/vJRx8tlZdeelbO79UzqeurO7tKzVv9eZvWOUacbTUq737CpQS+j3R/CuGS7h2iPgQQQKCyAOESKwIBBBBAwIsA4ZIXPa5NSWDnzqXbI+m8KezFF6fJLbfcJps2bZaTTjpBnn767/LVV9/KsGGjZMmST6VNmxwZPPgmGTt2vHzzzUpp2LCBZGU1ke3bd0iTJo3l2Wcfl06dTqp0E9fnn38pvXpd5jy/QYNMycpydxpt2bJFevc+V555ZnzSH4c3b94C6d69j7z44iTp1eucpK9fvPi/8vDDj8nUqU85H8N2xBEdpV69urJkyYLKH8um6cfU5eWpM5f+xqfFpfTdpc9FhEv69IJKEEAAgUQECJcSUeI5CCCAAAK7EyBcYm2kXWDnzqX0n7l05ZU3yKuvvimvvTZFunXr4sQrM6bPknPPvVRuuOFa+fujD8ismXOlZ8+L5LrrrpHHxj8kBZsKpH37UyQnJ1venvfGLmckVX2+enN2081DpLSkRK6/4VrZXLDZeZ3WOdnO19Wr1E4ikXbHHu18/WTpMudrt66dna/z5y2sCJcOzMl2rldf1bj5q9Y4X0/p2tn5ujJ/tTNek6wm0r5dW+f6nj36yrZthXL33Xc51/35T3dJq+yW8sjYeyvipI+XfOpcf2y7ts5X9d+x11mVv1okEqmoR/19Os/Gcs9cIlxK+zemzy9IuOQzKMMhgAACAQsQLgUMzPAIIIBAyAUIl0LeYB2nFwuXRuYOVZ+Vltbg4qq4cKlrty5OsDI9Llx69NEHZGZcuDR+/ENOfce1P0UikYh89NH8Xeqt+vxBg++Uiy48X07udKLcMTRP/vGPiVKvXj0Z//jDUrdOHbnmmhulWbOm8tbMl+WIwztKy5YHyMaNm+SII38j7y6cIfPiwqWFCxfJ449PlIsvvkD6Xni+XNvvJqeOH3/8Qqa98qZcdeX1su+++0hBQYH06XO+HHbYwfLAA+OcHUrqvKZ77x0ut946VJo3by5Lli6Qxe//V/r2vVpKS0ukqGi77L//fvLM/42XSROfl8mT/yVbt26TvfZqJr/88ot06Hi8zJr5clr7o/rhnrlEuKTj924yNREuJaPFcxFAAIGaFyBcqvkeUAECCCBgsgDhksndM7T2yjuXop7PFIpIJOGzhK688np54YVXpKSkZBc9d+fS/TJr5ttxO5celOn/ni1XX/1HOeOMbjJ5yoRd6o09P37AF1+c6IQ96qyj00/r5dw2t3TpQue/Dz3keJk8eYJ0736a3H//I3LbbQOk/3UD5M03Zsr3P3wm8+e9W7FzSZ251LLFkdKz5xny1PHLdV0AACAASURBVFN/E1X/ggWLZGX+UvlixVfy6bLP5aILeznP37p1q7z73ltyYsczJKtpE5k1c5rzemd17yPqoPDFi+fKWT36ysYNm+T9xbOdeRx11MmSnd1Cps/4l1NXhw7HyZQpT8rll/d3XmfVarXDKXHf6s58SvZ698wlwiVDv70ryiZcMr2D1I8AArYJEC7Z1nHmiwACCPgrQLjkryejJSCwc+fS7ZFkgwevz7/qyj9W3BbXtZu6tSwSt3Opnzz66IMVO5diU6lbt65zRtPL056VZk2b7hJk7dy5dLWMH/+wHHdcV7nrrj/LBX3OdcefMUsuvqif/O6yC+Xw3xwqEyY8I59/vlgWf/ChDB50lyxatNh5qebN95J1676K27k00TlzqUWLI5xw6cmnxomqf8GC9yQ//xN56unn5P77HpGvv/7WubZ162wnQOrY8TRn15LaGaVe/8zuF0jBps1OoHT0USdLm4NayxuvT3Xmce45l4o6RPyz5f+RQw45zgmXVIB2Xf+B8vrrM2Tt2i8SDu78CJZUvexcSuCbyICnEC4Z0CRKRAABBOIECJdYDggggAACXgQIl7zocW1KAk2aNHnsoot6XThhwti033Llnrn07/Izl9wzjmZMn11+5lK/8jOXYjuXrpY/D7nF2fmTmZkpCxb8W7KaZlVz5tLO56szmtSZRep5fxv3hAwfMcR5focOpzu3mhUXF0v//lfJwEE3ynnnXiorV66W5cvfk+uvHyzTpr0h/1v3ZdzOpYlyfq+z43YujRNVf2znUtujOzm31L311ktyVo8LZeOGjfL+4jlyYsfTndeP3dK2c+fSHDnyqJPloDY58vobU526zj7nEqfeZcsXxe1cmiD9y8OlH9eu2GW+Qd/K2P8PA+Sll15/saCg4KaUFhgXaSFAuKRFGygCAQQQSFiAcClhKp6IAAIIIFCNAOESyyLtAjk5OZe3aLHvwwvfnVFDZy654ZK7c0mdubQzXHLPXNoZFqkzlyZOmiyDBt4pJ5zQTmbPVreaVf6Mu6rPV3+vDgFv3vxgKS1d7zx/7JjHZNiwux3rwqIfnNc99dTzpaioSBb9Z5Zcfll/mT17vqxb96XMq7gtTu1cOltyco6RY445Sl57fYqoM6NUuJSfv1QOOqi9s9No6j+fkq6nnCvbtxfJYhUunXiGNGzYUObMfdV5nTO793HqUcFTzx4Xyg8//E8++WSBU1f7dqc45z+9/fZrckj5bXGVdy6tSHsAeNLJZ0V//OF/A9asWTM17YuTF/RNgHDJN0oGQgABBNIiQLiUFmZeBAEEEAitAOFSaFur98T222/fVc8//0Tmqad2cQ6ojkajgX/9xz8mye235zoHWbdpkyPTp78gX3zxlfTvP0h+/HGtNGnSWO655y55+unn5OOPP5X99ttXbr31Ohk6dKBz5tLUqdOcW8/Gjr1XevQ43an3s89WSO/eVzpnKjVs2ECysrIc+B07djh/v1bt/Cmfnwpvzj67u/ztb6Od+d5yy+3y4ouvOuc/qZqi0TI599wesnr1Gvnww6XStu2RMmXKBLnllqHywQcfOdcUF/8itWvXlksv7SNfffWN8/o7dvwiderUdsYZPXqkc1vdjBlzJCMjQ/r2PU9ee226s2tqwIAbnLrdA73LZPv27XLAAfvJpEmPydy5C5zzn+rUqSN/+cswGT16rKxb95PceOPv5f7789LSH+WkbjHs1+/mwh9//F9rvVcw1e1JgHBpT0L8PQIIIKCXAOGSXv2gGgQQQMA0AcIl0zoWknpHjx6d9fTTT37+6KMP1D7t9N+m5dBodbbQqvzvKj6f7th2RzlnEeXnr67Yi6Q+KW3Dho0V/63OLjq23dFOfSq0UXuWclq3kjatc5yziNT1S5Z8WmUv0869Td26dak4s+jjJZ8416nDtmNnRy1dssz5e/XnapxatWpJaWlpxXjt2rV1nj9/3nvO66rrVL2xuqr+eevWB0pO6+yK56v61GHequ6spo2lfbtjnNeLvW78f8c/r2DTFscpfv5+nam0u3FUsHTLLUNLhw4ddvDvf//7wpAsdWunQbhkbeuZOAIIGCpAuGRo4ygbAQQQ0ESAcEmTRthYxgMPPNDkoYce+DQ7u2X9Y445KtIqu6XKMyrfc8Z/h95jzZrvZPnyL6KrV68puvvuvx5JsBSOnwaES+HoI7NAAAF7BAiX7Ok1M0UAAQSCECBcCkKVMZMSyM7OvqSgoKBrSUlJi6Qu5MmhEKhTp873TZs2XbBq1SrOWApFR91JEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4ChEu6dII6EEAAgRAJEC6FqJlMBQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEE7BUgXLK398wcAQTMFCBcMrNvVI0AAgjoIkC4pEsnqAMBBBAIkQDhUoiayVQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQMBeAcIle3vPzBFAwEwBwiUz+0bVCCCAgC4CxoZL9evXf3n79u19dIGkDgQQQACBnQIHHXRQ/7KyMsnPz5+gs0uDBg1eLioqKhGRU3Wuk9oQQACBoAUIl4IWZnwEEEAg3ALGhkuRSGRdNBrdN9ztYXYIIICAmQLsXDKzb1SNAAL2ChAu2dt7Zo4AAgj4IUC45IciYyCAAAIIVBIgXGJBIIAAAmYJEC6Z1S+qRQABBHQTIFzSrSPUgwACCIRAgHApBE1kCgggYJUA4ZJV7WayCCCAgO8ChEu+kzIgAggggADhEmsAAQQQMEuAcMmsflEtAgggoJsA4ZJuHaEeBBBAIAQChEshaCJTQAABqwQIl6xqN5NFAAEEfBcgXPKdlAERQAABBAiXWAMIIICAWQKES2b1i2oRQAAB3QQIl3TrCPUggAACIRAgXApBE5kCAghYJUC4ZFW7mSwCCCDguwDhku+kDIgAAgggQLjEGkAAAQTMEiBcMqtfVIsAAgjoJkC4pFtHqAcBBBAIgQDhUgiayBQQQMAqAcIlq9rNZBFAAAHfBQiXfCdlQAQQQAABwiXWAAIIIGCWAOGSWf2iWgQQQEA3AcIl3TpCPQgggEAIBAiXQtBEpoAAAlYJEC5Z1W4miwACCPguQLjkOykDIoAAAggQLrEGEEAAAbMECJfM6hfVIoAAAroJEC7p1hHqQQABBEIgQLgUgiYyBQQQsEqAcMmqdjNZBBBAwHcBwiXfSRkQAQQQQIBwiTWAAAIImCVAuGRWv6gWAQQQ0E2AcEm3jlAPAgggEAIBwqUQNJEpIICAVQKES1a1m8kigAACvgsQLvlOyoAIIIAAAoRLrAEEEEDALAHCJbP6RbUIIICAbgKES7p1hHoQQACBEAgQLoWgiUwBAQSsEiBcsqrdTBYBBBDwXYBwyXdSBkQAAQQQIFxiDSCAAAJmCRAumdUvqkUAAQR0EyBc0q0j1IMAAgiEQIBwKQRNZAoIIGCVAOGSVe1msggggIDvAoRLvpMyIAIIIIAA4RJrAAEEEDBLgHDJrH5RLQIIIKCbAOGSbh2hHgQQQCAEAoRLIWgiU0AAAasECJesajeTRQABBHwXIFzynZQBEUAAAQQIl1gDCCCAgFkChEtm9YtqEUAAAd0ECJd06wj1IIAAAiEQIFwKQROZAgIIWCVAuGRVu5ksAggg4LsA4ZLvpAyIAAIIIEC4xBpAAAEEzBIgXDKrX1SLAAII6CZAuKRbR6gHAQQQCIEA4VIImsgUEEDAKgHCJavazWQRQAAB3wUIl3wnZUAEEEAAAcIl1gACCCBglgDhkln9oloEEEBANwHCJd06Qj0IIIBACAQIl0LQRKaAAAJWCRAuWdVuJosAAgj4LkC45DspAyKAAAIIEC6xBhBAAAGzBAiXzOoX1SKAAAK6CRAu6dYR6kEAAQRCIEC4FIImMgUEELBKgHDJqnYzWQQQQMB3AcIl30kZEAEEEECAcIk1gAACCJglQLhkVr+oFgEEENBNgHBJt45QDwIIIBACAcKlEDSRKSCAgFUChEtWtZvJIoAAAr4LEC75TsqACCCAAAKES6wBBBBAwCwBwiWz+kW1CCCAgG4ChEu6dYR6EEAAgRAIEC6FoIlMAQEErBIgXLKq3UwWAQQQ8F2AcMl3UgZEAAEEECBcYg0ggAACZgkQLpnVL6pFAAEEdBMgXNKtI9SDAAIIhECAcCkETWQKCCBglQDhklXtZrIIIICA7wKES76TMiACCCCAAOESawABBBAwS4Bwyax+US0CCCCgmwDhkm4doR4EEEAgBAKESyFoIlNAAAGrBAiXrGo3k0UAAQR8FyBc8p2UARFAAAEECJdYAwgggIBZAoRLZvWLahFAAAHdBAiXdOsI9SCAAAIhECBcCkETmQICCFglQLhkVbuZLAIIIOC7AOGS76QMiAACCCBAuMQaQAABBMwSIFwyq19UiwACCOgmQLikW0eoBwEEEAiBAOFSCJrIFBBAwCoBwiWr2s1kEUAAAd8FCJd8J2VABBBAAAHCJdYAAgggYJYA4ZJZ/aJaBBBAQDcBwiXdOkI9CCCAQAgECJdC0ESmgAACVgkQLlnVbiaLAAII+C4wNyMjo329evWW+z5ywAMWFRV1zszMfDfgl2F4BBBAAIEUBMrKyrLVZRkZGWtSuDxtlxQXFx9VWlq6REROTduL8kIIIICAhgKESxo2hZIQQAABwwTmGVZvrNyuIjLf0NopGwEEEAi7QE75BFcZMNFuBtRIiQgggECgAoRLgfIyOAIIIICAxgJREeF/BzVuEKUhgIDVAiPLf0bnWq3A5BFAAAFDBHhTbUijKBMBBBBAwHcBwiXfSRkQAQQQ8E2AcMk3SgZCAAEEghcgXAremFdAAAEEENBTgHBJz75QFQIIIKAECJdYBwgggIBBAoRLBjWLUhFAAAEEfBUgXPKVk8EQQAABXwUIl3zlZDAEEEAgWAHCpWB9GR0BBBBAQF8BwiV9e0NlCCCAAOESawABBBAwSIBwyaBmUSoCCCCAgK8ChEu+cjIYAggg4KsA4ZKvnAyGAAIIBCtAuBSsL6MjgAACCOgrQLikb2+oDAEEECBcYg0ggAACBgkQLhnULEpFAAEEEPBVgHDJV04GQwABBHwVIFzylZPBEEAAgWAFCJeC9WV0BBBAAAF9BQiX9O0NlSGAAAKES6wBBBBAwCABwiWDmkWpCCCAAAK+ChAu+crJYAgggICvAoRLvnIyGAIIIBCsAOFSsL6MjgACCCCgrwDhkr69oTIEEECAcIk1gAACCBgkQLhkULMoFQEEEEDAVwHCJV85GQwBBBDwVYBwyVdOBkMAAQSCFSBcCtaX0RFAAAEE9BUgXNK3N1SGAAIIEC6xBhBAAAGDBAiXDGoWpSKAAAII+CpAuOQrJ4MhgAACvgoQLvnKyWAIIIBAsAKES8H6+j16fxHpJiIH+D0w42kv8IOIvC0iT2lfKQUiYI4A4ZI5vaJSBBCwT4Bwyb6eM2MEEDBYgHDJjOY1b968+ZpDDjmoftu2R0datmxpRtVU6ZvAd999J8uWfRb95ptvi9avX99KRDb6NjgDIWCvAOGSvb1n5gggoL8A4ZL+PaJCBBBAoEKAcEn/xdD8kEMOXjvhyfG1u55yiojqWOzXIYu+ZmTUr+hUWdl2ax3mvj1Pbrj+ppKvv/5mbxEp0H/5UiECWgsQLmndHopDAAHLBQiXLF8ATB8BBMwSIFzSvF/Nmzcv/Ne/pmR27fpbsTVRycjI3KVLZWVF1nrMmTNPLrvsysKfflrfUPPlS3kI6C5AuKR7h6gPAQRsFiBcsrn7zB0BBIwTIFzSu2X9O57Y4R//WfRORCIRkWhUbPvaokUbWbt27S5datSokWze/JN1HrH+n3hil+gHH3x4rYhM0nsJUx0CWgsQLmndHopDAAHLBQiXLF8ATB8BBMwSIFzSu1/P/+EP11z2xBPj9a4ywOqq27UUezl395Kdj/79b5CnnnrmeRG5wk6BpGetQgT14Gde0nShvoBwKdTtZXIIIGC4AOGS4Q30uXzey/kMynAI+C3AL1p+i/o73twRI4Z1y80dbm2fCJeqX1B5eXdH8/LumS8ip/q75EI5WvSX7d9INBqVupmHEDCFssUpT4pwKWU6LkQAAQQCFyBcCpzYmBeIFhd9LZFIROrUP5j3csa0jUJtE7A2tDCk0XOHjxjWLS/3rohFZ3dXOrM8I6PBbltVVlZo49nmjk9u3j3RUYRLiXwbR4uLvqp0Cn7dzMN4U5KInB3PIVyyo8/MEgEEzBQgXDKzb35XHS0u+rLSWat1Mw/lvZzfyoyHgA8ChEs+IAY4RPnOpbus7lN1AZMKlmx+5OXdw86lPS+AaHHRF9U+q27mb3hTsmc/G55BuGRDl5kjAgiYKkC4ZGrn/Kub93L+WTISAoELpDO0yBGRO0VE3ZeSLSLqo9TVY72IrBGRr0XkHhFZFfiszXmBucNH3NEtL3d4JCpRiUhEbPxaK2PXD0UrLdtmrYdaB7l5d0dH5f2V2+J2/70cLS5a4dwKp7ZQV/e1XoMjCJjM+VkYVKWES0HJMi4CCCDgXYBwybuhySNEdxR+vtv3cer9Xd3Mw3kvZ3KHqV0HAZXRXCciF5fnM41EpHZ5YSUisrU8r3lBRJ7YU1aTjnDpSRHpKyJNY3otWrSQQw91tjPKV199JT/88EM87CYRebF8kjqA12QN5TuX7oy45xDbenNcVDLiAqaysm2Vtsba6JKX91d2Lv1asFT4WULfLfUaHMmbkpr8CVfzr024VPM9oAIEEEBgdwKES/aujeiOws8S+u2nLu/l7F0lzNyLQBcRmVi+8SeZcdSGoH4isrC6i4IMlwbWqlXr3tLS0voHHnig9OvXT3r37i3t2rWrtvglS5bIK6+8IhMnTpTVq1dLrVq1tpeWlt4hImOTmW3Inlu+c8neM5div/lVDZfsjdncmNE9c4mdS9V8v0d3FC5LKm+s1/BoAqaQ/eBMYjqES0lg8VQEEEAgzQKES2kG1+Tloju2LUvq39XrNeC9nCa9owz9BdROpWki0t5jqW+Xh0yV7joLKlyaJyJdVaiUl5cn11xzTVK1T5o0SUaOHOmETCKiCj8tqQHC8+S5I0bc0S03194zl+JDpaptdXcw2flwz1wiXKrS/eiOwk9FolGRSCSpr/UaHkPAZOe3EuGSnX1n1gggYIYA4ZIZffKzyuiObZ8k/T5Ove+r16At7+X87ARjhVFABUufi0imT5MrEhF1zkhFwOR3uKQKnq22V1199dWiQiIvDxVKPfPMM2oItf3qjD3d4+fltTS9du7w4Xd0y8u7K/JrZ8fs7kwZk//810Kl6kIm23xyc++JjhpFuBS3FqI7ti1N6Fa43d1gWr/hsbwp0fQHYYBlES4FiMvQCCCAgEcBwiWPgIZdHt2+bWlCt8Lt7g6GeryXM6zllJtGgUtEZEr52TKVXjYnJ8e5w0z9X9OmTSvuNFN3lm3atMm5u0z936pV1R6Nrb4dfyci/wziFykVAh08ZswYGThwoC9WY8eOlUGDBsUCJvegJnsezs6lkbl3Rmw6zDuZYCm2FNQuJpsOOx/lnLlEuFTe/+iObUt86X/9hs4OUb9Dd3t+Ypk3U8Il83pGxQggYI8A4ZI9vY5u3/axLx/WU6+hcwQL7+XsWTvMdM8CagPQyqrfFypUys3NTfguM7VxSD2/mpBJvZ9uozYC+fmN59wKp85MSvY2uD15xAVM6tOxuu3p+SH6+/KdS3dGUrjTJ9k7g7R5fq1a6pD65B6lpVu1qT/JO7JSqjs396/sXHKXSHTH1o98CZZiAW79RsfzpiS5bz+Tn024ZHL3qB0BBMIuQLgU9g6Xv5fbvvVDX4Kl2D8012t0HO/l7Fg7zHLPAtXeCterVy/nLjO1UymZh9rJpLKeV199teplzi1yfoVLapvSGD9uhdvd5OJukVPbmGw55Dtu51JSZxR72lJq+2HZJsyfnUuxYOm/nm6F2+0tco1O4E1JMv9LY+5zCZfM7R2VI4BA+AUIl8Lf4+j2rf8N5PeWeryXC//qYYaJCHwsIpU+Ua26zOabb76RN954Q/773//Kxx+rS0Tat28vHTp0kPPOO0/atFEbk3Y+4rKZ+D+e70u4VKtWraKWLVvW3819eIlMOqHnqK1b33//vfoUOb8OoUrodWvwSXOHDx9q5ZlLtp2hlOx83TOX7lU7+U6twfVZky8d3b71g6QO7U52i1j9xh0JmGqyw+l5bcKl9DjzKggggEAqAoRLqaiZc010+5bFKR3eneiHt9Rv1IH3cuasByr1X6CLiCyIH7a6YOnhhx+OTp06NdK8eXNp1aqVqA9lUw/14Wpr1qyR9evXyxVXXBEdOHBgEoVqUwAAIABJREFUpexIndFUdQeTH+HSkyLy+yBuh6vqq7Zu9evXT/3xUyLyB//9tRuxfOfSMKvOXLLp7KRUz9IalXevzWcuRbdvfT8tW/nqNz6RNyXa/Vj0tSDCJV85GQwBBBDwVYBwyVdOrQaLbt/yvnsyUsC3DNRvxHs5rTpPMekUcM7Djr2g2qijDumOvxXu1FNPlXr16jmHef/aY9q0aVJWViazZs2qeJq6Ra5du3aVzmDyI1wqatu2bf1PPvkkLVAKZfXq1QUiktwNgmmpzvcXKd+5ZNeZS+k4s8j0M6zcM5es3LkU3b5lUdDvQyqNn9n4ZAIm33+0aTMg4ZI2raAQBBBAYBcBwqVwLopo0ZZF6ciVKt7P1ee9XDhXErP6NQF11lJ+/BOqbgbq1q2b7LPPPnLSSSdJIp8yv3DhQikoKJA5c+ZUDBu3+cf5M6/hklP0yJEjnZPD0/FQr5OXl6deqrU6kTwdr+nDa6jGThORZ0RkSRLjzR0xYmj5p8UFHuyn9Rf2NPxDRajn4565ZES4lOrar+7bJLp9y3uS7C2E6vnTx3R1xjt78DspXZ/ZpLMfPy+T+NbnqWkQOEBEPhSRFml4LV4CAQQQQCB5gevVsR8ickPyl3KFjwIlIqJ2EdwX+7hxD2NHiza/m9AvslXf7/374VOcl+05aH5K19dv3In3ch4ax6U1KpDK71P3isjQWNVqg05+/s6s6cEHH4y++eabkdNOOy2p76eZM2dKnz59Kt0i17p164rdS17DJeeWOHXok9oSlY6H2sqlDpcy7NY49a/jsYfq6isJBk3OzqXcvDsjid5bzPOigd67rYtvnjk7l1Jd+1V/nESLNi9M+UfM9DHuh0z2HKQ+1DK1R2YTdduy50A+tRfnqiAEzhCR60Tk4iAGZ0wEEEAAAc8CJ4mI+hflszyPxABeBOLfy6mg6dMUgybey3npAtfaLJDK71OVbokbMGCAjB3rfiaaOry7b9++0rNnz6SCpVjgqw7+fv3110UFVuoxcOBAeeSRR5z/32u4pH5T66peKJ0PtW1LRNRhxu5vjPo/dge0p6DJ3bk0cpgzZdNv5aJ+/3KvUaPUmUtG7FxKde3Hf1dHizars+hSvyl/+pjTnPF6Dnrb0ziZTZx/NfP6c1P/n1h2VPieiPxJRBbZMV1miQACCBgpoO6/uEdE5hpZfTiK3t17uWSCpmjR5nfK30Kl9n5u+hj3M2x6DlJLIfV7IDKb/Jb3cuFYlzbNIpXfpzaJSFYM6e233xZ1G5x6qCDo2WeflS5duqR0R4e6Pe7aa6+Vm266yRlv3rx5os5u8uMb6+tWrVodrE4RT+ejSZMmsmXLFnV7mbOFyYBHIulbdUHT3OHDb2fnEsnaLsmiu3NptAmfFpfq2o99W0eLNs9P6Qdf/L3D08ec7ozXY+DslBL6+K3ZDbKcH8wETAb84P2VEl8XkSdERH3lgQACCCCgr4D6hOjpIvIXEdl50Ie+9YaxskTey/1a0BQtLJjn+f3XjLFqw7EKl+Z4fl+Y2cQ5LoH3cmFcreGcUyLfg1WzBPU9WSvGsXLlSlG3r6nHZZddJt9//70cdthhKWmtWLHCGUsFVOoRd2eZ52+qTV27ds1SaVU6Hyp1mz9/fuxQb3XYn+6PZA+kii2OziNGDD1h5Mg7IokcspXKWTSMq+44jHr+H7x0O44aNTp+55LO3wOprn11PtnHRZvnpdSfGWPPTOhnQs9Bs1Mav0GWk87H3pTwr6kJadf4k7aLyEEi8ouIvCYid9Z4RRSAAAIIIJCIQH0ReaP8f3e/E5G65f8ir/6cR/AC7paExB/xQdPUwoK3U3qfPX2MGybt6dFj4KyUxs9sUukfC3V+L70nAtP+fqOINDOt6BquN5Xfp9wkqfwRf6fZb37zGzn44IOlWbPU2vDzzz874dSnn6o7ZN1H+Z1loQiXksWuibWR7A8sdVC5Opep0/Dht5+Qmzcs4uGOIC87R73cicTrpr5jd4/uebn3xu9c0vl7INW1P0mFS4Wb5qR0L+GMsd0T+j7vMeCtlMZvkOXcZhcLl9Kbric0M55UjYAKlzaIiPraUkRqi8i5IlKEFgIIIICAEQLqQOke5eGSeq9MuJSetrmfipL4o7T8XKbRIjK1sGBuSmd7zHgksaO2egycmdL4DZo6u9pj7+V0fi+duLwZz1S3a9nwqe9+diOV36fcA5HKH1XDpZYtW0pWVsVdc0nVunHjRlm/fr0sW7as4jq/wqWvs7OzD169enVSBXl9ckhvi4sFSuqX6tgnys0dMeJ2zlyy44zupM7Ucs9cCs1tcdWt/YqfhYWbZnsOKmc8ot6LqtviZuwxuNtTkNsgy/mXNLZSe/1BXvPXq4RwRPkvKipw4oEAAgggoK/ARSJyqYj01bfE0FaWyC058YHSP6tIRAsLZnt+/zVjbPl7uQEzPL8vbNCU93KhXa3hnFgi34NVf5/a7W1xl156qRMMqYAplcd3333nfMDac88951zu521xHOidWEd2tyB+7ZdqNXL5mUtq5xIJi3D2UsW/zFTZuZTYKqyZZ6W69uOrjW7bNNPD0Y0iMx452xnvrAH/9jROg6bOjiiCpZpZS0G8qvpnyztEJLG990FUwJgIIIAAAnsSUPcvqX+5T/b2rD2Ny98nJrC793K/FihVHTlauGnmnv797lf//q3y93I9Bvzb0zgNeS+XWNd5lk4Cqfw+tdsDvceNGycPPfSQZGdnp3RLaX5+vtxxxx1y4403OkZ+Huj9pIj8/uOPP5Z27dqlpQFxydhTIvKHtLyo9xeJXxB7CpTiX23u8BG3d8sdeUeEYIWPy4sPGPNGjY6OMm/nUjJrf5c3Jds2vZVyMPTWI+c44/UY8GbKb0gaNHW2ZxMsef95qNsI6oBYFTAt1q0w6kEAAQQQcASmicg4EVEf+coj/QLxv8ckEyhVEzC9lfL7sBnl7+XOGvBmyu8HG/JeLv2rh1f0QyCVLOFrETk49uIDBgyQsWPHOv+pDvc+44wzpGnTpimdPbtp0yZ1/rUTTqnHwIEDnU+g8+MXJXUvX/7IkSMlNzc9t6qq18nLy1O1q0Oq1C+rJjxiB3TH3/KWSN3uzqXcO/iFNhEti56TlzfalE+LS3XtV9fN6LaN01PaCv3WI+c545116+spXd+waU8/fl5atEKNmurj6nwvEfmHUVVTLAIIIGCPwFoROVZE/mfPlLWaaeyAbnWGUtVb3pItNLpt0/SUbpF7a1z5e7kBr6d0fcNmvJdLtlk8XxuBVH6fuldEhsZmoD7dTYVKsceDDz4YHTt2bKRx48ZJBUxbtmyRIUOGRAcOHFiRT6ixV61yYxk/QouinJyc+mp7VDoeOTk5snr16tgnxaXjJWvyNeJ2LklKP0hTjvYDPIw65X+yUJktdTnrwKCdS35//0S3bVT/YqXOuI+m5WuDZs4tdX78rPTbgvH8EVC3Wqj+pudfSPypmVEQQAABmwRi7wBtmnOY5xot3KhubUvP+zj1Og2bOTvYeS8X5lXF3KoKOJuA4v9w4sSJcs0111T8UZcuXWT58uWizrNO5NPTVbB0zDHHOLuWYo9JkyZJv379Kv7bj28y59a4qsUG0d+44k26Jc4Lxdzhw2/rlps7TN0TRrJCslSRMOblqU+Lu099Z9t4/kB02wa1Ayn4WyUbNlMfJsabES8/xAy4lnDJgCZRIgIIWC1AuBS+9ke3bXwjpU95S/b9X8O9nB1PfvzOG74uMKOwC1S6NU7tMFLHGanb4WKPTp06yZdffpmQw5FHHinvvPNOxXPV7XHqYO/4TUa+fKPVqlWrqFWrVoHvXlK7ln744YfNJSUlqX1uXkJsWj2pfOfSUM5cSkOQYNKh6Xmj7jPlzKWgvqGi2za8FmjA1LAZb0aCap5m4xIuadYQykEAAQSqCBAuhXNJRLdtVLe4BfehRQ33Op9gKZxrh1klJtBFRBbEP7V3794ybZo6xm7nQ90iN27cuMj69eulpKREMjIynL8sKyuT2rVry1577SWDBw+ODh48uFJ2pMZ69dVXK43lS7ikznESkTFqm5XawRTEQ439zDPPqKEHiYh7GlX4H+U7l+6IsG+JO+Li7wh0z1yydudS7Ds/unXDK4HcGtdwr168GQn/z9fYDAmX7Ok1M0UAATMFCJfM7FsiVUe3bXg1kFvkGu3Vm/dyiXSA54RdYJ6IdI2fZHWZjToz6Y033pAFCxaI+gA19VAf2HbKKafIeeedV3F4d2ycuGwmfuj5foVLalCn8DFjxjgnhvv5UCebDxqkMiVRtwGpjyO15TF3+Ijbyj8tjjOXuDNw552R7plL1odL6udAdOuGab7eMNlwrwt4M2LLT1h3noRLdvWb2SKAgHkChEvm9SyZiqPbNkzz9W1+I97LJePPc8MtoM5eWiEi9eOnqXYdqU1B8bfIJcKgboVTZyy98sorVZ++XUQO9zNcUi/g3NenwiD1cXd+POKCpW9E5BA/xjRojLidS+k79C6dhyWn8zC/MM2LnUuVvoujW39+yZdv60bN+xIs+SJp1CCES0a1i2IRQMBCAcKl8Ded93Lh7zEzrDmBXQ73VqWoM5hyc3Pl6quvTqgydf51Xl5epTOW4i5sLSKr/A6XVOFzVMDkxy1ycdutVLB0uio4oZmH50nlO5c4cynZw/vC/nz3zCV2LsV9q0e3/vwvT9/5jZpfSLDkSdDYiwmXjG0dhSOAgCUChEt2NJr3cnb0mVnWjMAlIjK1updWIZPayaT+Lysry7kdTj3U7XEFBQXOLiX1f/EHd1cZ51IR+WeQv0g5t8ipA7hVupVoGhYrUqViKkVT9/5ZeCtcfK/Kdy4N1fbMpY+XfCqbCzZLk6wm0r5dW1+3tMafMVTdmVMFmwpkydJlzi1Rxxx7tDRrmpXW199TfUH+fV7efZy5tOtPx+iW9S+klCs2an5xkD8Pa+Z/QnjVRAUIlxKV4nkIIIBAzQgQLtWMe028anTrzy+kdMZ34715L1cTDeM1jRKo9hY5DzNwboWL3wDk986l+NoG1qpV697S0tL6KmRS9+b16tWrIgmrOgmVjKnTxtW9fypUql27tvpUOPWm35bDu6vra3m4dHskncdZq3sply5d7hzylJNzoLRunb3zsJ8qp9uMHj1Wxox5VFq0OEA+/lh9NGFEnn12igwdmicbNmyUOXNek06dOjp/Hj9u1fns6XWqm39+/iq5+OJ+8tFHS+Wll56VXr167rbORP3y89c4827dWn3v6XuMel7e/YRL1f8kjG5ZP1UikYhEo9GEvjZqroJ8PqLWw/+wmH4p4ZLpHaR+BBAIuwDhUtg7XHl+0a0//zPh93Hq/V7jvdXGCd7L2bVMmG2KAuqXXPUpaZUO+U5hLHUWtrqfrtKdZUGGS7EanxQRdb9JVuwPGjduLMcff7zznx9++KFs2bIlfj4FIqLub/lDCpMM2yVzhw8f0i03N307l/7+6AQZOeJeady4kZSVRWX7ju1y0YW95O+PPrjbQ5PP6n6BbN68Rf7zn9lOHNOxw2nSsuUBcvjhh0qv3ufIySd1cP58xedfSK9el8s336yUBg0ynW136qH637v3ufLMM48lHefMm7dQunfvIy++OEl69To76esXL/5QHn74MZky9SlnfkcccaLUq1dXPl6ywNdDov2OqdydS/erb+pTw7bofZhPdMv6KQkN03jv3/FmJCGpUD+JcCnU7WVyCCAQAgHCpRA0Mckp8F4uSTCejkCSAl1EZJI6zijJ69RxRdeIyMLqrktHuBR7XZWSDS8/lFulCm3K/2KliKhASR0G/hcLz1X6tX464dLI3KGRIG+xig8+cg48Wk44ob28/PKzTlBz0YVXy157NZMnnhjr/HfsVrTWOdmS0/pAJ4A5s/sFsmXzFln0n9myKn+1dOnSQ4499mgZctsA6da1c6XAZ9bMudKz50Vy3XXXyGPjH3Kuv+nmIVJaUiLX33Ctc4udeh01vvq6etUa52u7Y492vn6ydJnzNTbu/Lhw6cCcbOd69VWNm79qjfP1lK6dna8r81c748XfwtezR1/Ztq1Q7r77Lue6P//pLmmV3VIeGXtvRd3q1j91/bHt2jpfY7cCquer+ar7sKrOM+h+jSJc2tPPweiWn553erO7vdWN976MYGlPinb8PeGSHX1mlgggYK4A4ZK5vfNSeXTL+sm7fR+n3t813udy3st5EeZaBERURnOD+rVfRPYWkXpxnyynbnvbISLrReRFEXl8T1lNOsMlmpe8QNzOpfR8Wlzr1sdIvXr15JFx90qPs86QlfmrRH3KWk7rbBn/2NMydGiuNG++l2zdtk1GDL9Nbr6lv5zVvU/FzqW2bTuJurVM/U5/wAH7y4ovFjvXxz4VbmZFuHS1jB//sAwafKdcdOH5cnKnjnLH0FHyj39MdF5//OMPSd06deWaa26UZs2aylszX5IjDj/R2RG1ceMmOeLIw+TdhW/Jzp1LE2Xhwv/I449PlIsvvkD6Xni+XNvvJue2qB9//EKmvfKGXHXlDbLvvvs4B5P16XO+HHbYwfLAA+OcXbRNmzaRe+8dIbfeOlSaN28uS5a+I4vf/1D69r1KSktLpahou+y//37yzP89JpMmTpbJk/8lW7duc4K3X375RTp0PE5mzVQfo5qePrFzKaFvpujmn56ttP5i/Wm8zxW8GUmI0IonES5Z0WYmiQACBgsQLhncPI+lR7f89Fy176+b7HMl7+U84nI5An4LEC75LerveOU7l26PxAc0QQYYf/7TcHnuuRdk69atcuihB8vpp3eVBx/6i/ML+mGHnSBHHXW4vDztWelzwZXy1dffyrJP34vbuTTLed7++/9Gzjmnuzz51LhdfrGfNfNtZ+dS/OPFFyc6YY+a1+mn9XJum1u6dKHz34cecrxMnjxBunc/Te6//xG57bYB0v+6AfLmGzPl+x8+k/nz3q24Le78Xj2lZYsjpWfPM+Spp/4mV155vSxYsEhW5i+VL1Z8JZ8u+9y5xU/dRqfm9+57b8mJHc+QrKZNKoIhFZRt2lQgixfPlbN69JWNGzbJ+4tnO/M46qiTJTu7hUyf8S+nrg4djpMpU56Uyy/v77zOqtVqh9POIC3IPo1yzlzitrgEvt2im3/6v0q3ODbe5yrejCQAZ9FTCJcsajZTRQABIwUIl4xsm29FR7f89H+V7oRowns533AZCAE/BQiX/NT0f6zynUu3p/XT4r79ZqXcfnueE/IsW/a5/O53feXaa6+Q3r0vly1btlbM8oAD9pM13y2P27k0y/nBf8D+hzvh0lNPjdvlDKSZ5eHSddepnUsPyXHHdZO77vqTXNDnPCcAmD5jtlx8UT/53WUXyuG/OVQmTHhGPv/8fVn8wUcyeNCdsmjRB87rq91T69Z9KfMqwqWJzplLLcrDJRVsqZ1KKvTJz18qTz39vNx/3yPy9dffOteqQ8oXL54jHTueLk2bZslbM18uv8Wvj3Pr3/uL58jRR50sbQ5qLW+8PsWZx7nnXOLcWvfZ8kVySHm4NHnKBLmu/0B5/fUZsnbtiqTPfEr1LCb3QG/CpQS/5aKb101ybpFrso86d44DHxN0s+VphEu2dJp5IoCAqQKES6Z2zr+6o5t/esa5Ra7Jvuq4F97L+UfLSAj4J0C45J9lECM9d+21V1z+xISxaTtc+pGxj8uAgTdUvF7nTj2kuLhYHnzwL9Kr12VO0DT+8Ycr1XNm9z7lZy6pnUsi+5eHS+7OpcqfuRbbuaTCJXXmkjqzKKtplvxt3BMyfMQQ5/kdOpzu3GqmXrd//6tk4KAb5bxzL5WVK1fL8uXvyfXXD5Zp096Q/637Mm7n0kQ5v9fZcTuXxsmV5eGS2rnU9uhOzi11b731kpzV40LZuGGjEyCd2PF05/VnzXzZCYZ27lyaI0cedbIc1CZHXn9jqlPX2edc4tS7bPmiuJ1LE6R/ebj049oVaetT/z8MkIkTn39ORJw9wTz2KKDay5uRPTJZ+QTCJSvbzqQRQMAgAcIlg5oVYKm8lwsQl6ER8EOAcMkPxeDG+P2JJx4/4b333ook+rHqXp+XmdlCfvzxc8nKauKcV3Tyyd2ldu3a8tprk6VDh9Nkn332lkWLZlb6eNCzzupbfubSLOfPDzjgCDnnnDOdW9Oq1uOeuXSxxHYuqb8vKNgszZsfLKWl653njx07XoYNu9tRLSz83qnj1FPPl6KiIue1L7/8Opk9e375ziX1aXF9Rd1ap3Yu5eQcI8ccc5RT71VX/bFi59JBB7WTDh2Ol6lTn5SuXc+T7duLnJ1LJ554hjRs2FDmzHnFeZ0zz+zjnMn0/vuzndv3fvhhrXzyyUKnrvbtuzrnP7399ms7dy5NfkKuu27Qzp1L0agzjtc+7On6k07qHv3gg4+uLT/lP7gVyMgIhF+AcCn8PWaGCCBgtgDhktn9o3oEELBEgHBJ80bvvXfzbVOmTGhw2mmnpOWw6FYtj5ayslLJzMx0PkWtUaOGMmXKBOnY8Xj529+fkHvuftg54DojQ53BdIicc85ZMmbMY1JS8ovceusN8umnn8n06bOkbt26MmTILTJs2OCKuj/7fIX07nWlc7tdw4YNJCtLfWigyI4dO5xAZu3/1M4f98yiQw4+Xs4+p7v8bdxo579vufl2efHFV6WkpMQ5XDsaLZNzz+vhfPrbhx8ulbZtj5QpUyfILTcPlQ8++MgJd4qLf3GCsUt/10e++vIb+eyzFbJjxy9Sp05tZ5zR942UeW8vlBkz5khGRob07XuevPbadGfX1IABN0iPnqdL3z5XS2lpmWzfvl3UbYCTJj0mc99e4NxiV6dOHfnLX4bJ6PvGyrr//SQ33vh7uf/+vMD7pAK6q6++cdu6desbab58KQ8BEwQIl0zoEjUigIDNAoRLNnefuSOAgDEChEv6t6rZIYe0WffYYw/WPu30UyrfYxbQ590vWfqpFGza7Mh07drZvau5/H/WN20skKVLlzk7m9q1bytLPv7U2XmkHupg7Nh1sf9ud2zbius3FRTI0iXLdivetVvnitdR47Zuc6A0VQFU+eurulQd6s/VOBm1MqSstKxivGPbHe08f/78dyUnJ9u5blX+GqcuVUfVP1efgNc658CKP1f1xeqPzU+9Xux11Xxj/x3/vPj5x883iHvk1G2Ft9wytOTrr79tKiLb9F++VIiA9gKES9q3iAIRQMByAcIlyxcA00cAATMECJfM6FPWPvs0/+HAA7Mzjz32qEir7JZB5BZpO4w61UOsbb5uzervZPnyFdH8/NWF69at349gyYxvXKo0QoBwyYg2USQCCFgsQLhkcfOZOgIImCNAuGROr1Sl6uMRzhCRVmaVTbU+CKwRkTmcseSDJEMgUFmAcIkVgQACCOgtQLikd3+oDgEEEHAECJdYCAgggAACNgsQLtncfeaOAAImCBAumdAlakQAAesFCJesXwIAIIAAAlYLEC5Z3X4mjwACBggQLhnQJEpEAAEECJdYAwgggAACNgsQLtncfeaOAAImCBAumdAlakQAAesFCJesXwIAIIAAAlYLEC5Z3X4mjwACBggQLhnQJEpEAAEECJdYAwgggAACNgsQLtncfeaOAAImCBAumdAlakQAAesFCJesXwIAIIAAAlYLEC5Z3X4mjwACBggQLhnQJEpEAAEECJdYAwgggAACNgsQLtncfeaOAAImCBAumdAlakQAAesFCJesXwIAIIAAAlYLEC5Z3X4mjwACBggQLhnQJEpEAAEECJdYAwgggAACNgsQLtncfeaOAAImCBAumdAlakQAAesFCJesXwIAIIAAAlYLEC5Z3X4mjwACBggQLhnQJEpEAAEECJdYAwgggAACNgsQLtncfeaOAAImCBAumdAlakQAAesFCJesXwIAIIAAAlYLEC5Z3X4mjwACBggQLhnQJEpEAAEECJdYAwgggAACNgsQLtncfeaOAAImCBAumdAlakQAAesFCJesXwIAIIAAAlYLEC5Z3X4mjwACBggQLhnQJEpEAAEECJdYAwgggAACNgsQLtncfeaOAAImCBAumdAlakQAAesFCJesXwIAIIAAAlYLEC5Z3X4mjwACBggQLhnQJEpEAAEECJdYAwgggAACNgsQLtncfeaOAAImCBAumdAlakQAAesFCJesXwIAIIAAAlYLEC5Z3X4mjwACBggQLhnQJEpEAAEECJdYAwgggAACNgsQLtncfeaOAAImCBAumdAlakQAAesFCJesXwIAIIAAAlYLEC5Z3X4mjwACBggQLhnQJEpEAAEECJdYAwgggAACNgsQLtncfeaOAAImCBAumdAlakQAAesFCJesXwIAIIAAAp4F5noeoeYGaF3+0vk1VwKvjAACCCDwKwKnisjbmgudpnl9lIcAAggELkC4FDgxL4AAAgiEWmBuRkZG+3r16n1m4iyLi4tbqbrr1q37nYn1UzMCCCAQdoGSkpJOtWvXfk/XeRYXFx9ZWlq6RERUCMYDAQQQsFaAcMna1jNxBBBAwBeBuZmZmXULCwsv8GW0NA+y9957/zkajUZ+/vnnB9L80rwcAggggEACAo0aNVq3devWfRN4ao08pUGDBi8XFRWVEC7VCD8vigACGgkQLmnUDEpBAAEEDBQgXDKwaZSMAAIImCJAuGRKp6gTAQRsFyBcsn0FMH8EEEDAmwDhkjc/rkYAAQQQ+BUBwiWWBwIIIGCGAOGSGX2iSgQQQEBXAcIlXTtDXQgggEAIBAiXQtBEpoAAAlYIEC5Z0WYmiQACCAQmQLgUGC0DI4AAAggQLrEGEEAAATMECJfM6BNVIoAAAroKEC7p2hnqQgABBEIgQLgUgiYyBQQQsEKAcMmKNjNJBBBAIDABwqXAaBkYAQQQQIBwiTWAAAIImCFAuGRGn6gSAQQQ0FWAcEnXzlAXAgggEAIBwqUQNJGiasjEAAAgAElEQVQpIICAFQKES1a0mUkigAACgQkQLgVGy8AIIIAAAoRLrAEEEEDADAHCJTP6RJUIIICArgKES7p2hroQQACBEAgQLoWgiUwBAQSsECBcsqLNTBIBBBAITIBwKTBaBkYAAQQQIFxiDSCAAAJmCBAumdEnqkQAAQR0FSBc0rUz1IUAAgiEQIBwKQRNZAoIIGCFAOGSFW1mkggggEBgAoRLgdEyMAIIIIAA4RJrAAEEEDBDgHDJjD5RJQIIIKCrAOGSrp2hLgQQQCAEAoRLIWgiU0AAASsECJesaDOTRAABBAITIFwKjJaBEUAAAQQIl1gDCCCAgBkChEtm9IkqEUAAAV0FCJd07Qx1IYAAAiEQIFwKQROZAgIIWCFAuGRFm5kkAgggEJgA4VJgtAyMAAIIIEC4xBpAAAEEzBAgXDKjT1SJAAII6CpAuKRrZ6gLAQQQCIEA4VIImsgUEEDACgHCJSvazCQRQACBwAQIlwKjZWAEEEAAAcIl1gACCCBghgDhkhl9okoEEEBAVwHCJV07Q10IIIBACAQIl0LQRKaAAAJWCBAuWdFmJokAAggEJkC4FBgtAyOAAAIIEC6xBhBAAAEzBAiXzOgTVSKAAAK6ChAu6doZ6kIAAQRCIEC4FIImMgUEELBCgHDJijYzSQQQQCAwAcKlwGgZGAEEEECAcIk1gAACCJghQLhkRp+oEgEEENBVgHBJ185QFwIIIBACAcKlEDSRKSCAgBUChEtWtJlJIoAAAoEJEC4FRsvACCCAAAKES6wBBBBAwAwBwiUz+kSVCCCAgK4ChEu6doa6EEAAgRAIEC6FoIlMAQEErBAgXLKizUwSAQQQCEyAcCkwWgZGAAEEECBcYg0ggAACZggQLpnRJ6pEAAEEdBUgXNK1M9SFAAIIhECAcCkETWQKCCBghQDhkhVtZpIIIIBAYAKES4HRMjACCCCAAOESawABBBAwQ4BwyYw+USUCCCCgqwDhkq6doS4EEEAgBAKESyFoIlNAAAErBAiXrGgzk0QAAQQCEyBcCoyWgRFAAAEECJdYAwgggIAZAoRLZvSJKhFAAAFdBQiXdO0MdSGAAAIhECBcCkETmQICCFghQLhkRZuZJAIIIBCYAOFSYLQMjAACCCBAuMQaQAABBMwQIFwyo09UiQACCOgqQLika2eoCwEEEAiBAOFSCJrIFBBAwAoBwiUr2swkEUAAgcAECJcCo2VgBBBAAAHCJdYAAgggYIYA4ZIZfaJKBBBAQFcBwiVdO0NdCCCAQAgECJdC0ESmgAACVggQLlnRZiaJAAIIBCZAuBQYLQMjgAACCBAusQYQQAABMwQIl8zoE1UigAACugoQLunaGepCAAEEQiBAuBSCJjIFBBCwQoBwyYo2M0kEEEAgMAHCpcBoGRgBBBBAgHCJNYAAAgiYIUC4ZEafqBIBBBDQVYBwSdfOUBcCCCAQAgHCpRA0kSkggIAVAoRLVrSZSSKAAAKBCRAuBUbLwAgggAAChEusAQQQQMAMAcIlM/pElQgggICuAoRLunaGuhBAAIEQCBAuhaCJTAEBBKwQIFyyos1MEgEEEAhMgHApMFoGRgABBBAgXGINIIAAAmYIEC6Z0SeqRAABBHQVIFzStTPUhQACCIRAgHApBE1kCgggYIUA4ZIVbWaSCCCAQGAChEuB0TIwAggggADhEmsAAQQQMEOAcMmMPlElAgggoKsA4ZKunaEuBBBAIAQChEshaCJTQAABKwQIl6xoM5NEAAEEAhMgXAqMloERQAABBAiXWAMIIICAGQKES2b0iSoRQAABXQUIl3TtDHUhgAACIRAgXApBE5kCAghYIUC4ZEWbmSQCCCAQmADhUmC0DIwAAgggQLjEGkAAAQTMECBcMqNPVIkAAgjoKkC4pGtnqAsBBBAIgQDhUgiayBQQQMAKAcIlK9rMJBFAAIHABAiXAqNlYAQQQAABwiXWAAIIIGCGAOGSGX2iSgQQQEBXAcIlXTtDXQgggEAIBAiXQtBEpoAAAlYIEC5Z0WYm+f/t3Q2wXGV9P/DfTXIjCSUJBUUlb2iHWgkQKoIaSIiKL1gEBESNVahgBYsIfygRabmXAUWiAlZtIdUKLUiIpFLKi7wZKtIBBUIFVKqYEESkIknQG5IJuf/Z3dy8g3fZ3XPP85xPZpw7IXue8/t9fs/GzHfOPkuAAIGOCQiXOkZrYQIECBAQLtkDBAgQSENAuJTGnFRJgACBsgoIl8o6GXURIEAgAwHhUgZD1AIBApUQEC5VYsyaJECAQMcEhEsdo7UwAQIECAiX7AECBAikISBcSmNOqiRAgEBZBYRLZZ2MuggQIJCBgHApgyFqgQCBSggIlyoxZk0SIECgYwLCpY7RWpgAAQIEhEv2AAECBNIQEC6lMSdVEiBAoKwCwqWyTkZdBAgQyEBAuJTBELVAgEAlBIRLlRizJgkQINAxAeFSx2gtTIAAAQLCJXuAAAECaQgIl9KYkyoJECBQVgHhUlknoy4CBAhkICBcymCIWiBAoBICwqVKjFmTBAgQ6JiAcKljtBYmQIAAAeGSPUCAAIE0BIRLacxJlQQIECirgHCprJNRFwECBDIQEC5lMEQtECBQCQHhUiXGrEkCBAh0TEC41DFaCxMgQICAcMkeIECAQBoCwqU05qRKAgQIlFVAuFTWyaiLAAECGQgIlzIYohYIEKiEgHCpEmPWJAECBDomIFzqGK2FCRAgQEC4ZA8QIEAgDQHhUhpzUiUBAgTKKiBcKutk1EWAAIEMBIRLGQxRCwQIVEJAuFSJMWuSAAECHRMQLnWM1sIECBAgIFyyBwgQIJCGgHApjTmpkgABAmUVEC6VdTLqIkCAQAYCwqUMhqgFAgQqISBcqsSYNUmAAIGOCQiXOkZrYQIECBAQLtkDBAgQSENAuJTGnFRJgACBsgoIl8o6GXURIEAgAwHhUgZD1AIBApUQEC5VYsyaJECAQMcEhEsdo7UwAQIECAiX7AECBAikISBcSmNOqiRAgEBZBYRLZZ2MuggQIJCBgHApgyFqgQCBSggIlyoxZk0SIECgYwLCpY7RWpgAAQIEhEv2AAECBNIQEC6lMSdVEiBAoKwCSYdLL3/5y4+NiK4nnnhiblmB1UWAAIEqC2y//fYLnn766feU1WD06NELVq5cuSYiZpa1RnURIECgCAHhUhHK7kGAAIF8BZIOl3bcccdT+/v7u5566qk5+Y5IZwQIEEhXwJNL6c5O5QQIVEtAuFSteeuWAAEC7RYQLrVb1HoECBAgsF5AuGQzECBAIA0B4VIac1IlAQIEyiogXCrrZNRFgACBDASESxkMUQsECFRCQLhUiTFrkgABAh0TEC51jNbCBAgQICBcsgcIECCQhoBwKY05qZIAAQJlFRAulXUy6iJAgEAGAsKlDIaoBQIEKiEgXKrEmDVJgACBjgkIlzpGa2ECBAgQEC7ZAwQIEEhDQLiUxpxUSYAAgbIKCJfKOhl1ESBAIAMB4VIGQ9QCAQKVEBAuVWLMmiRAgEDHBIRLHaO1MAECBAgIl+wBAgQIpCEgXEpjTqokQIBAWQWES2WdjLoIECCQgYBwKYMhaoEAgUoICJcqMWZNEiBAoGMCwqWO0VqYAAECBIRL9gABAgTSEBAupTEnVRIgQKCsAsKlsk5GXQQIEMhAQLiUwRC1QIBAJQSES5UYsyYJECDQMQHhUsdoLUyAAAECwiV7gAABAmkICJfSmJMqCRAgUFYB4VJZJ6MuAgQIZCAgXMpgiFogQKASAsKlSoxZkwQIEOiYgHCpY7QWJkCAAAHhkj1AgACBNASES2nMSZUECBAoq4BwqayTURcBAgQyEBAuZTBELRAgUAkB4VIlxqxJAgQIdExAuNQxWgsTIECAgHDJHiBAgEAaAsKlNOakSgIECJRVQLhU1smoiwABAhkICJcyGKIWCBCohIBwqRJj1iQBAgQ6JiBc6hithQkQIEBAuGQPECBAIA0B4VIac1IlAQIEyiogXCrrZNRFgACBDASESxkMUQsECFRCQLhUiTFrkgABAh0TEC51jNbCBAgQICBcsgcIECCQhoBwKY05qZIAAQJlFRAulXUy6iJAgEAGAsKlDIaoBQIEKiEgXKrEmDVJgACBjgkIlzpGa2ECBAgQEC7ZAwQIEEhDQLiUxpxUSYAAgbIKCJfKOhl1ESBAIAMB4VIGQ9QCAQKVEBAuVWLMmiRAgEDHBIRLHaO1MAECBAgIl+wBAgQIpCEgXEpjTqokQIBAWQWES2WdjLoIECCQgYBwKYMhaoEAgUoICJcqMWZNEiBAoGMCwqWO0VqYAAECBIRL9gABAgTSEBAupTEnVRIgQKCsAsKlsk5GXQQIEMhAQLiUwRC1QIBAJQSES5UYsyYJECDQMQHhUsdoLUyAAAECwiV7gAABAmkICJfSmJMqCRAgUITAJyPiCxExvImbre3u7v7F6tWr39DENaV56Y477nhqf39/11NPPTWnNEUphAABAgTWCwiXbAYCBAikISBcSmNOqiRAgEARArVw6YKIeLiJm+3a3d39iHCpCTEvJUCAAIFBCwiXBk3lhQQIEBhSAeHSkPK7OQECBEolMBAuNVWUcKkpLi8mQIAAgSYEhEtNYHkpAQIEhlBAuDSE+G5NgACBkglsHC71R8TKiHjuD9S4nXCpZFNUDgECBDISEC5lNEytECCQtYBwKevxao4AAQJNC5weESdHxMvWBUs/jYiPRcQdz7NSv3CpaWMXECBAgMAgBYRLg4TyMgIECAyxgHBpiAfg9gQIECipwH4R8a8RMSEihkXEryPiwoj43Gb1Pjly5MhfrVq16q0l7eMFy3Kgd4pTUzMBAlUSEC5Vadp6JUAgZQHhUsrTUzsBAgQ6LzApIuZFxJ4RsU1ELIuImyPivetufduoUaNG9vX1Hdb5Utp/B+FS+02tSIAAgXYKCJfaqWktAgQIdE5AuNQ5WysTIEAgN4EFEfG2iNg2Ivoi4v6I6B81alS/cCm3UeuHAAEC5RAQLpVjDqogQIDAHxIQLv0hIX9OgAABAgMC+0fEZRExPiJGDPzH7u7un65evbr2Z8n98uRSciNTMAECFRMQLlVs4NolQCBZAeFSsqNTOAECBAoTmB8Rb4+IP4qIgf/fWBsRz9T+N2rUqCWeXCpsFm5EgACBSgkIlyo1bs0SIJCwgHAp4eEpnQABAh0UqB3o/eWI+LOIGLnRfVZHRO0b5E5Y9w1yzlzq4BAsTYAAgaoLCJeqvgP0T4BAKgLCpVQmpU4CBAgUI1ALlGZFxJh13xJXu2t/RPwuIr4TEUduVsZvRo4c+UvfFlfMcNyFAAECVRMQLlVt4volQCBVAeFSqpNTNwECBNov8MmIuGCjZddExGMR8aGI+N7z3K6/u7v7kdWrV7+h/eV0fkVnLnXe2B0IECDQioBwqRU91xIgQKA4AeFScdbuRIAAgbILbBwu1Z5WWjWIgrcRLg1CyUsIECBA4EUJCJdeFJuLCBAgULiAcKlwcjckQIBAaQUGwqXHm6jwlcKlJrS8lAABAgSaEhAuNcXlxQQIEBgyAeHSkNG7MQECBEonUAuXPh8RI5qozMfimsDyUgIECBBoTkC41JyXVxMgQGCoBIRLQyXvvgQIECifwKSIqJ2dNK+J0h4YOXJk36pVq97VxDWleakzl0ozCoUQIEBgqwLCJRuDAAECaQgIl9KYkyoJECBQpMCdEbFnRLwkItZGxOqI+LeI+NhWirht1KhRI/v6+g4rssB23Uu41C5J6xAgQKAzAsKlzrhalQABAu0WEC61W9R6BAgQSFugFiy9cSst1A74vmQrAZNwKe15q54AAQKlFhAulXo8iiNAgMB6AeGSzUCAAAECGwvUviFueEQsjohvRcQrIuKt636ujIhtN+MSLtk/BAgQINAxAeFSx2gtTIAAgbYKCJfaymkxAgQIJC1wVERcGRHXR8TmZyj9NCL+ZF3wtHGTzlxKeuSKJ0CAQLkFhEvlno/qCBAgMCAgXLIXCBAgQGBAoPZtcRdExOSIWLIZS+3PvhgRp0TEhRv92dru7u5frF69unYQeHK/nLmU3MgUTIBAxQSESxUbuHYJEEhWQLiU7OgUToAAgbYLDIRLJ21l5RkRUTu0+98j4vaN/vyi7u7uR4RLbZ+FBQkQIEAgIoRLtgEBAgTSEBAupTEnVRIgQKAIgYFwqal7CZea4vJiAgQIEGhCQLjUBJaXEiBAYAgFhEtDiO/WBAgQKJnAQLhU+2a4wf7qEi4NlsrrCBAgQKBZAeFSs2JeT4AAgaEREC4Njbu7EiBAoIwCtXDpC1s5tPuFau0XLpVxlGoiQIBAHgLCpTzmqAsCBPIXEC7lP2MdEiBAYLACtW+L+3xETBjsBRHx1MiRIx9btWrVW5u4pjQvdaB3aUahEAIECGxVQLhkYxAgQCANAeFSGnNSJQECBMoqcNuoUaNG9vX11Q77Tu6XcCm5kSmYAIGKCQiXKjZw7RIgkKyAcCnZ0SmcAAECpRAQLpViDIogQIBAngLCpTznqisCBPITEC7lN1MdESBAoEgB4VKR2u5FgACBigkIlyo2cO0SIJCsgHAp2dEpnAABAqUQEC6VYgyKIECAQJ4CwqU856orAgTyExAu5TdTHREgQKBIAeFSkdruRYAAgYoJCJcqNnDtEiCQrIBwKdnRKZwAAQKlEBAulWIMiiBAgECeAsKlPOeqKwIE8hMQLuU3Ux0RIECgSAHhUpHa7kWAAIGKCQiXKjZw7RIgkKyAcCnZ0SmcAAECpRAQLpViDIogQIBAngLCpTznqisCBPITEC7lN1MdESBAoEgB4VKR2u5FgACBigkIlyo2cO0SIJCsgHAp2dEpnAABAqUQEC6VYgyKIECAQJ4CwqU856orAgTyExAu5TdTHREgQKBIAeFSkdruRYAAgYoJCJcqNnDtEiCQrIBwKdnRKZwAAQKlEBAulWIMiiBAgECeAsKlPOeqKwIE8hMQLuU3Ux0RIECgSAHhUpHa7kWAAIGKCQiXKjZw7RIgkKyAcCnZ0SmcAAECpRAQLpViDIogQIBAngLCpTznqisCBPITEC7lN1MdESBAoEgB4VKR2u5FgACBigkIlyo2cO0SIJCsgHAp2dEpnAABAqUQEC6VYgyKIECAQJ4CwqU856orAgTyExAu5TdTHREgQKBIAeFSkdruRYAAgYoJCJcqNnDtEiCQrIBwKdnRKZwAAQKlEBAulWIMiiBAgECeAsKlPOeqKwIE8hMQLuU3Ux0RIECgSAHhUpHa7kWAAIGKCQiXKjZw7RIgkKyAcCnZ0SmcAAECpRAQLpViDIogQIBAngLCpTznqisCBPITEC7lN1MdESBAoEgB4VKR2u5FgACBigkIlyo2cO0SIJCsgHAp2dEpnAABAqUQEC6VYgyKIECAQJ4CwqU856orAgTyExAu5TdTHREgQKBIAeFSkdruRYAAgYoJCJcqNnDtEiCQrIBwKdnRKZwAAQKlEBAulWIMiiBAgECeAsKlPOeqKwIE8hMQLuU3Ux0RIECgSAHhUpHa7kWAAIGKCQiXKjZw7RIgkKyAcCnZ0SmcAAECpRAQLpViDIogQIBAngLCpTznqisCBPITEC7lN1MdESBAoEgB4VKR2u5FgACBigkIlyo2cO0SIJCsgHAp2dEpnAABAqUQEC6VYgyKIECAQJ4CwqU856orAgTyExAu5TdTHREgQKBIAeFSkdruRYAAgYoJCJcqNnDtEiCQrIBwKdnRKZwAAQKlEBAulWIMiiBAgECeAsKlPOeqKwIE8hMQLuU3Ux0RIECgSAHhUpHa7kWAAIGKCQiXKjZw7RIgkKyAcCnZ0SmcAAECpRAQLpViDIogQIBAngLCpTznqisCBPITEC7lN1MdESBAoEgB4VKR2u5FgACBigkIlyo2cO0SIJCsgHAp2dEpnAABAqUQEC6VYgyKIECAQJ4CwqU856orAgTyExAu5TdTHREgQKBIAeFSkdruRYAAgYoJCJcqNnDtEiCQrIBwKdnRKZwAAQKlEBAulWIMiiBAgECeAsKlPOeqKwIE8hMQLuU3Ux0RIECgSAHhUpHa7kWAAIGKCQiXKjZw7RIgkKyAcCnZ0SmcAAECpRAQLpViDIogQIBAngLCpTznqisCBPITEC7lN1MdESBAoEgB4VKR2u5FgACBigkIlyo2cO0SIJCsgHAp2dEpnAABAqUQEC6VYgyKIECAQJ4CwqU856orAgTyExAu5TdTHREgQKBIAeFSkdruRYAAgYoJCJcqNnDtEiCQrIBwKdnRKZwAAQKlEBAulWIMihgQmDhx4geXLVs2bc2aNS+nUj2BESNG/Grs2LF3LF269IrqdZ9nx8KlPOeqKwIE8hMQLuU3Ux0RIECgSAHhUpHa7vW8Aj09Pdv/4z9+9f5dXrXLS3afslvXzjvvTKuCAo899lg8+OBD/Y88svjZk08+eY/Zs2cvryBDVi0Ll7Iap2YIEMhYQLiU8XC1RoAAgQIEhEsFILvFCwvUgqXLL7/8oblzvzp8xoz9I6L2z5v+yv0cNmzUJlBr1z5bSYfa/G+77btx/PEnrjnuuI++5rTTTlvhPZSugHAp3dmpnACBagkIl6o1b90SIECg3QLCpXaLWq9pgZ12etmj8666fJsZ0/eP6OqK6O+v3M/Ng6UBxLX9z1bSo7YPbr3ltvjgB49e+cQTv57U9KZyQWkEhEulGYVCCBAg8IICwiUbhAABAgRaERAutaLn2pYFxo8f/8Hx43f+wn//9+2V/jfN84ZLa1e2bJzyAvvuu1//k0/+5hOLFy+el3IfVa5duFTl6eudAIGUBCr9D7GUBqVWAgQIlFRAuFTSwVSlrDFjxvzjUUcdcfgll3y1Ki1vtU/h0tbHf9xxx8dVV139rRUrVpxQ6Q2ScPPCpYSHp3QCBColIFyq1Lg1S4AAgbYLCJfaTmrBZgRGjx694LTTTp7W03NmV1XPWqr1/fzhUl/lzp7aeB/09p7Tf/75X7yzr6/vsGb2ldeWR0C4VJ5ZqIQAAQIvJCBcsj8IECBAoBUB4VIreq5tWWBDuPR3tcOWKhukDBs2equWa+sfi6uuS2/vucKllt9lQ7uAcGlo/d2dAAECgxUQLg1WyusIECBAYGsCwiX7YkgFBsKls3rOrB3lXdkY5fnCpefW9lX0u/Mazy/19J7bP8eTS0P6Hm315sKlVgVdT4AAgWIEhEvFOLsLAQIEchUQLuU62UT62vRjcYkU3aEyNw+Y1q6tfSSu2r88uZT+/IVL6c9QBwQIVENAuFSNOeuSAAECnRIQLnVK1rqDEtjw5NKnu7qiK/qjP6r6841vmBF33/3Dutvhhx8a8+dfUWmP2j7o6T2nf875FzhzaVDvpnK+SLhUzrmoigABApsLCJfsCQIECBBoRUC41Iqea1sWaIRLn5zW01PtM5cah3pveu7S2rW/r+wZVAOHevf2fsaZSy2/y4Z2AeHS0Pq7OwECBAYrIFwarJTXESBAgMDWBIRL9sWQCgyES1U+c2n4sG1fcAa1kKmqR3o3zlzy5NKQvklbvLlwqUVAlxMgQKAgAeFSQdBuQ4AAgUwFhEuZDjaVtjY8uXRmJf9NM+wPBEsDc2w8xVS9X40zl4RLKU9euJTy9NROgECVBCr5D7EqDVivBAgQ6LCAcKnDwJZ/YYH1Ty6d9emurq6u6O/vj6r8HD78j5raHvUnmCrkU9sHPT3n9s+ZI1xqaqOU7MXCpZINRDkECBB4HgHhkq1BgAABAq0ICJda0XNtywK1cOnU0z45rbfnzK4qHeY9fFhzwdIAdOMjctU59Pzs+plLwqWW32hDuIBwaQjx3ZoAAQJNCAiXmsDyUgIECBDYQkC4ZFMMqcCmTy5F9PdHdHX5yaGxD3p6PuPJpSF9h7Z+c+FS64ZWIECAQBECwqUilN2DAAEC+QoIl/KdbRKdNZ5cOqlyTy51RVelnkB6sf2e3ftZTy4l8U5+/iKFS4kPUPkECFRGQLhUmVFrlAABAh0REC51hNWigxVoPLl00rSz6mcueWLJE0ubPrnWeHLpwjv7+voOG+ye8rpyCQiXyjUP1RAgQOD5BIRL9gYBAgQItCIgXGpFz7UtC2x4cunTXf0RUfuHjZ8cBvZB48wl4VLLb7QhXEC4NIT4bk2AAIEmBIRLTWB5KQECBAhsIZB0uDR+/PgPrVixYvcVK1acZrZDKzB8+PB7tttuu+v33nvvebfccssDg61mIFzqOeuMLocteXRr80O3ej25NNi3Uilfd8opp7xs7ty5tz7zzDO7l7LAiKj9HbRy5co1ETGzrDWqiwABAkUICJeKUHYPAgQI5CuQdLi07777/vn9999/+rPPPntUviNKo7Ourq4nByodNmzYo9ttt90Ngwma6uHSqSdN6+39dFd/f3/UPhvnJ4eBfXD22bUzlzy5lMbfAltWuc8+++z/yCOPfPg3v/nNsWXtQbhU1smoiwCBogWES0WLux8BAgTyEkg6XKqNYptttrn6Na95zQWLFi26I6/RpNXNxuHSxpX/oaBp0yeXfCbOZwI3/Wxkb89nnbmU1l8Fm1Q7bty466ZOnXrWwoULf1jWNoRLZZ2MuggQKFpAuFS0uPsRIEAgL4Hkw6VrrrlmmyOPPPKbr33ta7+4aNGi7+U1nnS6eb5w6Q8FTRueXDqjy2HWmx5mzSPCk0vp/B2weaU77LDDv02cOPGy++6776YydyFcKvN01EaAQJECwqUitd2LAAEC+QkkHy7VRnLDDTe85LDDDru89szDyJEjHxk5cuSv8xtVuTt66qmn/raZCgeeaFq5cuU+p88+ZWrPWZ9y5pKvy9vi6wIbZy5dVP+2uAkTJpzazB7z2uIFuru7ly9fvnx6RHTvsMMO//Hwww9fUXwVzd1RuNScl1cTIJCvgHAp39nqjAABAkUIZBEuDUBNm1Kxd0QAABInSURBVDZtryVLluy+cuXKnYrAc48NAr/97W+bOlR92LBhS2vnMq1cufL1p59+8lRnLjlramtnbZ199nnrz1yaMGFCU3vM+7N4gVq4NHbs2MVHHXXUXbNnz15efAXN31G41LyZKwgQyFNAuJTnXHVFgACBogSyCpeKQnOfLQUG+bG4eqC09957XznwjXKNM5c+Ma3xbXHOXHLm0tbOXGo8ueR9R6ATAsKlTqhakwCBFAWESylOTc0ECBAoj4BwqTyzSLqSFzjQe4tAaeNGG2cufWJaT+8ZXYKVTYMVHhG9Z3+2f875wqWk/3IoefHCpZIPSHkECBQmIFwqjNqNCBAgkKWAcCnLsRbf1Mbh0sBH3jZ+Qun5Ktrw5JIzl8KZS1s5c6n2bXHCpeLf0dW5o3CpOrPWKQECLywgXLJDCBAgQKAVAeFSK3quXS8wfPjwezb/yNtgeDZ9cqnf16UJmDYJmHrPPs+TS4N5I3nNixYQLr1oOhcSIJCZgHAps4FqhwABAgULCJcKBne7TQXWh0s9n/JvGptjC4He3vM8uWRfdFRAuNRRXosTIJCQgH+IJTQspRIgQKCEAsKlEg6lSiVteHLpU85c6nfm0uaHuntyqUp/GwxNr8KloXF3VwIEyicgXCrfTFREgACBlASESylNK8NaNzy5NLsrfF2cr8vb7BTz3t7amUtf8m1xGb73y9KScKksk1AHAQJDLSBcGuoJuD8BAgTSFhAupT2/5KtvhEsnTuvp9eSSb4fb8smtxpNLwqXk3+glbkC4VOLhKI0AgUIFhEuFcrsZAQIEshMQLmU30rQaGgiXzuqZ3dUVtU/G9YefHAb2QePMJeFSWu/qtKoVLqU1L9USINA5AeFS52ytTIAAgSoICJeqMOUS97jpk0u+LS58W9xm3xb3OU8ulfj9m0NpwqUcpqgHAgTaISBcaoeiNQgQIFBdAeFSdWdfis43fXIpfDLMmd6bnLzV2/s5Ty6V4p2abxHCpXxnqzMCBJoTEC415+XVBAgQILCpgHDJjhhSgfVPLvXUDvT2a3OBhQvviK6urpg0aUJMnjyxckDCpcqNvPCGhUuFk7shAQIlFfAPsZIORlkECBBIREC4lMigci1zw5NLpxd65tLChd+Lrq5h6894mjhpfOwyeVL99/cveiCWLV9eP/tpjz13i+3HjdvkLKgli5fG4iWP1v984+tqv9983YGzg8aM3S72mrpH02dKHfneD8ett9weBx44M+bN+5emr9/8DKunly2LWv17Tp2SxNlWjTOX/sG3xeX6F0AJ+hIulWAISiBAoBQCwqVSjEERBAgQSFZAuJTs6PIovBEu/c20np5PdRX5obgDDjg47rnnvuju7o7Ro0fFM8/8LvbZ53Uxf/6l0dt7Xlx22ZWxbNnyOPXUE+Nzn+vZ5MNqU6fuFz/60UPxqldNjosuOi8OOujA9X8+sO6IESNi2223rQ/p2WefjZe+dIf48Y/vflEfett119fFXnvtEfPmff1FXX/EER+KM888LaZOnRIHHfTe+J//eSDuuOM7MXnyhBe1XpFz6u0938fi8nirl7YL4VJpR6MwAgQKFhAuFQzudgQIEMhMQLiU2UBTa2cgXGp8W1yRsUXEpIlTYrcpfxY3XD8/rrv+5njvkUfHEUccEpde+tWYPv2gePDBn8TEiePjvvv+a/1ZUNf+541x1Hv/KlatWhXz538jDnvPwZucEdQfm65b+/3tC++Ij3/81Ljuuqti8ZKl9dePGTsmdpk8MRbd/0D99xMnTaj/fuBjcHvsOSW2Hze2ft8/3XXverh08cUXrH/99BnT6uvWDgCfPGlCTJo8sb7O5tffe+/98da3Hhpn9cyOmQfsF1dc8a24664fxm3fvXZ93cuXLa+vO3XPKTF23NgY+P1AXY8uWbq+vlo9Rc6p8bE4Ty6l9r5OqV7hUkrTUisBAp0UEC51UtfaBAgQyF9AuJT/jEvd4YYnl2Z3FR1cTJw4JaZM+bO47vr59cBkp512jX33fV1c8x/fjBnTD4qf/OR/608v1Z5cOvnkE+pBz5/vNT3WrHkuHnroJ/Vw6T3vOXiLQ8g3Xvfa/7gh7lv0ozjr7/82rrnm+vjYx06pP8lUeyLqA7OOjHe+4/D4zVO/ja9/7ctx8slnxNq1a6Ovry9Gjx5dD4BqgdOu68Klc849M/ab9o4Y0T0ifvnYQ3HU+z4SN95wcxx66F/UA7FXv3qvLa6v9fH440/ES1+6Y3zgA0fEggXX1nt6+unF9bqPOfqE+n/bYYc/juXLV8S73/3OehC119T947nnnothw4ZF7SmsUaNGxSVzL4yD3nlgoYeuny1cKvX7N4fihEs5TFEPBAi0Q0C41A5FaxAgQKC6AsKl6s6+FJ1veHKp2DOXamcRTZq4+/onlz52/Clx2aVXxsmnnBDnnnNm/cmlV796l7j11ttjp51eFnf/4Na47j9viqOPPj4+85mz4vjjT1n35NJfbHF2UW3d3/++rx7i1H4dfvjBMe+qf6m/7vTZPfGliy6Ouf98UXxw1ntjn33fUj+L6Z8u/mLMOf9LcdrffiJuX/j9ePvbD4+rr74s3vUXb4s/3fX16z8W9/73Hxs/+MG98b8/u6dx5tPEKTFz5vT4xqVf2er1q1evive979i46aYFccAB+8Vxx51UD7l+/eTDcfdd98SBBx4WF1302Tj6mFnx+Tlfrn8k8NZbr4lLLrk0brjhlvjl4w/F8mUrYs8994vp098Ul/3rPxV6VpMnl0rxNs26COFS1uPVHAECTQgIl5rA8lICBAgQ2EJAuGRTDKnApk8u9RcaXNSCmd/97vf1J3bGj39lvPuQg+IfvvS5+qHZM6a/qx7o/Pznv4jbb/9+/TDtM888J17/+j+PmTP3i1mzPhrz5/9LvOc9797ikO0NTy5dFX935rnx04d/FvOv+kb9dbWgZu/Xz4xXvuLl8Y1LvxpT99w/ljz6o3rfxx77ibj++pvrH7kbPnx4XHnlP9fXH3hy6cp5X4sPvP+4erj0s5/dW1+vFmTNnLl//eynrV1f+xDb+973kXq4NOOAafHR4z5ZD5eefPJ/4/gT/l/Mu/LfY8GCy+rBU+0jdYceOive/4EjYvWq1fVw6fHHf1y/z8YB1+aHhHfy92fXz1zysbghfZNmfnPhUuYD1h4BAoMWEC4NmsoLCRAgQGArAsIl22JIBcaMGfPVI4885IjaR66KPMuncTbSwJNLV23xUa/p68KlEz/x0Zj2pnfUD/1eseKZ+NnP743v3Hjr+nBp62cubVj36WXL62cYfXfhHTFj+ptil1dNjr/84F/HjTfeGq973Z4xfMTwuP66q2L27N6YO/ey+hNSSx/9ZbzjHUfEFVdcUj/TaUOw87V4/7pwqfHkUsTEdeHSK16x01avrw13w5NL0+K4deFS7cmlj59walx55YJYsOBf68FT7YmpQw6ZFbNmHRGr1oVLtSeXavfZdd3TU7WAq8g5HXvsSXH11dfOX758+ceHdKO6ebYCwqVsR6sxAgSaFBAuNQnm5QQIECCwiYBwyYYYUoFJkybNesUrX/bFO79/4xCcubT7ujOXrtoiMBl4cqn2kbE3vPFt8YO7742PHPuXccnFF9QDmQ1PLm3tzKUt133Fy18TV3xzbrx55v7xyC+WxP77vTP+7/+eijvvvDFet/de8VfH/E3ccsvt8b3vXReLFj1Qf9qoFi7VznTaONj58IeOj5tv/m78+Md31Q/fHnhyqXY20taur/33I488Jm68cX68+S0zNnpy6eG46+574sC3Hha9Z38qTv7k8XH+nC/Fued8IW66eUFccnHjY3GPP/7QukPFBz6a97VCz1x60xvf3v/4478+aenSpVcO6UZ182wFhEvZjlZjBAg0KSBcahLMywkQIEBAuGQPlEtgp51etuTyyy8e9eY3T4/+/v7o6urq+M/aN6jddde9MWrUNjF16pT4zneuXn/fU075dFx22bw60ty5F9afWpo166/j5z+/N2677b/ixBNPjyeeeDJe9apJceGFn413vett6+s94ICD4557FkV394jYdts/WgfdH8uWrYhrr/1mzJjxpvp9avev9XrLLd+u//6mm26LY445sX4gd+1jerVfEyfuHLvvvlv93Kfaodpf+cqc2Hbb0fWnj1auXBnPPrsqttlmZKxd218/N+mMM87Z4vrrrpsX++9/UKxZsybGjNku+vpW1tc/8MCZ8e1v/1scXT/Q+z9jxx13qP/3Qw45KP7+70+Lt7zl0Hjyyf+Lgw9+Rz2A+/znvxzd3d3x/e/fGH/yJ7t0fD41m5tvXhjHHPPxvl/96teTy7VjVZOTgHApp2nqhQCBVgSES63ouZYAAQIEPLlkDwy5wHnnnTf261//5x9/5Svnj3jLW2ZscYZRJ870uX3hnREbPYNTO3No4D73LfqfWL7smfqfT548MSZNnhD3L3og9pw6JZYsXhqLFz8atbOMNv7z2plJtes3X3fgdbWfe07dLbYfN67+uto6tZ+7TJ60/r6/WLwklix+LGYc8KatrjNp8vj667f2uqlTd4+nly3b4vpaXwOvr11fW3+g79p9anXXrrt/0YPr6xv4/cDrxo7bbr1H7T5jx43p+NlYN9+0sBbiPTd79hmv/shHPtI35JtUAdkKCJeyHa3GCBBoUkC41CSYlxMgQIDAJgLCJRuiFAJz5swZ84UvzPnRhAk7b7PHHrt1jR+/88a5zMY5kP9e5KFHtcOpCrzf0kcfiwcf/Gn/o48uXXnOOZ95rWCpFG/PrIsQLmU9Xs0RINCEgHCpCSwvJUCAAIEtBIRLNkWpBCZMmHDU8uXLZ6xZs+aVpSpMMYUIdHd3/3LcuHHfW7JkiTOWChF3E+GSPUCAAIGGgHDJTiBAgACBVgSES63ouZYAAQIEkhYQLiU9PsUTINBGAeFSGzEtRYAAgQoKCJcqOHQtEyBAgEBDQLhkJxAgQKAhIFyyEwgQIECgFQHhUit6riVAgACBpAWES0mPT/EECLRRQLjURkxLESBAoIICwqUKDl3LBAgQINAQEC7ZCQQIEGgICJfsBAIECBBoRUC41IqeawkQIEAgaQHhUtLjUzwBAm0UEC61EdNSBAgQqKCAcKmCQ9cyAQIECDQEhEt2AgECBBoCwiU7gQABAgRaERAutaLnWgIECBBIWkC4lPT4FE+AQBsFhEttxLQUAQIEKiggXKrg0LVMgAABAg0B4ZKdQIAAgYaAcMlOIECAAIFWBIRLrei5lgABAgSSFhAuJT0+xRMg0EYB4VIbMS1FgACBCgoIlyo4dC0TIECAQENAuGQnECBAoCEgXLITCBAgQKAVAeFSK3quJUCAAIGkBYRLSY9P8QQItFFAuNRGTEsRIECgggLCpQoOXcsECBAg0BAQLtkJBAgQaAgIl+wEAgQIEGhFQLjUip5rCRAgQCBpAeFS0uNTPAECbRQQLrUR01IECBCooIBwqYJD1zIBAgQINASES3YCAQIEGgLCJTuBAAECBFoREC61oudaAgQIEEhaQLiU9PgUT4BAGwWES23EtBQBAgQqKCBcquDQtUyAAAECDQHhkp1AgACBhoBwyU4gQIAAgVYEhEut6LmWAAECBJIWEC4lPT7FEyDQRgHhUhsxLUWAAIEKCgiXKjh0LRMgQIBAQ0C4ZCcQIECgISBcshMIECBAoBUB4VIreq4lQIAAgaQFhEtJj0/xBAi0UUC41EZMSxEgQKCCAsKlCg5dywQIECDQEBAu2QkECBBoCAiX7AQCBAgQaEVAuNSKnmsJECBAIGkB4VLS41M8AQJtFBAutRHTUgQIEKiggHCpgkPXMgECBAg0BIRLdgIBAgQaAsIlO4EAAQIEWhEQLrWi51oCBAgQSFpAuJT0+BRPgEAbBYRLbcS0FAECBCooIFyq4NC1TIAAAQINAeGSnUCAAIGGgHDJTiBAgACBVgSES63ouZYAAQIEkhYQLiU9PsUTINBGAeFSGzEtRYAAgQoKCJcqOHQtEyBAgEBDQLhkJxAgQKAhIFyyEwgQIECgFQHhUit6riVAgACBpAWES0mPT/EECLRRQLjURkxLESBAoIICwqUKDl3LBAgQINAQEC7ZCQQIEGgICJfsBAIECBBoReC2YcOG7fWSl7zkwVYWcS0BAgQIEEhRYPXq1bs999xziyJiZor1q5kAAQLtEvj/inokIORDC08AAAAASUVORK5CYII= - - - Evaluation2 - - - \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/lanes.bpmn b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/lanes.bpmn deleted file mode 100644 index 2872d0ad202..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/lanes.bpmn +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - _323ED317-55EA-47A2-9AD6-0F1455E14D0F - _D411D442-8913-4004-BA99-A136F5D80BD9 - - - - - - - - processStartEvent - _374097F7-61D0-4B18-A915-FEB238C06348 - - - - - - - - - - - - _C9B1CD7E-E634-4511-BBB6-DB05AEF92D0F - _89D15FED-A187-4BD6-B4AF-8BBE837EDCB5 - - - - - - - - _89D15FED-A187-4BD6-B4AF-8BBE837EDCB5 - - - - - - - - _97A5F428-5E08-4DC2-AC38-61350BFE5514 - - - - - - - - _97A5F428-5E08-4DC2-AC38-61350BFE5514 - _C9B1CD7E-E634-4511-BBB6-DB05AEF92D0F - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _6CHygdIAEeWZuZ7CldmwKg - _6CHygdIAEeWZuZ7CldmwKg - - \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/lanes.bpmn.meta b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/lanes.bpmn.meta deleted file mode 100644 index a15ba89ee5b..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/diagrams/lanes.bpmn.meta +++ /dev/null @@ -1,20 +0,0 @@ - - - - - _6CHygdIAEeWZuZ7CldmwKg - - - org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet - - - org.kie.workbench.common.stunner.bpmn.client.BPMNShapeSet - - - data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoUAAAImCAYAAAAlofCUAAAgAElEQVR4Xu3dCXwV1d3/8XMTAgQSCCGAVwUDokFEAQUXHpGlVvt3Q6Fa0WKjPoKAsqPiIyS5adWqEEGBpwpKxYIUQaTVVkUIAvKALIqsyqrsBMgmGLLc/2vu9ZJAibnLzD3nzHzyevmKwtyzvH8z6bdn5kxcgi8EEEAAAQQQQAABxwu4HC8AAAIIIIAAAggggIAgFHISIIAAAggggAACCBAKOQcQQAABBBBAAAEEBKGQkwABBBBAAAEEEECAUMg5gAACCCCAAAIIICAIhZwECCCAAAIIIIAAAoRCzgEEEEAAAQQQQAABQ4Ddx5wHCCCAAAIIIIAAAoRCzgEEEEAAAQQQQAABVgo5BxBAAAEEEEAAAQS4fcw5gAACCCCAAAIIIGAI8Ewh5wECCCCAAAIIIIAAoZBzAAEEEEAAAQQQQEDflcIMiocAAggggAACCCBgnoCOt48zOnfuPPKGG24oNo+BlhBAAAEEEEAAAecKrFixIkHLUDhs2LD+OTk5B5xbOmaOAAIIIIAAAgiYJzBy5Eg3odA8T1pCAAEEEEAAAQS0FCAUalk2Bo0AAggggAACCJgrQCg015PWEEAAAQQQQAABLQUIhVqWjUEjgAACCCCAAALmChAKzfWkNQQQQAABBBBAQEsBQqGWZWPQCCCAAAIIIICAuQKEQnM9aQ0BBBBAAAEEENBSgFCoZdkYNAIIIIAAAgggYK4AodBcT1pDAAEEEEAAAQS0FCAUalk2Bo0AAggggAACCJgrQCg015PWEEAAAQQQQAABLQUIhVqWjUEjgAACCCCAAALmChAKzfWkNQQQQAABBBBAQEsBQqGWZWPQCCCAAAIIIICAuQKEQnM9aQ0BBBBAAAEEENBSgFCoZdkYNAIIIIAAAgggYK4AodBcT1pDAAEEEEAAAQS0FCAUalk2Bo0AAggggAACCJgrQCg015PWEEAAAQQQQAABLQUIhVqWjUEjgAACCCCAAALmChAKzfWkNQQQQAABBBBAQEsBQqGWZWPQCCCAAAIIIICAuQKEQnM9aQ0BBBBAAAEEENBSgFCoZdkYNAIIIIAAAgggYK4AodBcT1pDAAEEEEAAAQS0FCAUalk2Bo0AAggggAACCJgrQCg015PWEEAAAQQQQAABLQUIhVqWjUEjgAACCCCAAALmChAKzfWkNQQQQAABBBBAQEsBQqGWZWPQCCCAAAIIIICAuQKEQnM9aQ0BBBBAAAEEENBSgFCoZdkYNAIIIIAAAgggYK4AodBcT1pDAAEEEEAAAQS0FCAUalk2Bo0AAggggAACCJgrQCg015PWEEAAAQQQQAABLQUIhVqWjUEjgAACCCCAAALmChAKzfWkNQQQQAABBBBAQEsBQqGWZWPQCCCAAAIIIICAuQKEQnM9aQ0BBBBAAAEEENBSgFCoZdkYNAIIIIAAAgggYK4AodBcT1pDAAEEEEAAAQS0FCAUalk2Bo0AAggggAACCJgrQCg015PWEEAAAQQQQAABLQUIhVqWjUEjgAACCCCAAALmChAKzfWkNQQQQAABBBBAQEsBQqGWZWPQCCCAAAIIIICAuQKEQnM9aQ0BBBBAAAEEENBSgFCoZdkYNAIIIIAAAgggYK4AodBcT1pDAAEEEEAAAQS0FCAUalk2Bo0AAggggAACCJgrQCg015PWEEAAAQQQQAABLQUIhVqWjUEjgAACCCCAAALmChAKzfWkNQQQQAABBBBAQEsBQqGWZWPQCCCAAAIIIICAuQKEQnM9aQ0BBBBAAAEEENBSgFCoZdkYNAIIIIAAAgggYK4AodBcT1pDAAEEEEAAAQS0FCAUalk2Bo0AAggggAACCJgrQCg015PWEEAAAQQQQAABLQUIhVqWjUEjgAACCCCAAALmChAKzfWkNQQQQAABBBBAQEsBQqGWZWPQCCCAAAIIIICAuQKEQnM9aQ0BBBBAAAEEENBSgFCoZdkYNAIIIIAAAgggYK4AodBcT1pDAAEEEEAAAQS0FCAUalk2Bo0AAggggAACCJgrQCg015PWEEAAAQQQQAABLQUIhVqWjUEjgAACCCCAAALmChAKzfWkNQQQQAABBBBAQEsBQqGWZWPQCCCAAAIIIICAuQKEQnM9aQ0BBBBAAAEEENBSgFCoZdkYNAIIIIAAAgggYK4AodBcT1pDAAEEEEAAAQS0FCAUalk2Bo0AAggggAACCJgrQCg015PWEEAAAQQQQAABLQUIhVqWjUEjgAACCCCAAALmChAKzfWkNQQQQAABBBBAQEsBQqGWZWPQCCCAAAIIIICAuQKEQnM9aQ0BBBBAAAEEENBSgFCoZdkYNAIIIIAAAgggYK4AodBcT1pDAAEEEEAAAQS0FCAUalk2Bo0AAggggAACCJgrQCg015PWEAhJwLgAQ/oAB1sqMH78+AOWdkDjCCCAgMIChEKFi8PQ7C1gXHxr1q52d+/W1SVcQgivEHyX57A0d5m3Y8dOB3JycgiG9r70mB0CCFQjQCjk1EBAkoBx8dWvX9udlfWMy+sVwuUSgu/yHDye570FBScJhZKuB7pFAAH5AoRC+TVgBA4V8IXChDh3ZsYzrBQqsFKalfm8t7DwJ0KhQ69Hpo0AAkIQCjkLEJAk4F8pjGOlUJEVUv9KIaFQ0uVAtwggoIAAoVCBIjAEZwpUrhSOcXHvWH4yZKXQmdchs0YAgUoBQiFnAwKSBAIrhZlZz7h4mFD+Q5VZnhe8hawUSroa6BYBBFQQIBSqUAXG4EiB06Ewc4zxRB1fkgWysl7gmULJNaB7BBCQK0AolOtP7w4WqFwpHOPidTTyX8fDSqGDL0amjgACPgFCIScCApIEKlcKn3bxgkL524+zsozdxyXsPpZ0PdAtAgjIFyAUyq8BI3CogD8U1nJnZrFSqMJKqX+lkFDo0MuRaSOAACuFnAMIyBMIhMKMzKddxosKvcIr+C7Pwf9MIaFQ3hVBzwggIFuAlULZFaB/xwqcuVIof/et01+Lk+X5MyuFjr0amTgCCPBMIecAAhIFzlwp5Fcfy/7Vz1lZf2alUOL1QNcIICBfgJVC+TVgBA4VOL1SmGlsNOFLtgChUHYF6B8BBGQLEAplV4D+HStQuVL4FM8UKvBMpf+ZwlPsPnbsFcnEEUCAUMg5gIAkAX8ojHVnZo5xsclE/iYbT9aL3D6WdC3QLQIIqCFAKFSjDozCgQKBUJiRyUqhCruu/bePWSl04KXIlBFA4GcBQiGnAgKSBCpXCp9mpVCB1/H4VwoJhZIuB7pFAAEFBAiFChSBIThT4MyVQnYfy999TCh05pXIrBFAICBAKORcQECSQOVK4VMu2YGI/oVgpVDShUC3CCCgjAChUJlSMBCnCZxeKcx40uVyuYTX6xV8l+fgf6awlN3HTrsQmS8CCJwWIBRyMiAgScAfCmPcmZk8U6jC7mtP1ks8UyjpWqBbBBBQQ4BQqEYdGIUDBQKhMCPjKWPzLQ8VSr6H7b99zEqhAy9FpowAAj8LEAo5FRCQJFC5Umg8Uyj/PX0qvBZGpoN/pZBQKOlyoFsEEFBAgFCoQBGcPoSSkhLXF198UW/NmjXxhkXnzp1PXH/99Sfr1KljrB3Z9qtypfBJVgoVWCklFNr2UmNiCCAQpAChMEgoDjNXIDs7u+m6dV8mbdy0qd73e36IbXdF24orO1wWY/Ty9frNFZs2bolJTb2orO3lbU9e1bHT8bFjxx4xdwTyW6tcKXyS3cdCSL+DTiiUf00wAgQQkCtAKJTr77jeF332aWLf+/q2fuzxP4gLW7hjrryyrbikTStxrluXW7d8JzZu2Cp++GF/xbSpfxOzZs/+rmePnsV2QatcKRztEi6XEF6v4Ls8B/8zhWXsPrbLBcY8EEAgZAFCYchkfCBcgYGDHm29Zu2XDf767quuJk0bnzMIVvdM2YEDh0R636He6667Pn/yq/+7M9wxqPQ5fyh0uY1fc0cglB+IPZ6XeaZQpQuEsSCAQNQFCIVRJ3dehzt37ozr3qPb5Q/3/13soKHpEQG8mjNdvPPW/PIli5duSk1NLY2oMckfPh0KM3imUPq9Y5fx8mpjowkrhZIvC7pHAAGJAoRCifhO6NoIhL9/8L7LXpmSGXdRqwtNee3Kzh17xMjB2aWz/vb3LToHw8qVwiddQvLrWOhfCI+HUOiEn0nMEQEEqhcgFHJ2WCrQ4qILO/x94dTY1FYXmnqH1AiG/X47rHznjt1fWToBCxuvXCk0ninkPYWyg6kny7h9zEqhhac8TSOAgOIChELFC6Tz8B4b9EjrpucnNhw4tJ8pK4RnB6fXcmaI/LxTxye/+hctnzGsXCkczUqhAiul/mcKCYU6/8xh7AggEJkAoTAyPz5djcCizz5OfGrM6Ev+sWi6y8rf6Xtbj4e8r+S8+m33btbvSv7oo48S+vfvn9qvX7+89PT0Y2lpaaciOQEqVwpHsftYgd3X/mcKy9l9HMlJzWcRQEBrAUKh1uVTd/BNmjTu+OkXM2NSmiZbemf0wP4j4vaej1QcPHB4vdUaxsVy6NChWklJSRULFixIbtKkSek999xz9JFHHjnWrFmz8lD794dC4c7INJ4plL/71umvw/F4xrNSGOpJzPEIIGArAUKhrcqpxmQ8Hk+TH8sOXPj4iN/HROOVxK++/NeKBnWb73322WctfcG1cbFUVFSInJycA4b0okWL6s+cOTP5gw8+SG7Xrt2Je++999iAAQOOBfubWAKhcFzGaGOdTPYjdY7vP8vzsreIlUI1fogwCgQQkCJAKJTCbu9Oe919+6W/uvWqxLvuuTkqL2Se//dPxOeffF00f97Cb62UPTsUVu1r/vz5DWbNmpW8cOHC5J49e+bfd999x9LT0/N/aTyVK4U8U6hCIvU/U8jtYyuvIdpGAAG1BQiFatdHy9G1vqRlh7/MzIq9OO0iS28dB/YmbN2ySwx55I9l27Zs/9pKsF8KhVX7nTFjRtK7776bvHjx4qQ77rjj2AMPPHCsd+/ehWePrXKlcJTrXL/RpboXefPn3pBefB6sFyuFVl49tI0AAjoIEAp1qJJGYywpKXElNki8atuBfwuXy3hUzhuV75c0/bU4ceLk2ri4OMu0gg2FgQEYFq+//nrynDlzkjdu3FivV69ex/r163fspptu+tE4pnKlcBS7j5XYfWw8U8hKoWUXEA0jgIDyAoRC5Uuk1wCXLFlSf/iowWnvfzrJFc29E3f/+omKiROmbuvevfuJESNGnO9yuYyYYerX8uXLE7p06VIceKYwlMYPHToUO3369OS5c+c2Pnz4cNzdd999rKCgIKZly6ZNxmWMZKVQGLnYmhXAYNv1rxRW+HYfGz8YQ6nvuY7t2LHjyc6dO5+IdJd6pOPg8wgggECwAoTCYKU4LiiBl156KWX9pqUXZY8fEpVbx4EFpmdHThIdL++2Z/To0Xkul+vqoAYb+kHeYcOGRfzKkm+//bb24MGDmy9ZsqThmGeGiMzM0Za+tieaK7bRWhm2op9sz4TTK4VmnkM33XRT/uzZs3enpKSEvEM99FOUTyCAAALhCxAKw7fjk+cQMELhuk1LLsp+eUhU99OOHfWauOry7kqHwmXLltWbOnVqk9mzZ6f07ds3z+v1ei+5xJ0yLsN4ppDdx7LvIGd5xp9eKTQzFBqXSWJiYvnHH3+87frrrz/JDw4EEEBAVQFCoaqV0XRcubm59YaOeKzNe5+MN3JO1L76/HpExauvvL6tW7duvtvHVnS8YsUK4/ZxUai3j19++eWUGTNmNDHGlJ6efmTUqFF5xr8bF1+9+l53ZsYo371ugqHcYJzte0+h//axGefQnj17an/yySdJxcXFsUa927Rpc3LLli2brTg3aRMBBBAwQ4BQaIYibZwWCGw02bh3XlSfEWt3fm+lNpqcvSo4cODAI127dj1R9VTxbzTxunmmUO6zhIFnDquuFJp1Sefl5cXecMMNadu2bYs32szKyvph3Lhxh81qn3YQQAABMwUIhWZq0pZP4JJLU9vnTB9Z65I2LaKy+/i7rd+Lkf1fKft2607pr6SpblXwXKfGmSuFagSjYDdl2PE4/zOF/pVCMy/lmTNnJj344IMXG21ec801xatWrdpmZvu0hQACCJglQCg0S5J2Tgv0uvvWS//r5ksT7+h9Y1TuiX4wJ1esyt1Z9P68f0p5eXUwq4LVhUL/SuEIdh8rsfvYeKbQa3ooNFYLmzRp0sE4B4xnCwsLC7/ixwUCCCCgogChUMWqaD6m7Ozspsd+2nZB/yF3xURjRekvOe9XnNfwir1jxoyJ6q+5C2VVsPqVwoqfnylkpVD2C7yzPTmWrBQata+6ccXr9a7V/BJn+AggYFMBQqFNCyt7Wk2bpXSc83F2TFN3sqW7Bw7syxMP3ukp37/vkOWrL8bFsm/fvriYmBhXYAfxuZ4VDNbef/u4wp2RMTKqm3KCHZ/TjvN4JliyUkgodNqZxHwR0FeAUKhv7ZQe+eLFnyQMGzX40lkfeSwNPL+75X+8UydP33bjDT18vyXEyq+PPvooYdCgQRc9/vjjhwI7iCPpLxAKMzNGsvtYgd3X/mcKzb99TCiM5CrhswggEE0BQmE0tR3W14BBf2hdL7mk4UODb7fkd9W+PnGBqDjR8PjkSdN26kh7eqVw3AiXMN5UGM1fAUN//+HtyZrgLSoiFOp4LTFmBBAwR4BQaI4jrVQjcFHLCzq89s7Q2BYtzzM19+z4dr8Y9d9TynZ8972lO46tLOyZK4U8U6jGM4WEQivPedpGAAG1BQiFatdH+9Ht3r077p6+d1727Ev3x13UqpkpNwl3frdPPP/0u6Xvz/3X5gsvvLBMV6QzVwr5lSZC8hu8PVk5rBTqejExbgQQMEWAUGgKI438koARDLv3/K/L77zv+tiHBv8/Yytm2LdKp0/8p/jX/DVlS5d8sUnnQGh4+UNh+c8bTSQnItmJTIH+PZ5X2GjCjzIEEHC0AKHQ0eWP7uQfG/yHVstWfJ40ftpAV1N3o5B2JR/Yf1SM/u//9Xbv/qv8KZOma/kM4dnap0Oh75lCVgpl50L/SqEw/T2FRt15JU10f9bQGwIIhCdAKAzPjU+FKbA4d1FC3/vuu+S3D3YVzS5Iikm7vLlo3eaCcyai7Vv3i20bvxcH9xVUvD9rhffdOXO+6xaFXcZhTi3kj1WuFI6wdId2yANz6Ac8nhxvUSGh0KHlZ9oIIPDzHSwd/wcpY9iwYf3N/nVUnBHRE3juueearFqzrNHmTZvjd+3cV6vN5S0q0tpdEGOMYOs3+yq2bf4+pmWrC8ouv/zyk9d27nrc6hdTR2/mlT1VrhQOZ/dxBI8UmLVrm5VCGVcBfSKAgEoCrBSqVA2HjqW0tFSsWLGi3pdfflnPILjmmmtOdOnS5URcXJytRXyhsF65OyNzhMusYEM73rCfWfVkG88UslJo64uOySGAwC8KEAo5QRCQJBBYKRw3brhLgYUyx+dJT9YrPFMo6VqgWwQQUEOAUKhGHRiFAwUqVwqHu2RvsqB/IVgpdOBFyJQRQOAMAUIhJwQCkgT8K4VlblYKw77jG8nbjf5jZdS/Uuhi97Gk64FuEUBAvgChUH4NGIFDBfwrhWXujExWClVYqfSvFBIKHXo5Mm0EEGD3MecAAvIEKlcKh7mMhwq9Xq/xPju+S3JgpVDetUDPCCCghgArhWrUgVE4UODMlcLwd82aeg/V69xxeLInslLowOuQKSOAQKUAoZCzAQFJAoFQOC5jmLH5WIU7qI7+xSoez0SeKZR0LdAtAgioIUAoVKMOjMKBApUrhcNcDl6gU2ahM5uVQgdehUwZAQSqChAKOR8QkCRQuVI41GX88mOv8Aq+y3PweIzdxzHsPpZ0PdAtAgjIFyAUyq8BI3CogD8UlrozMlkpVGGl1L9SSCh06OXItBFAgN3HnAMIyBMIhMJxGawUqrBC6n+mkFAo74qgZwQQkC3ASqHsCtC/YwXOXCnkdTSyX8eTnT2JlULHXo1MHAEEDAFCIecBApIEqq4UShoC3VYRyPZMYqWQMwIBBBwtQCh0dPmZvEyB0yuFGUNdXiEc/ToYFeZPKJR5NdA3AgioIEAoVKEKjMGRApUrhUNcREL5b2rM9j1TGMvuY0dejUwaAQS4fcw5gIBEAX8oPOXOyBjmUul1NJ8vXe3LqGfHtIYNEkX7Dpf94mtzcpf+n4hxuUTXG68553FffbVJpKY2Fw2TEpV7/U6251VuH0u8HugaAQTkC7BSKL8GjMChAoFQOC5DrZXC2nGXiJYtm4ujR4+L0tJS0bBhA1+F6tSpLb7bnvuLv3vlzjsfFUsWrxRFxZvOOG7nzh/Efb97QuzZs0/8fe5rolu365T7HS7+28esFDr0cmTaCCDARhPOAQTkCVSuFBrPFKrz4urOnXqJL9d8IIYO8Yj58/8t/va3V8SV7duIX9/UT0yb9oIoLCwWzVu4RcvU5r4XbgdWFttfeZlY+X/rxO/ufUIUFG4QX3+1RRQUFomLWlwgcnKmi6KiH8XChYvEvHlTxY3dzr2SKNPBv1JIKJR3RdAzAgjIFmClUHYF6N+xAmeuFKrHMHRIlpg//2Pxzt9yRLdu14rPFq0Qv/3tYNGwYaIoLy8Xny+bI9L/MErs2PG98Hq94rbbe4revW85HQpbpnYVZeXlviB5yy03ig8/XOI7/r15U3ztqfZFKFStIowHAQSiLUAojLY4/SHws4BuoXDXzh/E+vWbRO8+vxHJjTqKadNfEI8PHid69fq1GPDY/eLAgcPCeNegsVI4enR/8eabc8W69f8QSUn+28+EQn/hvV7vWi4CBBBAQEUBQqGKVWFMjhA4HQrHPeESLpeRFoRK30+vFL4zQXTrfp2Y+MpbYsqUmWLXrr0iPr6OmD79z2LLlu2+8FdaWibGjBkoLm59kejTe6CIj68rWrVqIVZ/ueD0vD7852KRnj5avPfeZF97qs3X/0xhLXYfO+LqY5IIIHAuAUIh5wUCkgT8obDEbfyaOyFUeFPfmfuN/c8UBm4fXyNu+K97RXJyklj4jzdE4+SO4i+vPyc+/vdS8ca0F8RdvfqLQ4eOiozMJ8S99zwhluTOErfd+oh44Pe9xPjx/+PbVPLhh7lVbh9fo9ybGbM9r/FMoaRrgW4RQEANAUKhGnVgFA4UOB0Kxw0xfvWvUrlwwQefiKeefFEcOpQnOnVq5wt+xsrhmjXf+J4n/OmnU6Jt29Zi7dqNvhXBwsIiceut3X3Hf/bZSvHc86PEgvc/FRu+2SrGPP2YKK+oEO/N/ZfYunWnaNfuEvHkk/1F796/Uer1jP5nClkpdOClyJQRQOBnAUIhpwICkgSMi2/NmmXubt2vU26lMD+/QOTnF52WOe+8FFG3bl2xe/de3zOC+fmFvr8z/vzgwTxRt25tcd55TX1/b3wZ/20kvp9+KhF169bxJV4jSAa+kpISRVJSQ6WS8NLc1d6rrurC7WNJ1wPdIoCAfAFCofwaMAIHC4wYMeJ8B09fualPmDBhvxWDcrlcVwfaZaOJFcK0iQACZggQCs1QpA0EEEDgFwQIhZweCCCggwChUIcqMUYEENBagFCodfkYPAKOESAUOqbUTBQBBGQJEAplydMvAgiEIkAoDEWLYxFAAIEwBAiFYaDxEQQQiLoAoTDq5HSIAAJOEyAUOq3izBcBPQUIhXrWjVEjgIBGAoRCjYrFUBFwsACh0MHFZ+oIIBAdAUJhdJzpBQEEIhMgFEbmx6cRQACBGgUIhTUScQACCCggQChUoAgMAQEE7C1AKLR3fZkdAnYRIBTapZLMAwEElBUgFCpbGgaGAAJVBAiFnA4IIICAxQKEQouBaR4BBEwRIBSawkgjCCCAQPUChELODgQQ0EGAUKhDlRgjAghoLUAo1Lp8DB4BxwgQCh1TaiaKAAKyBAiFsuTpFwEEQhEgFIaixbEIIIBAGAKEwjDQ+AgCCERdgFAYdXI6RAABpwkQCp1WceaLgJ4ChEI968aoEUBAIwFCoUbFYqgIOFiAUOjg4jN1BBCIjgChMDrO9IIAApEJEAoj8+PTCCCAQI0ChMIaiTgAAQQUECAUKlAEhoAAAvYWIBTau77MDgG7CBAK7VJJ5oEAAsoKEAqVLQ0DQwCBKgKEQk4HBBBAwGIBQqHFwDSPAAKmCBAKTWGkEQQQQKB6AUIhZwcCCOggQCjUoUqMEQEEtBYgFGpdPgaPgGMECIWOKTUTRQABWQKEQlny9IsAAqEIEApD0eJYBBBAIAwBQmEYaHwEAQSiLkAojDo5HSKAgNMECIVOqzjzRUBPAUKhnnVj1AggoJEAoVCjYjFUBBwsQCh0cPGZOgIIREeAUBgdZ3pBAIHIBAiFkfnxaQQQQKBGAUJhjUQcgAACCggQChUoAkNAAAF7CxAK7V1fZoeAXQQIhXapJPNAAAFlBQiFypaGgSGAQBUBQiGnAwIIIGCxAKHQYmCaRwABUwQIhaYw0ggCCCBQvQChkLMDAQR0ECAU6lAlxogAAloLEAq1Lh+DR8AxAoRCx5SaiSKAgCwBQqEsefpFAIFQBAiFoWhxLAIIIBCGAKEwDDQ+ggACURcgFEadnA4RQMBpAoRCp1Wc+SKgpwChUM+6MWoEENBIgFCoUbEYKgIOFiAUOrj4TB0BBKIjQCiMjjO9IIBAZAKEwsj8+DQCCCBQowChsEYiDkAAAQUECIUKFIEhIICAvQUIhfauL7NDwC4ChEK7VJJ5IICAsgKEQmVLw8AQQKCKAKGQ0wEBBBCwWIBQaDEwzSOAgCkChEJTGGkEAQQQqF6AUMjZgQACOggQCnWoEmNEAAGtBQiFWpePwSPgGAFCoWNKzUQRQECWAKFQljz9IoBAKAKEwlC0OBYBBBAIQ4BQGAYaH0EAgagLEAqjTk6HCCDgNAFCodMqznwR0FOAUKhn3Rg1AghoJEAo1KhYDCd+WhwAACAASURBVBUBBwsQCh1cfKaOAALRESAURseZXhBAIDIBQmFkfnwaAQQQqFGAUFgjEQcggIACAoRCBYrAEBBAwN4ChEJ715fZIWAXAUKhXSrJPBBAQFkBQqGypWFgCCBQRYBQyOmAAAIIWCxAKLQYmOYRQMAUAUKhKYw0ggACCFQvQCjk7EAAAR0ECIU6VIkxIoCA1gKEQq3Lx+ARcIwAodAxpWaiCCAgS4BQKEuefhFAIBQBQmEoWhyLAAIIhCFAKAwDjY8ggEDUBQiFUSenQwQQcJoAodBpFWe+COgpQCjUs26MGgEENBIgFGpULIaKgIMFCIUOLj5TRwCB6AgQCqPjTC8IIBCZAKEwMj8+jQACCNQoQCiskYgDEEBAAQFCoQJFYAgIIGBvAUKhvevL7BCwiwCh0C6VZB4IIKCsAKFQ2dIwMAQQqCJAKOR0QAABBCwWIBRaDEzzCCBgigCh0BRGGkEAAQSqFyAUcnYggIAOAoRCHarEGBFAQGsBQqHW5WPwCDhGgFDomFIzUQQQkCVAKJQlT78IIBCKAKEwFC2ORQABBMIQIBSGgcZHEEAg6gKEwqiT0yECCDhNgFDotIozXwT0FCAU6lk3Ro0AAhoJEAo1KhZDRcDBAoRCBxefqSOAQHQECIXRcaYXBBCITIBQGJkfn0YAAQRqFCAU1kjEAQggoIAAoVCBIjAEBBCwtwCh0N71ZXYI2EWAUGiXSjIPBBCwXGDlypXxx48fjw10dOuttxYH02koofDDDz9MvO2224qCaZdjEEAAATMFCIVmatIWAgjYWmDs2LHNpk6dep7X6xU333xz/uzZs/cEM+FgQuG7777bcPDgwal169at2Ldv3zfBtMsxCCCAgJkChEIzNWkLAQRsL9CpU6e0iooKsW7dum1nTzawknjxxRefaty4cfnq1avjGzVqVN6lS5e2gWO9Xu9a49+NFcHWrVuXpKWlnTL+u2fPnq0PHz4cV1ZW5tq6detm20MyQQQQUE6AUKhcSRgQAgioLFBdKFywYEHi/fff3zohIaG8oqLC9c4772x/+OGHWxUUFNQ6ceJETGBOR44c+apTp06XFRcXx5SWlsYMGDDg4IsvvnjQ+Pvbb7+91fbt2+sSClU+AxgbAvYVIBTat7bMDAEELBCoLhRu2bKl9qpVq+qlp6fn169fv+OUKVN2vf322ynFxcWxq1evTggMZdCgQQfnzp3b+PDhwxt69+6dumnTpnrbtm3zrQwSCi0oGE0igEDQAoTCoKk4EAEEEBDi7FCYl5cXa/wzZ86cpGnTpjXbu3dv7Tp16ngnT568c9asWf8RCu+4445jK1euTMzLy4szPN1u96n9+/f7niEkFHKGIYCATAFCoUx9+kYAAe0Ezg6FgwYNusAIgnv27KnTqFGjstzc3O0JCQkdJ06cuOtcofCxxx47OG/evMabN2/elJKSUl4VgFCo3enAgBGwlQCh0FblZDIIIGClwM+7j5udOnUqJikpqczoKz8/v5axE/nIkSO1NmzYUN94nrCkpMTVokWLn06ePBlrHGtsIAmMa8WKFZv69+/f8sCBA3F169b1pqWlnVy8ePH2Pn36pC5evLihy+USV1555Y+vvvrqD1dccUWJlfOhbQQQQKCqgLahsHPnziO6du0a1DvCKDkCCCBghoAR5IzAd3ZbSUlJ5cY/u3fvrm18z8/Pjy0tLXXFxcV5jWPnz5+fEvjMwIEDD8THx3uNY40/S01N9e0+Dvx34LhmzZqVGseZMW7aQAABBIIRWL58eeJ//IAL5oMKHJOpwBgYAgIIIBCMQEaVg7KC+QDHIIAAAjIEdA2FMqzoEwEEEAhHoOqKHz9zwxHkMwggEBUBfkBFhZlOEEDAwQKEQgcXn6kjoJMAoVCnajFWBBDQUYBQqGPVGDMCDhQgFDqw6EwZAQSiKkAojCo3nSGAQLgChMJw5fgcAgggEJwAoTA4J45CAAHJAoRCyQWgewQQsL0AodD2JWaCCNhDgFBojzoyCwQQUFeAUKhubRgZAghUESAUcjoggAAC1goQCq31pXUEEDBJgFBoEiTNIIAAAtUIEAo5NRBAQAsBQqEWZWKQCCCgsQChUOPiMXQEnCRAKHRStZkrAgjIECAUylCnTwQQCFmAUBgyGR9AAAEEQhIgFIbExcEIICBLgFAoS55+EUDAKQKEQqdUmnkioLkAoVDzAjJ8BBBQXoBQqHyJGCACCBgChELOAwQQQMBaAUKhtb60jgACJgkQCk2CpBkEEECgGgFCIacGAghoIUAo1KJMDBIBBDQWIBRqXDyGjoCTBAiFTqo2c0UAARkChEIZ6vSJAAIhCxAKQybjAwgggEBIAoTCkLg4GAEEZAkQCmXJ0y8CCDhFgFDolEozTwQ0FyAUal5Aho8AAsoLEAqVLxEDRAABQ4BQyHmAAAIIWCtAKLTWl9YRQMAkAUKhSZA0gwACCFQjQCjk1EAAAS0ECIValIlBIoCAxgKEQo2Lx9ARcJIAodBJ1WauCCAgQ4BQKEOdPhFAIGQBQmHIZHwAAQQQCEmAUBgSFwcjgIAsAUKhLHn6RQABpwgQCp1SaeaJgOYChELNC8jwEUBAeQFCofIlYoAIIGAIEAo5DxBAAAFrBQiF1vrSOgIImCRAKDQJkmYQQACBagQIhZwaCCCghQChUIsyMUgEENBYgFCocfEYOgJOEiAUOqnazBUBBGQIEAplqNMnAgiELEAoDJmMDyCAAAIhCRAKQ+LiYAQQkCWgayjMkAVGvwgggECIAplVjq/67yE2w+EIIICAtQI6hsKMzp07j7zhhhuKraWhdQQQQCBygR9//NEdaKV+/foHIm+RFhBAAAHzBVasWJGgZSgcNmxY/5ycHH64mn9O0CICCJgssHbt2qsDTV599dVrTW6e5hBAAAFTBEaOHOkmFJpCSSMIIIDAuQUIhZwZCCCggwChUIcqMUYEENBagFCodfkYPAKOESAUOqbUTBQBBGQJEAplydMvAgiEIkAoDEWLYxFAAIEwBAiFYaDxEQQQiLoAoTDq5HSIAAJOEyAUOq3izBcBPQUIhXrWjVEjgIBGAoRCjYrFUBFwsACh0MHFZ+oIIBAdAUJhdJzpBQEEIhMgFEbmx6cRQACBGgUIhTUScQACCCggQChUoAgMAQEE7C1AKLR3fZkdAnYRIBTapZLMAwEElBUgFCpbGgaGAAJVBAiFnA4IIICAxQKEQouBaR4BBEwRIBSawkgjCCCAQPUChELODgQQ0EGAUKhDlRgjAghoLUAo1Lp8DB4BxwgQCh1TaiaKAAKyBAiFsuTpFwEEQhEgFIaixbEIIIBAGAKEwjDQ+AgCCERdgFAYdXI6RAABpwkQCp1WceaLgJ4ChEI968aoEUBAIwFCoUbFYqgIOFiAUOjg4jN1BBCIjgChMDrO9IIAApEJEAoj8+PTCCCAQI0ChMIaiTgAAQQUECAUKlAEhoAAAvYWIBTau77MDgG7CBAK7VJJ5oEAAsoKEAqVLQ0DQwCBKgKEQk4HBBBAwGIBQqHFwDSPAAKmCBAKTWGkEQQQQKB6AUIhZwcCCOggQCjUoUqMEQEEtBYgFGpdPgaPgGMECIWOKTUTRQABWQKEQlny9IsAAqEIEApD0eJYBBBAIAwBQmEYaHwEAQSiLkAojDo5HSKAgNMECIVOqzjzRUBPAUKhnnVj1AggoJEAoVCjYjFUBBwsQCh0cPGZOgIIREeAUBgdZ3pBAIHIBAiFkfnxaQQQQKBGAUJhjUQcgAACCggQChUoAkNAAAF7CxAK7V1fZoeAXQQIhXapJPNAAAFlBQiFypaGgSGAQBUBQiGnAwIIIGCxAKHQYmCaRwABUwQIhaYw0ggCCCBQvQChkLMDAQR0ECAU6lAlxogAAloLEAq1Lh+DR8AxAoRCx5SaiSKAgCwBQqEsefpFAIFQBAiFoWhxLAIIIBCGAKEwDDQ+ggACURcgFEadnA4RQMBpAoRCp1Wc+SKgpwChUM+6MWoEENBIgFCoUbEYKgIOFiAUOrj4TB0BBKIjQCiMjjO9IIBAZAKEwsj8+DQCCCBQowChsEYiDkAAAQUECIUKFIEhIICAvQUIhfauL7NDwC4ChEK7VJJ5IICAsgKEQmVLw8AQQKCKAKGQ0wEBBBCwWIBQaDEwzSOAgCkChEJTGGkEAQQQqF6AUMjZgQACOggQCnWoEmNEAAGtBQiFWpePwSPgGAFCoWNKzUQRQECWAKFQljz9IoBAKAKEwlC0OBYBBBAIQ4BQGAYaH0EAgagLEAqjTk6HCCDgNAFCodMqznwR0FOAUKhn3Rg1AghoJEAo1KhYDBUBBwsQCh1cfKaOAALRESAURseZXhBAIDIBQmFkfnwaAQQQqFGAUFgjEQcggIACAoRCBYrAEBBAwN4ChEJ715fZIWAXAUKhXSrJPBBAQFkBQqGypWFgCCBQRYBQyOmAAAIIWCxAKLQYmOYRQMAUAUKhKYw0ggACCFQvQCjk7EAAAR0ECIU6VIkxIoCA1gKEQq3Lx+ARcIwAodAxpWaiCCAgS4BQKEuefhFAIBQBQmEoWhyLAAIIhCFAKAwDjY8ggEDUBQiFUSenQwQQcJoAodBpFWe+COgpQCjUs26MGgEENBIgFGpULIaKgIMFCIUOLj5TRwCB6AgQCqPjTC8IIBCZAKEwMj8+jQACCNQoQCiskYgDEEBAAQFCoQJFYAgIIGBvAUKhvevL7BCwiwCh0C6VZB4IIKCsAKFQ2dIwMAQQqCJAKOR0QAABBCwWIBRaDEzzCCBgigCh0BRGGkEAAQSqFyAUcnYggIAOAoRCHarEGBFAQGsBQqHW5WPwCDhGgFDomFIzUQQQkCVAKJQlT78IIBCKAKEwFC2ORQABBMIQIBSGgcZHEEAg6gKEwqiT0yECCDhNgFDotIozXwT0FCAU6lk3Ro0AAhoJEAo1KhZDRcDBAoRCBxefqSOAQHQECIXRcaYXBBCITIBQGJkfn0YAAQRqFCAU1kjEAQggoIAAoVCBIjAEBBCwtwCh0N71ZXYI2EWAUGiXSjIPBBBQVoBQqGxpGBgCCFQRIBRyOiCAAAIWCxAKLQameQQQMEWAUGgKI40ggAAC1QsQCjk7EEBABwFCoQ5VYowIIKC1AKFQ6/IxeAQcI0AodEypmSgCCMgSIBTKkqdfBBAIRYBQGIoWxyKAAAJhCBAKw0DjIwggEHUBQmHUyekQAQScJkAodFrFmS8CegoQCvWsG6NGAAGNBKwMhcYPcY0obD/U8ePHH7D9JJmgbQUIhbYtLRNDAAFVBKwKhcYP8LVrV7u7devqcrmE8HqF4Ls8h9zcZd6OHTsdyMnJIRiqcvExjpAECIUhcXEwAgggELqAlaGwfv04d2bW/7hIhPITcZbnBW9hwUlCYeiXCJ9QRIBQqEghGAYCCNhXwMpQmJBQ252RMcZlLBV6vV7Bd3kOmZnPeQsLfyIU2vdStv3MCIW2LzETRAAB2QJWhkL/SuEzLuEVQriE4Ls8hyzP897CAkKh7OuN/sMXIBSGb8cnEUAAgaAELA2FCXHuzIxnXARC+YE4K/N5VgqDuiI4SFUBQqGqlWFcCCBgGwFLQ+HplUL5z9Q5fZeL/5lCVgptc+E6cCKEQgcWnSkjgEB0BSwNhb6VwjGsFCpw6zwr8wVWCqN7adGbyQKEQpNBaQ4BBBA4W8DSUFi/ljsz8xnjhTTyHqbj3rXv3nVW1p8JhVz+WgsQCrUuH4NHAAEdBCwNhb6VwqddTr91q8L8/c8UlrD7WIeLkjGeU4BQyImBAAIIWCxgaSj0rRSOMW6e8iVZICvLuH1MKJRcBrqPQIBQGAEeH0UAAQSCEbA0FCbU4plCRe6c+58pJBQGc01wjJoChEI168KoEEDARgKWhsKfVwq9wiuM3SZ8l+fg8T1TSCi00aXruKkQCh1XciaMAALRFrA0FPpWCnmmUI1nClkpjPa1RX/mChAKzfWkNQQQQOA/BCwNhfVjfc8UskIob4UwsELryXqRlUKuf60FCIVal4/BI4CADgLWhkJjo8lTLn7HnfwXFfo3mpxi97EOFyVjPKcAoZATAwEEELBYwNpQaKwUPu1SZK+Fo9+W6H+mkFBo8eVE8xYKEAotxKVpBBBAwBCwOhRmZD7tkr9Oxuuz/S+vJhRy1esrQCjUt3aMHAEENBGwOhT6VwrlP1Pn9N3P/mcKCYWaXJYM8xwChEJOCwQQQMBiAatDYUbmUy6nBzIV5s9KocUXEs1bLkAotJyYDhBAwOkCVodCY6MJzxTK32rDSqHTr3T9508o1L+GzAABBBQXsDoUZmQ+yUqhAi/u9q8UlrL7WPHrkeFVL0Ao5OxAAAEELBawNhTGuI3bx47e9qvILhuPx3imkFBo8eVE8xYKEAotxKVpBBBAwBCIRihUJBcJJ48jy7fRhFDIVa+vAKFQ39oxcgQQ0EQgGqFQeL1ChV/15uRxeDwvEQo1uSYZ5rkFCIWcGQgggIDFAtaHQp4pVGP3MSuFFl9KNG+xAKHQYmCaRwABBKIRCnmmUEjffmznlcKZM2cm5ebmJm7cuDG+sLCw1tatW+ONK7tNmzYnGzRoUNauXbuTPXr0KPr973+fzxWvrwChUN/aMXIEENBEIBqh0MnP8qnyOp6sLHvdPs7Ly4t9/vnnm77xxhvNioqKYoO53BITE8sfffTRQ2PGjDmckpJSHsxnOEYdAUKhOrVgJAggYFMBa0Ohy228koaVQlVWCsts8UqaSZMmNX722WebB8Jg+0tbi7t63Ci6X91BpJ7vFqnnn+cD371/v9i9/5DIXbtOLFiyTHz97XbfVWyEw8mTJ+/u168fK4ca/VwjFGpULIaKAAJ6ClgeCjOeNB6p45cPS14y9PhWCvUPhQ8//HDzt956q6lxtXW7uoPIfDRddO/UIajzK3fdVyLzLzPE0nVf+S7Whx9++PD06dN/0PPKdd6oCYXOqzkzRgCBKAtYHgp9K4XsPpa9+9rjeVn7UNinT5/U+fPnNzYukbfGjhbpt90S1tUy48OPxUPZL/k+26dPn6Pvvffe7rAa4kNRFSAURpWbzhBAwIkClofCjNEu2YGI/l1C95XCwAphw4T6Ive1F0WHSy6O6HLNXbdB3DUmSxQU/ygeeuihw2+++SYrhhGJWv9hQqH1xvSAAAIOF7A8FGaO5plCybeOjWc6dV4pNJ4hHDp0aKpxqa6fPkl0aN3KlN3cueu+ET2GjfH9BHj77bd38Iyh2j8MCYVq14fRIYCADQSqhsK4uLhTjRs3PpKSknKsTp06pyKZnvEDvH59lzvDt1LIM4WyN9t4sqy/ffzRRx8l9O/fP7Vfv3556enpx9LS0iI6h4zzz9hl3KpVqyuMTSVvPTVEpN/S09QXoc/412fioRcn+Taf7Ny58xt2JUdy1Vv7WUKhtb60jgACCJzxa+6Sk5OPxMbGlufn5yfXqlWrNDk5+agREGvVqhXy6zuMH+D16gt3ZuaTLq/XK1wu49FCvstyyPaMt/yZQqPmhw4dqpWUlFSxYMGC5CZNmpTec889Rx955JFjzZo1C/kcMi7PESNGnJ+Tk+Pu1v5ykftylqmBMPCsa/cR48TSDZvE8OHDD0yYMGE/PxbUFCAUqlkXRoUAAjYSqLpS2LRp0wPNmzf3/Y9iUVFR/aNHjyYbATE+Pv5Eo0aNjjVp0uSYy+UybobW+OVfKRSsFCpw69hYqfWvFJZb+koao+YVFRUiJyfngHGCLFq0qP7MmTOTP/jgg+R27dqduPfee48NGDDAWIUO6hwy2khMTOxQXFwcu+TFcaJ7+8uD2mUc6sp07oZNoseTHt9qYWFhoX9rMl/KCRAKlSsJA0IAAbsJVBcKq84zPz+/gREQCwoKkhs0aJBvBMTGjRv/4jveTq8UZox2eYVXqPCr3pw8Dv9KYXRDYdVzaP78+Q1mzZqVvHDhwuSePXvm33fffcfS09N/8RwyflPJgw8+eHH7li3EV689b+ml1+HxMeLrXd/zbKGlypE1TiiMzI9PI4AAAjUKBBMKqzZy9OjRpOPHjycXFhYmNWzY0AiHx5KSkgrP7qhypXAUu49dLiH7tTwyVgqrO/lmzJiR9O677yYvXrw46Y477jj2wAMPHOvdu/d/nEOBHccZfe8SmX3vrvFcjuSAzNnvi6zZC9iJHAmixZ8lFFoMTPMIIIBAqKEwIOb1el1HjhxJNgLiyZMn6yUlJfkCYmJi4o/GMZUrhaN895vZa2LJnc+gXWWvFJ7rSispKXG9/vrryXPmzEneuHFjvV69eh3r16/fsZtuusl3Dl177bVpq1evTljiGS26X9HGUsDcTVtFj7EviWuuuaZ41apV2/jJoJ4AoVC9mjAiBBCwmUC4obAqQ1lZWWxeXl7ysWPHGpeVlcUZATEnJycmMTGmSUaGsVLI7mP5u48rbx8bmzeCfTY0lNN9+fLlCV26dCkOPFMYymcPHToUO3369OS5c+c2Pnz4cNzdd999bM6cOY3z8vLidk15TqQ2Nd5Zbd2J9NWu70XH0X8Ubdq0Oblly5bNoYydY6MjQCiMjjO9IICAgwXWr1/foaKiItYgqLrRJFySkpKS2t9//33z8ePHN2jStJ4rk2cKhQrPMmZ7Jpx+ptDlcl0dbn1r+Jx32LBhEW9m+fbbb2sPHjy4+aJFi5KM/rzvTrZk1/HZt/Rdvxvkm57X611rkQ/NRiBAKIwAj48igAACwQjs2LEjNT8/3/erwyIJhcXFxfUOHz7c5Pjx4ymNGjXKmzRpkrdBg9iUcRkjXbJew0K/la8Bysp62VtUWOELbKqGwmXLltWbOnVqk9mzZ6f07ds3z/juC2mzJll66ziwAOl6YAihMJgfGpKOIRRKgqdbBBBwlsCPP/4Y/8MPPzSvX79+ceCVNMEKHDp0KCUvL6+JcXxKSsqRZs2a5Rn/7n+m0OvOzDCeKWT3sezd1/6VQn8oNG4fB1vfUI5bsWKFcfu4KNTbxy+//HLKjBkzfOdQenr6kVGjRvnOoQsuuOCK/fv31941/lmR2iQ5lKGEfOxXe/aJjmPHi7S0tJNbt27l9nHIgtZ/gFBovTE9IIAAAj6BvXv3uo3NI8GEwrNXBZs2bXokISHhRFVK/+5jr9u3UiiM33RHMJTpkOUZf3ql0KpT/uz3FP5SP2evCg4cOPBI165dzziHTm80eXqA6J52sZWPFIrcLTtEjz//hY0mVp0cJrRLKDQBkSYQQACBYASCCYXVrQqeq/3KlcKR7D62dItEcHdWq64UBnM+hHNMMKGwulXBc/V3+pU0d/5KZN75q3CGFPRnMhd+JrIWfsYraYIWi/6BhMLom9MjAgg4VKC6UBjMqmB1obBypTC44GLd3lL6z/JMkLZSGMyq4LnOocDLqzs0d4v1zw60NFp3yJ4svt57kJdXK/zzj1CocHEYGgII2Evg7FAYyqpg9SuFFW7fK2lkv4+F/oXHkxP1UBjKqmB1V9PpX3M37A+i+yUXWbILOXfbLtFj4tsiISGhvKioiF9zp+iPNkKhooVhWAggYD8BIxSeOnWqtjGzwA7icz0rGOzMK58pHMEzhQo8U+l/ptAb8etifqn+Rs337dsXFxMT4wrsID7Xs4LBnkPGccammJycHLcRCJcM+b0l//+i+6SZYun278Xw4cMPTJgwwfe7v/lST4BQqF5NGBECCNhUoLCwMGHPnj2pTZs2PRjYQRzJVP3PFBorhSONu8J8SRbw+G4fWxsKP/roo4RBgwZd9Pjjjx8K7CCOdNp5eXmxLVu2vKK4uDj2rb63ivRrrzA1GM748hvx0KyPfKuEu3bt+iYlJaU80jHzeWsECIXWuNIqAgggYLmAf6Wwwj0ug5VCmbuOA7u+/c8UWhsKrTqpAs8WGu2vH95PdLiwqSnBMHfHD6LH1L/7hv3222/v6NevX75Vc6DdyAUIhZEb0gICCCAgRcC3Ulivwp2ROcJ4H42lrxOh/Zp9PdnGM4V6hkLjBA7sRE6KryOW9O8jOpzve61h2F+5O/aKu2f+U+SfLGHHcdiK0f0goTC63vSGAAIImCZQeft4BLePTVMNvyH/RhN9Q6Ex8z59+qTOnz/f99t33urTU6Rf3TasX6o9Y+1W8dC8z3yYvXv3Pjpv3rzd4cvyyWgJEAqjJU0/CCCAgMkC/pXCcndG5kjjd61ZsmuUdoN39WS/on0orLpiaPx795bni4wenUT3VHdQ51fuzn0iK3etyN3l30vCxhKTL3qLmyMUWgxM8wgggIBVApUrhcNd3DuW/wZG/0YTYenuY6vOpbPbNZ4xHDRoUKqx+cT4uw7nNRZ3tbnIFw4b1q3t+2/j66uDR0XBT6dE7u4DYsHWPb7/Nr6MTSVTpkzZzTOE0aqYOf0QCs1xpBUEEEAg6gKVK4U8U6jCM4/+ZwrtEQqNk9nYlfzcc881e+ONN5oGwmFNJ7kRBh999NHDzzzzzCF2Gdekpd7fEwrVqwkjQgABBIIS8K8UlrszMnimMCgwiw/yP1Non1BYlctYOVyyZEnipk2b6hUUFMRu27Yt3vj7tLS0kw0bNiy//PLLT/To0aOIlUGLTzKLmycUWgxM8wgggIBVApUrhcPZfazA7mv/M4X2DIVWncO0q5YAoVCtejAaBBBAIGiB0yuF44Ybr+kz5b1ytBO+oyfrFW9REaEw6BOYA5UTIBQqVxIGhAACCAQn4F8pLPO9p9Dr9QqXy9iEzHdZDtnZE1kpDO7U5ShFBQiFihaGYSGAAAI1CVSuFA5zCZdL8PqY4F8fY4WXJyvHW1TkssXu45rOPf7engKEQnvWlVkhgIADBCpXCoe7eE1hUK/RszQ3Z/ueKSQUOuDSs+0UCYW2LS0TQwABuwv4VwrL3Bk8U6jEaxr9zxQSCu1+3dl5foRCO1eXuSGAgK0Fzlwp5FlCWc8SBvr1P1NIKLT1RWfzyREK1XBO4wAADfVJREFUbV5gpocAAvYVCKwUjhs3zMgllt4apf2afT1ZE1kptO/l5oiZEQodUWYmiQACdhTwrxSWujMyhru8wiuM99LwXZ5DtmcSodCOF5qD5kQodFCxmSoCCNhLoHKlcKhL9q1T+ncJ/zOFMew+ttdl5qjZEAodVW4miwACdhKoXCkc5lLgF3o4/r3X2R7j9jGh0E7XmNPmQih0WsWZLwII2EbAv1JY6uaZQvmvozGeufQ/U0gotM0F5sCJEAodWHSmjAAC9hA4c6VQ3rN0PMvof5bT/0whodAeV5czZ0EodGbdmTUCCNhAoHKlkGcKVXimkZVCG1xUDp8CodDhJwDTRwABfQX8K4Wn3OMyhhkvpBFKvMHZwePI9rzKSqG+lxMjF0IQCjkNEEAAAU0FArePx2UMcXELV/7reDy+jSax7D7W9Hpi2IRCzgEEEEBAW4HKlcKhLpUmsXTpKuF7m/ZZXw0bJIj2Hdr+4lADn73xxmvOOC4/v1Bs2LDV92dn/50qc/c/U0goVKUejCN0AVYKQzfjEwgggIASAlVDoRHBVLmBHBd3iWjZsrk4evS4KC0tFQ0bNvB51alTW2zfnvuL4+x153+LxYtXiuLiTWccl1C/rbjggvPEjz+eEI0bNxKffz5HNExqoNRrcDyEQiWuCwYRvgChMHw7PokAAghIFThzpVCVSOgVnTv1El+u+UAMHeIR8+f/W7zzt1dE+/ZtxE039RPTp70gCgqLRYsWbpGa2twXZZcuXS2MhcUrr7xM/N//rRO/u/cJUVC4QXz91RZRUFgkWrS4QAx5IlMs/Mc0kZ9fIC5r82uRnt5HPP/CUwpFYWP3sfFMISuFUi8KOo9IgFAYER8fRgABBOQJVIbCIS4VN5kMHZIp5s//WLzztxzRrdt14rNFy8VvfztYNGyYKMrLy8Xny+aI9D+MFjt27BFer1fcdntP0bv3b8Tv7n1cFBR+I1qm3iDKyivEtGnPi1tu6eYLgPn5ReLSS3qIMc8MEsOHP6zU5hpuH8u7FujZHAFCoTmOtIIAAghEXeDMUBj17mvscOiQrCqh8Fqxa+cPYv36TaJ3n9+I5EYdxbTpL4jHB48TvXr9Wgx47H5x4MBh37OIxkrh6NH9xZtvzhXr1v9DJCX5bz8bXyOGZ4uFCz8Ta9YuPOPPaxxMFA5gpTAKyHRhqQCh0FJeGkcAAQSsE6gMhU8oulIYCIUTfCuFEye+JaZMnil27dor4uPriOlv/lls2bzdF/5KS8vEmDEDxcWtLxJ9eg8U8fF1RatWLcTqLxecvkX85xf+V/zxj6+J3NxZ4upOVyp169hYqfWvFNZi97F1pzwtWyxAKLQYmOYRQAABqwT8obDEbbySRpldJlUebRw61Him0Lh9PEF0u/FaccMN94rk5CSx8B+vi8bJV4m/vP4n8fG/PxdvTHte3NVrgDh0KE9kZAwR9977hFiyZJa47bZHxAMP9BLjJzwj+t43VKxcuV589dU/RVKjBursqqky3+xs45lCQqFV5zvtWi9AKLTemB4QQAABSwTOCIWW9BB+owsWfCKeeupFcehgnujUqZ14Y9oLwridvGbNN77nCX/66ZRo27a1WLt2o2h1cQtRWFAkbr21uy8YfvbZSvHc86PEgvc/FRu+2Sruvef/ib/+db6Ij48/PaDL2l4sVqyYG/4ALfik//YxodACWpqMkgChMErQdIMAAgiYLWD8AF+zZpm7W/frXMLrFb4tvIp8zz9eIPILik6v6J3XLEXUja8rdu/a61vpyz9e6NsbY/z5wUN5om6d2uI8d1Pf3xt/bvy3MZ+fTpYIV4xLeCuM+VXeMQ4cr8p8jXEsXbrae9VVXbh9bPaJTntREyAURo2ajhBAAAHzBUaMGHG++a3SYrgCEyZM2B/uZ/kcArIFCIWyK0D/CCCAAAIIIICAAgKEQgWKwBAQQAABBBBAAAHZAoRC2RWgfwQQQAABBBBAQAEBQqECRWAICCCAAAIIIICAbAFCoewK0D8CCCCAAAIIIKCAAKFQgSIwBAQQQAABBBBAQLYAoVB2BegfAQQQQAABBBBQQIBQqEARGAICCCCAAAIIICBbgFAouwL0jwACCCCAAAIIKCBAKFSgCAwBAQQQQAABBBCQLUAolF0B+kcAAQQQQAABBBQQIBQqUASGgAACCCCAAAIIyBYgFMquAP0jgAACCCCAAAIKCBAKFSgCQ0AAAQQQQAABBGQLEAplV4D+EUAAAQQQQAABBQQIhQoUgSEggAACCCCAAAKyBQiFsitA/wgggAACCCCAgAIChEIFisAQEEAAAQQQQAAB2QKEQtkVoH8EEEAAAQQQQEABAUKhAkVgCAgggAACCCCAgGwBQqHsCtA/AggggAACCCCggAChUIEiMAQEEEAAAQQQQEC2AKFQdgXoHwEEEEAAAQQQUECAUKhAERgCAggggAACCCAgW4BQKLsC9I8AAggggAACCCggQChUoAgMAQEEEEAAAQQQkC1AKJRdAfpHAAEEEEAAAQQUECAUKlAEhoAAAggggAACCMgWIBTKrgD9I4AAAggggAACCggQChUoAkNAAAEEEEAAAQRkCxAKZVeA/hFAAAEEEEAAAQUECIUKFIEhIIAAAggggAACsgUIhbIrQP8IIIAAAggggIACAoRCBYrAEBBAAAEEEEAAAdkChELZFaB/BBBAAAEEEEBAAQFCoQJFYAgIIIAAAggggIBsAUKh7ArQPwIIIIAAAgggoIAAoVCBIjAEBBBAAAEEEEBAtgChUHYF6B8BBBBAAAEEEFBAgFCoQBEYAgIIIIAAAgggIFuAUCi7AvSPAAIIIIAAAggoIEAoVKAIDAEBBBBAAAEEEJAtQCiUXQH6RwABBBBAAAEEFBAgFCpQBIaAAAIIIIAAAgjIFiAUyq4A/SOAAAIIIIAAAgoIEAoVKAJDQAABBBBAAAEEZAsQCmVXgP4RQAABBBBAAAEFBAiFChSBISCAAAIIIIAAArIFCIWyK0D/CCCAAAIIIICAAgKEQgWKwBAQQAABBBBAAAHZAoRC2RWgfwQQQAABBBBAQAEBQqECRWAICCCAAAIIIICAbAFCoewK0D8CCCCAAAIIIKCAAKFQgSIwBAQQQAABBBBAQLYAoVB2BegfAQQQQAABBBBQQIBQqEARGAICCCCAAAIIICBbgFAouwL0jwACCCCAAAIIKCBAKFSgCAwBAQQQQAABBBCQLUAolF0B+kcAAQQQQAABBBQQIBQqUASGgAACCCCAAAIIyBYgFMquAP0jgAACCCCAAAIKCBAKFSgCQ0AAAQQQQAABBGQLEAplV4D+EUAAAQQQQAABBQQIhQoUgSEggAACCCCAAAKyBQiFsitA/wgggAACCCCAgAIChEIFisAQEEAAAQQQQAAB2QKEQtkVoH8EEEAAAQQQQEABAUKhAkVgCAgggAACCCCAgGwBQqHsCtA/AggggAACCCCggAChUIEiMAQEEEAAAQQQQEC2AKFQdgXoHwEEEEAAAQQQUECAUKhAERgCAggggAACCCAgW4BQKLsC9I8AAggggAACCCggQChUoAgMAQEEEEAAAQQQkC1AKJRdAfpHAAEEEEAAAQQUECAUKlAEhoAAAnoIrFy5Mv748eOxgdHeeuutxWaNfNu2bbV37NhRu1GjRuXXX3/9SbPapR0EEEAgWAFCYbBSHIcAAo4XGDt2bLOpU6ee5/V6xc0335w/e/bsPWagLFiwILFv376tmzRpUlpYWFirc+fORZ9++ukOM9qmDQQQQCBYAUJhsFIchwACCAghOnXqlFZRUSHWrVu37WyQwErixRdffKpx48blq1evjjdW/o4dO1YrOTm5rOoK4IcffpjYunXrkrS0tFPLli2L/+tf/9p42rRpeydPnpw8YsSI1Nzc3C2sGHLKIYBANAUIhdHUpi8EENBeoLpQaKz23X///a0TEhLKKyoqXO+88872hx9+uFVBQUGtevXqlZeUlMT07dv3yJ/+9KeDnTp1uqy4uDimtLQ0ZsCAAQdffPHFgwGYV155pfHYsWObr1mzZrMRGLUHYwIIIKCNAKFQm1IxUAQQUEGgulC4ZcuW2qtWraqXnp6eX79+/Y5TpkzZ9fbbb6cUFxfHrlq1aluXLl0ujYmJ8bZv3/7E3LlzGx8+fHhD7969Uzdt2lRv27ZtmwNza9u27WXGquLy5cu/U2G+jAEBBJwjQCh0Tq2ZKQIImCBwdijMy8uLNf6ZM2dO0rRp05rt3bu3dp06dbyTJ0/eOWvWrNOhsFu3bq2NlcGUlJTSlStXJubl5cUZw3G73af279//jfHv11133aW7du2qu2nTpk0pKSnlJgyXJhBAAIGgBQiFQVNxIAIIIPCfzxQOGjToAiMI7tmzp06jRo3KcnNztyckJHScOHHirnOFwvbt2/84b968xps3bz4d/IxQ2blz5zZut7v0iy+++BZnBBBAQIYAoVCGOn0igICWAj/vPm526tSpmKSkpDJjEvn5+bWMnchHjhyptWHDhvrG84QlJSWuFi1a/HTy5MlY49hhw4YdeO21184zNqjMmzfvu/79+7c8cOBAXN26db1paWknjdXD999/v3Ht2rW9ARjj+UNj44mWUAwaAQS0FNA2FHbu3HlE165dTXtHmJbVY9AIIBBVASPIGYHv7E6TkpLKjX92795d2/ien58fW1pa6oqLi/OFPON2cuBzzZo1K42Pj/caxxp/l5qaeso43vinaruBNqM6QTpDAAFHCyxfvjzx/wNsMV4EbHsI1wAAAABJRU5ErkJggg== - - - Lanes test - - - diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/web.xml b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/web.xml index 6a86b8e7f31..985ab949998 100644 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/web.xml +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/WEB-INF/web.xml @@ -19,90 +19,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> - - request-capture - org.uberfire.ext.security.server.SecurityIntegrationFilter - - - - request-capture - * - - - - Avoid Host Page Cache - org.uberfire.ext.security.server.CacheHeadersFilter - - - - Avoid Host Page Cache - /stunner.html - - - - Host Page Patch - org.jboss.errai.security.server.servlet.UserHostPageFilter - - - - Host Page Patch - /stunner.html - - - - GWT Locale Filter - org.uberfire.server.locale.GWTLocaleHeaderFilter - - - - GWT Locale Filter - /stunner.html - - - - UberFire Security Headers Filter - org.uberfire.ext.security.server.SecureHeadersFilter - - x-frame-options - SAMEORIGIN - - - x-xss-protection-enable - true - - - x-xss-protection-block - true - - - - - UberFire Security Headers Filter - * - - - - LoginRedirectServlet - org.uberfire.ext.security.server.LoginRedirectServlet - - display-after-login - /stunner.html - - - - - LoginRedirectServlet - /login - - - - FORM - - /login.jsp - /login.jsp?message=Login failed. Please try again. - - - ErraiServlet org.jboss.errai.bus.server.servlet.DefaultBlockingServlet @@ -125,32 +41,8 @@ admin - - - - default - /stunner.html - /org.kie.workbench.common.stunner.standalone.StunnerStandaloneShowcase/* - *.erraiBus - /plugins/* - - - admin - - - - - - - public - /org.kie.workbench.common.stunner.standalone.StunnerStandaloneShowcase/css/* - /org.kie.workbench.common.stunner.standalone.StunnerStandaloneShowcase/fonts/* - /org.kie.workbench.common.stunner.standalone.StunnerStandaloneShowcase/img/* - - - - index.jsp + index.html diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/afjs-manifest.json b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/afjs-manifest.json new file mode 100644 index 00000000000..68c3ea0ba67 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/afjs-manifest.json @@ -0,0 +1,9 @@ +{ + "name": "demo", + "editors": [ + { + "regex": "*.bpmn", + "editor": "BPMNStandaloneDiagramEditor" + } + ] +} \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/UberFireLogo.png b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/UberFireLogo.png deleted file mode 100644 index 954e542726d..00000000000 Binary files a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/UberFireLogo.png and /dev/null differ diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/bg-login-top.png b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/bg-login-top.png deleted file mode 100644 index 424979d0473..00000000000 Binary files a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/bg-login-top.png and /dev/null differ diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/bg-login.png b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/bg-login.png deleted file mode 100644 index 6e07afb724b..00000000000 Binary files a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/bg-login.png and /dev/null differ diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/default-diagram-thumbnail.png b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/default-diagram-thumbnail.png new file mode 100644 index 00000000000..d032580aef4 Binary files /dev/null and b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/default-diagram-thumbnail.png differ diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/loading-icon.gif b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/loading-icon.gif deleted file mode 100644 index 3c2f7c05883..00000000000 Binary files a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/images/loading-icon.gif and /dev/null differ diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/index.html b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/index.html new file mode 100644 index 00000000000..b285c26c0c5 --- /dev/null +++ b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/index.html @@ -0,0 +1,46 @@ + + + + + + + + BPMN Editor Showcase + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/login.jsp b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/login.jsp deleted file mode 100644 index 334ff44a9df..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/login.jsp +++ /dev/null @@ -1,177 +0,0 @@ -<%-- - ~ Copyright 2016 Red Hat, Inc. and/or its affiliates. - ~ - ~ Licensed 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. - --%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - Stunner Showcase - - - - - - -
-
- Uberfire Logo -
- -
-
- -
- <%=request.getParameter("message")%> -
-
-

- - -

-
- -

- - -

-
- -

- <% if (request.getParameter("gwt.codesvr") != null) { %> - "/> - <% } %> - -

-
-
-
- - diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/logout.jsp b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/logout.jsp deleted file mode 100644 index a046c0403de..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/logout.jsp +++ /dev/null @@ -1,50 +0,0 @@ -<%-- - ~ Copyright 2016 Red Hat, Inc. and/or its affiliates. - ~ - ~ Licensed 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. - --%> -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> -<% - request.logout(); - javax.servlet.http.HttpSession httpSession = request.getSession(false); - if (httpSession != null) { - httpSession.invalidate(); - } -%> - - - - Stunner - - - - - - -
-
- -
-
- - - \ No newline at end of file diff --git a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/stunner.html b/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/stunner.html deleted file mode 100644 index 02eaff5002f..00000000000 --- a/kie-wb-common-stunner/kie-wb-common-stunner-showcase/kie-wb-common-stunner-showcase-standalone/src/main/webapp/stunner.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - Stunner Showcase - - - - - -
-
-
-
-
-
-
-
-
-

Please wait

-
-
-
-
- Loading application... -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdown.java b/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdown.java new file mode 100644 index 00000000000..5b010df2864 --- /dev/null +++ b/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdown.java @@ -0,0 +1,80 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.widgets.client.assets.dropdown; + +import java.util.HashMap; +import java.util.Optional; + +import org.jboss.errai.ui.client.local.api.elemental2.IsElement; +import org.kie.workbench.common.widgets.client.kogito.IsKogito; + +public abstract class KogitoKieAssetsDropdown extends AbstractKieAssetsDropdown { + + protected final IsKogito isKogito; + + public KogitoKieAssetsDropdown(final KogitoKieAssetsDropdown.View view, + final IsKogito isKogito, + final KieAssetsDropdownItemsProvider dataProvider) { + super(view, dataProvider); + this.isKogito = isKogito; + } + + @Override + public void loadAssets() { + if (isKogito.get()) { + clear(); + initializeInput(); + } else { + super.loadAssets(); + } + } + + @Override + public void initialize() { + if (!isKogito.get()) { + super.initialize(); + } + } + + @Override + public void initializeDropdown() { + ((KogitoKieAssetsDropdown.View) view).enableDropdownMode(); + super.initializeDropdown(); + } + + protected void initializeInput() { + ((KogitoKieAssetsDropdown.View) view).enableInputMode(); + view.initialize(); + } + + @Override + public Optional getValue() { + if (isKogito.get()) { + return Optional.of(new KieAssetsDropdownItem("", "", view.getValue(), new HashMap<>())); + } else { + return super.getValue(); + } + } + + public interface View extends AbstractKieAssetsDropdown.View, + IsElement { + + void enableInputMode(); + + void enableDropdownMode(); + } +} diff --git a/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdownView.html b/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownView.html similarity index 100% rename from kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdownView.html rename to kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownView.html diff --git a/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownView.java b/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownView.java new file mode 100644 index 00000000000..eb4cd741f36 --- /dev/null +++ b/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownView.java @@ -0,0 +1,90 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.widgets.client.assets.dropdown; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.Dependent; +import javax.inject.Inject; + +import com.google.gwt.event.dom.client.KeyUpEvent; +import elemental2.dom.HTMLInputElement; +import elemental2.dom.HTMLOptionElement; +import elemental2.dom.HTMLSelectElement; +import org.jboss.errai.ui.client.local.spi.TranslationService; +import org.jboss.errai.ui.shared.api.annotations.DataField; +import org.jboss.errai.ui.shared.api.annotations.EventHandler; +import org.jboss.errai.ui.shared.api.annotations.Templated; +import org.uberfire.client.views.pfly.selectpicker.JQuerySelectPickerEvent; + +@Dependent +@Templated +public class KogitoKieAssetsDropdownView extends KieAssetsDropdownView implements KogitoKieAssetsDropdown.View { + + @DataField("fallback-input") + protected final HTMLInputElement fallbackInput; + + @Inject + public KogitoKieAssetsDropdownView(final HTMLSelectElement nativeSelect, + final HTMLInputElement fallbackInput, + final HTMLOptionElement htmlOptionElement, + final TranslationService translationService) { + super(nativeSelect, htmlOptionElement, translationService); + this.fallbackInput = fallbackInput; + } + + @PostConstruct + public void init() { + super.init(); + fallbackInput.hidden = true; + } + + @Override + public void initialize() { + fallbackInput.value = ""; + dropdown().selectpicker("val", ""); + } + + @Override + public String getValue() { + return fallbackInput.value; + } + + @Override + public void enableInputMode() { + nativeSelect.classList.add(HIDDEN_CSS_CLASS); + fallbackInput.classList.remove(HIDDEN_CSS_CLASS); + dropdown().selectpicker("hide"); + } + + @Override + public void enableDropdownMode() { + fallbackInput.classList.add(HIDDEN_CSS_CLASS); + nativeSelect.classList.remove(HIDDEN_CSS_CLASS); + dropdown().selectpicker("show"); + } + + @EventHandler("fallback-input") + public void onFallbackInputChange(final KeyUpEvent e) { + presenter.onValueChanged(); + } + + @Override + protected void onDropdownChangeHandlerMethod(JQuerySelectPickerEvent event) { + fallbackInput.value = event.target.value; + super.onDropdownChangeHandlerMethod(event); + } +} diff --git a/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownView.less b/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownView.less new file mode 100644 index 00000000000..bf3aec3d7ee --- /dev/null +++ b/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownView.less @@ -0,0 +1,38 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +[data-i18n-prefix="KogitoKieAssetsDropdownView."] { + + label, + .bootstrap-select, + .bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn) { + width: 100%; + margin: 0; + } + + .bootstrap-select { + .dropdown-menu { + .text { + font-weight: 600; + } + + .text-muted, + .disabled .text { + font-weight: normal; + } + } + } +} diff --git a/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdown.java b/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdown.java deleted file mode 100644 index a4681c3234a..00000000000 --- a/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdown.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.widgets.client.assets.dropdown; - -import java.util.HashMap; -import java.util.Optional; - -import org.jboss.errai.ui.client.local.api.elemental2.IsElement; -import org.kie.workbench.common.widgets.client.submarine.IsSubmarine; - -public abstract class SubmarineKieAssetsDropdown extends AbstractKieAssetsDropdown { - - protected final IsSubmarine isSubmarine; - - public SubmarineKieAssetsDropdown(final SubmarineKieAssetsDropdown.View view, - final IsSubmarine isSubmarine, - final KieAssetsDropdownItemsProvider dataProvider) { - super(view, dataProvider); - this.isSubmarine = isSubmarine; - } - - @Override - public void loadAssets() { - if (isSubmarine.get()) { - clear(); - initializeInput(); - } else { - super.loadAssets(); - } - } - - @Override - public void initialize() { - if (!isSubmarine.get()) { - super.initialize(); - } - } - - @Override - public void initializeDropdown() { - ((SubmarineKieAssetsDropdown.View) view).enableDropdownMode(); - super.initializeDropdown(); - } - - protected void initializeInput() { - ((SubmarineKieAssetsDropdown.View) view).enableInputMode(); - view.initialize(); - } - - @Override - public Optional getValue() { - if (isSubmarine.get()) { - return Optional.of(new KieAssetsDropdownItem("", "", view.getValue(), new HashMap<>())); - } else { - return super.getValue(); - } - } - - public interface View extends AbstractKieAssetsDropdown.View, - IsElement { - - void enableInputMode(); - - void enableDropdownMode(); - } -} diff --git a/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdownView.java b/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdownView.java deleted file mode 100644 index 55f8fb57812..00000000000 --- a/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdownView.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.widgets.client.assets.dropdown; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.event.dom.client.KeyUpEvent; -import elemental2.dom.HTMLInputElement; -import elemental2.dom.HTMLOptionElement; -import elemental2.dom.HTMLSelectElement; -import org.jboss.errai.ui.client.local.spi.TranslationService; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.EventHandler; -import org.jboss.errai.ui.shared.api.annotations.Templated; -import org.uberfire.client.views.pfly.selectpicker.JQuerySelectPickerEvent; - -@Dependent -@Templated -public class SubmarineKieAssetsDropdownView extends KieAssetsDropdownView implements SubmarineKieAssetsDropdown.View { - - @DataField("fallback-input") - protected final HTMLInputElement fallbackInput; - - @Inject - public SubmarineKieAssetsDropdownView(final HTMLSelectElement nativeSelect, - final HTMLInputElement fallbackInput, - final HTMLOptionElement htmlOptionElement, - final TranslationService translationService) { - super(nativeSelect, htmlOptionElement, translationService); - this.fallbackInput = fallbackInput; - } - - @PostConstruct - public void init() { - super.init(); - fallbackInput.hidden = true; - } - - @Override - public void initialize() { - fallbackInput.value = ""; - dropdown().selectpicker("val", ""); - } - - @Override - public String getValue() { - return fallbackInput.value; - } - - @Override - public void enableInputMode() { - nativeSelect.classList.add(HIDDEN_CSS_CLASS); - fallbackInput.classList.remove(HIDDEN_CSS_CLASS); - dropdown().selectpicker("hide"); - } - - @Override - public void enableDropdownMode() { - fallbackInput.classList.add(HIDDEN_CSS_CLASS); - nativeSelect.classList.remove(HIDDEN_CSS_CLASS); - dropdown().selectpicker("show"); - } - - @EventHandler("fallback-input") - public void onFallbackInputChange(final KeyUpEvent e) { - presenter.onValueChanged(); - } - - @Override - protected void onDropdownChangeHandlerMethod(JQuerySelectPickerEvent event) { - fallbackInput.value = event.target.value; - super.onDropdownChangeHandlerMethod(event); - } -} diff --git a/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdownView.less b/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdownView.less deleted file mode 100644 index a9aa9d9c13e..00000000000 --- a/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdownView.less +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -[data-i18n-prefix="SubmarineKieAssetsDropdownView."] { - - label, - .bootstrap-select, - .bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn) { - width: 100%; - margin: 0; - } - - .bootstrap-select { - .dropdown-menu { - .text { - font-weight: 600; - } - - .text-muted, - .disabled .text { - font-weight: normal; - } - } - } -} diff --git a/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/kogito/IsKogito.java b/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/kogito/IsKogito.java new file mode 100644 index 00000000000..081f649e596 --- /dev/null +++ b/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/kogito/IsKogito.java @@ -0,0 +1,29 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.widgets.client.kogito; + +import javax.enterprise.context.ApplicationScoped; + +@ApplicationScoped +public class IsKogito { + + private boolean isKogito = false; + + public boolean get() { + return isKogito; + } +} diff --git a/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/submarine/IsSubmarine.java b/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/submarine/IsSubmarine.java deleted file mode 100644 index e34bf46d191..00000000000 --- a/kie-wb-common-widgets/kie-wb-common-ui/src/main/java/org/kie/workbench/common/widgets/client/submarine/IsSubmarine.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.widgets.client.submarine; - -import javax.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class IsSubmarine { - - private boolean isSubmarine = false; - - public boolean get() { - return isSubmarine; - } -} diff --git a/kie-wb-common-widgets/kie-wb-common-ui/src/test/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownTest.java b/kie-wb-common-widgets/kie-wb-common-ui/src/test/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownTest.java new file mode 100644 index 00000000000..f54027ec9ae --- /dev/null +++ b/kie-wb-common-widgets/kie-wb-common-ui/src/test/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownTest.java @@ -0,0 +1,191 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.widgets.client.assets.dropdown; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import com.google.gwtmockito.GwtMockitoTestRunner; +import elemental2.dom.HTMLElement; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.workbench.common.widgets.client.kogito.IsKogito; +import org.mockito.Mock; +import org.uberfire.mvp.Command; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(GwtMockitoTestRunner.class) +public class KogitoKieAssetsDropdownTest extends AbstractKieAssetsDropdownTest { + + @Mock + private IsKogito isKogito; + + @Mock + private Consumer> kieAssetsConsumer; + + @Mock + private KogitoKieAssetsDropdownView viewlocalMock; + + private KieAssetsDropdown dropdownLocal; + + @Before + public void setup() { + when(isKogito.get()).thenReturn(false); + dropdownLocal = spy(new KogitoKieAssetsDropdown(viewlocalMock, isKogito, dataProviderMock) { + { + onValueChangeHandler = onValueChangeHandlerMock; + this.kieAssets.addAll(assetList); + } + }); + commonSetup(); + } + + @Test + public void testRegisterOnChangeHandler() { + final Command command = mock(Command.class); + + getDropdown().registerOnChangeHandler(command); + getDropdown().onValueChanged(); + + verify(command).execute(); + } + + @Test + public void testLoadAssetsWhenEnvIsKogito() { + + when(isKogito.get()).thenReturn(true); + + getDropdown().loadAssets(); + + verify(getDropdown()).clear(); + verify(viewlocalMock).enableInputMode(); + verify(getViewMock()).initialize(); + } + + @Test + public void testLoadAssetsWhenEnvIsNotKogito() { + + doReturn(kieAssetsConsumer).when((KogitoKieAssetsDropdown) getDropdown()).getAssetListConsumer(); + + getDropdown().loadAssets(); + + verify(getDropdown()).clear(); + verify(viewlocalMock).enableDropdownMode(); + verify(dataProviderMock).getItems(kieAssetsConsumer); + } + + @Test + public void testInitialize() { + getDropdown().initialize(); + verify(getViewMock()).refreshSelectPicker(); + } + + @Test + public void testInitializeWhenItIsNotKogito() { + when(isKogito.get()).thenReturn(true); + getDropdown().initialize(); + verify(getViewMock(), never()).refreshSelectPicker(); + } + + @Test + public void testGetElement() { + + final HTMLElement expectedElement = mock(HTMLElement.class); + when(getViewMock().getElement()).thenReturn(expectedElement); + + final HTMLElement actualElement = getDropdown().getElement(); + + assertEquals(expectedElement, actualElement); + } + + @Test + public void testGetValue() { + final List kieAssets = IntStream.range(0, 4).mapToObj(i -> { + final KieAssetsDropdownItem toReturn = mock(KieAssetsDropdownItem.class); + when(toReturn.getValue()).thenReturn("item" + i); + return toReturn; + }).collect(Collectors.toList()); + + when(getViewMock().getValue()).thenReturn("item2"); + ((KogitoKieAssetsDropdown) getDropdown()).kieAssets.clear(); + ((KogitoKieAssetsDropdown) getDropdown()).kieAssets.addAll(kieAssets); + final Optional retrieved = getDropdown().getValue(); + assertTrue(retrieved.isPresent()); + assertEquals("item2", retrieved.get().getValue()); + } + + @Test + public void testGetValueWhenOptionDoesNotExist() { + ((KogitoKieAssetsDropdown) getDropdown()).kieAssets.clear(); + assertFalse(getDropdown().getValue().isPresent()); + } + + @Test + public void testGetValueWhenItIsKogito() { + + final String expectedValue = "value"; + + when(isKogito.get()).thenReturn(true); + when(getViewMock().getValue()).thenReturn(expectedValue); + + final Optional value = getDropdown().getValue(); + + assertTrue(value.isPresent()); + assertEquals(expectedValue, value.get().getValue()); + } + + @Test + public void getAssetListConsumer() { + final List expectedDropdownItems = new ArrayList<>(); + ((KogitoKieAssetsDropdown) getDropdown()).getAssetListConsumer().accept(expectedDropdownItems); + verify(((KogitoKieAssetsDropdown) getDropdown()), times(1)).assetListConsumerMethod(eq(expectedDropdownItems)); + } + + @Test + public void assetListConsumerMethod() { + ((KogitoKieAssetsDropdown) getDropdown()).assetListConsumerMethod(assetList); + assetList.forEach(item -> verify(getViewMock()).addValue(item)); + verify(getViewMock()).refreshSelectPicker(); + verify(getViewMock()).initialize(); + } + + @Override + protected KieAssetsDropdown getDropdown() { + return dropdownLocal; + } + + @Override + protected KieAssetsDropdown.View getViewMock() { + return viewlocalMock; + } +} diff --git a/kie-wb-common-widgets/kie-wb-common-ui/src/test/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownViewTest.java b/kie-wb-common-widgets/kie-wb-common-ui/src/test/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownViewTest.java new file mode 100644 index 00000000000..d2b4fc4871e --- /dev/null +++ b/kie-wb-common-widgets/kie-wb-common-ui/src/test/java/org/kie/workbench/common/widgets/client/assets/dropdown/KogitoKieAssetsDropdownViewTest.java @@ -0,0 +1,227 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.workbench.common.widgets.client.assets.dropdown; + +import java.util.Map; + +import com.google.gwt.event.dom.client.KeyUpEvent; +import com.google.gwtmockito.GwtMockitoTestRunner; +import elemental2.dom.DOMTokenList; +import elemental2.dom.HTMLInputElement; +import elemental2.dom.HTMLOptionElement; +import elemental2.dom.HTMLSelectElement; +import org.jboss.errai.ui.client.local.spi.TranslationService; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.kie.soup.commons.util.Maps; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.uberfire.client.views.pfly.selectpicker.JQuerySelectPicker; +import org.uberfire.client.views.pfly.selectpicker.JQuerySelectPicker.CallbackFunction; +import org.uberfire.client.views.pfly.selectpicker.JQuerySelectPickerEvent; +import org.uberfire.client.views.pfly.selectpicker.JQuerySelectPickerTarget; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.kie.workbench.common.widgets.client.assets.dropdown.KogitoKieAssetsDropdownView.HIDDEN_CSS_CLASS; +import static org.kie.workbench.common.widgets.client.assets.dropdown.KogitoKieAssetsDropdownView.SELECT_PICKER_SUBTEXT_ATTRIBUTE; +import static org.kie.workbench.common.widgets.client.resources.i18n.KieWorkbenchWidgetsConstants.KieAssetsDropdownView_Select; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(GwtMockitoTestRunner.class) +public class KogitoKieAssetsDropdownViewTest { + + @Mock + private HTMLSelectElement nativeSelect; + + @Mock + private HTMLInputElement fallbackInput; + + @Mock + private HTMLOptionElement htmlOptionElement; + + @Mock + private KogitoKieAssetsDropdown presenter; + + @Mock + private JQuerySelectPicker dropdown; + + @Mock + private TranslationService translationService; + + private KogitoKieAssetsDropdownView view; + + @Before + public void setup() { + + view = Mockito.spy(new KogitoKieAssetsDropdownView(nativeSelect, fallbackInput, htmlOptionElement, translationService)); + view.init(presenter); + + doReturn(dropdown).when(view).dropdown(); + } + + @Test + public void testInit() { + + final CallbackFunction callbackFunction = mock(CallbackFunction.class); + doReturn(callbackFunction).when(view).getOnDropdownChangeHandler(); + + view.init(); + + assertFalse(nativeSelect.hidden); + assertTrue(fallbackInput.hidden); + verify(dropdown).on("hidden.bs.select", callbackFunction); + } + + @Test + public void testGetOnDropdownChangeHandler() { + + final JQuerySelectPickerEvent event = mock(JQuerySelectPickerEvent.class); + final JQuerySelectPickerTarget target = mock(JQuerySelectPickerTarget.class); + final String expectedValue = "newValue"; + + fallbackInput.value = "something"; + event.target = target; + target.value = expectedValue; + + view.getOnDropdownChangeHandler().call(event); + + final String actualValue = event.target.value; + + assertEquals(expectedValue, actualValue); + verify(presenter).onValueChanged(); + } + + @Test + public void testAddValue() { + + final HTMLOptionElement optionElement = mock(HTMLOptionElement.class); + final KieAssetsDropdownItem entry = new KieAssetsDropdownItem("text", "subtext", "value", getMetaData()); + + doReturn(optionElement).when(view).makeHTMLOptionElement(); + + view.addValue(entry); + + assertEquals("text", optionElement.text); + assertEquals("value", optionElement.value); + verify(optionElement).setAttribute(SELECT_PICKER_SUBTEXT_ATTRIBUTE, "subtext"); + verify(nativeSelect).appendChild(optionElement); + } + + @Test + public void testClear() { + + final HTMLOptionElement oldOptionElement = mock(HTMLOptionElement.class); + final HTMLOptionElement newOptionElement = mock(HTMLOptionElement.class); + nativeSelect.firstChild = oldOptionElement; + + doReturn(newOptionElement).when(view).selectOption(); + when(nativeSelect.removeChild(oldOptionElement)).then(a -> { + nativeSelect.firstChild = null; + return oldOptionElement; + }); + + view.clear(); + + verify(nativeSelect).removeChild(oldOptionElement); + verify(nativeSelect).appendChild(newOptionElement); + verify(view).refreshSelectPicker(); + } + + @Test + public void testSelectOption() { + + final String select = "Select"; + + doReturn(mock(HTMLOptionElement.class)).when(view).makeHTMLOptionElement(); + when(translationService.format(KieAssetsDropdownView_Select)).thenReturn(select); + + final HTMLOptionElement optionElement = view.selectOption(); + + assertEquals(select, optionElement.text); + assertEquals("", optionElement.value); + } + + @Test + public void testInitialize() { + + fallbackInput.value = "something"; + + view.initialize(); + + assertEquals("", fallbackInput.value); + verify(dropdown).selectpicker("val", ""); + } + + @Test + public void testRefreshSelectPicker() { + view.refreshSelectPicker(); + verify(dropdown).selectpicker("refresh"); + } + + @Test + public void testGetValue() { + + final String expected = "value"; + fallbackInput.value = expected; + + final String actual = view.getValue(); + + assertEquals(expected, actual); + } + + @Test + public void testEnableInputMode() { + + nativeSelect.classList = mock(DOMTokenList.class); + fallbackInput.classList = mock(DOMTokenList.class); + + view.enableInputMode(); + + verify(nativeSelect.classList).add(HIDDEN_CSS_CLASS); + verify(fallbackInput.classList).remove(HIDDEN_CSS_CLASS); + verify(dropdown).selectpicker("hide"); + } + + @Test + public void testEnableDropdownMode() { + + nativeSelect.classList = mock(DOMTokenList.class); + fallbackInput.classList = mock(DOMTokenList.class); + + view.enableDropdownMode(); + + verify(fallbackInput.classList).add(HIDDEN_CSS_CLASS); + verify(nativeSelect.classList).remove(HIDDEN_CSS_CLASS); + verify(dropdown).selectpicker("show"); + } + + @Test + public void testOnFallbackInputChange() { + view.onFallbackInputChange(mock(KeyUpEvent.class)); + verify(presenter).onValueChanged(); + } + + private Map getMetaData() { + return new Maps.Builder().put("foo", "bar").build(); + } +} diff --git a/kie-wb-common-widgets/kie-wb-common-ui/src/test/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdownTest.java b/kie-wb-common-widgets/kie-wb-common-ui/src/test/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdownTest.java deleted file mode 100644 index 683b018384d..00000000000 --- a/kie-wb-common-widgets/kie-wb-common-ui/src/test/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineKieAssetsDropdownTest.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.widgets.client.assets.dropdown; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.IntStream; - -import com.google.gwtmockito.GwtMockitoTestRunner; -import elemental2.dom.HTMLElement; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.workbench.common.widgets.client.submarine.IsSubmarine; -import org.mockito.Mock; -import org.uberfire.mvp.Command; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class SubmarineKieAssetsDropdownTest extends AbstractKieAssetsDropdownTest { - - @Mock - private IsSubmarine isSubmarine; - - @Mock - private Consumer> kieAssetsConsumer; - - @Mock - private SubmarineKieAssetsDropdownView viewlocalMock; - - private KieAssetsDropdown dropdownLocal; - - @Before - public void setup() { - when(isSubmarine.get()).thenReturn(false); - dropdownLocal = spy(new SubmarineKieAssetsDropdown(viewlocalMock, isSubmarine, dataProviderMock) { - { - onValueChangeHandler = onValueChangeHandlerMock; - this.kieAssets.addAll(assetList); - } - }); - commonSetup(); - } - - @Test - public void testRegisterOnChangeHandler() { - final Command command = mock(Command.class); - - getDropdown().registerOnChangeHandler(command); - getDropdown().onValueChanged(); - - verify(command).execute(); - } - - @Test - public void testLoadAssetsWhenEnvIsSubmarine() { - - when(isSubmarine.get()).thenReturn(true); - - getDropdown().loadAssets(); - - verify(getDropdown()).clear(); - verify(viewlocalMock).enableInputMode(); - verify(getViewMock()).initialize(); - } - - @Test - public void testLoadAssetsWhenEnvIsNotSubmarine() { - - doReturn(kieAssetsConsumer).when((SubmarineKieAssetsDropdown) getDropdown()).getAssetListConsumer(); - - getDropdown().loadAssets(); - - verify(getDropdown()).clear(); - verify(viewlocalMock).enableDropdownMode(); - verify(dataProviderMock).getItems(kieAssetsConsumer); - } - - @Test - public void testInitialize() { - getDropdown().initialize(); - verify(getViewMock()).refreshSelectPicker(); - } - - @Test - public void testInitializeWhenItIsNotSubmarine() { - when(isSubmarine.get()).thenReturn(true); - getDropdown().initialize(); - verify(getViewMock(), never()).refreshSelectPicker(); - } - - @Test - public void testGetElement() { - - final HTMLElement expectedElement = mock(HTMLElement.class); - when(getViewMock().getElement()).thenReturn(expectedElement); - - final HTMLElement actualElement = getDropdown().getElement(); - - assertEquals(expectedElement, actualElement); - } - - @Test - public void testGetValue() { - final List kieAssets = IntStream.range(0, 4).mapToObj(i -> { - final KieAssetsDropdownItem toReturn = mock(KieAssetsDropdownItem.class); - when(toReturn.getValue()).thenReturn("item" + i); - return toReturn; - }).collect(Collectors.toList()); - - when(getViewMock().getValue()).thenReturn("item2"); - ((SubmarineKieAssetsDropdown) getDropdown()).kieAssets.clear(); - ((SubmarineKieAssetsDropdown) getDropdown()).kieAssets.addAll(kieAssets); - final Optional retrieved = getDropdown().getValue(); - assertTrue(retrieved.isPresent()); - assertEquals("item2", retrieved.get().getValue()); - } - - @Test - public void testGetValueWhenOptionDoesNotExist() { - ((SubmarineKieAssetsDropdown) getDropdown()).kieAssets.clear(); - assertFalse(getDropdown().getValue().isPresent()); - } - - @Test - public void testGetValueWhenItIsSubmarine() { - - final String expectedValue = "value"; - - when(isSubmarine.get()).thenReturn(true); - when(getViewMock().getValue()).thenReturn(expectedValue); - - final Optional value = getDropdown().getValue(); - - assertTrue(value.isPresent()); - assertEquals(expectedValue, value.get().getValue()); - } - - @Test - public void getAssetListConsumer() { - final List expectedDropdownItems = new ArrayList<>(); - ((SubmarineKieAssetsDropdown) getDropdown()).getAssetListConsumer().accept(expectedDropdownItems); - verify(((SubmarineKieAssetsDropdown) getDropdown()), times(1)).assetListConsumerMethod(eq(expectedDropdownItems)); - } - - @Test - public void assetListConsumerMethod() { - ((SubmarineKieAssetsDropdown) getDropdown()).assetListConsumerMethod(assetList); - assetList.forEach(item -> verify(getViewMock()).addValue(item)); - verify(getViewMock()).refreshSelectPicker(); - verify(getViewMock()).initialize(); - } - - @Override - protected KieAssetsDropdown getDropdown() { - return dropdownLocal; - } - - @Override - protected KieAssetsDropdown.View getViewMock() { - return viewlocalMock; - } -} diff --git a/kie-wb-common-widgets/kie-wb-common-ui/src/test/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineSubmarineKieAssetsDropdownViewTest.java b/kie-wb-common-widgets/kie-wb-common-ui/src/test/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineSubmarineKieAssetsDropdownViewTest.java deleted file mode 100644 index a77b2e49fa9..00000000000 --- a/kie-wb-common-widgets/kie-wb-common-ui/src/test/java/org/kie/workbench/common/widgets/client/assets/dropdown/SubmarineSubmarineKieAssetsDropdownViewTest.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed 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. - */ - -package org.kie.workbench.common.widgets.client.assets.dropdown; - -import java.util.Map; - -import com.google.gwt.event.dom.client.KeyUpEvent; -import com.google.gwtmockito.GwtMockitoTestRunner; -import elemental2.dom.DOMTokenList; -import elemental2.dom.HTMLInputElement; -import elemental2.dom.HTMLOptionElement; -import elemental2.dom.HTMLSelectElement; -import org.jboss.errai.ui.client.local.spi.TranslationService; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.kie.soup.commons.util.Maps; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.uberfire.client.views.pfly.selectpicker.JQuerySelectPicker; -import org.uberfire.client.views.pfly.selectpicker.JQuerySelectPicker.CallbackFunction; -import org.uberfire.client.views.pfly.selectpicker.JQuerySelectPickerEvent; -import org.uberfire.client.views.pfly.selectpicker.JQuerySelectPickerTarget; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.kie.workbench.common.widgets.client.assets.dropdown.SubmarineKieAssetsDropdownView.HIDDEN_CSS_CLASS; -import static org.kie.workbench.common.widgets.client.assets.dropdown.SubmarineKieAssetsDropdownView.SELECT_PICKER_SUBTEXT_ATTRIBUTE; -import static org.kie.workbench.common.widgets.client.resources.i18n.KieWorkbenchWidgetsConstants.KieAssetsDropdownView_Select; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class SubmarineSubmarineKieAssetsDropdownViewTest { - - @Mock - private HTMLSelectElement nativeSelect; - - @Mock - private HTMLInputElement fallbackInput; - - @Mock - private HTMLOptionElement htmlOptionElement; - - @Mock - private SubmarineKieAssetsDropdown presenter; - - @Mock - private JQuerySelectPicker dropdown; - - @Mock - private TranslationService translationService; - - private SubmarineKieAssetsDropdownView view; - - @Before - public void setup() { - - view = Mockito.spy(new SubmarineKieAssetsDropdownView(nativeSelect, fallbackInput, htmlOptionElement, translationService)); - view.init(presenter); - - doReturn(dropdown).when(view).dropdown(); - } - - @Test - public void testInit() { - - final CallbackFunction callbackFunction = mock(CallbackFunction.class); - doReturn(callbackFunction).when(view).getOnDropdownChangeHandler(); - - view.init(); - - assertFalse(nativeSelect.hidden); - assertTrue(fallbackInput.hidden); - verify(dropdown).on("hidden.bs.select", callbackFunction); - } - - @Test - public void testGetOnDropdownChangeHandler() { - - final JQuerySelectPickerEvent event = mock(JQuerySelectPickerEvent.class); - final JQuerySelectPickerTarget target = mock(JQuerySelectPickerTarget.class); - final String expectedValue = "newValue"; - - fallbackInput.value = "something"; - event.target = target; - target.value = expectedValue; - - view.getOnDropdownChangeHandler().call(event); - - final String actualValue = event.target.value; - - assertEquals(expectedValue, actualValue); - verify(presenter).onValueChanged(); - } - - @Test - public void testAddValue() { - - final HTMLOptionElement optionElement = mock(HTMLOptionElement.class); - final KieAssetsDropdownItem entry = new KieAssetsDropdownItem("text", "subtext", "value", getMetaData()); - - doReturn(optionElement).when(view).makeHTMLOptionElement(); - - view.addValue(entry); - - assertEquals("text", optionElement.text); - assertEquals("value", optionElement.value); - verify(optionElement).setAttribute(SELECT_PICKER_SUBTEXT_ATTRIBUTE, "subtext"); - verify(nativeSelect).appendChild(optionElement); - } - - @Test - public void testClear() { - - final HTMLOptionElement oldOptionElement = mock(HTMLOptionElement.class); - final HTMLOptionElement newOptionElement = mock(HTMLOptionElement.class); - nativeSelect.firstChild = oldOptionElement; - - doReturn(newOptionElement).when(view).selectOption(); - when(nativeSelect.removeChild(oldOptionElement)).then(a -> { - nativeSelect.firstChild = null; - return oldOptionElement; - }); - - view.clear(); - - verify(nativeSelect).removeChild(oldOptionElement); - verify(nativeSelect).appendChild(newOptionElement); - verify(view).refreshSelectPicker(); - } - - @Test - public void testSelectOption() { - - final String select = "Select"; - - doReturn(mock(HTMLOptionElement.class)).when(view).makeHTMLOptionElement(); - when(translationService.format(KieAssetsDropdownView_Select)).thenReturn(select); - - final HTMLOptionElement optionElement = view.selectOption(); - - assertEquals(select, optionElement.text); - assertEquals("", optionElement.value); - } - - @Test - public void testInitialize() { - - fallbackInput.value = "something"; - - view.initialize(); - - assertEquals("", fallbackInput.value); - verify(dropdown).selectpicker("val", ""); - } - - @Test - public void testRefreshSelectPicker() { - view.refreshSelectPicker(); - verify(dropdown).selectpicker("refresh"); - } - - @Test - public void testGetValue() { - - final String expected = "value"; - fallbackInput.value = expected; - - final String actual = view.getValue(); - - assertEquals(expected, actual); - } - - @Test - public void testEnableInputMode() { - - nativeSelect.classList = mock(DOMTokenList.class); - fallbackInput.classList = mock(DOMTokenList.class); - - view.enableInputMode(); - - verify(nativeSelect.classList).add(HIDDEN_CSS_CLASS); - verify(fallbackInput.classList).remove(HIDDEN_CSS_CLASS); - verify(dropdown).selectpicker("hide"); - } - - @Test - public void testEnableDropdownMode() { - - nativeSelect.classList = mock(DOMTokenList.class); - fallbackInput.classList = mock(DOMTokenList.class); - - view.enableDropdownMode(); - - verify(fallbackInput.classList).add(HIDDEN_CSS_CLASS); - verify(nativeSelect.classList).remove(HIDDEN_CSS_CLASS); - verify(dropdown).selectpicker("show"); - } - - @Test - public void testOnFallbackInputChange() { - view.onFallbackInputChange(mock(KeyUpEvent.class)); - verify(presenter).onValueChanged(); - } - - private Map getMetaData() { - return new Maps.Builder().put("foo", "bar").build(); - } -} diff --git a/pom.xml b/pom.xml index 479638edfb1..abcac176a42 100644 --- a/pom.xml +++ b/pom.xml @@ -29,6 +29,7 @@ kie-wb-common-cli kie-wb-common-dev kie-wb-common-command-api + kie-wb-common-kogito